diff options
209 files changed, 11023 insertions, 10257 deletions
diff --git a/.cargo/config b/.cargo/config index 92a3acfd0..9f9b24a49 100644 --- a/.cargo/config +++ b/.cargo/config | |||
@@ -5,6 +5,8 @@ gen-syntax = "run --package ra_tools --bin ra_tools -- gen-syntax" | |||
5 | # Extracts the tests from | 5 | # Extracts the tests from |
6 | gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" | 6 | gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" |
7 | 7 | ||
8 | build-website = "run --package website-gen" | ||
9 | |||
8 | # Installs the visual studio code extension | 10 | # Installs the visual studio code extension |
9 | install-ra = "run --package ra_tools --bin ra_tools -- install-ra" | 11 | install-ra = "run --package ra_tools --bin ra_tools -- install-ra" |
10 | install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias | 12 | install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias |
diff --git a/.travis.yml b/.travis.yml index 52af05375..c198cc5f7 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -28,7 +28,7 @@ matrix: | |||
28 | language: rust | 28 | language: rust |
29 | rust: stable | 29 | rust: stable |
30 | script: | 30 | script: |
31 | - cargo doc --all --no-deps | 31 | - cargo build-website |
32 | env: | 32 | env: |
33 | - RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0 | 33 | - RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0 |
34 | 34 | ||
@@ -59,7 +59,7 @@ deploy: | |||
59 | skip-cleanup: true | 59 | skip-cleanup: true |
60 | github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable | 60 | github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable |
61 | keep-history: true | 61 | keep-history: true |
62 | local-dir: target/doc | 62 | local-dir: target/website/ |
63 | on: | 63 | on: |
64 | branch: master | 64 | branch: master |
65 | condition: $DEPLOY_DOCS = 1 | 65 | condition: $DEPLOY_DOCS = 1 |
diff --git a/Cargo.lock b/Cargo.lock index 9c630f370..27e0a82af 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -122,7 +122,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
122 | [[package]] | 122 | [[package]] |
123 | name = "chalk-engine" | 123 | name = "chalk-engine" |
124 | version = "0.9.0" | 124 | version = "0.9.0" |
125 | source = "git+https://github.com/rust-lang/chalk.git#c9314e425e49969c33cabcb8fac7da6eac3c5073" | 125 | source = "git+https://github.com/rust-lang/chalk.git#5c6cea8bc02c8bc282223aa12528648b5cd0b6e4" |
126 | dependencies = [ | 126 | dependencies = [ |
127 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", | 127 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", |
128 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | 128 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -132,7 +132,7 @@ dependencies = [ | |||
132 | [[package]] | 132 | [[package]] |
133 | name = "chalk-ir" | 133 | name = "chalk-ir" |
134 | version = "0.1.0" | 134 | version = "0.1.0" |
135 | source = "git+https://github.com/rust-lang/chalk.git#c9314e425e49969c33cabcb8fac7da6eac3c5073" | 135 | source = "git+https://github.com/rust-lang/chalk.git#5c6cea8bc02c8bc282223aa12528648b5cd0b6e4" |
136 | dependencies = [ | 136 | dependencies = [ |
137 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", | 137 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", |
138 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", | 138 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", |
@@ -142,7 +142,7 @@ dependencies = [ | |||
142 | [[package]] | 142 | [[package]] |
143 | name = "chalk-macros" | 143 | name = "chalk-macros" |
144 | version = "0.1.1" | 144 | version = "0.1.1" |
145 | source = "git+https://github.com/rust-lang/chalk.git#c9314e425e49969c33cabcb8fac7da6eac3c5073" | 145 | source = "git+https://github.com/rust-lang/chalk.git#5c6cea8bc02c8bc282223aa12528648b5cd0b6e4" |
146 | dependencies = [ | 146 | dependencies = [ |
147 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | 147 | "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
148 | ] | 148 | ] |
@@ -150,7 +150,7 @@ dependencies = [ | |||
150 | [[package]] | 150 | [[package]] |
151 | name = "chalk-rust-ir" | 151 | name = "chalk-rust-ir" |
152 | version = "0.1.0" | 152 | version = "0.1.0" |
153 | source = "git+https://github.com/rust-lang/chalk.git#c9314e425e49969c33cabcb8fac7da6eac3c5073" | 153 | source = "git+https://github.com/rust-lang/chalk.git#5c6cea8bc02c8bc282223aa12528648b5cd0b6e4" |
154 | dependencies = [ | 154 | dependencies = [ |
155 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", | 155 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", |
156 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 156 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", |
@@ -160,7 +160,7 @@ dependencies = [ | |||
160 | [[package]] | 160 | [[package]] |
161 | name = "chalk-solve" | 161 | name = "chalk-solve" |
162 | version = "0.1.0" | 162 | version = "0.1.0" |
163 | source = "git+https://github.com/rust-lang/chalk.git#c9314e425e49969c33cabcb8fac7da6eac3c5073" | 163 | source = "git+https://github.com/rust-lang/chalk.git#5c6cea8bc02c8bc282223aa12528648b5cd0b6e4" |
164 | dependencies = [ | 164 | dependencies = [ |
165 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", | 165 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", |
166 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 166 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", |
@@ -665,7 +665,7 @@ dependencies = [ | |||
665 | 665 | ||
666 | [[package]] | 666 | [[package]] |
667 | name = "lsp-types" | 667 | name = "lsp-types" |
668 | version = "0.60.0" | 668 | version = "0.61.0" |
669 | source = "registry+https://github.com/rust-lang/crates.io-index" | 669 | source = "registry+https://github.com/rust-lang/crates.io-index" |
670 | dependencies = [ | 670 | dependencies = [ |
671 | "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 671 | "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -800,11 +800,8 @@ dependencies = [ | |||
800 | 800 | ||
801 | [[package]] | 801 | [[package]] |
802 | name = "once_cell" | 802 | name = "once_cell" |
803 | version = "0.2.7" | 803 | version = "1.0.1" |
804 | source = "registry+https://github.com/rust-lang/crates.io-index" | 804 | source = "registry+https://github.com/rust-lang/crates.io-index" |
805 | dependencies = [ | ||
806 | "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
807 | ] | ||
808 | 805 | ||
809 | [[package]] | 806 | [[package]] |
810 | name = "ordermap" | 807 | name = "ordermap" |
@@ -950,7 +947,7 @@ dependencies = [ | |||
950 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | 947 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
951 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | 948 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
952 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | 949 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", |
953 | "once_cell 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", | 950 | "once_cell 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
954 | "ra_db 0.1.0", | 951 | "ra_db 0.1.0", |
955 | "ra_fmt 0.1.0", | 952 | "ra_fmt 0.1.0", |
956 | "ra_hir 0.1.0", | 953 | "ra_hir 0.1.0", |
@@ -1020,7 +1017,7 @@ dependencies = [ | |||
1020 | "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1017 | "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1021 | "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1018 | "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1022 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1019 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1023 | "once_cell 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1020 | "once_cell 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1024 | "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1021 | "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1025 | "ra_arena 0.1.0", | 1022 | "ra_arena 0.1.0", |
1026 | "ra_db 0.1.0", | 1023 | "ra_db 0.1.0", |
@@ -1069,7 +1066,7 @@ dependencies = [ | |||
1069 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1066 | "jod-thread 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1070 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1067 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1071 | "lsp-server 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1068 | "lsp-server 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1072 | "lsp-types 0.60.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1069 | "lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1073 | "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1070 | "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1074 | "ra_ide_api 0.1.0", | 1071 | "ra_ide_api 0.1.0", |
1075 | "ra_prof 0.1.0", | 1072 | "ra_prof 0.1.0", |
@@ -1115,7 +1112,7 @@ dependencies = [ | |||
1115 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1112 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1116 | "jemalloc-ctl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | 1113 | "jemalloc-ctl 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
1117 | "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | 1114 | "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", |
1118 | "once_cell 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", | 1115 | "once_cell 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1119 | ] | 1116 | ] |
1120 | 1117 | ||
1121 | [[package]] | 1118 | [[package]] |
@@ -1780,6 +1777,13 @@ version = "0.5.0" | |||
1780 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1777 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1781 | 1778 | ||
1782 | [[package]] | 1779 | [[package]] |
1780 | name = "website-gen" | ||
1781 | version = "0.0.0" | ||
1782 | dependencies = [ | ||
1783 | "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1784 | ] | ||
1785 | |||
1786 | [[package]] | ||
1783 | name = "winapi" | 1787 | name = "winapi" |
1784 | version = "0.2.8" | 1788 | version = "0.2.8" |
1785 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1789 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1920,7 +1924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1920 | "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" | 1924 | "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" |
1921 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" | 1925 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" |
1922 | "checksum lsp-server 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "148cfb1c0b3295c23d9fb4a20fd1b242f5e6f46c525fdcc7f5c0a65710362012" | 1926 | "checksum lsp-server 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "148cfb1c0b3295c23d9fb4a20fd1b242f5e6f46c525fdcc7f5c0a65710362012" |
1923 | "checksum lsp-types 0.60.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3edefcd66dde1f7f1df706f46520a3c93adc5ca4bc5747da6621195e894efd" | 1927 | "checksum lsp-types 0.61.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa3268fbe8beb2795c2fb327bf44f4f3d24f5fe9ebc18d7e2980afd444d72bcf" |
1924 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" | 1928 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" |
1925 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" | 1929 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" |
1926 | "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" | 1930 | "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" |
@@ -1934,7 +1938,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
1934 | "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" | 1938 | "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" |
1935 | "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" | 1939 | "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" |
1936 | "checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" | 1940 | "checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" |
1937 | "checksum once_cell 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d1a13503127ae8c93c0e2c817d74895b0af4df9132ec9be3ea42dd1656cd6e9" | 1941 | "checksum once_cell 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c9192c5a4c3b5488dae8d3886ef9df6b5eb246d36323dc7a5078595a154e7771" |
1938 | "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" | 1942 | "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" |
1939 | "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" | 1943 | "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" |
1940 | "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" | 1944 | "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" |
diff --git a/Cargo.toml b/Cargo.toml index e44c9570f..317c63795 100644 --- a/Cargo.toml +++ b/Cargo.toml | |||
@@ -1,5 +1,5 @@ | |||
1 | [workspace] | 1 | [workspace] |
2 | members = [ "crates/*" ] | 2 | members = [ "crates/*", "website/website-gen" ] |
3 | 3 | ||
4 | [profile.release] | 4 | [profile.release] |
5 | incremental = true | 5 | incremental = true |
@@ -55,7 +55,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0 | |||
55 | ## Quick Links | 55 | ## Quick Links |
56 | 56 | ||
57 | * Work List: https://paper.dropbox.com/doc/RLS-2.0-work-list--AZ3BgHKKCtqszbsi3gi6sjchAQ-42vbnxzuKq2lKwW0mkn8Y | 57 | * Work List: https://paper.dropbox.com/doc/RLS-2.0-work-list--AZ3BgHKKCtqszbsi3gi6sjchAQ-42vbnxzuKq2lKwW0mkn8Y |
58 | * API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/index.html | 58 | * API docs: https://rust-analyzer.github.io/rust-analyzer/api-docs/ra_ide_api/ |
59 | * CI: https://travis-ci.org/rust-analyzer/rust-analyzer | 59 | * CI: https://travis-ci.org/rust-analyzer/rust-analyzer |
60 | 60 | ||
61 | ## License | 61 | ## License |
diff --git a/crates/ra_assists/Cargo.toml b/crates/ra_assists/Cargo.toml index 2113286a3..635d87611 100644 --- a/crates/ra_assists/Cargo.toml +++ b/crates/ra_assists/Cargo.toml | |||
@@ -6,7 +6,7 @@ authors = ["rust-analyzer developers"] | |||
6 | 6 | ||
7 | [dependencies] | 7 | [dependencies] |
8 | format-buf = "1.0.0" | 8 | format-buf = "1.0.0" |
9 | once_cell = "0.2.0" | 9 | once_cell = "1.0.1" |
10 | join_to_string = "0.1.3" | 10 | join_to_string = "0.1.3" |
11 | itertools = "0.8.0" | 11 | itertools = "0.8.0" |
12 | arrayvec = "0.4.10" | 12 | arrayvec = "0.4.10" |
diff --git a/crates/ra_assists/src/ast_editor.rs b/crates/ra_assists/src/ast_editor.rs index 6815638dc..048478662 100644 --- a/crates/ra_assists/src/ast_editor.rs +++ b/crates/ra_assists/src/ast_editor.rs | |||
@@ -274,7 +274,7 @@ impl AstBuilder<ast::Block> { | |||
274 | 274 | ||
275 | impl AstBuilder<ast::Expr> { | 275 | impl AstBuilder<ast::Expr> { |
276 | fn from_text(text: &str) -> ast::Expr { | 276 | fn from_text(text: &str) -> ast::Expr { |
277 | ast_node_from_file_text(&format!("fn f() {{ {}; }}", text)) | 277 | ast_node_from_file_text(&format!("const C: () = {};", text)) |
278 | } | 278 | } |
279 | 279 | ||
280 | pub fn unit() -> ast::Expr { | 280 | pub fn unit() -> ast::Expr { |
diff --git a/crates/ra_assists/src/introduce_variable.rs b/crates/ra_assists/src/introduce_variable.rs index 95c18d0e3..470ffe120 100644 --- a/crates/ra_assists/src/introduce_variable.rs +++ b/crates/ra_assists/src/introduce_variable.rs | |||
@@ -3,7 +3,8 @@ use hir::db::HirDatabase; | |||
3 | use ra_syntax::{ | 3 | use ra_syntax::{ |
4 | ast::{self, AstNode}, | 4 | ast::{self, AstNode}, |
5 | SyntaxKind::{ | 5 | SyntaxKind::{ |
6 | BREAK_EXPR, COMMENT, LAMBDA_EXPR, LOOP_EXPR, MATCH_ARM, PATH_EXPR, RETURN_EXPR, WHITESPACE, | 6 | BLOCK_EXPR, BREAK_EXPR, COMMENT, LAMBDA_EXPR, LOOP_EXPR, MATCH_ARM, PATH_EXPR, RETURN_EXPR, |
7 | WHITESPACE, | ||
7 | }, | 8 | }, |
8 | SyntaxNode, TextUnit, | 9 | SyntaxNode, TextUnit, |
9 | }; | 10 | }; |
@@ -80,10 +81,12 @@ pub(crate) fn introduce_variable(mut ctx: AssistCtx<impl HirDatabase>) -> Option | |||
80 | /// In general that's true for any expression, but in some cases that would produce invalid code. | 81 | /// In general that's true for any expression, but in some cases that would produce invalid code. |
81 | fn valid_target_expr(node: SyntaxNode) -> Option<ast::Expr> { | 82 | fn valid_target_expr(node: SyntaxNode) -> Option<ast::Expr> { |
82 | match node.kind() { | 83 | match node.kind() { |
83 | PATH_EXPR => None, | 84 | PATH_EXPR | LOOP_EXPR => None, |
84 | BREAK_EXPR => ast::BreakExpr::cast(node).and_then(|e| e.expr()), | 85 | BREAK_EXPR => ast::BreakExpr::cast(node).and_then(|e| e.expr()), |
85 | RETURN_EXPR => ast::ReturnExpr::cast(node).and_then(|e| e.expr()), | 86 | RETURN_EXPR => ast::ReturnExpr::cast(node).and_then(|e| e.expr()), |
86 | LOOP_EXPR => ast::ReturnExpr::cast(node).and_then(|e| e.expr()), | 87 | BLOCK_EXPR => { |
88 | ast::BlockExpr::cast(node).filter(|it| it.is_standalone()).map(ast::Expr::from) | ||
89 | } | ||
87 | _ => ast::Expr::cast(node), | 90 | _ => ast::Expr::cast(node), |
88 | } | 91 | } |
89 | } | 92 | } |
diff --git a/crates/ra_assists/src/move_guard.rs b/crates/ra_assists/src/move_guard.rs index 127c9e068..699221e33 100644 --- a/crates/ra_assists/src/move_guard.rs +++ b/crates/ra_assists/src/move_guard.rs | |||
@@ -65,9 +65,9 @@ pub(crate) fn move_arm_cond_to_match_guard(mut ctx: AssistCtx<impl HirDatabase>) | |||
65 | "move condition to match guard", | 65 | "move condition to match guard", |
66 | |edit| { | 66 | |edit| { |
67 | edit.target(if_expr.syntax().text_range()); | 67 | edit.target(if_expr.syntax().text_range()); |
68 | let then_only_expr = then_block.statements().next().is_none(); | 68 | let then_only_expr = then_block.block().and_then(|it| it.statements().next()).is_none(); |
69 | 69 | ||
70 | match &then_block.expr() { | 70 | match &then_block.block().and_then(|it| it.expr()) { |
71 | Some(then_expr) if then_only_expr => { | 71 | Some(then_expr) if then_only_expr => { |
72 | edit.replace(if_expr.syntax().text_range(), then_expr.syntax().text()) | 72 | edit.replace(if_expr.syntax().text_range(), then_expr.syntax().text()) |
73 | } | 73 | } |
diff --git a/crates/ra_assists/src/replace_if_let_with_match.rs b/crates/ra_assists/src/replace_if_let_with_match.rs index c0bf6d235..401835c57 100644 --- a/crates/ra_assists/src/replace_if_let_with_match.rs +++ b/crates/ra_assists/src/replace_if_let_with_match.rs | |||
@@ -1,3 +1,4 @@ | |||
1 | use format_buf::format; | ||
1 | use hir::db::HirDatabase; | 2 | use hir::db::HirDatabase; |
2 | use ra_fmt::extract_trivial_expression; | 3 | use ra_fmt::extract_trivial_expression; |
3 | use ra_syntax::{ast, AstNode}; | 4 | use ra_syntax::{ast, AstNode}; |
@@ -25,16 +26,21 @@ pub(crate) fn replace_if_let_with_match(mut ctx: AssistCtx<impl HirDatabase>) -> | |||
25 | ctx.build() | 26 | ctx.build() |
26 | } | 27 | } |
27 | 28 | ||
28 | fn build_match_expr(expr: ast::Expr, pat1: ast::Pat, arm1: ast::Block, arm2: ast::Block) -> String { | 29 | fn build_match_expr( |
30 | expr: ast::Expr, | ||
31 | pat1: ast::Pat, | ||
32 | arm1: ast::BlockExpr, | ||
33 | arm2: ast::BlockExpr, | ||
34 | ) -> String { | ||
29 | let mut buf = String::new(); | 35 | let mut buf = String::new(); |
30 | buf.push_str(&format!("match {} {{\n", expr.syntax().text())); | 36 | format!(buf, "match {} {{\n", expr.syntax().text()); |
31 | buf.push_str(&format!(" {} => {}\n", pat1.syntax().text(), format_arm(&arm1))); | 37 | format!(buf, " {} => {}\n", pat1.syntax().text(), format_arm(&arm1)); |
32 | buf.push_str(&format!(" _ => {}\n", format_arm(&arm2))); | 38 | format!(buf, " _ => {}\n", format_arm(&arm2)); |
33 | buf.push_str("}"); | 39 | buf.push_str("}"); |
34 | buf | 40 | buf |
35 | } | 41 | } |
36 | 42 | ||
37 | fn format_arm(block: &ast::Block) -> String { | 43 | fn format_arm(block: &ast::BlockExpr) -> String { |
38 | match extract_trivial_expression(block) { | 44 | match extract_trivial_expression(block) { |
39 | None => block.syntax().text().to_string(), | 45 | None => block.syntax().text().to_string(), |
40 | Some(e) => format!("{},", e.syntax().text()), | 46 | Some(e) => format!("{},", e.syntax().text()), |
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index 7e7e6c073..1fad5b233 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::{collections::HashSet, fmt::Write, path::Path, time::Instant}; | 1 | use std::{collections::HashSet, fmt::Write, path::Path, time::Instant}; |
2 | 2 | ||
3 | use ra_db::SourceDatabase; | 3 | use ra_db::SourceDatabase; |
4 | use ra_hir::{Crate, HasSource, ImplItem, ModuleDef, Ty}; | 4 | use ra_hir::{Crate, HasBodySource, HasSource, HirDisplay, ImplItem, ModuleDef, Ty, TypeWalk}; |
5 | use ra_syntax::AstNode; | 5 | use ra_syntax::AstNode; |
6 | 6 | ||
7 | use crate::Result; | 7 | use crate::Result; |
@@ -66,6 +66,7 @@ pub fn run(verbose: bool, memory_usage: bool, path: &Path, only: Option<&str>) - | |||
66 | let mut num_exprs = 0; | 66 | let mut num_exprs = 0; |
67 | let mut num_exprs_unknown = 0; | 67 | let mut num_exprs_unknown = 0; |
68 | let mut num_exprs_partially_unknown = 0; | 68 | let mut num_exprs_partially_unknown = 0; |
69 | let mut num_type_mismatches = 0; | ||
69 | for f in funcs { | 70 | for f in funcs { |
70 | let name = f.name(db); | 71 | let name = f.name(db); |
71 | let mut msg = format!("processing: {}", name); | 72 | let mut msg = format!("processing: {}", name); |
@@ -100,6 +101,42 @@ pub fn run(verbose: bool, memory_usage: bool, path: &Path, only: Option<&str>) - | |||
100 | num_exprs_partially_unknown += 1; | 101 | num_exprs_partially_unknown += 1; |
101 | } | 102 | } |
102 | } | 103 | } |
104 | if let Some(mismatch) = inference_result.type_mismatch_for_expr(expr_id) { | ||
105 | num_type_mismatches += 1; | ||
106 | if verbose { | ||
107 | let src = f.expr_source(db, expr_id); | ||
108 | if let Some(src) = src { | ||
109 | // FIXME: it might be nice to have a function (on Analysis?) that goes from Source<T> -> (LineCol, LineCol) directly | ||
110 | let original_file = src.file_id.original_file(db); | ||
111 | let path = db.file_relative_path(original_file); | ||
112 | let line_index = host.analysis().file_line_index(original_file).unwrap(); | ||
113 | let text_range = src | ||
114 | .ast | ||
115 | .either(|it| it.syntax().text_range(), |it| it.syntax().text_range()); | ||
116 | let (start, end) = ( | ||
117 | line_index.line_col(text_range.start()), | ||
118 | line_index.line_col(text_range.end()), | ||
119 | ); | ||
120 | bar.println(format!( | ||
121 | "{} {}:{}-{}:{}: Expected {}, got {}", | ||
122 | path.display(), | ||
123 | start.line + 1, | ||
124 | start.col_utf16, | ||
125 | end.line + 1, | ||
126 | end.col_utf16, | ||
127 | mismatch.expected.display(db), | ||
128 | mismatch.actual.display(db) | ||
129 | )); | ||
130 | } else { | ||
131 | bar.println(format!( | ||
132 | "{}: Expected {}, got {}", | ||
133 | name, | ||
134 | mismatch.expected.display(db), | ||
135 | mismatch.actual.display(db) | ||
136 | )); | ||
137 | } | ||
138 | } | ||
139 | } | ||
103 | } | 140 | } |
104 | bar.inc(1); | 141 | bar.inc(1); |
105 | } | 142 | } |
@@ -115,6 +152,7 @@ pub fn run(verbose: bool, memory_usage: bool, path: &Path, only: Option<&str>) - | |||
115 | num_exprs_partially_unknown, | 152 | num_exprs_partially_unknown, |
116 | (num_exprs_partially_unknown * 100 / num_exprs) | 153 | (num_exprs_partially_unknown * 100 / num_exprs) |
117 | ); | 154 | ); |
155 | println!("Type mismatches: {}", num_type_mismatches); | ||
118 | println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); | 156 | println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); |
119 | println!("Total: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage()); | 157 | println!("Total: {:?}, {}", analysis_time.elapsed(), ra_prof::memory_usage()); |
120 | 158 | ||
diff --git a/crates/ra_fmt/src/lib.rs b/crates/ra_fmt/src/lib.rs index b09478d7a..e22ac9753 100644 --- a/crates/ra_fmt/src/lib.rs +++ b/crates/ra_fmt/src/lib.rs | |||
@@ -34,7 +34,8 @@ fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> { | |||
34 | successors(token.prev_token(), |token| token.prev_token()) | 34 | successors(token.prev_token(), |token| token.prev_token()) |
35 | } | 35 | } |
36 | 36 | ||
37 | pub fn extract_trivial_expression(block: &ast::Block) -> Option<ast::Expr> { | 37 | pub fn extract_trivial_expression(expr: &ast::BlockExpr) -> Option<ast::Expr> { |
38 | let block = expr.block()?; | ||
38 | let expr = block.expr()?; | 39 | let expr = block.expr()?; |
39 | if expr.syntax().text().contains_char('\n') { | 40 | if expr.syntax().text().contains_char('\n') { |
40 | return None; | 41 | return None; |
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index 646c96692..d9bed4dda 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml | |||
@@ -11,7 +11,7 @@ relative-path = "0.4.0" | |||
11 | rustc-hash = "1.0" | 11 | rustc-hash = "1.0" |
12 | parking_lot = "0.9.0" | 12 | parking_lot = "0.9.0" |
13 | ena = "0.13" | 13 | ena = "0.13" |
14 | once_cell = "0.2" | 14 | once_cell = "1.0.1" |
15 | 15 | ||
16 | ra_syntax = { path = "../ra_syntax" } | 16 | ra_syntax = { path = "../ra_syntax" } |
17 | ra_arena = { path = "../ra_arena" } | 17 | ra_arena = { path = "../ra_arena" } |
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 66a58efed..f7efc1b66 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -510,18 +510,6 @@ pub enum DefWithBody { | |||
510 | impl_froms!(DefWithBody: Function, Const, Static); | 510 | impl_froms!(DefWithBody: Function, Const, Static); |
511 | 511 | ||
512 | impl DefWithBody { | 512 | impl DefWithBody { |
513 | pub fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { | ||
514 | db.infer(self) | ||
515 | } | ||
516 | |||
517 | pub fn body(self, db: &impl HirDatabase) -> Arc<Body> { | ||
518 | db.body_hir(self) | ||
519 | } | ||
520 | |||
521 | pub fn body_source_map(self, db: &impl HirDatabase) -> Arc<BodySourceMap> { | ||
522 | db.body_with_source_map(self).1 | ||
523 | } | ||
524 | |||
525 | /// Builds a resolver for code inside this item. | 513 | /// Builds a resolver for code inside this item. |
526 | pub(crate) fn resolver(self, db: &impl HirDatabase) -> Resolver { | 514 | pub(crate) fn resolver(self, db: &impl HirDatabase) -> Resolver { |
527 | match self { | 515 | match self { |
@@ -532,6 +520,43 @@ impl DefWithBody { | |||
532 | } | 520 | } |
533 | } | 521 | } |
534 | 522 | ||
523 | pub trait HasBody: Copy { | ||
524 | fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult>; | ||
525 | fn body(self, db: &impl HirDatabase) -> Arc<Body>; | ||
526 | fn body_source_map(self, db: &impl HirDatabase) -> Arc<BodySourceMap>; | ||
527 | } | ||
528 | |||
529 | impl<T> HasBody for T | ||
530 | where | ||
531 | T: Into<DefWithBody> + Copy + HasSource, | ||
532 | { | ||
533 | fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { | ||
534 | db.infer(self.into()) | ||
535 | } | ||
536 | |||
537 | fn body(self, db: &impl HirDatabase) -> Arc<Body> { | ||
538 | db.body_hir(self.into()) | ||
539 | } | ||
540 | |||
541 | fn body_source_map(self, db: &impl HirDatabase) -> Arc<BodySourceMap> { | ||
542 | db.body_with_source_map(self.into()).1 | ||
543 | } | ||
544 | } | ||
545 | |||
546 | impl HasBody for DefWithBody { | ||
547 | fn infer(self, db: &impl HirDatabase) -> Arc<InferenceResult> { | ||
548 | db.infer(self) | ||
549 | } | ||
550 | |||
551 | fn body(self, db: &impl HirDatabase) -> Arc<Body> { | ||
552 | db.body_hir(self) | ||
553 | } | ||
554 | |||
555 | fn body_source_map(self, db: &impl HirDatabase) -> Arc<BodySourceMap> { | ||
556 | db.body_with_source_map(self).1 | ||
557 | } | ||
558 | } | ||
559 | |||
535 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 560 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
536 | pub struct Function { | 561 | pub struct Function { |
537 | pub(crate) id: FunctionId, | 562 | pub(crate) id: FunctionId, |
diff --git a/crates/ra_hir/src/code_model/src.rs b/crates/ra_hir/src/code_model/src.rs index 32bd9c661..b9ffb0c7a 100644 --- a/crates/ra_hir/src/code_model/src.rs +++ b/crates/ra_hir/src/code_model/src.rs | |||
@@ -1,11 +1,15 @@ | |||
1 | use ra_syntax::ast; | 1 | use ra_syntax::{ |
2 | ast::{self, AstNode}, | ||
3 | SyntaxNode, | ||
4 | }; | ||
2 | 5 | ||
3 | use crate::{ | 6 | use crate::{ |
4 | ids::AstItemDef, AstDatabase, Const, DefDatabase, Enum, EnumVariant, FieldSource, Function, | 7 | ids::AstItemDef, AstDatabase, Const, DefDatabase, Either, Enum, EnumVariant, FieldSource, |
5 | HirFileId, MacroDef, Module, ModuleSource, Static, Struct, StructField, Trait, TypeAlias, | 8 | Function, HasBody, HirDatabase, HirFileId, MacroDef, Module, ModuleSource, Static, Struct, |
6 | Union, | 9 | StructField, Trait, TypeAlias, Union, |
7 | }; | 10 | }; |
8 | 11 | ||
12 | #[derive(Debug, PartialEq, Eq, Clone, Copy)] | ||
9 | pub struct Source<T> { | 13 | pub struct Source<T> { |
10 | pub file_id: HirFileId, | 14 | pub file_id: HirFileId, |
11 | pub ast: T, | 15 | pub ast: T, |
@@ -16,6 +20,15 @@ pub trait HasSource { | |||
16 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<Self::Ast>; | 20 | fn source(self, db: &(impl DefDatabase + AstDatabase)) -> Source<Self::Ast>; |
17 | } | 21 | } |
18 | 22 | ||
23 | impl<T> Source<T> { | ||
24 | pub(crate) fn map<F: FnOnce(T) -> U, U>(self, f: F) -> Source<U> { | ||
25 | Source { file_id: self.file_id, ast: f(self.ast) } | ||
26 | } | ||
27 | pub(crate) fn file_syntax(&self, db: &impl AstDatabase) -> SyntaxNode { | ||
28 | db.parse_or_expand(self.file_id).expect("source created from invalid file") | ||
29 | } | ||
30 | } | ||
31 | |||
19 | /// NB: Module is !HasSource, because it has two source nodes at the same time: | 32 | /// NB: Module is !HasSource, because it has two source nodes at the same time: |
20 | /// definition and declaration. | 33 | /// definition and declaration. |
21 | impl Module { | 34 | impl Module { |
@@ -108,3 +121,27 @@ impl HasSource for MacroDef { | |||
108 | Source { file_id: self.id.0.file_id(), ast: self.id.0.to_node(db) } | 121 | Source { file_id: self.id.0.file_id(), ast: self.id.0.to_node(db) } |
109 | } | 122 | } |
110 | } | 123 | } |
124 | |||
125 | pub trait HasBodySource: HasBody + HasSource | ||
126 | where | ||
127 | Self::Ast: AstNode, | ||
128 | { | ||
129 | fn expr_source( | ||
130 | self, | ||
131 | db: &impl HirDatabase, | ||
132 | expr_id: crate::expr::ExprId, | ||
133 | ) -> Option<Source<Either<ast::Expr, ast::RecordField>>> { | ||
134 | let source_map = self.body_source_map(db); | ||
135 | let source_ptr = source_map.expr_syntax(expr_id)?; | ||
136 | let root = source_ptr.file_syntax(db); | ||
137 | let source = source_ptr.map(|ast| ast.map(|it| it.to_node(&root), |it| it.to_node(&root))); | ||
138 | Some(source) | ||
139 | } | ||
140 | } | ||
141 | |||
142 | impl<T> HasBodySource for T | ||
143 | where | ||
144 | T: HasBody + HasSource, | ||
145 | T::Ast: AstNode, | ||
146 | { | ||
147 | } | ||
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs index 7cdc7555c..fc21e269f 100644 --- a/crates/ra_hir/src/expr.rs +++ b/crates/ra_hir/src/expr.rs | |||
@@ -1,36 +1,30 @@ | |||
1 | use std::ops::Index; | 1 | pub(crate) mod lower; |
2 | use std::sync::Arc; | 2 | pub(crate) mod scope; |
3 | pub(crate) mod validation; | ||
3 | 4 | ||
4 | use rustc_hash::FxHashMap; | 5 | use std::{ops::Index, sync::Arc}; |
5 | 6 | ||
6 | use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; | 7 | use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId}; |
7 | use ra_syntax::{ | 8 | use ra_syntax::{ast, AstPtr}; |
8 | ast::{ | 9 | use rustc_hash::FxHashMap; |
9 | self, ArgListOwner, ArrayExprKind, LiteralKind, LoopBodyOwner, NameOwner, | ||
10 | TryBlockBodyOwner, TypeAscriptionOwner, | ||
11 | }, | ||
12 | AstNode, AstPtr, SyntaxNodePtr, | ||
13 | }; | ||
14 | use test_utils::tested_by; | ||
15 | 10 | ||
16 | use crate::{ | 11 | use crate::{ |
17 | name::{AsName, SELF_PARAM}, | ||
18 | path::GenericArgs, | 12 | path::GenericArgs, |
19 | ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, | 13 | ty::primitive::{UncertainFloatTy, UncertainIntTy}, |
20 | type_ref::{Mutability, TypeRef}, | 14 | type_ref::{Mutability, TypeRef}, |
21 | DefWithBody, Either, HasSource, HirDatabase, HirFileId, MacroCallLoc, MacroFileKind, Name, | 15 | DefWithBody, Either, HasSource, HirDatabase, Name, Path, Resolver, Source, |
22 | Path, Resolver, | ||
23 | }; | 16 | }; |
24 | 17 | ||
25 | pub use self::scope::ExprScopes; | 18 | pub use self::scope::ExprScopes; |
26 | 19 | ||
27 | pub(crate) mod scope; | ||
28 | pub(crate) mod validation; | ||
29 | |||
30 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 20 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
31 | pub struct ExprId(RawId); | 21 | pub struct ExprId(RawId); |
32 | impl_arena_id!(ExprId); | 22 | impl_arena_id!(ExprId); |
33 | 23 | ||
24 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
25 | pub struct PatId(RawId); | ||
26 | impl_arena_id!(PatId); | ||
27 | |||
34 | /// The body of an item (function, const etc.). | 28 | /// The body of an item (function, const etc.). |
35 | #[derive(Debug, Eq, PartialEq)] | 29 | #[derive(Debug, Eq, PartialEq)] |
36 | pub struct Body { | 30 | pub struct Body { |
@@ -49,22 +43,32 @@ pub struct Body { | |||
49 | body_expr: ExprId, | 43 | body_expr: ExprId, |
50 | } | 44 | } |
51 | 45 | ||
46 | type ExprPtr = Either<AstPtr<ast::Expr>, AstPtr<ast::RecordField>>; | ||
47 | type ExprSource = Source<ExprPtr>; | ||
48 | |||
49 | type PatPtr = Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>; | ||
50 | type PatSource = Source<PatPtr>; | ||
51 | |||
52 | /// An item body together with the mapping from syntax nodes to HIR expression | 52 | /// An item body together with the mapping from syntax nodes to HIR expression |
53 | /// IDs. This is needed to go from e.g. a position in a file to the HIR | 53 | /// IDs. This is needed to go from e.g. a position in a file to the HIR |
54 | /// expression containing it; but for type inference etc., we want to operate on | 54 | /// expression containing it; but for type inference etc., we want to operate on |
55 | /// a structure that is agnostic to the actual positions of expressions in the | 55 | /// a structure that is agnostic to the actual positions of expressions in the |
56 | /// file, so that we don't recompute types whenever some whitespace is typed. | 56 | /// file, so that we don't recompute types whenever some whitespace is typed. |
57 | /// | ||
58 | /// One complication here is that, due to macro expansion, a single `Body` might | ||
59 | /// be spread across several files. So, for each ExprId and PatId, we record | ||
60 | /// both the HirFileId and the position inside the file. However, we only store | ||
61 | /// AST -> ExprId mapping for non-macro files, as it is not clear how to handle | ||
62 | /// this properly for macros. | ||
57 | #[derive(Default, Debug, Eq, PartialEq)] | 63 | #[derive(Default, Debug, Eq, PartialEq)] |
58 | pub struct BodySourceMap { | 64 | pub struct BodySourceMap { |
59 | expr_map: FxHashMap<SyntaxNodePtr, ExprId>, | 65 | expr_map: FxHashMap<ExprPtr, ExprId>, |
60 | expr_map_back: ArenaMap<ExprId, SyntaxNodePtr>, | 66 | expr_map_back: ArenaMap<ExprId, ExprSource>, |
61 | pat_map: FxHashMap<PatPtr, PatId>, | 67 | pat_map: FxHashMap<PatPtr, PatId>, |
62 | pat_map_back: ArenaMap<PatId, PatPtr>, | 68 | pat_map_back: ArenaMap<PatId, PatSource>, |
63 | field_map: FxHashMap<(ExprId, usize), AstPtr<ast::RecordField>>, | 69 | field_map: FxHashMap<(ExprId, usize), AstPtr<ast::RecordField>>, |
64 | } | 70 | } |
65 | 71 | ||
66 | type PatPtr = Either<AstPtr<ast::Pat>, AstPtr<ast::SelfParam>>; | ||
67 | |||
68 | impl Body { | 72 | impl Body { |
69 | pub fn params(&self) -> &[PatId] { | 73 | pub fn params(&self) -> &[PatId] { |
70 | &self.params | 74 | &self.params |
@@ -128,20 +132,16 @@ impl Index<PatId> for Body { | |||
128 | } | 132 | } |
129 | 133 | ||
130 | impl BodySourceMap { | 134 | impl BodySourceMap { |
131 | pub(crate) fn expr_syntax(&self, expr: ExprId) -> Option<SyntaxNodePtr> { | 135 | pub(crate) fn expr_syntax(&self, expr: ExprId) -> Option<ExprSource> { |
132 | self.expr_map_back.get(expr).cloned() | 136 | self.expr_map_back.get(expr).copied() |
133 | } | ||
134 | |||
135 | pub(crate) fn syntax_expr(&self, ptr: SyntaxNodePtr) -> Option<ExprId> { | ||
136 | self.expr_map.get(&ptr).cloned() | ||
137 | } | 137 | } |
138 | 138 | ||
139 | pub(crate) fn node_expr(&self, node: &ast::Expr) -> Option<ExprId> { | 139 | pub(crate) fn node_expr(&self, node: &ast::Expr) -> Option<ExprId> { |
140 | self.expr_map.get(&SyntaxNodePtr::new(node.syntax())).cloned() | 140 | self.expr_map.get(&Either::A(AstPtr::new(node))).cloned() |
141 | } | 141 | } |
142 | 142 | ||
143 | pub(crate) fn pat_syntax(&self, pat: PatId) -> Option<PatPtr> { | 143 | pub(crate) fn pat_syntax(&self, pat: PatId) -> Option<PatSource> { |
144 | self.pat_map_back.get(pat).cloned() | 144 | self.pat_map_back.get(pat).copied() |
145 | } | 145 | } |
146 | 146 | ||
147 | pub(crate) fn node_pat(&self, node: &ast::Pat) -> Option<PatId> { | 147 | pub(crate) fn node_pat(&self, node: &ast::Pat) -> Option<PatId> { |
@@ -436,10 +436,6 @@ impl Expr { | |||
436 | } | 436 | } |
437 | } | 437 | } |
438 | 438 | ||
439 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | ||
440 | pub struct PatId(RawId); | ||
441 | impl_arena_id!(PatId); | ||
442 | |||
443 | /// Explicit binding annotations given in the HIR for a binding. Note | 439 | /// Explicit binding annotations given in the HIR for a binding. Note |
444 | /// that this is not the final binding *mode* that we infer after type | 440 | /// that this is not the final binding *mode* that we infer after type |
445 | /// inference. | 441 | /// inference. |
@@ -485,7 +481,7 @@ pub enum Pat { | |||
485 | Missing, | 481 | Missing, |
486 | Wild, | 482 | Wild, |
487 | Tuple(Vec<PatId>), | 483 | Tuple(Vec<PatId>), |
488 | Struct { | 484 | Record { |
489 | path: Option<Path>, | 485 | path: Option<Path>, |
490 | args: Vec<RecordFieldPat>, | 486 | args: Vec<RecordFieldPat>, |
491 | // FIXME: 'ellipsis' option | 487 | // FIXME: 'ellipsis' option |
@@ -531,7 +527,7 @@ impl Pat { | |||
531 | let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); | 527 | let total_iter = prefix.iter().chain(rest.iter()).chain(suffix.iter()); |
532 | total_iter.copied().for_each(f); | 528 | total_iter.copied().for_each(f); |
533 | } | 529 | } |
534 | Pat::Struct { args, .. } => { | 530 | Pat::Record { args, .. } => { |
535 | args.iter().map(|f| f.pat).for_each(f); | 531 | args.iter().map(|f| f.pat).for_each(f); |
536 | } | 532 | } |
537 | } | 533 | } |
@@ -539,624 +535,29 @@ impl Pat { | |||
539 | } | 535 | } |
540 | 536 | ||
541 | // Queries | 537 | // Queries |
542 | |||
543 | pub(crate) struct ExprCollector<DB> { | ||
544 | db: DB, | ||
545 | owner: DefWithBody, | ||
546 | exprs: Arena<ExprId, Expr>, | ||
547 | pats: Arena<PatId, Pat>, | ||
548 | source_map: BodySourceMap, | ||
549 | params: Vec<PatId>, | ||
550 | body_expr: Option<ExprId>, | ||
551 | resolver: Resolver, | ||
552 | // Expr collector expands macros along the way. original points to the file | ||
553 | // we started with, current points to the current macro expansion. source | ||
554 | // maps don't support macros yet, so we only record info into source map if | ||
555 | // current == original (see #1196) | ||
556 | original_file_id: HirFileId, | ||
557 | current_file_id: HirFileId, | ||
558 | } | ||
559 | |||
560 | impl<'a, DB> ExprCollector<&'a DB> | ||
561 | where | ||
562 | DB: HirDatabase, | ||
563 | { | ||
564 | fn new(owner: DefWithBody, file_id: HirFileId, resolver: Resolver, db: &'a DB) -> Self { | ||
565 | ExprCollector { | ||
566 | owner, | ||
567 | resolver, | ||
568 | db, | ||
569 | exprs: Arena::default(), | ||
570 | pats: Arena::default(), | ||
571 | source_map: BodySourceMap::default(), | ||
572 | params: Vec::new(), | ||
573 | body_expr: None, | ||
574 | original_file_id: file_id, | ||
575 | current_file_id: file_id, | ||
576 | } | ||
577 | } | ||
578 | fn alloc_expr(&mut self, expr: Expr, syntax_ptr: SyntaxNodePtr) -> ExprId { | ||
579 | let id = self.exprs.alloc(expr); | ||
580 | if self.current_file_id == self.original_file_id { | ||
581 | self.source_map.expr_map.insert(syntax_ptr, id); | ||
582 | self.source_map.expr_map_back.insert(id, syntax_ptr); | ||
583 | } | ||
584 | id | ||
585 | } | ||
586 | |||
587 | fn alloc_pat(&mut self, pat: Pat, ptr: PatPtr) -> PatId { | ||
588 | let id = self.pats.alloc(pat); | ||
589 | |||
590 | if self.current_file_id == self.original_file_id { | ||
591 | self.source_map.pat_map.insert(ptr, id); | ||
592 | self.source_map.pat_map_back.insert(id, ptr); | ||
593 | } | ||
594 | |||
595 | id | ||
596 | } | ||
597 | |||
598 | fn empty_block(&mut self) -> ExprId { | ||
599 | let block = Expr::Block { statements: Vec::new(), tail: None }; | ||
600 | self.exprs.alloc(block) | ||
601 | } | ||
602 | |||
603 | fn collect_expr(&mut self, expr: ast::Expr) -> ExprId { | ||
604 | let syntax_ptr = SyntaxNodePtr::new(expr.syntax()); | ||
605 | match expr { | ||
606 | ast::Expr::IfExpr(e) => { | ||
607 | let then_branch = self.collect_block_opt(e.then_branch()); | ||
608 | |||
609 | let else_branch = e.else_branch().map(|b| match b { | ||
610 | ast::ElseBranch::Block(it) => self.collect_block(it), | ||
611 | ast::ElseBranch::IfExpr(elif) => { | ||
612 | let expr: ast::Expr = ast::Expr::cast(elif.syntax().clone()).unwrap(); | ||
613 | self.collect_expr(expr) | ||
614 | } | ||
615 | }); | ||
616 | |||
617 | let condition = match e.condition() { | ||
618 | None => self.exprs.alloc(Expr::Missing), | ||
619 | Some(condition) => match condition.pat() { | ||
620 | None => self.collect_expr_opt(condition.expr()), | ||
621 | // if let -- desugar to match | ||
622 | Some(pat) => { | ||
623 | let pat = self.collect_pat(pat); | ||
624 | let match_expr = self.collect_expr_opt(condition.expr()); | ||
625 | let placeholder_pat = self.pats.alloc(Pat::Missing); | ||
626 | let arms = vec![ | ||
627 | MatchArm { pats: vec![pat], expr: then_branch, guard: None }, | ||
628 | MatchArm { | ||
629 | pats: vec![placeholder_pat], | ||
630 | expr: else_branch.unwrap_or_else(|| self.empty_block()), | ||
631 | guard: None, | ||
632 | }, | ||
633 | ]; | ||
634 | return self | ||
635 | .alloc_expr(Expr::Match { expr: match_expr, arms }, syntax_ptr); | ||
636 | } | ||
637 | }, | ||
638 | }; | ||
639 | |||
640 | self.alloc_expr(Expr::If { condition, then_branch, else_branch }, syntax_ptr) | ||
641 | } | ||
642 | ast::Expr::TryBlockExpr(e) => { | ||
643 | let body = self.collect_block_opt(e.try_body()); | ||
644 | self.alloc_expr(Expr::TryBlock { body }, syntax_ptr) | ||
645 | } | ||
646 | ast::Expr::BlockExpr(e) => self.collect_block_opt(e.block()), | ||
647 | ast::Expr::LoopExpr(e) => { | ||
648 | let body = self.collect_block_opt(e.loop_body()); | ||
649 | self.alloc_expr(Expr::Loop { body }, syntax_ptr) | ||
650 | } | ||
651 | ast::Expr::WhileExpr(e) => { | ||
652 | let body = self.collect_block_opt(e.loop_body()); | ||
653 | |||
654 | let condition = match e.condition() { | ||
655 | None => self.exprs.alloc(Expr::Missing), | ||
656 | Some(condition) => match condition.pat() { | ||
657 | None => self.collect_expr_opt(condition.expr()), | ||
658 | // if let -- desugar to match | ||
659 | Some(pat) => { | ||
660 | tested_by!(infer_while_let); | ||
661 | let pat = self.collect_pat(pat); | ||
662 | let match_expr = self.collect_expr_opt(condition.expr()); | ||
663 | let placeholder_pat = self.pats.alloc(Pat::Missing); | ||
664 | let break_ = self.exprs.alloc(Expr::Break { expr: None }); | ||
665 | let arms = vec![ | ||
666 | MatchArm { pats: vec![pat], expr: body, guard: None }, | ||
667 | MatchArm { pats: vec![placeholder_pat], expr: break_, guard: None }, | ||
668 | ]; | ||
669 | let match_expr = | ||
670 | self.exprs.alloc(Expr::Match { expr: match_expr, arms }); | ||
671 | return self.alloc_expr(Expr::Loop { body: match_expr }, syntax_ptr); | ||
672 | } | ||
673 | }, | ||
674 | }; | ||
675 | |||
676 | self.alloc_expr(Expr::While { condition, body }, syntax_ptr) | ||
677 | } | ||
678 | ast::Expr::ForExpr(e) => { | ||
679 | let iterable = self.collect_expr_opt(e.iterable()); | ||
680 | let pat = self.collect_pat_opt(e.pat()); | ||
681 | let body = self.collect_block_opt(e.loop_body()); | ||
682 | self.alloc_expr(Expr::For { iterable, pat, body }, syntax_ptr) | ||
683 | } | ||
684 | ast::Expr::CallExpr(e) => { | ||
685 | let callee = self.collect_expr_opt(e.expr()); | ||
686 | let args = if let Some(arg_list) = e.arg_list() { | ||
687 | arg_list.args().map(|e| self.collect_expr(e)).collect() | ||
688 | } else { | ||
689 | Vec::new() | ||
690 | }; | ||
691 | self.alloc_expr(Expr::Call { callee, args }, syntax_ptr) | ||
692 | } | ||
693 | ast::Expr::MethodCallExpr(e) => { | ||
694 | let receiver = self.collect_expr_opt(e.expr()); | ||
695 | let args = if let Some(arg_list) = e.arg_list() { | ||
696 | arg_list.args().map(|e| self.collect_expr(e)).collect() | ||
697 | } else { | ||
698 | Vec::new() | ||
699 | }; | ||
700 | let method_name = e.name_ref().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); | ||
701 | let generic_args = e.type_arg_list().and_then(GenericArgs::from_ast); | ||
702 | self.alloc_expr( | ||
703 | Expr::MethodCall { receiver, method_name, args, generic_args }, | ||
704 | syntax_ptr, | ||
705 | ) | ||
706 | } | ||
707 | ast::Expr::MatchExpr(e) => { | ||
708 | let expr = self.collect_expr_opt(e.expr()); | ||
709 | let arms = if let Some(match_arm_list) = e.match_arm_list() { | ||
710 | match_arm_list | ||
711 | .arms() | ||
712 | .map(|arm| MatchArm { | ||
713 | pats: arm.pats().map(|p| self.collect_pat(p)).collect(), | ||
714 | expr: self.collect_expr_opt(arm.expr()), | ||
715 | guard: arm | ||
716 | .guard() | ||
717 | .and_then(|guard| guard.expr()) | ||
718 | .map(|e| self.collect_expr(e)), | ||
719 | }) | ||
720 | .collect() | ||
721 | } else { | ||
722 | Vec::new() | ||
723 | }; | ||
724 | self.alloc_expr(Expr::Match { expr, arms }, syntax_ptr) | ||
725 | } | ||
726 | ast::Expr::PathExpr(e) => { | ||
727 | let path = | ||
728 | e.path().and_then(Path::from_ast).map(Expr::Path).unwrap_or(Expr::Missing); | ||
729 | self.alloc_expr(path, syntax_ptr) | ||
730 | } | ||
731 | ast::Expr::ContinueExpr(_e) => { | ||
732 | // FIXME: labels | ||
733 | self.alloc_expr(Expr::Continue, syntax_ptr) | ||
734 | } | ||
735 | ast::Expr::BreakExpr(e) => { | ||
736 | let expr = e.expr().map(|e| self.collect_expr(e)); | ||
737 | self.alloc_expr(Expr::Break { expr }, syntax_ptr) | ||
738 | } | ||
739 | ast::Expr::ParenExpr(e) => { | ||
740 | let inner = self.collect_expr_opt(e.expr()); | ||
741 | // make the paren expr point to the inner expression as well | ||
742 | self.source_map.expr_map.insert(syntax_ptr, inner); | ||
743 | inner | ||
744 | } | ||
745 | ast::Expr::ReturnExpr(e) => { | ||
746 | let expr = e.expr().map(|e| self.collect_expr(e)); | ||
747 | self.alloc_expr(Expr::Return { expr }, syntax_ptr) | ||
748 | } | ||
749 | ast::Expr::RecordLit(e) => { | ||
750 | let path = e.path().and_then(Path::from_ast); | ||
751 | let mut field_ptrs = Vec::new(); | ||
752 | let record_lit = if let Some(nfl) = e.record_field_list() { | ||
753 | let fields = nfl | ||
754 | .fields() | ||
755 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) | ||
756 | .map(|field| RecordLitField { | ||
757 | name: field | ||
758 | .name_ref() | ||
759 | .map(|nr| nr.as_name()) | ||
760 | .unwrap_or_else(Name::missing), | ||
761 | expr: if let Some(e) = field.expr() { | ||
762 | self.collect_expr(e) | ||
763 | } else if let Some(nr) = field.name_ref() { | ||
764 | // field shorthand | ||
765 | let id = self.exprs.alloc(Expr::Path(Path::from_name_ref(&nr))); | ||
766 | self.source_map | ||
767 | .expr_map | ||
768 | .insert(SyntaxNodePtr::new(nr.syntax()), id); | ||
769 | self.source_map | ||
770 | .expr_map_back | ||
771 | .insert(id, SyntaxNodePtr::new(nr.syntax())); | ||
772 | id | ||
773 | } else { | ||
774 | self.exprs.alloc(Expr::Missing) | ||
775 | }, | ||
776 | }) | ||
777 | .collect(); | ||
778 | let spread = nfl.spread().map(|s| self.collect_expr(s)); | ||
779 | Expr::RecordLit { path, fields, spread } | ||
780 | } else { | ||
781 | Expr::RecordLit { path, fields: Vec::new(), spread: None } | ||
782 | }; | ||
783 | |||
784 | let res = self.alloc_expr(record_lit, syntax_ptr); | ||
785 | for (i, ptr) in field_ptrs.into_iter().enumerate() { | ||
786 | self.source_map.field_map.insert((res, i), ptr); | ||
787 | } | ||
788 | res | ||
789 | } | ||
790 | ast::Expr::FieldExpr(e) => { | ||
791 | let expr = self.collect_expr_opt(e.expr()); | ||
792 | let name = match e.field_access() { | ||
793 | Some(kind) => kind.as_name(), | ||
794 | _ => Name::missing(), | ||
795 | }; | ||
796 | self.alloc_expr(Expr::Field { expr, name }, syntax_ptr) | ||
797 | } | ||
798 | ast::Expr::AwaitExpr(e) => { | ||
799 | let expr = self.collect_expr_opt(e.expr()); | ||
800 | self.alloc_expr(Expr::Await { expr }, syntax_ptr) | ||
801 | } | ||
802 | ast::Expr::TryExpr(e) => { | ||
803 | let expr = self.collect_expr_opt(e.expr()); | ||
804 | self.alloc_expr(Expr::Try { expr }, syntax_ptr) | ||
805 | } | ||
806 | ast::Expr::CastExpr(e) => { | ||
807 | let expr = self.collect_expr_opt(e.expr()); | ||
808 | let type_ref = TypeRef::from_ast_opt(e.type_ref()); | ||
809 | self.alloc_expr(Expr::Cast { expr, type_ref }, syntax_ptr) | ||
810 | } | ||
811 | ast::Expr::RefExpr(e) => { | ||
812 | let expr = self.collect_expr_opt(e.expr()); | ||
813 | let mutability = Mutability::from_mutable(e.is_mut()); | ||
814 | self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) | ||
815 | } | ||
816 | ast::Expr::PrefixExpr(e) => { | ||
817 | let expr = self.collect_expr_opt(e.expr()); | ||
818 | if let Some(op) = e.op_kind() { | ||
819 | self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr) | ||
820 | } else { | ||
821 | self.alloc_expr(Expr::Missing, syntax_ptr) | ||
822 | } | ||
823 | } | ||
824 | ast::Expr::LambdaExpr(e) => { | ||
825 | let mut args = Vec::new(); | ||
826 | let mut arg_types = Vec::new(); | ||
827 | if let Some(pl) = e.param_list() { | ||
828 | for param in pl.params() { | ||
829 | let pat = self.collect_pat_opt(param.pat()); | ||
830 | let type_ref = param.ascribed_type().map(TypeRef::from_ast); | ||
831 | args.push(pat); | ||
832 | arg_types.push(type_ref); | ||
833 | } | ||
834 | } | ||
835 | let body = self.collect_expr_opt(e.body()); | ||
836 | self.alloc_expr(Expr::Lambda { args, arg_types, body }, syntax_ptr) | ||
837 | } | ||
838 | ast::Expr::BinExpr(e) => { | ||
839 | let lhs = self.collect_expr_opt(e.lhs()); | ||
840 | let rhs = self.collect_expr_opt(e.rhs()); | ||
841 | let op = e.op_kind().map(BinaryOp::from); | ||
842 | self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr) | ||
843 | } | ||
844 | ast::Expr::TupleExpr(e) => { | ||
845 | let exprs = e.exprs().map(|expr| self.collect_expr(expr)).collect(); | ||
846 | self.alloc_expr(Expr::Tuple { exprs }, syntax_ptr) | ||
847 | } | ||
848 | |||
849 | ast::Expr::ArrayExpr(e) => { | ||
850 | let kind = e.kind(); | ||
851 | |||
852 | match kind { | ||
853 | ArrayExprKind::ElementList(e) => { | ||
854 | let exprs = e.map(|expr| self.collect_expr(expr)).collect(); | ||
855 | self.alloc_expr(Expr::Array(Array::ElementList(exprs)), syntax_ptr) | ||
856 | } | ||
857 | ArrayExprKind::Repeat { initializer, repeat } => { | ||
858 | let initializer = self.collect_expr_opt(initializer); | ||
859 | let repeat = self.collect_expr_opt(repeat); | ||
860 | self.alloc_expr( | ||
861 | Expr::Array(Array::Repeat { initializer, repeat }), | ||
862 | syntax_ptr, | ||
863 | ) | ||
864 | } | ||
865 | } | ||
866 | } | ||
867 | |||
868 | ast::Expr::Literal(e) => { | ||
869 | let lit = match e.kind() { | ||
870 | LiteralKind::IntNumber { suffix } => { | ||
871 | let known_name = suffix | ||
872 | .and_then(|it| IntTy::from_suffix(&it).map(UncertainIntTy::Known)); | ||
873 | |||
874 | Literal::Int( | ||
875 | Default::default(), | ||
876 | known_name.unwrap_or(UncertainIntTy::Unknown), | ||
877 | ) | ||
878 | } | ||
879 | LiteralKind::FloatNumber { suffix } => { | ||
880 | let known_name = suffix | ||
881 | .and_then(|it| FloatTy::from_suffix(&it).map(UncertainFloatTy::Known)); | ||
882 | |||
883 | Literal::Float( | ||
884 | Default::default(), | ||
885 | known_name.unwrap_or(UncertainFloatTy::Unknown), | ||
886 | ) | ||
887 | } | ||
888 | LiteralKind::ByteString => Literal::ByteString(Default::default()), | ||
889 | LiteralKind::String => Literal::String(Default::default()), | ||
890 | LiteralKind::Byte => { | ||
891 | Literal::Int(Default::default(), UncertainIntTy::Known(IntTy::u8())) | ||
892 | } | ||
893 | LiteralKind::Bool => Literal::Bool(Default::default()), | ||
894 | LiteralKind::Char => Literal::Char(Default::default()), | ||
895 | }; | ||
896 | self.alloc_expr(Expr::Literal(lit), syntax_ptr) | ||
897 | } | ||
898 | ast::Expr::IndexExpr(e) => { | ||
899 | let base = self.collect_expr_opt(e.base()); | ||
900 | let index = self.collect_expr_opt(e.index()); | ||
901 | self.alloc_expr(Expr::Index { base, index }, syntax_ptr) | ||
902 | } | ||
903 | |||
904 | // FIXME implement HIR for these: | ||
905 | ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), | ||
906 | ast::Expr::RangeExpr(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), | ||
907 | ast::Expr::MacroCall(e) => { | ||
908 | let ast_id = self | ||
909 | .db | ||
910 | .ast_id_map(self.current_file_id) | ||
911 | .ast_id(&e) | ||
912 | .with_file_id(self.current_file_id); | ||
913 | |||
914 | if let Some(path) = e.path().and_then(Path::from_ast) { | ||
915 | if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) { | ||
916 | let call_id = MacroCallLoc { def: def.id, ast_id }.id(self.db); | ||
917 | let file_id = call_id.as_file(MacroFileKind::Expr); | ||
918 | if let Some(node) = self.db.parse_or_expand(file_id) { | ||
919 | if let Some(expr) = ast::Expr::cast(node) { | ||
920 | log::debug!("macro expansion {:#?}", expr.syntax()); | ||
921 | let old_file_id = | ||
922 | std::mem::replace(&mut self.current_file_id, file_id); | ||
923 | let id = self.collect_expr(expr); | ||
924 | self.current_file_id = old_file_id; | ||
925 | return id; | ||
926 | } | ||
927 | } | ||
928 | } | ||
929 | } | ||
930 | // FIXME: Instead of just dropping the error from expansion | ||
931 | // report it | ||
932 | self.alloc_expr(Expr::Missing, syntax_ptr) | ||
933 | } | ||
934 | } | ||
935 | } | ||
936 | |||
937 | fn collect_expr_opt(&mut self, expr: Option<ast::Expr>) -> ExprId { | ||
938 | if let Some(expr) = expr { | ||
939 | self.collect_expr(expr) | ||
940 | } else { | ||
941 | self.exprs.alloc(Expr::Missing) | ||
942 | } | ||
943 | } | ||
944 | |||
945 | fn collect_block(&mut self, block: ast::Block) -> ExprId { | ||
946 | let statements = block | ||
947 | .statements() | ||
948 | .map(|s| match s { | ||
949 | ast::Stmt::LetStmt(stmt) => { | ||
950 | let pat = self.collect_pat_opt(stmt.pat()); | ||
951 | let type_ref = stmt.ascribed_type().map(TypeRef::from_ast); | ||
952 | let initializer = stmt.initializer().map(|e| self.collect_expr(e)); | ||
953 | Statement::Let { pat, type_ref, initializer } | ||
954 | } | ||
955 | ast::Stmt::ExprStmt(stmt) => Statement::Expr(self.collect_expr_opt(stmt.expr())), | ||
956 | }) | ||
957 | .collect(); | ||
958 | let tail = block.expr().map(|e| self.collect_expr(e)); | ||
959 | self.alloc_expr(Expr::Block { statements, tail }, SyntaxNodePtr::new(block.syntax())) | ||
960 | } | ||
961 | |||
962 | fn collect_block_opt(&mut self, block: Option<ast::Block>) -> ExprId { | ||
963 | if let Some(block) = block { | ||
964 | self.collect_block(block) | ||
965 | } else { | ||
966 | self.exprs.alloc(Expr::Missing) | ||
967 | } | ||
968 | } | ||
969 | |||
970 | fn collect_pat(&mut self, pat: ast::Pat) -> PatId { | ||
971 | let pattern = match &pat { | ||
972 | ast::Pat::BindPat(bp) => { | ||
973 | let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); | ||
974 | let annotation = BindingAnnotation::new(bp.is_mutable(), bp.is_ref()); | ||
975 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); | ||
976 | Pat::Bind { name, mode: annotation, subpat } | ||
977 | } | ||
978 | ast::Pat::TupleStructPat(p) => { | ||
979 | let path = p.path().and_then(Path::from_ast); | ||
980 | let args = p.args().map(|p| self.collect_pat(p)).collect(); | ||
981 | Pat::TupleStruct { path, args } | ||
982 | } | ||
983 | ast::Pat::RefPat(p) => { | ||
984 | let pat = self.collect_pat_opt(p.pat()); | ||
985 | let mutability = Mutability::from_mutable(p.is_mut()); | ||
986 | Pat::Ref { pat, mutability } | ||
987 | } | ||
988 | ast::Pat::PathPat(p) => { | ||
989 | let path = p.path().and_then(Path::from_ast); | ||
990 | path.map(Pat::Path).unwrap_or(Pat::Missing) | ||
991 | } | ||
992 | ast::Pat::TuplePat(p) => { | ||
993 | let args = p.args().map(|p| self.collect_pat(p)).collect(); | ||
994 | Pat::Tuple(args) | ||
995 | } | ||
996 | ast::Pat::PlaceholderPat(_) => Pat::Wild, | ||
997 | ast::Pat::RecordPat(p) => { | ||
998 | let path = p.path().and_then(Path::from_ast); | ||
999 | let record_field_pat_list = | ||
1000 | p.record_field_pat_list().expect("every struct should have a field list"); | ||
1001 | let mut fields: Vec<_> = record_field_pat_list | ||
1002 | .bind_pats() | ||
1003 | .filter_map(|bind_pat| { | ||
1004 | let ast_pat = | ||
1005 | ast::Pat::cast(bind_pat.syntax().clone()).expect("bind pat is a pat"); | ||
1006 | let pat = self.collect_pat(ast_pat); | ||
1007 | let name = bind_pat.name()?.as_name(); | ||
1008 | Some(RecordFieldPat { name, pat }) | ||
1009 | }) | ||
1010 | .collect(); | ||
1011 | let iter = record_field_pat_list.record_field_pats().filter_map(|f| { | ||
1012 | let ast_pat = f.pat()?; | ||
1013 | let pat = self.collect_pat(ast_pat); | ||
1014 | let name = f.name()?.as_name(); | ||
1015 | Some(RecordFieldPat { name, pat }) | ||
1016 | }); | ||
1017 | fields.extend(iter); | ||
1018 | |||
1019 | Pat::Struct { path, args: fields } | ||
1020 | } | ||
1021 | |||
1022 | // FIXME: implement | ||
1023 | ast::Pat::BoxPat(_) => Pat::Missing, | ||
1024 | ast::Pat::LiteralPat(_) => Pat::Missing, | ||
1025 | ast::Pat::SlicePat(_) | ast::Pat::RangePat(_) => Pat::Missing, | ||
1026 | }; | ||
1027 | let ptr = AstPtr::new(&pat); | ||
1028 | self.alloc_pat(pattern, Either::A(ptr)) | ||
1029 | } | ||
1030 | |||
1031 | fn collect_pat_opt(&mut self, pat: Option<ast::Pat>) -> PatId { | ||
1032 | if let Some(pat) = pat { | ||
1033 | self.collect_pat(pat) | ||
1034 | } else { | ||
1035 | self.pats.alloc(Pat::Missing) | ||
1036 | } | ||
1037 | } | ||
1038 | |||
1039 | fn collect_const_body(&mut self, node: ast::ConstDef) { | ||
1040 | let body = self.collect_expr_opt(node.body()); | ||
1041 | self.body_expr = Some(body); | ||
1042 | } | ||
1043 | |||
1044 | fn collect_static_body(&mut self, node: ast::StaticDef) { | ||
1045 | let body = self.collect_expr_opt(node.body()); | ||
1046 | self.body_expr = Some(body); | ||
1047 | } | ||
1048 | |||
1049 | fn collect_fn_body(&mut self, node: ast::FnDef) { | ||
1050 | if let Some(param_list) = node.param_list() { | ||
1051 | if let Some(self_param) = param_list.self_param() { | ||
1052 | let ptr = AstPtr::new(&self_param); | ||
1053 | let param_pat = self.alloc_pat( | ||
1054 | Pat::Bind { | ||
1055 | name: SELF_PARAM, | ||
1056 | mode: BindingAnnotation::Unannotated, | ||
1057 | subpat: None, | ||
1058 | }, | ||
1059 | Either::B(ptr), | ||
1060 | ); | ||
1061 | self.params.push(param_pat); | ||
1062 | } | ||
1063 | |||
1064 | for param in param_list.params() { | ||
1065 | let pat = if let Some(pat) = param.pat() { | ||
1066 | pat | ||
1067 | } else { | ||
1068 | continue; | ||
1069 | }; | ||
1070 | let param_pat = self.collect_pat(pat); | ||
1071 | self.params.push(param_pat); | ||
1072 | } | ||
1073 | }; | ||
1074 | |||
1075 | let body = self.collect_block_opt(node.body()); | ||
1076 | self.body_expr = Some(body); | ||
1077 | } | ||
1078 | |||
1079 | fn finish(self) -> (Body, BodySourceMap) { | ||
1080 | let body = Body { | ||
1081 | owner: self.owner, | ||
1082 | exprs: self.exprs, | ||
1083 | pats: self.pats, | ||
1084 | params: self.params, | ||
1085 | body_expr: self.body_expr.expect("A body should have been collected"), | ||
1086 | }; | ||
1087 | (body, self.source_map) | ||
1088 | } | ||
1089 | } | ||
1090 | |||
1091 | impl From<ast::BinOp> for BinaryOp { | ||
1092 | fn from(ast_op: ast::BinOp) -> Self { | ||
1093 | match ast_op { | ||
1094 | ast::BinOp::BooleanOr => BinaryOp::LogicOp(LogicOp::Or), | ||
1095 | ast::BinOp::BooleanAnd => BinaryOp::LogicOp(LogicOp::And), | ||
1096 | ast::BinOp::EqualityTest => BinaryOp::CmpOp(CmpOp::Eq { negated: false }), | ||
1097 | ast::BinOp::NegatedEqualityTest => BinaryOp::CmpOp(CmpOp::Eq { negated: true }), | ||
1098 | ast::BinOp::LesserEqualTest => { | ||
1099 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Less, strict: false }) | ||
1100 | } | ||
1101 | ast::BinOp::GreaterEqualTest => { | ||
1102 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Greater, strict: false }) | ||
1103 | } | ||
1104 | ast::BinOp::LesserTest => { | ||
1105 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Less, strict: true }) | ||
1106 | } | ||
1107 | ast::BinOp::GreaterTest => { | ||
1108 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Greater, strict: true }) | ||
1109 | } | ||
1110 | ast::BinOp::Addition => BinaryOp::ArithOp(ArithOp::Add), | ||
1111 | ast::BinOp::Multiplication => BinaryOp::ArithOp(ArithOp::Mul), | ||
1112 | ast::BinOp::Subtraction => BinaryOp::ArithOp(ArithOp::Sub), | ||
1113 | ast::BinOp::Division => BinaryOp::ArithOp(ArithOp::Div), | ||
1114 | ast::BinOp::Remainder => BinaryOp::ArithOp(ArithOp::Rem), | ||
1115 | ast::BinOp::LeftShift => BinaryOp::ArithOp(ArithOp::Shl), | ||
1116 | ast::BinOp::RightShift => BinaryOp::ArithOp(ArithOp::Shr), | ||
1117 | ast::BinOp::BitwiseXor => BinaryOp::ArithOp(ArithOp::BitXor), | ||
1118 | ast::BinOp::BitwiseOr => BinaryOp::ArithOp(ArithOp::BitOr), | ||
1119 | ast::BinOp::BitwiseAnd => BinaryOp::ArithOp(ArithOp::BitAnd), | ||
1120 | ast::BinOp::Assignment => BinaryOp::Assignment { op: None }, | ||
1121 | ast::BinOp::AddAssign => BinaryOp::Assignment { op: Some(ArithOp::Add) }, | ||
1122 | ast::BinOp::DivAssign => BinaryOp::Assignment { op: Some(ArithOp::Div) }, | ||
1123 | ast::BinOp::MulAssign => BinaryOp::Assignment { op: Some(ArithOp::Mul) }, | ||
1124 | ast::BinOp::RemAssign => BinaryOp::Assignment { op: Some(ArithOp::Rem) }, | ||
1125 | ast::BinOp::ShlAssign => BinaryOp::Assignment { op: Some(ArithOp::Shl) }, | ||
1126 | ast::BinOp::ShrAssign => BinaryOp::Assignment { op: Some(ArithOp::Shr) }, | ||
1127 | ast::BinOp::SubAssign => BinaryOp::Assignment { op: Some(ArithOp::Sub) }, | ||
1128 | ast::BinOp::BitOrAssign => BinaryOp::Assignment { op: Some(ArithOp::BitOr) }, | ||
1129 | ast::BinOp::BitAndAssign => BinaryOp::Assignment { op: Some(ArithOp::BitAnd) }, | ||
1130 | ast::BinOp::BitXorAssign => BinaryOp::Assignment { op: Some(ArithOp::BitXor) }, | ||
1131 | } | ||
1132 | } | ||
1133 | } | ||
1134 | |||
1135 | pub(crate) fn body_with_source_map_query( | 538 | pub(crate) fn body_with_source_map_query( |
1136 | db: &impl HirDatabase, | 539 | db: &impl HirDatabase, |
1137 | def: DefWithBody, | 540 | def: DefWithBody, |
1138 | ) -> (Arc<Body>, Arc<BodySourceMap>) { | 541 | ) -> (Arc<Body>, Arc<BodySourceMap>) { |
1139 | let mut collector; | 542 | let mut params = None; |
1140 | 543 | ||
1141 | match def { | 544 | let (file_id, body) = match def { |
1142 | DefWithBody::Const(ref c) => { | 545 | DefWithBody::Function(f) => { |
1143 | let src = c.source(db); | ||
1144 | collector = ExprCollector::new(def, src.file_id, def.resolver(db), db); | ||
1145 | collector.collect_const_body(src.ast) | ||
1146 | } | ||
1147 | DefWithBody::Function(ref f) => { | ||
1148 | let src = f.source(db); | 546 | let src = f.source(db); |
1149 | collector = ExprCollector::new(def, src.file_id, def.resolver(db), db); | 547 | params = src.ast.param_list(); |
1150 | collector.collect_fn_body(src.ast) | 548 | (src.file_id, src.ast.body().map(ast::Expr::from)) |
549 | } | ||
550 | DefWithBody::Const(c) => { | ||
551 | let src = c.source(db); | ||
552 | (src.file_id, src.ast.body()) | ||
1151 | } | 553 | } |
1152 | DefWithBody::Static(ref s) => { | 554 | DefWithBody::Static(s) => { |
1153 | let src = s.source(db); | 555 | let src = s.source(db); |
1154 | collector = ExprCollector::new(def, src.file_id, def.resolver(db), db); | 556 | (src.file_id, src.ast.body()) |
1155 | collector.collect_static_body(src.ast) | ||
1156 | } | 557 | } |
1157 | } | 558 | }; |
1158 | 559 | ||
1159 | let (body, source_map) = collector.finish(); | 560 | let (body, source_map) = lower::lower(db, def.resolver(db), file_id, def, params, body); |
1160 | (Arc::new(body), Arc::new(source_map)) | 561 | (Arc::new(body), Arc::new(source_map)) |
1161 | } | 562 | } |
1162 | 563 | ||
diff --git a/crates/ra_hir/src/expr/lower.rs b/crates/ra_hir/src/expr/lower.rs new file mode 100644 index 000000000..6afd80989 --- /dev/null +++ b/crates/ra_hir/src/expr/lower.rs | |||
@@ -0,0 +1,630 @@ | |||
1 | use ra_arena::Arena; | ||
2 | use ra_syntax::{ | ||
3 | ast::{ | ||
4 | self, ArgListOwner, ArrayExprKind, LiteralKind, LoopBodyOwner, NameOwner, | ||
5 | TypeAscriptionOwner, | ||
6 | }, | ||
7 | AstNode, AstPtr, | ||
8 | }; | ||
9 | use test_utils::tested_by; | ||
10 | |||
11 | use crate::{ | ||
12 | name::{AsName, Name, SELF_PARAM}, | ||
13 | path::GenericArgs, | ||
14 | ty::primitive::{FloatTy, IntTy, UncertainFloatTy, UncertainIntTy}, | ||
15 | type_ref::TypeRef, | ||
16 | DefWithBody, Either, HirDatabase, HirFileId, MacroCallLoc, MacroFileKind, Mutability, Path, | ||
17 | Resolver, Source, | ||
18 | }; | ||
19 | |||
20 | use super::{ | ||
21 | ArithOp, Array, BinaryOp, BindingAnnotation, Body, BodySourceMap, CmpOp, Expr, ExprId, Literal, | ||
22 | LogicOp, MatchArm, Ordering, Pat, PatId, PatPtr, RecordFieldPat, RecordLitField, Statement, | ||
23 | }; | ||
24 | |||
25 | pub(super) fn lower( | ||
26 | db: &impl HirDatabase, | ||
27 | resolver: Resolver, | ||
28 | file_id: HirFileId, | ||
29 | owner: DefWithBody, | ||
30 | params: Option<ast::ParamList>, | ||
31 | body: Option<ast::Expr>, | ||
32 | ) -> (Body, BodySourceMap) { | ||
33 | ExprCollector { | ||
34 | resolver, | ||
35 | db, | ||
36 | original_file_id: file_id, | ||
37 | current_file_id: file_id, | ||
38 | source_map: BodySourceMap::default(), | ||
39 | body: Body { | ||
40 | owner, | ||
41 | exprs: Arena::default(), | ||
42 | pats: Arena::default(), | ||
43 | params: Vec::new(), | ||
44 | body_expr: ExprId((!0).into()), | ||
45 | }, | ||
46 | } | ||
47 | .collect(params, body) | ||
48 | } | ||
49 | |||
50 | struct ExprCollector<DB> { | ||
51 | db: DB, | ||
52 | resolver: Resolver, | ||
53 | // Expr collector expands macros along the way. original points to the file | ||
54 | // we started with, current points to the current macro expansion. source | ||
55 | // maps don't support macros yet, so we only record info into source map if | ||
56 | // current == original (see #1196) | ||
57 | original_file_id: HirFileId, | ||
58 | current_file_id: HirFileId, | ||
59 | |||
60 | body: Body, | ||
61 | source_map: BodySourceMap, | ||
62 | } | ||
63 | |||
64 | impl<'a, DB> ExprCollector<&'a DB> | ||
65 | where | ||
66 | DB: HirDatabase, | ||
67 | { | ||
68 | fn collect( | ||
69 | mut self, | ||
70 | param_list: Option<ast::ParamList>, | ||
71 | body: Option<ast::Expr>, | ||
72 | ) -> (Body, BodySourceMap) { | ||
73 | if let Some(param_list) = param_list { | ||
74 | if let Some(self_param) = param_list.self_param() { | ||
75 | let ptr = AstPtr::new(&self_param); | ||
76 | let param_pat = self.alloc_pat( | ||
77 | Pat::Bind { | ||
78 | name: SELF_PARAM, | ||
79 | mode: BindingAnnotation::Unannotated, | ||
80 | subpat: None, | ||
81 | }, | ||
82 | Either::B(ptr), | ||
83 | ); | ||
84 | self.body.params.push(param_pat); | ||
85 | } | ||
86 | |||
87 | for param in param_list.params() { | ||
88 | let pat = match param.pat() { | ||
89 | None => continue, | ||
90 | Some(pat) => pat, | ||
91 | }; | ||
92 | let param_pat = self.collect_pat(pat); | ||
93 | self.body.params.push(param_pat); | ||
94 | } | ||
95 | }; | ||
96 | |||
97 | self.body.body_expr = self.collect_expr_opt(body); | ||
98 | (self.body, self.source_map) | ||
99 | } | ||
100 | |||
101 | fn alloc_expr(&mut self, expr: Expr, ptr: AstPtr<ast::Expr>) -> ExprId { | ||
102 | let ptr = Either::A(ptr); | ||
103 | let id = self.body.exprs.alloc(expr); | ||
104 | if self.current_file_id == self.original_file_id { | ||
105 | self.source_map.expr_map.insert(ptr, id); | ||
106 | } | ||
107 | self.source_map | ||
108 | .expr_map_back | ||
109 | .insert(id, Source { file_id: self.current_file_id, ast: ptr }); | ||
110 | id | ||
111 | } | ||
112 | // desugared exprs don't have ptr, that's wrong and should be fixed | ||
113 | // somehow. | ||
114 | fn alloc_expr_desugared(&mut self, expr: Expr) -> ExprId { | ||
115 | self.body.exprs.alloc(expr) | ||
116 | } | ||
117 | fn alloc_expr_field_shorthand(&mut self, expr: Expr, ptr: AstPtr<ast::RecordField>) -> ExprId { | ||
118 | let ptr = Either::B(ptr); | ||
119 | let id = self.body.exprs.alloc(expr); | ||
120 | if self.current_file_id == self.original_file_id { | ||
121 | self.source_map.expr_map.insert(ptr, id); | ||
122 | } | ||
123 | self.source_map | ||
124 | .expr_map_back | ||
125 | .insert(id, Source { file_id: self.current_file_id, ast: ptr }); | ||
126 | id | ||
127 | } | ||
128 | fn alloc_pat(&mut self, pat: Pat, ptr: PatPtr) -> PatId { | ||
129 | let id = self.body.pats.alloc(pat); | ||
130 | if self.current_file_id == self.original_file_id { | ||
131 | self.source_map.pat_map.insert(ptr, id); | ||
132 | } | ||
133 | self.source_map.pat_map_back.insert(id, Source { file_id: self.current_file_id, ast: ptr }); | ||
134 | id | ||
135 | } | ||
136 | |||
137 | fn empty_block(&mut self) -> ExprId { | ||
138 | let block = Expr::Block { statements: Vec::new(), tail: None }; | ||
139 | self.body.exprs.alloc(block) | ||
140 | } | ||
141 | |||
142 | fn missing_expr(&mut self) -> ExprId { | ||
143 | self.body.exprs.alloc(Expr::Missing) | ||
144 | } | ||
145 | |||
146 | fn missing_pat(&mut self) -> PatId { | ||
147 | self.body.pats.alloc(Pat::Missing) | ||
148 | } | ||
149 | |||
150 | fn collect_expr(&mut self, expr: ast::Expr) -> ExprId { | ||
151 | let syntax_ptr = AstPtr::new(&expr); | ||
152 | match expr { | ||
153 | ast::Expr::IfExpr(e) => { | ||
154 | let then_branch = self.collect_block_opt(e.then_branch()); | ||
155 | |||
156 | let else_branch = e.else_branch().map(|b| match b { | ||
157 | ast::ElseBranch::Block(it) => self.collect_block(it), | ||
158 | ast::ElseBranch::IfExpr(elif) => { | ||
159 | let expr: ast::Expr = ast::Expr::cast(elif.syntax().clone()).unwrap(); | ||
160 | self.collect_expr(expr) | ||
161 | } | ||
162 | }); | ||
163 | |||
164 | let condition = match e.condition() { | ||
165 | None => self.missing_expr(), | ||
166 | Some(condition) => match condition.pat() { | ||
167 | None => self.collect_expr_opt(condition.expr()), | ||
168 | // if let -- desugar to match | ||
169 | Some(pat) => { | ||
170 | let pat = self.collect_pat(pat); | ||
171 | let match_expr = self.collect_expr_opt(condition.expr()); | ||
172 | let placeholder_pat = self.missing_pat(); | ||
173 | let arms = vec![ | ||
174 | MatchArm { pats: vec![pat], expr: then_branch, guard: None }, | ||
175 | MatchArm { | ||
176 | pats: vec![placeholder_pat], | ||
177 | expr: else_branch.unwrap_or_else(|| self.empty_block()), | ||
178 | guard: None, | ||
179 | }, | ||
180 | ]; | ||
181 | return self | ||
182 | .alloc_expr(Expr::Match { expr: match_expr, arms }, syntax_ptr); | ||
183 | } | ||
184 | }, | ||
185 | }; | ||
186 | |||
187 | self.alloc_expr(Expr::If { condition, then_branch, else_branch }, syntax_ptr) | ||
188 | } | ||
189 | ast::Expr::TryBlockExpr(e) => { | ||
190 | let body = self.collect_block_opt(e.body()); | ||
191 | self.alloc_expr(Expr::TryBlock { body }, syntax_ptr) | ||
192 | } | ||
193 | ast::Expr::BlockExpr(e) => self.collect_block(e), | ||
194 | ast::Expr::LoopExpr(e) => { | ||
195 | let body = self.collect_block_opt(e.loop_body()); | ||
196 | self.alloc_expr(Expr::Loop { body }, syntax_ptr) | ||
197 | } | ||
198 | ast::Expr::WhileExpr(e) => { | ||
199 | let body = self.collect_block_opt(e.loop_body()); | ||
200 | |||
201 | let condition = match e.condition() { | ||
202 | None => self.missing_expr(), | ||
203 | Some(condition) => match condition.pat() { | ||
204 | None => self.collect_expr_opt(condition.expr()), | ||
205 | // if let -- desugar to match | ||
206 | Some(pat) => { | ||
207 | tested_by!(infer_while_let); | ||
208 | let pat = self.collect_pat(pat); | ||
209 | let match_expr = self.collect_expr_opt(condition.expr()); | ||
210 | let placeholder_pat = self.missing_pat(); | ||
211 | let break_ = self.alloc_expr_desugared(Expr::Break { expr: None }); | ||
212 | let arms = vec![ | ||
213 | MatchArm { pats: vec![pat], expr: body, guard: None }, | ||
214 | MatchArm { pats: vec![placeholder_pat], expr: break_, guard: None }, | ||
215 | ]; | ||
216 | let match_expr = | ||
217 | self.alloc_expr_desugared(Expr::Match { expr: match_expr, arms }); | ||
218 | return self.alloc_expr(Expr::Loop { body: match_expr }, syntax_ptr); | ||
219 | } | ||
220 | }, | ||
221 | }; | ||
222 | |||
223 | self.alloc_expr(Expr::While { condition, body }, syntax_ptr) | ||
224 | } | ||
225 | ast::Expr::ForExpr(e) => { | ||
226 | let iterable = self.collect_expr_opt(e.iterable()); | ||
227 | let pat = self.collect_pat_opt(e.pat()); | ||
228 | let body = self.collect_block_opt(e.loop_body()); | ||
229 | self.alloc_expr(Expr::For { iterable, pat, body }, syntax_ptr) | ||
230 | } | ||
231 | ast::Expr::CallExpr(e) => { | ||
232 | let callee = self.collect_expr_opt(e.expr()); | ||
233 | let args = if let Some(arg_list) = e.arg_list() { | ||
234 | arg_list.args().map(|e| self.collect_expr(e)).collect() | ||
235 | } else { | ||
236 | Vec::new() | ||
237 | }; | ||
238 | self.alloc_expr(Expr::Call { callee, args }, syntax_ptr) | ||
239 | } | ||
240 | ast::Expr::MethodCallExpr(e) => { | ||
241 | let receiver = self.collect_expr_opt(e.expr()); | ||
242 | let args = if let Some(arg_list) = e.arg_list() { | ||
243 | arg_list.args().map(|e| self.collect_expr(e)).collect() | ||
244 | } else { | ||
245 | Vec::new() | ||
246 | }; | ||
247 | let method_name = e.name_ref().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); | ||
248 | let generic_args = e.type_arg_list().and_then(GenericArgs::from_ast); | ||
249 | self.alloc_expr( | ||
250 | Expr::MethodCall { receiver, method_name, args, generic_args }, | ||
251 | syntax_ptr, | ||
252 | ) | ||
253 | } | ||
254 | ast::Expr::MatchExpr(e) => { | ||
255 | let expr = self.collect_expr_opt(e.expr()); | ||
256 | let arms = if let Some(match_arm_list) = e.match_arm_list() { | ||
257 | match_arm_list | ||
258 | .arms() | ||
259 | .map(|arm| MatchArm { | ||
260 | pats: arm.pats().map(|p| self.collect_pat(p)).collect(), | ||
261 | expr: self.collect_expr_opt(arm.expr()), | ||
262 | guard: arm | ||
263 | .guard() | ||
264 | .and_then(|guard| guard.expr()) | ||
265 | .map(|e| self.collect_expr(e)), | ||
266 | }) | ||
267 | .collect() | ||
268 | } else { | ||
269 | Vec::new() | ||
270 | }; | ||
271 | self.alloc_expr(Expr::Match { expr, arms }, syntax_ptr) | ||
272 | } | ||
273 | ast::Expr::PathExpr(e) => { | ||
274 | let path = | ||
275 | e.path().and_then(Path::from_ast).map(Expr::Path).unwrap_or(Expr::Missing); | ||
276 | self.alloc_expr(path, syntax_ptr) | ||
277 | } | ||
278 | ast::Expr::ContinueExpr(_e) => { | ||
279 | // FIXME: labels | ||
280 | self.alloc_expr(Expr::Continue, syntax_ptr) | ||
281 | } | ||
282 | ast::Expr::BreakExpr(e) => { | ||
283 | let expr = e.expr().map(|e| self.collect_expr(e)); | ||
284 | self.alloc_expr(Expr::Break { expr }, syntax_ptr) | ||
285 | } | ||
286 | ast::Expr::ParenExpr(e) => { | ||
287 | let inner = self.collect_expr_opt(e.expr()); | ||
288 | // make the paren expr point to the inner expression as well | ||
289 | self.source_map.expr_map.insert(Either::A(syntax_ptr), inner); | ||
290 | inner | ||
291 | } | ||
292 | ast::Expr::ReturnExpr(e) => { | ||
293 | let expr = e.expr().map(|e| self.collect_expr(e)); | ||
294 | self.alloc_expr(Expr::Return { expr }, syntax_ptr) | ||
295 | } | ||
296 | ast::Expr::RecordLit(e) => { | ||
297 | let path = e.path().and_then(Path::from_ast); | ||
298 | let mut field_ptrs = Vec::new(); | ||
299 | let record_lit = if let Some(nfl) = e.record_field_list() { | ||
300 | let fields = nfl | ||
301 | .fields() | ||
302 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) | ||
303 | .map(|field| RecordLitField { | ||
304 | name: field | ||
305 | .name_ref() | ||
306 | .map(|nr| nr.as_name()) | ||
307 | .unwrap_or_else(Name::missing), | ||
308 | expr: if let Some(e) = field.expr() { | ||
309 | self.collect_expr(e) | ||
310 | } else if let Some(nr) = field.name_ref() { | ||
311 | // field shorthand | ||
312 | self.alloc_expr_field_shorthand( | ||
313 | Expr::Path(Path::from_name_ref(&nr)), | ||
314 | AstPtr::new(&field), | ||
315 | ) | ||
316 | } else { | ||
317 | self.missing_expr() | ||
318 | }, | ||
319 | }) | ||
320 | .collect(); | ||
321 | let spread = nfl.spread().map(|s| self.collect_expr(s)); | ||
322 | Expr::RecordLit { path, fields, spread } | ||
323 | } else { | ||
324 | Expr::RecordLit { path, fields: Vec::new(), spread: None } | ||
325 | }; | ||
326 | |||
327 | let res = self.alloc_expr(record_lit, syntax_ptr); | ||
328 | for (i, ptr) in field_ptrs.into_iter().enumerate() { | ||
329 | self.source_map.field_map.insert((res, i), ptr); | ||
330 | } | ||
331 | res | ||
332 | } | ||
333 | ast::Expr::FieldExpr(e) => { | ||
334 | let expr = self.collect_expr_opt(e.expr()); | ||
335 | let name = match e.field_access() { | ||
336 | Some(kind) => kind.as_name(), | ||
337 | _ => Name::missing(), | ||
338 | }; | ||
339 | self.alloc_expr(Expr::Field { expr, name }, syntax_ptr) | ||
340 | } | ||
341 | ast::Expr::AwaitExpr(e) => { | ||
342 | let expr = self.collect_expr_opt(e.expr()); | ||
343 | self.alloc_expr(Expr::Await { expr }, syntax_ptr) | ||
344 | } | ||
345 | ast::Expr::TryExpr(e) => { | ||
346 | let expr = self.collect_expr_opt(e.expr()); | ||
347 | self.alloc_expr(Expr::Try { expr }, syntax_ptr) | ||
348 | } | ||
349 | ast::Expr::CastExpr(e) => { | ||
350 | let expr = self.collect_expr_opt(e.expr()); | ||
351 | let type_ref = TypeRef::from_ast_opt(e.type_ref()); | ||
352 | self.alloc_expr(Expr::Cast { expr, type_ref }, syntax_ptr) | ||
353 | } | ||
354 | ast::Expr::RefExpr(e) => { | ||
355 | let expr = self.collect_expr_opt(e.expr()); | ||
356 | let mutability = Mutability::from_mutable(e.is_mut()); | ||
357 | self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) | ||
358 | } | ||
359 | ast::Expr::PrefixExpr(e) => { | ||
360 | let expr = self.collect_expr_opt(e.expr()); | ||
361 | if let Some(op) = e.op_kind() { | ||
362 | self.alloc_expr(Expr::UnaryOp { expr, op }, syntax_ptr) | ||
363 | } else { | ||
364 | self.alloc_expr(Expr::Missing, syntax_ptr) | ||
365 | } | ||
366 | } | ||
367 | ast::Expr::LambdaExpr(e) => { | ||
368 | let mut args = Vec::new(); | ||
369 | let mut arg_types = Vec::new(); | ||
370 | if let Some(pl) = e.param_list() { | ||
371 | for param in pl.params() { | ||
372 | let pat = self.collect_pat_opt(param.pat()); | ||
373 | let type_ref = param.ascribed_type().map(TypeRef::from_ast); | ||
374 | args.push(pat); | ||
375 | arg_types.push(type_ref); | ||
376 | } | ||
377 | } | ||
378 | let body = self.collect_expr_opt(e.body()); | ||
379 | self.alloc_expr(Expr::Lambda { args, arg_types, body }, syntax_ptr) | ||
380 | } | ||
381 | ast::Expr::BinExpr(e) => { | ||
382 | let lhs = self.collect_expr_opt(e.lhs()); | ||
383 | let rhs = self.collect_expr_opt(e.rhs()); | ||
384 | let op = e.op_kind().map(BinaryOp::from); | ||
385 | self.alloc_expr(Expr::BinaryOp { lhs, rhs, op }, syntax_ptr) | ||
386 | } | ||
387 | ast::Expr::TupleExpr(e) => { | ||
388 | let exprs = e.exprs().map(|expr| self.collect_expr(expr)).collect(); | ||
389 | self.alloc_expr(Expr::Tuple { exprs }, syntax_ptr) | ||
390 | } | ||
391 | |||
392 | ast::Expr::ArrayExpr(e) => { | ||
393 | let kind = e.kind(); | ||
394 | |||
395 | match kind { | ||
396 | ArrayExprKind::ElementList(e) => { | ||
397 | let exprs = e.map(|expr| self.collect_expr(expr)).collect(); | ||
398 | self.alloc_expr(Expr::Array(Array::ElementList(exprs)), syntax_ptr) | ||
399 | } | ||
400 | ArrayExprKind::Repeat { initializer, repeat } => { | ||
401 | let initializer = self.collect_expr_opt(initializer); | ||
402 | let repeat = self.collect_expr_opt(repeat); | ||
403 | self.alloc_expr( | ||
404 | Expr::Array(Array::Repeat { initializer, repeat }), | ||
405 | syntax_ptr, | ||
406 | ) | ||
407 | } | ||
408 | } | ||
409 | } | ||
410 | |||
411 | ast::Expr::Literal(e) => { | ||
412 | let lit = match e.kind() { | ||
413 | LiteralKind::IntNumber { suffix } => { | ||
414 | let known_name = suffix | ||
415 | .and_then(|it| IntTy::from_suffix(&it).map(UncertainIntTy::Known)); | ||
416 | |||
417 | Literal::Int( | ||
418 | Default::default(), | ||
419 | known_name.unwrap_or(UncertainIntTy::Unknown), | ||
420 | ) | ||
421 | } | ||
422 | LiteralKind::FloatNumber { suffix } => { | ||
423 | let known_name = suffix | ||
424 | .and_then(|it| FloatTy::from_suffix(&it).map(UncertainFloatTy::Known)); | ||
425 | |||
426 | Literal::Float( | ||
427 | Default::default(), | ||
428 | known_name.unwrap_or(UncertainFloatTy::Unknown), | ||
429 | ) | ||
430 | } | ||
431 | LiteralKind::ByteString => Literal::ByteString(Default::default()), | ||
432 | LiteralKind::String => Literal::String(Default::default()), | ||
433 | LiteralKind::Byte => { | ||
434 | Literal::Int(Default::default(), UncertainIntTy::Known(IntTy::u8())) | ||
435 | } | ||
436 | LiteralKind::Bool => Literal::Bool(Default::default()), | ||
437 | LiteralKind::Char => Literal::Char(Default::default()), | ||
438 | }; | ||
439 | self.alloc_expr(Expr::Literal(lit), syntax_ptr) | ||
440 | } | ||
441 | ast::Expr::IndexExpr(e) => { | ||
442 | let base = self.collect_expr_opt(e.base()); | ||
443 | let index = self.collect_expr_opt(e.index()); | ||
444 | self.alloc_expr(Expr::Index { base, index }, syntax_ptr) | ||
445 | } | ||
446 | |||
447 | // FIXME implement HIR for these: | ||
448 | ast::Expr::Label(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), | ||
449 | ast::Expr::RangeExpr(_e) => self.alloc_expr(Expr::Missing, syntax_ptr), | ||
450 | ast::Expr::MacroCall(e) => { | ||
451 | let ast_id = self | ||
452 | .db | ||
453 | .ast_id_map(self.current_file_id) | ||
454 | .ast_id(&e) | ||
455 | .with_file_id(self.current_file_id); | ||
456 | |||
457 | if let Some(path) = e.path().and_then(Path::from_ast) { | ||
458 | if let Some(def) = self.resolver.resolve_path_as_macro(self.db, &path) { | ||
459 | let call_id = MacroCallLoc { def: def.id, ast_id }.id(self.db); | ||
460 | let file_id = call_id.as_file(MacroFileKind::Expr); | ||
461 | if let Some(node) = self.db.parse_or_expand(file_id) { | ||
462 | if let Some(expr) = ast::Expr::cast(node) { | ||
463 | log::debug!("macro expansion {:#?}", expr.syntax()); | ||
464 | let old_file_id = | ||
465 | std::mem::replace(&mut self.current_file_id, file_id); | ||
466 | let id = self.collect_expr(expr); | ||
467 | self.current_file_id = old_file_id; | ||
468 | return id; | ||
469 | } | ||
470 | } | ||
471 | } | ||
472 | } | ||
473 | // FIXME: Instead of just dropping the error from expansion | ||
474 | // report it | ||
475 | self.alloc_expr(Expr::Missing, syntax_ptr) | ||
476 | } | ||
477 | } | ||
478 | } | ||
479 | |||
480 | fn collect_expr_opt(&mut self, expr: Option<ast::Expr>) -> ExprId { | ||
481 | if let Some(expr) = expr { | ||
482 | self.collect_expr(expr) | ||
483 | } else { | ||
484 | self.missing_expr() | ||
485 | } | ||
486 | } | ||
487 | |||
488 | fn collect_block(&mut self, expr: ast::BlockExpr) -> ExprId { | ||
489 | let syntax_node_ptr = AstPtr::new(&expr.clone().into()); | ||
490 | let block = match expr.block() { | ||
491 | Some(block) => block, | ||
492 | None => return self.alloc_expr(Expr::Missing, syntax_node_ptr), | ||
493 | }; | ||
494 | let statements = block | ||
495 | .statements() | ||
496 | .map(|s| match s { | ||
497 | ast::Stmt::LetStmt(stmt) => { | ||
498 | let pat = self.collect_pat_opt(stmt.pat()); | ||
499 | let type_ref = stmt.ascribed_type().map(TypeRef::from_ast); | ||
500 | let initializer = stmt.initializer().map(|e| self.collect_expr(e)); | ||
501 | Statement::Let { pat, type_ref, initializer } | ||
502 | } | ||
503 | ast::Stmt::ExprStmt(stmt) => Statement::Expr(self.collect_expr_opt(stmt.expr())), | ||
504 | }) | ||
505 | .collect(); | ||
506 | let tail = block.expr().map(|e| self.collect_expr(e)); | ||
507 | self.alloc_expr(Expr::Block { statements, tail }, syntax_node_ptr) | ||
508 | } | ||
509 | |||
510 | fn collect_block_opt(&mut self, expr: Option<ast::BlockExpr>) -> ExprId { | ||
511 | if let Some(block) = expr { | ||
512 | self.collect_block(block) | ||
513 | } else { | ||
514 | self.missing_expr() | ||
515 | } | ||
516 | } | ||
517 | |||
518 | fn collect_pat(&mut self, pat: ast::Pat) -> PatId { | ||
519 | let pattern = match &pat { | ||
520 | ast::Pat::BindPat(bp) => { | ||
521 | let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); | ||
522 | let annotation = BindingAnnotation::new(bp.is_mutable(), bp.is_ref()); | ||
523 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); | ||
524 | Pat::Bind { name, mode: annotation, subpat } | ||
525 | } | ||
526 | ast::Pat::TupleStructPat(p) => { | ||
527 | let path = p.path().and_then(Path::from_ast); | ||
528 | let args = p.args().map(|p| self.collect_pat(p)).collect(); | ||
529 | Pat::TupleStruct { path, args } | ||
530 | } | ||
531 | ast::Pat::RefPat(p) => { | ||
532 | let pat = self.collect_pat_opt(p.pat()); | ||
533 | let mutability = Mutability::from_mutable(p.is_mut()); | ||
534 | Pat::Ref { pat, mutability } | ||
535 | } | ||
536 | ast::Pat::PathPat(p) => { | ||
537 | let path = p.path().and_then(Path::from_ast); | ||
538 | path.map(Pat::Path).unwrap_or(Pat::Missing) | ||
539 | } | ||
540 | ast::Pat::TuplePat(p) => { | ||
541 | let args = p.args().map(|p| self.collect_pat(p)).collect(); | ||
542 | Pat::Tuple(args) | ||
543 | } | ||
544 | ast::Pat::PlaceholderPat(_) => Pat::Wild, | ||
545 | ast::Pat::RecordPat(p) => { | ||
546 | let path = p.path().and_then(Path::from_ast); | ||
547 | let record_field_pat_list = | ||
548 | p.record_field_pat_list().expect("every struct should have a field list"); | ||
549 | let mut fields: Vec<_> = record_field_pat_list | ||
550 | .bind_pats() | ||
551 | .filter_map(|bind_pat| { | ||
552 | let ast_pat = | ||
553 | ast::Pat::cast(bind_pat.syntax().clone()).expect("bind pat is a pat"); | ||
554 | let pat = self.collect_pat(ast_pat); | ||
555 | let name = bind_pat.name()?.as_name(); | ||
556 | Some(RecordFieldPat { name, pat }) | ||
557 | }) | ||
558 | .collect(); | ||
559 | let iter = record_field_pat_list.record_field_pats().filter_map(|f| { | ||
560 | let ast_pat = f.pat()?; | ||
561 | let pat = self.collect_pat(ast_pat); | ||
562 | let name = f.name()?.as_name(); | ||
563 | Some(RecordFieldPat { name, pat }) | ||
564 | }); | ||
565 | fields.extend(iter); | ||
566 | |||
567 | Pat::Record { path, args: fields } | ||
568 | } | ||
569 | |||
570 | // FIXME: implement | ||
571 | ast::Pat::BoxPat(_) => Pat::Missing, | ||
572 | ast::Pat::LiteralPat(_) => Pat::Missing, | ||
573 | ast::Pat::SlicePat(_) | ast::Pat::RangePat(_) => Pat::Missing, | ||
574 | }; | ||
575 | let ptr = AstPtr::new(&pat); | ||
576 | self.alloc_pat(pattern, Either::A(ptr)) | ||
577 | } | ||
578 | |||
579 | fn collect_pat_opt(&mut self, pat: Option<ast::Pat>) -> PatId { | ||
580 | if let Some(pat) = pat { | ||
581 | self.collect_pat(pat) | ||
582 | } else { | ||
583 | self.missing_pat() | ||
584 | } | ||
585 | } | ||
586 | } | ||
587 | |||
588 | impl From<ast::BinOp> for BinaryOp { | ||
589 | fn from(ast_op: ast::BinOp) -> Self { | ||
590 | match ast_op { | ||
591 | ast::BinOp::BooleanOr => BinaryOp::LogicOp(LogicOp::Or), | ||
592 | ast::BinOp::BooleanAnd => BinaryOp::LogicOp(LogicOp::And), | ||
593 | ast::BinOp::EqualityTest => BinaryOp::CmpOp(CmpOp::Eq { negated: false }), | ||
594 | ast::BinOp::NegatedEqualityTest => BinaryOp::CmpOp(CmpOp::Eq { negated: true }), | ||
595 | ast::BinOp::LesserEqualTest => { | ||
596 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Less, strict: false }) | ||
597 | } | ||
598 | ast::BinOp::GreaterEqualTest => { | ||
599 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Greater, strict: false }) | ||
600 | } | ||
601 | ast::BinOp::LesserTest => { | ||
602 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Less, strict: true }) | ||
603 | } | ||
604 | ast::BinOp::GreaterTest => { | ||
605 | BinaryOp::CmpOp(CmpOp::Ord { ordering: Ordering::Greater, strict: true }) | ||
606 | } | ||
607 | ast::BinOp::Addition => BinaryOp::ArithOp(ArithOp::Add), | ||
608 | ast::BinOp::Multiplication => BinaryOp::ArithOp(ArithOp::Mul), | ||
609 | ast::BinOp::Subtraction => BinaryOp::ArithOp(ArithOp::Sub), | ||
610 | ast::BinOp::Division => BinaryOp::ArithOp(ArithOp::Div), | ||
611 | ast::BinOp::Remainder => BinaryOp::ArithOp(ArithOp::Rem), | ||
612 | ast::BinOp::LeftShift => BinaryOp::ArithOp(ArithOp::Shl), | ||
613 | ast::BinOp::RightShift => BinaryOp::ArithOp(ArithOp::Shr), | ||
614 | ast::BinOp::BitwiseXor => BinaryOp::ArithOp(ArithOp::BitXor), | ||
615 | ast::BinOp::BitwiseOr => BinaryOp::ArithOp(ArithOp::BitOr), | ||
616 | ast::BinOp::BitwiseAnd => BinaryOp::ArithOp(ArithOp::BitAnd), | ||
617 | ast::BinOp::Assignment => BinaryOp::Assignment { op: None }, | ||
618 | ast::BinOp::AddAssign => BinaryOp::Assignment { op: Some(ArithOp::Add) }, | ||
619 | ast::BinOp::DivAssign => BinaryOp::Assignment { op: Some(ArithOp::Div) }, | ||
620 | ast::BinOp::MulAssign => BinaryOp::Assignment { op: Some(ArithOp::Mul) }, | ||
621 | ast::BinOp::RemAssign => BinaryOp::Assignment { op: Some(ArithOp::Rem) }, | ||
622 | ast::BinOp::ShlAssign => BinaryOp::Assignment { op: Some(ArithOp::Shl) }, | ||
623 | ast::BinOp::ShrAssign => BinaryOp::Assignment { op: Some(ArithOp::Shr) }, | ||
624 | ast::BinOp::SubAssign => BinaryOp::Assignment { op: Some(ArithOp::Sub) }, | ||
625 | ast::BinOp::BitOrAssign => BinaryOp::Assignment { op: Some(ArithOp::BitOr) }, | ||
626 | ast::BinOp::BitAndAssign => BinaryOp::Assignment { op: Some(ArithOp::BitAnd) }, | ||
627 | ast::BinOp::BitXorAssign => BinaryOp::Assignment { op: Some(ArithOp::BitXor) }, | ||
628 | } | ||
629 | } | ||
630 | } | ||
diff --git a/crates/ra_hir/src/expr/scope.rs b/crates/ra_hir/src/expr/scope.rs index 79e1857f9..b6d7f3fc1 100644 --- a/crates/ra_hir/src/expr/scope.rs +++ b/crates/ra_hir/src/expr/scope.rs | |||
@@ -172,7 +172,7 @@ fn compute_expr_scopes(expr: ExprId, body: &Body, scopes: &mut ExprScopes, scope | |||
172 | #[cfg(test)] | 172 | #[cfg(test)] |
173 | mod tests { | 173 | mod tests { |
174 | use ra_db::SourceDatabase; | 174 | use ra_db::SourceDatabase; |
175 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode, SyntaxNodePtr}; | 175 | use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; |
176 | use test_utils::{assert_eq_text, extract_offset}; | 176 | use test_utils::{assert_eq_text, extract_offset}; |
177 | 177 | ||
178 | use crate::{mock::MockDatabase, source_binder::SourceAnalyzer}; | 178 | use crate::{mock::MockDatabase, source_binder::SourceAnalyzer}; |
@@ -194,8 +194,7 @@ mod tests { | |||
194 | let analyzer = SourceAnalyzer::new(&db, file_id, marker.syntax(), None); | 194 | let analyzer = SourceAnalyzer::new(&db, file_id, marker.syntax(), None); |
195 | 195 | ||
196 | let scopes = analyzer.scopes(); | 196 | let scopes = analyzer.scopes(); |
197 | let expr_id = | 197 | let expr_id = analyzer.body_source_map().node_expr(&marker.into()).unwrap(); |
198 | analyzer.body_source_map().syntax_expr(SyntaxNodePtr::new(marker.syntax())).unwrap(); | ||
199 | let scope = scopes.scope_for(expr_id); | 198 | let scope = scopes.scope_for(expr_id); |
200 | 199 | ||
201 | let actual = scopes | 200 | let actual = scopes |
diff --git a/crates/ra_hir/src/expr/validation.rs b/crates/ra_hir/src/expr/validation.rs index c8ae19869..1202913e2 100644 --- a/crates/ra_hir/src/expr/validation.rs +++ b/crates/ra_hir/src/expr/validation.rs | |||
@@ -1,9 +1,8 @@ | |||
1 | use rustc_hash::FxHashSet; | ||
2 | use std::sync::Arc; | 1 | use std::sync::Arc; |
3 | 2 | ||
4 | use ra_syntax::ast::{AstNode, RecordLit}; | 3 | use ra_syntax::ast; |
4 | use rustc_hash::FxHashSet; | ||
5 | 5 | ||
6 | use super::{Expr, ExprId, RecordLitField}; | ||
7 | use crate::{ | 6 | use crate::{ |
8 | adt::AdtDef, | 7 | adt::AdtDef, |
9 | diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr}, | 8 | diagnostics::{DiagnosticSink, MissingFields, MissingOkInTailExpr}, |
@@ -11,9 +10,10 @@ use crate::{ | |||
11 | name, | 10 | name, |
12 | path::{PathKind, PathSegment}, | 11 | path::{PathKind, PathSegment}, |
13 | ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, | 12 | ty::{ApplicationTy, InferenceResult, Ty, TypeCtor}, |
14 | Function, HasSource, HirDatabase, ModuleDef, Name, Path, PerNs, Resolution, | 13 | Function, HirDatabase, ModuleDef, Name, Path, PerNs, Resolution, |
15 | }; | 14 | }; |
16 | use ra_syntax::ast; | 15 | |
16 | use super::{Expr, ExprId, RecordLitField}; | ||
17 | 17 | ||
18 | pub(crate) struct ExprValidator<'a, 'b: 'a> { | 18 | pub(crate) struct ExprValidator<'a, 'b: 'a> { |
19 | func: Function, | 19 | func: Function, |
@@ -79,21 +79,20 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
79 | return; | 79 | return; |
80 | } | 80 | } |
81 | let source_map = self.func.body_source_map(db); | 81 | let source_map = self.func.body_source_map(db); |
82 | let file_id = self.func.source(db).file_id; | 82 | |
83 | let parse = db.parse(file_id.original_file(db)); | 83 | if let Some(source_ptr) = source_map.expr_syntax(id) { |
84 | let source_file = parse.tree(); | 84 | if let Some(expr) = source_ptr.ast.a() { |
85 | if let Some(field_list_node) = source_map | 85 | let root = source_ptr.file_syntax(db); |
86 | .expr_syntax(id) | 86 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { |
87 | .map(|ptr| ptr.to_node(source_file.syntax())) | 87 | if let Some(field_list) = record_lit.record_field_list() { |
88 | .and_then(RecordLit::cast) | 88 | self.sink.push(MissingFields { |
89 | .and_then(|lit| lit.record_field_list()) | 89 | file: source_ptr.file_id, |
90 | { | 90 | field_list: AstPtr::new(&field_list), |
91 | let field_list_ptr = AstPtr::new(&field_list_node); | 91 | missed_fields, |
92 | self.sink.push(MissingFields { | 92 | }) |
93 | file: file_id, | 93 | } |
94 | field_list: field_list_ptr, | 94 | } |
95 | missed_fields, | 95 | } |
96 | }) | ||
97 | } | 96 | } |
98 | } | 97 | } |
99 | 98 | ||
@@ -133,10 +132,11 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
133 | 132 | ||
134 | if params.len() == 2 && ¶ms[0] == &mismatch.actual { | 133 | if params.len() == 2 && ¶ms[0] == &mismatch.actual { |
135 | let source_map = self.func.body_source_map(db); | 134 | let source_map = self.func.body_source_map(db); |
136 | let file_id = self.func.source(db).file_id; | ||
137 | 135 | ||
138 | if let Some(expr) = source_map.expr_syntax(id).and_then(|n| n.cast::<ast::Expr>()) { | 136 | if let Some(source_ptr) = source_map.expr_syntax(id) { |
139 | self.sink.push(MissingOkInTailExpr { file: file_id, expr }); | 137 | if let Some(expr) = source_ptr.ast.a() { |
138 | self.sink.push(MissingOkInTailExpr { file: source_ptr.file_id, expr }); | ||
139 | } | ||
140 | } | 140 | } |
141 | } | 141 | } |
142 | } | 142 | } |
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 018fcd096..c3e589921 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -69,14 +69,16 @@ pub use self::{ | |||
69 | resolve::Resolution, | 69 | resolve::Resolution, |
70 | source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer}, | 70 | source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer}, |
71 | source_id::{AstIdMap, ErasedFileAstId}, | 71 | source_id::{AstIdMap, ErasedFileAstId}, |
72 | ty::{display::HirDisplay, ApplicationTy, CallableDef, Substs, TraitRef, Ty, TypeCtor}, | 72 | ty::{ |
73 | display::HirDisplay, ApplicationTy, CallableDef, Substs, TraitRef, Ty, TypeCtor, TypeWalk, | ||
74 | }, | ||
73 | type_ref::Mutability, | 75 | type_ref::Mutability, |
74 | }; | 76 | }; |
75 | 77 | ||
76 | pub use self::code_model::{ | 78 | pub use self::code_model::{ |
77 | docs::{DocDef, Docs, Documentation}, | 79 | docs::{DocDef, Docs, Documentation}, |
78 | src::{HasSource, Source}, | 80 | src::{HasBodySource, HasSource, Source}, |
79 | BuiltinType, Const, ConstData, Container, Crate, CrateDependency, DefWithBody, Enum, | 81 | BuiltinType, Const, ConstData, Container, Crate, CrateDependency, DefWithBody, Enum, |
80 | EnumVariant, FieldSource, FnData, Function, MacroDef, Module, ModuleDef, ModuleSource, Static, | 82 | EnumVariant, FieldSource, FnData, Function, HasBody, MacroDef, Module, ModuleDef, ModuleSource, |
81 | Struct, StructField, Trait, TypeAlias, Union, | 83 | Static, Struct, StructField, Trait, TypeAlias, Union, |
82 | }; | 84 | }; |
diff --git a/crates/ra_hir/src/path.rs b/crates/ra_hir/src/path.rs index 5ee71e421..24316fc91 100644 --- a/crates/ra_hir/src/path.rs +++ b/crates/ra_hir/src/path.rs | |||
@@ -31,7 +31,8 @@ pub struct GenericArgs { | |||
31 | /// Self type. Otherwise, when we have a path `Trait<X, Y>`, the Self type | 31 | /// Self type. Otherwise, when we have a path `Trait<X, Y>`, the Self type |
32 | /// is left out. | 32 | /// is left out. |
33 | pub has_self_type: bool, | 33 | pub has_self_type: bool, |
34 | // someday also bindings | 34 | /// Associated type bindings like in `Iterator<Item = T>`. |
35 | pub bindings: Vec<(Name, TypeRef)>, | ||
35 | } | 36 | } |
36 | 37 | ||
37 | /// A single generic argument. | 38 | /// A single generic argument. |
@@ -170,16 +171,24 @@ impl GenericArgs { | |||
170 | let type_ref = TypeRef::from_ast_opt(type_arg.type_ref()); | 171 | let type_ref = TypeRef::from_ast_opt(type_arg.type_ref()); |
171 | args.push(GenericArg::Type(type_ref)); | 172 | args.push(GenericArg::Type(type_ref)); |
172 | } | 173 | } |
173 | // lifetimes and assoc type args ignored for now | 174 | // lifetimes ignored for now |
174 | if !args.is_empty() { | 175 | let mut bindings = Vec::new(); |
175 | Some(GenericArgs { args, has_self_type: false }) | 176 | for assoc_type_arg in node.assoc_type_args() { |
176 | } else { | 177 | if let Some(name_ref) = assoc_type_arg.name_ref() { |
178 | let name = name_ref.as_name(); | ||
179 | let type_ref = TypeRef::from_ast_opt(assoc_type_arg.type_ref()); | ||
180 | bindings.push((name, type_ref)); | ||
181 | } | ||
182 | } | ||
183 | if args.is_empty() && bindings.is_empty() { | ||
177 | None | 184 | None |
185 | } else { | ||
186 | Some(GenericArgs { args, has_self_type: false, bindings }) | ||
178 | } | 187 | } |
179 | } | 188 | } |
180 | 189 | ||
181 | pub(crate) fn empty() -> GenericArgs { | 190 | pub(crate) fn empty() -> GenericArgs { |
182 | GenericArgs { args: Vec::new(), has_self_type: false } | 191 | GenericArgs { args: Vec::new(), has_self_type: false, bindings: Vec::new() } |
183 | } | 192 | } |
184 | } | 193 | } |
185 | 194 | ||
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 56ff7da3a..fdbe5e8b0 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -27,9 +27,9 @@ use crate::{ | |||
27 | name, | 27 | name, |
28 | path::{PathKind, PathSegment}, | 28 | path::{PathKind, PathSegment}, |
29 | ty::method_resolution::implements_trait, | 29 | ty::method_resolution::implements_trait, |
30 | AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HirDatabase, HirFileId, | 30 | AsName, AstId, Const, Crate, DefWithBody, Either, Enum, Function, HasBody, HirDatabase, |
31 | MacroDef, Module, ModuleDef, Name, Path, PerNs, Resolution, Resolver, Static, Struct, Trait, | 31 | HirFileId, MacroDef, Module, ModuleDef, Name, Path, PerNs, Resolution, Resolver, Static, |
32 | Ty, | 32 | Struct, Trait, Ty, |
33 | }; | 33 | }; |
34 | 34 | ||
35 | /// Locates the module by `FileId`. Picks topmost module in the file. | 35 | /// Locates the module by `FileId`. Picks topmost module in the file. |
@@ -228,7 +228,7 @@ impl SourceAnalyzer { | |||
228 | let scopes = db.expr_scopes(def); | 228 | let scopes = db.expr_scopes(def); |
229 | let scope = match offset { | 229 | let scope = match offset { |
230 | None => scope_for(&scopes, &source_map, &node), | 230 | None => scope_for(&scopes, &source_map, &node), |
231 | Some(offset) => scope_for_offset(&scopes, &source_map, offset), | 231 | Some(offset) => scope_for_offset(&scopes, &source_map, file_id.into(), offset), |
232 | }; | 232 | }; |
233 | let resolver = expr::resolver_for_scope(def.body(db), db, scope); | 233 | let resolver = expr::resolver_for_scope(def.body(db), db, scope); |
234 | SourceAnalyzer { | 234 | SourceAnalyzer { |
@@ -330,6 +330,7 @@ impl SourceAnalyzer { | |||
330 | .body_source_map | 330 | .body_source_map |
331 | .as_ref()? | 331 | .as_ref()? |
332 | .pat_syntax(it)? | 332 | .pat_syntax(it)? |
333 | .ast // FIXME: ignoring file_id here is definitelly wrong | ||
333 | .map_a(|ptr| ptr.cast::<ast::BindPat>().unwrap()); | 334 | .map_a(|ptr| ptr.cast::<ast::BindPat>().unwrap()); |
334 | PathResolution::LocalBinding(pat_ptr) | 335 | PathResolution::LocalBinding(pat_ptr) |
335 | } | 336 | } |
@@ -354,7 +355,7 @@ impl SourceAnalyzer { | |||
354 | ret.and_then(|entry| { | 355 | ret.and_then(|entry| { |
355 | Some(ScopeEntryWithSyntax { | 356 | Some(ScopeEntryWithSyntax { |
356 | name: entry.name().clone(), | 357 | name: entry.name().clone(), |
357 | ptr: source_map.pat_syntax(entry.pat())?, | 358 | ptr: source_map.pat_syntax(entry.pat())?.ast, |
358 | }) | 359 | }) |
359 | }) | 360 | }) |
360 | } | 361 | } |
@@ -462,25 +463,35 @@ fn scope_for( | |||
462 | node: &SyntaxNode, | 463 | node: &SyntaxNode, |
463 | ) -> Option<ScopeId> { | 464 | ) -> Option<ScopeId> { |
464 | node.ancestors() | 465 | node.ancestors() |
465 | .map(|it| SyntaxNodePtr::new(&it)) | 466 | .filter_map(ast::Expr::cast) |
466 | .filter_map(|ptr| source_map.syntax_expr(ptr)) | 467 | .filter_map(|it| source_map.node_expr(&it)) |
467 | .find_map(|it| scopes.scope_for(it)) | 468 | .find_map(|it| scopes.scope_for(it)) |
468 | } | 469 | } |
469 | 470 | ||
470 | fn scope_for_offset( | 471 | fn scope_for_offset( |
471 | scopes: &ExprScopes, | 472 | scopes: &ExprScopes, |
472 | source_map: &BodySourceMap, | 473 | source_map: &BodySourceMap, |
474 | file_id: HirFileId, | ||
473 | offset: TextUnit, | 475 | offset: TextUnit, |
474 | ) -> Option<ScopeId> { | 476 | ) -> Option<ScopeId> { |
475 | scopes | 477 | scopes |
476 | .scope_by_expr() | 478 | .scope_by_expr() |
477 | .iter() | 479 | .iter() |
478 | .filter_map(|(id, scope)| Some((source_map.expr_syntax(*id)?, scope))) | 480 | .filter_map(|(id, scope)| { |
481 | let source = source_map.expr_syntax(*id)?; | ||
482 | // FIXME: correctly handle macro expansion | ||
483 | if source.file_id != file_id { | ||
484 | return None; | ||
485 | } | ||
486 | let syntax_node_ptr = | ||
487 | source.ast.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); | ||
488 | Some((syntax_node_ptr, scope)) | ||
489 | }) | ||
479 | // find containing scope | 490 | // find containing scope |
480 | .min_by_key(|(ptr, _scope)| { | 491 | .min_by_key(|(ptr, _scope)| { |
481 | (!(ptr.range().start() <= offset && offset <= ptr.range().end()), ptr.range().len()) | 492 | (!(ptr.range().start() <= offset && offset <= ptr.range().end()), ptr.range().len()) |
482 | }) | 493 | }) |
483 | .map(|(ptr, scope)| adjust(scopes, source_map, ptr, offset).unwrap_or(*scope)) | 494 | .map(|(ptr, scope)| adjust(scopes, source_map, ptr, file_id, offset).unwrap_or(*scope)) |
484 | } | 495 | } |
485 | 496 | ||
486 | // XXX: during completion, cursor might be outside of any particular | 497 | // XXX: during completion, cursor might be outside of any particular |
@@ -489,13 +500,23 @@ fn adjust( | |||
489 | scopes: &ExprScopes, | 500 | scopes: &ExprScopes, |
490 | source_map: &BodySourceMap, | 501 | source_map: &BodySourceMap, |
491 | ptr: SyntaxNodePtr, | 502 | ptr: SyntaxNodePtr, |
503 | file_id: HirFileId, | ||
492 | offset: TextUnit, | 504 | offset: TextUnit, |
493 | ) -> Option<ScopeId> { | 505 | ) -> Option<ScopeId> { |
494 | let r = ptr.range(); | 506 | let r = ptr.range(); |
495 | let child_scopes = scopes | 507 | let child_scopes = scopes |
496 | .scope_by_expr() | 508 | .scope_by_expr() |
497 | .iter() | 509 | .iter() |
498 | .filter_map(|(id, scope)| Some((source_map.expr_syntax(*id)?, scope))) | 510 | .filter_map(|(id, scope)| { |
511 | let source = source_map.expr_syntax(*id)?; | ||
512 | // FIXME: correctly handle macro expansion | ||
513 | if source.file_id != file_id { | ||
514 | return None; | ||
515 | } | ||
516 | let syntax_node_ptr = | ||
517 | source.ast.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()); | ||
518 | Some((syntax_node_ptr, scope)) | ||
519 | }) | ||
499 | .map(|(ptr, scope)| (ptr.range(), scope)) | 520 | .map(|(ptr, scope)| (ptr.range(), scope)) |
500 | .filter(|(range, _)| range.start() <= offset && range.is_subrange(&r) && *range != r); | 521 | .filter(|(range, _)| range.start() <= offset && range.is_subrange(&r) && *range != r); |
501 | 522 | ||
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index b54c80318..a3df08827 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -120,12 +120,44 @@ pub struct ProjectionTy { | |||
120 | pub parameters: Substs, | 120 | pub parameters: Substs, |
121 | } | 121 | } |
122 | 122 | ||
123 | impl ProjectionTy { | ||
124 | pub fn trait_ref(&self, db: &impl HirDatabase) -> TraitRef { | ||
125 | TraitRef { | ||
126 | trait_: self | ||
127 | .associated_ty | ||
128 | .parent_trait(db) | ||
129 | .expect("projection ty without parent trait"), | ||
130 | substs: self.parameters.clone(), | ||
131 | } | ||
132 | } | ||
133 | } | ||
134 | |||
135 | impl TypeWalk for ProjectionTy { | ||
136 | fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
137 | self.parameters.walk(f); | ||
138 | } | ||
139 | |||
140 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | ||
141 | self.parameters.walk_mut(f); | ||
142 | } | ||
143 | } | ||
144 | |||
123 | #[derive(Clone, PartialEq, Eq, Debug, Hash)] | 145 | #[derive(Clone, PartialEq, Eq, Debug, Hash)] |
124 | pub struct UnselectedProjectionTy { | 146 | pub struct UnselectedProjectionTy { |
125 | pub type_name: Name, | 147 | pub type_name: Name, |
126 | pub parameters: Substs, | 148 | pub parameters: Substs, |
127 | } | 149 | } |
128 | 150 | ||
151 | impl TypeWalk for UnselectedProjectionTy { | ||
152 | fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
153 | self.parameters.walk(f); | ||
154 | } | ||
155 | |||
156 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | ||
157 | self.parameters.walk_mut(f); | ||
158 | } | ||
159 | } | ||
160 | |||
129 | /// A type. | 161 | /// A type. |
130 | /// | 162 | /// |
131 | /// See also the `TyKind` enum in rustc (librustc/ty/sty.rs), which represents | 163 | /// See also the `TyKind` enum in rustc (librustc/ty/sty.rs), which represents |
@@ -282,20 +314,14 @@ impl TraitRef { | |||
282 | pub fn self_ty(&self) -> &Ty { | 314 | pub fn self_ty(&self) -> &Ty { |
283 | &self.substs[0] | 315 | &self.substs[0] |
284 | } | 316 | } |
317 | } | ||
285 | 318 | ||
286 | pub fn subst(mut self, substs: &Substs) -> TraitRef { | 319 | impl TypeWalk for TraitRef { |
287 | self.substs.walk_mut(&mut |ty_mut| { | 320 | fn walk(&self, f: &mut impl FnMut(&Ty)) { |
288 | let ty = mem::replace(ty_mut, Ty::Unknown); | ||
289 | *ty_mut = ty.subst(substs); | ||
290 | }); | ||
291 | self | ||
292 | } | ||
293 | |||
294 | pub fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
295 | self.substs.walk(f); | 321 | self.substs.walk(f); |
296 | } | 322 | } |
297 | 323 | ||
298 | pub fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | 324 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { |
299 | self.substs.walk_mut(f); | 325 | self.substs.walk_mut(f); |
300 | } | 326 | } |
301 | } | 327 | } |
@@ -306,6 +332,8 @@ impl TraitRef { | |||
306 | pub enum GenericPredicate { | 332 | pub enum GenericPredicate { |
307 | /// The given trait needs to be implemented for its type parameters. | 333 | /// The given trait needs to be implemented for its type parameters. |
308 | Implemented(TraitRef), | 334 | Implemented(TraitRef), |
335 | /// An associated type bindings like in `Iterator<Item = T>`. | ||
336 | Projection(ProjectionPredicate), | ||
309 | /// We couldn't resolve the trait reference. (If some type parameters can't | 337 | /// We couldn't resolve the trait reference. (If some type parameters can't |
310 | /// be resolved, they will just be Unknown). | 338 | /// be resolved, they will just be Unknown). |
311 | Error, | 339 | Error, |
@@ -319,25 +347,35 @@ impl GenericPredicate { | |||
319 | } | 347 | } |
320 | } | 348 | } |
321 | 349 | ||
322 | pub fn subst(self, substs: &Substs) -> GenericPredicate { | 350 | pub fn is_implemented(&self) -> bool { |
323 | match self { | 351 | match self { |
324 | GenericPredicate::Implemented(trait_ref) => { | 352 | GenericPredicate::Implemented(_) => true, |
325 | GenericPredicate::Implemented(trait_ref.subst(substs)) | 353 | _ => false, |
326 | } | ||
327 | GenericPredicate::Error => self, | ||
328 | } | 354 | } |
329 | } | 355 | } |
330 | 356 | ||
331 | pub fn walk(&self, f: &mut impl FnMut(&Ty)) { | 357 | pub fn trait_ref(&self, db: &impl HirDatabase) -> Option<TraitRef> { |
358 | match self { | ||
359 | GenericPredicate::Implemented(tr) => Some(tr.clone()), | ||
360 | GenericPredicate::Projection(proj) => Some(proj.projection_ty.trait_ref(db)), | ||
361 | GenericPredicate::Error => None, | ||
362 | } | ||
363 | } | ||
364 | } | ||
365 | |||
366 | impl TypeWalk for GenericPredicate { | ||
367 | fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
332 | match self { | 368 | match self { |
333 | GenericPredicate::Implemented(trait_ref) => trait_ref.walk(f), | 369 | GenericPredicate::Implemented(trait_ref) => trait_ref.walk(f), |
370 | GenericPredicate::Projection(projection_pred) => projection_pred.walk(f), | ||
334 | GenericPredicate::Error => {} | 371 | GenericPredicate::Error => {} |
335 | } | 372 | } |
336 | } | 373 | } |
337 | 374 | ||
338 | pub fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | 375 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { |
339 | match self { | 376 | match self { |
340 | GenericPredicate::Implemented(trait_ref) => trait_ref.walk_mut(f), | 377 | GenericPredicate::Implemented(trait_ref) => trait_ref.walk_mut(f), |
378 | GenericPredicate::Projection(projection_pred) => projection_pred.walk_mut(f), | ||
341 | GenericPredicate::Error => {} | 379 | GenericPredicate::Error => {} |
342 | } | 380 | } |
343 | } | 381 | } |
@@ -378,16 +416,16 @@ impl FnSig { | |||
378 | pub fn ret(&self) -> &Ty { | 416 | pub fn ret(&self) -> &Ty { |
379 | &self.params_and_return[self.params_and_return.len() - 1] | 417 | &self.params_and_return[self.params_and_return.len() - 1] |
380 | } | 418 | } |
419 | } | ||
381 | 420 | ||
382 | /// Applies the given substitutions to all types in this signature and | 421 | impl TypeWalk for FnSig { |
383 | /// returns the result. | 422 | fn walk(&self, f: &mut impl FnMut(&Ty)) { |
384 | pub fn subst(&self, substs: &Substs) -> FnSig { | 423 | for t in self.params_and_return.iter() { |
385 | let result: Vec<_> = | 424 | t.walk(f); |
386 | self.params_and_return.iter().map(|ty| ty.clone().subst(substs)).collect(); | 425 | } |
387 | FnSig { params_and_return: result.into() } | ||
388 | } | 426 | } |
389 | 427 | ||
390 | pub fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | 428 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { |
391 | // Without an Arc::make_mut_slice, we can't avoid the clone here: | 429 | // Without an Arc::make_mut_slice, we can't avoid the clone here: |
392 | let mut v: Vec<_> = self.params_and_return.iter().cloned().collect(); | 430 | let mut v: Vec<_> = self.params_and_return.iter().cloned().collect(); |
393 | for t in &mut v { | 431 | for t in &mut v { |
@@ -411,64 +449,6 @@ impl Ty { | |||
411 | Ty::apply(TypeCtor::Tuple { cardinality: 0 }, Substs::empty()) | 449 | Ty::apply(TypeCtor::Tuple { cardinality: 0 }, Substs::empty()) |
412 | } | 450 | } |
413 | 451 | ||
414 | pub fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
415 | match self { | ||
416 | Ty::Apply(a_ty) => { | ||
417 | for t in a_ty.parameters.iter() { | ||
418 | t.walk(f); | ||
419 | } | ||
420 | } | ||
421 | Ty::Projection(p_ty) => { | ||
422 | for t in p_ty.parameters.iter() { | ||
423 | t.walk(f); | ||
424 | } | ||
425 | } | ||
426 | Ty::UnselectedProjection(p_ty) => { | ||
427 | for t in p_ty.parameters.iter() { | ||
428 | t.walk(f); | ||
429 | } | ||
430 | } | ||
431 | Ty::Dyn(predicates) | Ty::Opaque(predicates) => { | ||
432 | for p in predicates.iter() { | ||
433 | p.walk(f); | ||
434 | } | ||
435 | } | ||
436 | Ty::Param { .. } | Ty::Bound(_) | Ty::Infer(_) | Ty::Unknown => {} | ||
437 | } | ||
438 | f(self); | ||
439 | } | ||
440 | |||
441 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | ||
442 | match self { | ||
443 | Ty::Apply(a_ty) => { | ||
444 | a_ty.parameters.walk_mut(f); | ||
445 | } | ||
446 | Ty::Projection(p_ty) => { | ||
447 | p_ty.parameters.walk_mut(f); | ||
448 | } | ||
449 | Ty::UnselectedProjection(p_ty) => { | ||
450 | p_ty.parameters.walk_mut(f); | ||
451 | } | ||
452 | Ty::Dyn(predicates) | Ty::Opaque(predicates) => { | ||
453 | let mut v: Vec<_> = predicates.iter().cloned().collect(); | ||
454 | for p in &mut v { | ||
455 | p.walk_mut(f); | ||
456 | } | ||
457 | *predicates = v.into(); | ||
458 | } | ||
459 | Ty::Param { .. } | Ty::Bound(_) | Ty::Infer(_) | Ty::Unknown => {} | ||
460 | } | ||
461 | f(self); | ||
462 | } | ||
463 | |||
464 | fn fold(mut self, f: &mut impl FnMut(Ty) -> Ty) -> Ty { | ||
465 | self.walk_mut(&mut |ty_mut| { | ||
466 | let ty = mem::replace(ty_mut, Ty::Unknown); | ||
467 | *ty_mut = f(ty); | ||
468 | }); | ||
469 | self | ||
470 | } | ||
471 | |||
472 | pub fn as_reference(&self) -> Option<(&Ty, Mutability)> { | 452 | pub fn as_reference(&self) -> Option<(&Ty, Mutability)> { |
473 | match self { | 453 | match self { |
474 | Ty::Apply(ApplicationTy { ctor: TypeCtor::Ref(mutability), parameters }) => { | 454 | Ty::Apply(ApplicationTy { ctor: TypeCtor::Ref(mutability), parameters }) => { |
@@ -544,10 +524,53 @@ impl Ty { | |||
544 | } | 524 | } |
545 | } | 525 | } |
546 | 526 | ||
527 | /// Returns the type parameters of this type if it has some (i.e. is an ADT | ||
528 | /// or function); so if `self` is `Option<u32>`, this returns the `u32`. | ||
529 | pub fn substs(&self) -> Option<Substs> { | ||
530 | match self { | ||
531 | Ty::Apply(ApplicationTy { parameters, .. }) => Some(parameters.clone()), | ||
532 | _ => None, | ||
533 | } | ||
534 | } | ||
535 | |||
536 | /// If this is an `impl Trait` or `dyn Trait`, returns that trait. | ||
537 | pub fn inherent_trait(&self) -> Option<Trait> { | ||
538 | match self { | ||
539 | Ty::Dyn(predicates) | Ty::Opaque(predicates) => { | ||
540 | predicates.iter().find_map(|pred| match pred { | ||
541 | GenericPredicate::Implemented(tr) => Some(tr.trait_), | ||
542 | _ => None, | ||
543 | }) | ||
544 | } | ||
545 | _ => None, | ||
546 | } | ||
547 | } | ||
548 | } | ||
549 | |||
550 | /// This allows walking structures that contain types to do something with those | ||
551 | /// types, similar to Chalk's `Fold` trait. | ||
552 | pub trait TypeWalk { | ||
553 | fn walk(&self, f: &mut impl FnMut(&Ty)); | ||
554 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)); | ||
555 | |||
556 | fn fold(mut self, f: &mut impl FnMut(Ty) -> Ty) -> Self | ||
557 | where | ||
558 | Self: Sized, | ||
559 | { | ||
560 | self.walk_mut(&mut |ty_mut| { | ||
561 | let ty = mem::replace(ty_mut, Ty::Unknown); | ||
562 | *ty_mut = f(ty); | ||
563 | }); | ||
564 | self | ||
565 | } | ||
566 | |||
547 | /// Replaces type parameters in this type using the given `Substs`. (So e.g. | 567 | /// Replaces type parameters in this type using the given `Substs`. (So e.g. |
548 | /// if `self` is `&[T]`, where type parameter T has index 0, and the | 568 | /// if `self` is `&[T]`, where type parameter T has index 0, and the |
549 | /// `Substs` contain `u32` at index 0, we'll have `&[u32]` afterwards.) | 569 | /// `Substs` contain `u32` at index 0, we'll have `&[u32]` afterwards.) |
550 | pub fn subst(self, substs: &Substs) -> Ty { | 570 | fn subst(self, substs: &Substs) -> Self |
571 | where | ||
572 | Self: Sized, | ||
573 | { | ||
551 | self.fold(&mut |ty| match ty { | 574 | self.fold(&mut |ty| match ty { |
552 | Ty::Param { idx, name } => { | 575 | Ty::Param { idx, name } => { |
553 | substs.get(idx as usize).cloned().unwrap_or(Ty::Param { idx, name }) | 576 | substs.get(idx as usize).cloned().unwrap_or(Ty::Param { idx, name }) |
@@ -557,24 +580,21 @@ impl Ty { | |||
557 | } | 580 | } |
558 | 581 | ||
559 | /// Substitutes `Ty::Bound` vars (as opposed to type parameters). | 582 | /// Substitutes `Ty::Bound` vars (as opposed to type parameters). |
560 | pub fn subst_bound_vars(self, substs: &Substs) -> Ty { | 583 | fn subst_bound_vars(self, substs: &Substs) -> Self |
584 | where | ||
585 | Self: Sized, | ||
586 | { | ||
561 | self.fold(&mut |ty| match ty { | 587 | self.fold(&mut |ty| match ty { |
562 | Ty::Bound(idx) => substs.get(idx as usize).cloned().unwrap_or_else(|| Ty::Bound(idx)), | 588 | Ty::Bound(idx) => substs.get(idx as usize).cloned().unwrap_or_else(|| Ty::Bound(idx)), |
563 | ty => ty, | 589 | ty => ty, |
564 | }) | 590 | }) |
565 | } | 591 | } |
566 | 592 | ||
567 | /// Returns the type parameters of this type if it has some (i.e. is an ADT | ||
568 | /// or function); so if `self` is `Option<u32>`, this returns the `u32`. | ||
569 | pub fn substs(&self) -> Option<Substs> { | ||
570 | match self { | ||
571 | Ty::Apply(ApplicationTy { parameters, .. }) => Some(parameters.clone()), | ||
572 | _ => None, | ||
573 | } | ||
574 | } | ||
575 | |||
576 | /// Shifts up `Ty::Bound` vars by `n`. | 593 | /// Shifts up `Ty::Bound` vars by `n`. |
577 | pub fn shift_bound_vars(self, n: i32) -> Ty { | 594 | fn shift_bound_vars(self, n: i32) -> Self |
595 | where | ||
596 | Self: Sized, | ||
597 | { | ||
578 | self.fold(&mut |ty| match ty { | 598 | self.fold(&mut |ty| match ty { |
579 | Ty::Bound(idx) => { | 599 | Ty::Bound(idx) => { |
580 | assert!(idx as i32 >= -n); | 600 | assert!(idx as i32 >= -n); |
@@ -583,18 +603,57 @@ impl Ty { | |||
583 | ty => ty, | 603 | ty => ty, |
584 | }) | 604 | }) |
585 | } | 605 | } |
606 | } | ||
586 | 607 | ||
587 | /// If this is an `impl Trait` or `dyn Trait`, returns that trait. | 608 | impl TypeWalk for Ty { |
588 | pub fn inherent_trait(&self) -> Option<Trait> { | 609 | fn walk(&self, f: &mut impl FnMut(&Ty)) { |
610 | match self { | ||
611 | Ty::Apply(a_ty) => { | ||
612 | for t in a_ty.parameters.iter() { | ||
613 | t.walk(f); | ||
614 | } | ||
615 | } | ||
616 | Ty::Projection(p_ty) => { | ||
617 | for t in p_ty.parameters.iter() { | ||
618 | t.walk(f); | ||
619 | } | ||
620 | } | ||
621 | Ty::UnselectedProjection(p_ty) => { | ||
622 | for t in p_ty.parameters.iter() { | ||
623 | t.walk(f); | ||
624 | } | ||
625 | } | ||
626 | Ty::Dyn(predicates) | Ty::Opaque(predicates) => { | ||
627 | for p in predicates.iter() { | ||
628 | p.walk(f); | ||
629 | } | ||
630 | } | ||
631 | Ty::Param { .. } | Ty::Bound(_) | Ty::Infer(_) | Ty::Unknown => {} | ||
632 | } | ||
633 | f(self); | ||
634 | } | ||
635 | |||
636 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | ||
589 | match self { | 637 | match self { |
638 | Ty::Apply(a_ty) => { | ||
639 | a_ty.parameters.walk_mut(f); | ||
640 | } | ||
641 | Ty::Projection(p_ty) => { | ||
642 | p_ty.parameters.walk_mut(f); | ||
643 | } | ||
644 | Ty::UnselectedProjection(p_ty) => { | ||
645 | p_ty.parameters.walk_mut(f); | ||
646 | } | ||
590 | Ty::Dyn(predicates) | Ty::Opaque(predicates) => { | 647 | Ty::Dyn(predicates) | Ty::Opaque(predicates) => { |
591 | predicates.iter().find_map(|pred| match pred { | 648 | let mut v: Vec<_> = predicates.iter().cloned().collect(); |
592 | GenericPredicate::Implemented(tr) => Some(tr.trait_), | 649 | for p in &mut v { |
593 | _ => None, | 650 | p.walk_mut(f); |
594 | }) | 651 | } |
652 | *predicates = v.into(); | ||
595 | } | 653 | } |
596 | _ => None, | 654 | Ty::Param { .. } | Ty::Bound(_) | Ty::Infer(_) | Ty::Unknown => {} |
597 | } | 655 | } |
656 | f(self); | ||
598 | } | 657 | } |
599 | } | 658 | } |
600 | 659 | ||
@@ -742,20 +801,66 @@ impl HirDisplay for Ty { | |||
742 | Ty::Opaque(_) => write!(f, "impl ")?, | 801 | Ty::Opaque(_) => write!(f, "impl ")?, |
743 | _ => unreachable!(), | 802 | _ => unreachable!(), |
744 | }; | 803 | }; |
745 | // looping by hand here just to format the bounds in a slightly nicer way | 804 | // Note: This code is written to produce nice results (i.e. |
805 | // corresponding to surface Rust) for types that can occur in | ||
806 | // actual Rust. It will have weird results if the predicates | ||
807 | // aren't as expected (i.e. self types = $0, projection | ||
808 | // predicates for a certain trait come after the Implemented | ||
809 | // predicate for that trait). | ||
746 | let mut first = true; | 810 | let mut first = true; |
811 | let mut angle_open = false; | ||
747 | for p in predicates.iter() { | 812 | for p in predicates.iter() { |
748 | if !first { | ||
749 | write!(f, " + ")?; | ||
750 | } | ||
751 | first = false; | ||
752 | match p { | 813 | match p { |
753 | // don't show the $0 self type | ||
754 | GenericPredicate::Implemented(trait_ref) => { | 814 | GenericPredicate::Implemented(trait_ref) => { |
755 | trait_ref.hir_fmt_ext(f, false)? | 815 | if angle_open { |
816 | write!(f, ">")?; | ||
817 | } | ||
818 | if !first { | ||
819 | write!(f, " + ")?; | ||
820 | } | ||
821 | // We assume that the self type is $0 (i.e. the | ||
822 | // existential) here, which is the only thing that's | ||
823 | // possible in actual Rust, and hence don't print it | ||
824 | write!( | ||
825 | f, | ||
826 | "{}", | ||
827 | trait_ref.trait_.name(f.db).unwrap_or_else(Name::missing) | ||
828 | )?; | ||
829 | if trait_ref.substs.len() > 1 { | ||
830 | write!(f, "<")?; | ||
831 | f.write_joined(&trait_ref.substs[1..], ", ")?; | ||
832 | // there might be assoc type bindings, so we leave the angle brackets open | ||
833 | angle_open = true; | ||
834 | } | ||
835 | } | ||
836 | GenericPredicate::Projection(projection_pred) => { | ||
837 | // in types in actual Rust, these will always come | ||
838 | // after the corresponding Implemented predicate | ||
839 | if angle_open { | ||
840 | write!(f, ", ")?; | ||
841 | } else { | ||
842 | write!(f, "<")?; | ||
843 | angle_open = true; | ||
844 | } | ||
845 | let name = projection_pred.projection_ty.associated_ty.name(f.db); | ||
846 | write!(f, "{} = ", name)?; | ||
847 | projection_pred.ty.hir_fmt(f)?; | ||
848 | } | ||
849 | GenericPredicate::Error => { | ||
850 | if angle_open { | ||
851 | // impl Trait<X, {error}> | ||
852 | write!(f, ", ")?; | ||
853 | } else if !first { | ||
854 | // impl Trait + {error} | ||
855 | write!(f, " + ")?; | ||
856 | } | ||
857 | p.hir_fmt(f)?; | ||
756 | } | 858 | } |
757 | GenericPredicate::Error => p.hir_fmt(f)?, | ||
758 | } | 859 | } |
860 | first = false; | ||
861 | } | ||
862 | if angle_open { | ||
863 | write!(f, ">")?; | ||
759 | } | 864 | } |
760 | } | 865 | } |
761 | Ty::Unknown => write!(f, "{{unknown}}")?, | 866 | Ty::Unknown => write!(f, "{{unknown}}")?, |
@@ -766,13 +871,12 @@ impl HirDisplay for Ty { | |||
766 | } | 871 | } |
767 | 872 | ||
768 | impl TraitRef { | 873 | impl TraitRef { |
769 | fn hir_fmt_ext( | 874 | fn hir_fmt_ext(&self, f: &mut HirFormatter<impl HirDatabase>, use_as: bool) -> fmt::Result { |
770 | &self, | 875 | self.substs[0].hir_fmt(f)?; |
771 | f: &mut HirFormatter<impl HirDatabase>, | 876 | if use_as { |
772 | with_self_ty: bool, | 877 | write!(f, " as ")?; |
773 | ) -> fmt::Result { | 878 | } else { |
774 | if with_self_ty { | 879 | write!(f, ": ")?; |
775 | write!(f, "{}: ", self.substs[0].display(f.db),)?; | ||
776 | } | 880 | } |
777 | write!(f, "{}", self.trait_.name(f.db).unwrap_or_else(Name::missing))?; | 881 | write!(f, "{}", self.trait_.name(f.db).unwrap_or_else(Name::missing))?; |
778 | if self.substs.len() > 1 { | 882 | if self.substs.len() > 1 { |
@@ -786,7 +890,7 @@ impl TraitRef { | |||
786 | 890 | ||
787 | impl HirDisplay for TraitRef { | 891 | impl HirDisplay for TraitRef { |
788 | fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { | 892 | fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { |
789 | self.hir_fmt_ext(f, true) | 893 | self.hir_fmt_ext(f, false) |
790 | } | 894 | } |
791 | } | 895 | } |
792 | 896 | ||
@@ -800,6 +904,16 @@ impl HirDisplay for GenericPredicate { | |||
800 | fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { | 904 | fn hir_fmt(&self, f: &mut HirFormatter<impl HirDatabase>) -> fmt::Result { |
801 | match self { | 905 | match self { |
802 | GenericPredicate::Implemented(trait_ref) => trait_ref.hir_fmt(f)?, | 906 | GenericPredicate::Implemented(trait_ref) => trait_ref.hir_fmt(f)?, |
907 | GenericPredicate::Projection(projection_pred) => { | ||
908 | write!(f, "<")?; | ||
909 | projection_pred.projection_ty.trait_ref(f.db).hir_fmt_ext(f, true)?; | ||
910 | write!( | ||
911 | f, | ||
912 | ">::{} = {}", | ||
913 | projection_pred.projection_ty.associated_ty.name(f.db), | ||
914 | projection_pred.ty.display(f.db) | ||
915 | )?; | ||
916 | } | ||
803 | GenericPredicate::Error => write!(f, "{{error}}")?, | 917 | GenericPredicate::Error => write!(f, "{{error}}")?, |
804 | } | 918 | } |
805 | Ok(()) | 919 | Ok(()) |
diff --git a/crates/ra_hir/src/ty/autoderef.rs b/crates/ra_hir/src/ty/autoderef.rs index 2535d4ae7..08f52a53b 100644 --- a/crates/ra_hir/src/ty/autoderef.rs +++ b/crates/ra_hir/src/ty/autoderef.rs | |||
@@ -7,7 +7,7 @@ use std::iter::successors; | |||
7 | 7 | ||
8 | use log::{info, warn}; | 8 | use log::{info, warn}; |
9 | 9 | ||
10 | use super::{traits::Solution, Canonical, Ty}; | 10 | use super::{traits::Solution, Canonical, Ty, TypeWalk}; |
11 | use crate::{HasGenericParams, HirDatabase, Name, Resolver}; | 11 | use crate::{HasGenericParams, HirDatabase, Name, Resolver}; |
12 | 12 | ||
13 | const AUTODEREF_RECURSION_LIMIT: usize = 10; | 13 | const AUTODEREF_RECURSION_LIMIT: usize = 10; |
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 812990426..ec3b7ffef 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -30,7 +30,7 @@ use super::{ | |||
30 | autoderef, lower, method_resolution, op, primitive, | 30 | autoderef, lower, method_resolution, op, primitive, |
31 | traits::{Guidance, Obligation, ProjectionPredicate, Solution}, | 31 | traits::{Guidance, Obligation, ProjectionPredicate, Solution}, |
32 | ApplicationTy, CallableDef, InEnvironment, ProjectionTy, Substs, TraitEnvironment, TraitRef, | 32 | ApplicationTy, CallableDef, InEnvironment, ProjectionTy, Substs, TraitEnvironment, TraitRef, |
33 | Ty, TypableDef, TypeCtor, | 33 | Ty, TypableDef, TypeCtor, TypeWalk, |
34 | }; | 34 | }; |
35 | use crate::{ | 35 | use crate::{ |
36 | adt::VariantDef, | 36 | adt::VariantDef, |
@@ -50,8 +50,8 @@ use crate::{ | |||
50 | }, | 50 | }, |
51 | ty::infer::diagnostics::InferenceDiagnostic, | 51 | ty::infer::diagnostics::InferenceDiagnostic, |
52 | type_ref::{Mutability, TypeRef}, | 52 | type_ref::{Mutability, TypeRef}, |
53 | AdtDef, ConstData, DefWithBody, FnData, Function, HirDatabase, ImplItem, ModuleDef, Name, Path, | 53 | AdtDef, ConstData, DefWithBody, FnData, Function, HasBody, HirDatabase, ImplItem, ModuleDef, |
54 | StructField, | 54 | Name, Path, StructField, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | mod unify; | 57 | mod unify; |
@@ -749,7 +749,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
749 | let is_non_ref_pat = match &body[pat] { | 749 | let is_non_ref_pat = match &body[pat] { |
750 | Pat::Tuple(..) | 750 | Pat::Tuple(..) |
751 | | Pat::TupleStruct { .. } | 751 | | Pat::TupleStruct { .. } |
752 | | Pat::Struct { .. } | 752 | | Pat::Record { .. } |
753 | | Pat::Range { .. } | 753 | | Pat::Range { .. } |
754 | | Pat::Slice { .. } => true, | 754 | | Pat::Slice { .. } => true, |
755 | // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. | 755 | // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. |
@@ -806,10 +806,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
806 | let subty = self.infer_pat(*pat, expectation, default_bm); | 806 | let subty = self.infer_pat(*pat, expectation, default_bm); |
807 | Ty::apply_one(TypeCtor::Ref(*mutability), subty) | 807 | Ty::apply_one(TypeCtor::Ref(*mutability), subty) |
808 | } | 808 | } |
809 | Pat::TupleStruct { path: ref p, args: ref subpats } => { | 809 | Pat::TupleStruct { path: p, args: subpats } => { |
810 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) | 810 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) |
811 | } | 811 | } |
812 | Pat::Struct { path: ref p, args: ref fields } => { | 812 | Pat::Record { path: p, args: fields } => { |
813 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) | 813 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) |
814 | } | 814 | } |
815 | Pat::Path(path) => { | 815 | Pat::Path(path) => { |
@@ -817,7 +817,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
817 | let resolver = self.resolver.clone(); | 817 | let resolver = self.resolver.clone(); |
818 | self.infer_path_expr(&resolver, &path, pat.into()).unwrap_or(Ty::Unknown) | 818 | self.infer_path_expr(&resolver, &path, pat.into()).unwrap_or(Ty::Unknown) |
819 | } | 819 | } |
820 | Pat::Bind { mode, name: _name, subpat } => { | 820 | Pat::Bind { mode, name: _, subpat } => { |
821 | let mode = if mode == &BindingAnnotation::Unannotated { | 821 | let mode = if mode == &BindingAnnotation::Unannotated { |
822 | default_bm | 822 | default_bm |
823 | } else { | 823 | } else { |
diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs index e7e8825d1..9a0d2d8f9 100644 --- a/crates/ra_hir/src/ty/infer/unify.rs +++ b/crates/ra_hir/src/ty/infer/unify.rs | |||
@@ -3,7 +3,7 @@ | |||
3 | use super::{InferenceContext, Obligation}; | 3 | use super::{InferenceContext, Obligation}; |
4 | use crate::db::HirDatabase; | 4 | use crate::db::HirDatabase; |
5 | use crate::ty::{ | 5 | use crate::ty::{ |
6 | Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, TraitRef, Ty, | 6 | Canonical, InEnvironment, InferTy, ProjectionPredicate, ProjectionTy, TraitRef, Ty, TypeWalk, |
7 | }; | 7 | }; |
8 | 8 | ||
9 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 9 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { |
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 47d161277..f6f0137cf 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -8,7 +8,10 @@ | |||
8 | use std::iter; | 8 | use std::iter; |
9 | use std::sync::Arc; | 9 | use std::sync::Arc; |
10 | 10 | ||
11 | use super::{FnSig, GenericPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor}; | 11 | use super::{ |
12 | FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | ||
13 | TypeWalk, | ||
14 | }; | ||
12 | use crate::{ | 15 | use crate::{ |
13 | adt::VariantDef, | 16 | adt::VariantDef, |
14 | generics::HasGenericParams, | 17 | generics::HasGenericParams, |
@@ -62,7 +65,9 @@ impl Ty { | |||
62 | let self_ty = Ty::Bound(0); | 65 | let self_ty = Ty::Bound(0); |
63 | let predicates = bounds | 66 | let predicates = bounds |
64 | .iter() | 67 | .iter() |
65 | .map(|b| GenericPredicate::from_type_bound(db, resolver, b, self_ty.clone())) | 68 | .flat_map(|b| { |
69 | GenericPredicate::from_type_bound(db, resolver, b, self_ty.clone()) | ||
70 | }) | ||
66 | .collect::<Vec<_>>(); | 71 | .collect::<Vec<_>>(); |
67 | Ty::Dyn(predicates.into()) | 72 | Ty::Dyn(predicates.into()) |
68 | } | 73 | } |
@@ -70,7 +75,9 @@ impl Ty { | |||
70 | let self_ty = Ty::Bound(0); | 75 | let self_ty = Ty::Bound(0); |
71 | let predicates = bounds | 76 | let predicates = bounds |
72 | .iter() | 77 | .iter() |
73 | .map(|b| GenericPredicate::from_type_bound(db, resolver, b, self_ty.clone())) | 78 | .flat_map(|b| { |
79 | GenericPredicate::from_type_bound(db, resolver, b, self_ty.clone()) | ||
80 | }) | ||
74 | .collect::<Vec<_>>(); | 81 | .collect::<Vec<_>>(); |
75 | Ty::Opaque(predicates.into()) | 82 | Ty::Opaque(predicates.into()) |
76 | } | 83 | } |
@@ -326,15 +333,6 @@ impl TraitRef { | |||
326 | TraitRef { trait_, substs } | 333 | TraitRef { trait_, substs } |
327 | } | 334 | } |
328 | 335 | ||
329 | pub(crate) fn from_where_predicate( | ||
330 | db: &impl HirDatabase, | ||
331 | resolver: &Resolver, | ||
332 | pred: &WherePredicate, | ||
333 | ) -> Option<TraitRef> { | ||
334 | let self_ty = Ty::from_hir(db, resolver, &pred.type_ref); | ||
335 | TraitRef::from_type_bound(db, resolver, &pred.bound, self_ty) | ||
336 | } | ||
337 | |||
338 | pub(crate) fn from_type_bound( | 336 | pub(crate) fn from_type_bound( |
339 | db: &impl HirDatabase, | 337 | db: &impl HirDatabase, |
340 | resolver: &Resolver, | 338 | resolver: &Resolver, |
@@ -349,26 +347,58 @@ impl TraitRef { | |||
349 | } | 347 | } |
350 | 348 | ||
351 | impl GenericPredicate { | 349 | impl GenericPredicate { |
352 | pub(crate) fn from_where_predicate( | 350 | pub(crate) fn from_where_predicate<'a>( |
353 | db: &impl HirDatabase, | 351 | db: &'a impl HirDatabase, |
354 | resolver: &Resolver, | 352 | resolver: &'a Resolver, |
355 | where_predicate: &WherePredicate, | 353 | where_predicate: &'a WherePredicate, |
356 | ) -> GenericPredicate { | 354 | ) -> impl Iterator<Item = GenericPredicate> + 'a { |
357 | TraitRef::from_where_predicate(db, &resolver, where_predicate) | 355 | let self_ty = Ty::from_hir(db, resolver, &where_predicate.type_ref); |
358 | .map_or(GenericPredicate::Error, GenericPredicate::Implemented) | 356 | GenericPredicate::from_type_bound(db, resolver, &where_predicate.bound, self_ty) |
359 | } | 357 | } |
360 | 358 | ||
361 | pub(crate) fn from_type_bound( | 359 | pub(crate) fn from_type_bound<'a>( |
362 | db: &impl HirDatabase, | 360 | db: &'a impl HirDatabase, |
363 | resolver: &Resolver, | 361 | resolver: &'a Resolver, |
364 | bound: &TypeBound, | 362 | bound: &'a TypeBound, |
365 | self_ty: Ty, | 363 | self_ty: Ty, |
366 | ) -> GenericPredicate { | 364 | ) -> impl Iterator<Item = GenericPredicate> + 'a { |
367 | TraitRef::from_type_bound(db, &resolver, bound, self_ty) | 365 | let trait_ref = TraitRef::from_type_bound(db, &resolver, bound, self_ty); |
368 | .map_or(GenericPredicate::Error, GenericPredicate::Implemented) | 366 | iter::once(trait_ref.clone().map_or(GenericPredicate::Error, GenericPredicate::Implemented)) |
367 | .chain( | ||
368 | trait_ref.into_iter().flat_map(move |tr| { | ||
369 | assoc_type_bindings_from_type_bound(db, resolver, bound, tr) | ||
370 | }), | ||
371 | ) | ||
369 | } | 372 | } |
370 | } | 373 | } |
371 | 374 | ||
375 | fn assoc_type_bindings_from_type_bound<'a>( | ||
376 | db: &'a impl HirDatabase, | ||
377 | resolver: &'a Resolver, | ||
378 | bound: &'a TypeBound, | ||
379 | trait_ref: TraitRef, | ||
380 | ) -> impl Iterator<Item = GenericPredicate> + 'a { | ||
381 | let last_segment = match bound { | ||
382 | TypeBound::Path(path) => path.segments.last(), | ||
383 | TypeBound::Error => None, | ||
384 | }; | ||
385 | last_segment | ||
386 | .into_iter() | ||
387 | .flat_map(|segment| segment.args_and_bindings.iter()) | ||
388 | .flat_map(|args_and_bindings| args_and_bindings.bindings.iter()) | ||
389 | .map(move |(name, type_ref)| { | ||
390 | let associated_ty = match trait_ref.trait_.associated_type_by_name(db, name.clone()) { | ||
391 | None => return GenericPredicate::Error, | ||
392 | Some(t) => t, | ||
393 | }; | ||
394 | let projection_ty = | ||
395 | ProjectionTy { associated_ty, parameters: trait_ref.substs.clone() }; | ||
396 | let ty = Ty::from_hir(db, resolver, type_ref); | ||
397 | let projection_predicate = ProjectionPredicate { projection_ty, ty }; | ||
398 | GenericPredicate::Projection(projection_predicate) | ||
399 | }) | ||
400 | } | ||
401 | |||
372 | /// Build the declared type of an item. This depends on the namespace; e.g. for | 402 | /// Build the declared type of an item. This depends on the namespace; e.g. for |
373 | /// `struct Foo(usize)`, we have two types: The type of the struct itself, and | 403 | /// `struct Foo(usize)`, we have two types: The type of the struct itself, and |
374 | /// the constructor function `(usize) -> Foo` which lives in the values | 404 | /// the constructor function `(usize) -> Foo` which lives in the values |
@@ -425,7 +455,7 @@ pub(crate) fn trait_env( | |||
425 | ) -> Arc<super::TraitEnvironment> { | 455 | ) -> Arc<super::TraitEnvironment> { |
426 | let predicates = resolver | 456 | let predicates = resolver |
427 | .where_predicates_in_scope() | 457 | .where_predicates_in_scope() |
428 | .map(|pred| GenericPredicate::from_where_predicate(db, &resolver, pred)) | 458 | .flat_map(|pred| GenericPredicate::from_where_predicate(db, &resolver, pred)) |
429 | .collect::<Vec<_>>(); | 459 | .collect::<Vec<_>>(); |
430 | 460 | ||
431 | Arc::new(super::TraitEnvironment { predicates }) | 461 | Arc::new(super::TraitEnvironment { predicates }) |
@@ -439,7 +469,7 @@ pub(crate) fn generic_predicates_query( | |||
439 | let resolver = def.resolver(db); | 469 | let resolver = def.resolver(db); |
440 | let predicates = resolver | 470 | let predicates = resolver |
441 | .where_predicates_in_scope() | 471 | .where_predicates_in_scope() |
442 | .map(|pred| GenericPredicate::from_where_predicate(db, &resolver, pred)) | 472 | .flat_map(|pred| GenericPredicate::from_where_predicate(db, &resolver, pred)) |
443 | .collect::<Vec<_>>(); | 473 | .collect::<Vec<_>>(); |
444 | predicates.into() | 474 | predicates.into() |
445 | } | 475 | } |
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index b034fd59e..d92d4659b 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -2793,6 +2793,10 @@ fn main() { | |||
2793 | } | 2793 | } |
2794 | "#), | 2794 | "#), |
2795 | @r###" | 2795 | @r###" |
2796 | ![0; 17) '{Foo(v...,2,])}': Foo | ||
2797 | ![1; 4) 'Foo': Foo({unknown}) -> Foo | ||
2798 | ![1; 16) 'Foo(vec![1,2,])': Foo | ||
2799 | ![5; 15) 'vec![1,2,]': {unknown} | ||
2796 | [156; 182) '{ ...,2); }': () | 2800 | [156; 182) '{ ...,2); }': () |
2797 | [166; 167) 'x': Foo | 2801 | [166; 167) 'x': Foo |
2798 | "### | 2802 | "### |
@@ -3548,6 +3552,97 @@ fn test() { | |||
3548 | ); | 3552 | ); |
3549 | } | 3553 | } |
3550 | 3554 | ||
3555 | #[test] | ||
3556 | fn assoc_type_bindings() { | ||
3557 | assert_snapshot!( | ||
3558 | infer(r#" | ||
3559 | trait Trait { | ||
3560 | type Type; | ||
3561 | } | ||
3562 | |||
3563 | fn get<T: Trait>(t: T) -> <T as Trait>::Type {} | ||
3564 | fn get2<U, T: Trait<Type = U>>(t: T) -> U {} | ||
3565 | fn set<T: Trait<Type = u64>>(t: T) -> T {t} | ||
3566 | |||
3567 | struct S<T>; | ||
3568 | impl<T> Trait for S<T> { type Type = T; } | ||
3569 | |||
3570 | fn test<T: Trait<Type = u32>>(x: T, y: impl Trait<Type = i64>) { | ||
3571 | get(x); | ||
3572 | get2(x); | ||
3573 | get(y); | ||
3574 | get2(y); | ||
3575 | get(set(S)); | ||
3576 | get2(set(S)); | ||
3577 | get2(S::<str>); | ||
3578 | } | ||
3579 | "#), | ||
3580 | @r###" | ||
3581 | [50; 51) 't': T | ||
3582 | [78; 80) '{}': () | ||
3583 | [112; 113) 't': T | ||
3584 | [123; 125) '{}': () | ||
3585 | [155; 156) 't': T | ||
3586 | [166; 169) '{t}': T | ||
3587 | [167; 168) 't': T | ||
3588 | [257; 258) 'x': T | ||
3589 | [263; 264) 'y': impl Trait<Type = i64> | ||
3590 | [290; 398) '{ ...r>); }': () | ||
3591 | [296; 299) 'get': fn get<T>(T) -> <T as Trait>::Type | ||
3592 | [296; 302) 'get(x)': {unknown} | ||
3593 | [300; 301) 'x': T | ||
3594 | [308; 312) 'get2': fn get2<{unknown}, S<{unknown}>>(T) -> U | ||
3595 | [308; 315) 'get2(x)': {unknown} | ||
3596 | [313; 314) 'x': T | ||
3597 | [321; 324) 'get': fn get<impl Trait<Type = i64>>(T) -> <T as Trait>::Type | ||
3598 | [321; 327) 'get(y)': {unknown} | ||
3599 | [325; 326) 'y': impl Trait<Type = i64> | ||
3600 | [333; 337) 'get2': fn get2<{unknown}, S<{unknown}>>(T) -> U | ||
3601 | [333; 340) 'get2(y)': {unknown} | ||
3602 | [338; 339) 'y': impl Trait<Type = i64> | ||
3603 | [346; 349) 'get': fn get<S<u64>>(T) -> <T as Trait>::Type | ||
3604 | [346; 357) 'get(set(S))': u64 | ||
3605 | [350; 353) 'set': fn set<S<u64>>(T) -> T | ||
3606 | [350; 356) 'set(S)': S<u64> | ||
3607 | [354; 355) 'S': S<u64> | ||
3608 | [363; 367) 'get2': fn get2<u64, S<u64>>(T) -> U | ||
3609 | [363; 375) 'get2(set(S))': u64 | ||
3610 | [368; 371) 'set': fn set<S<u64>>(T) -> T | ||
3611 | [368; 374) 'set(S)': S<u64> | ||
3612 | [372; 373) 'S': S<u64> | ||
3613 | [381; 385) 'get2': fn get2<str, S<str>>(T) -> U | ||
3614 | [381; 395) 'get2(S::<str>)': str | ||
3615 | [386; 394) 'S::<str>': S<str> | ||
3616 | "### | ||
3617 | ); | ||
3618 | } | ||
3619 | |||
3620 | #[test] | ||
3621 | fn projection_eq_within_chalk() { | ||
3622 | // std::env::set_var("CHALK_DEBUG", "1"); | ||
3623 | assert_snapshot!( | ||
3624 | infer(r#" | ||
3625 | trait Trait1 { | ||
3626 | type Type; | ||
3627 | } | ||
3628 | trait Trait2<T> { | ||
3629 | fn foo(self) -> T; | ||
3630 | } | ||
3631 | impl<T, U> Trait2<T> for U where U: Trait1<Type = T> {} | ||
3632 | |||
3633 | fn test<T: Trait1<Type = u32>>(x: T) { | ||
3634 | x.foo(); | ||
3635 | } | ||
3636 | "#), | ||
3637 | @r###" | ||
3638 | [62; 66) 'self': Self | ||
3639 | [164; 165) 'x': T | ||
3640 | [170; 186) '{ ...o(); }': () | ||
3641 | [176; 177) 'x': T | ||
3642 | [176; 183) 'x.foo()': {unknown} | ||
3643 | "### | ||
3644 | ); | ||
3645 | } | ||
3551 | fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { | 3646 | fn type_at_pos(db: &MockDatabase, pos: FilePosition) -> String { |
3552 | let file = db.parse(pos.file_id).ok().unwrap(); | 3647 | let file = db.parse(pos.file_id).ok().unwrap(); |
3553 | let expr = algo::find_node_at_offset::<ast::Expr>(file.syntax(), pos.offset).unwrap(); | 3648 | let expr = algo::find_node_at_offset::<ast::Expr>(file.syntax(), pos.offset).unwrap(); |
@@ -3566,7 +3661,6 @@ fn infer(content: &str) -> String { | |||
3566 | let source_file = db.parse(file_id).ok().unwrap(); | 3661 | let source_file = db.parse(file_id).ok().unwrap(); |
3567 | 3662 | ||
3568 | let mut acc = String::new(); | 3663 | let mut acc = String::new(); |
3569 | // acc.push_str("\n"); | ||
3570 | 3664 | ||
3571 | let mut infer_def = |inference_result: Arc<InferenceResult>, | 3665 | let mut infer_def = |inference_result: Arc<InferenceResult>, |
3572 | body_source_map: Arc<BodySourceMap>| { | 3666 | body_source_map: Arc<BodySourceMap>| { |
@@ -3574,7 +3668,9 @@ fn infer(content: &str) -> String { | |||
3574 | 3668 | ||
3575 | for (pat, ty) in inference_result.type_of_pat.iter() { | 3669 | for (pat, ty) in inference_result.type_of_pat.iter() { |
3576 | let syntax_ptr = match body_source_map.pat_syntax(pat) { | 3670 | let syntax_ptr = match body_source_map.pat_syntax(pat) { |
3577 | Some(sp) => sp.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr()), | 3671 | Some(sp) => { |
3672 | sp.map(|ast| ast.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr())) | ||
3673 | } | ||
3578 | None => continue, | 3674 | None => continue, |
3579 | }; | 3675 | }; |
3580 | types.push((syntax_ptr, ty)); | 3676 | types.push((syntax_ptr, ty)); |
@@ -3582,22 +3678,34 @@ fn infer(content: &str) -> String { | |||
3582 | 3678 | ||
3583 | for (expr, ty) in inference_result.type_of_expr.iter() { | 3679 | for (expr, ty) in inference_result.type_of_expr.iter() { |
3584 | let syntax_ptr = match body_source_map.expr_syntax(expr) { | 3680 | let syntax_ptr = match body_source_map.expr_syntax(expr) { |
3585 | Some(sp) => sp, | 3681 | Some(sp) => { |
3682 | sp.map(|ast| ast.either(|it| it.syntax_node_ptr(), |it| it.syntax_node_ptr())) | ||
3683 | } | ||
3586 | None => continue, | 3684 | None => continue, |
3587 | }; | 3685 | }; |
3588 | types.push((syntax_ptr, ty)); | 3686 | types.push((syntax_ptr, ty)); |
3589 | } | 3687 | } |
3590 | 3688 | ||
3591 | // sort ranges for consistency | 3689 | // sort ranges for consistency |
3592 | types.sort_by_key(|(ptr, _)| (ptr.range().start(), ptr.range().end())); | 3690 | types.sort_by_key(|(src_ptr, _)| (src_ptr.ast.range().start(), src_ptr.ast.range().end())); |
3593 | for (syntax_ptr, ty) in &types { | 3691 | for (src_ptr, ty) in &types { |
3594 | let node = syntax_ptr.to_node(source_file.syntax()); | 3692 | let node = src_ptr.ast.to_node(&src_ptr.file_syntax(&db)); |
3693 | |||
3595 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { | 3694 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { |
3596 | (self_param.self_kw_token().text_range(), "self".to_string()) | 3695 | (self_param.self_kw_token().text_range(), "self".to_string()) |
3597 | } else { | 3696 | } else { |
3598 | (syntax_ptr.range(), node.text().to_string().replace("\n", " ")) | 3697 | (src_ptr.ast.range(), node.text().to_string().replace("\n", " ")) |
3599 | }; | 3698 | }; |
3600 | write!(acc, "{} '{}': {}\n", range, ellipsize(text, 15), ty.display(&db)).unwrap(); | 3699 | let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" }; |
3700 | write!( | ||
3701 | acc, | ||
3702 | "{}{} '{}': {}\n", | ||
3703 | macro_prefix, | ||
3704 | range, | ||
3705 | ellipsize(text, 15), | ||
3706 | ty.display(&db) | ||
3707 | ) | ||
3708 | .unwrap(); | ||
3601 | } | 3709 | } |
3602 | }; | 3710 | }; |
3603 | 3711 | ||
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index b634f0b79..6e0271a96 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs | |||
@@ -8,7 +8,7 @@ use ra_db::salsa; | |||
8 | use ra_prof::profile; | 8 | use ra_prof::profile; |
9 | use rustc_hash::FxHashSet; | 9 | use rustc_hash::FxHashSet; |
10 | 10 | ||
11 | use super::{Canonical, GenericPredicate, HirDisplay, ProjectionTy, TraitRef, Ty}; | 11 | use super::{Canonical, GenericPredicate, HirDisplay, ProjectionTy, TraitRef, Ty, TypeWalk}; |
12 | use crate::{db::HirDatabase, Crate, ImplBlock, Trait}; | 12 | use crate::{db::HirDatabase, Crate, ImplBlock, Trait}; |
13 | 13 | ||
14 | use self::chalk::{from_chalk, ToChalk}; | 14 | use self::chalk::{from_chalk, ToChalk}; |
@@ -124,6 +124,9 @@ impl Obligation { | |||
124 | pub fn from_predicate(predicate: GenericPredicate) -> Option<Obligation> { | 124 | pub fn from_predicate(predicate: GenericPredicate) -> Option<Obligation> { |
125 | match predicate { | 125 | match predicate { |
126 | GenericPredicate::Implemented(trait_ref) => Some(Obligation::Trait(trait_ref)), | 126 | GenericPredicate::Implemented(trait_ref) => Some(Obligation::Trait(trait_ref)), |
127 | GenericPredicate::Projection(projection_pred) => { | ||
128 | Some(Obligation::Projection(projection_pred)) | ||
129 | } | ||
127 | GenericPredicate::Error => None, | 130 | GenericPredicate::Error => None, |
128 | } | 131 | } |
129 | } | 132 | } |
@@ -135,6 +138,18 @@ pub struct ProjectionPredicate { | |||
135 | pub ty: Ty, | 138 | pub ty: Ty, |
136 | } | 139 | } |
137 | 140 | ||
141 | impl TypeWalk for ProjectionPredicate { | ||
142 | fn walk(&self, f: &mut impl FnMut(&Ty)) { | ||
143 | self.projection_ty.walk(f); | ||
144 | self.ty.walk(f); | ||
145 | } | ||
146 | |||
147 | fn walk_mut(&mut self, f: &mut impl FnMut(&mut Ty)) { | ||
148 | self.projection_ty.walk_mut(f); | ||
149 | self.ty.walk_mut(f); | ||
150 | } | ||
151 | } | ||
152 | |||
138 | /// Solve a trait goal using Chalk. | 153 | /// Solve a trait goal using Chalk. |
139 | pub(crate) fn trait_solve_query( | 154 | pub(crate) fn trait_solve_query( |
140 | db: &impl HirDatabase, | 155 | db: &impl HirDatabase, |
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 2ebc06135..c201c5e50 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -19,6 +19,7 @@ use crate::{ | |||
19 | ty::display::HirDisplay, | 19 | ty::display::HirDisplay, |
20 | ty::{ | 20 | ty::{ |
21 | ApplicationTy, CallableDef, GenericPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 21 | ApplicationTy, CallableDef, GenericPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, |
22 | TypeWalk, | ||
22 | }, | 23 | }, |
23 | Crate, HasGenericParams, ImplBlock, ImplItem, Trait, TypeAlias, | 24 | Crate, HasGenericParams, ImplBlock, ImplItem, Trait, TypeAlias, |
24 | }; | 25 | }; |
@@ -211,6 +212,13 @@ impl ToChalk for GenericPredicate { | |||
211 | GenericPredicate::Implemented(trait_ref) => { | 212 | GenericPredicate::Implemented(trait_ref) => { |
212 | make_binders(chalk_ir::WhereClause::Implemented(trait_ref.to_chalk(db)), 0) | 213 | make_binders(chalk_ir::WhereClause::Implemented(trait_ref.to_chalk(db)), 0) |
213 | } | 214 | } |
215 | GenericPredicate::Projection(projection_pred) => make_binders( | ||
216 | chalk_ir::WhereClause::ProjectionEq(chalk_ir::ProjectionEq { | ||
217 | projection: projection_pred.projection_ty.to_chalk(db), | ||
218 | ty: projection_pred.ty.to_chalk(db), | ||
219 | }), | ||
220 | 0, | ||
221 | ), | ||
214 | GenericPredicate::Error => { | 222 | GenericPredicate::Error => { |
215 | let impossible_trait_ref = chalk_ir::TraitRef { | 223 | let impossible_trait_ref = chalk_ir::TraitRef { |
216 | trait_id: UNKNOWN_TRAIT, | 224 | trait_id: UNKNOWN_TRAIT, |
diff --git a/crates/ra_ide_api/src/completion/presentation.rs b/crates/ra_ide_api/src/completion/presentation.rs index f19eec9b7..db7e8348e 100644 --- a/crates/ra_ide_api/src/completion/presentation.rs +++ b/crates/ra_ide_api/src/completion/presentation.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | //! This modules takes care of rendering various defenitions as completion items. | 1 | //! This modules takes care of rendering various defenitions as completion items. |
2 | use hir::{Docs, HasSource, HirDisplay, PerNs, Resolution, Ty}; | 2 | use hir::{Docs, HasSource, HirDisplay, PerNs, Resolution, Ty, TypeWalk}; |
3 | use join_to_string::join; | 3 | use join_to_string::join; |
4 | use ra_syntax::ast::NameOwner; | 4 | use ra_syntax::ast::NameOwner; |
5 | use test_utils::tested_by; | 5 | use test_utils::tested_by; |
diff --git a/crates/ra_ide_api/src/join_lines.rs b/crates/ra_ide_api/src/join_lines.rs index a2e4b6f3c..a71e4ed7d 100644 --- a/crates/ra_ide_api/src/join_lines.rs +++ b/crates/ra_ide_api/src/join_lines.rs | |||
@@ -123,7 +123,7 @@ fn has_comma_after(node: &SyntaxNode) -> bool { | |||
123 | fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> { | 123 | fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> { |
124 | let block = ast::Block::cast(token.parent())?; | 124 | let block = ast::Block::cast(token.parent())?; |
125 | let block_expr = ast::BlockExpr::cast(block.syntax().parent()?)?; | 125 | let block_expr = ast::BlockExpr::cast(block.syntax().parent()?)?; |
126 | let expr = extract_trivial_expression(&block)?; | 126 | let expr = extract_trivial_expression(&block_expr)?; |
127 | 127 | ||
128 | let block_range = block_expr.syntax().text_range(); | 128 | let block_range = block_expr.syntax().text_range(); |
129 | let mut buf = expr.syntax().text().to_string(); | 129 | let mut buf = expr.syntax().text().to_string(); |
diff --git a/crates/ra_ide_api/src/syntax_tree.rs b/crates/ra_ide_api/src/syntax_tree.rs index dd31b9093..914759709 100644 --- a/crates/ra_ide_api/src/syntax_tree.rs +++ b/crates/ra_ide_api/src/syntax_tree.rs | |||
@@ -116,9 +116,10 @@ SOURCE_FILE@[0; 11) | |||
116 | L_PAREN@[6; 7) "(" | 116 | L_PAREN@[6; 7) "(" |
117 | R_PAREN@[7; 8) ")" | 117 | R_PAREN@[7; 8) ")" |
118 | WHITESPACE@[8; 9) " " | 118 | WHITESPACE@[8; 9) " " |
119 | BLOCK@[9; 11) | 119 | BLOCK_EXPR@[9; 11) |
120 | L_CURLY@[9; 10) "{" | 120 | BLOCK@[9; 11) |
121 | R_CURLY@[10; 11) "}" | 121 | L_CURLY@[9; 10) "{" |
122 | R_CURLY@[10; 11) "}" | ||
122 | "# | 123 | "# |
123 | .trim() | 124 | .trim() |
124 | ); | 125 | ); |
@@ -148,26 +149,27 @@ SOURCE_FILE@[0; 60) | |||
148 | L_PAREN@[7; 8) "(" | 149 | L_PAREN@[7; 8) "(" |
149 | R_PAREN@[8; 9) ")" | 150 | R_PAREN@[8; 9) ")" |
150 | WHITESPACE@[9; 10) " " | 151 | WHITESPACE@[9; 10) " " |
151 | BLOCK@[10; 60) | 152 | BLOCK_EXPR@[10; 60) |
152 | L_CURLY@[10; 11) "{" | 153 | BLOCK@[10; 60) |
153 | WHITESPACE@[11; 16) "\n " | 154 | L_CURLY@[10; 11) "{" |
154 | EXPR_STMT@[16; 58) | 155 | WHITESPACE@[11; 16) "\n " |
155 | MACRO_CALL@[16; 57) | 156 | EXPR_STMT@[16; 58) |
156 | PATH@[16; 22) | 157 | MACRO_CALL@[16; 57) |
157 | PATH_SEGMENT@[16; 22) | 158 | PATH@[16; 22) |
158 | NAME_REF@[16; 22) | 159 | PATH_SEGMENT@[16; 22) |
159 | IDENT@[16; 22) "assert" | 160 | NAME_REF@[16; 22) |
160 | EXCL@[22; 23) "!" | 161 | IDENT@[16; 22) "assert" |
161 | TOKEN_TREE@[23; 57) | 162 | EXCL@[22; 23) "!" |
162 | L_PAREN@[23; 24) "(" | 163 | TOKEN_TREE@[23; 57) |
163 | STRING@[24; 52) "\"\n fn foo() {\n ..." | 164 | L_PAREN@[23; 24) "(" |
164 | COMMA@[52; 53) "," | 165 | STRING@[24; 52) "\"\n fn foo() {\n ..." |
165 | WHITESPACE@[53; 54) " " | 166 | COMMA@[52; 53) "," |
166 | STRING@[54; 56) "\"\"" | 167 | WHITESPACE@[53; 54) " " |
167 | R_PAREN@[56; 57) ")" | 168 | STRING@[54; 56) "\"\"" |
168 | SEMI@[57; 58) ";" | 169 | R_PAREN@[56; 57) ")" |
169 | WHITESPACE@[58; 59) "\n" | 170 | SEMI@[57; 58) ";" |
170 | R_CURLY@[59; 60) "}" | 171 | WHITESPACE@[58; 59) "\n" |
172 | R_CURLY@[59; 60) "}" | ||
171 | "# | 173 | "# |
172 | .trim() | 174 | .trim() |
173 | ); | 175 | ); |
@@ -190,9 +192,10 @@ FN_DEF@[0; 11) | |||
190 | L_PAREN@[6; 7) "(" | 192 | L_PAREN@[6; 7) "(" |
191 | R_PAREN@[7; 8) ")" | 193 | R_PAREN@[7; 8) ")" |
192 | WHITESPACE@[8; 9) " " | 194 | WHITESPACE@[8; 9) " " |
193 | BLOCK@[9; 11) | 195 | BLOCK_EXPR@[9; 11) |
194 | L_CURLY@[9; 10) "{" | 196 | BLOCK@[9; 11) |
195 | R_CURLY@[10; 11) "}" | 197 | L_CURLY@[9; 10) "{" |
198 | R_CURLY@[10; 11) "}" | ||
196 | "# | 199 | "# |
197 | .trim() | 200 | .trim() |
198 | ); | 201 | ); |
@@ -258,10 +261,11 @@ SOURCE_FILE@[0; 12) | |||
258 | L_PAREN@[6; 7) "(" | 261 | L_PAREN@[6; 7) "(" |
259 | R_PAREN@[7; 8) ")" | 262 | R_PAREN@[7; 8) ")" |
260 | WHITESPACE@[8; 9) " " | 263 | WHITESPACE@[8; 9) " " |
261 | BLOCK@[9; 12) | 264 | BLOCK_EXPR@[9; 12) |
262 | L_CURLY@[9; 10) "{" | 265 | BLOCK@[9; 12) |
263 | WHITESPACE@[10; 11) "\n" | 266 | L_CURLY@[9; 10) "{" |
264 | R_CURLY@[11; 12) "}" | 267 | WHITESPACE@[10; 11) "\n" |
268 | R_CURLY@[11; 12) "}" | ||
265 | "# | 269 | "# |
266 | .trim() | 270 | .trim() |
267 | ); | 271 | ); |
@@ -292,10 +296,11 @@ SOURCE_FILE@[0; 12) | |||
292 | L_PAREN@[6; 7) "(" | 296 | L_PAREN@[6; 7) "(" |
293 | R_PAREN@[7; 8) ")" | 297 | R_PAREN@[7; 8) ")" |
294 | WHITESPACE@[8; 9) " " | 298 | WHITESPACE@[8; 9) " " |
295 | BLOCK@[9; 12) | 299 | BLOCK_EXPR@[9; 12) |
296 | L_CURLY@[9; 10) "{" | 300 | BLOCK@[9; 12) |
297 | WHITESPACE@[10; 11) "\n" | 301 | L_CURLY@[9; 10) "{" |
298 | R_CURLY@[11; 12) "}" | 302 | WHITESPACE@[10; 11) "\n" |
303 | R_CURLY@[11; 12) "}" | ||
299 | "# | 304 | "# |
300 | .trim() | 305 | .trim() |
301 | ); | 306 | ); |
@@ -325,10 +330,11 @@ SOURCE_FILE@[0; 25) | |||
325 | L_PAREN@[6; 7) "(" | 330 | L_PAREN@[6; 7) "(" |
326 | R_PAREN@[7; 8) ")" | 331 | R_PAREN@[7; 8) ")" |
327 | WHITESPACE@[8; 9) " " | 332 | WHITESPACE@[8; 9) " " |
328 | BLOCK@[9; 12) | 333 | BLOCK_EXPR@[9; 12) |
329 | L_CURLY@[9; 10) "{" | 334 | BLOCK@[9; 12) |
330 | WHITESPACE@[10; 11) "\n" | 335 | L_CURLY@[9; 10) "{" |
331 | R_CURLY@[11; 12) "}" | 336 | WHITESPACE@[10; 11) "\n" |
337 | R_CURLY@[11; 12) "}" | ||
332 | WHITESPACE@[12; 13) "\n" | 338 | WHITESPACE@[12; 13) "\n" |
333 | FN_DEF@[13; 25) | 339 | FN_DEF@[13; 25) |
334 | FN_KW@[13; 15) "fn" | 340 | FN_KW@[13; 15) "fn" |
@@ -339,10 +345,11 @@ SOURCE_FILE@[0; 25) | |||
339 | L_PAREN@[19; 20) "(" | 345 | L_PAREN@[19; 20) "(" |
340 | R_PAREN@[20; 21) ")" | 346 | R_PAREN@[20; 21) ")" |
341 | WHITESPACE@[21; 22) " " | 347 | WHITESPACE@[21; 22) " " |
342 | BLOCK@[22; 25) | 348 | BLOCK_EXPR@[22; 25) |
343 | L_CURLY@[22; 23) "{" | 349 | BLOCK@[22; 25) |
344 | WHITESPACE@[23; 24) "\n" | 350 | L_CURLY@[22; 23) "{" |
345 | R_CURLY@[24; 25) "}" | 351 | WHITESPACE@[23; 24) "\n" |
352 | R_CURLY@[24; 25) "}" | ||
346 | "# | 353 | "# |
347 | .trim() | 354 | .trim() |
348 | ); | 355 | ); |
diff --git a/crates/ra_lsp_server/Cargo.toml b/crates/ra_lsp_server/Cargo.toml index eb4812633..07cc2dd32 100644 --- a/crates/ra_lsp_server/Cargo.toml +++ b/crates/ra_lsp_server/Cargo.toml | |||
@@ -12,7 +12,7 @@ serde = { version = "1.0.83", features = ["derive"] } | |||
12 | crossbeam-channel = "0.3.5" | 12 | crossbeam-channel = "0.3.5" |
13 | flexi_logger = "0.14.0" | 13 | flexi_logger = "0.14.0" |
14 | log = "0.4.3" | 14 | log = "0.4.3" |
15 | lsp-types = { version = "0.60.0", features = ["proposed"] } | 15 | lsp-types = { version = "0.61.0", features = ["proposed"] } |
16 | rustc-hash = "1.0" | 16 | rustc-hash = "1.0" |
17 | parking_lot = "0.9.0" | 17 | parking_lot = "0.9.0" |
18 | jod-thread = "0.1.0" | 18 | jod-thread = "0.1.0" |
diff --git a/crates/ra_lsp_server/src/caps.rs b/crates/ra_lsp_server/src/caps.rs index bb9205aed..22fc97a97 100644 --- a/crates/ra_lsp_server/src/caps.rs +++ b/crates/ra_lsp_server/src/caps.rs | |||
@@ -43,6 +43,7 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
43 | rename_provider: Some(RenameProviderCapability::Options(RenameOptions { | 43 | rename_provider: Some(RenameProviderCapability::Options(RenameOptions { |
44 | prepare_provider: Some(true), | 44 | prepare_provider: Some(true), |
45 | })), | 45 | })), |
46 | document_link_provider: None, | ||
46 | color_provider: None, | 47 | color_provider: None, |
47 | execute_command_provider: None, | 48 | execute_command_provider: None, |
48 | workspace: None, | 49 | workspace: None, |
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs index f185aecb7..01641fdee 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/ra_mbe/src/mbe_expander.rs | |||
@@ -1,7 +1,9 @@ | |||
1 | //! This module takes a (parsed) definition of `macro_rules` invocation, a | ||
2 | //! `tt::TokenTree` representing an argument of macro invocation, and produces a | ||
3 | //! `tt::TokenTree` for the result of the expansion. | ||
4 | |||
5 | use ra_parser::FragmentKind::*; | ||
1 | use ra_syntax::SmolStr; | 6 | use ra_syntax::SmolStr; |
2 | /// This module takes a (parsed) definition of `macro_rules` invocation, a | ||
3 | /// `tt::TokenTree` representing an argument of macro invocation, and produces a | ||
4 | /// `tt::TokenTree` for the result of the expansion. | ||
5 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
6 | use tt::TokenId; | 8 | use tt::TokenId; |
7 | 9 | ||
@@ -191,82 +193,12 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result<Bindings, | |||
191 | match pat { | 193 | match pat { |
192 | crate::TokenTree::Leaf(leaf) => match leaf { | 194 | crate::TokenTree::Leaf(leaf) => match leaf { |
193 | crate::Leaf::Var(crate::Var { text, kind }) => { | 195 | crate::Leaf::Var(crate::Var { text, kind }) => { |
194 | let kind = kind.clone().ok_or(ExpandError::UnexpectedToken)?; | 196 | let kind = kind.as_ref().ok_or(ExpandError::UnexpectedToken)?; |
195 | match kind.as_str() { | 197 | match match_meta_var(kind.as_str(), input)? { |
196 | "ident" => { | 198 | Some(tt) => { |
197 | let ident = | 199 | res.inner.insert(text.clone(), Binding::Simple(tt)); |
198 | input.eat_ident().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
199 | res.inner.insert( | ||
200 | text.clone(), | ||
201 | Binding::Simple(tt::Leaf::from(ident).into()), | ||
202 | ); | ||
203 | } | ||
204 | "path" => { | ||
205 | let path = | ||
206 | input.eat_path().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
207 | res.inner.insert(text.clone(), Binding::Simple(path)); | ||
208 | } | ||
209 | "expr" => { | ||
210 | let expr = | ||
211 | input.eat_expr().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
212 | res.inner.insert(text.clone(), Binding::Simple(expr)); | ||
213 | } | ||
214 | "ty" => { | ||
215 | let ty = input.eat_ty().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
216 | res.inner.insert(text.clone(), Binding::Simple(ty)); | ||
217 | } | ||
218 | "pat" => { | ||
219 | let pat = input.eat_pat().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
220 | res.inner.insert(text.clone(), Binding::Simple(pat)); | ||
221 | } | ||
222 | "stmt" => { | ||
223 | let pat = input.eat_stmt().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
224 | res.inner.insert(text.clone(), Binding::Simple(pat)); | ||
225 | } | ||
226 | "block" => { | ||
227 | let block = | ||
228 | input.eat_block().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
229 | res.inner.insert(text.clone(), Binding::Simple(block)); | ||
230 | } | ||
231 | "meta" => { | ||
232 | let meta = | ||
233 | input.eat_meta().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
234 | res.inner.insert(text.clone(), Binding::Simple(meta)); | ||
235 | } | ||
236 | "tt" => { | ||
237 | let token = input.eat().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
238 | res.inner.insert(text.clone(), Binding::Simple(token)); | ||
239 | } | ||
240 | "item" => { | ||
241 | let item = | ||
242 | input.eat_item().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
243 | res.inner.insert(text.clone(), Binding::Simple(item)); | ||
244 | } | ||
245 | "lifetime" => { | ||
246 | let lifetime = | ||
247 | input.eat_lifetime().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
248 | res.inner.insert(text.clone(), Binding::Simple(lifetime)); | ||
249 | } | 200 | } |
250 | "literal" => { | 201 | None => res.push_optional(text), |
251 | let literal = | ||
252 | input.eat_literal().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
253 | |||
254 | res.inner.insert( | ||
255 | text.clone(), | ||
256 | Binding::Simple(tt::Leaf::from(literal).into()), | ||
257 | ); | ||
258 | } | ||
259 | "vis" => { | ||
260 | // `vis` is optional | ||
261 | if let Some(vis) = input.try_eat_vis() { | ||
262 | let vis = vis.clone(); | ||
263 | res.inner.insert(text.clone(), Binding::Simple(vis)); | ||
264 | } else { | ||
265 | res.push_optional(&text); | ||
266 | } | ||
267 | } | ||
268 | |||
269 | _ => return Err(ExpandError::UnexpectedToken), | ||
270 | } | 202 | } |
271 | } | 203 | } |
272 | crate::Leaf::Punct(punct) => { | 204 | crate::Leaf::Punct(punct) => { |
@@ -360,6 +292,42 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result<Bindings, | |||
360 | Ok(res) | 292 | Ok(res) |
361 | } | 293 | } |
362 | 294 | ||
295 | fn match_meta_var(kind: &str, input: &mut TtCursor) -> Result<Option<tt::TokenTree>, ExpandError> { | ||
296 | let fragment = match kind { | ||
297 | "path" => Path, | ||
298 | "expr" => Expr, | ||
299 | "ty" => Type, | ||
300 | "pat" => Pattern, | ||
301 | "stmt" => Statement, | ||
302 | "block" => Block, | ||
303 | "meta" => MetaItem, | ||
304 | "item" => Item, | ||
305 | _ => { | ||
306 | let binding = match kind { | ||
307 | "ident" => { | ||
308 | let ident = input.eat_ident().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
309 | tt::Leaf::from(ident).into() | ||
310 | } | ||
311 | "tt" => input.eat().ok_or(ExpandError::UnexpectedToken)?.clone(), | ||
312 | "lifetime" => input.eat_lifetime().ok_or(ExpandError::UnexpectedToken)?.clone(), | ||
313 | "literal" => { | ||
314 | let literal = input.eat_literal().ok_or(ExpandError::UnexpectedToken)?.clone(); | ||
315 | tt::Leaf::from(literal).into() | ||
316 | } | ||
317 | // `vis` is optional | ||
318 | "vis" => match input.try_eat_vis() { | ||
319 | Some(vis) => vis, | ||
320 | None => return Ok(None), | ||
321 | }, | ||
322 | _ => return Err(ExpandError::UnexpectedToken), | ||
323 | }; | ||
324 | return Ok(Some(binding)); | ||
325 | } | ||
326 | }; | ||
327 | let binding = input.eat_fragment(fragment).ok_or(ExpandError::UnexpectedToken)?; | ||
328 | Ok(Some(binding)) | ||
329 | } | ||
330 | |||
363 | #[derive(Debug)] | 331 | #[derive(Debug)] |
364 | struct ExpandCtx<'a> { | 332 | struct ExpandCtx<'a> { |
365 | bindings: &'a Bindings, | 333 | bindings: &'a Bindings, |
diff --git a/crates/ra_mbe/src/subtree_parser.rs b/crates/ra_mbe/src/subtree_parser.rs index 5688e7f7f..4440c69ff 100644 --- a/crates/ra_mbe/src/subtree_parser.rs +++ b/crates/ra_mbe/src/subtree_parser.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use crate::subtree_source::SubtreeTokenSource; | 1 | use crate::subtree_source::SubtreeTokenSource; |
2 | 2 | ||
3 | use ra_parser::{TokenSource, TreeSink}; | 3 | use ra_parser::{FragmentKind, TokenSource, TreeSink}; |
4 | use ra_syntax::SyntaxKind; | 4 | use ra_syntax::SyntaxKind; |
5 | use tt::buffer::{Cursor, TokenBuffer}; | 5 | use tt::buffer::{Cursor, TokenBuffer}; |
6 | 6 | ||
@@ -52,40 +52,10 @@ impl<'a> Parser<'a> { | |||
52 | Parser { cur_pos, subtree } | 52 | Parser { cur_pos, subtree } |
53 | } | 53 | } |
54 | 54 | ||
55 | pub fn parse_path(self) -> Option<tt::TokenTree> { | 55 | pub fn parse_fragment(self, fragment_kind: FragmentKind) -> Option<tt::TokenTree> { |
56 | self.parse(ra_parser::parse_path) | 56 | self.parse(|token_source, tree_skink| { |
57 | } | 57 | ra_parser::parse_fragment(token_source, tree_skink, fragment_kind) |
58 | 58 | }) | |
59 | pub fn parse_expr(self) -> Option<tt::TokenTree> { | ||
60 | self.parse(ra_parser::parse_expr) | ||
61 | } | ||
62 | |||
63 | pub fn parse_ty(self) -> Option<tt::TokenTree> { | ||
64 | self.parse(ra_parser::parse_ty) | ||
65 | } | ||
66 | |||
67 | pub fn parse_pat(self) -> Option<tt::TokenTree> { | ||
68 | self.parse(ra_parser::parse_pat) | ||
69 | } | ||
70 | |||
71 | pub fn parse_stmt(self) -> Option<tt::TokenTree> { | ||
72 | self.parse(|src, sink| ra_parser::parse_stmt(src, sink, false)) | ||
73 | } | ||
74 | |||
75 | pub fn parse_block(self) -> Option<tt::TokenTree> { | ||
76 | self.parse(ra_parser::parse_block) | ||
77 | } | ||
78 | |||
79 | pub fn parse_meta(self) -> Option<tt::TokenTree> { | ||
80 | self.parse(ra_parser::parse_meta) | ||
81 | } | ||
82 | |||
83 | pub fn parse_item(self) -> Option<tt::TokenTree> { | ||
84 | self.parse(ra_parser::parse_item) | ||
85 | } | ||
86 | |||
87 | pub fn parse_vis(self) -> Option<tt::TokenTree> { | ||
88 | self.parse(ra_parser::parse_vis) | ||
89 | } | 59 | } |
90 | 60 | ||
91 | fn parse<F>(self, f: F) -> Option<tt::TokenTree> | 61 | fn parse<F>(self, f: F) -> Option<tt::TokenTree> |
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 8225759e7..a380b1cfd 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs | |||
@@ -1,4 +1,7 @@ | |||
1 | use ra_parser::{ParseError, TreeSink}; | 1 | use ra_parser::{ |
2 | FragmentKind::{self, *}, | ||
3 | ParseError, TreeSink, | ||
4 | }; | ||
2 | use ra_syntax::{ | 5 | use ra_syntax::{ |
3 | ast, AstNode, AstToken, NodeOrToken, Parse, SmolStr, SyntaxKind, SyntaxKind::*, SyntaxNode, | 6 | ast, AstNode, AstToken, NodeOrToken, Parse, SmolStr, SyntaxKind, SyntaxKind::*, SyntaxNode, |
4 | SyntaxTreeBuilder, TextRange, TextUnit, T, | 7 | SyntaxTreeBuilder, TextRange, TextUnit, T, |
@@ -63,33 +66,50 @@ where | |||
63 | Ok(parse) | 66 | Ok(parse) |
64 | } | 67 | } |
65 | 68 | ||
69 | fn fragment_to_syntax_node( | ||
70 | tt: &tt::Subtree, | ||
71 | fragment_kind: FragmentKind, | ||
72 | ) -> Result<Parse<SyntaxNode>, ExpandError> { | ||
73 | let tokens = [tt.clone().into()]; | ||
74 | let buffer = TokenBuffer::new(&tokens); | ||
75 | let mut token_source = SubtreeTokenSource::new(&buffer); | ||
76 | let mut tree_sink = TtTreeSink::new(buffer.begin()); | ||
77 | ra_parser::parse_fragment(&mut token_source, &mut tree_sink, fragment_kind); | ||
78 | if tree_sink.roots.len() != 1 { | ||
79 | return Err(ExpandError::ConversionError); | ||
80 | } | ||
81 | //FIXME: would be cool to report errors | ||
82 | let parse = tree_sink.inner.finish(); | ||
83 | Ok(parse) | ||
84 | } | ||
85 | |||
66 | /// Parses the token tree (result of macro expansion) to an expression | 86 | /// Parses the token tree (result of macro expansion) to an expression |
67 | pub fn token_tree_to_expr(tt: &tt::Subtree) -> Result<Parse<ast::Expr>, ExpandError> { | 87 | pub fn token_tree_to_expr(tt: &tt::Subtree) -> Result<Parse<ast::Expr>, ExpandError> { |
68 | let parse = token_tree_to_syntax_node(tt, ra_parser::parse_expr)?; | 88 | let parse = fragment_to_syntax_node(tt, Expr)?; |
69 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) | 89 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) |
70 | } | 90 | } |
71 | 91 | ||
72 | /// Parses the token tree (result of macro expansion) to a Pattern | 92 | /// Parses the token tree (result of macro expansion) to a Pattern |
73 | pub fn token_tree_to_pat(tt: &tt::Subtree) -> Result<Parse<ast::Pat>, ExpandError> { | 93 | pub fn token_tree_to_pat(tt: &tt::Subtree) -> Result<Parse<ast::Pat>, ExpandError> { |
74 | let parse = token_tree_to_syntax_node(tt, ra_parser::parse_pat)?; | 94 | let parse = fragment_to_syntax_node(tt, Pattern)?; |
75 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) | 95 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) |
76 | } | 96 | } |
77 | 97 | ||
78 | /// Parses the token tree (result of macro expansion) to a Type | 98 | /// Parses the token tree (result of macro expansion) to a Type |
79 | pub fn token_tree_to_ty(tt: &tt::Subtree) -> Result<Parse<ast::TypeRef>, ExpandError> { | 99 | pub fn token_tree_to_ty(tt: &tt::Subtree) -> Result<Parse<ast::TypeRef>, ExpandError> { |
80 | let parse = token_tree_to_syntax_node(tt, ra_parser::parse_ty)?; | 100 | let parse = fragment_to_syntax_node(tt, Type)?; |
81 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) | 101 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) |
82 | } | 102 | } |
83 | 103 | ||
84 | /// Parses the token tree (result of macro expansion) as a sequence of stmts | 104 | /// Parses the token tree (result of macro expansion) as a sequence of stmts |
85 | pub fn token_tree_to_macro_stmts(tt: &tt::Subtree) -> Result<Parse<ast::MacroStmts>, ExpandError> { | 105 | pub fn token_tree_to_macro_stmts(tt: &tt::Subtree) -> Result<Parse<ast::MacroStmts>, ExpandError> { |
86 | let parse = token_tree_to_syntax_node(tt, ra_parser::parse_macro_stmts)?; | 106 | let parse = fragment_to_syntax_node(tt, Statements)?; |
87 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) | 107 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) |
88 | } | 108 | } |
89 | 109 | ||
90 | /// Parses the token tree (result of macro expansion) as a sequence of items | 110 | /// Parses the token tree (result of macro expansion) as a sequence of items |
91 | pub fn token_tree_to_macro_items(tt: &tt::Subtree) -> Result<Parse<ast::MacroItems>, ExpandError> { | 111 | pub fn token_tree_to_macro_items(tt: &tt::Subtree) -> Result<Parse<ast::MacroItems>, ExpandError> { |
92 | let parse = token_tree_to_syntax_node(tt, ra_parser::parse_macro_items)?; | 112 | let parse = fragment_to_syntax_node(tt, Items)?; |
93 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) | 113 | parse.cast().ok_or_else(|| crate::ExpandError::ConversionError) |
94 | } | 114 | } |
95 | 115 | ||
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 1dbf22997..034ea639b 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs | |||
@@ -678,21 +678,22 @@ fn test_expr_order() { | |||
678 | PARAM_LIST@[5; 7) | 678 | PARAM_LIST@[5; 7) |
679 | L_PAREN@[5; 6) "(" | 679 | L_PAREN@[5; 6) "(" |
680 | R_PAREN@[6; 7) ")" | 680 | R_PAREN@[6; 7) ")" |
681 | BLOCK@[7; 15) | 681 | BLOCK_EXPR@[7; 15) |
682 | L_CURLY@[7; 8) "{" | 682 | BLOCK@[7; 15) |
683 | EXPR_STMT@[8; 14) | 683 | L_CURLY@[7; 8) "{" |
684 | BIN_EXPR@[8; 13) | 684 | EXPR_STMT@[8; 14) |
685 | BIN_EXPR@[8; 11) | 685 | BIN_EXPR@[8; 13) |
686 | LITERAL@[8; 9) | 686 | BIN_EXPR@[8; 11) |
687 | INT_NUMBER@[8; 9) "1" | 687 | LITERAL@[8; 9) |
688 | PLUS@[9; 10) "+" | 688 | INT_NUMBER@[8; 9) "1" |
689 | LITERAL@[10; 11) | 689 | PLUS@[9; 10) "+" |
690 | INT_NUMBER@[10; 11) "1" | 690 | LITERAL@[10; 11) |
691 | STAR@[11; 12) "*" | 691 | INT_NUMBER@[10; 11) "1" |
692 | LITERAL@[12; 13) | 692 | STAR@[11; 12) "*" |
693 | INT_NUMBER@[12; 13) "2" | 693 | LITERAL@[12; 13) |
694 | SEMI@[13; 14) ";" | 694 | INT_NUMBER@[12; 13) "2" |
695 | R_CURLY@[14; 15) "}""#, | 695 | SEMI@[13; 14) ";" |
696 | R_CURLY@[14; 15) "}""#, | ||
696 | ); | 697 | ); |
697 | } | 698 | } |
698 | 699 | ||
diff --git a/crates/ra_mbe/src/tt_cursor.rs b/crates/ra_mbe/src/tt_cursor.rs index 468276397..a69c006c7 100644 --- a/crates/ra_mbe/src/tt_cursor.rs +++ b/crates/ra_mbe/src/tt_cursor.rs | |||
@@ -1,5 +1,6 @@ | |||
1 | use crate::subtree_parser::Parser; | 1 | use crate::{subtree_parser::Parser, ParseError}; |
2 | use crate::ParseError; | 2 | |
3 | use ra_parser::FragmentKind; | ||
3 | use smallvec::{smallvec, SmallVec}; | 4 | use smallvec::{smallvec, SmallVec}; |
4 | 5 | ||
5 | #[derive(Debug, Clone)] | 6 | #[derive(Debug, Clone)] |
@@ -98,44 +99,9 @@ impl<'a> TtCursor<'a> { | |||
98 | }) | 99 | }) |
99 | } | 100 | } |
100 | 101 | ||
101 | pub(crate) fn eat_path(&mut self) -> Option<tt::TokenTree> { | 102 | pub(crate) fn eat_fragment(&mut self, fragment_kind: FragmentKind) -> Option<tt::TokenTree> { |
102 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
103 | parser.parse_path() | ||
104 | } | ||
105 | |||
106 | pub(crate) fn eat_expr(&mut self) -> Option<tt::TokenTree> { | ||
107 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
108 | parser.parse_expr() | ||
109 | } | ||
110 | |||
111 | pub(crate) fn eat_ty(&mut self) -> Option<tt::TokenTree> { | ||
112 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
113 | parser.parse_ty() | ||
114 | } | ||
115 | |||
116 | pub(crate) fn eat_pat(&mut self) -> Option<tt::TokenTree> { | ||
117 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
118 | parser.parse_pat() | ||
119 | } | ||
120 | |||
121 | pub(crate) fn eat_stmt(&mut self) -> Option<tt::TokenTree> { | ||
122 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
123 | parser.parse_stmt() | ||
124 | } | ||
125 | |||
126 | pub(crate) fn eat_block(&mut self) -> Option<tt::TokenTree> { | ||
127 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
128 | parser.parse_block() | ||
129 | } | ||
130 | |||
131 | pub(crate) fn eat_meta(&mut self) -> Option<tt::TokenTree> { | ||
132 | let parser = Parser::new(&mut self.pos, self.subtree); | ||
133 | parser.parse_meta() | ||
134 | } | ||
135 | |||
136 | pub(crate) fn eat_item(&mut self) -> Option<tt::TokenTree> { | ||
137 | let parser = Parser::new(&mut self.pos, self.subtree); | 103 | let parser = Parser::new(&mut self.pos, self.subtree); |
138 | parser.parse_item() | 104 | parser.parse_fragment(fragment_kind) |
139 | } | 105 | } |
140 | 106 | ||
141 | pub(crate) fn eat_lifetime(&mut self) -> Option<tt::TokenTree> { | 107 | pub(crate) fn eat_lifetime(&mut self) -> Option<tt::TokenTree> { |
@@ -154,7 +120,7 @@ impl<'a> TtCursor<'a> { | |||
154 | let old_pos = self.pos; | 120 | let old_pos = self.pos; |
155 | let parser = Parser::new(&mut self.pos, self.subtree); | 121 | let parser = Parser::new(&mut self.pos, self.subtree); |
156 | 122 | ||
157 | let res = parser.parse_vis(); | 123 | let res = parser.parse_fragment(FragmentKind::Visibility); |
158 | if res.is_none() { | 124 | if res.is_none() { |
159 | self.pos = old_pos; | 125 | self.pos = old_pos; |
160 | } | 126 | } |
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index dee3a229d..be9419e0c 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -49,98 +49,93 @@ pub(crate) fn root(p: &mut Parser) { | |||
49 | m.complete(p, SOURCE_FILE); | 49 | m.complete(p, SOURCE_FILE); |
50 | } | 50 | } |
51 | 51 | ||
52 | pub(crate) fn macro_items(p: &mut Parser) { | 52 | /// Various pieces of syntax that can be parsed by macros by example |
53 | let m = p.start(); | 53 | pub(crate) mod fragments { |
54 | items::mod_contents(p, false); | 54 | use super::*; |
55 | m.complete(p, MACRO_ITEMS); | ||
56 | } | ||
57 | 55 | ||
58 | pub(crate) fn macro_stmts(p: &mut Parser) { | 56 | pub(crate) use super::{ |
59 | let m = p.start(); | 57 | expressions::block, paths::type_path as path, patterns::pattern, types::type_, |
60 | 58 | }; | |
61 | while !p.at(EOF) { | ||
62 | if p.current() == T![;] { | ||
63 | p.bump(); | ||
64 | continue; | ||
65 | } | ||
66 | 59 | ||
67 | expressions::stmt(p, expressions::StmtWithSemi::Optional); | 60 | pub(crate) fn expr(p: &mut Parser) { |
61 | let _ = expressions::expr(p); | ||
68 | } | 62 | } |
69 | 63 | ||
70 | m.complete(p, MACRO_STMTS); | 64 | pub(crate) fn stmt(p: &mut Parser) { |
71 | } | 65 | expressions::stmt(p, expressions::StmtWithSemi::No) |
72 | 66 | } | |
73 | pub(crate) fn path(p: &mut Parser) { | ||
74 | paths::type_path(p); | ||
75 | } | ||
76 | |||
77 | pub(crate) fn expr(p: &mut Parser) { | ||
78 | expressions::expr(p); | ||
79 | } | ||
80 | 67 | ||
81 | pub(crate) fn type_(p: &mut Parser) { | 68 | pub(crate) fn opt_visibility(p: &mut Parser) { |
82 | types::type_(p) | 69 | let _ = super::opt_visibility(p); |
83 | } | 70 | } |
84 | 71 | ||
85 | pub(crate) fn pattern(p: &mut Parser) { | 72 | // Parse a meta item , which excluded [], e.g : #[ MetaItem ] |
86 | patterns::pattern(p) | 73 | pub(crate) fn meta_item(p: &mut Parser) { |
87 | } | 74 | fn is_delimiter(p: &mut Parser) -> bool { |
75 | match p.current() { | ||
76 | T!['{'] | T!['('] | T!['['] => true, | ||
77 | _ => false, | ||
78 | } | ||
79 | } | ||
88 | 80 | ||
89 | pub(crate) fn stmt(p: &mut Parser, with_semi: bool) { | 81 | if is_delimiter(p) { |
90 | let with_semi = | 82 | items::token_tree(p); |
91 | if with_semi { expressions::StmtWithSemi::Yes } else { expressions::StmtWithSemi::No }; | 83 | return; |
84 | } | ||
92 | 85 | ||
93 | expressions::stmt(p, with_semi) | 86 | let m = p.start(); |
94 | } | 87 | while !p.at(EOF) { |
88 | if is_delimiter(p) { | ||
89 | items::token_tree(p); | ||
90 | break; | ||
91 | } else { | ||
92 | // https://doc.rust-lang.org/reference/attributes.html | ||
93 | // https://doc.rust-lang.org/reference/paths.html#simple-paths | ||
94 | // The start of an meta must be a simple path | ||
95 | match p.current() { | ||
96 | IDENT | T![::] | T![super] | T![self] | T![crate] => p.bump(), | ||
97 | T![=] => { | ||
98 | p.bump(); | ||
99 | match p.current() { | ||
100 | c if c.is_literal() => p.bump(), | ||
101 | T![true] | T![false] => p.bump(), | ||
102 | _ => {} | ||
103 | } | ||
104 | break; | ||
105 | } | ||
106 | _ => break, | ||
107 | } | ||
108 | } | ||
109 | } | ||
95 | 110 | ||
96 | pub(crate) fn block(p: &mut Parser) { | 111 | m.complete(p, TOKEN_TREE); |
97 | expressions::block(p); | 112 | } |
98 | } | ||
99 | 113 | ||
100 | // Parse a meta item , which excluded [], e.g : #[ MetaItem ] | 114 | pub(crate) fn item(p: &mut Parser) { |
101 | pub(crate) fn meta_item(p: &mut Parser) { | 115 | items::item_or_macro(p, true, items::ItemFlavor::Mod) |
102 | fn is_delimiter(p: &mut Parser) -> bool { | ||
103 | match p.current() { | ||
104 | T!['{'] | T!['('] | T!['['] => true, | ||
105 | _ => false, | ||
106 | } | ||
107 | } | 116 | } |
108 | 117 | ||
109 | if is_delimiter(p) { | 118 | pub(crate) fn macro_items(p: &mut Parser) { |
110 | items::token_tree(p); | 119 | let m = p.start(); |
111 | return; | 120 | items::mod_contents(p, false); |
121 | m.complete(p, MACRO_ITEMS); | ||
112 | } | 122 | } |
113 | 123 | ||
114 | let m = p.start(); | 124 | pub(crate) fn macro_stmts(p: &mut Parser) { |
115 | while !p.at(EOF) { | 125 | let m = p.start(); |
116 | if is_delimiter(p) { | 126 | |
117 | items::token_tree(p); | 127 | while !p.at(EOF) { |
118 | break; | 128 | if p.current() == T![;] { |
119 | } else { | 129 | p.bump(); |
120 | // https://doc.rust-lang.org/reference/attributes.html | 130 | continue; |
121 | // https://doc.rust-lang.org/reference/paths.html#simple-paths | ||
122 | // The start of an meta must be a simple path | ||
123 | match p.current() { | ||
124 | IDENT | T![::] | T![super] | T![self] | T![crate] => p.bump(), | ||
125 | T![=] => { | ||
126 | p.bump(); | ||
127 | match p.current() { | ||
128 | c if c.is_literal() => p.bump(), | ||
129 | T![true] | T![false] => p.bump(), | ||
130 | _ => {} | ||
131 | } | ||
132 | break; | ||
133 | } | ||
134 | _ => break, | ||
135 | } | 131 | } |
132 | |||
133 | expressions::stmt(p, expressions::StmtWithSemi::Optional); | ||
136 | } | 134 | } |
137 | } | ||
138 | 135 | ||
139 | m.complete(p, TOKEN_TREE); | 136 | m.complete(p, MACRO_STMTS); |
140 | } | 137 | } |
141 | 138 | ||
142 | pub(crate) fn item(p: &mut Parser) { | ||
143 | items::item_or_macro(p, true, items::ItemFlavor::Mod) | ||
144 | } | 139 | } |
145 | 140 | ||
146 | pub(crate) fn reparser( | 141 | pub(crate) fn reparser( |
@@ -149,7 +144,7 @@ pub(crate) fn reparser( | |||
149 | parent: Option<SyntaxKind>, | 144 | parent: Option<SyntaxKind>, |
150 | ) -> Option<fn(&mut Parser)> { | 145 | ) -> Option<fn(&mut Parser)> { |
151 | let res = match node { | 146 | let res = match node { |
152 | BLOCK => expressions::block, | 147 | BLOCK => expressions::naked_block, |
153 | RECORD_FIELD_DEF_LIST => items::record_field_def_list, | 148 | RECORD_FIELD_DEF_LIST => items::record_field_def_list, |
154 | RECORD_FIELD_LIST => items::record_field_list, | 149 | RECORD_FIELD_LIST => items::record_field_list, |
155 | ENUM_VARIANT_LIST => items::enum_variant_list, | 150 | ENUM_VARIANT_LIST => items::enum_variant_list, |
@@ -180,7 +175,7 @@ impl BlockLike { | |||
180 | } | 175 | } |
181 | } | 176 | } |
182 | 177 | ||
183 | pub(crate) fn opt_visibility(p: &mut Parser) -> bool { | 178 | fn opt_visibility(p: &mut Parser) -> bool { |
184 | match p.current() { | 179 | match p.current() { |
185 | T![pub] => { | 180 | T![pub] => { |
186 | let m = p.start(); | 181 | let m = p.start(); |
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index 783d6a6f0..ba8386d11 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -40,6 +40,11 @@ pub(crate) fn block(p: &mut Parser) { | |||
40 | p.error("expected a block"); | 40 | p.error("expected a block"); |
41 | return; | 41 | return; |
42 | } | 42 | } |
43 | atom::block_expr(p, None); | ||
44 | } | ||
45 | |||
46 | pub(crate) fn naked_block(p: &mut Parser) { | ||
47 | assert!(p.at(T!['{'])); | ||
43 | let m = p.start(); | 48 | let m = p.start(); |
44 | p.bump(); | 49 | p.bump(); |
45 | expr_block_contents(p); | 50 | expr_block_contents(p); |
diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index bc942ae01..ec7f2441d 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs | |||
@@ -463,10 +463,10 @@ fn match_guard(p: &mut Parser) -> CompletedMarker { | |||
463 | // unsafe {}; | 463 | // unsafe {}; |
464 | // 'label: {}; | 464 | // 'label: {}; |
465 | // } | 465 | // } |
466 | fn block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { | 466 | pub(super) fn block_expr(p: &mut Parser, m: Option<Marker>) -> CompletedMarker { |
467 | assert!(p.at(T!['{'])); | 467 | assert!(p.at(T!['{'])); |
468 | let m = m.unwrap_or_else(|| p.start()); | 468 | let m = m.unwrap_or_else(|| p.start()); |
469 | block(p); | 469 | naked_block(p); |
470 | m.complete(p, BLOCK_EXPR) | 470 | m.complete(p, BLOCK_EXPR) |
471 | } | 471 | } |
472 | 472 | ||
diff --git a/crates/ra_parser/src/grammar/paths.rs b/crates/ra_parser/src/grammar/paths.rs index 07eb53b0c..28c35a67d 100644 --- a/crates/ra_parser/src/grammar/paths.rs +++ b/crates/ra_parser/src/grammar/paths.rs | |||
@@ -18,7 +18,7 @@ pub(super) fn use_path(p: &mut Parser) { | |||
18 | path(p, Mode::Use) | 18 | path(p, Mode::Use) |
19 | } | 19 | } |
20 | 20 | ||
21 | pub(super) fn type_path(p: &mut Parser) { | 21 | pub(crate) fn type_path(p: &mut Parser) { |
22 | path(p, Mode::Type) | 22 | path(p, Mode::Type) |
23 | } | 23 | } |
24 | 24 | ||
diff --git a/crates/ra_parser/src/grammar/patterns.rs b/crates/ra_parser/src/grammar/patterns.rs index eae70ab85..32cde7de6 100644 --- a/crates/ra_parser/src/grammar/patterns.rs +++ b/crates/ra_parser/src/grammar/patterns.rs | |||
@@ -4,7 +4,7 @@ pub(super) const PATTERN_FIRST: TokenSet = expressions::LITERAL_FIRST | |||
4 | .union(paths::PATH_FIRST) | 4 | .union(paths::PATH_FIRST) |
5 | .union(token_set![BOX_KW, REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE, MINUS]); | 5 | .union(token_set![BOX_KW, REF_KW, MUT_KW, L_PAREN, L_BRACK, AMP, UNDERSCORE, MINUS]); |
6 | 6 | ||
7 | pub(super) fn pattern(p: &mut Parser) { | 7 | pub(crate) fn pattern(p: &mut Parser) { |
8 | pattern_r(p, PAT_RECOVERY_SET); | 8 | pattern_r(p, PAT_RECOVERY_SET); |
9 | } | 9 | } |
10 | 10 | ||
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 29d173305..9e321b2a6 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs | |||
@@ -7,7 +7,7 @@ pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(token_set![ | |||
7 | 7 | ||
8 | const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA]; | 8 | const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA]; |
9 | 9 | ||
10 | pub(super) fn type_(p: &mut Parser) { | 10 | pub(crate) fn type_(p: &mut Parser) { |
11 | type_with_bounds_cond(p, true); | 11 | type_with_bounds_cond(p, true); |
12 | } | 12 | } |
13 | 13 | ||
diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs index 3d88be642..45241e566 100644 --- a/crates/ra_parser/src/lib.rs +++ b/crates/ra_parser/src/lib.rs | |||
@@ -83,62 +83,42 @@ pub fn parse(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | |||
83 | parse_from_tokens(token_source, tree_sink, grammar::root); | 83 | parse_from_tokens(token_source, tree_sink, grammar::root); |
84 | } | 84 | } |
85 | 85 | ||
86 | /// Parse given tokens into the given sink as a path | 86 | pub enum FragmentKind { |
87 | pub fn parse_path(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 87 | Path, |
88 | parse_from_tokens(token_source, tree_sink, grammar::path); | 88 | Expr, |
89 | } | 89 | Statement, |
90 | 90 | Type, | |
91 | /// Parse given tokens into the given sink as a expression | 91 | Pattern, |
92 | pub fn parse_expr(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 92 | Item, |
93 | parse_from_tokens(token_source, tree_sink, grammar::expr); | 93 | Block, |
94 | } | 94 | Visibility, |
95 | 95 | MetaItem, | |
96 | /// Parse given tokens into the given sink as a ty | 96 | |
97 | pub fn parse_ty(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 97 | // These kinds are used when parsing the result of expansion |
98 | parse_from_tokens(token_source, tree_sink, grammar::type_); | 98 | // FIXME: use separate fragment kinds for macro inputs and outputs? |
99 | } | 99 | Items, |
100 | 100 | Statements, | |
101 | /// Parse given tokens into the given sink as a pattern | 101 | } |
102 | pub fn parse_pat(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 102 | |
103 | parse_from_tokens(token_source, tree_sink, grammar::pattern); | 103 | pub fn parse_fragment( |
104 | } | ||
105 | |||
106 | /// Parse given tokens into the given sink as a statement | ||
107 | pub fn parse_stmt( | ||
108 | token_source: &mut dyn TokenSource, | 104 | token_source: &mut dyn TokenSource, |
109 | tree_sink: &mut dyn TreeSink, | 105 | tree_sink: &mut dyn TreeSink, |
110 | with_semi: bool, | 106 | fragment_kind: FragmentKind, |
111 | ) { | 107 | ) { |
112 | parse_from_tokens(token_source, tree_sink, |p| grammar::stmt(p, with_semi)); | 108 | let parser: fn(&'_ mut parser::Parser) = match fragment_kind { |
113 | } | 109 | FragmentKind::Path => grammar::fragments::path, |
114 | 110 | FragmentKind::Expr => grammar::fragments::expr, | |
115 | /// Parse given tokens into the given sink as a block | 111 | FragmentKind::Type => grammar::fragments::type_, |
116 | pub fn parse_block(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 112 | FragmentKind::Pattern => grammar::fragments::pattern, |
117 | parse_from_tokens(token_source, tree_sink, grammar::block); | 113 | FragmentKind::Item => grammar::fragments::item, |
118 | } | 114 | FragmentKind::Block => grammar::fragments::block, |
119 | 115 | FragmentKind::Visibility => grammar::fragments::opt_visibility, | |
120 | pub fn parse_meta(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 116 | FragmentKind::MetaItem => grammar::fragments::meta_item, |
121 | parse_from_tokens(token_source, tree_sink, grammar::meta_item); | 117 | FragmentKind::Statement => grammar::fragments::stmt, |
122 | } | 118 | FragmentKind::Items => grammar::fragments::macro_items, |
123 | 119 | FragmentKind::Statements => grammar::fragments::macro_stmts, | |
124 | /// Parse given tokens into the given sink as an item | 120 | }; |
125 | pub fn parse_item(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 121 | parse_from_tokens(token_source, tree_sink, parser) |
126 | parse_from_tokens(token_source, tree_sink, grammar::item); | ||
127 | } | ||
128 | |||
129 | /// Parse given tokens into the given sink as an visibility qualifier | ||
130 | pub fn parse_vis(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | ||
131 | parse_from_tokens(token_source, tree_sink, |p| { | ||
132 | grammar::opt_visibility(p); | ||
133 | }); | ||
134 | } | ||
135 | |||
136 | pub fn parse_macro_items(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | ||
137 | parse_from_tokens(token_source, tree_sink, grammar::macro_items); | ||
138 | } | ||
139 | |||
140 | pub fn parse_macro_stmts(token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink) { | ||
141 | parse_from_tokens(token_source, tree_sink, grammar::macro_stmts); | ||
142 | } | 122 | } |
143 | 123 | ||
144 | /// A parsing function for a specific braced-block. | 124 | /// A parsing function for a specific braced-block. |
diff --git a/crates/ra_prof/Cargo.toml b/crates/ra_prof/Cargo.toml index d35adeeeb..7db4498c3 100644 --- a/crates/ra_prof/Cargo.toml +++ b/crates/ra_prof/Cargo.toml | |||
@@ -6,7 +6,7 @@ authors = ["rust-analyzer developers"] | |||
6 | publish = false | 6 | publish = false |
7 | 7 | ||
8 | [dependencies] | 8 | [dependencies] |
9 | once_cell = "0.2.0" | 9 | once_cell = "1.0.1" |
10 | itertools = "0.8.0" | 10 | itertools = "0.8.0" |
11 | backtrace = "0.3.28" | 11 | backtrace = "0.3.28" |
12 | jemallocator = { version = "0.3.2", optional = true } | 12 | jemallocator = { version = "0.3.2", optional = true } |
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index d7ea4354d..25dbd0bed 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -9,12 +9,12 @@ use crate::{ | |||
9 | 9 | ||
10 | #[derive(Debug, Clone, PartialEq, Eq)] | 10 | #[derive(Debug, Clone, PartialEq, Eq)] |
11 | pub enum ElseBranch { | 11 | pub enum ElseBranch { |
12 | Block(ast::Block), | 12 | Block(ast::BlockExpr), |
13 | IfExpr(ast::IfExpr), | 13 | IfExpr(ast::IfExpr), |
14 | } | 14 | } |
15 | 15 | ||
16 | impl ast::IfExpr { | 16 | impl ast::IfExpr { |
17 | pub fn then_branch(&self) -> Option<ast::Block> { | 17 | pub fn then_branch(&self) -> Option<ast::BlockExpr> { |
18 | self.blocks().nth(0) | 18 | self.blocks().nth(0) |
19 | } | 19 | } |
20 | pub fn else_branch(&self) -> Option<ElseBranch> { | 20 | pub fn else_branch(&self) -> Option<ElseBranch> { |
@@ -28,7 +28,7 @@ impl ast::IfExpr { | |||
28 | Some(res) | 28 | Some(res) |
29 | } | 29 | } |
30 | 30 | ||
31 | fn blocks(&self) -> AstChildren<ast::Block> { | 31 | fn blocks(&self) -> AstChildren<ast::BlockExpr> { |
32 | children(self) | 32 | children(self) |
33 | } | 33 | } |
34 | } | 34 | } |
@@ -289,6 +289,26 @@ impl ast::Literal { | |||
289 | } | 289 | } |
290 | } | 290 | } |
291 | 291 | ||
292 | impl ast::BlockExpr { | ||
293 | /// false if the block is an intrinsic part of the syntax and can't be | ||
294 | /// replaced with arbitrary expression. | ||
295 | /// | ||
296 | /// ```not_rust | ||
297 | /// fn foo() { not_stand_alone } | ||
298 | /// const FOO: () = { stand_alone }; | ||
299 | /// ``` | ||
300 | pub fn is_standalone(&self) -> bool { | ||
301 | let kind = match self.syntax().parent() { | ||
302 | None => return true, | ||
303 | Some(it) => it.kind(), | ||
304 | }; | ||
305 | match kind { | ||
306 | FN_DEF | MATCH_ARM | IF_EXPR | WHILE_EXPR | LOOP_EXPR | TRY_BLOCK_EXPR => false, | ||
307 | _ => true, | ||
308 | } | ||
309 | } | ||
310 | } | ||
311 | |||
292 | #[test] | 312 | #[test] |
293 | fn test_literal_with_attr() { | 313 | fn test_literal_with_attr() { |
294 | let parse = ast::SourceFile::parse(r#"const _: &str = { #[attr] "Hello" };"#); | 314 | let parse = ast::SourceFile::parse(r#"const _: &str = { #[attr] "Hello" };"#); |
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index d161470e7..bcf753f78 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -1004,7 +1004,7 @@ impl FnDef { | |||
1004 | pub fn param_list(&self) -> Option<ParamList> { | 1004 | pub fn param_list(&self) -> Option<ParamList> { |
1005 | AstChildren::new(&self.syntax).next() | 1005 | AstChildren::new(&self.syntax).next() |
1006 | } | 1006 | } |
1007 | pub fn body(&self) -> Option<Block> { | 1007 | pub fn body(&self) -> Option<BlockExpr> { |
1008 | AstChildren::new(&self.syntax).next() | 1008 | AstChildren::new(&self.syntax).next() |
1009 | } | 1009 | } |
1010 | pub fn ret_type(&self) -> Option<RetType> { | 1010 | pub fn ret_type(&self) -> Option<RetType> { |
@@ -3135,8 +3135,11 @@ impl AstNode for TryBlockExpr { | |||
3135 | &self.syntax | 3135 | &self.syntax |
3136 | } | 3136 | } |
3137 | } | 3137 | } |
3138 | impl ast::TryBlockBodyOwner for TryBlockExpr {} | 3138 | impl TryBlockExpr { |
3139 | impl TryBlockExpr {} | 3139 | pub fn body(&self) -> Option<BlockExpr> { |
3140 | AstChildren::new(&self.syntax).next() | ||
3141 | } | ||
3142 | } | ||
3140 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3143 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3141 | pub struct TryExpr { | 3144 | pub struct TryExpr { |
3142 | pub(crate) syntax: SyntaxNode, | 3145 | pub(crate) syntax: SyntaxNode, |
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 1b9a2b20c..c3e676d4c 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -28,13 +28,7 @@ pub trait VisibilityOwner: AstNode { | |||
28 | } | 28 | } |
29 | 29 | ||
30 | pub trait LoopBodyOwner: AstNode { | 30 | pub trait LoopBodyOwner: AstNode { |
31 | fn loop_body(&self) -> Option<ast::Block> { | 31 | fn loop_body(&self) -> Option<ast::BlockExpr> { |
32 | child_opt(self) | ||
33 | } | ||
34 | } | ||
35 | |||
36 | pub trait TryBlockBodyOwner: AstNode { | ||
37 | fn try_body(&self) -> Option<ast::Block> { | ||
38 | child_opt(self) | 32 | child_opt(self) |
39 | } | 33 | } |
40 | } | 34 | } |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index a07293a46..3e6c2d3f3 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -275,7 +275,7 @@ Grammar( | |||
275 | "AttrsOwner", | 275 | "AttrsOwner", |
276 | "DocCommentsOwner" | 276 | "DocCommentsOwner" |
277 | ], | 277 | ], |
278 | options: [ "ParamList", ["body", "Block"], "RetType" ], | 278 | options: [ "ParamList", ["body", "BlockExpr"], "RetType" ], |
279 | ), | 279 | ), |
280 | "RetType": (options: ["TypeRef"]), | 280 | "RetType": (options: ["TypeRef"]), |
281 | "StructDef": ( | 281 | "StructDef": ( |
@@ -426,7 +426,7 @@ Grammar( | |||
426 | traits: ["LoopBodyOwner"], | 426 | traits: ["LoopBodyOwner"], |
427 | ), | 427 | ), |
428 | "TryBlockExpr": ( | 428 | "TryBlockExpr": ( |
429 | traits: ["TryBlockBodyOwner"], | 429 | options: [["body", "BlockExpr"]], |
430 | ), | 430 | ), |
431 | "ForExpr": ( | 431 | "ForExpr": ( |
432 | traits: ["LoopBodyOwner"], | 432 | traits: ["LoopBodyOwner"], |
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 2bced1867..edb6076bb 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -203,7 +203,8 @@ fn api_walkthrough() { | |||
203 | assert_eq!(name.text(), "foo"); | 203 | assert_eq!(name.text(), "foo"); |
204 | 204 | ||
205 | // Let's get the `1 + 1` expression! | 205 | // Let's get the `1 + 1` expression! |
206 | let block: ast::Block = func.body().unwrap(); | 206 | let body: ast::BlockExpr = func.body().unwrap(); |
207 | let block = body.block().unwrap(); | ||
207 | let expr: ast::Expr = block.expr().unwrap(); | 208 | let expr: ast::Expr = block.expr().unwrap(); |
208 | 209 | ||
209 | // Enums are used to group related ast nodes together, and can be used for | 210 | // Enums are used to group related ast nodes together, and can be used for |
diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index ee8797410..16824f3c4 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs | |||
@@ -97,7 +97,7 @@ pub(crate) fn validate(root: &SyntaxNode) -> Vec<SyntaxError> { | |||
97 | for node in root.descendants() { | 97 | for node in root.descendants() { |
98 | let _ = visitor_ctx(&mut errors) | 98 | let _ = visitor_ctx(&mut errors) |
99 | .visit::<ast::Literal, _>(validate_literal) | 99 | .visit::<ast::Literal, _>(validate_literal) |
100 | .visit::<ast::Block, _>(block::validate_block_node) | 100 | .visit::<ast::BlockExpr, _>(block::validate_block_expr) |
101 | .visit::<ast::FieldExpr, _>(|it, errors| validate_numeric_name(it.name_ref(), errors)) | 101 | .visit::<ast::FieldExpr, _>(|it, errors| validate_numeric_name(it.name_ref(), errors)) |
102 | .visit::<ast::RecordField, _>(|it, errors| validate_numeric_name(it.name_ref(), errors)) | 102 | .visit::<ast::RecordField, _>(|it, errors| validate_numeric_name(it.name_ref(), errors)) |
103 | .accept(&node); | 103 | .accept(&node); |
diff --git a/crates/ra_syntax/src/validation/block.rs b/crates/ra_syntax/src/validation/block.rs index c5588658d..3c9e96eb3 100644 --- a/crates/ra_syntax/src/validation/block.rs +++ b/crates/ra_syntax/src/validation/block.rs | |||
@@ -5,18 +5,18 @@ use crate::{ | |||
5 | SyntaxKind::*, | 5 | SyntaxKind::*, |
6 | }; | 6 | }; |
7 | 7 | ||
8 | pub(crate) fn validate_block_node(node: ast::Block, errors: &mut Vec<SyntaxError>) { | 8 | pub(crate) fn validate_block_expr(expr: ast::BlockExpr, errors: &mut Vec<SyntaxError>) { |
9 | if let Some(parent) = node.syntax().parent() { | 9 | if let Some(parent) = expr.syntax().parent() { |
10 | match parent.kind() { | 10 | match parent.kind() { |
11 | FN_DEF => return, | 11 | FN_DEF | EXPR_STMT | BLOCK => return, |
12 | BLOCK_EXPR => match parent.parent().map(|v| v.kind()) { | ||
13 | Some(EXPR_STMT) | Some(BLOCK) => return, | ||
14 | _ => {} | ||
15 | }, | ||
16 | _ => {} | 12 | _ => {} |
17 | } | 13 | } |
18 | } | 14 | } |
19 | errors.extend( | 15 | if let Some(block) = expr.block() { |
20 | node.attrs().map(|attr| SyntaxError::new(InvalidBlockAttr, attr.syntax().text_range())), | 16 | errors.extend( |
21 | ) | 17 | block |
18 | .attrs() | ||
19 | .map(|attr| SyntaxError::new(InvalidBlockAttr, attr.syntax().text_range())), | ||
20 | ) | ||
21 | } | ||
22 | } | 22 | } |
diff --git a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.txt b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.txt index 6d5199a56..378b92834 100644 --- a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.txt +++ b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.txt | |||
@@ -25,10 +25,11 @@ SOURCE_FILE@[0; 54) | |||
25 | L_PAREN@[25; 26) "(" | 25 | L_PAREN@[25; 26) "(" |
26 | R_PAREN@[26; 27) ")" | 26 | R_PAREN@[26; 27) ")" |
27 | WHITESPACE@[27; 28) " " | 27 | WHITESPACE@[27; 28) " " |
28 | BLOCK@[28; 31) | 28 | BLOCK_EXPR@[28; 31) |
29 | L_CURLY@[28; 29) "{" | 29 | BLOCK@[28; 31) |
30 | WHITESPACE@[29; 30) "\n" | 30 | L_CURLY@[28; 29) "{" |
31 | R_CURLY@[30; 31) "}" | 31 | WHITESPACE@[29; 30) "\n" |
32 | R_CURLY@[30; 31) "}" | ||
32 | WHITESPACE@[31; 34) "\n\n\n" | 33 | WHITESPACE@[31; 34) "\n\n\n" |
33 | ATTR@[34; 53) | 34 | ATTR@[34; 53) |
34 | POUND@[34; 35) "#" | 35 | POUND@[34; 35) "#" |
diff --git a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.txt b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.txt index b79e01238..7ae417441 100644 --- a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.txt +++ b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.txt | |||
@@ -20,9 +20,10 @@ SOURCE_FILE@[0; 31) | |||
20 | PARAM_LIST@[23; 25) | 20 | PARAM_LIST@[23; 25) |
21 | L_PAREN@[23; 24) "(" | 21 | L_PAREN@[23; 24) "(" |
22 | R_PAREN@[24; 25) ")" | 22 | R_PAREN@[24; 25) ")" |
23 | BLOCK@[25; 27) | 23 | BLOCK_EXPR@[25; 27) |
24 | L_CURLY@[25; 26) "{" | 24 | BLOCK@[25; 27) |
25 | R_CURLY@[26; 27) "}" | 25 | L_CURLY@[25; 26) "{" |
26 | R_CURLY@[26; 27) "}" | ||
26 | WHITESPACE@[27; 29) "\n\n" | 27 | WHITESPACE@[27; 29) "\n\n" |
27 | ERROR@[29; 30) | 28 | ERROR@[29; 30) |
28 | R_CURLY@[29; 30) "}" | 29 | R_CURLY@[29; 30) "}" |
diff --git a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.txt b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.txt index 9a8871579..1a4b40a2b 100644 --- a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.txt +++ b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.txt | |||
@@ -8,10 +8,11 @@ SOURCE_FILE@[0; 95) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 12) | 11 | BLOCK_EXPR@[9; 12) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 12) |
13 | WHITESPACE@[10; 11) "\n" | 13 | L_CURLY@[9; 10) "{" |
14 | R_CURLY@[11; 12) "}" | 14 | WHITESPACE@[10; 11) "\n" |
15 | R_CURLY@[11; 12) "}" | ||
15 | WHITESPACE@[12; 14) "\n\n" | 16 | WHITESPACE@[12; 14) "\n\n" |
16 | MACRO_CALL@[14; 19) | 17 | MACRO_CALL@[14; 19) |
17 | PATH@[14; 17) | 18 | PATH@[14; 17) |
@@ -32,29 +33,31 @@ SOURCE_FILE@[0; 95) | |||
32 | LITERAL@[29; 33) | 33 | LITERAL@[29; 33) |
33 | TRUE_KW@[29; 33) "true" | 34 | TRUE_KW@[29; 33) "true" |
34 | WHITESPACE@[33; 34) " " | 35 | WHITESPACE@[33; 34) " " |
35 | BLOCK@[34; 51) | 36 | BLOCK_EXPR@[34; 51) |
36 | L_CURLY@[34; 35) "{" | 37 | BLOCK@[34; 51) |
37 | WHITESPACE@[35; 44) "\n " | 38 | L_CURLY@[34; 35) "{" |
38 | LITERAL@[44; 45) | 39 | WHITESPACE@[35; 44) "\n " |
39 | INT_NUMBER@[44; 45) "1" | 40 | LITERAL@[44; 45) |
40 | WHITESPACE@[45; 50) "\n " | 41 | INT_NUMBER@[44; 45) "1" |
41 | R_CURLY@[50; 51) "}" | 42 | WHITESPACE@[45; 50) "\n " |
43 | R_CURLY@[50; 51) "}" | ||
42 | WHITESPACE@[51; 52) " " | 44 | WHITESPACE@[51; 52) " " |
43 | ELSE_KW@[52; 56) "else" | 45 | ELSE_KW@[52; 56) "else" |
44 | WHITESPACE@[56; 57) " " | 46 | WHITESPACE@[56; 57) " " |
45 | BLOCK@[57; 78) | 47 | BLOCK_EXPR@[57; 78) |
46 | L_CURLY@[57; 58) "{" | 48 | BLOCK@[57; 78) |
47 | WHITESPACE@[58; 67) "\n " | 49 | L_CURLY@[57; 58) "{" |
48 | BIN_EXPR@[67; 72) | 50 | WHITESPACE@[58; 67) "\n " |
49 | LITERAL@[67; 68) | 51 | BIN_EXPR@[67; 72) |
50 | INT_NUMBER@[67; 68) "2" | 52 | LITERAL@[67; 68) |
51 | WHITESPACE@[68; 69) " " | 53 | INT_NUMBER@[67; 68) "2" |
52 | PLUS@[69; 70) "+" | 54 | WHITESPACE@[68; 69) " " |
53 | WHITESPACE@[70; 71) " " | 55 | PLUS@[69; 70) "+" |
54 | LITERAL@[71; 72) | 56 | WHITESPACE@[70; 71) " " |
55 | INT_NUMBER@[71; 72) "3" | 57 | LITERAL@[71; 72) |
56 | WHITESPACE@[72; 77) "\n " | 58 | INT_NUMBER@[71; 72) "3" |
57 | R_CURLY@[77; 78) "}" | 59 | WHITESPACE@[72; 77) "\n " |
60 | R_CURLY@[77; 78) "}" | ||
58 | WHITESPACE@[78; 79) "\n" | 61 | WHITESPACE@[78; 79) "\n" |
59 | R_CURLY@[79; 80) "}" | 62 | R_CURLY@[79; 80) "}" |
60 | WHITESPACE@[80; 82) "\n\n" | 63 | WHITESPACE@[80; 82) "\n\n" |
@@ -67,10 +70,11 @@ SOURCE_FILE@[0; 95) | |||
67 | L_PAREN@[88; 89) "(" | 70 | L_PAREN@[88; 89) "(" |
68 | R_PAREN@[89; 90) ")" | 71 | R_PAREN@[89; 90) ")" |
69 | WHITESPACE@[90; 91) " " | 72 | WHITESPACE@[90; 91) " " |
70 | BLOCK@[91; 94) | 73 | BLOCK_EXPR@[91; 94) |
71 | L_CURLY@[91; 92) "{" | 74 | BLOCK@[91; 94) |
72 | WHITESPACE@[92; 93) "\n" | 75 | L_CURLY@[91; 92) "{" |
73 | R_CURLY@[93; 94) "}" | 76 | WHITESPACE@[92; 93) "\n" |
77 | R_CURLY@[93; 94) "}" | ||
74 | WHITESPACE@[94; 95) "\n" | 78 | WHITESPACE@[94; 95) "\n" |
75 | error 17: expected EXCL | 79 | error 17: expected EXCL |
76 | error 19: expected SEMI | 80 | error 19: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.txt b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.txt index c46809f81..b73dda5ad 100644 --- a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.txt +++ b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.txt | |||
@@ -8,35 +8,36 @@ SOURCE_FILE@[0; 42) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 41) | 11 | BLOCK_EXPR@[10; 41) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 41) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | EXPR_STMT@[16; 39) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LAMBDA_EXPR@[16; 38) | 15 | EXPR_STMT@[16; 39) |
16 | PARAM_LIST@[16; 18) | 16 | LAMBDA_EXPR@[16; 38) |
17 | PIPE@[16; 17) "|" | 17 | PARAM_LIST@[16; 18) |
18 | PIPE@[17; 18) "|" | 18 | PIPE@[16; 17) "|" |
19 | WHITESPACE@[18; 19) " " | 19 | PIPE@[17; 18) "|" |
20 | RET_TYPE@[19; 24) | 20 | WHITESPACE@[18; 19) " " |
21 | THIN_ARROW@[19; 21) "->" | 21 | RET_TYPE@[19; 24) |
22 | WHITESPACE@[21; 22) " " | 22 | THIN_ARROW@[19; 21) "->" |
23 | TUPLE_TYPE@[22; 24) | 23 | WHITESPACE@[21; 22) " " |
24 | L_PAREN@[22; 23) "(" | 24 | TUPLE_TYPE@[22; 24) |
25 | R_PAREN@[23; 24) ")" | 25 | L_PAREN@[22; 23) "(" |
26 | WHITESPACE@[24; 25) " " | 26 | R_PAREN@[23; 24) ")" |
27 | BLOCK_EXPR@[25; 38) | 27 | WHITESPACE@[24; 25) " " |
28 | UNSAFE_KW@[25; 31) "unsafe" | 28 | BLOCK_EXPR@[25; 38) |
29 | WHITESPACE@[31; 32) " " | 29 | UNSAFE_KW@[25; 31) "unsafe" |
30 | BLOCK@[32; 38) | 30 | WHITESPACE@[31; 32) " " |
31 | L_CURLY@[32; 33) "{" | 31 | BLOCK@[32; 38) |
32 | WHITESPACE@[33; 34) " " | 32 | L_CURLY@[32; 33) "{" |
33 | TUPLE_EXPR@[34; 36) | 33 | WHITESPACE@[33; 34) " " |
34 | L_PAREN@[34; 35) "(" | 34 | TUPLE_EXPR@[34; 36) |
35 | R_PAREN@[35; 36) ")" | 35 | L_PAREN@[34; 35) "(" |
36 | WHITESPACE@[36; 37) " " | 36 | R_PAREN@[35; 36) ")" |
37 | R_CURLY@[37; 38) "}" | 37 | WHITESPACE@[36; 37) " " |
38 | SEMI@[38; 39) ";" | 38 | R_CURLY@[37; 38) "}" |
39 | WHITESPACE@[39; 40) "\n" | 39 | SEMI@[38; 39) ";" |
40 | R_CURLY@[40; 41) "}" | 40 | WHITESPACE@[39; 40) "\n" |
41 | R_CURLY@[40; 41) "}" | ||
41 | WHITESPACE@[41; 42) "\n" | 42 | WHITESPACE@[41; 42) "\n" |
42 | error 24: expected `{` | 43 | error 24: expected `{` |
diff --git a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.txt b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.txt index 2f0878572..0ba17cf8d 100644 --- a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.txt +++ b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.txt | |||
@@ -24,8 +24,9 @@ SOURCE_FILE@[0; 23) | |||
24 | NAME_REF@[18; 19) | 24 | NAME_REF@[18; 19) |
25 | IDENT@[18; 19) "T" | 25 | IDENT@[18; 19) "T" |
26 | WHITESPACE@[19; 20) " " | 26 | WHITESPACE@[19; 20) " " |
27 | BLOCK@[20; 22) | 27 | BLOCK_EXPR@[20; 22) |
28 | L_CURLY@[20; 21) "{" | 28 | BLOCK@[20; 22) |
29 | R_CURLY@[21; 22) "}" | 29 | L_CURLY@[20; 21) "{" |
30 | R_CURLY@[21; 22) "}" | ||
30 | WHITESPACE@[22; 23) "\n" | 31 | WHITESPACE@[22; 23) "\n" |
31 | error 19: expected colon | 32 | error 19: expected colon |
diff --git a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.txt b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.txt index 97e64dea9..bc5be6a66 100644 --- a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.txt +++ b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.txt | |||
@@ -8,36 +8,37 @@ SOURCE_FILE@[0; 56) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 55) | 11 | BLOCK_EXPR@[9; 55) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 55) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 38) | 14 | WHITESPACE@[10; 15) "\n " |
15 | CALL_EXPR@[15; 38) | 15 | EXPR_STMT@[15; 38) |
16 | PATH_EXPR@[15; 18) | 16 | CALL_EXPR@[15; 38) |
17 | PATH@[15; 18) | 17 | PATH_EXPR@[15; 18) |
18 | PATH_SEGMENT@[15; 18) | 18 | PATH@[15; 18) |
19 | NAME_REF@[15; 18) | 19 | PATH_SEGMENT@[15; 18) |
20 | IDENT@[15; 18) "foo" | 20 | NAME_REF@[15; 18) |
21 | ARG_LIST@[18; 38) | 21 | IDENT@[15; 18) "foo" |
22 | L_PAREN@[18; 19) "(" | 22 | ARG_LIST@[18; 38) |
23 | WHITESPACE@[19; 28) "\n " | 23 | L_PAREN@[18; 19) "(" |
24 | LITERAL@[28; 29) | 24 | WHITESPACE@[19; 28) "\n " |
25 | INT_NUMBER@[28; 29) "1" | 25 | LITERAL@[28; 29) |
26 | COMMA@[29; 30) "," | 26 | INT_NUMBER@[28; 29) "1" |
27 | WHITESPACE@[30; 31) " " | 27 | COMMA@[29; 30) "," |
28 | LITERAL@[31; 32) | 28 | WHITESPACE@[30; 31) " " |
29 | INT_NUMBER@[31; 32) "2" | 29 | LITERAL@[31; 32) |
30 | WHITESPACE@[32; 37) "\n " | 30 | INT_NUMBER@[31; 32) "2" |
31 | R_PAREN@[37; 38) ")" | 31 | WHITESPACE@[32; 37) "\n " |
32 | WHITESPACE@[38; 43) "\n " | 32 | R_PAREN@[37; 38) ")" |
33 | EXPR_STMT@[43; 53) | 33 | WHITESPACE@[38; 43) "\n " |
34 | RETURN_EXPR@[43; 52) | 34 | EXPR_STMT@[43; 53) |
35 | RETURN_KW@[43; 49) "return" | 35 | RETURN_EXPR@[43; 52) |
36 | WHITESPACE@[49; 50) " " | 36 | RETURN_KW@[43; 49) "return" |
37 | LITERAL@[50; 52) | 37 | WHITESPACE@[49; 50) " " |
38 | INT_NUMBER@[50; 52) "92" | 38 | LITERAL@[50; 52) |
39 | SEMI@[52; 53) ";" | 39 | INT_NUMBER@[50; 52) "92" |
40 | WHITESPACE@[53; 54) "\n" | 40 | SEMI@[52; 53) ";" |
41 | R_CURLY@[54; 55) "}" | 41 | WHITESPACE@[53; 54) "\n" |
42 | R_CURLY@[54; 55) "}" | ||
42 | WHITESPACE@[55; 56) "\n" | 43 | WHITESPACE@[55; 56) "\n" |
43 | error 38: expected SEMI | 44 | error 38: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.txt b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.txt index c18e20900..9033a5b38 100644 --- a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.txt +++ b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.txt | |||
@@ -19,28 +19,29 @@ SOURCE_FILE@[0; 47) | |||
19 | IDENT@[12; 15) "i32" | 19 | IDENT@[12; 15) "i32" |
20 | R_PAREN@[15; 16) ")" | 20 | R_PAREN@[15; 16) ")" |
21 | WHITESPACE@[16; 17) " " | 21 | WHITESPACE@[16; 17) " " |
22 | BLOCK@[17; 46) | 22 | BLOCK_EXPR@[17; 46) |
23 | L_CURLY@[17; 18) "{" | 23 | BLOCK@[17; 46) |
24 | WHITESPACE@[18; 23) "\n " | 24 | L_CURLY@[17; 18) "{" |
25 | LET_STMT@[23; 36) | 25 | WHITESPACE@[18; 23) "\n " |
26 | LET_KW@[23; 26) "let" | 26 | LET_STMT@[23; 36) |
27 | WHITESPACE@[26; 27) " " | 27 | LET_KW@[23; 26) "let" |
28 | BIND_PAT@[27; 30) | 28 | WHITESPACE@[26; 27) " " |
29 | NAME@[27; 30) | 29 | BIND_PAT@[27; 30) |
30 | IDENT@[27; 30) "bar" | 30 | NAME@[27; 30) |
31 | WHITESPACE@[30; 31) " " | 31 | IDENT@[27; 30) "bar" |
32 | EQ@[31; 32) "=" | 32 | WHITESPACE@[30; 31) " " |
33 | WHITESPACE@[32; 33) " " | 33 | EQ@[31; 32) "=" |
34 | LITERAL@[33; 35) | 34 | WHITESPACE@[32; 33) " " |
35 | INT_NUMBER@[33; 35) "92" | 35 | LITERAL@[33; 35) |
36 | SEMI@[35; 36) ";" | 36 | INT_NUMBER@[33; 35) "92" |
37 | WHITESPACE@[36; 41) "\n " | 37 | SEMI@[35; 36) ";" |
38 | BIN_EXPR@[41; 44) | 38 | WHITESPACE@[36; 41) "\n " |
39 | LITERAL@[41; 42) | 39 | BIN_EXPR@[41; 44) |
40 | INT_NUMBER@[41; 42) "1" | 40 | LITERAL@[41; 42) |
41 | WHITESPACE@[42; 43) " " | 41 | INT_NUMBER@[41; 42) "1" |
42 | PLUS@[43; 44) "+" | 42 | WHITESPACE@[42; 43) " " |
43 | WHITESPACE@[44; 45) "\n" | 43 | PLUS@[43; 44) "+" |
44 | R_CURLY@[45; 46) "}" | 44 | WHITESPACE@[44; 45) "\n" |
45 | R_CURLY@[45; 46) "}" | ||
45 | WHITESPACE@[46; 47) "\n" | 46 | WHITESPACE@[46; 47) "\n" |
46 | error 44: expected expression | 47 | error 44: expected expression |
diff --git a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.txt b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.txt index 52eb7d5e2..d12f4c99b 100644 --- a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.txt +++ b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.txt | |||
@@ -32,89 +32,90 @@ SOURCE_FILE@[0; 183) | |||
32 | NAME_REF@[39; 46) | 32 | NAME_REF@[39; 46) |
33 | IDENT@[39; 46) "ScopeId" | 33 | IDENT@[39; 46) "ScopeId" |
34 | WHITESPACE@[46; 47) " " | 34 | WHITESPACE@[46; 47) " " |
35 | BLOCK@[47; 161) | 35 | BLOCK_EXPR@[47; 161) |
36 | L_CURLY@[47; 48) "{" | 36 | BLOCK@[47; 161) |
37 | WHITESPACE@[48; 57) "\n " | 37 | L_CURLY@[47; 48) "{" |
38 | LET_STMT@[57; 85) | 38 | WHITESPACE@[48; 57) "\n " |
39 | LET_KW@[57; 60) "let" | 39 | LET_STMT@[57; 85) |
40 | WHITESPACE@[60; 61) " " | 40 | LET_KW@[57; 60) "let" |
41 | BIND_PAT@[61; 64) | 41 | WHITESPACE@[60; 61) " " |
42 | NAME@[61; 64) | 42 | BIND_PAT@[61; 64) |
43 | IDENT@[61; 64) "res" | 43 | NAME@[61; 64) |
44 | WHITESPACE@[64; 65) " " | 44 | IDENT@[61; 64) "res" |
45 | EQ@[65; 66) "=" | 45 | WHITESPACE@[64; 65) " " |
46 | WHITESPACE@[66; 67) " " | 46 | EQ@[65; 66) "=" |
47 | METHOD_CALL_EXPR@[67; 84) | 47 | WHITESPACE@[66; 67) " " |
48 | FIELD_EXPR@[67; 78) | 48 | METHOD_CALL_EXPR@[67; 84) |
49 | PATH_EXPR@[67; 71) | 49 | FIELD_EXPR@[67; 78) |
50 | PATH@[67; 71) | 50 | PATH_EXPR@[67; 71) |
51 | PATH_SEGMENT@[67; 71) | 51 | PATH@[67; 71) |
52 | SELF_KW@[67; 71) "self" | 52 | PATH_SEGMENT@[67; 71) |
53 | DOT@[71; 72) "." | 53 | SELF_KW@[67; 71) "self" |
54 | NAME_REF@[72; 78) | 54 | DOT@[71; 72) "." |
55 | IDENT@[72; 78) "scopes" | 55 | NAME_REF@[72; 78) |
56 | DOT@[78; 79) "." | 56 | IDENT@[72; 78) "scopes" |
57 | NAME_REF@[79; 82) | 57 | DOT@[78; 79) "." |
58 | IDENT@[79; 82) "len" | 58 | NAME_REF@[79; 82) |
59 | ARG_LIST@[82; 84) | 59 | IDENT@[79; 82) "len" |
60 | L_PAREN@[82; 83) "(" | 60 | ARG_LIST@[82; 84) |
61 | R_PAREN@[83; 84) ")" | 61 | L_PAREN@[82; 83) "(" |
62 | SEMI@[84; 85) ";" | 62 | R_PAREN@[83; 84) ")" |
63 | WHITESPACE@[85; 94) "\n " | 63 | SEMI@[84; 85) ";" |
64 | METHOD_CALL_EXPR@[94; 155) | 64 | WHITESPACE@[85; 94) "\n " |
65 | FIELD_EXPR@[94; 105) | 65 | METHOD_CALL_EXPR@[94; 155) |
66 | PATH_EXPR@[94; 98) | 66 | FIELD_EXPR@[94; 105) |
67 | PATH@[94; 98) | 67 | PATH_EXPR@[94; 98) |
68 | PATH_SEGMENT@[94; 98) | 68 | PATH@[94; 98) |
69 | SELF_KW@[94; 98) "self" | 69 | PATH_SEGMENT@[94; 98) |
70 | DOT@[98; 99) "." | 70 | SELF_KW@[94; 98) "self" |
71 | NAME_REF@[99; 105) | 71 | DOT@[98; 99) "." |
72 | IDENT@[99; 105) "scopes" | 72 | NAME_REF@[99; 105) |
73 | DOT@[105; 106) "." | 73 | IDENT@[99; 105) "scopes" |
74 | NAME_REF@[106; 110) | 74 | DOT@[105; 106) "." |
75 | IDENT@[106; 110) "push" | 75 | NAME_REF@[106; 110) |
76 | ARG_LIST@[110; 155) | 76 | IDENT@[106; 110) "push" |
77 | L_PAREN@[110; 111) "(" | 77 | ARG_LIST@[110; 155) |
78 | RECORD_LIT@[111; 154) | 78 | L_PAREN@[110; 111) "(" |
79 | PATH@[111; 120) | 79 | RECORD_LIT@[111; 154) |
80 | PATH_SEGMENT@[111; 120) | 80 | PATH@[111; 120) |
81 | NAME_REF@[111; 120) | 81 | PATH_SEGMENT@[111; 120) |
82 | IDENT@[111; 120) "ScopeData" | 82 | NAME_REF@[111; 120) |
83 | WHITESPACE@[120; 121) " " | 83 | IDENT@[111; 120) "ScopeData" |
84 | RECORD_FIELD_LIST@[121; 154) | 84 | WHITESPACE@[120; 121) " " |
85 | L_CURLY@[121; 122) "{" | 85 | RECORD_FIELD_LIST@[121; 154) |
86 | WHITESPACE@[122; 123) " " | 86 | L_CURLY@[121; 122) "{" |
87 | RECORD_FIELD@[123; 135) | 87 | WHITESPACE@[122; 123) " " |
88 | NAME_REF@[123; 129) | 88 | RECORD_FIELD@[123; 135) |
89 | IDENT@[123; 129) "parent" | 89 | NAME_REF@[123; 129) |
90 | COLON@[129; 130) ":" | 90 | IDENT@[123; 129) "parent" |
91 | WHITESPACE@[130; 131) " " | 91 | COLON@[129; 130) ":" |
92 | PATH_EXPR@[131; 135) | 92 | WHITESPACE@[130; 131) " " |
93 | PATH@[131; 135) | 93 | PATH_EXPR@[131; 135) |
94 | PATH_SEGMENT@[131; 135) | 94 | PATH@[131; 135) |
95 | NAME_REF@[131; 135) | 95 | PATH_SEGMENT@[131; 135) |
96 | IDENT@[131; 135) "None" | 96 | NAME_REF@[131; 135) |
97 | COMMA@[135; 136) "," | 97 | IDENT@[131; 135) "None" |
98 | WHITESPACE@[136; 137) " " | 98 | COMMA@[135; 136) "," |
99 | RECORD_FIELD@[137; 152) | 99 | WHITESPACE@[136; 137) " " |
100 | NAME_REF@[137; 144) | 100 | RECORD_FIELD@[137; 152) |
101 | IDENT@[137; 144) "entries" | 101 | NAME_REF@[137; 144) |
102 | COLON@[144; 145) ":" | 102 | IDENT@[137; 144) "entries" |
103 | WHITESPACE@[145; 146) " " | 103 | COLON@[144; 145) ":" |
104 | MACRO_CALL@[146; 152) | 104 | WHITESPACE@[145; 146) " " |
105 | PATH@[146; 149) | 105 | MACRO_CALL@[146; 152) |
106 | PATH_SEGMENT@[146; 149) | 106 | PATH@[146; 149) |
107 | NAME_REF@[146; 149) | 107 | PATH_SEGMENT@[146; 149) |
108 | IDENT@[146; 149) "vec" | 108 | NAME_REF@[146; 149) |
109 | EXCL@[149; 150) "!" | 109 | IDENT@[146; 149) "vec" |
110 | TOKEN_TREE@[150; 152) | 110 | EXCL@[149; 150) "!" |
111 | L_BRACK@[150; 151) "[" | 111 | TOKEN_TREE@[150; 152) |
112 | R_BRACK@[151; 152) "]" | 112 | L_BRACK@[150; 151) "[" |
113 | WHITESPACE@[152; 153) " " | 113 | R_BRACK@[151; 152) "]" |
114 | R_CURLY@[153; 154) "}" | 114 | WHITESPACE@[152; 153) " " |
115 | R_PAREN@[154; 155) ")" | 115 | R_CURLY@[153; 154) "}" |
116 | WHITESPACE@[155; 160) "\n " | 116 | R_PAREN@[154; 155) ")" |
117 | R_CURLY@[160; 161) "}" | 117 | WHITESPACE@[155; 160) "\n " |
118 | R_CURLY@[160; 161) "}" | ||
118 | WHITESPACE@[161; 167) "\n\n " | 119 | WHITESPACE@[161; 167) "\n\n " |
119 | FN_DEF@[167; 180) | 120 | FN_DEF@[167; 180) |
120 | FN_KW@[167; 169) "fn" | 121 | FN_KW@[167; 169) "fn" |
diff --git a/crates/ra_syntax/test_data/parser/err/0019_let_recover.txt b/crates/ra_syntax/test_data/parser/err/0019_let_recover.txt index b6710241e..cc3578e54 100644 --- a/crates/ra_syntax/test_data/parser/err/0019_let_recover.txt +++ b/crates/ra_syntax/test_data/parser/err/0019_let_recover.txt | |||
@@ -8,88 +8,92 @@ SOURCE_FILE@[0; 139) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 138) | 11 | BLOCK_EXPR@[9; 138) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 138) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 24) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 24) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | BIND_PAT@[19; 22) | 17 | WHITESPACE@[18; 19) " " |
18 | NAME@[19; 22) | 18 | BIND_PAT@[19; 22) |
19 | IDENT@[19; 22) "foo" | 19 | NAME@[19; 22) |
20 | WHITESPACE@[22; 23) " " | 20 | IDENT@[19; 22) "foo" |
21 | EQ@[23; 24) "=" | 21 | WHITESPACE@[22; 23) " " |
22 | WHITESPACE@[24; 29) "\n " | 22 | EQ@[23; 24) "=" |
23 | LET_STMT@[29; 41) | 23 | WHITESPACE@[24; 29) "\n " |
24 | LET_KW@[29; 32) "let" | 24 | LET_STMT@[29; 41) |
25 | WHITESPACE@[32; 33) " " | 25 | LET_KW@[29; 32) "let" |
26 | BIND_PAT@[33; 36) | 26 | WHITESPACE@[32; 33) " " |
27 | NAME@[33; 36) | 27 | BIND_PAT@[33; 36) |
28 | IDENT@[33; 36) "bar" | 28 | NAME@[33; 36) |
29 | WHITESPACE@[36; 37) " " | 29 | IDENT@[33; 36) "bar" |
30 | EQ@[37; 38) "=" | 30 | WHITESPACE@[36; 37) " " |
31 | WHITESPACE@[38; 39) " " | 31 | EQ@[37; 38) "=" |
32 | LITERAL@[39; 40) | 32 | WHITESPACE@[38; 39) " " |
33 | INT_NUMBER@[39; 40) "1" | 33 | LITERAL@[39; 40) |
34 | SEMI@[40; 41) ";" | 34 | INT_NUMBER@[39; 40) "1" |
35 | WHITESPACE@[41; 46) "\n " | 35 | SEMI@[40; 41) ";" |
36 | LET_STMT@[46; 49) | 36 | WHITESPACE@[41; 46) "\n " |
37 | LET_KW@[46; 49) "let" | 37 | LET_STMT@[46; 49) |
38 | WHITESPACE@[49; 54) "\n " | 38 | LET_KW@[46; 49) "let" |
39 | LET_STMT@[54; 67) | 39 | WHITESPACE@[49; 54) "\n " |
40 | LET_KW@[54; 57) "let" | 40 | LET_STMT@[54; 67) |
41 | WHITESPACE@[57; 58) " " | 41 | LET_KW@[54; 57) "let" |
42 | BIND_PAT@[58; 61) | 42 | WHITESPACE@[57; 58) " " |
43 | NAME@[58; 61) | 43 | BIND_PAT@[58; 61) |
44 | IDENT@[58; 61) "baz" | 44 | NAME@[58; 61) |
45 | WHITESPACE@[61; 62) " " | 45 | IDENT@[58; 61) "baz" |
46 | EQ@[62; 63) "=" | 46 | WHITESPACE@[61; 62) " " |
47 | WHITESPACE@[63; 64) " " | 47 | EQ@[62; 63) "=" |
48 | LITERAL@[64; 66) | 48 | WHITESPACE@[63; 64) " " |
49 | INT_NUMBER@[64; 66) "92" | 49 | LITERAL@[64; 66) |
50 | SEMI@[66; 67) ";" | 50 | INT_NUMBER@[64; 66) "92" |
51 | WHITESPACE@[67; 72) "\n " | 51 | SEMI@[66; 67) ";" |
52 | LET_STMT@[72; 75) | 52 | WHITESPACE@[67; 72) "\n " |
53 | LET_KW@[72; 75) "let" | 53 | LET_STMT@[72; 75) |
54 | WHITESPACE@[75; 80) "\n " | 54 | LET_KW@[72; 75) "let" |
55 | EXPR_STMT@[80; 90) | 55 | WHITESPACE@[75; 80) "\n " |
56 | IF_EXPR@[80; 90) | 56 | EXPR_STMT@[80; 90) |
57 | IF_KW@[80; 82) "if" | 57 | IF_EXPR@[80; 90) |
58 | WHITESPACE@[82; 83) " " | 58 | IF_KW@[80; 82) "if" |
59 | CONDITION@[83; 87) | 59 | WHITESPACE@[82; 83) " " |
60 | LITERAL@[83; 87) | 60 | CONDITION@[83; 87) |
61 | TRUE_KW@[83; 87) "true" | 61 | LITERAL@[83; 87) |
62 | WHITESPACE@[87; 88) " " | 62 | TRUE_KW@[83; 87) "true" |
63 | BLOCK@[88; 90) | 63 | WHITESPACE@[87; 88) " " |
64 | L_CURLY@[88; 89) "{" | 64 | BLOCK_EXPR@[88; 90) |
65 | R_CURLY@[89; 90) "}" | 65 | BLOCK@[88; 90) |
66 | WHITESPACE@[90; 95) "\n " | 66 | L_CURLY@[88; 89) "{" |
67 | LET_STMT@[95; 98) | 67 | R_CURLY@[89; 90) "}" |
68 | LET_KW@[95; 98) "let" | 68 | WHITESPACE@[90; 95) "\n " |
69 | WHITESPACE@[98; 103) "\n " | 69 | LET_STMT@[95; 98) |
70 | EXPR_STMT@[103; 116) | 70 | LET_KW@[95; 98) "let" |
71 | WHILE_EXPR@[103; 116) | 71 | WHITESPACE@[98; 103) "\n " |
72 | WHILE_KW@[103; 108) "while" | 72 | EXPR_STMT@[103; 116) |
73 | WHITESPACE@[108; 109) " " | 73 | WHILE_EXPR@[103; 116) |
74 | CONDITION@[109; 113) | 74 | WHILE_KW@[103; 108) "while" |
75 | LITERAL@[109; 113) | 75 | WHITESPACE@[108; 109) " " |
76 | TRUE_KW@[109; 113) "true" | 76 | CONDITION@[109; 113) |
77 | WHITESPACE@[113; 114) " " | 77 | LITERAL@[109; 113) |
78 | BLOCK@[114; 116) | 78 | TRUE_KW@[109; 113) "true" |
79 | L_CURLY@[114; 115) "{" | 79 | WHITESPACE@[113; 114) " " |
80 | R_CURLY@[115; 116) "}" | 80 | BLOCK_EXPR@[114; 116) |
81 | WHITESPACE@[116; 121) "\n " | 81 | BLOCK@[114; 116) |
82 | LET_STMT@[121; 124) | 82 | L_CURLY@[114; 115) "{" |
83 | LET_KW@[121; 124) "let" | 83 | R_CURLY@[115; 116) "}" |
84 | WHITESPACE@[124; 129) "\n " | 84 | WHITESPACE@[116; 121) "\n " |
85 | LOOP_EXPR@[129; 136) | 85 | LET_STMT@[121; 124) |
86 | LOOP_KW@[129; 133) "loop" | 86 | LET_KW@[121; 124) "let" |
87 | WHITESPACE@[133; 134) " " | 87 | WHITESPACE@[124; 129) "\n " |
88 | BLOCK@[134; 136) | 88 | LOOP_EXPR@[129; 136) |
89 | L_CURLY@[134; 135) "{" | 89 | LOOP_KW@[129; 133) "loop" |
90 | R_CURLY@[135; 136) "}" | 90 | WHITESPACE@[133; 134) " " |
91 | WHITESPACE@[136; 137) "\n" | 91 | BLOCK_EXPR@[134; 136) |
92 | R_CURLY@[137; 138) "}" | 92 | BLOCK@[134; 136) |
93 | L_CURLY@[134; 135) "{" | ||
94 | R_CURLY@[135; 136) "}" | ||
95 | WHITESPACE@[136; 137) "\n" | ||
96 | R_CURLY@[137; 138) "}" | ||
93 | WHITESPACE@[138; 139) "\n" | 97 | WHITESPACE@[138; 139) "\n" |
94 | error 24: expected expression | 98 | error 24: expected expression |
95 | error 24: expected SEMI | 99 | error 24: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.txt b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.txt index 71c014028..70727d059 100644 --- a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.txt +++ b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.txt | |||
@@ -11,9 +11,10 @@ SOURCE_FILE@[0; 16) | |||
11 | L_PAREN@[10; 11) "(" | 11 | L_PAREN@[10; 11) "(" |
12 | R_PAREN@[11; 12) ")" | 12 | R_PAREN@[11; 12) ")" |
13 | WHITESPACE@[12; 13) " " | 13 | WHITESPACE@[12; 13) " " |
14 | BLOCK@[13; 15) | 14 | BLOCK_EXPR@[13; 15) |
15 | L_CURLY@[13; 14) "{" | 15 | BLOCK@[13; 15) |
16 | R_CURLY@[14; 15) "}" | 16 | L_CURLY@[13; 14) "{" |
17 | R_CURLY@[14; 15) "}" | ||
17 | WHITESPACE@[15; 16) "\n" | 18 | WHITESPACE@[15; 16) "\n" |
18 | error 2: expected a name | 19 | error 2: expected a name |
19 | error 2: expected function arguments | 20 | error 2: expected function arguments |
diff --git a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.txt b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.txt index c125a0bc9..333782480 100644 --- a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.txt +++ b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.txt | |||
@@ -25,10 +25,11 @@ SOURCE_FILE@[0; 22) | |||
25 | IDENT@[15; 16) "y" | 25 | IDENT@[15; 16) "y" |
26 | R_PAREN@[16; 17) ")" | 26 | R_PAREN@[16; 17) ")" |
27 | WHITESPACE@[17; 18) " " | 27 | WHITESPACE@[17; 18) " " |
28 | BLOCK@[18; 21) | 28 | BLOCK_EXPR@[18; 21) |
29 | L_CURLY@[18; 19) "{" | 29 | BLOCK@[18; 21) |
30 | WHITESPACE@[19; 20) "\n" | 30 | L_CURLY@[18; 19) "{" |
31 | R_CURLY@[20; 21) "}" | 31 | WHITESPACE@[19; 20) "\n" |
32 | R_CURLY@[20; 21) "}" | ||
32 | WHITESPACE@[21; 22) "\n" | 33 | WHITESPACE@[21; 22) "\n" |
33 | error 16: expected COLON | 34 | error 16: expected COLON |
34 | error 16: expected type | 35 | error 16: expected type |
diff --git a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt index 32b53bba7..ee0ac52c3 100644 --- a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt +++ b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.txt | |||
@@ -8,38 +8,39 @@ SOURCE_FILE@[0; 112) | |||
8 | L_PAREN@[4; 5) "(" | 8 | L_PAREN@[4; 5) "(" |
9 | R_PAREN@[5; 6) ")" | 9 | R_PAREN@[5; 6) ")" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | BLOCK@[7; 33) | 11 | BLOCK_EXPR@[7; 33) |
12 | L_CURLY@[7; 8) "{" | 12 | BLOCK@[7; 33) |
13 | WHITESPACE@[8; 9) " " | 13 | L_CURLY@[7; 8) "{" |
14 | EXPR_STMT@[9; 15) | 14 | WHITESPACE@[8; 9) " " |
15 | ARRAY_EXPR@[9; 15) | 15 | EXPR_STMT@[9; 15) |
16 | L_BRACK@[9; 10) "[" | 16 | ARRAY_EXPR@[9; 15) |
17 | LITERAL@[10; 11) | 17 | L_BRACK@[9; 10) "[" |
18 | INT_NUMBER@[10; 11) "1" | 18 | LITERAL@[10; 11) |
19 | COMMA@[11; 12) "," | 19 | INT_NUMBER@[10; 11) "1" |
20 | WHITESPACE@[12; 13) " " | 20 | COMMA@[11; 12) "," |
21 | LITERAL@[13; 14) | 21 | WHITESPACE@[12; 13) " " |
22 | INT_NUMBER@[13; 14) "2" | 22 | LITERAL@[13; 14) |
23 | COMMA@[14; 15) "," | 23 | INT_NUMBER@[13; 14) "2" |
24 | WHITESPACE@[15; 16) " " | 24 | COMMA@[14; 15) "," |
25 | EXPR_STMT@[16; 17) | 25 | WHITESPACE@[15; 16) " " |
26 | ERROR@[16; 17) | 26 | EXPR_STMT@[16; 17) |
27 | AT@[16; 17) "@" | 27 | ERROR@[16; 17) |
28 | EXPR_STMT@[17; 18) | 28 | AT@[16; 17) "@" |
29 | ERROR@[17; 18) | 29 | EXPR_STMT@[17; 18) |
30 | COMMA@[17; 18) "," | 30 | ERROR@[17; 18) |
31 | WHITESPACE@[18; 19) " " | 31 | COMMA@[17; 18) "," |
32 | STRUCT_DEF@[19; 26) | 32 | WHITESPACE@[18; 19) " " |
33 | STRUCT_KW@[19; 25) "struct" | 33 | STRUCT_DEF@[19; 26) |
34 | ERROR@[25; 26) | 34 | STRUCT_KW@[19; 25) "struct" |
35 | COMMA@[25; 26) "," | 35 | ERROR@[25; 26) |
36 | WHITESPACE@[26; 27) " " | 36 | COMMA@[25; 26) "," |
37 | LET_STMT@[27; 31) | 37 | WHITESPACE@[26; 27) " " |
38 | LET_KW@[27; 30) "let" | 38 | LET_STMT@[27; 31) |
39 | ERROR@[30; 31) | 39 | LET_KW@[27; 30) "let" |
40 | R_BRACK@[30; 31) "]" | 40 | ERROR@[30; 31) |
41 | WHITESPACE@[31; 32) " " | 41 | R_BRACK@[30; 31) "]" |
42 | R_CURLY@[32; 33) "}" | 42 | WHITESPACE@[31; 32) " " |
43 | R_CURLY@[32; 33) "}" | ||
43 | WHITESPACE@[33; 34) "\n" | 44 | WHITESPACE@[33; 34) "\n" |
44 | FN_DEF@[34; 68) | 45 | FN_DEF@[34; 68) |
45 | FN_KW@[34; 36) "fn" | 46 | FN_KW@[34; 36) "fn" |
@@ -50,45 +51,46 @@ SOURCE_FILE@[0; 112) | |||
50 | L_PAREN@[38; 39) "(" | 51 | L_PAREN@[38; 39) "(" |
51 | R_PAREN@[39; 40) ")" | 52 | R_PAREN@[39; 40) ")" |
52 | WHITESPACE@[40; 41) " " | 53 | WHITESPACE@[40; 41) " " |
53 | BLOCK@[41; 68) | 54 | BLOCK_EXPR@[41; 68) |
54 | L_CURLY@[41; 42) "{" | 55 | BLOCK@[41; 68) |
55 | WHITESPACE@[42; 43) " " | 56 | L_CURLY@[41; 42) "{" |
56 | EXPR_STMT@[43; 52) | 57 | WHITESPACE@[42; 43) " " |
57 | CALL_EXPR@[43; 52) | 58 | EXPR_STMT@[43; 52) |
58 | PATH_EXPR@[43; 46) | 59 | CALL_EXPR@[43; 52) |
59 | PATH@[43; 46) | 60 | PATH_EXPR@[43; 46) |
60 | PATH_SEGMENT@[43; 46) | 61 | PATH@[43; 46) |
61 | NAME_REF@[43; 46) | 62 | PATH_SEGMENT@[43; 46) |
62 | IDENT@[43; 46) "foo" | 63 | NAME_REF@[43; 46) |
63 | ARG_LIST@[46; 52) | 64 | IDENT@[43; 46) "foo" |
64 | L_PAREN@[46; 47) "(" | 65 | ARG_LIST@[46; 52) |
65 | LITERAL@[47; 48) | 66 | L_PAREN@[46; 47) "(" |
66 | INT_NUMBER@[47; 48) "1" | 67 | LITERAL@[47; 48) |
67 | COMMA@[48; 49) "," | 68 | INT_NUMBER@[47; 48) "1" |
68 | WHITESPACE@[49; 50) " " | 69 | COMMA@[48; 49) "," |
69 | LITERAL@[50; 51) | 70 | WHITESPACE@[49; 50) " " |
70 | INT_NUMBER@[50; 51) "2" | 71 | LITERAL@[50; 51) |
71 | COMMA@[51; 52) "," | 72 | INT_NUMBER@[50; 51) "2" |
72 | WHITESPACE@[52; 53) " " | 73 | COMMA@[51; 52) "," |
73 | EXPR_STMT@[53; 54) | 74 | WHITESPACE@[52; 53) " " |
74 | ERROR@[53; 54) | 75 | EXPR_STMT@[53; 54) |
75 | AT@[53; 54) "@" | 76 | ERROR@[53; 54) |
76 | EXPR_STMT@[54; 55) | 77 | AT@[53; 54) "@" |
77 | ERROR@[54; 55) | 78 | EXPR_STMT@[54; 55) |
78 | COMMA@[54; 55) "," | 79 | ERROR@[54; 55) |
79 | WHITESPACE@[55; 56) " " | 80 | COMMA@[54; 55) "," |
80 | IMPL_BLOCK@[56; 60) | 81 | WHITESPACE@[55; 56) " " |
81 | IMPL_KW@[56; 60) "impl" | 82 | IMPL_BLOCK@[56; 60) |
82 | EXPR_STMT@[60; 61) | 83 | IMPL_KW@[56; 60) "impl" |
83 | ERROR@[60; 61) | 84 | EXPR_STMT@[60; 61) |
84 | COMMA@[60; 61) "," | 85 | ERROR@[60; 61) |
85 | WHITESPACE@[61; 62) " " | 86 | COMMA@[60; 61) "," |
86 | LET_STMT@[62; 65) | 87 | WHITESPACE@[61; 62) " " |
87 | LET_KW@[62; 65) "let" | 88 | LET_STMT@[62; 65) |
88 | ERROR@[65; 66) | 89 | LET_KW@[62; 65) "let" |
89 | R_PAREN@[65; 66) ")" | 90 | ERROR@[65; 66) |
90 | WHITESPACE@[66; 67) " " | 91 | R_PAREN@[65; 66) ")" |
91 | R_CURLY@[67; 68) "}" | 92 | WHITESPACE@[66; 67) " " |
93 | R_CURLY@[67; 68) "}" | ||
92 | WHITESPACE@[68; 69) "\n" | 94 | WHITESPACE@[68; 69) "\n" |
93 | FN_DEF@[69; 111) | 95 | FN_DEF@[69; 111) |
94 | FN_KW@[69; 71) "fn" | 96 | FN_KW@[69; 71) "fn" |
@@ -99,54 +101,55 @@ SOURCE_FILE@[0; 112) | |||
99 | L_PAREN@[73; 74) "(" | 101 | L_PAREN@[73; 74) "(" |
100 | R_PAREN@[74; 75) ")" | 102 | R_PAREN@[74; 75) ")" |
101 | WHITESPACE@[75; 76) " " | 103 | WHITESPACE@[75; 76) " " |
102 | BLOCK@[76; 111) | 104 | BLOCK_EXPR@[76; 111) |
103 | L_CURLY@[76; 77) "{" | 105 | BLOCK@[76; 111) |
104 | WHITESPACE@[77; 78) " " | 106 | L_CURLY@[76; 77) "{" |
105 | EXPR_STMT@[78; 91) | 107 | WHITESPACE@[77; 78) " " |
106 | METHOD_CALL_EXPR@[78; 91) | 108 | EXPR_STMT@[78; 91) |
107 | PATH_EXPR@[78; 81) | 109 | METHOD_CALL_EXPR@[78; 91) |
108 | PATH@[78; 81) | 110 | PATH_EXPR@[78; 81) |
109 | PATH_SEGMENT@[78; 81) | 111 | PATH@[78; 81) |
110 | NAME_REF@[78; 81) | 112 | PATH_SEGMENT@[78; 81) |
111 | IDENT@[78; 81) "foo" | 113 | NAME_REF@[78; 81) |
112 | DOT@[81; 82) "." | 114 | IDENT@[78; 81) "foo" |
113 | NAME_REF@[82; 85) | 115 | DOT@[81; 82) "." |
114 | IDENT@[82; 85) "bar" | 116 | NAME_REF@[82; 85) |
115 | ARG_LIST@[85; 91) | 117 | IDENT@[82; 85) "bar" |
116 | L_PAREN@[85; 86) "(" | 118 | ARG_LIST@[85; 91) |
117 | LITERAL@[86; 87) | 119 | L_PAREN@[85; 86) "(" |
118 | INT_NUMBER@[86; 87) "1" | 120 | LITERAL@[86; 87) |
119 | COMMA@[87; 88) "," | 121 | INT_NUMBER@[86; 87) "1" |
120 | WHITESPACE@[88; 89) " " | 122 | COMMA@[87; 88) "," |
121 | LITERAL@[89; 90) | 123 | WHITESPACE@[88; 89) " " |
122 | INT_NUMBER@[89; 90) "2" | 124 | LITERAL@[89; 90) |
123 | COMMA@[90; 91) "," | 125 | INT_NUMBER@[89; 90) "2" |
124 | WHITESPACE@[91; 92) " " | 126 | COMMA@[90; 91) "," |
125 | EXPR_STMT@[92; 93) | 127 | WHITESPACE@[91; 92) " " |
126 | ERROR@[92; 93) | 128 | EXPR_STMT@[92; 93) |
127 | AT@[92; 93) "@" | 129 | ERROR@[92; 93) |
128 | EXPR_STMT@[93; 94) | 130 | AT@[92; 93) "@" |
129 | ERROR@[93; 94) | 131 | EXPR_STMT@[93; 94) |
130 | COMMA@[93; 94) "," | 132 | ERROR@[93; 94) |
131 | WHITESPACE@[94; 95) " " | 133 | COMMA@[93; 94) "," |
132 | EXPR_STMT@[95; 96) | 134 | WHITESPACE@[94; 95) " " |
133 | ERROR@[95; 96) | 135 | EXPR_STMT@[95; 96) |
134 | R_BRACK@[95; 96) "]" | 136 | ERROR@[95; 96) |
135 | EXPR_STMT@[96; 97) | 137 | R_BRACK@[95; 96) "]" |
136 | ERROR@[96; 97) | 138 | EXPR_STMT@[96; 97) |
137 | COMMA@[96; 97) "," | 139 | ERROR@[96; 97) |
138 | WHITESPACE@[97; 98) " " | 140 | COMMA@[96; 97) "," |
139 | TRAIT_DEF@[98; 104) | 141 | WHITESPACE@[97; 98) " " |
140 | TRAIT_KW@[98; 103) "trait" | 142 | TRAIT_DEF@[98; 104) |
141 | ERROR@[103; 104) | 143 | TRAIT_KW@[98; 103) "trait" |
142 | COMMA@[103; 104) "," | 144 | ERROR@[103; 104) |
143 | WHITESPACE@[104; 105) " " | 145 | COMMA@[103; 104) "," |
144 | LET_STMT@[105; 108) | 146 | WHITESPACE@[104; 105) " " |
145 | LET_KW@[105; 108) "let" | 147 | LET_STMT@[105; 108) |
146 | ERROR@[108; 109) | 148 | LET_KW@[105; 108) "let" |
147 | R_PAREN@[108; 109) ")" | 149 | ERROR@[108; 109) |
148 | WHITESPACE@[109; 110) " " | 150 | R_PAREN@[108; 109) ")" |
149 | R_CURLY@[110; 111) "}" | 151 | WHITESPACE@[109; 110) " " |
152 | R_CURLY@[110; 111) "}" | ||
150 | WHITESPACE@[111; 112) "\n" | 153 | WHITESPACE@[111; 112) "\n" |
151 | error 15: expected expression | 154 | error 15: expected expression |
152 | error 15: expected R_BRACK | 155 | error 15: expected R_BRACK |
diff --git a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.txt b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.txt index f2515faa7..6dd04f80e 100644 --- a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.txt +++ b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.txt | |||
@@ -8,31 +8,32 @@ SOURCE_FILE@[0; 94) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 55) | 11 | BLOCK_EXPR@[10; 55) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 55) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | MACRO_CALL@[16; 49) | 14 | WHITESPACE@[11; 16) "\n " |
15 | PATH@[16; 19) | 15 | MACRO_CALL@[16; 49) |
16 | PATH_SEGMENT@[16; 19) | 16 | PATH@[16; 19) |
17 | NAME_REF@[16; 19) | 17 | PATH_SEGMENT@[16; 19) |
18 | IDENT@[16; 19) "foo" | 18 | NAME_REF@[16; 19) |
19 | EXCL@[19; 20) "!" | 19 | IDENT@[16; 19) "foo" |
20 | WHITESPACE@[20; 21) " " | 20 | EXCL@[19; 20) "!" |
21 | TOKEN_TREE@[21; 49) | 21 | WHITESPACE@[20; 21) " " |
22 | L_PAREN@[21; 22) "(" | 22 | TOKEN_TREE@[21; 49) |
23 | WHITESPACE@[22; 31) "\n " | 23 | L_PAREN@[21; 22) "(" |
24 | IDENT@[31; 34) "bar" | 24 | WHITESPACE@[22; 31) "\n " |
25 | COMMA@[34; 35) "," | 25 | IDENT@[31; 34) "bar" |
26 | WHITESPACE@[35; 36) " " | 26 | COMMA@[34; 35) "," |
27 | STRING@[36; 41) "\"baz\"" | 27 | WHITESPACE@[35; 36) " " |
28 | COMMA@[41; 42) "," | 28 | STRING@[36; 41) "\"baz\"" |
29 | WHITESPACE@[42; 43) " " | 29 | COMMA@[41; 42) "," |
30 | INT_NUMBER@[43; 44) "1" | 30 | WHITESPACE@[42; 43) " " |
31 | COMMA@[44; 45) "," | 31 | INT_NUMBER@[43; 44) "1" |
32 | WHITESPACE@[45; 46) " " | 32 | COMMA@[44; 45) "," |
33 | FLOAT_NUMBER@[46; 49) "2.0" | 33 | WHITESPACE@[45; 46) " " |
34 | WHITESPACE@[49; 54) "\n " | 34 | FLOAT_NUMBER@[46; 49) "2.0" |
35 | R_CURLY@[54; 55) "}" | 35 | WHITESPACE@[49; 54) "\n " |
36 | R_CURLY@[54; 55) "}" | ||
36 | WHITESPACE@[55; 56) " " | 37 | WHITESPACE@[55; 56) " " |
37 | COMMENT@[56; 91) "//~ ERROR incorrect c ..." | 38 | COMMENT@[56; 91) "//~ ERROR incorrect c ..." |
38 | WHITESPACE@[91; 92) "\n" | 39 | WHITESPACE@[91; 92) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt index faf0fe462..198daf7b4 100644 --- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt +++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.txt | |||
@@ -61,9 +61,10 @@ SOURCE_FILE@[0; 240) | |||
61 | L_PAREN@[48; 49) "(" | 61 | L_PAREN@[48; 49) "(" |
62 | R_PAREN@[49; 50) ")" | 62 | R_PAREN@[49; 50) ")" |
63 | WHITESPACE@[50; 51) " " | 63 | WHITESPACE@[50; 51) " " |
64 | BLOCK@[51; 53) | 64 | BLOCK_EXPR@[51; 53) |
65 | L_CURLY@[51; 52) "{" | 65 | BLOCK@[51; 53) |
66 | R_CURLY@[52; 53) "}" | 66 | L_CURLY@[51; 52) "{" |
67 | R_CURLY@[52; 53) "}" | ||
67 | WHITESPACE@[53; 55) "\n\n" | 68 | WHITESPACE@[53; 55) "\n\n" |
68 | FN_DEF@[55; 239) | 69 | FN_DEF@[55; 239) |
69 | FN_KW@[55; 57) "fn" | 70 | FN_KW@[55; 57) "fn" |
@@ -74,222 +75,223 @@ SOURCE_FILE@[0; 240) | |||
74 | L_PAREN@[62; 63) "(" | 75 | L_PAREN@[62; 63) "(" |
75 | R_PAREN@[63; 64) ")" | 76 | R_PAREN@[63; 64) ")" |
76 | WHITESPACE@[64; 65) " " | 77 | WHITESPACE@[64; 65) " " |
77 | BLOCK@[65; 239) | 78 | BLOCK_EXPR@[65; 239) |
78 | L_CURLY@[65; 66) "{" | 79 | BLOCK@[65; 239) |
79 | WHITESPACE@[66; 71) "\n " | 80 | L_CURLY@[65; 66) "{" |
80 | LET_STMT@[71; 121) | 81 | WHITESPACE@[66; 71) "\n " |
81 | LET_KW@[71; 74) "let" | 82 | LET_STMT@[71; 121) |
82 | WHITESPACE@[74; 75) " " | 83 | LET_KW@[71; 74) "let" |
83 | PLACEHOLDER_PAT@[75; 76) | 84 | WHITESPACE@[74; 75) " " |
84 | UNDERSCORE@[75; 76) "_" | 85 | PLACEHOLDER_PAT@[75; 76) |
85 | COLON@[76; 77) ":" | 86 | UNDERSCORE@[75; 76) "_" |
86 | WHITESPACE@[77; 78) " " | 87 | COLON@[76; 77) ":" |
87 | DYN_TRAIT_TYPE@[78; 121) | 88 | WHITESPACE@[77; 78) " " |
88 | TYPE_BOUND_LIST@[78; 121) | 89 | DYN_TRAIT_TYPE@[78; 121) |
89 | TYPE_BOUND@[78; 88) | 90 | TYPE_BOUND_LIST@[78; 121) |
90 | PATH_TYPE@[78; 88) | 91 | TYPE_BOUND@[78; 88) |
91 | PATH@[78; 88) | 92 | PATH_TYPE@[78; 88) |
92 | PATH_SEGMENT@[78; 88) | 93 | PATH@[78; 88) |
93 | NAME_REF@[78; 81) | 94 | PATH_SEGMENT@[78; 88) |
94 | IDENT@[78; 81) "Box" | 95 | NAME_REF@[78; 81) |
95 | TYPE_ARG_LIST@[81; 88) | 96 | IDENT@[78; 81) "Box" |
96 | L_ANGLE@[81; 82) "<" | 97 | TYPE_ARG_LIST@[81; 88) |
97 | TYPE_ARG@[82; 88) | 98 | L_ANGLE@[81; 82) "<" |
98 | PAREN_TYPE@[82; 88) | 99 | TYPE_ARG@[82; 88) |
99 | L_PAREN@[82; 83) "(" | 100 | PAREN_TYPE@[82; 88) |
100 | PATH_TYPE@[83; 87) | 101 | L_PAREN@[82; 83) "(" |
101 | PATH@[83; 87) | 102 | PATH_TYPE@[83; 87) |
102 | PATH_SEGMENT@[83; 87) | 103 | PATH@[83; 87) |
103 | NAME_REF@[83; 87) | 104 | PATH_SEGMENT@[83; 87) |
104 | IDENT@[83; 87) "Copy" | 105 | NAME_REF@[83; 87) |
105 | R_PAREN@[87; 88) ")" | 106 | IDENT@[83; 87) "Copy" |
106 | WHITESPACE@[88; 89) " " | 107 | R_PAREN@[87; 88) ")" |
107 | PLUS@[89; 90) "+" | 108 | WHITESPACE@[88; 89) " " |
108 | WHITESPACE@[90; 91) " " | 109 | PLUS@[89; 90) "+" |
109 | TYPE_BOUND@[91; 99) | 110 | WHITESPACE@[90; 91) " " |
110 | L_PAREN@[91; 92) "(" | 111 | TYPE_BOUND@[91; 99) |
111 | QUESTION@[92; 93) "?" | 112 | L_PAREN@[91; 92) "(" |
112 | PATH_TYPE@[93; 98) | 113 | QUESTION@[92; 93) "?" |
113 | PATH@[93; 98) | 114 | PATH_TYPE@[93; 98) |
114 | PATH_SEGMENT@[93; 98) | 115 | PATH@[93; 98) |
115 | NAME_REF@[93; 98) | 116 | PATH_SEGMENT@[93; 98) |
116 | IDENT@[93; 98) "Sized" | 117 | NAME_REF@[93; 98) |
117 | R_PAREN@[98; 99) ")" | 118 | IDENT@[93; 98) "Sized" |
118 | WHITESPACE@[99; 100) " " | 119 | R_PAREN@[98; 99) ")" |
119 | PLUS@[100; 101) "+" | 120 | WHITESPACE@[99; 100) " " |
120 | WHITESPACE@[101; 102) " " | 121 | PLUS@[100; 101) "+" |
121 | TYPE_BOUND@[102; 121) | 122 | WHITESPACE@[101; 102) " " |
122 | L_PAREN@[102; 103) "(" | 123 | TYPE_BOUND@[102; 121) |
123 | FOR_TYPE@[103; 120) | 124 | L_PAREN@[102; 103) "(" |
124 | FOR_KW@[103; 106) "for" | 125 | FOR_TYPE@[103; 120) |
125 | TYPE_PARAM_LIST@[106; 110) | 126 | FOR_KW@[103; 106) "for" |
126 | L_ANGLE@[106; 107) "<" | 127 | TYPE_PARAM_LIST@[106; 110) |
127 | LIFETIME_PARAM@[107; 109) | 128 | L_ANGLE@[106; 107) "<" |
128 | LIFETIME@[107; 109) "\'a" | 129 | LIFETIME_PARAM@[107; 109) |
129 | R_ANGLE@[109; 110) ">" | 130 | LIFETIME@[107; 109) "\'a" |
130 | WHITESPACE@[110; 111) " " | 131 | R_ANGLE@[109; 110) ">" |
131 | PATH_TYPE@[111; 120) | 132 | WHITESPACE@[110; 111) " " |
132 | PATH@[111; 120) | 133 | PATH_TYPE@[111; 120) |
133 | PATH_SEGMENT@[111; 120) | 134 | PATH@[111; 120) |
134 | NAME_REF@[111; 116) | 135 | PATH_SEGMENT@[111; 120) |
135 | IDENT@[111; 116) "Trait" | 136 | NAME_REF@[111; 116) |
136 | TYPE_ARG_LIST@[116; 120) | 137 | IDENT@[111; 116) "Trait" |
137 | L_ANGLE@[116; 117) "<" | 138 | TYPE_ARG_LIST@[116; 120) |
138 | LIFETIME_ARG@[117; 119) | 139 | L_ANGLE@[116; 117) "<" |
139 | LIFETIME@[117; 119) "\'a" | 140 | LIFETIME_ARG@[117; 119) |
140 | R_ANGLE@[119; 120) ">" | 141 | LIFETIME@[117; 119) "\'a" |
141 | R_PAREN@[120; 121) ")" | 142 | R_ANGLE@[119; 120) ">" |
142 | EXPR_STMT@[121; 123) | 143 | R_PAREN@[120; 121) ")" |
143 | ERROR@[121; 122) | 144 | EXPR_STMT@[121; 123) |
144 | R_ANGLE@[121; 122) ">" | 145 | ERROR@[121; 122) |
145 | SEMI@[122; 123) ";" | 146 | R_ANGLE@[121; 122) ">" |
146 | WHITESPACE@[123; 128) "\n " | 147 | SEMI@[122; 123) ";" |
147 | LET_STMT@[128; 141) | 148 | WHITESPACE@[123; 128) "\n " |
148 | LET_KW@[128; 131) "let" | 149 | LET_STMT@[128; 141) |
149 | WHITESPACE@[131; 132) " " | 150 | LET_KW@[128; 131) "let" |
150 | PLACEHOLDER_PAT@[132; 133) | 151 | WHITESPACE@[131; 132) " " |
151 | UNDERSCORE@[132; 133) "_" | 152 | PLACEHOLDER_PAT@[132; 133) |
152 | COLON@[133; 134) ":" | 153 | UNDERSCORE@[132; 133) "_" |
153 | WHITESPACE@[134; 135) " " | 154 | COLON@[133; 134) ":" |
154 | PATH_TYPE@[135; 141) | 155 | WHITESPACE@[134; 135) " " |
155 | PATH@[135; 141) | 156 | PATH_TYPE@[135; 141) |
156 | PATH_SEGMENT@[135; 141) | 157 | PATH@[135; 141) |
157 | NAME_REF@[135; 138) | 158 | PATH_SEGMENT@[135; 141) |
158 | IDENT@[135; 138) "Box" | 159 | NAME_REF@[135; 138) |
159 | TYPE_ARG_LIST@[138; 141) | 160 | IDENT@[135; 138) "Box" |
160 | L_ANGLE@[138; 139) "<" | 161 | TYPE_ARG_LIST@[138; 141) |
161 | TYPE_ARG@[139; 141) | 162 | L_ANGLE@[138; 139) "<" |
162 | PAREN_TYPE@[139; 141) | 163 | TYPE_ARG@[139; 141) |
163 | L_PAREN@[139; 140) "(" | 164 | PAREN_TYPE@[139; 141) |
164 | ERROR@[140; 141) | 165 | L_PAREN@[139; 140) "(" |
165 | QUESTION@[140; 141) "?" | 166 | ERROR@[140; 141) |
166 | EXPR_STMT@[141; 146) | 167 | QUESTION@[140; 141) "?" |
167 | PATH_EXPR@[141; 146) | 168 | EXPR_STMT@[141; 146) |
168 | PATH@[141; 146) | 169 | PATH_EXPR@[141; 146) |
169 | PATH_SEGMENT@[141; 146) | 170 | PATH@[141; 146) |
170 | NAME_REF@[141; 146) | 171 | PATH_SEGMENT@[141; 146) |
171 | IDENT@[141; 146) "Sized" | 172 | NAME_REF@[141; 146) |
172 | EXPR_STMT@[146; 147) | 173 | IDENT@[141; 146) "Sized" |
173 | ERROR@[146; 147) | 174 | EXPR_STMT@[146; 147) |
174 | R_PAREN@[146; 147) ")" | 175 | ERROR@[146; 147) |
175 | WHITESPACE@[147; 148) " " | 176 | R_PAREN@[146; 147) ")" |
176 | EXPR_STMT@[148; 149) | 177 | WHITESPACE@[147; 148) " " |
177 | ERROR@[148; 149) | 178 | EXPR_STMT@[148; 149) |
178 | PLUS@[148; 149) "+" | 179 | ERROR@[148; 149) |
179 | WHITESPACE@[149; 150) " " | 180 | PLUS@[148; 149) "+" |
180 | EXPR_STMT@[150; 151) | 181 | WHITESPACE@[149; 150) " " |
181 | PAREN_EXPR@[150; 151) | 182 | EXPR_STMT@[150; 151) |
182 | L_PAREN@[150; 151) "(" | 183 | PAREN_EXPR@[150; 151) |
183 | EXPR_STMT@[151; 157) | 184 | L_PAREN@[150; 151) "(" |
184 | FOR_EXPR@[151; 157) | 185 | EXPR_STMT@[151; 157) |
185 | FOR_KW@[151; 154) "for" | 186 | FOR_EXPR@[151; 157) |
186 | ERROR@[154; 155) | 187 | FOR_KW@[151; 154) "for" |
187 | L_ANGLE@[154; 155) "<" | 188 | ERROR@[154; 155) |
188 | ERROR@[155; 157) | 189 | L_ANGLE@[154; 155) "<" |
189 | LIFETIME@[155; 157) "\'a" | 190 | ERROR@[155; 157) |
190 | EXPR_STMT@[157; 158) | 191 | LIFETIME@[155; 157) "\'a" |
191 | ERROR@[157; 158) | 192 | EXPR_STMT@[157; 158) |
192 | R_ANGLE@[157; 158) ">" | 193 | ERROR@[157; 158) |
193 | WHITESPACE@[158; 159) " " | 194 | R_ANGLE@[157; 158) ">" |
194 | EXPR_STMT@[159; 180) | 195 | WHITESPACE@[158; 159) " " |
195 | BIN_EXPR@[159; 180) | 196 | EXPR_STMT@[159; 180) |
196 | BIN_EXPR@[159; 178) | 197 | BIN_EXPR@[159; 180) |
197 | BIN_EXPR@[159; 169) | 198 | BIN_EXPR@[159; 178) |
198 | BIN_EXPR@[159; 167) | 199 | BIN_EXPR@[159; 169) |
199 | PATH_EXPR@[159; 164) | 200 | BIN_EXPR@[159; 167) |
200 | PATH@[159; 164) | 201 | PATH_EXPR@[159; 164) |
201 | PATH_SEGMENT@[159; 164) | 202 | PATH@[159; 164) |
202 | NAME_REF@[159; 164) | 203 | PATH_SEGMENT@[159; 164) |
203 | IDENT@[159; 164) "Trait" | 204 | NAME_REF@[159; 164) |
204 | L_ANGLE@[164; 165) "<" | 205 | IDENT@[159; 164) "Trait" |
205 | ERROR@[165; 167) | 206 | L_ANGLE@[164; 165) "<" |
206 | LIFETIME@[165; 167) "\'a" | 207 | ERROR@[165; 167) |
207 | R_ANGLE@[167; 168) ">" | 208 | LIFETIME@[165; 167) "\'a" |
208 | ERROR@[168; 169) | 209 | R_ANGLE@[167; 168) ">" |
209 | R_PAREN@[168; 169) ")" | 210 | ERROR@[168; 169) |
210 | WHITESPACE@[169; 170) " " | 211 | R_PAREN@[168; 169) ")" |
211 | PLUS@[170; 171) "+" | 212 | WHITESPACE@[169; 170) " " |
212 | WHITESPACE@[171; 172) " " | 213 | PLUS@[170; 171) "+" |
213 | PAREN_EXPR@[172; 178) | 214 | WHITESPACE@[171; 172) " " |
214 | L_PAREN@[172; 173) "(" | 215 | PAREN_EXPR@[172; 178) |
215 | PATH_EXPR@[173; 177) | 216 | L_PAREN@[172; 173) "(" |
216 | PATH@[173; 177) | 217 | PATH_EXPR@[173; 177) |
217 | PATH_SEGMENT@[173; 177) | 218 | PATH@[173; 177) |
218 | NAME_REF@[173; 177) | 219 | PATH_SEGMENT@[173; 177) |
219 | IDENT@[173; 177) "Copy" | 220 | NAME_REF@[173; 177) |
220 | R_PAREN@[177; 178) ")" | 221 | IDENT@[173; 177) "Copy" |
221 | R_ANGLE@[178; 179) ">" | 222 | R_PAREN@[177; 178) ")" |
222 | ERROR@[179; 180) | 223 | R_ANGLE@[178; 179) ">" |
223 | SEMI@[179; 180) ";" | 224 | ERROR@[179; 180) |
224 | WHITESPACE@[180; 185) "\n " | 225 | SEMI@[179; 180) ";" |
225 | LET_STMT@[185; 235) | 226 | WHITESPACE@[180; 185) "\n " |
226 | LET_KW@[185; 188) "let" | 227 | LET_STMT@[185; 235) |
227 | WHITESPACE@[188; 189) " " | 228 | LET_KW@[185; 188) "let" |
228 | PLACEHOLDER_PAT@[189; 190) | 229 | WHITESPACE@[188; 189) " " |
229 | UNDERSCORE@[189; 190) "_" | 230 | PLACEHOLDER_PAT@[189; 190) |
230 | COLON@[190; 191) ":" | 231 | UNDERSCORE@[189; 190) "_" |
231 | WHITESPACE@[191; 192) " " | 232 | COLON@[190; 191) ":" |
232 | DYN_TRAIT_TYPE@[192; 235) | 233 | WHITESPACE@[191; 192) " " |
233 | TYPE_BOUND_LIST@[192; 235) | 234 | DYN_TRAIT_TYPE@[192; 235) |
234 | TYPE_BOUND@[192; 215) | 235 | TYPE_BOUND_LIST@[192; 235) |
235 | PATH_TYPE@[192; 215) | 236 | TYPE_BOUND@[192; 215) |
236 | PATH@[192; 215) | 237 | PATH_TYPE@[192; 215) |
237 | PATH_SEGMENT@[192; 215) | 238 | PATH@[192; 215) |
238 | NAME_REF@[192; 195) | 239 | PATH_SEGMENT@[192; 215) |
239 | IDENT@[192; 195) "Box" | 240 | NAME_REF@[192; 195) |
240 | TYPE_ARG_LIST@[195; 215) | 241 | IDENT@[192; 195) "Box" |
241 | L_ANGLE@[195; 196) "<" | 242 | TYPE_ARG_LIST@[195; 215) |
242 | TYPE_ARG@[196; 215) | 243 | L_ANGLE@[195; 196) "<" |
243 | PAREN_TYPE@[196; 215) | 244 | TYPE_ARG@[196; 215) |
244 | L_PAREN@[196; 197) "(" | 245 | PAREN_TYPE@[196; 215) |
245 | FOR_TYPE@[197; 214) | 246 | L_PAREN@[196; 197) "(" |
246 | FOR_KW@[197; 200) "for" | 247 | FOR_TYPE@[197; 214) |
247 | TYPE_PARAM_LIST@[200; 204) | 248 | FOR_KW@[197; 200) "for" |
248 | L_ANGLE@[200; 201) "<" | 249 | TYPE_PARAM_LIST@[200; 204) |
249 | LIFETIME_PARAM@[201; 203) | 250 | L_ANGLE@[200; 201) "<" |
250 | LIFETIME@[201; 203) "\'a" | 251 | LIFETIME_PARAM@[201; 203) |
251 | R_ANGLE@[203; 204) ">" | 252 | LIFETIME@[201; 203) "\'a" |
252 | WHITESPACE@[204; 205) " " | 253 | R_ANGLE@[203; 204) ">" |
253 | PATH_TYPE@[205; 214) | 254 | WHITESPACE@[204; 205) " " |
254 | PATH@[205; 214) | 255 | PATH_TYPE@[205; 214) |
255 | PATH_SEGMENT@[205; 214) | 256 | PATH@[205; 214) |
256 | NAME_REF@[205; 210) | 257 | PATH_SEGMENT@[205; 214) |
257 | IDENT@[205; 210) "Trait" | 258 | NAME_REF@[205; 210) |
258 | TYPE_ARG_LIST@[210; 214) | 259 | IDENT@[205; 210) "Trait" |
259 | L_ANGLE@[210; 211) "<" | 260 | TYPE_ARG_LIST@[210; 214) |
260 | LIFETIME_ARG@[211; 213) | 261 | L_ANGLE@[210; 211) "<" |
261 | LIFETIME@[211; 213) "\'a" | 262 | LIFETIME_ARG@[211; 213) |
262 | R_ANGLE@[213; 214) ">" | 263 | LIFETIME@[211; 213) "\'a" |
263 | R_PAREN@[214; 215) ")" | 264 | R_ANGLE@[213; 214) ">" |
264 | WHITESPACE@[215; 216) " " | 265 | R_PAREN@[214; 215) ")" |
265 | PLUS@[216; 217) "+" | 266 | WHITESPACE@[215; 216) " " |
266 | WHITESPACE@[217; 218) " " | 267 | PLUS@[216; 217) "+" |
267 | TYPE_BOUND@[218; 224) | 268 | WHITESPACE@[217; 218) " " |
268 | L_PAREN@[218; 219) "(" | 269 | TYPE_BOUND@[218; 224) |
269 | PATH_TYPE@[219; 223) | 270 | L_PAREN@[218; 219) "(" |
270 | PATH@[219; 223) | 271 | PATH_TYPE@[219; 223) |
271 | PATH_SEGMENT@[219; 223) | 272 | PATH@[219; 223) |
272 | NAME_REF@[219; 223) | 273 | PATH_SEGMENT@[219; 223) |
273 | IDENT@[219; 223) "Copy" | 274 | NAME_REF@[219; 223) |
274 | R_PAREN@[223; 224) ")" | 275 | IDENT@[219; 223) "Copy" |
275 | WHITESPACE@[224; 225) " " | 276 | R_PAREN@[223; 224) ")" |
276 | PLUS@[225; 226) "+" | 277 | WHITESPACE@[224; 225) " " |
277 | WHITESPACE@[226; 227) " " | 278 | PLUS@[225; 226) "+" |
278 | TYPE_BOUND@[227; 235) | 279 | WHITESPACE@[226; 227) " " |
279 | L_PAREN@[227; 228) "(" | 280 | TYPE_BOUND@[227; 235) |
280 | QUESTION@[228; 229) "?" | 281 | L_PAREN@[227; 228) "(" |
281 | PATH_TYPE@[229; 234) | 282 | QUESTION@[228; 229) "?" |
282 | PATH@[229; 234) | 283 | PATH_TYPE@[229; 234) |
283 | PATH_SEGMENT@[229; 234) | 284 | PATH@[229; 234) |
284 | NAME_REF@[229; 234) | 285 | PATH_SEGMENT@[229; 234) |
285 | IDENT@[229; 234) "Sized" | 286 | NAME_REF@[229; 234) |
286 | R_PAREN@[234; 235) ")" | 287 | IDENT@[229; 234) "Sized" |
287 | EXPR_STMT@[235; 237) | 288 | R_PAREN@[234; 235) ")" |
288 | ERROR@[235; 236) | 289 | EXPR_STMT@[235; 237) |
289 | R_ANGLE@[235; 236) ">" | 290 | ERROR@[235; 236) |
290 | SEMI@[236; 237) ";" | 291 | R_ANGLE@[235; 236) ">" |
291 | WHITESPACE@[237; 238) "\n" | 292 | SEMI@[236; 237) ";" |
292 | R_CURLY@[238; 239) "}" | 293 | WHITESPACE@[237; 238) "\n" |
294 | R_CURLY@[238; 239) "}" | ||
293 | WHITESPACE@[239; 240) "\n" | 295 | WHITESPACE@[239; 240) "\n" |
294 | error 88: expected COMMA | 296 | error 88: expected COMMA |
295 | error 88: expected R_ANGLE | 297 | error 88: expected R_ANGLE |
diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.txt b/crates/ra_syntax/test_data/parser/err/0025_nope.txt index 7b228a8ed..8369f4bda 100644 --- a/crates/ra_syntax/test_data/parser/err/0025_nope.txt +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.txt | |||
@@ -8,187 +8,188 @@ SOURCE_FILE@[0; 575) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 574) | 11 | BLOCK_EXPR@[10; 574) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 574) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | ENUM_DEF@[16; 152) | 14 | WHITESPACE@[11; 16) "\n " |
15 | ENUM_KW@[16; 20) "enum" | 15 | ENUM_DEF@[16; 152) |
16 | WHITESPACE@[20; 21) " " | 16 | ENUM_KW@[16; 20) "enum" |
17 | NAME@[21; 25) | 17 | WHITESPACE@[20; 21) " " |
18 | IDENT@[21; 25) "Test" | 18 | NAME@[21; 25) |
19 | WHITESPACE@[25; 26) " " | 19 | IDENT@[21; 25) "Test" |
20 | ENUM_VARIANT_LIST@[26; 152) | 20 | WHITESPACE@[25; 26) " " |
21 | L_CURLY@[26; 27) "{" | 21 | ENUM_VARIANT_LIST@[26; 152) |
22 | WHITESPACE@[27; 36) "\n " | 22 | L_CURLY@[26; 27) "{" |
23 | ENUM_VARIANT@[36; 40) | 23 | WHITESPACE@[27; 36) "\n " |
24 | NAME@[36; 40) | 24 | ENUM_VARIANT@[36; 40) |
25 | IDENT@[36; 40) "Var1" | 25 | NAME@[36; 40) |
26 | COMMA@[40; 41) "," | 26 | IDENT@[36; 40) "Var1" |
27 | WHITESPACE@[41; 50) "\n " | 27 | COMMA@[40; 41) "," |
28 | ENUM_VARIANT@[50; 62) | 28 | WHITESPACE@[41; 50) "\n " |
29 | NAME@[50; 54) | 29 | ENUM_VARIANT@[50; 62) |
30 | IDENT@[50; 54) "Var2" | 30 | NAME@[50; 54) |
31 | TUPLE_FIELD_DEF_LIST@[54; 62) | 31 | IDENT@[50; 54) "Var2" |
32 | L_PAREN@[54; 55) "(" | 32 | TUPLE_FIELD_DEF_LIST@[54; 62) |
33 | TUPLE_FIELD_DEF@[55; 61) | 33 | L_PAREN@[54; 55) "(" |
34 | PATH_TYPE@[55; 61) | 34 | TUPLE_FIELD_DEF@[55; 61) |
35 | PATH@[55; 61) | 35 | PATH_TYPE@[55; 61) |
36 | PATH_SEGMENT@[55; 61) | 36 | PATH@[55; 61) |
37 | NAME_REF@[55; 61) | 37 | PATH_SEGMENT@[55; 61) |
38 | IDENT@[55; 61) "String" | 38 | NAME_REF@[55; 61) |
39 | R_PAREN@[61; 62) ")" | 39 | IDENT@[55; 61) "String" |
40 | COMMA@[62; 63) "," | 40 | R_PAREN@[61; 62) ")" |
41 | WHITESPACE@[63; 72) "\n " | 41 | COMMA@[62; 63) "," |
42 | ENUM_VARIANT@[72; 145) | 42 | WHITESPACE@[63; 72) "\n " |
43 | NAME@[72; 76) | 43 | ENUM_VARIANT@[72; 145) |
44 | IDENT@[72; 76) "Var3" | 44 | NAME@[72; 76) |
45 | WHITESPACE@[76; 77) " " | 45 | IDENT@[72; 76) "Var3" |
46 | RECORD_FIELD_DEF_LIST@[77; 145) | 46 | WHITESPACE@[76; 77) " " |
47 | L_CURLY@[77; 78) "{" | 47 | RECORD_FIELD_DEF_LIST@[77; 145) |
48 | WHITESPACE@[78; 91) "\n " | 48 | L_CURLY@[77; 78) "{" |
49 | RECORD_FIELD_DEF@[91; 95) | 49 | WHITESPACE@[78; 91) "\n " |
50 | NAME@[91; 94) | 50 | RECORD_FIELD_DEF@[91; 95) |
51 | IDENT@[91; 94) "abc" | 51 | NAME@[91; 94) |
52 | COLON@[94; 95) ":" | 52 | IDENT@[91; 94) "abc" |
53 | WHITESPACE@[95; 96) " " | 53 | COLON@[94; 95) ":" |
54 | ERROR@[96; 98) | 54 | WHITESPACE@[95; 96) " " |
55 | L_CURLY@[96; 97) "{" | 55 | ERROR@[96; 98) |
56 | R_CURLY@[97; 98) "}" | 56 | L_CURLY@[96; 97) "{" |
57 | ERROR@[98; 99) | 57 | R_CURLY@[97; 98) "}" |
58 | COMMA@[98; 99) "," | 58 | ERROR@[98; 99) |
59 | WHITESPACE@[99; 100) " " | 59 | COMMA@[98; 99) "," |
60 | COMMENT@[100; 135) "//~ ERROR: expected t ..." | 60 | WHITESPACE@[99; 100) " " |
61 | WHITESPACE@[135; 144) "\n " | 61 | COMMENT@[100; 135) "//~ ERROR: expected t ..." |
62 | R_CURLY@[144; 145) "}" | 62 | WHITESPACE@[135; 144) "\n " |
63 | COMMA@[145; 146) "," | 63 | R_CURLY@[144; 145) "}" |
64 | WHITESPACE@[146; 151) "\n " | 64 | COMMA@[145; 146) "," |
65 | R_CURLY@[151; 152) "}" | 65 | WHITESPACE@[146; 151) "\n " |
66 | WHITESPACE@[152; 158) "\n\n " | 66 | R_CURLY@[151; 152) "}" |
67 | COMMENT@[158; 171) "// recover..." | 67 | WHITESPACE@[152; 158) "\n\n " |
68 | WHITESPACE@[171; 176) "\n " | 68 | COMMENT@[158; 171) "// recover..." |
69 | LET_STMT@[176; 186) | 69 | WHITESPACE@[171; 176) "\n " |
70 | LET_KW@[176; 179) "let" | 70 | LET_STMT@[176; 186) |
71 | WHITESPACE@[179; 180) " " | 71 | LET_KW@[176; 179) "let" |
72 | BIND_PAT@[180; 181) | 72 | WHITESPACE@[179; 180) " " |
73 | NAME@[180; 181) | 73 | BIND_PAT@[180; 181) |
74 | IDENT@[180; 181) "a" | 74 | NAME@[180; 181) |
75 | WHITESPACE@[181; 182) " " | 75 | IDENT@[180; 181) "a" |
76 | EQ@[182; 183) "=" | 76 | WHITESPACE@[181; 182) " " |
77 | WHITESPACE@[183; 184) " " | 77 | EQ@[182; 183) "=" |
78 | LITERAL@[184; 185) | 78 | WHITESPACE@[183; 184) " " |
79 | INT_NUMBER@[184; 185) "1" | 79 | LITERAL@[184; 185) |
80 | SEMI@[185; 186) ";" | 80 | INT_NUMBER@[184; 185) "1" |
81 | WHITESPACE@[186; 191) "\n " | 81 | SEMI@[185; 186) ";" |
82 | ENUM_DEF@[191; 223) | 82 | WHITESPACE@[186; 191) "\n " |
83 | ENUM_KW@[191; 195) "enum" | 83 | ENUM_DEF@[191; 223) |
84 | WHITESPACE@[195; 196) " " | 84 | ENUM_KW@[191; 195) "enum" |
85 | NAME@[196; 201) | 85 | WHITESPACE@[195; 196) " " |
86 | IDENT@[196; 201) "Test2" | 86 | NAME@[196; 201) |
87 | WHITESPACE@[201; 202) " " | 87 | IDENT@[196; 201) "Test2" |
88 | ENUM_VARIANT_LIST@[202; 223) | 88 | WHITESPACE@[201; 202) " " |
89 | L_CURLY@[202; 203) "{" | 89 | ENUM_VARIANT_LIST@[202; 223) |
90 | WHITESPACE@[203; 212) "\n " | 90 | L_CURLY@[202; 203) "{" |
91 | ENUM_VARIANT@[212; 216) | 91 | WHITESPACE@[203; 212) "\n " |
92 | NAME@[212; 216) | 92 | ENUM_VARIANT@[212; 216) |
93 | IDENT@[212; 216) "Fine" | 93 | NAME@[212; 216) |
94 | COMMA@[216; 217) "," | 94 | IDENT@[212; 216) "Fine" |
95 | WHITESPACE@[217; 222) "\n " | 95 | COMMA@[216; 217) "," |
96 | R_CURLY@[222; 223) "}" | 96 | WHITESPACE@[217; 222) "\n " |
97 | WHITESPACE@[223; 229) "\n\n " | 97 | R_CURLY@[222; 223) "}" |
98 | ENUM_DEF@[229; 300) | 98 | WHITESPACE@[223; 229) "\n\n " |
99 | ENUM_KW@[229; 233) "enum" | 99 | ENUM_DEF@[229; 300) |
100 | WHITESPACE@[233; 234) " " | 100 | ENUM_KW@[229; 233) "enum" |
101 | NAME@[234; 239) | 101 | WHITESPACE@[233; 234) " " |
102 | IDENT@[234; 239) "Test3" | 102 | NAME@[234; 239) |
103 | WHITESPACE@[239; 240) " " | 103 | IDENT@[234; 239) "Test3" |
104 | ENUM_VARIANT_LIST@[240; 300) | 104 | WHITESPACE@[239; 240) " " |
105 | L_CURLY@[240; 241) "{" | 105 | ENUM_VARIANT_LIST@[240; 300) |
106 | WHITESPACE@[241; 250) "\n " | 106 | L_CURLY@[240; 241) "{" |
107 | ENUM_VARIANT@[250; 293) | 107 | WHITESPACE@[241; 250) "\n " |
108 | NAME@[250; 259) | 108 | ENUM_VARIANT@[250; 293) |
109 | IDENT@[250; 259) "StillFine" | 109 | NAME@[250; 259) |
110 | WHITESPACE@[259; 260) " " | 110 | IDENT@[250; 259) "StillFine" |
111 | RECORD_FIELD_DEF_LIST@[260; 293) | 111 | WHITESPACE@[259; 260) " " |
112 | L_CURLY@[260; 261) "{" | 112 | RECORD_FIELD_DEF_LIST@[260; 293) |
113 | WHITESPACE@[261; 274) "\n " | 113 | L_CURLY@[260; 261) "{" |
114 | RECORD_FIELD_DEF@[274; 282) | 114 | WHITESPACE@[261; 274) "\n " |
115 | NAME@[274; 277) | 115 | RECORD_FIELD_DEF@[274; 282) |
116 | IDENT@[274; 277) "def" | 116 | NAME@[274; 277) |
117 | COLON@[277; 278) ":" | 117 | IDENT@[274; 277) "def" |
118 | WHITESPACE@[278; 279) " " | 118 | COLON@[277; 278) ":" |
119 | PATH_TYPE@[279; 282) | 119 | WHITESPACE@[278; 279) " " |
120 | PATH@[279; 282) | 120 | PATH_TYPE@[279; 282) |
121 | PATH_SEGMENT@[279; 282) | 121 | PATH@[279; 282) |
122 | NAME_REF@[279; 282) | 122 | PATH_SEGMENT@[279; 282) |
123 | IDENT@[279; 282) "i32" | 123 | NAME_REF@[279; 282) |
124 | COMMA@[282; 283) "," | 124 | IDENT@[279; 282) "i32" |
125 | WHITESPACE@[283; 292) "\n " | 125 | COMMA@[282; 283) "," |
126 | R_CURLY@[292; 293) "}" | 126 | WHITESPACE@[283; 292) "\n " |
127 | COMMA@[293; 294) "," | 127 | R_CURLY@[292; 293) "}" |
128 | WHITESPACE@[294; 299) "\n " | 128 | COMMA@[293; 294) "," |
129 | R_CURLY@[299; 300) "}" | 129 | WHITESPACE@[294; 299) "\n " |
130 | WHITESPACE@[300; 306) "\n\n " | 130 | R_CURLY@[299; 300) "}" |
131 | EXPR_STMT@[306; 459) | 131 | WHITESPACE@[300; 306) "\n\n " |
132 | BLOCK_EXPR@[306; 459) | 132 | EXPR_STMT@[306; 459) |
133 | BLOCK@[306; 459) | 133 | BLOCK_EXPR@[306; 459) |
134 | L_CURLY@[306; 307) "{" | 134 | BLOCK@[306; 459) |
135 | WHITESPACE@[307; 316) "\n " | 135 | L_CURLY@[306; 307) "{" |
136 | ENUM_DEF@[316; 453) | 136 | WHITESPACE@[307; 316) "\n " |
137 | COMMENT@[316; 329) "// fail again" | 137 | ENUM_DEF@[316; 453) |
138 | WHITESPACE@[329; 338) "\n " | 138 | COMMENT@[316; 329) "// fail again" |
139 | ENUM_KW@[338; 342) "enum" | 139 | WHITESPACE@[329; 338) "\n " |
140 | WHITESPACE@[342; 343) " " | 140 | ENUM_KW@[338; 342) "enum" |
141 | NAME@[343; 348) | 141 | WHITESPACE@[342; 343) " " |
142 | IDENT@[343; 348) "Test4" | 142 | NAME@[343; 348) |
143 | WHITESPACE@[348; 349) " " | 143 | IDENT@[343; 348) "Test4" |
144 | ENUM_VARIANT_LIST@[349; 453) | 144 | WHITESPACE@[348; 349) " " |
145 | L_CURLY@[349; 350) "{" | 145 | ENUM_VARIANT_LIST@[349; 453) |
146 | WHITESPACE@[350; 363) "\n " | 146 | L_CURLY@[349; 350) "{" |
147 | ENUM_VARIANT@[363; 372) | 147 | WHITESPACE@[350; 363) "\n " |
148 | NAME@[363; 367) | 148 | ENUM_VARIANT@[363; 372) |
149 | IDENT@[363; 367) "Nope" | 149 | NAME@[363; 367) |
150 | TUPLE_FIELD_DEF_LIST@[367; 372) | 150 | IDENT@[363; 367) "Nope" |
151 | L_PAREN@[367; 368) "(" | 151 | TUPLE_FIELD_DEF_LIST@[367; 372) |
152 | TUPLE_FIELD_DEF@[368; 371) | 152 | L_PAREN@[367; 368) "(" |
153 | PATH_TYPE@[368; 371) | 153 | TUPLE_FIELD_DEF@[368; 371) |
154 | PATH@[368; 371) | 154 | PATH_TYPE@[368; 371) |
155 | PATH_SEGMENT@[368; 371) | 155 | PATH@[368; 371) |
156 | NAME_REF@[368; 371) | 156 | PATH_SEGMENT@[368; 371) |
157 | IDENT@[368; 371) "i32" | 157 | NAME_REF@[368; 371) |
158 | WHITESPACE@[371; 372) " " | 158 | IDENT@[368; 371) "i32" |
159 | ERROR@[372; 372) | 159 | WHITESPACE@[371; 372) " " |
160 | ERROR@[372; 374) | 160 | ERROR@[372; 372) |
161 | L_CURLY@[372; 373) "{" | 161 | ERROR@[372; 374) |
162 | R_CURLY@[373; 374) "}" | 162 | L_CURLY@[372; 373) "{" |
163 | ERROR@[374; 375) | 163 | R_CURLY@[373; 374) "}" |
164 | R_PAREN@[374; 375) ")" | 164 | ERROR@[374; 375) |
165 | WHITESPACE@[375; 376) " " | 165 | R_PAREN@[374; 375) ")" |
166 | COMMENT@[376; 396) "//~ ERROR: found `{`" | 166 | WHITESPACE@[375; 376) " " |
167 | WHITESPACE@[396; 422) "\n ..." | 167 | COMMENT@[376; 396) "//~ ERROR: found `{`" |
168 | COMMENT@[422; 443) "//~^ ERROR: found `{`" | 168 | WHITESPACE@[396; 422) "\n ..." |
169 | WHITESPACE@[443; 452) "\n " | 169 | COMMENT@[422; 443) "//~^ ERROR: found `{`" |
170 | R_CURLY@[452; 453) "}" | 170 | WHITESPACE@[443; 452) "\n " |
171 | WHITESPACE@[453; 458) "\n " | 171 | R_CURLY@[452; 453) "}" |
172 | R_CURLY@[458; 459) "}" | 172 | WHITESPACE@[453; 458) "\n " |
173 | WHITESPACE@[459; 464) "\n " | 173 | R_CURLY@[458; 459) "}" |
174 | COMMENT@[464; 486) "// still recover later" | 174 | WHITESPACE@[459; 464) "\n " |
175 | WHITESPACE@[486; 491) "\n " | 175 | COMMENT@[464; 486) "// still recover later" |
176 | LET_STMT@[491; 510) | 176 | WHITESPACE@[486; 491) "\n " |
177 | LET_KW@[491; 494) "let" | 177 | LET_STMT@[491; 510) |
178 | WHITESPACE@[494; 495) " " | 178 | LET_KW@[491; 494) "let" |
179 | BIND_PAT@[495; 505) | 179 | WHITESPACE@[494; 495) " " |
180 | NAME@[495; 505) | 180 | BIND_PAT@[495; 505) |
181 | IDENT@[495; 505) "bad_syntax" | 181 | NAME@[495; 505) |
182 | WHITESPACE@[505; 506) " " | 182 | IDENT@[495; 505) "bad_syntax" |
183 | EQ@[506; 507) "=" | 183 | WHITESPACE@[505; 506) " " |
184 | WHITESPACE@[507; 508) " " | 184 | EQ@[506; 507) "=" |
185 | ERROR@[508; 509) | 185 | WHITESPACE@[507; 508) " " |
186 | UNDERSCORE@[508; 509) "_" | 186 | ERROR@[508; 509) |
187 | SEMI@[509; 510) ";" | 187 | UNDERSCORE@[508; 509) "_" |
188 | WHITESPACE@[510; 511) " " | 188 | SEMI@[509; 510) ";" |
189 | COMMENT@[511; 572) "//~ ERROR: expected e ..." | 189 | WHITESPACE@[510; 511) " " |
190 | WHITESPACE@[572; 573) "\n" | 190 | COMMENT@[511; 572) "//~ ERROR: expected e ..." |
191 | R_CURLY@[573; 574) "}" | 191 | WHITESPACE@[572; 573) "\n" |
192 | R_CURLY@[573; 574) "}" | ||
192 | WHITESPACE@[574; 575) "\n" | 193 | WHITESPACE@[574; 575) "\n" |
193 | error 95: expected type | 194 | error 95: expected type |
194 | error 95: expected COMMA | 195 | error 95: expected COMMA |
diff --git a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.txt b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.txt index 061e6fb31..9298b45a4 100644 --- a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.txt +++ b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.txt | |||
@@ -20,9 +20,10 @@ SOURCE_FILE@[0; 30) | |||
20 | LIFETIME@[23; 25) "\'a" | 20 | LIFETIME@[23; 25) "\'a" |
21 | R_ANGLE@[25; 26) ">" | 21 | R_ANGLE@[25; 26) ">" |
22 | WHITESPACE@[26; 27) "\n" | 22 | WHITESPACE@[26; 27) "\n" |
23 | BLOCK@[27; 29) | 23 | BLOCK_EXPR@[27; 29) |
24 | L_CURLY@[27; 28) "{" | 24 | BLOCK@[27; 29) |
25 | R_CURLY@[28; 29) "}" | 25 | L_CURLY@[27; 28) "{" |
26 | R_CURLY@[28; 29) "}" | ||
26 | WHITESPACE@[29; 30) "\n" | 27 | WHITESPACE@[29; 30) "\n" |
27 | error 26: expected a path | 28 | error 26: expected a path |
28 | error 26: expected colon | 29 | error 26: expected colon |
diff --git a/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt b/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt index 98bc562a3..73d322c48 100644 --- a/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt +++ b/crates/ra_syntax/test_data/parser/err/0028_macro_2.0.txt | |||
@@ -73,188 +73,189 @@ SOURCE_FILE@[0; 349) | |||
73 | L_PAREN@[125; 126) "(" | 73 | L_PAREN@[125; 126) "(" |
74 | R_PAREN@[126; 127) ")" | 74 | R_PAREN@[126; 127) ")" |
75 | WHITESPACE@[127; 128) " " | 75 | WHITESPACE@[127; 128) " " |
76 | BLOCK@[128; 348) | 76 | BLOCK_EXPR@[128; 348) |
77 | L_CURLY@[128; 129) "{" | 77 | BLOCK@[128; 348) |
78 | WHITESPACE@[129; 134) "\n " | 78 | L_CURLY@[128; 129) "{" |
79 | EXPR_STMT@[134; 139) | 79 | WHITESPACE@[129; 134) "\n " |
80 | PATH_EXPR@[134; 139) | 80 | EXPR_STMT@[134; 139) |
81 | PATH@[134; 139) | 81 | PATH_EXPR@[134; 139) |
82 | PATH_SEGMENT@[134; 139) | 82 | PATH@[134; 139) |
83 | NAME_REF@[134; 139) | 83 | PATH_SEGMENT@[134; 139) |
84 | IDENT@[134; 139) "macro" | 84 | NAME_REF@[134; 139) |
85 | WHITESPACE@[139; 140) " " | 85 | IDENT@[134; 139) "macro" |
86 | EXPR_STMT@[140; 154) | 86 | WHITESPACE@[139; 140) " " |
87 | CALL_EXPR@[140; 154) | 87 | EXPR_STMT@[140; 154) |
88 | PATH_EXPR@[140; 150) | 88 | CALL_EXPR@[140; 154) |
89 | PATH@[140; 150) | 89 | PATH_EXPR@[140; 150) |
90 | PATH_SEGMENT@[140; 150) | 90 | PATH@[140; 150) |
91 | NAME_REF@[140; 150) | 91 | PATH_SEGMENT@[140; 150) |
92 | IDENT@[140; 150) "test_merge" | 92 | NAME_REF@[140; 150) |
93 | ARG_LIST@[150; 154) | 93 | IDENT@[140; 150) "test_merge" |
94 | L_PAREN@[150; 151) "(" | 94 | ARG_LIST@[150; 154) |
95 | ARRAY_EXPR@[151; 154) | 95 | L_PAREN@[150; 151) "(" |
96 | L_BRACK@[151; 152) "[" | 96 | ARRAY_EXPR@[151; 154) |
97 | ERROR@[152; 153) | 97 | L_BRACK@[151; 152) "[" |
98 | DOLLAR@[152; 153) "$" | 98 | ERROR@[152; 153) |
99 | PAREN_EXPR@[153; 154) | 99 | DOLLAR@[152; 153) "$" |
100 | L_PAREN@[153; 154) "(" | 100 | PAREN_EXPR@[153; 154) |
101 | EXPR_STMT@[154; 155) | 101 | L_PAREN@[153; 154) "(" |
102 | ERROR@[154; 155) | 102 | EXPR_STMT@[154; 155) |
103 | DOLLAR@[154; 155) "$" | 103 | ERROR@[154; 155) |
104 | EXPR_STMT@[155; 160) | 104 | DOLLAR@[154; 155) "$" |
105 | PATH_EXPR@[155; 160) | 105 | EXPR_STMT@[155; 160) |
106 | PATH@[155; 160) | 106 | PATH_EXPR@[155; 160) |
107 | PATH_SEGMENT@[155; 160) | 107 | PATH@[155; 160) |
108 | NAME_REF@[155; 160) | 108 | PATH_SEGMENT@[155; 160) |
109 | IDENT@[155; 160) "input" | 109 | NAME_REF@[155; 160) |
110 | EXPR_STMT@[160; 161) | 110 | IDENT@[155; 160) "input" |
111 | ERROR@[160; 161) | 111 | EXPR_STMT@[160; 161) |
112 | COLON@[160; 161) ":" | 112 | ERROR@[160; 161) |
113 | EXPR_STMT@[161; 165) | 113 | COLON@[160; 161) ":" |
114 | PATH_EXPR@[161; 165) | 114 | EXPR_STMT@[161; 165) |
115 | PATH@[161; 165) | 115 | PATH_EXPR@[161; 165) |
116 | PATH_SEGMENT@[161; 165) | 116 | PATH@[161; 165) |
117 | NAME_REF@[161; 165) | 117 | PATH_SEGMENT@[161; 165) |
118 | IDENT@[161; 165) "expr" | 118 | NAME_REF@[161; 165) |
119 | EXPR_STMT@[165; 166) | 119 | IDENT@[161; 165) "expr" |
120 | ERROR@[165; 166) | 120 | EXPR_STMT@[165; 166) |
121 | R_PAREN@[165; 166) ")" | 121 | ERROR@[165; 166) |
122 | EXPR_STMT@[166; 167) | 122 | R_PAREN@[165; 166) ")" |
123 | ERROR@[166; 167) | 123 | EXPR_STMT@[166; 167) |
124 | COMMA@[166; 167) "," | 124 | ERROR@[166; 167) |
125 | EXPR_STMT@[167; 170) | 125 | COMMA@[166; 167) "," |
126 | PREFIX_EXPR@[167; 170) | 126 | EXPR_STMT@[167; 170) |
127 | STAR@[167; 168) "*" | 127 | PREFIX_EXPR@[167; 170) |
128 | WHITESPACE@[168; 169) " " | 128 | STAR@[167; 168) "*" |
129 | ERROR@[169; 170) | 129 | WHITESPACE@[168; 169) " " |
130 | DOLLAR@[169; 170) "$" | 130 | ERROR@[169; 170) |
131 | EXPR_STMT@[170; 171) | 131 | DOLLAR@[169; 170) "$" |
132 | PAREN_EXPR@[170; 171) | 132 | EXPR_STMT@[170; 171) |
133 | L_PAREN@[170; 171) "(" | 133 | PAREN_EXPR@[170; 171) |
134 | EXPR_STMT@[171; 172) | 134 | L_PAREN@[170; 171) "(" |
135 | ERROR@[171; 172) | 135 | EXPR_STMT@[171; 172) |
136 | COMMA@[171; 172) "," | 136 | ERROR@[171; 172) |
137 | EXPR_STMT@[172; 173) | 137 | COMMA@[171; 172) "," |
138 | ERROR@[172; 173) | 138 | EXPR_STMT@[172; 173) |
139 | R_PAREN@[172; 173) ")" | 139 | ERROR@[172; 173) |
140 | EXPR_STMT@[173; 175) | 140 | R_PAREN@[172; 173) ")" |
141 | PREFIX_EXPR@[173; 175) | 141 | EXPR_STMT@[173; 175) |
142 | STAR@[173; 174) "*" | 142 | PREFIX_EXPR@[173; 175) |
143 | ERROR@[174; 175) | 143 | STAR@[173; 174) "*" |
144 | R_BRACK@[174; 175) "]" | 144 | ERROR@[174; 175) |
145 | EXPR_STMT@[175; 176) | 145 | R_BRACK@[174; 175) "]" |
146 | ERROR@[175; 176) | 146 | EXPR_STMT@[175; 176) |
147 | COMMA@[175; 176) "," | 147 | ERROR@[175; 176) |
148 | WHITESPACE@[176; 177) " " | 148 | COMMA@[175; 176) "," |
149 | EXPR_STMT@[177; 180) | 149 | WHITESPACE@[176; 177) " " |
150 | ARRAY_EXPR@[177; 180) | 150 | EXPR_STMT@[177; 180) |
151 | L_BRACK@[177; 178) "[" | 151 | ARRAY_EXPR@[177; 180) |
152 | ERROR@[178; 179) | 152 | L_BRACK@[177; 178) "[" |
153 | DOLLAR@[178; 179) "$" | 153 | ERROR@[178; 179) |
154 | PAREN_EXPR@[179; 180) | 154 | DOLLAR@[178; 179) "$" |
155 | L_PAREN@[179; 180) "(" | 155 | PAREN_EXPR@[179; 180) |
156 | EXPR_STMT@[180; 181) | 156 | L_PAREN@[179; 180) "(" |
157 | ERROR@[180; 181) | 157 | EXPR_STMT@[180; 181) |
158 | DOLLAR@[180; 181) "$" | 158 | ERROR@[180; 181) |
159 | EXPR_STMT@[181; 187) | 159 | DOLLAR@[180; 181) "$" |
160 | PATH_EXPR@[181; 187) | 160 | EXPR_STMT@[181; 187) |
161 | PATH@[181; 187) | 161 | PATH_EXPR@[181; 187) |
162 | PATH_SEGMENT@[181; 187) | 162 | PATH@[181; 187) |
163 | NAME_REF@[181; 187) | 163 | PATH_SEGMENT@[181; 187) |
164 | IDENT@[181; 187) "output" | 164 | NAME_REF@[181; 187) |
165 | EXPR_STMT@[187; 188) | 165 | IDENT@[181; 187) "output" |
166 | ERROR@[187; 188) | 166 | EXPR_STMT@[187; 188) |
167 | COLON@[187; 188) ":" | 167 | ERROR@[187; 188) |
168 | EXPR_STMT@[188; 192) | 168 | COLON@[187; 188) ":" |
169 | PATH_EXPR@[188; 192) | 169 | EXPR_STMT@[188; 192) |
170 | PATH@[188; 192) | 170 | PATH_EXPR@[188; 192) |
171 | PATH_SEGMENT@[188; 192) | 171 | PATH@[188; 192) |
172 | NAME_REF@[188; 192) | 172 | PATH_SEGMENT@[188; 192) |
173 | IDENT@[188; 192) "expr" | 173 | NAME_REF@[188; 192) |
174 | EXPR_STMT@[192; 193) | 174 | IDENT@[188; 192) "expr" |
175 | ERROR@[192; 193) | 175 | EXPR_STMT@[192; 193) |
176 | R_PAREN@[192; 193) ")" | 176 | ERROR@[192; 193) |
177 | EXPR_STMT@[193; 194) | 177 | R_PAREN@[192; 193) ")" |
178 | ERROR@[193; 194) | 178 | EXPR_STMT@[193; 194) |
179 | COMMA@[193; 194) "," | 179 | ERROR@[193; 194) |
180 | EXPR_STMT@[194; 197) | 180 | COMMA@[193; 194) "," |
181 | PREFIX_EXPR@[194; 197) | 181 | EXPR_STMT@[194; 197) |
182 | STAR@[194; 195) "*" | 182 | PREFIX_EXPR@[194; 197) |
183 | WHITESPACE@[195; 196) " " | 183 | STAR@[194; 195) "*" |
184 | ERROR@[196; 197) | 184 | WHITESPACE@[195; 196) " " |
185 | DOLLAR@[196; 197) "$" | 185 | ERROR@[196; 197) |
186 | EXPR_STMT@[197; 198) | 186 | DOLLAR@[196; 197) "$" |
187 | PAREN_EXPR@[197; 198) | 187 | EXPR_STMT@[197; 198) |
188 | L_PAREN@[197; 198) "(" | 188 | PAREN_EXPR@[197; 198) |
189 | EXPR_STMT@[198; 199) | 189 | L_PAREN@[197; 198) "(" |
190 | ERROR@[198; 199) | 190 | EXPR_STMT@[198; 199) |
191 | COMMA@[198; 199) "," | 191 | ERROR@[198; 199) |
192 | EXPR_STMT@[199; 200) | 192 | COMMA@[198; 199) "," |
193 | ERROR@[199; 200) | 193 | EXPR_STMT@[199; 200) |
194 | R_PAREN@[199; 200) ")" | 194 | ERROR@[199; 200) |
195 | EXPR_STMT@[200; 202) | 195 | R_PAREN@[199; 200) ")" |
196 | PREFIX_EXPR@[200; 202) | 196 | EXPR_STMT@[200; 202) |
197 | STAR@[200; 201) "*" | 197 | PREFIX_EXPR@[200; 202) |
198 | ERROR@[201; 202) | 198 | STAR@[200; 201) "*" |
199 | R_BRACK@[201; 202) "]" | 199 | ERROR@[201; 202) |
200 | EXPR_STMT@[202; 203) | 200 | R_BRACK@[201; 202) "]" |
201 | ERROR@[202; 203) | 201 | EXPR_STMT@[202; 203) |
202 | R_PAREN@[202; 203) ")" | 202 | ERROR@[202; 203) |
203 | WHITESPACE@[203; 204) " " | 203 | R_PAREN@[202; 203) ")" |
204 | BLOCK_EXPR@[204; 346) | 204 | WHITESPACE@[203; 204) " " |
205 | BLOCK@[204; 346) | 205 | BLOCK_EXPR@[204; 346) |
206 | L_CURLY@[204; 205) "{" | 206 | BLOCK@[204; 346) |
207 | WHITESPACE@[205; 214) "\n " | 207 | L_CURLY@[204; 205) "{" |
208 | EXPR_STMT@[214; 340) | 208 | WHITESPACE@[205; 214) "\n " |
209 | MACRO_CALL@[214; 339) | 209 | EXPR_STMT@[214; 340) |
210 | PATH@[214; 223) | 210 | MACRO_CALL@[214; 339) |
211 | PATH_SEGMENT@[214; 223) | 211 | PATH@[214; 223) |
212 | NAME_REF@[214; 223) | 212 | PATH_SEGMENT@[214; 223) |
213 | IDENT@[214; 223) "assert_eq" | 213 | NAME_REF@[214; 223) |
214 | EXCL@[223; 224) "!" | 214 | IDENT@[214; 223) "assert_eq" |
215 | TOKEN_TREE@[224; 339) | 215 | EXCL@[223; 224) "!" |
216 | L_PAREN@[224; 225) "(" | 216 | TOKEN_TREE@[224; 339) |
217 | WHITESPACE@[225; 238) "\n " | 217 | L_PAREN@[224; 225) "(" |
218 | IDENT@[238; 253) "merge_use_trees" | 218 | WHITESPACE@[225; 238) "\n " |
219 | TOKEN_TREE@[253; 284) | 219 | IDENT@[238; 253) "merge_use_trees" |
220 | L_PAREN@[253; 254) "(" | 220 | TOKEN_TREE@[253; 284) |
221 | IDENT@[254; 269) "parse_use_trees" | 221 | L_PAREN@[253; 254) "(" |
222 | EXCL@[269; 270) "!" | 222 | IDENT@[254; 269) "parse_use_trees" |
223 | TOKEN_TREE@[270; 283) | 223 | EXCL@[269; 270) "!" |
224 | L_PAREN@[270; 271) "(" | 224 | TOKEN_TREE@[270; 283) |
225 | DOLLAR@[271; 272) "$" | 225 | L_PAREN@[270; 271) "(" |
226 | TOKEN_TREE@[272; 281) | 226 | DOLLAR@[271; 272) "$" |
227 | L_PAREN@[272; 273) "(" | 227 | TOKEN_TREE@[272; 281) |
228 | DOLLAR@[273; 274) "$" | 228 | L_PAREN@[272; 273) "(" |
229 | IDENT@[274; 279) "input" | 229 | DOLLAR@[273; 274) "$" |
230 | COMMA@[279; 280) "," | 230 | IDENT@[274; 279) "input" |
231 | R_PAREN@[280; 281) ")" | 231 | COMMA@[279; 280) "," |
232 | STAR@[281; 282) "*" | 232 | R_PAREN@[280; 281) ")" |
233 | R_PAREN@[282; 283) ")" | 233 | STAR@[281; 282) "*" |
234 | R_PAREN@[283; 284) ")" | 234 | R_PAREN@[282; 283) ")" |
235 | COMMA@[284; 285) "," | 235 | R_PAREN@[283; 284) ")" |
236 | WHITESPACE@[285; 298) "\n " | 236 | COMMA@[284; 285) "," |
237 | IDENT@[298; 313) "parse_use_trees" | 237 | WHITESPACE@[285; 298) "\n " |
238 | EXCL@[313; 314) "!" | 238 | IDENT@[298; 313) "parse_use_trees" |
239 | TOKEN_TREE@[314; 328) | 239 | EXCL@[313; 314) "!" |
240 | L_PAREN@[314; 315) "(" | 240 | TOKEN_TREE@[314; 328) |
241 | DOLLAR@[315; 316) "$" | 241 | L_PAREN@[314; 315) "(" |
242 | TOKEN_TREE@[316; 326) | 242 | DOLLAR@[315; 316) "$" |
243 | L_PAREN@[316; 317) "(" | 243 | TOKEN_TREE@[316; 326) |
244 | DOLLAR@[317; 318) "$" | 244 | L_PAREN@[316; 317) "(" |
245 | IDENT@[318; 324) "output" | 245 | DOLLAR@[317; 318) "$" |
246 | COMMA@[324; 325) "," | 246 | IDENT@[318; 324) "output" |
247 | R_PAREN@[325; 326) ")" | 247 | COMMA@[324; 325) "," |
248 | STAR@[326; 327) "*" | 248 | R_PAREN@[325; 326) ")" |
249 | R_PAREN@[327; 328) ")" | 249 | STAR@[326; 327) "*" |
250 | COMMA@[328; 329) "," | 250 | R_PAREN@[327; 328) ")" |
251 | WHITESPACE@[329; 338) "\n " | 251 | COMMA@[328; 329) "," |
252 | R_PAREN@[338; 339) ")" | 252 | WHITESPACE@[329; 338) "\n " |
253 | SEMI@[339; 340) ";" | 253 | R_PAREN@[338; 339) ")" |
254 | WHITESPACE@[340; 345) "\n " | 254 | SEMI@[339; 340) ";" |
255 | R_CURLY@[345; 346) "}" | 255 | WHITESPACE@[340; 345) "\n " |
256 | WHITESPACE@[346; 347) "\n" | 256 | R_CURLY@[345; 346) "}" |
257 | R_CURLY@[347; 348) "}" | 257 | WHITESPACE@[346; 347) "\n" |
258 | R_CURLY@[347; 348) "}" | ||
258 | WHITESPACE@[348; 349) "\n" | 259 | WHITESPACE@[348; 349) "\n" |
259 | error 5: expected EXCL | 260 | error 5: expected EXCL |
260 | error 41: expected SEMI | 261 | error 41: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/err/0029_field_completion.txt b/crates/ra_syntax/test_data/parser/err/0029_field_completion.txt index fb50a12fc..e3e1282ec 100644 --- a/crates/ra_syntax/test_data/parser/err/0029_field_completion.txt +++ b/crates/ra_syntax/test_data/parser/err/0029_field_completion.txt | |||
@@ -19,17 +19,18 @@ SOURCE_FILE@[0; 24) | |||
19 | IDENT@[10; 11) "A" | 19 | IDENT@[10; 11) "A" |
20 | R_PAREN@[11; 12) ")" | 20 | R_PAREN@[11; 12) ")" |
21 | WHITESPACE@[12; 13) " " | 21 | WHITESPACE@[12; 13) " " |
22 | BLOCK@[13; 23) | 22 | BLOCK_EXPR@[13; 23) |
23 | L_CURLY@[13; 14) "{" | 23 | BLOCK@[13; 23) |
24 | WHITESPACE@[14; 19) "\n " | 24 | L_CURLY@[13; 14) "{" |
25 | FIELD_EXPR@[19; 21) | 25 | WHITESPACE@[14; 19) "\n " |
26 | PATH_EXPR@[19; 20) | 26 | FIELD_EXPR@[19; 21) |
27 | PATH@[19; 20) | 27 | PATH_EXPR@[19; 20) |
28 | PATH_SEGMENT@[19; 20) | 28 | PATH@[19; 20) |
29 | NAME_REF@[19; 20) | 29 | PATH_SEGMENT@[19; 20) |
30 | IDENT@[19; 20) "a" | 30 | NAME_REF@[19; 20) |
31 | DOT@[20; 21) "." | 31 | IDENT@[19; 20) "a" |
32 | WHITESPACE@[21; 22) "\n" | 32 | DOT@[20; 21) "." |
33 | R_CURLY@[22; 23) "}" | 33 | WHITESPACE@[21; 22) "\n" |
34 | R_CURLY@[22; 23) "}" | ||
34 | WHITESPACE@[23; 24) "\n" | 35 | WHITESPACE@[23; 24) "\n" |
35 | error 21: expected field name or number | 36 | error 21: expected field name or number |
diff --git a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.txt b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.txt index c205cf147..f67325b76 100644 --- a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.txt +++ b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.txt | |||
@@ -8,105 +8,108 @@ SOURCE_FILE@[0; 350) | |||
8 | L_PAREN@[8; 9) "(" | 8 | L_PAREN@[8; 9) "(" |
9 | R_PAREN@[9; 10) ")" | 9 | R_PAREN@[9; 10) ")" |
10 | WHITESPACE@[10; 11) " " | 10 | WHITESPACE@[10; 11) " " |
11 | BLOCK@[11; 349) | 11 | BLOCK_EXPR@[11; 349) |
12 | L_CURLY@[11; 12) "{" | 12 | BLOCK@[11; 349) |
13 | WHITESPACE@[12; 17) "\n " | 13 | L_CURLY@[11; 12) "{" |
14 | LET_STMT@[17; 129) | 14 | WHITESPACE@[12; 17) "\n " |
15 | LET_KW@[17; 20) "let" | 15 | LET_STMT@[17; 129) |
16 | WHITESPACE@[20; 21) " " | 16 | LET_KW@[17; 20) "let" |
17 | BIND_PAT@[21; 26) | 17 | WHITESPACE@[20; 21) " " |
18 | NAME@[21; 26) | 18 | BIND_PAT@[21; 26) |
19 | IDENT@[21; 26) "inner" | 19 | NAME@[21; 26) |
20 | WHITESPACE@[26; 27) " " | 20 | IDENT@[21; 26) "inner" |
21 | EQ@[27; 28) "=" | 21 | WHITESPACE@[26; 27) " " |
22 | WHITESPACE@[28; 29) " " | 22 | EQ@[27; 28) "=" |
23 | BLOCK_EXPR@[29; 128) | 23 | WHITESPACE@[28; 29) " " |
24 | BLOCK@[29; 128) | 24 | BLOCK_EXPR@[29; 128) |
25 | L_CURLY@[29; 30) "{" | 25 | BLOCK@[29; 128) |
26 | WHITESPACE@[30; 39) "\n " | 26 | L_CURLY@[29; 30) "{" |
27 | ATTR@[39; 83) | 27 | WHITESPACE@[30; 39) "\n " |
28 | POUND@[39; 40) "#" | 28 | ATTR@[39; 83) |
29 | EXCL@[40; 41) "!" | 29 | POUND@[39; 40) "#" |
30 | TOKEN_TREE@[41; 83) | 30 | EXCL@[40; 41) "!" |
31 | L_BRACK@[41; 42) "[" | 31 | TOKEN_TREE@[41; 83) |
32 | IDENT@[42; 45) "doc" | 32 | L_BRACK@[41; 42) "[" |
33 | TOKEN_TREE@[45; 82) | 33 | IDENT@[42; 45) "doc" |
34 | L_PAREN@[45; 46) "(" | 34 | TOKEN_TREE@[45; 82) |
35 | STRING@[46; 81) "\"Inner attributes not ..." | 35 | L_PAREN@[45; 46) "(" |
36 | R_PAREN@[81; 82) ")" | 36 | STRING@[46; 81) "\"Inner attributes not ..." |
37 | R_BRACK@[82; 83) "]" | 37 | R_PAREN@[81; 82) ")" |
38 | WHITESPACE@[83; 92) "\n " | 38 | R_BRACK@[82; 83) "]" |
39 | COMMENT@[92; 122) "//! Nor are ModuleDoc ..." | 39 | WHITESPACE@[83; 92) "\n " |
40 | WHITESPACE@[122; 127) "\n " | 40 | COMMENT@[92; 122) "//! Nor are ModuleDoc ..." |
41 | R_CURLY@[127; 128) "}" | 41 | WHITESPACE@[122; 127) "\n " |
42 | SEMI@[128; 129) ";" | 42 | R_CURLY@[127; 128) "}" |
43 | WHITESPACE@[129; 134) "\n " | 43 | SEMI@[128; 129) ";" |
44 | EXPR_STMT@[134; 257) | 44 | WHITESPACE@[129; 134) "\n " |
45 | IF_EXPR@[134; 257) | 45 | EXPR_STMT@[134; 257) |
46 | IF_KW@[134; 136) "if" | 46 | IF_EXPR@[134; 257) |
47 | WHITESPACE@[136; 137) " " | 47 | IF_KW@[134; 136) "if" |
48 | CONDITION@[137; 141) | 48 | WHITESPACE@[136; 137) " " |
49 | LITERAL@[137; 141) | 49 | CONDITION@[137; 141) |
50 | TRUE_KW@[137; 141) "true" | 50 | LITERAL@[137; 141) |
51 | WHITESPACE@[141; 142) " " | 51 | TRUE_KW@[137; 141) "true" |
52 | BLOCK@[142; 257) | 52 | WHITESPACE@[141; 142) " " |
53 | L_CURLY@[142; 143) "{" | 53 | BLOCK_EXPR@[142; 257) |
54 | WHITESPACE@[143; 152) "\n " | 54 | BLOCK@[142; 257) |
55 | ATTR@[152; 171) | 55 | L_CURLY@[142; 143) "{" |
56 | POUND@[152; 153) "#" | 56 | WHITESPACE@[143; 152) "\n " |
57 | EXCL@[153; 154) "!" | 57 | ATTR@[152; 171) |
58 | TOKEN_TREE@[154; 171) | 58 | POUND@[152; 153) "#" |
59 | L_BRACK@[154; 155) "[" | 59 | EXCL@[153; 154) "!" |
60 | IDENT@[155; 158) "doc" | 60 | TOKEN_TREE@[154; 171) |
61 | TOKEN_TREE@[158; 170) | 61 | L_BRACK@[154; 155) "[" |
62 | L_PAREN@[158; 159) "(" | 62 | IDENT@[155; 158) "doc" |
63 | STRING@[159; 169) "\"Nor here\"" | 63 | TOKEN_TREE@[158; 170) |
64 | R_PAREN@[169; 170) ")" | 64 | L_PAREN@[158; 159) "(" |
65 | R_BRACK@[170; 171) "]" | 65 | STRING@[159; 169) "\"Nor here\"" |
66 | WHITESPACE@[171; 180) "\n " | 66 | R_PAREN@[169; 170) ")" |
67 | ATTR@[180; 212) | 67 | R_BRACK@[170; 171) "]" |
68 | POUND@[180; 181) "#" | 68 | WHITESPACE@[171; 180) "\n " |
69 | EXCL@[181; 182) "!" | 69 | ATTR@[180; 212) |
70 | TOKEN_TREE@[182; 212) | 70 | POUND@[180; 181) "#" |
71 | L_BRACK@[182; 183) "[" | 71 | EXCL@[181; 182) "!" |
72 | IDENT@[183; 186) "doc" | 72 | TOKEN_TREE@[182; 212) |
73 | TOKEN_TREE@[186; 211) | 73 | L_BRACK@[182; 183) "[" |
74 | L_PAREN@[186; 187) "(" | 74 | IDENT@[183; 186) "doc" |
75 | STRING@[187; 210) "\"We error on each attr\"" | 75 | TOKEN_TREE@[186; 211) |
76 | R_PAREN@[210; 211) ")" | 76 | L_PAREN@[186; 187) "(" |
77 | R_BRACK@[211; 212) "]" | 77 | STRING@[187; 210) "\"We error on each attr\"" |
78 | WHITESPACE@[212; 221) "\n " | 78 | R_PAREN@[210; 211) ")" |
79 | COMMENT@[221; 251) "//! Nor are ModuleDoc ..." | 79 | R_BRACK@[211; 212) "]" |
80 | WHITESPACE@[251; 256) "\n " | 80 | WHITESPACE@[212; 221) "\n " |
81 | R_CURLY@[256; 257) "}" | 81 | COMMENT@[221; 251) "//! Nor are ModuleDoc ..." |
82 | WHITESPACE@[257; 262) "\n " | 82 | WHITESPACE@[251; 256) "\n " |
83 | WHILE_EXPR@[262; 347) | 83 | R_CURLY@[256; 257) "}" |
84 | WHILE_KW@[262; 267) "while" | 84 | WHITESPACE@[257; 262) "\n " |
85 | WHITESPACE@[267; 268) " " | 85 | WHILE_EXPR@[262; 347) |
86 | CONDITION@[268; 272) | 86 | WHILE_KW@[262; 267) "while" |
87 | LITERAL@[268; 272) | 87 | WHITESPACE@[267; 268) " " |
88 | TRUE_KW@[268; 272) "true" | 88 | CONDITION@[268; 272) |
89 | WHITESPACE@[272; 273) " " | 89 | LITERAL@[268; 272) |
90 | BLOCK@[273; 347) | 90 | TRUE_KW@[268; 272) "true" |
91 | L_CURLY@[273; 274) "{" | 91 | WHITESPACE@[272; 273) " " |
92 | WHITESPACE@[274; 283) "\n " | 92 | BLOCK_EXPR@[273; 347) |
93 | ATTR@[283; 302) | 93 | BLOCK@[273; 347) |
94 | POUND@[283; 284) "#" | 94 | L_CURLY@[273; 274) "{" |
95 | EXCL@[284; 285) "!" | 95 | WHITESPACE@[274; 283) "\n " |
96 | TOKEN_TREE@[285; 302) | 96 | ATTR@[283; 302) |
97 | L_BRACK@[285; 286) "[" | 97 | POUND@[283; 284) "#" |
98 | IDENT@[286; 289) "doc" | 98 | EXCL@[284; 285) "!" |
99 | TOKEN_TREE@[289; 301) | 99 | TOKEN_TREE@[285; 302) |
100 | L_PAREN@[289; 290) "(" | 100 | L_BRACK@[285; 286) "[" |
101 | STRING@[290; 300) "\"Nor here\"" | 101 | IDENT@[286; 289) "doc" |
102 | R_PAREN@[300; 301) ")" | 102 | TOKEN_TREE@[289; 301) |
103 | R_BRACK@[301; 302) "]" | 103 | L_PAREN@[289; 290) "(" |
104 | WHITESPACE@[302; 311) "\n " | 104 | STRING@[290; 300) "\"Nor here\"" |
105 | COMMENT@[311; 341) "//! Nor are ModuleDoc ..." | 105 | R_PAREN@[300; 301) ")" |
106 | WHITESPACE@[341; 346) "\n " | 106 | R_BRACK@[301; 302) "]" |
107 | R_CURLY@[346; 347) "}" | 107 | WHITESPACE@[302; 311) "\n " |
108 | WHITESPACE@[347; 348) "\n" | 108 | COMMENT@[311; 341) "//! Nor are ModuleDoc ..." |
109 | R_CURLY@[348; 349) "}" | 109 | WHITESPACE@[341; 346) "\n " |
110 | R_CURLY@[346; 347) "}" | ||
111 | WHITESPACE@[347; 348) "\n" | ||
112 | R_CURLY@[348; 349) "}" | ||
110 | WHITESPACE@[349; 350) "\n" | 113 | WHITESPACE@[349; 350) "\n" |
111 | error [39; 83): A block in this position cannot accept inner attributes | 114 | error [39; 83): A block in this position cannot accept inner attributes |
112 | error [152; 171): A block in this position cannot accept inner attributes | 115 | error [152; 171): A block in this position cannot accept inner attributes |
diff --git a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.txt b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.txt index 4e8c4143b..1344fcbc2 100644 --- a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.txt +++ b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.txt | |||
@@ -8,185 +8,186 @@ SOURCE_FILE@[0; 293) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 292) | 11 | BLOCK_EXPR@[9; 292) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 292) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 101) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_EXPR@[15; 101) | 15 | EXPR_STMT@[15; 101) |
16 | MATCH_KW@[15; 20) "match" | 16 | MATCH_EXPR@[15; 101) |
17 | WHITESPACE@[20; 21) " " | 17 | MATCH_KW@[15; 20) "match" |
18 | TUPLE_EXPR@[21; 23) | 18 | WHITESPACE@[20; 21) " " |
19 | L_PAREN@[21; 22) "(" | 19 | TUPLE_EXPR@[21; 23) |
20 | R_PAREN@[22; 23) ")" | 20 | L_PAREN@[21; 22) "(" |
21 | WHITESPACE@[23; 24) " " | 21 | R_PAREN@[22; 23) ")" |
22 | MATCH_ARM_LIST@[24; 101) | 22 | WHITESPACE@[23; 24) " " |
23 | L_CURLY@[24; 25) "{" | 23 | MATCH_ARM_LIST@[24; 101) |
24 | WHITESPACE@[25; 34) "\n " | 24 | L_CURLY@[24; 25) "{" |
25 | MATCH_ARM@[34; 41) | 25 | WHITESPACE@[25; 34) "\n " |
26 | PLACEHOLDER_PAT@[34; 35) | 26 | MATCH_ARM@[34; 41) |
27 | UNDERSCORE@[34; 35) "_" | 27 | PLACEHOLDER_PAT@[34; 35) |
28 | WHITESPACE@[35; 36) " " | 28 | UNDERSCORE@[34; 35) "_" |
29 | FAT_ARROW@[36; 38) "=>" | 29 | WHITESPACE@[35; 36) " " |
30 | WHITESPACE@[38; 39) " " | 30 | FAT_ARROW@[36; 38) "=>" |
31 | TUPLE_EXPR@[39; 41) | 31 | WHITESPACE@[38; 39) " " |
32 | L_PAREN@[39; 40) "(" | 32 | TUPLE_EXPR@[39; 41) |
33 | R_PAREN@[40; 41) ")" | 33 | L_PAREN@[39; 40) "(" |
34 | COMMA@[41; 42) "," | 34 | R_PAREN@[40; 41) ")" |
35 | WHITESPACE@[42; 51) "\n " | 35 | COMMA@[41; 42) "," |
36 | MATCH_ARM@[51; 78) | 36 | WHITESPACE@[42; 51) "\n " |
37 | ATTR@[51; 52) | 37 | MATCH_ARM@[51; 78) |
38 | POUND@[51; 52) "#" | 38 | ATTR@[51; 52) |
39 | ERROR@[52; 53) | 39 | POUND@[51; 52) "#" |
40 | EXCL@[52; 53) "!" | 40 | ERROR@[52; 53) |
41 | ARRAY_EXPR@[53; 78) | 41 | EXCL@[52; 53) "!" |
42 | L_BRACK@[53; 54) "[" | 42 | ARRAY_EXPR@[53; 78) |
43 | CALL_EXPR@[54; 77) | 43 | L_BRACK@[53; 54) "[" |
44 | PATH_EXPR@[54; 57) | 44 | CALL_EXPR@[54; 77) |
45 | PATH@[54; 57) | 45 | PATH_EXPR@[54; 57) |
46 | PATH_SEGMENT@[54; 57) | 46 | PATH@[54; 57) |
47 | NAME_REF@[54; 57) | 47 | PATH_SEGMENT@[54; 57) |
48 | IDENT@[54; 57) "doc" | 48 | NAME_REF@[54; 57) |
49 | ARG_LIST@[57; 77) | 49 | IDENT@[54; 57) "doc" |
50 | L_PAREN@[57; 58) "(" | 50 | ARG_LIST@[57; 77) |
51 | LITERAL@[58; 76) | 51 | L_PAREN@[57; 58) "(" |
52 | STRING@[58; 76) "\"Not allowed here\"" | 52 | LITERAL@[58; 76) |
53 | R_PAREN@[76; 77) ")" | 53 | STRING@[58; 76) "\"Not allowed here\"" |
54 | R_BRACK@[77; 78) "]" | 54 | R_PAREN@[76; 77) ")" |
55 | WHITESPACE@[78; 87) "\n " | 55 | R_BRACK@[77; 78) "]" |
56 | MATCH_ARM@[87; 94) | 56 | WHITESPACE@[78; 87) "\n " |
57 | PLACEHOLDER_PAT@[87; 88) | 57 | MATCH_ARM@[87; 94) |
58 | UNDERSCORE@[87; 88) "_" | 58 | PLACEHOLDER_PAT@[87; 88) |
59 | WHITESPACE@[88; 89) " " | 59 | UNDERSCORE@[87; 88) "_" |
60 | FAT_ARROW@[89; 91) "=>" | 60 | WHITESPACE@[88; 89) " " |
61 | WHITESPACE@[91; 92) " " | 61 | FAT_ARROW@[89; 91) "=>" |
62 | TUPLE_EXPR@[92; 94) | 62 | WHITESPACE@[91; 92) " " |
63 | L_PAREN@[92; 93) "(" | 63 | TUPLE_EXPR@[92; 94) |
64 | R_PAREN@[93; 94) ")" | 64 | L_PAREN@[92; 93) "(" |
65 | COMMA@[94; 95) "," | 65 | R_PAREN@[93; 94) ")" |
66 | WHITESPACE@[95; 100) "\n " | 66 | COMMA@[94; 95) "," |
67 | R_CURLY@[100; 101) "}" | 67 | WHITESPACE@[95; 100) "\n " |
68 | WHITESPACE@[101; 107) "\n\n " | 68 | R_CURLY@[100; 101) "}" |
69 | EXPR_STMT@[107; 185) | 69 | WHITESPACE@[101; 107) "\n\n " |
70 | MATCH_EXPR@[107; 185) | 70 | EXPR_STMT@[107; 185) |
71 | MATCH_KW@[107; 112) "match" | 71 | MATCH_EXPR@[107; 185) |
72 | WHITESPACE@[112; 113) " " | 72 | MATCH_KW@[107; 112) "match" |
73 | TUPLE_EXPR@[113; 115) | 73 | WHITESPACE@[112; 113) " " |
74 | L_PAREN@[113; 114) "(" | 74 | TUPLE_EXPR@[113; 115) |
75 | R_PAREN@[114; 115) ")" | 75 | L_PAREN@[113; 114) "(" |
76 | WHITESPACE@[115; 116) " " | 76 | R_PAREN@[114; 115) ")" |
77 | MATCH_ARM_LIST@[116; 185) | 77 | WHITESPACE@[115; 116) " " |
78 | L_CURLY@[116; 117) "{" | 78 | MATCH_ARM_LIST@[116; 185) |
79 | WHITESPACE@[117; 126) "\n " | 79 | L_CURLY@[116; 117) "{" |
80 | MATCH_ARM@[126; 133) | 80 | WHITESPACE@[117; 126) "\n " |
81 | PLACEHOLDER_PAT@[126; 127) | 81 | MATCH_ARM@[126; 133) |
82 | UNDERSCORE@[126; 127) "_" | 82 | PLACEHOLDER_PAT@[126; 127) |
83 | WHITESPACE@[127; 128) " " | 83 | UNDERSCORE@[126; 127) "_" |
84 | FAT_ARROW@[128; 130) "=>" | 84 | WHITESPACE@[127; 128) " " |
85 | WHITESPACE@[130; 131) " " | 85 | FAT_ARROW@[128; 130) "=>" |
86 | TUPLE_EXPR@[131; 133) | 86 | WHITESPACE@[130; 131) " " |
87 | L_PAREN@[131; 132) "(" | 87 | TUPLE_EXPR@[131; 133) |
88 | R_PAREN@[132; 133) ")" | 88 | L_PAREN@[131; 132) "(" |
89 | COMMA@[133; 134) "," | 89 | R_PAREN@[132; 133) ")" |
90 | WHITESPACE@[134; 143) "\n " | 90 | COMMA@[133; 134) "," |
91 | MATCH_ARM@[143; 150) | 91 | WHITESPACE@[134; 143) "\n " |
92 | PLACEHOLDER_PAT@[143; 144) | 92 | MATCH_ARM@[143; 150) |
93 | UNDERSCORE@[143; 144) "_" | 93 | PLACEHOLDER_PAT@[143; 144) |
94 | WHITESPACE@[144; 145) " " | 94 | UNDERSCORE@[143; 144) "_" |
95 | FAT_ARROW@[145; 147) "=>" | 95 | WHITESPACE@[144; 145) " " |
96 | WHITESPACE@[147; 148) " " | 96 | FAT_ARROW@[145; 147) "=>" |
97 | TUPLE_EXPR@[148; 150) | 97 | WHITESPACE@[147; 148) " " |
98 | L_PAREN@[148; 149) "(" | 98 | TUPLE_EXPR@[148; 150) |
99 | R_PAREN@[149; 150) ")" | 99 | L_PAREN@[148; 149) "(" |
100 | COMMA@[150; 151) "," | 100 | R_PAREN@[149; 150) ")" |
101 | WHITESPACE@[151; 160) "\n " | 101 | COMMA@[150; 151) "," |
102 | MATCH_ARM@[160; 179) | 102 | WHITESPACE@[151; 160) "\n " |
103 | ATTR@[160; 161) | 103 | MATCH_ARM@[160; 179) |
104 | POUND@[160; 161) "#" | 104 | ATTR@[160; 161) |
105 | ERROR@[161; 162) | 105 | POUND@[160; 161) "#" |
106 | EXCL@[161; 162) "!" | 106 | ERROR@[161; 162) |
107 | ARRAY_EXPR@[162; 179) | 107 | EXCL@[161; 162) "!" |
108 | L_BRACK@[162; 163) "[" | 108 | ARRAY_EXPR@[162; 179) |
109 | CALL_EXPR@[163; 178) | 109 | L_BRACK@[162; 163) "[" |
110 | PATH_EXPR@[163; 166) | 110 | CALL_EXPR@[163; 178) |
111 | PATH@[163; 166) | 111 | PATH_EXPR@[163; 166) |
112 | PATH_SEGMENT@[163; 166) | 112 | PATH@[163; 166) |
113 | NAME_REF@[163; 166) | 113 | PATH_SEGMENT@[163; 166) |
114 | IDENT@[163; 166) "doc" | 114 | NAME_REF@[163; 166) |
115 | ARG_LIST@[166; 178) | 115 | IDENT@[163; 166) "doc" |
116 | L_PAREN@[166; 167) "(" | 116 | ARG_LIST@[166; 178) |
117 | LITERAL@[167; 177) | 117 | L_PAREN@[166; 167) "(" |
118 | STRING@[167; 177) "\"Nor here\"" | 118 | LITERAL@[167; 177) |
119 | R_PAREN@[177; 178) ")" | 119 | STRING@[167; 177) "\"Nor here\"" |
120 | R_BRACK@[178; 179) "]" | 120 | R_PAREN@[177; 178) ")" |
121 | WHITESPACE@[179; 184) "\n " | 121 | R_BRACK@[178; 179) "]" |
122 | R_CURLY@[184; 185) "}" | 122 | WHITESPACE@[179; 184) "\n " |
123 | WHITESPACE@[185; 191) "\n\n " | 123 | R_CURLY@[184; 185) "}" |
124 | MATCH_EXPR@[191; 290) | 124 | WHITESPACE@[185; 191) "\n\n " |
125 | MATCH_KW@[191; 196) "match" | 125 | MATCH_EXPR@[191; 290) |
126 | WHITESPACE@[196; 197) " " | 126 | MATCH_KW@[191; 196) "match" |
127 | TUPLE_EXPR@[197; 199) | 127 | WHITESPACE@[196; 197) " " |
128 | L_PAREN@[197; 198) "(" | 128 | TUPLE_EXPR@[197; 199) |
129 | R_PAREN@[198; 199) ")" | 129 | L_PAREN@[197; 198) "(" |
130 | WHITESPACE@[199; 200) " " | 130 | R_PAREN@[198; 199) ")" |
131 | MATCH_ARM_LIST@[200; 290) | 131 | WHITESPACE@[199; 200) " " |
132 | L_CURLY@[200; 201) "{" | 132 | MATCH_ARM_LIST@[200; 290) |
133 | WHITESPACE@[201; 210) "\n " | 133 | L_CURLY@[200; 201) "{" |
134 | MATCH_ARM@[210; 250) | 134 | WHITESPACE@[201; 210) "\n " |
135 | ATTR@[210; 222) | 135 | MATCH_ARM@[210; 250) |
136 | POUND@[210; 211) "#" | 136 | ATTR@[210; 222) |
137 | TOKEN_TREE@[211; 222) | 137 | POUND@[210; 211) "#" |
138 | L_BRACK@[211; 212) "[" | 138 | TOKEN_TREE@[211; 222) |
139 | IDENT@[212; 215) "cfg" | 139 | L_BRACK@[211; 212) "[" |
140 | TOKEN_TREE@[215; 221) | 140 | IDENT@[212; 215) "cfg" |
141 | L_PAREN@[215; 216) "(" | 141 | TOKEN_TREE@[215; 221) |
142 | IDENT@[216; 220) "test" | 142 | L_PAREN@[215; 216) "(" |
143 | R_PAREN@[220; 221) ")" | 143 | IDENT@[216; 220) "test" |
144 | R_BRACK@[221; 222) "]" | 144 | R_PAREN@[220; 221) ")" |
145 | WHITESPACE@[222; 231) "\n " | 145 | R_BRACK@[221; 222) "]" |
146 | ATTR@[231; 232) | 146 | WHITESPACE@[222; 231) "\n " |
147 | POUND@[231; 232) "#" | 147 | ATTR@[231; 232) |
148 | ERROR@[232; 233) | 148 | POUND@[231; 232) "#" |
149 | EXCL@[232; 233) "!" | 149 | ERROR@[232; 233) |
150 | ARRAY_EXPR@[233; 250) | 150 | EXCL@[232; 233) "!" |
151 | L_BRACK@[233; 234) "[" | 151 | ARRAY_EXPR@[233; 250) |
152 | CALL_EXPR@[234; 249) | 152 | L_BRACK@[233; 234) "[" |
153 | PATH_EXPR@[234; 237) | 153 | CALL_EXPR@[234; 249) |
154 | PATH@[234; 237) | 154 | PATH_EXPR@[234; 237) |
155 | PATH_SEGMENT@[234; 237) | 155 | PATH@[234; 237) |
156 | NAME_REF@[234; 237) | 156 | PATH_SEGMENT@[234; 237) |
157 | IDENT@[234; 237) "doc" | 157 | NAME_REF@[234; 237) |
158 | ARG_LIST@[237; 249) | 158 | IDENT@[234; 237) "doc" |
159 | L_PAREN@[237; 238) "(" | 159 | ARG_LIST@[237; 249) |
160 | LITERAL@[238; 248) | 160 | L_PAREN@[237; 238) "(" |
161 | STRING@[238; 248) "\"Nor here\"" | 161 | LITERAL@[238; 248) |
162 | R_PAREN@[248; 249) ")" | 162 | STRING@[238; 248) "\"Nor here\"" |
163 | R_BRACK@[249; 250) "]" | 163 | R_PAREN@[248; 249) ")" |
164 | WHITESPACE@[250; 259) "\n " | 164 | R_BRACK@[249; 250) "]" |
165 | MATCH_ARM@[259; 266) | 165 | WHITESPACE@[250; 259) "\n " |
166 | PLACEHOLDER_PAT@[259; 260) | 166 | MATCH_ARM@[259; 266) |
167 | UNDERSCORE@[259; 260) "_" | 167 | PLACEHOLDER_PAT@[259; 260) |
168 | WHITESPACE@[260; 261) " " | 168 | UNDERSCORE@[259; 260) "_" |
169 | FAT_ARROW@[261; 263) "=>" | 169 | WHITESPACE@[260; 261) " " |
170 | WHITESPACE@[263; 264) " " | 170 | FAT_ARROW@[261; 263) "=>" |
171 | TUPLE_EXPR@[264; 266) | 171 | WHITESPACE@[263; 264) " " |
172 | L_PAREN@[264; 265) "(" | 172 | TUPLE_EXPR@[264; 266) |
173 | R_PAREN@[265; 266) ")" | 173 | L_PAREN@[264; 265) "(" |
174 | COMMA@[266; 267) "," | 174 | R_PAREN@[265; 266) ")" |
175 | WHITESPACE@[267; 276) "\n " | 175 | COMMA@[266; 267) "," |
176 | MATCH_ARM@[276; 283) | 176 | WHITESPACE@[267; 276) "\n " |
177 | PLACEHOLDER_PAT@[276; 277) | 177 | MATCH_ARM@[276; 283) |
178 | UNDERSCORE@[276; 277) "_" | 178 | PLACEHOLDER_PAT@[276; 277) |
179 | WHITESPACE@[277; 278) " " | 179 | UNDERSCORE@[276; 277) "_" |
180 | FAT_ARROW@[278; 280) "=>" | 180 | WHITESPACE@[277; 278) " " |
181 | WHITESPACE@[280; 281) " " | 181 | FAT_ARROW@[278; 280) "=>" |
182 | TUPLE_EXPR@[281; 283) | 182 | WHITESPACE@[280; 281) " " |
183 | L_PAREN@[281; 282) "(" | 183 | TUPLE_EXPR@[281; 283) |
184 | R_PAREN@[282; 283) ")" | 184 | L_PAREN@[281; 282) "(" |
185 | COMMA@[283; 284) "," | 185 | R_PAREN@[282; 283) ")" |
186 | WHITESPACE@[284; 289) "\n " | 186 | COMMA@[283; 284) "," |
187 | R_CURLY@[289; 290) "}" | 187 | WHITESPACE@[284; 289) "\n " |
188 | WHITESPACE@[290; 291) "\n" | 188 | R_CURLY@[289; 290) "}" |
189 | R_CURLY@[291; 292) "}" | 189 | WHITESPACE@[290; 291) "\n" |
190 | R_CURLY@[291; 292) "}" | ||
190 | WHITESPACE@[292; 293) "\n" | 191 | WHITESPACE@[292; 293) "\n" |
191 | error 52: expected `[` | 192 | error 52: expected `[` |
192 | error 52: expected pattern | 193 | error 52: expected pattern |
diff --git a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.txt b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.txt index e4f1f6337..b65cc3de3 100644 --- a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.txt +++ b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.txt | |||
@@ -8,56 +8,57 @@ SOURCE_FILE@[0; 89) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 88) | 11 | BLOCK_EXPR@[9; 88) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 88) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | MATCH_EXPR@[15; 86) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_KW@[15; 20) "match" | 15 | MATCH_EXPR@[15; 86) |
16 | WHITESPACE@[20; 21) " " | 16 | MATCH_KW@[15; 20) "match" |
17 | TUPLE_EXPR@[21; 23) | 17 | WHITESPACE@[20; 21) " " |
18 | L_PAREN@[21; 22) "(" | 18 | TUPLE_EXPR@[21; 23) |
19 | R_PAREN@[22; 23) ")" | 19 | L_PAREN@[21; 22) "(" |
20 | WHITESPACE@[23; 24) " " | 20 | R_PAREN@[22; 23) ")" |
21 | MATCH_ARM_LIST@[24; 86) | 21 | WHITESPACE@[23; 24) " " |
22 | L_CURLY@[24; 25) "{" | 22 | MATCH_ARM_LIST@[24; 86) |
23 | WHITESPACE@[25; 34) "\n " | 23 | L_CURLY@[24; 25) "{" |
24 | MATCH_ARM@[34; 41) | 24 | WHITESPACE@[25; 34) "\n " |
25 | PLACEHOLDER_PAT@[34; 35) | 25 | MATCH_ARM@[34; 41) |
26 | UNDERSCORE@[34; 35) "_" | 26 | PLACEHOLDER_PAT@[34; 35) |
27 | WHITESPACE@[35; 36) " " | 27 | UNDERSCORE@[34; 35) "_" |
28 | FAT_ARROW@[36; 38) "=>" | 28 | WHITESPACE@[35; 36) " " |
29 | WHITESPACE@[38; 39) " " | 29 | FAT_ARROW@[36; 38) "=>" |
30 | TUPLE_EXPR@[39; 41) | 30 | WHITESPACE@[38; 39) " " |
31 | L_PAREN@[39; 40) "(" | 31 | TUPLE_EXPR@[39; 41) |
32 | R_PAREN@[40; 41) ")" | 32 | L_PAREN@[39; 40) "(" |
33 | COMMA@[41; 42) "," | 33 | R_PAREN@[40; 41) ")" |
34 | WHITESPACE@[42; 51) "\n " | 34 | COMMA@[41; 42) "," |
35 | MATCH_ARM@[51; 58) | 35 | WHITESPACE@[42; 51) "\n " |
36 | PLACEHOLDER_PAT@[51; 52) | 36 | MATCH_ARM@[51; 58) |
37 | UNDERSCORE@[51; 52) "_" | 37 | PLACEHOLDER_PAT@[51; 52) |
38 | WHITESPACE@[52; 53) " " | 38 | UNDERSCORE@[51; 52) "_" |
39 | FAT_ARROW@[53; 55) "=>" | 39 | WHITESPACE@[52; 53) " " |
40 | WHITESPACE@[55; 56) " " | 40 | FAT_ARROW@[53; 55) "=>" |
41 | TUPLE_EXPR@[56; 58) | 41 | WHITESPACE@[55; 56) " " |
42 | L_PAREN@[56; 57) "(" | 42 | TUPLE_EXPR@[56; 58) |
43 | R_PAREN@[57; 58) ")" | 43 | L_PAREN@[56; 57) "(" |
44 | COMMA@[58; 59) "," | 44 | R_PAREN@[57; 58) ")" |
45 | WHITESPACE@[59; 68) "\n " | 45 | COMMA@[58; 59) "," |
46 | MATCH_ARM@[68; 80) | 46 | WHITESPACE@[59; 68) "\n " |
47 | ATTR@[68; 80) | 47 | MATCH_ARM@[68; 80) |
48 | POUND@[68; 69) "#" | 48 | ATTR@[68; 80) |
49 | TOKEN_TREE@[69; 80) | 49 | POUND@[68; 69) "#" |
50 | L_BRACK@[69; 70) "[" | 50 | TOKEN_TREE@[69; 80) |
51 | IDENT@[70; 73) "cfg" | 51 | L_BRACK@[69; 70) "[" |
52 | TOKEN_TREE@[73; 79) | 52 | IDENT@[70; 73) "cfg" |
53 | L_PAREN@[73; 74) "(" | 53 | TOKEN_TREE@[73; 79) |
54 | IDENT@[74; 78) "test" | 54 | L_PAREN@[73; 74) "(" |
55 | R_PAREN@[78; 79) ")" | 55 | IDENT@[74; 78) "test" |
56 | R_BRACK@[79; 80) "]" | 56 | R_PAREN@[78; 79) ")" |
57 | WHITESPACE@[80; 85) "\n " | 57 | R_BRACK@[79; 80) "]" |
58 | R_CURLY@[85; 86) "}" | 58 | WHITESPACE@[80; 85) "\n " |
59 | WHITESPACE@[86; 87) "\n" | 59 | R_CURLY@[85; 86) "}" |
60 | R_CURLY@[87; 88) "}" | 60 | WHITESPACE@[86; 87) "\n" |
61 | R_CURLY@[87; 88) "}" | ||
61 | WHITESPACE@[88; 89) "\n" | 62 | WHITESPACE@[88; 89) "\n" |
62 | error 80: expected pattern | 63 | error 80: expected pattern |
63 | error 80: expected FAT_ARROW | 64 | error 80: expected FAT_ARROW |
diff --git a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.txt b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.txt index 0cdca4b55..21269fb02 100644 --- a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.txt +++ b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.txt | |||
@@ -8,84 +8,85 @@ SOURCE_FILE@[0; 91) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 89) | 11 | BLOCK_EXPR@[10; 89) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 89) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 27) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 27) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | BIND_PAT@[20; 27) | 17 | WHITESPACE@[19; 20) " " |
18 | REF_KW@[20; 23) "ref" | 18 | BIND_PAT@[20; 27) |
19 | WHITESPACE@[23; 24) " " | 19 | REF_KW@[20; 23) "ref" |
20 | ERROR@[24; 27) | 20 | WHITESPACE@[23; 24) " " |
21 | BOX_KW@[24; 27) "box" | 21 | ERROR@[24; 27) |
22 | WHITESPACE@[27; 28) " " | 22 | BOX_KW@[24; 27) "box" |
23 | EXPR_STMT@[28; 35) | 23 | WHITESPACE@[27; 28) " " |
24 | BIN_EXPR@[28; 34) | 24 | EXPR_STMT@[28; 35) |
25 | PATH_EXPR@[28; 29) | 25 | BIN_EXPR@[28; 34) |
26 | PATH@[28; 29) | 26 | PATH_EXPR@[28; 29) |
27 | PATH_SEGMENT@[28; 29) | 27 | PATH@[28; 29) |
28 | NAME_REF@[28; 29) | 28 | PATH_SEGMENT@[28; 29) |
29 | IDENT@[28; 29) "i" | 29 | NAME_REF@[28; 29) |
30 | WHITESPACE@[29; 30) " " | 30 | IDENT@[28; 29) "i" |
31 | EQ@[30; 31) "=" | 31 | WHITESPACE@[29; 30) " " |
32 | WHITESPACE@[31; 32) " " | 32 | EQ@[30; 31) "=" |
33 | TUPLE_EXPR@[32; 34) | 33 | WHITESPACE@[31; 32) " " |
34 | L_PAREN@[32; 33) "(" | 34 | TUPLE_EXPR@[32; 34) |
35 | R_PAREN@[33; 34) ")" | 35 | L_PAREN@[32; 33) "(" |
36 | SEMI@[34; 35) ";" | 36 | R_PAREN@[33; 34) ")" |
37 | WHITESPACE@[35; 40) "\n " | 37 | SEMI@[34; 35) ";" |
38 | LET_STMT@[40; 51) | 38 | WHITESPACE@[35; 40) "\n " |
39 | LET_KW@[40; 43) "let" | 39 | LET_STMT@[40; 51) |
40 | WHITESPACE@[43; 44) " " | 40 | LET_KW@[40; 43) "let" |
41 | BIND_PAT@[44; 51) | 41 | WHITESPACE@[43; 44) " " |
42 | MUT_KW@[44; 47) "mut" | 42 | BIND_PAT@[44; 51) |
43 | WHITESPACE@[47; 48) " " | 43 | MUT_KW@[44; 47) "mut" |
44 | ERROR@[48; 51) | 44 | WHITESPACE@[47; 48) " " |
45 | BOX_KW@[48; 51) "box" | 45 | ERROR@[48; 51) |
46 | WHITESPACE@[51; 52) " " | 46 | BOX_KW@[48; 51) "box" |
47 | EXPR_STMT@[52; 59) | 47 | WHITESPACE@[51; 52) " " |
48 | BIN_EXPR@[52; 58) | 48 | EXPR_STMT@[52; 59) |
49 | PATH_EXPR@[52; 53) | 49 | BIN_EXPR@[52; 58) |
50 | PATH@[52; 53) | 50 | PATH_EXPR@[52; 53) |
51 | PATH_SEGMENT@[52; 53) | 51 | PATH@[52; 53) |
52 | NAME_REF@[52; 53) | 52 | PATH_SEGMENT@[52; 53) |
53 | IDENT@[52; 53) "i" | 53 | NAME_REF@[52; 53) |
54 | WHITESPACE@[53; 54) " " | 54 | IDENT@[52; 53) "i" |
55 | EQ@[54; 55) "=" | 55 | WHITESPACE@[53; 54) " " |
56 | WHITESPACE@[55; 56) " " | 56 | EQ@[54; 55) "=" |
57 | TUPLE_EXPR@[56; 58) | 57 | WHITESPACE@[55; 56) " " |
58 | L_PAREN@[56; 57) "(" | 58 | TUPLE_EXPR@[56; 58) |
59 | R_PAREN@[57; 58) ")" | 59 | L_PAREN@[56; 57) "(" |
60 | SEMI@[58; 59) ";" | 60 | R_PAREN@[57; 58) ")" |
61 | WHITESPACE@[59; 64) "\n " | 61 | SEMI@[58; 59) ";" |
62 | LET_STMT@[64; 79) | 62 | WHITESPACE@[59; 64) "\n " |
63 | LET_KW@[64; 67) "let" | 63 | LET_STMT@[64; 79) |
64 | WHITESPACE@[67; 68) " " | 64 | LET_KW@[64; 67) "let" |
65 | BIND_PAT@[68; 79) | 65 | WHITESPACE@[67; 68) " " |
66 | REF_KW@[68; 71) "ref" | 66 | BIND_PAT@[68; 79) |
67 | WHITESPACE@[71; 72) " " | 67 | REF_KW@[68; 71) "ref" |
68 | MUT_KW@[72; 75) "mut" | 68 | WHITESPACE@[71; 72) " " |
69 | WHITESPACE@[75; 76) " " | 69 | MUT_KW@[72; 75) "mut" |
70 | ERROR@[76; 79) | 70 | WHITESPACE@[75; 76) " " |
71 | BOX_KW@[76; 79) "box" | 71 | ERROR@[76; 79) |
72 | WHITESPACE@[79; 80) " " | 72 | BOX_KW@[76; 79) "box" |
73 | EXPR_STMT@[80; 87) | 73 | WHITESPACE@[79; 80) " " |
74 | BIN_EXPR@[80; 86) | 74 | EXPR_STMT@[80; 87) |
75 | PATH_EXPR@[80; 81) | 75 | BIN_EXPR@[80; 86) |
76 | PATH@[80; 81) | 76 | PATH_EXPR@[80; 81) |
77 | PATH_SEGMENT@[80; 81) | 77 | PATH@[80; 81) |
78 | NAME_REF@[80; 81) | 78 | PATH_SEGMENT@[80; 81) |
79 | IDENT@[80; 81) "i" | 79 | NAME_REF@[80; 81) |
80 | WHITESPACE@[81; 82) " " | 80 | IDENT@[80; 81) "i" |
81 | EQ@[82; 83) "=" | 81 | WHITESPACE@[81; 82) " " |
82 | WHITESPACE@[83; 84) " " | 82 | EQ@[82; 83) "=" |
83 | TUPLE_EXPR@[84; 86) | 83 | WHITESPACE@[83; 84) " " |
84 | L_PAREN@[84; 85) "(" | 84 | TUPLE_EXPR@[84; 86) |
85 | R_PAREN@[85; 86) ")" | 85 | L_PAREN@[84; 85) "(" |
86 | SEMI@[86; 87) ";" | 86 | R_PAREN@[85; 86) ")" |
87 | WHITESPACE@[87; 88) "\n" | 87 | SEMI@[86; 87) ";" |
88 | R_CURLY@[88; 89) "}" | 88 | WHITESPACE@[87; 88) "\n" |
89 | R_CURLY@[88; 89) "}" | ||
89 | WHITESPACE@[89; 91) "\n\n" | 90 | WHITESPACE@[89; 91) "\n\n" |
90 | error 24: expected a name | 91 | error 24: expected a name |
91 | error 27: expected SEMI | 92 | error 27: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt index 7abc49d5e..2950d77ef 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.txt | |||
@@ -8,19 +8,20 @@ SOURCE_FILE@[0; 30) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 29) | 11 | BLOCK_EXPR@[10; 29) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 29) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | EXPR_STMT@[16; 22) | 14 | WHITESPACE@[11; 16) "\n " |
15 | ERROR@[16; 22) | 15 | EXPR_STMT@[16; 22) |
16 | LABEL@[16; 22) | 16 | ERROR@[16; 22) |
17 | LIFETIME@[16; 21) "\'loop" | 17 | LABEL@[16; 22) |
18 | COLON@[21; 22) ":" | 18 | LIFETIME@[16; 21) "\'loop" |
19 | WHITESPACE@[22; 23) " " | 19 | COLON@[21; 22) ":" |
20 | IMPL_BLOCK@[23; 27) | 20 | WHITESPACE@[22; 23) " " |
21 | IMPL_KW@[23; 27) "impl" | 21 | IMPL_BLOCK@[23; 27) |
22 | WHITESPACE@[27; 28) "\n" | 22 | IMPL_KW@[23; 27) "impl" |
23 | R_CURLY@[28; 29) "}" | 23 | WHITESPACE@[27; 28) "\n" |
24 | R_CURLY@[28; 29) "}" | ||
24 | WHITESPACE@[29; 30) "\n" | 25 | WHITESPACE@[29; 30) "\n" |
25 | error 22: expected a loop | 26 | error 22: expected a loop |
26 | error 22: expected SEMI | 27 | error 22: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt index a1871ec08..f3fbc4828 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.txt | |||
@@ -7,9 +7,10 @@ SOURCE_FILE@[0; 33) | |||
7 | PARAM_LIST@[6; 8) | 7 | PARAM_LIST@[6; 8) |
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | BLOCK@[8; 10) | 10 | BLOCK_EXPR@[8; 10) |
11 | L_CURLY@[8; 9) "{" | 11 | BLOCK@[8; 10) |
12 | R_CURLY@[9; 10) "}" | 12 | L_CURLY@[8; 9) "{" |
13 | R_CURLY@[9; 10) "}" | ||
13 | WHITESPACE@[10; 11) " " | 14 | WHITESPACE@[10; 11) " " |
14 | ERROR@[11; 17) | 15 | ERROR@[11; 17) |
15 | UNSAFE_KW@[11; 17) "unsafe" | 16 | UNSAFE_KW@[11; 17) "unsafe" |
@@ -27,9 +28,10 @@ SOURCE_FILE@[0; 33) | |||
27 | PARAM_LIST@[28; 30) | 28 | PARAM_LIST@[28; 30) |
28 | L_PAREN@[28; 29) "(" | 29 | L_PAREN@[28; 29) "(" |
29 | R_PAREN@[29; 30) ")" | 30 | R_PAREN@[29; 30) ")" |
30 | BLOCK@[30; 32) | 31 | BLOCK_EXPR@[30; 32) |
31 | L_CURLY@[30; 31) "{" | 32 | BLOCK@[30; 32) |
32 | R_CURLY@[31; 32) "}" | 33 | L_CURLY@[30; 31) "{" |
34 | R_CURLY@[31; 32) "}" | ||
33 | WHITESPACE@[32; 33) "\n" | 35 | WHITESPACE@[32; 33) "\n" |
34 | error 11: expected an item | 36 | error 11: expected an item |
35 | error 18: expected an item | 37 | error 18: expected an item |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt index f70adc25d..5cfe766d7 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.txt | |||
@@ -8,24 +8,25 @@ SOURCE_FILE@[0; 30) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 29) | 11 | BLOCK_EXPR@[9; 29) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 29) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[11; 27) | 14 | WHITESPACE@[10; 11) " " |
15 | LET_KW@[11; 14) "let" | 15 | LET_STMT@[11; 27) |
16 | WHITESPACE@[14; 15) " " | 16 | LET_KW@[11; 14) "let" |
17 | PLACEHOLDER_PAT@[15; 16) | 17 | WHITESPACE@[14; 15) " " |
18 | UNDERSCORE@[15; 16) "_" | 18 | PLACEHOLDER_PAT@[15; 16) |
19 | WHITESPACE@[16; 17) " " | 19 | UNDERSCORE@[15; 16) "_" |
20 | EQ@[17; 18) "=" | 20 | WHITESPACE@[16; 17) " " |
21 | WHITESPACE@[18; 19) " " | 21 | EQ@[17; 18) "=" |
22 | BLOCK_EXPR@[19; 27) | 22 | WHITESPACE@[18; 19) " " |
23 | ASYNC_KW@[19; 24) "async" | 23 | BLOCK_EXPR@[19; 27) |
24 | WHITESPACE@[24; 25) " " | 24 | ASYNC_KW@[19; 24) "async" |
25 | BLOCK@[25; 27) | 25 | WHITESPACE@[24; 25) " " |
26 | L_CURLY@[25; 26) "{" | 26 | BLOCK@[25; 27) |
27 | R_CURLY@[26; 27) "}" | 27 | L_CURLY@[25; 26) "{" |
28 | WHITESPACE@[27; 28) " " | 28 | R_CURLY@[26; 27) "}" |
29 | R_CURLY@[28; 29) "}" | 29 | WHITESPACE@[27; 28) " " |
30 | R_CURLY@[28; 29) "}" | ||
30 | WHITESPACE@[29; 30) "\n" | 31 | WHITESPACE@[29; 30) "\n" |
31 | error 27: expected SEMI | 32 | error 27: expected SEMI |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt index 1dbfca698..0594f148f 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.txt | |||
@@ -8,18 +8,19 @@ SOURCE_FILE@[0; 21) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 20) | 11 | BLOCK_EXPR@[9; 20) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 20) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | ERROR@[11; 14) | 14 | WHITESPACE@[10; 11) " " |
15 | VISIBILITY@[11; 14) | 15 | ERROR@[11; 14) |
16 | PUB_KW@[11; 14) "pub" | 16 | VISIBILITY@[11; 14) |
17 | WHITESPACE@[14; 15) " " | 17 | PUB_KW@[11; 14) "pub" |
18 | EXPR_STMT@[15; 18) | 18 | WHITESPACE@[14; 15) " " |
19 | LITERAL@[15; 17) | 19 | EXPR_STMT@[15; 18) |
20 | INT_NUMBER@[15; 17) "92" | 20 | LITERAL@[15; 17) |
21 | SEMI@[17; 18) ";" | 21 | INT_NUMBER@[15; 17) "92" |
22 | WHITESPACE@[18; 19) " " | 22 | SEMI@[17; 18) ";" |
23 | R_CURLY@[19; 20) "}" | 23 | WHITESPACE@[18; 19) " " |
24 | R_CURLY@[19; 20) "}" | ||
24 | WHITESPACE@[20; 21) "\n" | 25 | WHITESPACE@[20; 21) "\n" |
25 | error 14: expected an item | 26 | error 14: expected an item |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt index 338776a72..eab9f5b91 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.txt | |||
@@ -8,48 +8,50 @@ SOURCE_FILE@[0; 48) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 47) | 11 | BLOCK_EXPR@[9; 47) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 47) |
13 | WHITESPACE@[10; 14) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[14; 25) | 14 | WHITESPACE@[10; 14) "\n " |
15 | ATTR@[14; 18) | 15 | EXPR_STMT@[14; 25) |
16 | POUND@[14; 15) "#" | 16 | ATTR@[14; 18) |
17 | TOKEN_TREE@[15; 18) | 17 | POUND@[14; 15) "#" |
18 | L_BRACK@[15; 16) "[" | 18 | TOKEN_TREE@[15; 18) |
19 | IDENT@[16; 17) "A" | 19 | L_BRACK@[15; 16) "[" |
20 | R_BRACK@[17; 18) "]" | 20 | IDENT@[16; 17) "A" |
21 | WHITESPACE@[18; 19) " " | 21 | R_BRACK@[17; 18) "]" |
22 | BIN_EXPR@[19; 24) | 22 | WHITESPACE@[18; 19) " " |
23 | LITERAL@[19; 20) | 23 | BIN_EXPR@[19; 24) |
24 | INT_NUMBER@[19; 20) "1" | 24 | LITERAL@[19; 20) |
25 | WHITESPACE@[20; 21) " " | 25 | INT_NUMBER@[19; 20) "1" |
26 | PLUS@[21; 22) "+" | 26 | WHITESPACE@[20; 21) " " |
27 | WHITESPACE@[22; 23) " " | 27 | PLUS@[21; 22) "+" |
28 | LITERAL@[23; 24) | 28 | WHITESPACE@[22; 23) " " |
29 | INT_NUMBER@[23; 24) "2" | 29 | LITERAL@[23; 24) |
30 | SEMI@[24; 25) ";" | 30 | INT_NUMBER@[23; 24) "2" |
31 | WHITESPACE@[25; 29) "\n " | 31 | SEMI@[24; 25) ";" |
32 | EXPR_STMT@[29; 45) | 32 | WHITESPACE@[25; 29) "\n " |
33 | ATTR@[29; 33) | 33 | EXPR_STMT@[29; 45) |
34 | POUND@[29; 30) "#" | 34 | ATTR@[29; 33) |
35 | TOKEN_TREE@[30; 33) | 35 | POUND@[29; 30) "#" |
36 | L_BRACK@[30; 31) "[" | 36 | TOKEN_TREE@[30; 33) |
37 | IDENT@[31; 32) "B" | 37 | L_BRACK@[30; 31) "[" |
38 | R_BRACK@[32; 33) "]" | 38 | IDENT@[31; 32) "B" |
39 | WHITESPACE@[33; 34) " " | 39 | R_BRACK@[32; 33) "]" |
40 | IF_EXPR@[34; 44) | 40 | WHITESPACE@[33; 34) " " |
41 | IF_KW@[34; 36) "if" | 41 | IF_EXPR@[34; 44) |
42 | WHITESPACE@[36; 37) " " | 42 | IF_KW@[34; 36) "if" |
43 | CONDITION@[37; 41) | 43 | WHITESPACE@[36; 37) " " |
44 | LITERAL@[37; 41) | 44 | CONDITION@[37; 41) |
45 | TRUE_KW@[37; 41) "true" | 45 | LITERAL@[37; 41) |
46 | WHITESPACE@[41; 42) " " | 46 | TRUE_KW@[37; 41) "true" |
47 | BLOCK@[42; 44) | 47 | WHITESPACE@[41; 42) " " |
48 | L_CURLY@[42; 43) "{" | 48 | BLOCK_EXPR@[42; 44) |
49 | R_CURLY@[43; 44) "}" | 49 | BLOCK@[42; 44) |
50 | SEMI@[44; 45) ";" | 50 | L_CURLY@[42; 43) "{" |
51 | WHITESPACE@[45; 46) "\n" | 51 | R_CURLY@[43; 44) "}" |
52 | R_CURLY@[46; 47) "}" | 52 | SEMI@[44; 45) ";" |
53 | WHITESPACE@[45; 46) "\n" | ||
54 | R_CURLY@[46; 47) "}" | ||
53 | WHITESPACE@[47; 48) "\n" | 55 | WHITESPACE@[47; 48) "\n" |
54 | error 24: attributes are not allowed on BIN_EXPR | 56 | error 24: attributes are not allowed on BIN_EXPR |
55 | error 44: attributes are not allowed on IF_EXPR | 57 | error 44: attributes are not allowed on IF_EXPR |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt index 465e79e7b..8ad2a588f 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.txt | |||
@@ -8,45 +8,46 @@ SOURCE_FILE@[0; 47) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 46) | 11 | BLOCK_EXPR@[9; 46) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 46) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 20) | 14 | WHITESPACE@[10; 15) "\n " |
15 | FIELD_EXPR@[15; 19) | 15 | EXPR_STMT@[15; 20) |
16 | PATH_EXPR@[15; 16) | 16 | FIELD_EXPR@[15; 19) |
17 | PATH@[15; 16) | 17 | PATH_EXPR@[15; 16) |
18 | PATH_SEGMENT@[15; 16) | 18 | PATH@[15; 16) |
19 | NAME_REF@[15; 16) | 19 | PATH_SEGMENT@[15; 16) |
20 | IDENT@[15; 16) "x" | 20 | NAME_REF@[15; 16) |
21 | DOT@[16; 17) "." | 21 | IDENT@[15; 16) "x" |
22 | FLOAT_NUMBER@[17; 19) "0." | 22 | DOT@[16; 17) "." |
23 | SEMI@[19; 20) ";" | 23 | FLOAT_NUMBER@[17; 19) "0." |
24 | WHITESPACE@[20; 25) "\n " | 24 | SEMI@[19; 20) ";" |
25 | EXPR_STMT@[25; 32) | 25 | WHITESPACE@[20; 25) "\n " |
26 | FIELD_EXPR@[25; 31) | 26 | EXPR_STMT@[25; 32) |
27 | PATH_EXPR@[25; 26) | 27 | FIELD_EXPR@[25; 31) |
28 | PATH@[25; 26) | 28 | PATH_EXPR@[25; 26) |
29 | PATH_SEGMENT@[25; 26) | 29 | PATH@[25; 26) |
30 | NAME_REF@[25; 26) | 30 | PATH_SEGMENT@[25; 26) |
31 | IDENT@[25; 26) "x" | 31 | NAME_REF@[25; 26) |
32 | DOT@[26; 27) "." | 32 | IDENT@[25; 26) "x" |
33 | NAME_REF@[27; 31) | 33 | DOT@[26; 27) "." |
34 | INT_NUMBER@[27; 31) "1i32" | 34 | NAME_REF@[27; 31) |
35 | SEMI@[31; 32) ";" | 35 | INT_NUMBER@[27; 31) "1i32" |
36 | WHITESPACE@[32; 37) "\n " | 36 | SEMI@[31; 32) ";" |
37 | EXPR_STMT@[37; 44) | 37 | WHITESPACE@[32; 37) "\n " |
38 | FIELD_EXPR@[37; 43) | 38 | EXPR_STMT@[37; 44) |
39 | PATH_EXPR@[37; 38) | 39 | FIELD_EXPR@[37; 43) |
40 | PATH@[37; 38) | 40 | PATH_EXPR@[37; 38) |
41 | PATH_SEGMENT@[37; 38) | 41 | PATH@[37; 38) |
42 | NAME_REF@[37; 38) | 42 | PATH_SEGMENT@[37; 38) |
43 | IDENT@[37; 38) "x" | 43 | NAME_REF@[37; 38) |
44 | DOT@[38; 39) "." | 44 | IDENT@[37; 38) "x" |
45 | NAME_REF@[39; 43) | 45 | DOT@[38; 39) "." |
46 | INT_NUMBER@[39; 43) "0x01" | 46 | NAME_REF@[39; 43) |
47 | SEMI@[43; 44) ";" | 47 | INT_NUMBER@[39; 43) "0x01" |
48 | WHITESPACE@[44; 45) "\n" | 48 | SEMI@[43; 44) ";" |
49 | R_CURLY@[45; 46) "}" | 49 | WHITESPACE@[44; 45) "\n" |
50 | R_CURLY@[45; 46) "}" | ||
50 | WHITESPACE@[46; 47) "\n" | 51 | WHITESPACE@[46; 47) "\n" |
51 | error [27; 31): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix | 52 | error [27; 31): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix |
52 | error [39; 43): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix | 53 | error [39; 43): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt index b1ef210d3..2ea6a566d 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.txt | |||
@@ -13,9 +13,10 @@ SOURCE_FILE@[0; 50) | |||
13 | L_PAREN@[19; 20) "(" | 13 | L_PAREN@[19; 20) "(" |
14 | R_PAREN@[20; 21) ")" | 14 | R_PAREN@[20; 21) ")" |
15 | WHITESPACE@[21; 22) " " | 15 | WHITESPACE@[21; 22) " " |
16 | BLOCK@[22; 24) | 16 | BLOCK_EXPR@[22; 24) |
17 | L_CURLY@[22; 23) "{" | 17 | BLOCK@[22; 24) |
18 | R_CURLY@[23; 24) "}" | 18 | L_CURLY@[22; 23) "{" |
19 | R_CURLY@[23; 24) "}" | ||
19 | WHITESPACE@[24; 25) "\n" | 20 | WHITESPACE@[24; 25) "\n" |
20 | ERROR@[25; 31) | 21 | ERROR@[25; 31) |
21 | UNSAFE_KW@[25; 31) "unsafe" | 22 | UNSAFE_KW@[25; 31) "unsafe" |
@@ -31,9 +32,10 @@ SOURCE_FILE@[0; 50) | |||
31 | L_PAREN@[44; 45) "(" | 32 | L_PAREN@[44; 45) "(" |
32 | R_PAREN@[45; 46) ")" | 33 | R_PAREN@[45; 46) ")" |
33 | WHITESPACE@[46; 47) " " | 34 | WHITESPACE@[46; 47) " " |
34 | BLOCK@[47; 49) | 35 | BLOCK_EXPR@[47; 49) |
35 | L_CURLY@[47; 48) "{" | 36 | BLOCK@[47; 49) |
36 | R_CURLY@[48; 49) "}" | 37 | L_CURLY@[47; 48) "{" |
38 | R_CURLY@[48; 49) "}" | ||
37 | WHITESPACE@[49; 50) "\n" | 39 | WHITESPACE@[49; 50) "\n" |
38 | error 5: expected existential, fn, trait or impl | 40 | error 5: expected existential, fn, trait or impl |
39 | error 31: expected existential, fn, trait or impl | 41 | error 31: expected existential, fn, trait or impl |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt index 7da4e243f..a1a0bd7c4 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.txt | |||
@@ -44,9 +44,10 @@ SOURCE_FILE@[0; 62) | |||
44 | L_PAREN@[54; 55) "(" | 44 | L_PAREN@[54; 55) "(" |
45 | R_PAREN@[55; 56) ")" | 45 | R_PAREN@[55; 56) ")" |
46 | WHITESPACE@[56; 57) " " | 46 | WHITESPACE@[56; 57) " " |
47 | BLOCK@[57; 59) | 47 | BLOCK_EXPR@[57; 59) |
48 | L_CURLY@[57; 58) "{" | 48 | BLOCK@[57; 59) |
49 | R_CURLY@[58; 59) "}" | 49 | L_CURLY@[57; 58) "{" |
50 | R_CURLY@[58; 59) "}" | ||
50 | WHITESPACE@[59; 60) "\n" | 51 | WHITESPACE@[59; 60) "\n" |
51 | R_CURLY@[60; 61) "}" | 52 | R_CURLY@[60; 61) "}" |
52 | WHITESPACE@[61; 62) "\n" | 53 | WHITESPACE@[61; 62) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt index 18f02bb22..d4e710dd4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.txt | |||
@@ -50,9 +50,10 @@ SOURCE_FILE@[0; 83) | |||
50 | L_PAREN@[56; 57) "(" | 50 | L_PAREN@[56; 57) "(" |
51 | R_PAREN@[57; 58) ")" | 51 | R_PAREN@[57; 58) ")" |
52 | WHITESPACE@[58; 59) " " | 52 | WHITESPACE@[58; 59) " " |
53 | BLOCK@[59; 61) | 53 | BLOCK_EXPR@[59; 61) |
54 | L_CURLY@[59; 60) "{" | 54 | BLOCK@[59; 61) |
55 | R_CURLY@[60; 61) "}" | 55 | L_CURLY@[59; 60) "{" |
56 | R_CURLY@[60; 61) "}" | ||
56 | WHITESPACE@[61; 66) "\n " | 57 | WHITESPACE@[61; 66) "\n " |
57 | FN_DEF@[66; 80) | 58 | FN_DEF@[66; 80) |
58 | FN_KW@[66; 68) "fn" | 59 | FN_KW@[66; 68) "fn" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt index 8a21ee968..e3f5a7f04 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.txt | |||
@@ -54,8 +54,9 @@ SOURCE_FILE@[0; 49) | |||
54 | IDENT@[40; 43) "str" | 54 | IDENT@[40; 43) "str" |
55 | R_PAREN@[43; 44) ")" | 55 | R_PAREN@[43; 44) ")" |
56 | WHITESPACE@[44; 45) "\n" | 56 | WHITESPACE@[44; 45) "\n" |
57 | BLOCK@[45; 48) | 57 | BLOCK_EXPR@[45; 48) |
58 | L_CURLY@[45; 46) "{" | 58 | BLOCK@[45; 48) |
59 | WHITESPACE@[46; 47) " " | 59 | L_CURLY@[45; 46) "{" |
60 | R_CURLY@[47; 48) "}" | 60 | WHITESPACE@[46; 47) " " |
61 | R_CURLY@[47; 48) "}" | ||
61 | WHITESPACE@[48; 49) "\n" | 62 | WHITESPACE@[48; 49) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt index c1a70d566..8ae7909f9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.txt | |||
@@ -31,7 +31,8 @@ SOURCE_FILE@[0; 28) | |||
31 | PARAM_LIST@[23; 25) | 31 | PARAM_LIST@[23; 25) |
32 | L_PAREN@[23; 24) "(" | 32 | L_PAREN@[23; 24) "(" |
33 | R_PAREN@[24; 25) ")" | 33 | R_PAREN@[24; 25) ")" |
34 | BLOCK@[25; 27) | 34 | BLOCK_EXPR@[25; 27) |
35 | L_CURLY@[25; 26) "{" | 35 | BLOCK@[25; 27) |
36 | R_CURLY@[26; 27) "}" | 36 | L_CURLY@[25; 26) "{" |
37 | R_CURLY@[26; 27) "}" | ||
37 | WHITESPACE@[27; 28) "\n" | 38 | WHITESPACE@[27; 28) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt index 8e210a6ca..0ccd12b0a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.txt | |||
@@ -22,9 +22,10 @@ SOURCE_FILE@[0; 128) | |||
22 | SELF_KW@[18; 22) "self" | 22 | SELF_KW@[18; 22) "self" |
23 | R_PAREN@[22; 23) ")" | 23 | R_PAREN@[22; 23) ")" |
24 | WHITESPACE@[23; 24) " " | 24 | WHITESPACE@[23; 24) " " |
25 | BLOCK@[24; 26) | 25 | BLOCK_EXPR@[24; 26) |
26 | L_CURLY@[24; 25) "{" | 26 | BLOCK@[24; 26) |
27 | R_CURLY@[25; 26) "}" | 27 | L_CURLY@[24; 25) "{" |
28 | R_CURLY@[25; 26) "}" | ||
28 | WHITESPACE@[26; 31) "\n " | 29 | WHITESPACE@[26; 31) "\n " |
29 | FN_DEF@[31; 46) | 30 | FN_DEF@[31; 46) |
30 | FN_KW@[31; 33) "fn" | 31 | FN_KW@[31; 33) "fn" |
@@ -39,9 +40,10 @@ SOURCE_FILE@[0; 128) | |||
39 | COMMA@[41; 42) "," | 40 | COMMA@[41; 42) "," |
40 | R_PAREN@[42; 43) ")" | 41 | R_PAREN@[42; 43) ")" |
41 | WHITESPACE@[43; 44) " " | 42 | WHITESPACE@[43; 44) " " |
42 | BLOCK@[44; 46) | 43 | BLOCK_EXPR@[44; 46) |
43 | L_CURLY@[44; 45) "{" | 44 | BLOCK@[44; 46) |
44 | R_CURLY@[45; 46) "}" | 45 | L_CURLY@[44; 45) "{" |
46 | R_CURLY@[45; 46) "}" | ||
45 | WHITESPACE@[46; 51) "\n " | 47 | WHITESPACE@[46; 51) "\n " |
46 | FN_DEF@[51; 69) | 48 | FN_DEF@[51; 69) |
47 | FN_KW@[51; 53) "fn" | 49 | FN_KW@[51; 53) "fn" |
@@ -58,9 +60,10 @@ SOURCE_FILE@[0; 128) | |||
58 | COMMA@[64; 65) "," | 60 | COMMA@[64; 65) "," |
59 | R_PAREN@[65; 66) ")" | 61 | R_PAREN@[65; 66) ")" |
60 | WHITESPACE@[66; 67) " " | 62 | WHITESPACE@[66; 67) " " |
61 | BLOCK@[67; 69) | 63 | BLOCK_EXPR@[67; 69) |
62 | L_CURLY@[67; 68) "{" | 64 | BLOCK@[67; 69) |
63 | R_CURLY@[68; 69) "}" | 65 | L_CURLY@[67; 68) "{" |
66 | R_CURLY@[68; 69) "}" | ||
64 | WHITESPACE@[69; 74) "\n " | 67 | WHITESPACE@[69; 74) "\n " |
65 | FN_DEF@[74; 103) | 68 | FN_DEF@[74; 103) |
66 | FN_KW@[74; 76) "fn" | 69 | FN_KW@[74; 76) "fn" |
@@ -91,9 +94,10 @@ SOURCE_FILE@[0; 128) | |||
91 | IDENT@[96; 99) "i32" | 94 | IDENT@[96; 99) "i32" |
92 | R_PAREN@[99; 100) ")" | 95 | R_PAREN@[99; 100) ")" |
93 | WHITESPACE@[100; 101) " " | 96 | WHITESPACE@[100; 101) " " |
94 | BLOCK@[101; 103) | 97 | BLOCK_EXPR@[101; 103) |
95 | L_CURLY@[101; 102) "{" | 98 | BLOCK@[101; 103) |
96 | R_CURLY@[102; 103) "}" | 99 | L_CURLY@[101; 102) "{" |
100 | R_CURLY@[102; 103) "}" | ||
97 | WHITESPACE@[103; 108) "\n " | 101 | WHITESPACE@[103; 108) "\n " |
98 | FN_DEF@[108; 125) | 102 | FN_DEF@[108; 125) |
99 | FN_KW@[108; 110) "fn" | 103 | FN_KW@[108; 110) "fn" |
@@ -108,9 +112,10 @@ SOURCE_FILE@[0; 128) | |||
108 | SELF_KW@[117; 121) "self" | 112 | SELF_KW@[117; 121) "self" |
109 | R_PAREN@[121; 122) ")" | 113 | R_PAREN@[121; 122) ")" |
110 | WHITESPACE@[122; 123) " " | 114 | WHITESPACE@[122; 123) " " |
111 | BLOCK@[123; 125) | 115 | BLOCK_EXPR@[123; 125) |
112 | L_CURLY@[123; 124) "{" | 116 | BLOCK@[123; 125) |
113 | R_CURLY@[124; 125) "}" | 117 | L_CURLY@[123; 124) "{" |
118 | R_CURLY@[124; 125) "}" | ||
114 | WHITESPACE@[125; 126) "\n" | 119 | WHITESPACE@[125; 126) "\n" |
115 | R_CURLY@[126; 127) "}" | 120 | R_CURLY@[126; 127) "}" |
116 | WHITESPACE@[127; 128) "\n" | 121 | WHITESPACE@[127; 128) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt index 4108762e5..80bb7733c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.txt | |||
@@ -8,88 +8,89 @@ SOURCE_FILE@[0; 103) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 102) | 11 | BLOCK_EXPR@[9; 102) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 102) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 33) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 33) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PATH_PAT@[19; 27) | 17 | WHITESPACE@[18; 19) " " |
18 | PATH@[19; 27) | 18 | PATH_PAT@[19; 27) |
19 | PATH@[19; 22) | 19 | PATH@[19; 27) |
20 | PATH_SEGMENT@[19; 22) | 20 | PATH@[19; 22) |
21 | NAME_REF@[19; 22) | 21 | PATH_SEGMENT@[19; 22) |
22 | IDENT@[19; 22) "foo" | 22 | NAME_REF@[19; 22) |
23 | COLONCOLON@[22; 24) "::" | 23 | IDENT@[19; 22) "foo" |
24 | PATH_SEGMENT@[24; 27) | 24 | COLONCOLON@[22; 24) "::" |
25 | NAME_REF@[24; 27) | 25 | PATH_SEGMENT@[24; 27) |
26 | IDENT@[24; 27) "Bar" | 26 | NAME_REF@[24; 27) |
27 | WHITESPACE@[27; 28) " " | 27 | IDENT@[24; 27) "Bar" |
28 | EQ@[28; 29) "=" | 28 | WHITESPACE@[27; 28) " " |
29 | WHITESPACE@[29; 30) " " | 29 | EQ@[28; 29) "=" |
30 | TUPLE_EXPR@[30; 32) | 30 | WHITESPACE@[29; 30) " " |
31 | L_PAREN@[30; 31) "(" | 31 | TUPLE_EXPR@[30; 32) |
32 | R_PAREN@[31; 32) ")" | 32 | L_PAREN@[30; 31) "(" |
33 | SEMI@[32; 33) ";" | 33 | R_PAREN@[31; 32) ")" |
34 | WHITESPACE@[33; 38) "\n " | 34 | SEMI@[32; 33) ";" |
35 | LET_STMT@[38; 53) | 35 | WHITESPACE@[33; 38) "\n " |
36 | LET_KW@[38; 41) "let" | 36 | LET_STMT@[38; 53) |
37 | WHITESPACE@[41; 42) " " | 37 | LET_KW@[38; 41) "let" |
38 | PATH_PAT@[42; 47) | 38 | WHITESPACE@[41; 42) " " |
39 | PATH@[42; 47) | 39 | PATH_PAT@[42; 47) |
40 | PATH_SEGMENT@[42; 47) | 40 | PATH@[42; 47) |
41 | COLONCOLON@[42; 44) "::" | 41 | PATH_SEGMENT@[42; 47) |
42 | NAME_REF@[44; 47) | 42 | COLONCOLON@[42; 44) "::" |
43 | IDENT@[44; 47) "Bar" | 43 | NAME_REF@[44; 47) |
44 | WHITESPACE@[47; 48) " " | 44 | IDENT@[44; 47) "Bar" |
45 | EQ@[48; 49) "=" | 45 | WHITESPACE@[47; 48) " " |
46 | WHITESPACE@[49; 50) " " | 46 | EQ@[48; 49) "=" |
47 | TUPLE_EXPR@[50; 52) | 47 | WHITESPACE@[49; 50) " " |
48 | L_PAREN@[50; 51) "(" | 48 | TUPLE_EXPR@[50; 52) |
49 | R_PAREN@[51; 52) ")" | 49 | L_PAREN@[50; 51) "(" |
50 | SEMI@[52; 53) ";" | 50 | R_PAREN@[51; 52) ")" |
51 | WHITESPACE@[53; 58) "\n " | 51 | SEMI@[52; 53) ";" |
52 | LET_STMT@[58; 78) | 52 | WHITESPACE@[53; 58) "\n " |
53 | LET_KW@[58; 61) "let" | 53 | LET_STMT@[58; 78) |
54 | WHITESPACE@[61; 62) " " | 54 | LET_KW@[58; 61) "let" |
55 | RECORD_PAT@[62; 72) | 55 | WHITESPACE@[61; 62) " " |
56 | PATH@[62; 65) | 56 | RECORD_PAT@[62; 72) |
57 | PATH_SEGMENT@[62; 65) | 57 | PATH@[62; 65) |
58 | NAME_REF@[62; 65) | 58 | PATH_SEGMENT@[62; 65) |
59 | IDENT@[62; 65) "Bar" | 59 | NAME_REF@[62; 65) |
60 | WHITESPACE@[65; 66) " " | 60 | IDENT@[62; 65) "Bar" |
61 | RECORD_FIELD_PAT_LIST@[66; 72) | 61 | WHITESPACE@[65; 66) " " |
62 | L_CURLY@[66; 67) "{" | 62 | RECORD_FIELD_PAT_LIST@[66; 72) |
63 | WHITESPACE@[67; 68) " " | 63 | L_CURLY@[66; 67) "{" |
64 | DOTDOT@[68; 70) ".." | 64 | WHITESPACE@[67; 68) " " |
65 | WHITESPACE@[70; 71) " " | 65 | DOTDOT@[68; 70) ".." |
66 | R_CURLY@[71; 72) "}" | 66 | WHITESPACE@[70; 71) " " |
67 | WHITESPACE@[72; 73) " " | 67 | R_CURLY@[71; 72) "}" |
68 | EQ@[73; 74) "=" | 68 | WHITESPACE@[72; 73) " " |
69 | WHITESPACE@[74; 75) " " | 69 | EQ@[73; 74) "=" |
70 | TUPLE_EXPR@[75; 77) | 70 | WHITESPACE@[74; 75) " " |
71 | L_PAREN@[75; 76) "(" | 71 | TUPLE_EXPR@[75; 77) |
72 | R_PAREN@[76; 77) ")" | 72 | L_PAREN@[75; 76) "(" |
73 | SEMI@[77; 78) ";" | 73 | R_PAREN@[76; 77) ")" |
74 | WHITESPACE@[78; 83) "\n " | 74 | SEMI@[77; 78) ";" |
75 | LET_STMT@[83; 100) | 75 | WHITESPACE@[78; 83) "\n " |
76 | LET_KW@[83; 86) "let" | 76 | LET_STMT@[83; 100) |
77 | WHITESPACE@[86; 87) " " | 77 | LET_KW@[83; 86) "let" |
78 | TUPLE_STRUCT_PAT@[87; 94) | 78 | WHITESPACE@[86; 87) " " |
79 | PATH@[87; 90) | 79 | TUPLE_STRUCT_PAT@[87; 94) |
80 | PATH_SEGMENT@[87; 90) | 80 | PATH@[87; 90) |
81 | NAME_REF@[87; 90) | 81 | PATH_SEGMENT@[87; 90) |
82 | IDENT@[87; 90) "Bar" | 82 | NAME_REF@[87; 90) |
83 | L_PAREN@[90; 91) "(" | 83 | IDENT@[87; 90) "Bar" |
84 | DOTDOT@[91; 93) ".." | 84 | L_PAREN@[90; 91) "(" |
85 | R_PAREN@[93; 94) ")" | 85 | DOTDOT@[91; 93) ".." |
86 | WHITESPACE@[94; 95) " " | 86 | R_PAREN@[93; 94) ")" |
87 | EQ@[95; 96) "=" | 87 | WHITESPACE@[94; 95) " " |
88 | WHITESPACE@[96; 97) " " | 88 | EQ@[95; 96) "=" |
89 | TUPLE_EXPR@[97; 99) | 89 | WHITESPACE@[96; 97) " " |
90 | L_PAREN@[97; 98) "(" | 90 | TUPLE_EXPR@[97; 99) |
91 | R_PAREN@[98; 99) ")" | 91 | L_PAREN@[97; 98) "(" |
92 | SEMI@[99; 100) ";" | 92 | R_PAREN@[98; 99) ")" |
93 | WHITESPACE@[100; 101) "\n" | 93 | SEMI@[99; 100) ";" |
94 | R_CURLY@[101; 102) "}" | 94 | WHITESPACE@[100; 101) "\n" |
95 | R_CURLY@[101; 102) "}" | ||
95 | WHITESPACE@[102; 103) "\n" | 96 | WHITESPACE@[102; 103) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt index 8240aba15..2d8872022 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.txt | |||
@@ -8,17 +8,19 @@ SOURCE_FILE@[0; 26) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 25) | 11 | BLOCK_EXPR@[9; 25) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 25) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 23) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LOOP_EXPR@[15; 22) | 15 | EXPR_STMT@[15; 23) |
16 | LOOP_KW@[15; 19) "loop" | 16 | LOOP_EXPR@[15; 22) |
17 | WHITESPACE@[19; 20) " " | 17 | LOOP_KW@[15; 19) "loop" |
18 | BLOCK@[20; 22) | 18 | WHITESPACE@[19; 20) " " |
19 | L_CURLY@[20; 21) "{" | 19 | BLOCK_EXPR@[20; 22) |
20 | R_CURLY@[21; 22) "}" | 20 | BLOCK@[20; 22) |
21 | SEMI@[22; 23) ";" | 21 | L_CURLY@[20; 21) "{" |
22 | WHITESPACE@[23; 24) "\n" | 22 | R_CURLY@[21; 22) "}" |
23 | R_CURLY@[24; 25) "}" | 23 | SEMI@[22; 23) ";" |
24 | WHITESPACE@[23; 24) "\n" | ||
25 | R_CURLY@[24; 25) "}" | ||
24 | WHITESPACE@[25; 26) "\n" | 26 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt index 1d2cf2761..29b268b55 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.txt | |||
@@ -8,52 +8,53 @@ SOURCE_FILE@[0; 48) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 47) | 11 | BLOCK_EXPR@[9; 47) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 47) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 21) | 14 | WHITESPACE@[10; 15) "\n " |
15 | FIELD_EXPR@[15; 20) | 15 | EXPR_STMT@[15; 21) |
16 | PATH_EXPR@[15; 16) | 16 | FIELD_EXPR@[15; 20) |
17 | PATH@[15; 16) | 17 | PATH_EXPR@[15; 16) |
18 | PATH_SEGMENT@[15; 16) | 18 | PATH@[15; 16) |
19 | NAME_REF@[15; 16) | 19 | PATH_SEGMENT@[15; 16) |
20 | IDENT@[15; 16) "x" | 20 | NAME_REF@[15; 16) |
21 | DOT@[16; 17) "." | 21 | IDENT@[15; 16) "x" |
22 | NAME_REF@[17; 20) | 22 | DOT@[16; 17) "." |
23 | IDENT@[17; 20) "foo" | 23 | NAME_REF@[17; 20) |
24 | SEMI@[20; 21) ";" | 24 | IDENT@[17; 20) "foo" |
25 | WHITESPACE@[21; 26) "\n " | 25 | SEMI@[20; 21) ";" |
26 | EXPR_STMT@[26; 34) | 26 | WHITESPACE@[21; 26) "\n " |
27 | FIELD_EXPR@[26; 33) | 27 | EXPR_STMT@[26; 34) |
28 | FIELD_EXPR@[26; 29) | 28 | FIELD_EXPR@[26; 33) |
29 | PATH_EXPR@[26; 27) | 29 | FIELD_EXPR@[26; 29) |
30 | PATH@[26; 27) | 30 | PATH_EXPR@[26; 27) |
31 | PATH_SEGMENT@[26; 27) | 31 | PATH@[26; 27) |
32 | NAME_REF@[26; 27) | 32 | PATH_SEGMENT@[26; 27) |
33 | IDENT@[26; 27) "x" | 33 | NAME_REF@[26; 27) |
34 | DOT@[27; 28) "." | 34 | IDENT@[26; 27) "x" |
35 | NAME_REF@[28; 29) | 35 | DOT@[27; 28) "." |
36 | INT_NUMBER@[28; 29) "0" | 36 | NAME_REF@[28; 29) |
37 | DOT@[29; 30) "." | 37 | INT_NUMBER@[28; 29) "0" |
38 | NAME_REF@[30; 33) | 38 | DOT@[29; 30) "." |
39 | IDENT@[30; 33) "bar" | 39 | NAME_REF@[30; 33) |
40 | SEMI@[33; 34) ";" | 40 | IDENT@[30; 33) "bar" |
41 | WHITESPACE@[34; 39) "\n " | 41 | SEMI@[33; 34) ";" |
42 | EXPR_STMT@[39; 45) | 42 | WHITESPACE@[34; 39) "\n " |
43 | CALL_EXPR@[39; 44) | 43 | EXPR_STMT@[39; 45) |
44 | FIELD_EXPR@[39; 42) | 44 | CALL_EXPR@[39; 44) |
45 | PATH_EXPR@[39; 40) | 45 | FIELD_EXPR@[39; 42) |
46 | PATH@[39; 40) | 46 | PATH_EXPR@[39; 40) |
47 | PATH_SEGMENT@[39; 40) | 47 | PATH@[39; 40) |
48 | NAME_REF@[39; 40) | 48 | PATH_SEGMENT@[39; 40) |
49 | IDENT@[39; 40) "x" | 49 | NAME_REF@[39; 40) |
50 | DOT@[40; 41) "." | 50 | IDENT@[39; 40) "x" |
51 | NAME_REF@[41; 42) | 51 | DOT@[40; 41) "." |
52 | INT_NUMBER@[41; 42) "0" | 52 | NAME_REF@[41; 42) |
53 | ARG_LIST@[42; 44) | 53 | INT_NUMBER@[41; 42) "0" |
54 | L_PAREN@[42; 43) "(" | 54 | ARG_LIST@[42; 44) |
55 | R_PAREN@[43; 44) ")" | 55 | L_PAREN@[42; 43) "(" |
56 | SEMI@[44; 45) ";" | 56 | R_PAREN@[43; 44) ")" |
57 | WHITESPACE@[45; 46) "\n" | 57 | SEMI@[44; 45) ";" |
58 | R_CURLY@[46; 47) "}" | 58 | WHITESPACE@[45; 46) "\n" |
59 | R_CURLY@[46; 47) "}" | ||
59 | WHITESPACE@[47; 48) "\n" | 60 | WHITESPACE@[47; 48) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt index e8cc32f2c..c051c1c86 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.txt | |||
@@ -8,28 +8,30 @@ SOURCE_FILE@[0; 69) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 68) | 11 | BLOCK_EXPR@[9; 68) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 68) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LOOP_EXPR@[15; 66) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LOOP_KW@[15; 19) "loop" | 15 | LOOP_EXPR@[15; 66) |
16 | WHITESPACE@[19; 20) " " | 16 | LOOP_KW@[15; 19) "loop" |
17 | BLOCK@[20; 66) | 17 | WHITESPACE@[19; 20) " " |
18 | L_CURLY@[20; 21) "{" | 18 | BLOCK_EXPR@[20; 66) |
19 | WHITESPACE@[21; 30) "\n " | 19 | BLOCK@[20; 66) |
20 | EXPR_STMT@[30; 39) | 20 | L_CURLY@[20; 21) "{" |
21 | CONTINUE_EXPR@[30; 38) | 21 | WHITESPACE@[21; 30) "\n " |
22 | CONTINUE_KW@[30; 38) "continue" | 22 | EXPR_STMT@[30; 39) |
23 | SEMI@[38; 39) ";" | 23 | CONTINUE_EXPR@[30; 38) |
24 | WHITESPACE@[39; 48) "\n " | 24 | CONTINUE_KW@[30; 38) "continue" |
25 | EXPR_STMT@[48; 60) | 25 | SEMI@[38; 39) ";" |
26 | CONTINUE_EXPR@[48; 59) | 26 | WHITESPACE@[39; 48) "\n " |
27 | CONTINUE_KW@[48; 56) "continue" | 27 | EXPR_STMT@[48; 60) |
28 | WHITESPACE@[56; 57) " " | 28 | CONTINUE_EXPR@[48; 59) |
29 | LIFETIME@[57; 59) "\'l" | 29 | CONTINUE_KW@[48; 56) "continue" |
30 | SEMI@[59; 60) ";" | 30 | WHITESPACE@[56; 57) " " |
31 | WHITESPACE@[60; 65) "\n " | 31 | LIFETIME@[57; 59) "\'l" |
32 | R_CURLY@[65; 66) "}" | 32 | SEMI@[59; 60) ";" |
33 | WHITESPACE@[66; 67) "\n" | 33 | WHITESPACE@[60; 65) "\n " |
34 | R_CURLY@[67; 68) "}" | 34 | R_CURLY@[65; 66) "}" |
35 | WHITESPACE@[66; 67) "\n" | ||
36 | R_CURLY@[67; 68) "}" | ||
35 | WHITESPACE@[68; 69) "\n" | 37 | WHITESPACE@[68; 69) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt index 67d0de0f0..d0beeb81e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.txt | |||
@@ -31,9 +31,10 @@ SOURCE_FILE@[0; 69) | |||
31 | IDENT@[25; 29) "Self" | 31 | IDENT@[25; 29) "Self" |
32 | R_PAREN@[29; 30) ")" | 32 | R_PAREN@[29; 30) ")" |
33 | WHITESPACE@[30; 31) " " | 33 | WHITESPACE@[30; 31) " " |
34 | BLOCK@[31; 33) | 34 | BLOCK_EXPR@[31; 33) |
35 | L_CURLY@[31; 32) "{" | 35 | BLOCK@[31; 33) |
36 | R_CURLY@[32; 33) "}" | 36 | L_CURLY@[31; 32) "{" |
37 | R_CURLY@[32; 33) "}" | ||
37 | WHITESPACE@[33; 38) "\n " | 38 | WHITESPACE@[33; 38) "\n " |
38 | FN_DEF@[38; 66) | 39 | FN_DEF@[38; 66) |
39 | FN_KW@[38; 40) "fn" | 40 | FN_KW@[38; 40) "fn" |
@@ -64,9 +65,10 @@ SOURCE_FILE@[0; 69) | |||
64 | R_ANGLE@[61; 62) ">" | 65 | R_ANGLE@[61; 62) ">" |
65 | R_PAREN@[62; 63) ")" | 66 | R_PAREN@[62; 63) ")" |
66 | WHITESPACE@[63; 64) " " | 67 | WHITESPACE@[63; 64) " " |
67 | BLOCK@[64; 66) | 68 | BLOCK_EXPR@[64; 66) |
68 | L_CURLY@[64; 65) "{" | 69 | BLOCK@[64; 66) |
69 | R_CURLY@[65; 66) "}" | 70 | L_CURLY@[64; 65) "{" |
71 | R_CURLY@[65; 66) "}" | ||
70 | WHITESPACE@[66; 67) "\n" | 72 | WHITESPACE@[66; 67) "\n" |
71 | R_CURLY@[67; 68) "}" | 73 | R_CURLY@[67; 68) "}" |
72 | WHITESPACE@[68; 69) "\n" | 74 | WHITESPACE@[68; 69) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt index 42032f56c..2d71efd86 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.txt | |||
@@ -8,37 +8,38 @@ SOURCE_FILE@[0; 44) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 43) | 11 | BLOCK_EXPR@[9; 43) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 43) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 20) | 14 | WHITESPACE@[10; 15) "\n " |
15 | PREFIX_EXPR@[15; 19) | 15 | EXPR_STMT@[15; 20) |
16 | STAR@[15; 16) "*" | 16 | PREFIX_EXPR@[15; 19) |
17 | PREFIX_EXPR@[16; 19) | 17 | STAR@[15; 16) "*" |
18 | STAR@[16; 17) "*" | 18 | PREFIX_EXPR@[16; 19) |
19 | REF_EXPR@[17; 19) | 19 | STAR@[16; 17) "*" |
20 | AMP@[17; 18) "&" | 20 | REF_EXPR@[17; 19) |
21 | LITERAL@[18; 19) | 21 | AMP@[17; 18) "&" |
22 | INT_NUMBER@[18; 19) "1" | 22 | LITERAL@[18; 19) |
23 | SEMI@[19; 20) ";" | 23 | INT_NUMBER@[18; 19) "1" |
24 | WHITESPACE@[20; 25) "\n " | 24 | SEMI@[19; 20) ";" |
25 | EXPR_STMT@[25; 32) | 25 | WHITESPACE@[20; 25) "\n " |
26 | PREFIX_EXPR@[25; 31) | 26 | EXPR_STMT@[25; 32) |
27 | EXCL@[25; 26) "!" | 27 | PREFIX_EXPR@[25; 31) |
28 | PREFIX_EXPR@[26; 31) | 28 | EXCL@[25; 26) "!" |
29 | EXCL@[26; 27) "!" | 29 | PREFIX_EXPR@[26; 31) |
30 | LITERAL@[27; 31) | 30 | EXCL@[26; 27) "!" |
31 | TRUE_KW@[27; 31) "true" | 31 | LITERAL@[27; 31) |
32 | SEMI@[31; 32) ";" | 32 | TRUE_KW@[27; 31) "true" |
33 | WHITESPACE@[32; 37) "\n " | 33 | SEMI@[31; 32) ";" |
34 | EXPR_STMT@[37; 41) | 34 | WHITESPACE@[32; 37) "\n " |
35 | PREFIX_EXPR@[37; 40) | 35 | EXPR_STMT@[37; 41) |
36 | MINUS@[37; 38) "-" | 36 | PREFIX_EXPR@[37; 40) |
37 | PREFIX_EXPR@[38; 40) | 37 | MINUS@[37; 38) "-" |
38 | MINUS@[38; 39) "-" | 38 | PREFIX_EXPR@[38; 40) |
39 | LITERAL@[39; 40) | 39 | MINUS@[38; 39) "-" |
40 | INT_NUMBER@[39; 40) "1" | 40 | LITERAL@[39; 40) |
41 | SEMI@[40; 41) ";" | 41 | INT_NUMBER@[39; 40) "1" |
42 | WHITESPACE@[41; 42) "\n" | 42 | SEMI@[40; 41) ";" |
43 | R_CURLY@[42; 43) "}" | 43 | WHITESPACE@[41; 42) "\n" |
44 | R_CURLY@[42; 43) "}" | ||
44 | WHITESPACE@[43; 44) "\n" | 45 | WHITESPACE@[43; 44) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt index a893833e1..0768f0518 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.txt | |||
@@ -54,9 +54,10 @@ SOURCE_FILE@[0; 89) | |||
54 | L_PAREN@[60; 61) "(" | 54 | L_PAREN@[60; 61) "(" |
55 | R_PAREN@[61; 62) ")" | 55 | R_PAREN@[61; 62) ")" |
56 | WHITESPACE@[62; 63) " " | 56 | WHITESPACE@[62; 63) " " |
57 | BLOCK@[63; 65) | 57 | BLOCK_EXPR@[63; 65) |
58 | L_CURLY@[63; 64) "{" | 58 | BLOCK@[63; 65) |
59 | R_CURLY@[64; 65) "}" | 59 | L_CURLY@[63; 64) "{" |
60 | R_CURLY@[64; 65) "}" | ||
60 | WHITESPACE@[65; 70) "\n " | 61 | WHITESPACE@[65; 70) "\n " |
61 | FN_DEF@[70; 86) | 62 | FN_DEF@[70; 86) |
62 | FN_KW@[70; 72) "fn" | 63 | FN_KW@[70; 72) "fn" |
@@ -70,9 +71,10 @@ SOURCE_FILE@[0; 89) | |||
70 | SELF_KW@[78; 82) "self" | 71 | SELF_KW@[78; 82) "self" |
71 | R_PAREN@[82; 83) ")" | 72 | R_PAREN@[82; 83) ")" |
72 | WHITESPACE@[83; 84) " " | 73 | WHITESPACE@[83; 84) " " |
73 | BLOCK@[84; 86) | 74 | BLOCK_EXPR@[84; 86) |
74 | L_CURLY@[84; 85) "{" | 75 | BLOCK@[84; 86) |
75 | R_CURLY@[85; 86) "}" | 76 | L_CURLY@[84; 85) "{" |
77 | R_CURLY@[85; 86) "}" | ||
76 | WHITESPACE@[86; 87) "\n" | 78 | WHITESPACE@[86; 87) "\n" |
77 | R_CURLY@[87; 88) "}" | 79 | R_CURLY@[87; 88) "}" |
78 | WHITESPACE@[88; 89) "\n" | 80 | WHITESPACE@[88; 89) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt index 40ddbfbf6..c1d669e54 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.txt | |||
@@ -8,33 +8,34 @@ SOURCE_FILE@[0; 39) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 38) | 11 | BLOCK_EXPR@[10; 38) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 38) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 36) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 36) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | SLICE_PAT@[20; 30) | 17 | WHITESPACE@[19; 20) " " |
18 | L_BRACK@[20; 21) "[" | 18 | SLICE_PAT@[20; 30) |
19 | BIND_PAT@[21; 22) | 19 | L_BRACK@[20; 21) "[" |
20 | NAME@[21; 22) | 20 | BIND_PAT@[21; 22) |
21 | IDENT@[21; 22) "a" | 21 | NAME@[21; 22) |
22 | COMMA@[22; 23) "," | 22 | IDENT@[21; 22) "a" |
23 | WHITESPACE@[23; 24) " " | 23 | COMMA@[22; 23) "," |
24 | BIND_PAT@[24; 25) | 24 | WHITESPACE@[23; 24) " " |
25 | NAME@[24; 25) | 25 | BIND_PAT@[24; 25) |
26 | IDENT@[24; 25) "b" | 26 | NAME@[24; 25) |
27 | COMMA@[25; 26) "," | 27 | IDENT@[24; 25) "b" |
28 | WHITESPACE@[26; 27) " " | 28 | COMMA@[25; 26) "," |
29 | DOTDOT@[27; 29) ".." | 29 | WHITESPACE@[26; 27) " " |
30 | R_BRACK@[29; 30) "]" | 30 | DOTDOT@[27; 29) ".." |
31 | WHITESPACE@[30; 31) " " | 31 | R_BRACK@[29; 30) "]" |
32 | EQ@[31; 32) "=" | 32 | WHITESPACE@[30; 31) " " |
33 | WHITESPACE@[32; 33) " " | 33 | EQ@[31; 32) "=" |
34 | ARRAY_EXPR@[33; 35) | 34 | WHITESPACE@[32; 33) " " |
35 | L_BRACK@[33; 34) "[" | 35 | ARRAY_EXPR@[33; 35) |
36 | R_BRACK@[34; 35) "]" | 36 | L_BRACK@[33; 34) "[" |
37 | SEMI@[35; 36) ";" | 37 | R_BRACK@[34; 35) "]" |
38 | WHITESPACE@[36; 37) "\n" | 38 | SEMI@[35; 36) ";" |
39 | R_CURLY@[37; 38) "}" | 39 | WHITESPACE@[36; 37) "\n" |
40 | R_CURLY@[37; 38) "}" | ||
40 | WHITESPACE@[38; 39) "\n" | 41 | WHITESPACE@[38; 39) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt index 0ff936471..adc8931e2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.txt | |||
@@ -8,96 +8,97 @@ SOURCE_FILE@[0; 97) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 96) | 11 | BLOCK_EXPR@[9; 96) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 96) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 28) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 28) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | TUPLE_STRUCT_PAT@[19; 22) | 17 | WHITESPACE@[18; 19) " " |
18 | PATH@[19; 20) | 18 | TUPLE_STRUCT_PAT@[19; 22) |
19 | PATH_SEGMENT@[19; 20) | 19 | PATH@[19; 20) |
20 | NAME_REF@[19; 20) | 20 | PATH_SEGMENT@[19; 20) |
21 | IDENT@[19; 20) "S" | 21 | NAME_REF@[19; 20) |
22 | L_PAREN@[20; 21) "(" | 22 | IDENT@[19; 20) "S" |
23 | R_PAREN@[21; 22) ")" | 23 | L_PAREN@[20; 21) "(" |
24 | WHITESPACE@[22; 23) " " | 24 | R_PAREN@[21; 22) ")" |
25 | EQ@[23; 24) "=" | 25 | WHITESPACE@[22; 23) " " |
26 | WHITESPACE@[24; 25) " " | 26 | EQ@[23; 24) "=" |
27 | TUPLE_EXPR@[25; 27) | 27 | WHITESPACE@[24; 25) " " |
28 | L_PAREN@[25; 26) "(" | 28 | TUPLE_EXPR@[25; 27) |
29 | R_PAREN@[26; 27) ")" | 29 | L_PAREN@[25; 26) "(" |
30 | SEMI@[27; 28) ";" | 30 | R_PAREN@[26; 27) ")" |
31 | WHITESPACE@[28; 33) "\n " | 31 | SEMI@[27; 28) ";" |
32 | LET_STMT@[33; 47) | 32 | WHITESPACE@[28; 33) "\n " |
33 | LET_KW@[33; 36) "let" | 33 | LET_STMT@[33; 47) |
34 | WHITESPACE@[36; 37) " " | 34 | LET_KW@[33; 36) "let" |
35 | TUPLE_STRUCT_PAT@[37; 41) | 35 | WHITESPACE@[36; 37) " " |
36 | PATH@[37; 38) | 36 | TUPLE_STRUCT_PAT@[37; 41) |
37 | PATH_SEGMENT@[37; 38) | 37 | PATH@[37; 38) |
38 | NAME_REF@[37; 38) | 38 | PATH_SEGMENT@[37; 38) |
39 | IDENT@[37; 38) "S" | 39 | NAME_REF@[37; 38) |
40 | L_PAREN@[38; 39) "(" | 40 | IDENT@[37; 38) "S" |
41 | PLACEHOLDER_PAT@[39; 40) | 41 | L_PAREN@[38; 39) "(" |
42 | UNDERSCORE@[39; 40) "_" | 42 | PLACEHOLDER_PAT@[39; 40) |
43 | R_PAREN@[40; 41) ")" | 43 | UNDERSCORE@[39; 40) "_" |
44 | WHITESPACE@[41; 42) " " | 44 | R_PAREN@[40; 41) ")" |
45 | EQ@[42; 43) "=" | 45 | WHITESPACE@[41; 42) " " |
46 | WHITESPACE@[43; 44) " " | 46 | EQ@[42; 43) "=" |
47 | TUPLE_EXPR@[44; 46) | 47 | WHITESPACE@[43; 44) " " |
48 | L_PAREN@[44; 45) "(" | 48 | TUPLE_EXPR@[44; 46) |
49 | R_PAREN@[45; 46) ")" | 49 | L_PAREN@[44; 45) "(" |
50 | SEMI@[46; 47) ";" | 50 | R_PAREN@[45; 46) ")" |
51 | WHITESPACE@[47; 52) "\n " | 51 | SEMI@[46; 47) ";" |
52 | LET_STMT@[52; 67) | 52 | WHITESPACE@[47; 52) "\n " |
53 | LET_KW@[52; 55) "let" | 53 | LET_STMT@[52; 67) |
54 | WHITESPACE@[55; 56) " " | 54 | LET_KW@[52; 55) "let" |
55 | TUPLE_STRUCT_PAT@[56; 61) | 55 | WHITESPACE@[55; 56) " " |
56 | PATH@[56; 57) | 56 | TUPLE_STRUCT_PAT@[56; 61) |
57 | PATH_SEGMENT@[56; 57) | 57 | PATH@[56; 57) |
58 | NAME_REF@[56; 57) | 58 | PATH_SEGMENT@[56; 57) |
59 | IDENT@[56; 57) "S" | 59 | NAME_REF@[56; 57) |
60 | L_PAREN@[57; 58) "(" | 60 | IDENT@[56; 57) "S" |
61 | PLACEHOLDER_PAT@[58; 59) | 61 | L_PAREN@[57; 58) "(" |
62 | UNDERSCORE@[58; 59) "_" | 62 | PLACEHOLDER_PAT@[58; 59) |
63 | COMMA@[59; 60) "," | 63 | UNDERSCORE@[58; 59) "_" |
64 | R_PAREN@[60; 61) ")" | 64 | COMMA@[59; 60) "," |
65 | WHITESPACE@[61; 62) " " | 65 | R_PAREN@[60; 61) ")" |
66 | EQ@[62; 63) "=" | 66 | WHITESPACE@[61; 62) " " |
67 | WHITESPACE@[63; 64) " " | 67 | EQ@[62; 63) "=" |
68 | TUPLE_EXPR@[64; 66) | 68 | WHITESPACE@[63; 64) " " |
69 | L_PAREN@[64; 65) "(" | 69 | TUPLE_EXPR@[64; 66) |
70 | R_PAREN@[65; 66) ")" | 70 | L_PAREN@[64; 65) "(" |
71 | SEMI@[66; 67) ";" | 71 | R_PAREN@[65; 66) ")" |
72 | WHITESPACE@[67; 72) "\n " | 72 | SEMI@[66; 67) ";" |
73 | LET_STMT@[72; 94) | 73 | WHITESPACE@[67; 72) "\n " |
74 | LET_KW@[72; 75) "let" | 74 | LET_STMT@[72; 94) |
75 | WHITESPACE@[75; 76) " " | 75 | LET_KW@[72; 75) "let" |
76 | TUPLE_STRUCT_PAT@[76; 88) | 76 | WHITESPACE@[75; 76) " " |
77 | PATH@[76; 77) | 77 | TUPLE_STRUCT_PAT@[76; 88) |
78 | PATH_SEGMENT@[76; 77) | 78 | PATH@[76; 77) |
79 | NAME_REF@[76; 77) | 79 | PATH_SEGMENT@[76; 77) |
80 | IDENT@[76; 77) "S" | 80 | NAME_REF@[76; 77) |
81 | L_PAREN@[77; 78) "(" | 81 | IDENT@[76; 77) "S" |
82 | PLACEHOLDER_PAT@[78; 79) | 82 | L_PAREN@[77; 78) "(" |
83 | UNDERSCORE@[78; 79) "_" | 83 | PLACEHOLDER_PAT@[78; 79) |
84 | COMMA@[79; 80) "," | 84 | UNDERSCORE@[78; 79) "_" |
85 | WHITESPACE@[80; 81) " " | 85 | COMMA@[79; 80) "," |
86 | DOTDOT@[81; 83) ".." | 86 | WHITESPACE@[80; 81) " " |
87 | WHITESPACE@[83; 84) " " | 87 | DOTDOT@[81; 83) ".." |
88 | COMMA@[84; 85) "," | 88 | WHITESPACE@[83; 84) " " |
89 | WHITESPACE@[85; 86) " " | 89 | COMMA@[84; 85) "," |
90 | BIND_PAT@[86; 87) | 90 | WHITESPACE@[85; 86) " " |
91 | NAME@[86; 87) | 91 | BIND_PAT@[86; 87) |
92 | IDENT@[86; 87) "x" | 92 | NAME@[86; 87) |
93 | R_PAREN@[87; 88) ")" | 93 | IDENT@[86; 87) "x" |
94 | WHITESPACE@[88; 89) " " | 94 | R_PAREN@[87; 88) ")" |
95 | EQ@[89; 90) "=" | 95 | WHITESPACE@[88; 89) " " |
96 | WHITESPACE@[90; 91) " " | 96 | EQ@[89; 90) "=" |
97 | TUPLE_EXPR@[91; 93) | 97 | WHITESPACE@[90; 91) " " |
98 | L_PAREN@[91; 92) "(" | 98 | TUPLE_EXPR@[91; 93) |
99 | R_PAREN@[92; 93) ")" | 99 | L_PAREN@[91; 92) "(" |
100 | SEMI@[93; 94) ";" | 100 | R_PAREN@[92; 93) ")" |
101 | WHITESPACE@[94; 95) "\n" | 101 | SEMI@[93; 94) ";" |
102 | R_CURLY@[95; 96) "}" | 102 | WHITESPACE@[94; 95) "\n" |
103 | R_CURLY@[95; 96) "}" | ||
103 | WHITESPACE@[96; 97) "\n" | 104 | WHITESPACE@[96; 97) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt index a833b1b96..0f1a367f7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.txt | |||
@@ -8,42 +8,43 @@ SOURCE_FILE@[0; 52) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 51) | 11 | BLOCK_EXPR@[10; 51) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 51) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 28) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 28) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | REF_PAT@[20; 22) | 17 | WHITESPACE@[19; 20) " " |
18 | AMP@[20; 21) "&" | 18 | REF_PAT@[20; 22) |
19 | BIND_PAT@[21; 22) | 19 | AMP@[20; 21) "&" |
20 | NAME@[21; 22) | 20 | BIND_PAT@[21; 22) |
21 | IDENT@[21; 22) "a" | 21 | NAME@[21; 22) |
22 | WHITESPACE@[22; 23) " " | 22 | IDENT@[21; 22) "a" |
23 | EQ@[23; 24) "=" | 23 | WHITESPACE@[22; 23) " " |
24 | WHITESPACE@[24; 25) " " | 24 | EQ@[23; 24) "=" |
25 | TUPLE_EXPR@[25; 27) | 25 | WHITESPACE@[24; 25) " " |
26 | L_PAREN@[25; 26) "(" | 26 | TUPLE_EXPR@[25; 27) |
27 | R_PAREN@[26; 27) ")" | 27 | L_PAREN@[25; 26) "(" |
28 | SEMI@[27; 28) ";" | 28 | R_PAREN@[26; 27) ")" |
29 | WHITESPACE@[28; 33) "\n " | 29 | SEMI@[27; 28) ";" |
30 | LET_STMT@[33; 49) | 30 | WHITESPACE@[28; 33) "\n " |
31 | LET_KW@[33; 36) "let" | 31 | LET_STMT@[33; 49) |
32 | WHITESPACE@[36; 37) " " | 32 | LET_KW@[33; 36) "let" |
33 | REF_PAT@[37; 43) | 33 | WHITESPACE@[36; 37) " " |
34 | AMP@[37; 38) "&" | 34 | REF_PAT@[37; 43) |
35 | MUT_KW@[38; 41) "mut" | 35 | AMP@[37; 38) "&" |
36 | WHITESPACE@[41; 42) " " | 36 | MUT_KW@[38; 41) "mut" |
37 | BIND_PAT@[42; 43) | 37 | WHITESPACE@[41; 42) " " |
38 | NAME@[42; 43) | 38 | BIND_PAT@[42; 43) |
39 | IDENT@[42; 43) "b" | 39 | NAME@[42; 43) |
40 | WHITESPACE@[43; 44) " " | 40 | IDENT@[42; 43) "b" |
41 | EQ@[44; 45) "=" | 41 | WHITESPACE@[43; 44) " " |
42 | WHITESPACE@[45; 46) " " | 42 | EQ@[44; 45) "=" |
43 | TUPLE_EXPR@[46; 48) | 43 | WHITESPACE@[45; 46) " " |
44 | L_PAREN@[46; 47) "(" | 44 | TUPLE_EXPR@[46; 48) |
45 | R_PAREN@[47; 48) ")" | 45 | L_PAREN@[46; 47) "(" |
46 | SEMI@[48; 49) ";" | 46 | R_PAREN@[47; 48) ")" |
47 | WHITESPACE@[49; 50) "\n" | 47 | SEMI@[48; 49) ";" |
48 | R_CURLY@[50; 51) "}" | 48 | WHITESPACE@[49; 50) "\n" |
49 | R_CURLY@[50; 51) "}" | ||
49 | WHITESPACE@[51; 52) "\n" | 50 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt index 11c14e3b4..b17a2c257 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.txt | |||
@@ -8,82 +8,83 @@ SOURCE_FILE@[0; 89) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 88) | 11 | BLOCK_EXPR@[9; 88) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 88) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 25) | 14 | WHITESPACE@[10; 15) "\n " |
15 | CAST_EXPR@[15; 24) | 15 | EXPR_STMT@[15; 25) |
16 | LITERAL@[15; 17) | 16 | CAST_EXPR@[15; 24) |
17 | INT_NUMBER@[15; 17) "82" | 17 | LITERAL@[15; 17) |
18 | WHITESPACE@[17; 18) " " | 18 | INT_NUMBER@[15; 17) "82" |
19 | AS_KW@[18; 20) "as" | 19 | WHITESPACE@[17; 18) " " |
20 | WHITESPACE@[20; 21) " " | 20 | AS_KW@[18; 20) "as" |
21 | PATH_TYPE@[21; 24) | 21 | WHITESPACE@[20; 21) " " |
22 | PATH@[21; 24) | 22 | PATH_TYPE@[21; 24) |
23 | PATH_SEGMENT@[21; 24) | 23 | PATH@[21; 24) |
24 | NAME_REF@[21; 24) | 24 | PATH_SEGMENT@[21; 24) |
25 | IDENT@[21; 24) "i32" | 25 | NAME_REF@[21; 24) |
26 | SEMI@[24; 25) ";" | 26 | IDENT@[21; 24) "i32" |
27 | WHITESPACE@[25; 30) "\n " | 27 | SEMI@[24; 25) ";" |
28 | EXPR_STMT@[30; 43) | 28 | WHITESPACE@[25; 30) "\n " |
29 | BIN_EXPR@[30; 42) | 29 | EXPR_STMT@[30; 43) |
30 | CAST_EXPR@[30; 38) | 30 | BIN_EXPR@[30; 42) |
31 | LITERAL@[30; 32) | 31 | CAST_EXPR@[30; 38) |
32 | INT_NUMBER@[30; 32) "81" | 32 | LITERAL@[30; 32) |
33 | WHITESPACE@[32; 33) " " | 33 | INT_NUMBER@[30; 32) "81" |
34 | AS_KW@[33; 35) "as" | 34 | WHITESPACE@[32; 33) " " |
35 | WHITESPACE@[35; 36) " " | 35 | AS_KW@[33; 35) "as" |
36 | PATH_TYPE@[36; 38) | 36 | WHITESPACE@[35; 36) " " |
37 | PATH@[36; 38) | 37 | PATH_TYPE@[36; 38) |
38 | PATH_SEGMENT@[36; 38) | 38 | PATH@[36; 38) |
39 | NAME_REF@[36; 38) | 39 | PATH_SEGMENT@[36; 38) |
40 | IDENT@[36; 38) "i8" | 40 | NAME_REF@[36; 38) |
41 | WHITESPACE@[38; 39) " " | 41 | IDENT@[36; 38) "i8" |
42 | PLUS@[39; 40) "+" | 42 | WHITESPACE@[38; 39) " " |
43 | WHITESPACE@[40; 41) " " | 43 | PLUS@[39; 40) "+" |
44 | LITERAL@[41; 42) | 44 | WHITESPACE@[40; 41) " " |
45 | INT_NUMBER@[41; 42) "1" | 45 | LITERAL@[41; 42) |
46 | SEMI@[42; 43) ";" | 46 | INT_NUMBER@[41; 42) "1" |
47 | WHITESPACE@[43; 48) "\n " | 47 | SEMI@[42; 43) ";" |
48 | EXPR_STMT@[48; 62) | 48 | WHITESPACE@[43; 48) "\n " |
49 | BIN_EXPR@[48; 61) | 49 | EXPR_STMT@[48; 62) |
50 | CAST_EXPR@[48; 57) | 50 | BIN_EXPR@[48; 61) |
51 | LITERAL@[48; 50) | 51 | CAST_EXPR@[48; 57) |
52 | INT_NUMBER@[48; 50) "79" | 52 | LITERAL@[48; 50) |
53 | WHITESPACE@[50; 51) " " | 53 | INT_NUMBER@[48; 50) "79" |
54 | AS_KW@[51; 53) "as" | 54 | WHITESPACE@[50; 51) " " |
55 | WHITESPACE@[53; 54) " " | 55 | AS_KW@[51; 53) "as" |
56 | PATH_TYPE@[54; 57) | 56 | WHITESPACE@[53; 54) " " |
57 | PATH@[54; 57) | 57 | PATH_TYPE@[54; 57) |
58 | PATH_SEGMENT@[54; 57) | 58 | PATH@[54; 57) |
59 | NAME_REF@[54; 57) | 59 | PATH_SEGMENT@[54; 57) |
60 | IDENT@[54; 57) "i16" | 60 | NAME_REF@[54; 57) |
61 | WHITESPACE@[57; 58) " " | 61 | IDENT@[54; 57) "i16" |
62 | MINUS@[58; 59) "-" | 62 | WHITESPACE@[57; 58) " " |
63 | WHITESPACE@[59; 60) " " | 63 | MINUS@[58; 59) "-" |
64 | LITERAL@[60; 61) | 64 | WHITESPACE@[59; 60) " " |
65 | INT_NUMBER@[60; 61) "1" | 65 | LITERAL@[60; 61) |
66 | SEMI@[61; 62) ";" | 66 | INT_NUMBER@[60; 61) "1" |
67 | WHITESPACE@[62; 67) "\n " | 67 | SEMI@[61; 62) ";" |
68 | EXPR_STMT@[67; 86) | 68 | WHITESPACE@[62; 67) "\n " |
69 | BIN_EXPR@[67; 85) | 69 | EXPR_STMT@[67; 86) |
70 | CAST_EXPR@[67; 77) | 70 | BIN_EXPR@[67; 85) |
71 | LITERAL@[67; 71) | 71 | CAST_EXPR@[67; 77) |
72 | INT_NUMBER@[67; 71) "0x36" | 72 | LITERAL@[67; 71) |
73 | WHITESPACE@[71; 72) " " | 73 | INT_NUMBER@[67; 71) "0x36" |
74 | AS_KW@[72; 74) "as" | 74 | WHITESPACE@[71; 72) " " |
75 | WHITESPACE@[74; 75) " " | 75 | AS_KW@[72; 74) "as" |
76 | PATH_TYPE@[75; 77) | 76 | WHITESPACE@[74; 75) " " |
77 | PATH@[75; 77) | 77 | PATH_TYPE@[75; 77) |
78 | PATH_SEGMENT@[75; 77) | 78 | PATH@[75; 77) |
79 | NAME_REF@[75; 77) | 79 | PATH_SEGMENT@[75; 77) |
80 | IDENT@[75; 77) "u8" | 80 | NAME_REF@[75; 77) |
81 | WHITESPACE@[77; 78) " " | 81 | IDENT@[75; 77) "u8" |
82 | LTEQ@[78; 80) "<=" | 82 | WHITESPACE@[77; 78) " " |
83 | WHITESPACE@[80; 81) " " | 83 | LTEQ@[78; 80) "<=" |
84 | LITERAL@[81; 85) | 84 | WHITESPACE@[80; 81) " " |
85 | INT_NUMBER@[81; 85) "0x37" | 85 | LITERAL@[81; 85) |
86 | SEMI@[85; 86) ";" | 86 | INT_NUMBER@[81; 85) "0x37" |
87 | WHITESPACE@[86; 87) "\n" | 87 | SEMI@[85; 86) ";" |
88 | R_CURLY@[87; 88) "}" | 88 | WHITESPACE@[86; 87) "\n" |
89 | R_CURLY@[87; 88) "}" | ||
89 | WHITESPACE@[88; 89) "\n" | 90 | WHITESPACE@[88; 89) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt index 1c9414b21..4028ca243 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.txt | |||
@@ -8,38 +8,40 @@ SOURCE_FILE@[0; 197) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 37) | 11 | BLOCK_EXPR@[9; 37) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 37) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | IF_EXPR@[11; 35) | 14 | WHITESPACE@[10; 11) " " |
15 | IF_KW@[11; 13) "if" | 15 | IF_EXPR@[11; 35) |
16 | WHITESPACE@[13; 14) " " | 16 | IF_KW@[11; 13) "if" |
17 | CONDITION@[14; 32) | 17 | WHITESPACE@[13; 14) " " |
18 | LET_KW@[14; 17) "let" | 18 | CONDITION@[14; 32) |
19 | WHITESPACE@[17; 18) " " | 19 | LET_KW@[14; 17) "let" |
20 | TUPLE_STRUCT_PAT@[18; 25) | 20 | WHITESPACE@[17; 18) " " |
21 | PATH@[18; 22) | 21 | TUPLE_STRUCT_PAT@[18; 25) |
22 | PATH_SEGMENT@[18; 22) | 22 | PATH@[18; 22) |
23 | NAME_REF@[18; 22) | 23 | PATH_SEGMENT@[18; 22) |
24 | IDENT@[18; 22) "Some" | 24 | NAME_REF@[18; 22) |
25 | L_PAREN@[22; 23) "(" | 25 | IDENT@[18; 22) "Some" |
26 | PLACEHOLDER_PAT@[23; 24) | 26 | L_PAREN@[22; 23) "(" |
27 | UNDERSCORE@[23; 24) "_" | 27 | PLACEHOLDER_PAT@[23; 24) |
28 | R_PAREN@[24; 25) ")" | 28 | UNDERSCORE@[23; 24) "_" |
29 | WHITESPACE@[25; 26) " " | 29 | R_PAREN@[24; 25) ")" |
30 | EQ@[26; 27) "=" | 30 | WHITESPACE@[25; 26) " " |
31 | WHITESPACE@[27; 28) " " | 31 | EQ@[26; 27) "=" |
32 | PATH_EXPR@[28; 32) | 32 | WHITESPACE@[27; 28) " " |
33 | PATH@[28; 32) | 33 | PATH_EXPR@[28; 32) |
34 | PATH_SEGMENT@[28; 32) | 34 | PATH@[28; 32) |
35 | NAME_REF@[28; 32) | 35 | PATH_SEGMENT@[28; 32) |
36 | IDENT@[28; 32) "None" | 36 | NAME_REF@[28; 32) |
37 | WHITESPACE@[32; 33) " " | 37 | IDENT@[28; 32) "None" |
38 | BLOCK@[33; 35) | 38 | WHITESPACE@[32; 33) " " |
39 | L_CURLY@[33; 34) "{" | 39 | BLOCK_EXPR@[33; 35) |
40 | R_CURLY@[34; 35) "}" | 40 | BLOCK@[33; 35) |
41 | WHITESPACE@[35; 36) " " | 41 | L_CURLY@[33; 34) "{" |
42 | R_CURLY@[36; 37) "}" | 42 | R_CURLY@[34; 35) "}" |
43 | WHITESPACE@[35; 36) " " | ||
44 | R_CURLY@[36; 37) "}" | ||
43 | WHITESPACE@[37; 38) "\n" | 45 | WHITESPACE@[37; 38) "\n" |
44 | FN_DEF@[38; 196) | 46 | FN_DEF@[38; 196) |
45 | FN_KW@[38; 40) "fn" | 47 | FN_KW@[38; 40) "fn" |
@@ -50,151 +52,156 @@ SOURCE_FILE@[0; 197) | |||
50 | L_PAREN@[44; 45) "(" | 52 | L_PAREN@[44; 45) "(" |
51 | R_PAREN@[45; 46) ")" | 53 | R_PAREN@[45; 46) ")" |
52 | WHITESPACE@[46; 47) " " | 54 | WHITESPACE@[46; 47) " " |
53 | BLOCK@[47; 196) | 55 | BLOCK_EXPR@[47; 196) |
54 | L_CURLY@[47; 48) "{" | 56 | BLOCK@[47; 196) |
55 | WHITESPACE@[48; 53) "\n " | 57 | L_CURLY@[47; 48) "{" |
56 | EXPR_STMT@[53; 87) | 58 | WHITESPACE@[48; 53) "\n " |
57 | IF_EXPR@[53; 87) | 59 | EXPR_STMT@[53; 87) |
58 | IF_KW@[53; 55) "if" | 60 | IF_EXPR@[53; 87) |
59 | WHITESPACE@[55; 56) " " | 61 | IF_KW@[53; 55) "if" |
60 | CONDITION@[56; 84) | 62 | WHITESPACE@[55; 56) " " |
61 | LET_KW@[56; 59) "let" | 63 | CONDITION@[56; 84) |
62 | WHITESPACE@[59; 60) " " | 64 | LET_KW@[56; 59) "let" |
63 | TUPLE_STRUCT_PAT@[60; 67) | 65 | WHITESPACE@[59; 60) " " |
64 | PATH@[60; 64) | 66 | TUPLE_STRUCT_PAT@[60; 67) |
65 | PATH_SEGMENT@[60; 64) | 67 | PATH@[60; 64) |
66 | NAME_REF@[60; 64) | 68 | PATH_SEGMENT@[60; 64) |
67 | IDENT@[60; 64) "Some" | 69 | NAME_REF@[60; 64) |
68 | L_PAREN@[64; 65) "(" | 70 | IDENT@[60; 64) "Some" |
69 | PLACEHOLDER_PAT@[65; 66) | 71 | L_PAREN@[64; 65) "(" |
70 | UNDERSCORE@[65; 66) "_" | 72 | PLACEHOLDER_PAT@[65; 66) |
71 | R_PAREN@[66; 67) ")" | 73 | UNDERSCORE@[65; 66) "_" |
72 | WHITESPACE@[67; 68) " " | 74 | R_PAREN@[66; 67) ")" |
73 | PIPE@[68; 69) "|" | 75 | WHITESPACE@[67; 68) " " |
74 | WHITESPACE@[69; 70) " " | 76 | PIPE@[68; 69) "|" |
75 | TUPLE_STRUCT_PAT@[70; 77) | 77 | WHITESPACE@[69; 70) " " |
76 | PATH@[70; 74) | 78 | TUPLE_STRUCT_PAT@[70; 77) |
77 | PATH_SEGMENT@[70; 74) | 79 | PATH@[70; 74) |
78 | NAME_REF@[70; 74) | 80 | PATH_SEGMENT@[70; 74) |
79 | IDENT@[70; 74) "Some" | 81 | NAME_REF@[70; 74) |
80 | L_PAREN@[74; 75) "(" | 82 | IDENT@[70; 74) "Some" |
81 | PLACEHOLDER_PAT@[75; 76) | 83 | L_PAREN@[74; 75) "(" |
82 | UNDERSCORE@[75; 76) "_" | 84 | PLACEHOLDER_PAT@[75; 76) |
83 | R_PAREN@[76; 77) ")" | 85 | UNDERSCORE@[75; 76) "_" |
84 | WHITESPACE@[77; 78) " " | 86 | R_PAREN@[76; 77) ")" |
85 | EQ@[78; 79) "=" | 87 | WHITESPACE@[77; 78) " " |
86 | WHITESPACE@[79; 80) " " | 88 | EQ@[78; 79) "=" |
87 | PATH_EXPR@[80; 84) | 89 | WHITESPACE@[79; 80) " " |
88 | PATH@[80; 84) | 90 | PATH_EXPR@[80; 84) |
89 | PATH_SEGMENT@[80; 84) | 91 | PATH@[80; 84) |
90 | NAME_REF@[80; 84) | 92 | PATH_SEGMENT@[80; 84) |
91 | IDENT@[80; 84) "None" | 93 | NAME_REF@[80; 84) |
92 | WHITESPACE@[84; 85) " " | 94 | IDENT@[80; 84) "None" |
93 | BLOCK@[85; 87) | 95 | WHITESPACE@[84; 85) " " |
94 | L_CURLY@[85; 86) "{" | 96 | BLOCK_EXPR@[85; 87) |
95 | R_CURLY@[86; 87) "}" | 97 | BLOCK@[85; 87) |
96 | WHITESPACE@[87; 92) "\n " | 98 | L_CURLY@[85; 86) "{" |
97 | EXPR_STMT@[92; 118) | 99 | R_CURLY@[86; 87) "}" |
98 | IF_EXPR@[92; 118) | 100 | WHITESPACE@[87; 92) "\n " |
99 | IF_KW@[92; 94) "if" | 101 | EXPR_STMT@[92; 118) |
100 | WHITESPACE@[94; 95) " " | 102 | IF_EXPR@[92; 118) |
101 | CONDITION@[95; 115) | 103 | IF_KW@[92; 94) "if" |
102 | LET_KW@[95; 98) "let" | 104 | WHITESPACE@[94; 95) " " |
103 | WHITESPACE@[98; 99) " " | 105 | CONDITION@[95; 115) |
104 | PIPE@[99; 100) "|" | 106 | LET_KW@[95; 98) "let" |
105 | WHITESPACE@[100; 101) " " | 107 | WHITESPACE@[98; 99) " " |
106 | TUPLE_STRUCT_PAT@[101; 108) | 108 | PIPE@[99; 100) "|" |
107 | PATH@[101; 105) | 109 | WHITESPACE@[100; 101) " " |
108 | PATH_SEGMENT@[101; 105) | 110 | TUPLE_STRUCT_PAT@[101; 108) |
109 | NAME_REF@[101; 105) | 111 | PATH@[101; 105) |
110 | IDENT@[101; 105) "Some" | 112 | PATH_SEGMENT@[101; 105) |
111 | L_PAREN@[105; 106) "(" | 113 | NAME_REF@[101; 105) |
112 | PLACEHOLDER_PAT@[106; 107) | 114 | IDENT@[101; 105) "Some" |
113 | UNDERSCORE@[106; 107) "_" | 115 | L_PAREN@[105; 106) "(" |
114 | R_PAREN@[107; 108) ")" | 116 | PLACEHOLDER_PAT@[106; 107) |
115 | WHITESPACE@[108; 109) " " | 117 | UNDERSCORE@[106; 107) "_" |
116 | EQ@[109; 110) "=" | 118 | R_PAREN@[107; 108) ")" |
117 | WHITESPACE@[110; 111) " " | 119 | WHITESPACE@[108; 109) " " |
118 | PATH_EXPR@[111; 115) | 120 | EQ@[109; 110) "=" |
119 | PATH@[111; 115) | 121 | WHITESPACE@[110; 111) " " |
120 | PATH_SEGMENT@[111; 115) | 122 | PATH_EXPR@[111; 115) |
121 | NAME_REF@[111; 115) | 123 | PATH@[111; 115) |
122 | IDENT@[111; 115) "None" | 124 | PATH_SEGMENT@[111; 115) |
123 | WHITESPACE@[115; 116) " " | 125 | NAME_REF@[111; 115) |
124 | BLOCK@[116; 118) | 126 | IDENT@[111; 115) "None" |
125 | L_CURLY@[116; 117) "{" | 127 | WHITESPACE@[115; 116) " " |
126 | R_CURLY@[117; 118) "}" | 128 | BLOCK_EXPR@[116; 118) |
127 | WHITESPACE@[118; 123) "\n " | 129 | BLOCK@[116; 118) |
128 | EXPR_STMT@[123; 160) | 130 | L_CURLY@[116; 117) "{" |
129 | WHILE_EXPR@[123; 160) | 131 | R_CURLY@[117; 118) "}" |
130 | WHILE_KW@[123; 128) "while" | 132 | WHITESPACE@[118; 123) "\n " |
131 | WHITESPACE@[128; 129) " " | 133 | EXPR_STMT@[123; 160) |
132 | CONDITION@[129; 157) | 134 | WHILE_EXPR@[123; 160) |
133 | LET_KW@[129; 132) "let" | 135 | WHILE_KW@[123; 128) "while" |
134 | WHITESPACE@[132; 133) " " | 136 | WHITESPACE@[128; 129) " " |
135 | TUPLE_STRUCT_PAT@[133; 140) | 137 | CONDITION@[129; 157) |
136 | PATH@[133; 137) | 138 | LET_KW@[129; 132) "let" |
137 | PATH_SEGMENT@[133; 137) | 139 | WHITESPACE@[132; 133) " " |
138 | NAME_REF@[133; 137) | 140 | TUPLE_STRUCT_PAT@[133; 140) |
139 | IDENT@[133; 137) "Some" | 141 | PATH@[133; 137) |
140 | L_PAREN@[137; 138) "(" | 142 | PATH_SEGMENT@[133; 137) |
141 | PLACEHOLDER_PAT@[138; 139) | 143 | NAME_REF@[133; 137) |
142 | UNDERSCORE@[138; 139) "_" | 144 | IDENT@[133; 137) "Some" |
143 | R_PAREN@[139; 140) ")" | 145 | L_PAREN@[137; 138) "(" |
144 | WHITESPACE@[140; 141) " " | 146 | PLACEHOLDER_PAT@[138; 139) |
145 | PIPE@[141; 142) "|" | 147 | UNDERSCORE@[138; 139) "_" |
146 | WHITESPACE@[142; 143) " " | 148 | R_PAREN@[139; 140) ")" |
147 | TUPLE_STRUCT_PAT@[143; 150) | 149 | WHITESPACE@[140; 141) " " |
148 | PATH@[143; 147) | 150 | PIPE@[141; 142) "|" |
149 | PATH_SEGMENT@[143; 147) | 151 | WHITESPACE@[142; 143) " " |
150 | NAME_REF@[143; 147) | 152 | TUPLE_STRUCT_PAT@[143; 150) |
151 | IDENT@[143; 147) "Some" | 153 | PATH@[143; 147) |
152 | L_PAREN@[147; 148) "(" | 154 | PATH_SEGMENT@[143; 147) |
153 | PLACEHOLDER_PAT@[148; 149) | 155 | NAME_REF@[143; 147) |
154 | UNDERSCORE@[148; 149) "_" | 156 | IDENT@[143; 147) "Some" |
155 | R_PAREN@[149; 150) ")" | 157 | L_PAREN@[147; 148) "(" |
156 | WHITESPACE@[150; 151) " " | 158 | PLACEHOLDER_PAT@[148; 149) |
157 | EQ@[151; 152) "=" | 159 | UNDERSCORE@[148; 149) "_" |
158 | WHITESPACE@[152; 153) " " | 160 | R_PAREN@[149; 150) ")" |
159 | PATH_EXPR@[153; 157) | 161 | WHITESPACE@[150; 151) " " |
160 | PATH@[153; 157) | 162 | EQ@[151; 152) "=" |
161 | PATH_SEGMENT@[153; 157) | 163 | WHITESPACE@[152; 153) " " |
162 | NAME_REF@[153; 157) | 164 | PATH_EXPR@[153; 157) |
163 | IDENT@[153; 157) "None" | 165 | PATH@[153; 157) |
164 | WHITESPACE@[157; 158) " " | 166 | PATH_SEGMENT@[153; 157) |
165 | BLOCK@[158; 160) | 167 | NAME_REF@[153; 157) |
166 | L_CURLY@[158; 159) "{" | 168 | IDENT@[153; 157) "None" |
167 | R_CURLY@[159; 160) "}" | 169 | WHITESPACE@[157; 158) " " |
168 | WHITESPACE@[160; 165) "\n " | 170 | BLOCK_EXPR@[158; 160) |
169 | WHILE_EXPR@[165; 194) | 171 | BLOCK@[158; 160) |
170 | WHILE_KW@[165; 170) "while" | 172 | L_CURLY@[158; 159) "{" |
171 | WHITESPACE@[170; 171) " " | 173 | R_CURLY@[159; 160) "}" |
172 | CONDITION@[171; 191) | 174 | WHITESPACE@[160; 165) "\n " |
173 | LET_KW@[171; 174) "let" | 175 | WHILE_EXPR@[165; 194) |
174 | WHITESPACE@[174; 175) " " | 176 | WHILE_KW@[165; 170) "while" |
175 | PIPE@[175; 176) "|" | 177 | WHITESPACE@[170; 171) " " |
176 | WHITESPACE@[176; 177) " " | 178 | CONDITION@[171; 191) |
177 | TUPLE_STRUCT_PAT@[177; 184) | 179 | LET_KW@[171; 174) "let" |
178 | PATH@[177; 181) | 180 | WHITESPACE@[174; 175) " " |
179 | PATH_SEGMENT@[177; 181) | 181 | PIPE@[175; 176) "|" |
180 | NAME_REF@[177; 181) | 182 | WHITESPACE@[176; 177) " " |
181 | IDENT@[177; 181) "Some" | 183 | TUPLE_STRUCT_PAT@[177; 184) |
182 | L_PAREN@[181; 182) "(" | 184 | PATH@[177; 181) |
183 | PLACEHOLDER_PAT@[182; 183) | 185 | PATH_SEGMENT@[177; 181) |
184 | UNDERSCORE@[182; 183) "_" | 186 | NAME_REF@[177; 181) |
185 | R_PAREN@[183; 184) ")" | 187 | IDENT@[177; 181) "Some" |
186 | WHITESPACE@[184; 185) " " | 188 | L_PAREN@[181; 182) "(" |
187 | EQ@[185; 186) "=" | 189 | PLACEHOLDER_PAT@[182; 183) |
188 | WHITESPACE@[186; 187) " " | 190 | UNDERSCORE@[182; 183) "_" |
189 | PATH_EXPR@[187; 191) | 191 | R_PAREN@[183; 184) ")" |
190 | PATH@[187; 191) | 192 | WHITESPACE@[184; 185) " " |
191 | PATH_SEGMENT@[187; 191) | 193 | EQ@[185; 186) "=" |
192 | NAME_REF@[187; 191) | 194 | WHITESPACE@[186; 187) " " |
193 | IDENT@[187; 191) "None" | 195 | PATH_EXPR@[187; 191) |
194 | WHITESPACE@[191; 192) " " | 196 | PATH@[187; 191) |
195 | BLOCK@[192; 194) | 197 | PATH_SEGMENT@[187; 191) |
196 | L_CURLY@[192; 193) "{" | 198 | NAME_REF@[187; 191) |
197 | R_CURLY@[193; 194) "}" | 199 | IDENT@[187; 191) "None" |
198 | WHITESPACE@[194; 195) "\n" | 200 | WHITESPACE@[191; 192) " " |
199 | R_CURLY@[195; 196) "}" | 201 | BLOCK_EXPR@[192; 194) |
202 | BLOCK@[192; 194) | ||
203 | L_CURLY@[192; 193) "{" | ||
204 | R_CURLY@[193; 194) "}" | ||
205 | WHITESPACE@[194; 195) "\n" | ||
206 | R_CURLY@[195; 196) "}" | ||
200 | WHITESPACE@[196; 197) "\n" | 207 | WHITESPACE@[196; 197) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt index a772117a1..9b43d624c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.txt | |||
@@ -8,59 +8,62 @@ SOURCE_FILE@[0; 70) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 69) | 11 | BLOCK_EXPR@[9; 69) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 69) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 29) | 14 | WHITESPACE@[10; 15) "\n " |
15 | WHILE_EXPR@[15; 28) | 15 | EXPR_STMT@[15; 29) |
16 | WHILE_KW@[15; 20) "while" | 16 | WHILE_EXPR@[15; 28) |
17 | WHITESPACE@[20; 21) " " | 17 | WHILE_KW@[15; 20) "while" |
18 | CONDITION@[21; 25) | 18 | WHITESPACE@[20; 21) " " |
19 | LITERAL@[21; 25) | 19 | CONDITION@[21; 25) |
20 | TRUE_KW@[21; 25) "true" | 20 | LITERAL@[21; 25) |
21 | WHITESPACE@[25; 26) " " | 21 | TRUE_KW@[21; 25) "true" |
22 | BLOCK@[26; 28) | 22 | WHITESPACE@[25; 26) " " |
23 | L_CURLY@[26; 27) "{" | 23 | BLOCK_EXPR@[26; 28) |
24 | R_CURLY@[27; 28) "}" | 24 | BLOCK@[26; 28) |
25 | SEMI@[28; 29) ";" | 25 | L_CURLY@[26; 27) "{" |
26 | WHITESPACE@[29; 34) "\n " | 26 | R_CURLY@[27; 28) "}" |
27 | EXPR_STMT@[34; 67) | 27 | SEMI@[28; 29) ";" |
28 | WHILE_EXPR@[34; 66) | 28 | WHITESPACE@[29; 34) "\n " |
29 | WHILE_KW@[34; 39) "while" | 29 | EXPR_STMT@[34; 67) |
30 | WHITESPACE@[39; 40) " " | 30 | WHILE_EXPR@[34; 66) |
31 | CONDITION@[40; 63) | 31 | WHILE_KW@[34; 39) "while" |
32 | LET_KW@[40; 43) "let" | 32 | WHITESPACE@[39; 40) " " |
33 | WHITESPACE@[43; 44) " " | 33 | CONDITION@[40; 63) |
34 | TUPLE_STRUCT_PAT@[44; 51) | 34 | LET_KW@[40; 43) "let" |
35 | PATH@[44; 48) | 35 | WHITESPACE@[43; 44) " " |
36 | PATH_SEGMENT@[44; 48) | 36 | TUPLE_STRUCT_PAT@[44; 51) |
37 | NAME_REF@[44; 48) | 37 | PATH@[44; 48) |
38 | IDENT@[44; 48) "Some" | 38 | PATH_SEGMENT@[44; 48) |
39 | L_PAREN@[48; 49) "(" | 39 | NAME_REF@[44; 48) |
40 | BIND_PAT@[49; 50) | 40 | IDENT@[44; 48) "Some" |
41 | NAME@[49; 50) | 41 | L_PAREN@[48; 49) "(" |
42 | IDENT@[49; 50) "x" | 42 | BIND_PAT@[49; 50) |
43 | R_PAREN@[50; 51) ")" | 43 | NAME@[49; 50) |
44 | WHITESPACE@[51; 52) " " | 44 | IDENT@[49; 50) "x" |
45 | EQ@[52; 53) "=" | 45 | R_PAREN@[50; 51) ")" |
46 | WHITESPACE@[53; 54) " " | 46 | WHITESPACE@[51; 52) " " |
47 | METHOD_CALL_EXPR@[54; 63) | 47 | EQ@[52; 53) "=" |
48 | PATH_EXPR@[54; 56) | 48 | WHITESPACE@[53; 54) " " |
49 | PATH@[54; 56) | 49 | METHOD_CALL_EXPR@[54; 63) |
50 | PATH_SEGMENT@[54; 56) | 50 | PATH_EXPR@[54; 56) |
51 | NAME_REF@[54; 56) | 51 | PATH@[54; 56) |
52 | IDENT@[54; 56) "it" | 52 | PATH_SEGMENT@[54; 56) |
53 | DOT@[56; 57) "." | 53 | NAME_REF@[54; 56) |
54 | NAME_REF@[57; 61) | 54 | IDENT@[54; 56) "it" |
55 | IDENT@[57; 61) "next" | 55 | DOT@[56; 57) "." |
56 | ARG_LIST@[61; 63) | 56 | NAME_REF@[57; 61) |
57 | L_PAREN@[61; 62) "(" | 57 | IDENT@[57; 61) "next" |
58 | R_PAREN@[62; 63) ")" | 58 | ARG_LIST@[61; 63) |
59 | WHITESPACE@[63; 64) " " | 59 | L_PAREN@[61; 62) "(" |
60 | BLOCK@[64; 66) | 60 | R_PAREN@[62; 63) ")" |
61 | L_CURLY@[64; 65) "{" | 61 | WHITESPACE@[63; 64) " " |
62 | R_CURLY@[65; 66) "}" | 62 | BLOCK_EXPR@[64; 66) |
63 | SEMI@[66; 67) ";" | 63 | BLOCK@[64; 66) |
64 | WHITESPACE@[67; 68) "\n" | 64 | L_CURLY@[64; 65) "{" |
65 | R_CURLY@[68; 69) "}" | 65 | R_CURLY@[65; 66) "}" |
66 | SEMI@[66; 67) ";" | ||
67 | WHITESPACE@[67; 68) "\n" | ||
68 | R_CURLY@[68; 69) "}" | ||
66 | WHITESPACE@[69; 70) "\n" | 69 | WHITESPACE@[69; 70) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt index 4ece7cd7e..67ffdfd67 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.txt | |||
@@ -8,46 +8,48 @@ SOURCE_FILE@[0; 102) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 101) | 11 | BLOCK_EXPR@[9; 101) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 101) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LOOP_EXPR@[15; 99) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LOOP_KW@[15; 19) "loop" | 15 | LOOP_EXPR@[15; 99) |
16 | WHITESPACE@[19; 20) " " | 16 | LOOP_KW@[15; 19) "loop" |
17 | BLOCK@[20; 99) | 17 | WHITESPACE@[19; 20) " " |
18 | L_CURLY@[20; 21) "{" | 18 | BLOCK_EXPR@[20; 99) |
19 | WHITESPACE@[21; 30) "\n " | 19 | BLOCK@[20; 99) |
20 | EXPR_STMT@[30; 36) | 20 | L_CURLY@[20; 21) "{" |
21 | BREAK_EXPR@[30; 35) | 21 | WHITESPACE@[21; 30) "\n " |
22 | BREAK_KW@[30; 35) "break" | 22 | EXPR_STMT@[30; 36) |
23 | SEMI@[35; 36) ";" | 23 | BREAK_EXPR@[30; 35) |
24 | WHITESPACE@[36; 45) "\n " | 24 | BREAK_KW@[30; 35) "break" |
25 | EXPR_STMT@[45; 54) | 25 | SEMI@[35; 36) ";" |
26 | BREAK_EXPR@[45; 53) | 26 | WHITESPACE@[36; 45) "\n " |
27 | BREAK_KW@[45; 50) "break" | 27 | EXPR_STMT@[45; 54) |
28 | WHITESPACE@[50; 51) " " | 28 | BREAK_EXPR@[45; 53) |
29 | LIFETIME@[51; 53) "\'l" | 29 | BREAK_KW@[45; 50) "break" |
30 | SEMI@[53; 54) ";" | 30 | WHITESPACE@[50; 51) " " |
31 | WHITESPACE@[54; 63) "\n " | 31 | LIFETIME@[51; 53) "\'l" |
32 | EXPR_STMT@[63; 72) | 32 | SEMI@[53; 54) ";" |
33 | BREAK_EXPR@[63; 71) | 33 | WHITESPACE@[54; 63) "\n " |
34 | BREAK_KW@[63; 68) "break" | 34 | EXPR_STMT@[63; 72) |
35 | WHITESPACE@[68; 69) " " | 35 | BREAK_EXPR@[63; 71) |
36 | LITERAL@[69; 71) | 36 | BREAK_KW@[63; 68) "break" |
37 | INT_NUMBER@[69; 71) "92" | 37 | WHITESPACE@[68; 69) " " |
38 | SEMI@[71; 72) ";" | 38 | LITERAL@[69; 71) |
39 | WHITESPACE@[72; 81) "\n " | 39 | INT_NUMBER@[69; 71) "92" |
40 | EXPR_STMT@[81; 93) | 40 | SEMI@[71; 72) ";" |
41 | BREAK_EXPR@[81; 92) | 41 | WHITESPACE@[72; 81) "\n " |
42 | BREAK_KW@[81; 86) "break" | 42 | EXPR_STMT@[81; 93) |
43 | WHITESPACE@[86; 87) " " | 43 | BREAK_EXPR@[81; 92) |
44 | LIFETIME@[87; 89) "\'l" | 44 | BREAK_KW@[81; 86) "break" |
45 | WHITESPACE@[89; 90) " " | 45 | WHITESPACE@[86; 87) " " |
46 | LITERAL@[90; 92) | 46 | LIFETIME@[87; 89) "\'l" |
47 | INT_NUMBER@[90; 92) "92" | 47 | WHITESPACE@[89; 90) " " |
48 | SEMI@[92; 93) ";" | 48 | LITERAL@[90; 92) |
49 | WHITESPACE@[93; 98) "\n " | 49 | INT_NUMBER@[90; 92) "92" |
50 | R_CURLY@[98; 99) "}" | 50 | SEMI@[92; 93) ";" |
51 | WHITESPACE@[99; 100) "\n" | 51 | WHITESPACE@[93; 98) "\n " |
52 | R_CURLY@[100; 101) "}" | 52 | R_CURLY@[98; 99) "}" |
53 | WHITESPACE@[99; 100) "\n" | ||
54 | R_CURLY@[100; 101) "}" | ||
53 | WHITESPACE@[101; 102) "\n" | 55 | WHITESPACE@[101; 102) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt index b5b09b2e5..a7dfe167c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.txt | |||
@@ -15,7 +15,8 @@ SOURCE_FILE@[0; 30) | |||
15 | L_PAREN@[24; 25) "(" | 15 | L_PAREN@[24; 25) "(" |
16 | R_PAREN@[25; 26) ")" | 16 | R_PAREN@[25; 26) ")" |
17 | WHITESPACE@[26; 27) " " | 17 | WHITESPACE@[26; 27) " " |
18 | BLOCK@[27; 29) | 18 | BLOCK_EXPR@[27; 29) |
19 | L_CURLY@[27; 28) "{" | 19 | BLOCK@[27; 29) |
20 | R_CURLY@[28; 29) "}" | 20 | L_CURLY@[27; 28) "{" |
21 | R_CURLY@[28; 29) "}" | ||
21 | WHITESPACE@[29; 30) "\n" | 22 | WHITESPACE@[29; 30) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt index 9bfddf5d2..6e226de4b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.txt | |||
@@ -41,38 +41,39 @@ SOURCE_FILE@[0; 71) | |||
41 | L_PAREN@[33; 34) "(" | 41 | L_PAREN@[33; 34) "(" |
42 | R_PAREN@[34; 35) ")" | 42 | R_PAREN@[34; 35) ")" |
43 | WHITESPACE@[35; 36) " " | 43 | WHITESPACE@[35; 36) " " |
44 | BLOCK@[36; 70) | 44 | BLOCK_EXPR@[36; 70) |
45 | L_CURLY@[36; 37) "{" | 45 | BLOCK@[36; 70) |
46 | WHITESPACE@[37; 38) " " | 46 | L_CURLY@[36; 37) "{" |
47 | EXPR_STMT@[38; 68) | 47 | WHITESPACE@[37; 38) " " |
48 | CALL_EXPR@[38; 67) | 48 | EXPR_STMT@[38; 68) |
49 | PATH_EXPR@[38; 65) | 49 | CALL_EXPR@[38; 67) |
50 | PATH@[38; 65) | 50 | PATH_EXPR@[38; 65) |
51 | PATH@[38; 56) | 51 | PATH@[38; 65) |
52 | PATH_SEGMENT@[38; 56) | 52 | PATH@[38; 56) |
53 | L_ANGLE@[38; 39) "<" | 53 | PATH_SEGMENT@[38; 56) |
54 | PATH_TYPE@[39; 44) | 54 | L_ANGLE@[38; 39) "<" |
55 | PATH@[39; 44) | 55 | PATH_TYPE@[39; 44) |
56 | PATH_SEGMENT@[39; 44) | 56 | PATH@[39; 44) |
57 | NAME_REF@[39; 44) | 57 | PATH_SEGMENT@[39; 44) |
58 | IDENT@[39; 44) "usize" | 58 | NAME_REF@[39; 44) |
59 | WHITESPACE@[44; 45) " " | 59 | IDENT@[39; 44) "usize" |
60 | AS_KW@[45; 47) "as" | 60 | WHITESPACE@[44; 45) " " |
61 | WHITESPACE@[47; 48) " " | 61 | AS_KW@[45; 47) "as" |
62 | PATH_TYPE@[48; 55) | 62 | WHITESPACE@[47; 48) " " |
63 | PATH@[48; 55) | 63 | PATH_TYPE@[48; 55) |
64 | PATH_SEGMENT@[48; 55) | 64 | PATH@[48; 55) |
65 | NAME_REF@[48; 55) | 65 | PATH_SEGMENT@[48; 55) |
66 | IDENT@[48; 55) "Default" | 66 | NAME_REF@[48; 55) |
67 | R_ANGLE@[55; 56) ">" | 67 | IDENT@[48; 55) "Default" |
68 | COLONCOLON@[56; 58) "::" | 68 | R_ANGLE@[55; 56) ">" |
69 | PATH_SEGMENT@[58; 65) | 69 | COLONCOLON@[56; 58) "::" |
70 | NAME_REF@[58; 65) | 70 | PATH_SEGMENT@[58; 65) |
71 | IDENT@[58; 65) "default" | 71 | NAME_REF@[58; 65) |
72 | ARG_LIST@[65; 67) | 72 | IDENT@[58; 65) "default" |
73 | L_PAREN@[65; 66) "(" | 73 | ARG_LIST@[65; 67) |
74 | R_PAREN@[66; 67) ")" | 74 | L_PAREN@[65; 66) "(" |
75 | SEMI@[67; 68) ";" | 75 | R_PAREN@[66; 67) ")" |
76 | WHITESPACE@[68; 69) " " | 76 | SEMI@[67; 68) ";" |
77 | R_CURLY@[69; 70) "}" | 77 | WHITESPACE@[68; 69) " " |
78 | R_CURLY@[69; 70) "}" | ||
78 | WHITESPACE@[70; 71) "\n" | 79 | WHITESPACE@[70; 71) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt index 477c645d1..042cee879 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.txt | |||
@@ -8,21 +8,22 @@ SOURCE_FILE@[0; 21) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 20) | 11 | BLOCK_EXPR@[9; 20) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 20) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[11; 18) | 14 | WHITESPACE@[10; 11) " " |
15 | INDEX_EXPR@[11; 17) | 15 | EXPR_STMT@[11; 18) |
16 | PATH_EXPR@[11; 13) | 16 | INDEX_EXPR@[11; 17) |
17 | PATH@[11; 13) | 17 | PATH_EXPR@[11; 13) |
18 | PATH_SEGMENT@[11; 13) | 18 | PATH@[11; 13) |
19 | NAME_REF@[11; 13) | 19 | PATH_SEGMENT@[11; 13) |
20 | IDENT@[11; 13) "xs" | 20 | NAME_REF@[11; 13) |
21 | L_BRACK@[13; 14) "[" | 21 | IDENT@[11; 13) "xs" |
22 | RANGE_EXPR@[14; 16) | 22 | L_BRACK@[13; 14) "[" |
23 | DOTDOT@[14; 16) ".." | 23 | RANGE_EXPR@[14; 16) |
24 | R_BRACK@[16; 17) "]" | 24 | DOTDOT@[14; 16) ".." |
25 | SEMI@[17; 18) ";" | 25 | R_BRACK@[16; 17) "]" |
26 | WHITESPACE@[18; 19) " " | 26 | SEMI@[17; 18) ";" |
27 | R_CURLY@[19; 20) "}" | 27 | WHITESPACE@[18; 19) " " |
28 | R_CURLY@[19; 20) "}" | ||
28 | WHITESPACE@[20; 21) "\n" | 29 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt index 882e4a9ae..d180fcf20 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.txt | |||
@@ -11,10 +11,11 @@ SOURCE_FILE@[0; 71) | |||
11 | L_PAREN@[13; 14) "(" | 11 | L_PAREN@[13; 14) "(" |
12 | R_PAREN@[14; 15) ")" | 12 | R_PAREN@[14; 15) ")" |
13 | WHITESPACE@[15; 16) " " | 13 | WHITESPACE@[15; 16) " " |
14 | BLOCK@[16; 19) | 14 | BLOCK_EXPR@[16; 19) |
15 | L_CURLY@[16; 17) "{" | 15 | BLOCK@[16; 19) |
16 | WHITESPACE@[17; 18) " " | 16 | L_CURLY@[16; 17) "{" |
17 | R_CURLY@[18; 19) "}" | 17 | WHITESPACE@[17; 18) " " |
18 | R_CURLY@[18; 19) "}" | ||
18 | WHITESPACE@[19; 20) "\n" | 19 | WHITESPACE@[19; 20) "\n" |
19 | STRUCT_DEF@[20; 49) | 20 | STRUCT_DEF@[20; 49) |
20 | STRUCT_KW@[20; 26) "struct" | 21 | STRUCT_KW@[20; 26) "struct" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt index dd8946ad2..e8003bf91 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.txt | |||
@@ -8,140 +8,141 @@ SOURCE_FILE@[0; 118) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 117) | 11 | BLOCK_EXPR@[9; 117) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 117) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 27) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 27) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PLACEHOLDER_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | UNDERSCORE@[19; 20) "_" | 18 | PLACEHOLDER_PAT@[19; 20) |
19 | WHITESPACE@[20; 21) " " | 19 | UNDERSCORE@[19; 20) "_" |
20 | EQ@[21; 22) "=" | 20 | WHITESPACE@[20; 21) " " |
21 | WHITESPACE@[22; 23) " " | 21 | EQ@[21; 22) "=" |
22 | CALL_EXPR@[23; 26) | 22 | WHITESPACE@[22; 23) " " |
23 | PATH_EXPR@[23; 24) | 23 | CALL_EXPR@[23; 26) |
24 | PATH@[23; 24) | 24 | PATH_EXPR@[23; 24) |
25 | PATH_SEGMENT@[23; 24) | 25 | PATH@[23; 24) |
26 | NAME_REF@[23; 24) | 26 | PATH_SEGMENT@[23; 24) |
27 | IDENT@[23; 24) "f" | 27 | NAME_REF@[23; 24) |
28 | ARG_LIST@[24; 26) | 28 | IDENT@[23; 24) "f" |
29 | L_PAREN@[24; 25) "(" | 29 | ARG_LIST@[24; 26) |
30 | R_PAREN@[25; 26) ")" | 30 | L_PAREN@[24; 25) "(" |
31 | SEMI@[26; 27) ";" | 31 | R_PAREN@[25; 26) ")" |
32 | WHITESPACE@[27; 32) "\n " | 32 | SEMI@[26; 27) ";" |
33 | LET_STMT@[32; 54) | 33 | WHITESPACE@[27; 32) "\n " |
34 | LET_KW@[32; 35) "let" | 34 | LET_STMT@[32; 54) |
35 | WHITESPACE@[35; 36) " " | 35 | LET_KW@[32; 35) "let" |
36 | PLACEHOLDER_PAT@[36; 37) | 36 | WHITESPACE@[35; 36) " " |
37 | UNDERSCORE@[36; 37) "_" | 37 | PLACEHOLDER_PAT@[36; 37) |
38 | WHITESPACE@[37; 38) " " | 38 | UNDERSCORE@[36; 37) "_" |
39 | EQ@[38; 39) "=" | 39 | WHITESPACE@[37; 38) " " |
40 | WHITESPACE@[39; 40) " " | 40 | EQ@[38; 39) "=" |
41 | CALL_EXPR@[40; 53) | 41 | WHITESPACE@[39; 40) " " |
42 | CALL_EXPR@[40; 46) | 42 | CALL_EXPR@[40; 53) |
43 | CALL_EXPR@[40; 43) | 43 | CALL_EXPR@[40; 46) |
44 | PATH_EXPR@[40; 41) | 44 | CALL_EXPR@[40; 43) |
45 | PATH@[40; 41) | 45 | PATH_EXPR@[40; 41) |
46 | PATH_SEGMENT@[40; 41) | 46 | PATH@[40; 41) |
47 | NAME_REF@[40; 41) | 47 | PATH_SEGMENT@[40; 41) |
48 | IDENT@[40; 41) "f" | 48 | NAME_REF@[40; 41) |
49 | ARG_LIST@[41; 43) | 49 | IDENT@[40; 41) "f" |
50 | L_PAREN@[41; 42) "(" | 50 | ARG_LIST@[41; 43) |
51 | R_PAREN@[42; 43) ")" | 51 | L_PAREN@[41; 42) "(" |
52 | ARG_LIST@[43; 46) | 52 | R_PAREN@[42; 43) ")" |
53 | L_PAREN@[43; 44) "(" | 53 | ARG_LIST@[43; 46) |
54 | LITERAL@[44; 45) | 54 | L_PAREN@[43; 44) "(" |
55 | INT_NUMBER@[44; 45) "1" | 55 | LITERAL@[44; 45) |
56 | R_PAREN@[45; 46) ")" | 56 | INT_NUMBER@[44; 45) "1" |
57 | ARG_LIST@[46; 53) | 57 | R_PAREN@[45; 46) ")" |
58 | L_PAREN@[46; 47) "(" | 58 | ARG_LIST@[46; 53) |
59 | LITERAL@[47; 48) | 59 | L_PAREN@[46; 47) "(" |
60 | INT_NUMBER@[47; 48) "1" | 60 | LITERAL@[47; 48) |
61 | COMMA@[48; 49) "," | 61 | INT_NUMBER@[47; 48) "1" |
62 | WHITESPACE@[49; 50) " " | 62 | COMMA@[48; 49) "," |
63 | LITERAL@[50; 51) | 63 | WHITESPACE@[49; 50) " " |
64 | INT_NUMBER@[50; 51) "2" | 64 | LITERAL@[50; 51) |
65 | COMMA@[51; 52) "," | 65 | INT_NUMBER@[50; 51) "2" |
66 | R_PAREN@[52; 53) ")" | 66 | COMMA@[51; 52) "," |
67 | SEMI@[53; 54) ";" | 67 | R_PAREN@[52; 53) ")" |
68 | WHITESPACE@[54; 59) "\n " | 68 | SEMI@[53; 54) ";" |
69 | LET_STMT@[59; 84) | 69 | WHITESPACE@[54; 59) "\n " |
70 | LET_KW@[59; 62) "let" | 70 | LET_STMT@[59; 84) |
71 | WHITESPACE@[62; 63) " " | 71 | LET_KW@[59; 62) "let" |
72 | PLACEHOLDER_PAT@[63; 64) | 72 | WHITESPACE@[62; 63) " " |
73 | UNDERSCORE@[63; 64) "_" | 73 | PLACEHOLDER_PAT@[63; 64) |
74 | WHITESPACE@[64; 65) " " | 74 | UNDERSCORE@[63; 64) "_" |
75 | EQ@[65; 66) "=" | 75 | WHITESPACE@[64; 65) " " |
76 | WHITESPACE@[66; 67) " " | 76 | EQ@[65; 66) "=" |
77 | CALL_EXPR@[67; 83) | 77 | WHITESPACE@[66; 67) " " |
78 | PATH_EXPR@[67; 68) | 78 | CALL_EXPR@[67; 83) |
79 | PATH@[67; 68) | 79 | PATH_EXPR@[67; 68) |
80 | PATH_SEGMENT@[67; 68) | 80 | PATH@[67; 68) |
81 | NAME_REF@[67; 68) | 81 | PATH_SEGMENT@[67; 68) |
82 | IDENT@[67; 68) "f" | 82 | NAME_REF@[67; 68) |
83 | ARG_LIST@[68; 83) | 83 | IDENT@[67; 68) "f" |
84 | L_PAREN@[68; 69) "(" | 84 | ARG_LIST@[68; 83) |
85 | CALL_EXPR@[69; 82) | 85 | L_PAREN@[68; 69) "(" |
86 | PATH_EXPR@[69; 80) | 86 | CALL_EXPR@[69; 82) |
87 | PATH@[69; 80) | 87 | PATH_EXPR@[69; 80) |
88 | PATH@[69; 74) | 88 | PATH@[69; 80) |
89 | PATH_SEGMENT@[69; 74) | 89 | PATH@[69; 74) |
90 | L_ANGLE@[69; 70) "<" | 90 | PATH_SEGMENT@[69; 74) |
91 | PATH_TYPE@[70; 73) | 91 | L_ANGLE@[69; 70) "<" |
92 | PATH@[70; 73) | 92 | PATH_TYPE@[70; 73) |
93 | PATH_SEGMENT@[70; 73) | 93 | PATH@[70; 73) |
94 | NAME_REF@[70; 73) | 94 | PATH_SEGMENT@[70; 73) |
95 | IDENT@[70; 73) "Foo" | 95 | NAME_REF@[70; 73) |
96 | R_ANGLE@[73; 74) ">" | 96 | IDENT@[70; 73) "Foo" |
97 | COLONCOLON@[74; 76) "::" | 97 | R_ANGLE@[73; 74) ">" |
98 | PATH_SEGMENT@[76; 80) | 98 | COLONCOLON@[74; 76) "::" |
99 | NAME_REF@[76; 80) | 99 | PATH_SEGMENT@[76; 80) |
100 | IDENT@[76; 80) "func" | 100 | NAME_REF@[76; 80) |
101 | ARG_LIST@[80; 82) | 101 | IDENT@[76; 80) "func" |
102 | L_PAREN@[80; 81) "(" | 102 | ARG_LIST@[80; 82) |
103 | R_PAREN@[81; 82) ")" | 103 | L_PAREN@[80; 81) "(" |
104 | R_PAREN@[82; 83) ")" | 104 | R_PAREN@[81; 82) ")" |
105 | SEMI@[83; 84) ";" | 105 | R_PAREN@[82; 83) ")" |
106 | WHITESPACE@[84; 89) "\n " | 106 | SEMI@[83; 84) ";" |
107 | EXPR_STMT@[89; 115) | 107 | WHITESPACE@[84; 89) "\n " |
108 | CALL_EXPR@[89; 114) | 108 | EXPR_STMT@[89; 115) |
109 | PATH_EXPR@[89; 90) | 109 | CALL_EXPR@[89; 114) |
110 | PATH@[89; 90) | 110 | PATH_EXPR@[89; 90) |
111 | PATH_SEGMENT@[89; 90) | 111 | PATH@[89; 90) |
112 | NAME_REF@[89; 90) | 112 | PATH_SEGMENT@[89; 90) |
113 | IDENT@[89; 90) "f" | 113 | NAME_REF@[89; 90) |
114 | ARG_LIST@[90; 114) | 114 | IDENT@[89; 90) "f" |
115 | L_PAREN@[90; 91) "(" | 115 | ARG_LIST@[90; 114) |
116 | CALL_EXPR@[91; 113) | 116 | L_PAREN@[90; 91) "(" |
117 | PATH_EXPR@[91; 111) | 117 | CALL_EXPR@[91; 113) |
118 | PATH@[91; 111) | 118 | PATH_EXPR@[91; 111) |
119 | PATH@[91; 105) | 119 | PATH@[91; 111) |
120 | PATH_SEGMENT@[91; 105) | 120 | PATH@[91; 105) |
121 | L_ANGLE@[91; 92) "<" | 121 | PATH_SEGMENT@[91; 105) |
122 | PATH_TYPE@[92; 95) | 122 | L_ANGLE@[91; 92) "<" |
123 | PATH@[92; 95) | 123 | PATH_TYPE@[92; 95) |
124 | PATH_SEGMENT@[92; 95) | 124 | PATH@[92; 95) |
125 | NAME_REF@[92; 95) | 125 | PATH_SEGMENT@[92; 95) |
126 | IDENT@[92; 95) "Foo" | 126 | NAME_REF@[92; 95) |
127 | WHITESPACE@[95; 96) " " | 127 | IDENT@[92; 95) "Foo" |
128 | AS_KW@[96; 98) "as" | 128 | WHITESPACE@[95; 96) " " |
129 | WHITESPACE@[98; 99) " " | 129 | AS_KW@[96; 98) "as" |
130 | PATH_TYPE@[99; 104) | 130 | WHITESPACE@[98; 99) " " |
131 | PATH@[99; 104) | 131 | PATH_TYPE@[99; 104) |
132 | PATH_SEGMENT@[99; 104) | 132 | PATH@[99; 104) |
133 | NAME_REF@[99; 104) | 133 | PATH_SEGMENT@[99; 104) |
134 | IDENT@[99; 104) "Trait" | 134 | NAME_REF@[99; 104) |
135 | R_ANGLE@[104; 105) ">" | 135 | IDENT@[99; 104) "Trait" |
136 | COLONCOLON@[105; 107) "::" | 136 | R_ANGLE@[104; 105) ">" |
137 | PATH_SEGMENT@[107; 111) | 137 | COLONCOLON@[105; 107) "::" |
138 | NAME_REF@[107; 111) | 138 | PATH_SEGMENT@[107; 111) |
139 | IDENT@[107; 111) "func" | 139 | NAME_REF@[107; 111) |
140 | ARG_LIST@[111; 113) | 140 | IDENT@[107; 111) "func" |
141 | L_PAREN@[111; 112) "(" | 141 | ARG_LIST@[111; 113) |
142 | R_PAREN@[112; 113) ")" | 142 | L_PAREN@[111; 112) "(" |
143 | R_PAREN@[113; 114) ")" | 143 | R_PAREN@[112; 113) ")" |
144 | SEMI@[114; 115) ";" | 144 | R_PAREN@[113; 114) ")" |
145 | WHITESPACE@[115; 116) "\n" | 145 | SEMI@[114; 115) ";" |
146 | R_CURLY@[116; 117) "}" | 146 | WHITESPACE@[115; 116) "\n" |
147 | R_CURLY@[116; 117) "}" | ||
147 | WHITESPACE@[117; 118) "\n" | 148 | WHITESPACE@[117; 118) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt index d1a8c560a..e75d569f0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.txt | |||
@@ -8,21 +8,23 @@ SOURCE_FILE@[0; 21) | |||
8 | L_PAREN@[4; 5) "(" | 8 | L_PAREN@[4; 5) "(" |
9 | R_PAREN@[5; 6) ")" | 9 | R_PAREN@[5; 6) ")" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | BLOCK@[7; 20) | 11 | BLOCK_EXPR@[7; 20) |
12 | L_CURLY@[7; 8) "{" | 12 | BLOCK@[7; 20) |
13 | WHITESPACE@[8; 9) " " | 13 | L_CURLY@[7; 8) "{" |
14 | FN_DEF@[9; 18) | 14 | WHITESPACE@[8; 9) " " |
15 | FN_KW@[9; 11) "fn" | 15 | FN_DEF@[9; 18) |
16 | WHITESPACE@[11; 12) " " | 16 | FN_KW@[9; 11) "fn" |
17 | NAME@[12; 13) | 17 | WHITESPACE@[11; 12) " " |
18 | IDENT@[12; 13) "b" | 18 | NAME@[12; 13) |
19 | PARAM_LIST@[13; 15) | 19 | IDENT@[12; 13) "b" |
20 | L_PAREN@[13; 14) "(" | 20 | PARAM_LIST@[13; 15) |
21 | R_PAREN@[14; 15) ")" | 21 | L_PAREN@[13; 14) "(" |
22 | WHITESPACE@[15; 16) " " | 22 | R_PAREN@[14; 15) ")" |
23 | BLOCK@[16; 18) | 23 | WHITESPACE@[15; 16) " " |
24 | L_CURLY@[16; 17) "{" | 24 | BLOCK_EXPR@[16; 18) |
25 | R_CURLY@[17; 18) "}" | 25 | BLOCK@[16; 18) |
26 | WHITESPACE@[18; 19) " " | 26 | L_CURLY@[16; 17) "{" |
27 | R_CURLY@[19; 20) "}" | 27 | R_CURLY@[17; 18) "}" |
28 | WHITESPACE@[18; 19) " " | ||
29 | R_CURLY@[19; 20) "}" | ||
28 | WHITESPACE@[20; 21) "\n" | 30 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt index f85d6a4bc..33886154d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.txt | |||
@@ -40,7 +40,8 @@ SOURCE_FILE@[0; 35) | |||
40 | PARAM_LIST@[30; 32) | 40 | PARAM_LIST@[30; 32) |
41 | L_PAREN@[30; 31) "(" | 41 | L_PAREN@[30; 31) "(" |
42 | R_PAREN@[31; 32) ")" | 42 | R_PAREN@[31; 32) ")" |
43 | BLOCK@[32; 34) | 43 | BLOCK_EXPR@[32; 34) |
44 | L_CURLY@[32; 33) "{" | 44 | BLOCK@[32; 34) |
45 | R_CURLY@[33; 34) "}" | 45 | L_CURLY@[32; 33) "{" |
46 | R_CURLY@[33; 34) "}" | ||
46 | WHITESPACE@[34; 35) "\n" | 47 | WHITESPACE@[34; 35) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt index bb948c8d8..02f2a9db6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.txt | |||
@@ -34,9 +34,10 @@ SOURCE_FILE@[0; 58) | |||
34 | LIFETIME@[20; 22) "\'f" | 34 | LIFETIME@[20; 22) "\'f" |
35 | R_ANGLE@[22; 23) ">" | 35 | R_ANGLE@[22; 23) ">" |
36 | WHITESPACE@[23; 24) " " | 36 | WHITESPACE@[23; 24) " " |
37 | BLOCK@[24; 26) | 37 | BLOCK_EXPR@[24; 26) |
38 | L_CURLY@[24; 25) "{" | 38 | BLOCK@[24; 26) |
39 | R_CURLY@[25; 26) "}" | 39 | L_CURLY@[24; 25) "{" |
40 | R_CURLY@[25; 26) "}" | ||
40 | WHITESPACE@[26; 27) "\n" | 41 | WHITESPACE@[26; 27) "\n" |
41 | FN_DEF@[27; 57) | 42 | FN_DEF@[27; 57) |
42 | FN_KW@[27; 29) "fn" | 43 | FN_KW@[27; 29) "fn" |
@@ -75,7 +76,8 @@ SOURCE_FILE@[0; 58) | |||
75 | LIFETIME@[51; 53) "\'f" | 76 | LIFETIME@[51; 53) "\'f" |
76 | R_ANGLE@[53; 54) ">" | 77 | R_ANGLE@[53; 54) ">" |
77 | WHITESPACE@[54; 55) " " | 78 | WHITESPACE@[54; 55) " " |
78 | BLOCK@[55; 57) | 79 | BLOCK_EXPR@[55; 57) |
79 | L_CURLY@[55; 56) "{" | 80 | BLOCK@[55; 57) |
80 | R_CURLY@[56; 57) "}" | 81 | L_CURLY@[55; 56) "{" |
82 | R_CURLY@[56; 57) "}" | ||
81 | WHITESPACE@[57; 58) "\n" | 83 | WHITESPACE@[57; 58) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt index bc4b97c9f..f1018fcab 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.txt | |||
@@ -8,88 +8,89 @@ SOURCE_FILE@[0; 91) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 90) | 11 | BLOCK_EXPR@[9; 90) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 90) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 25) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 25) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PLACEHOLDER_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | UNDERSCORE@[19; 20) "_" | 18 | PLACEHOLDER_PAT@[19; 20) |
19 | WHITESPACE@[20; 21) " " | 19 | UNDERSCORE@[19; 20) "_" |
20 | EQ@[21; 22) "=" | 20 | WHITESPACE@[20; 21) " " |
21 | WHITESPACE@[22; 23) " " | 21 | EQ@[21; 22) "=" |
22 | PATH_EXPR@[23; 24) | 22 | WHITESPACE@[22; 23) " " |
23 | PATH@[23; 24) | 23 | PATH_EXPR@[23; 24) |
24 | PATH_SEGMENT@[23; 24) | 24 | PATH@[23; 24) |
25 | NAME_REF@[23; 24) | 25 | PATH_SEGMENT@[23; 24) |
26 | IDENT@[23; 24) "a" | 26 | NAME_REF@[23; 24) |
27 | SEMI@[24; 25) ";" | 27 | IDENT@[23; 24) "a" |
28 | WHITESPACE@[25; 30) "\n " | 28 | SEMI@[24; 25) ";" |
29 | LET_STMT@[30; 43) | 29 | WHITESPACE@[25; 30) "\n " |
30 | LET_KW@[30; 33) "let" | 30 | LET_STMT@[30; 43) |
31 | WHITESPACE@[33; 34) " " | 31 | LET_KW@[30; 33) "let" |
32 | PLACEHOLDER_PAT@[34; 35) | 32 | WHITESPACE@[33; 34) " " |
33 | UNDERSCORE@[34; 35) "_" | 33 | PLACEHOLDER_PAT@[34; 35) |
34 | WHITESPACE@[35; 36) " " | 34 | UNDERSCORE@[34; 35) "_" |
35 | EQ@[36; 37) "=" | 35 | WHITESPACE@[35; 36) " " |
36 | WHITESPACE@[37; 38) " " | 36 | EQ@[36; 37) "=" |
37 | PATH_EXPR@[38; 42) | 37 | WHITESPACE@[37; 38) " " |
38 | PATH@[38; 42) | 38 | PATH_EXPR@[38; 42) |
39 | PATH@[38; 39) | 39 | PATH@[38; 42) |
40 | PATH_SEGMENT@[38; 39) | 40 | PATH@[38; 39) |
41 | NAME_REF@[38; 39) | 41 | PATH_SEGMENT@[38; 39) |
42 | IDENT@[38; 39) "a" | 42 | NAME_REF@[38; 39) |
43 | COLONCOLON@[39; 41) "::" | 43 | IDENT@[38; 39) "a" |
44 | PATH_SEGMENT@[41; 42) | 44 | COLONCOLON@[39; 41) "::" |
45 | NAME_REF@[41; 42) | 45 | PATH_SEGMENT@[41; 42) |
46 | IDENT@[41; 42) "b" | 46 | NAME_REF@[41; 42) |
47 | SEMI@[42; 43) ";" | 47 | IDENT@[41; 42) "b" |
48 | WHITESPACE@[43; 48) "\n " | 48 | SEMI@[42; 43) ";" |
49 | LET_STMT@[48; 65) | 49 | WHITESPACE@[43; 48) "\n " |
50 | LET_KW@[48; 51) "let" | 50 | LET_STMT@[48; 65) |
51 | WHITESPACE@[51; 52) " " | 51 | LET_KW@[48; 51) "let" |
52 | PLACEHOLDER_PAT@[52; 53) | 52 | WHITESPACE@[51; 52) " " |
53 | UNDERSCORE@[52; 53) "_" | 53 | PLACEHOLDER_PAT@[52; 53) |
54 | WHITESPACE@[53; 54) " " | 54 | UNDERSCORE@[52; 53) "_" |
55 | EQ@[54; 55) "=" | 55 | WHITESPACE@[53; 54) " " |
56 | WHITESPACE@[55; 56) " " | 56 | EQ@[54; 55) "=" |
57 | PATH_EXPR@[56; 64) | 57 | WHITESPACE@[55; 56) " " |
58 | PATH@[56; 64) | 58 | PATH_EXPR@[56; 64) |
59 | PATH_SEGMENT@[56; 64) | 59 | PATH@[56; 64) |
60 | COLONCOLON@[56; 58) "::" | 60 | PATH_SEGMENT@[56; 64) |
61 | NAME_REF@[58; 59) | 61 | COLONCOLON@[56; 58) "::" |
62 | IDENT@[58; 59) "a" | 62 | NAME_REF@[58; 59) |
63 | TYPE_ARG_LIST@[59; 64) | 63 | IDENT@[58; 59) "a" |
64 | COLONCOLON@[59; 61) "::" | 64 | TYPE_ARG_LIST@[59; 64) |
65 | L_ANGLE@[61; 62) "<" | 65 | COLONCOLON@[59; 61) "::" |
66 | TYPE_ARG@[62; 63) | 66 | L_ANGLE@[61; 62) "<" |
67 | PATH_TYPE@[62; 63) | 67 | TYPE_ARG@[62; 63) |
68 | PATH@[62; 63) | 68 | PATH_TYPE@[62; 63) |
69 | PATH_SEGMENT@[62; 63) | 69 | PATH@[62; 63) |
70 | NAME_REF@[62; 63) | 70 | PATH_SEGMENT@[62; 63) |
71 | IDENT@[62; 63) "b" | 71 | NAME_REF@[62; 63) |
72 | R_ANGLE@[63; 64) ">" | 72 | IDENT@[62; 63) "b" |
73 | SEMI@[64; 65) ";" | 73 | R_ANGLE@[63; 64) ">" |
74 | WHITESPACE@[65; 70) "\n " | 74 | SEMI@[64; 65) ";" |
75 | LET_STMT@[70; 88) | 75 | WHITESPACE@[65; 70) "\n " |
76 | LET_KW@[70; 73) "let" | 76 | LET_STMT@[70; 88) |
77 | WHITESPACE@[73; 74) " " | 77 | LET_KW@[70; 73) "let" |
78 | PLACEHOLDER_PAT@[74; 75) | 78 | WHITESPACE@[73; 74) " " |
79 | UNDERSCORE@[74; 75) "_" | 79 | PLACEHOLDER_PAT@[74; 75) |
80 | WHITESPACE@[75; 76) " " | 80 | UNDERSCORE@[74; 75) "_" |
81 | EQ@[76; 77) "=" | 81 | WHITESPACE@[75; 76) " " |
82 | WHITESPACE@[77; 78) " " | 82 | EQ@[76; 77) "=" |
83 | MACRO_CALL@[78; 87) | 83 | WHITESPACE@[77; 78) " " |
84 | PATH@[78; 84) | 84 | MACRO_CALL@[78; 87) |
85 | PATH_SEGMENT@[78; 84) | 85 | PATH@[78; 84) |
86 | NAME_REF@[78; 84) | 86 | PATH_SEGMENT@[78; 84) |
87 | IDENT@[78; 84) "format" | 87 | NAME_REF@[78; 84) |
88 | EXCL@[84; 85) "!" | 88 | IDENT@[78; 84) "format" |
89 | TOKEN_TREE@[85; 87) | 89 | EXCL@[84; 85) "!" |
90 | L_PAREN@[85; 86) "(" | 90 | TOKEN_TREE@[85; 87) |
91 | R_PAREN@[86; 87) ")" | 91 | L_PAREN@[85; 86) "(" |
92 | SEMI@[87; 88) ";" | 92 | R_PAREN@[86; 87) ")" |
93 | WHITESPACE@[88; 89) "\n" | 93 | SEMI@[87; 88) ";" |
94 | R_CURLY@[89; 90) "}" | 94 | WHITESPACE@[88; 89) "\n" |
95 | R_CURLY@[89; 90) "}" | ||
95 | WHITESPACE@[90; 91) "\n" | 96 | WHITESPACE@[90; 91) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt index ab5dad438..2b28cec67 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.txt | |||
@@ -8,69 +8,70 @@ SOURCE_FILE@[0; 113) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 112) | 11 | BLOCK_EXPR@[10; 112) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 112) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | MATCH_EXPR@[16; 110) | 14 | WHITESPACE@[11; 16) "\n " |
15 | MATCH_KW@[16; 21) "match" | 15 | MATCH_EXPR@[16; 110) |
16 | WHITESPACE@[21; 22) " " | 16 | MATCH_KW@[16; 21) "match" |
17 | TUPLE_EXPR@[22; 24) | 17 | WHITESPACE@[21; 22) " " |
18 | L_PAREN@[22; 23) "(" | 18 | TUPLE_EXPR@[22; 24) |
19 | R_PAREN@[23; 24) ")" | 19 | L_PAREN@[22; 23) "(" |
20 | WHITESPACE@[24; 25) " " | 20 | R_PAREN@[23; 24) ")" |
21 | MATCH_ARM_LIST@[25; 110) | 21 | WHITESPACE@[24; 25) " " |
22 | L_CURLY@[25; 26) "{" | 22 | MATCH_ARM_LIST@[25; 110) |
23 | WHITESPACE@[26; 35) "\n " | 23 | L_CURLY@[25; 26) "{" |
24 | MATCH_ARM@[35; 43) | 24 | WHITESPACE@[26; 35) "\n " |
25 | LITERAL_PAT@[35; 37) | 25 | MATCH_ARM@[35; 43) |
26 | MINUS@[35; 36) "-" | 26 | LITERAL_PAT@[35; 37) |
27 | LITERAL@[36; 37) | 27 | MINUS@[35; 36) "-" |
28 | INT_NUMBER@[36; 37) "1" | 28 | LITERAL@[36; 37) |
29 | WHITESPACE@[37; 38) " " | 29 | INT_NUMBER@[36; 37) "1" |
30 | FAT_ARROW@[38; 40) "=>" | 30 | WHITESPACE@[37; 38) " " |
31 | WHITESPACE@[40; 41) " " | 31 | FAT_ARROW@[38; 40) "=>" |
32 | TUPLE_EXPR@[41; 43) | 32 | WHITESPACE@[40; 41) " " |
33 | L_PAREN@[41; 42) "(" | 33 | TUPLE_EXPR@[41; 43) |
34 | R_PAREN@[42; 43) ")" | 34 | L_PAREN@[41; 42) "(" |
35 | COMMA@[43; 44) "," | 35 | R_PAREN@[42; 43) ")" |
36 | WHITESPACE@[44; 53) "\n " | 36 | COMMA@[43; 44) "," |
37 | MATCH_ARM@[53; 61) | 37 | WHITESPACE@[44; 53) "\n " |
38 | LITERAL_PAT@[53; 55) | 38 | MATCH_ARM@[53; 61) |
39 | LITERAL@[53; 55) | 39 | LITERAL_PAT@[53; 55) |
40 | INT_NUMBER@[53; 55) "92" | 40 | LITERAL@[53; 55) |
41 | WHITESPACE@[55; 56) " " | 41 | INT_NUMBER@[53; 55) "92" |
42 | FAT_ARROW@[56; 58) "=>" | 42 | WHITESPACE@[55; 56) " " |
43 | WHITESPACE@[58; 59) " " | 43 | FAT_ARROW@[56; 58) "=>" |
44 | TUPLE_EXPR@[59; 61) | 44 | WHITESPACE@[58; 59) " " |
45 | L_PAREN@[59; 60) "(" | 45 | TUPLE_EXPR@[59; 61) |
46 | R_PAREN@[60; 61) ")" | 46 | L_PAREN@[59; 60) "(" |
47 | COMMA@[61; 62) "," | 47 | R_PAREN@[60; 61) ")" |
48 | WHITESPACE@[62; 71) "\n " | 48 | COMMA@[61; 62) "," |
49 | MATCH_ARM@[71; 80) | 49 | WHITESPACE@[62; 71) "\n " |
50 | LITERAL_PAT@[71; 74) | 50 | MATCH_ARM@[71; 80) |
51 | LITERAL@[71; 74) | 51 | LITERAL_PAT@[71; 74) |
52 | CHAR@[71; 74) "\'c\'" | 52 | LITERAL@[71; 74) |
53 | WHITESPACE@[74; 75) " " | 53 | CHAR@[71; 74) "\'c\'" |
54 | FAT_ARROW@[75; 77) "=>" | 54 | WHITESPACE@[74; 75) " " |
55 | WHITESPACE@[77; 78) " " | 55 | FAT_ARROW@[75; 77) "=>" |
56 | TUPLE_EXPR@[78; 80) | 56 | WHITESPACE@[77; 78) " " |
57 | L_PAREN@[78; 79) "(" | 57 | TUPLE_EXPR@[78; 80) |
58 | R_PAREN@[79; 80) ")" | 58 | L_PAREN@[78; 79) "(" |
59 | COMMA@[80; 81) "," | 59 | R_PAREN@[79; 80) ")" |
60 | WHITESPACE@[81; 90) "\n " | 60 | COMMA@[80; 81) "," |
61 | MATCH_ARM@[90; 103) | 61 | WHITESPACE@[81; 90) "\n " |
62 | LITERAL_PAT@[90; 97) | 62 | MATCH_ARM@[90; 103) |
63 | LITERAL@[90; 97) | 63 | LITERAL_PAT@[90; 97) |
64 | STRING@[90; 97) "\"hello\"" | 64 | LITERAL@[90; 97) |
65 | WHITESPACE@[97; 98) " " | 65 | STRING@[90; 97) "\"hello\"" |
66 | FAT_ARROW@[98; 100) "=>" | 66 | WHITESPACE@[97; 98) " " |
67 | WHITESPACE@[100; 101) " " | 67 | FAT_ARROW@[98; 100) "=>" |
68 | TUPLE_EXPR@[101; 103) | 68 | WHITESPACE@[100; 101) " " |
69 | L_PAREN@[101; 102) "(" | 69 | TUPLE_EXPR@[101; 103) |
70 | R_PAREN@[102; 103) ")" | 70 | L_PAREN@[101; 102) "(" |
71 | COMMA@[103; 104) "," | 71 | R_PAREN@[102; 103) ")" |
72 | WHITESPACE@[104; 109) "\n " | 72 | COMMA@[103; 104) "," |
73 | R_CURLY@[109; 110) "}" | 73 | WHITESPACE@[104; 109) "\n " |
74 | WHITESPACE@[110; 111) "\n" | 74 | R_CURLY@[109; 110) "}" |
75 | R_CURLY@[111; 112) "}" | 75 | WHITESPACE@[110; 111) "\n" |
76 | R_CURLY@[111; 112) "}" | ||
76 | WHITESPACE@[112; 113) "\n" | 77 | WHITESPACE@[112; 113) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt index c86a0db3f..9a9a13370 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.txt | |||
@@ -104,7 +104,8 @@ SOURCE_FILE@[0; 116) | |||
104 | TYPE_BOUND@[110; 112) | 104 | TYPE_BOUND@[110; 112) |
105 | LIFETIME@[110; 112) "\'a" | 105 | LIFETIME@[110; 112) "\'a" |
106 | WHITESPACE@[112; 113) "\n" | 106 | WHITESPACE@[112; 113) "\n" |
107 | BLOCK@[113; 115) | 107 | BLOCK_EXPR@[113; 115) |
108 | L_CURLY@[113; 114) "{" | 108 | BLOCK@[113; 115) |
109 | R_CURLY@[114; 115) "}" | 109 | L_CURLY@[113; 114) "{" |
110 | R_CURLY@[114; 115) "}" | ||
110 | WHITESPACE@[115; 116) "\n" | 111 | WHITESPACE@[115; 116) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt index 7a8b81983..9788197be 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.txt | |||
@@ -10,7 +10,8 @@ SOURCE_FILE@[0; 18) | |||
10 | L_PAREN@[12; 13) "(" | 10 | L_PAREN@[12; 13) "(" |
11 | R_PAREN@[13; 14) ")" | 11 | R_PAREN@[13; 14) ")" |
12 | WHITESPACE@[14; 15) " " | 12 | WHITESPACE@[14; 15) " " |
13 | BLOCK@[15; 17) | 13 | BLOCK_EXPR@[15; 17) |
14 | L_CURLY@[15; 16) "{" | 14 | BLOCK@[15; 17) |
15 | R_CURLY@[16; 17) "}" | 15 | L_CURLY@[15; 16) "{" |
16 | R_CURLY@[16; 17) "}" | ||
16 | WHITESPACE@[17; 18) "\n" | 17 | WHITESPACE@[17; 18) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt index 1b7e9b905..3d659ce10 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.txt | |||
@@ -8,75 +8,76 @@ SOURCE_FILE@[0; 112) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 111) | 11 | BLOCK_EXPR@[10; 111) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 111) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | MATCH_EXPR@[16; 109) | 14 | WHITESPACE@[11; 16) "\n " |
15 | MATCH_KW@[16; 21) "match" | 15 | MATCH_EXPR@[16; 109) |
16 | WHITESPACE@[21; 22) " " | 16 | MATCH_KW@[16; 21) "match" |
17 | LITERAL@[22; 24) | 17 | WHITESPACE@[21; 22) " " |
18 | INT_NUMBER@[22; 24) "92" | 18 | LITERAL@[22; 24) |
19 | WHITESPACE@[24; 25) " " | 19 | INT_NUMBER@[22; 24) "92" |
20 | MATCH_ARM_LIST@[25; 109) | 20 | WHITESPACE@[24; 25) " " |
21 | L_CURLY@[25; 26) "{" | 21 | MATCH_ARM_LIST@[25; 109) |
22 | WHITESPACE@[26; 35) "\n " | 22 | L_CURLY@[25; 26) "{" |
23 | MATCH_ARM@[35; 50) | 23 | WHITESPACE@[26; 35) "\n " |
24 | RANGE_PAT@[35; 44) | 24 | MATCH_ARM@[35; 50) |
25 | LITERAL_PAT@[35; 36) | 25 | RANGE_PAT@[35; 44) |
26 | LITERAL@[35; 36) | 26 | LITERAL_PAT@[35; 36) |
27 | INT_NUMBER@[35; 36) "0" | 27 | LITERAL@[35; 36) |
28 | WHITESPACE@[36; 37) " " | 28 | INT_NUMBER@[35; 36) "0" |
29 | DOTDOTDOT@[37; 40) "..." | 29 | WHITESPACE@[36; 37) " " |
30 | WHITESPACE@[40; 41) " " | 30 | DOTDOTDOT@[37; 40) "..." |
31 | LITERAL_PAT@[41; 44) | 31 | WHITESPACE@[40; 41) " " |
32 | LITERAL@[41; 44) | 32 | LITERAL_PAT@[41; 44) |
33 | INT_NUMBER@[41; 44) "100" | 33 | LITERAL@[41; 44) |
34 | WHITESPACE@[44; 45) " " | 34 | INT_NUMBER@[41; 44) "100" |
35 | FAT_ARROW@[45; 47) "=>" | 35 | WHITESPACE@[44; 45) " " |
36 | WHITESPACE@[47; 48) " " | 36 | FAT_ARROW@[45; 47) "=>" |
37 | TUPLE_EXPR@[48; 50) | 37 | WHITESPACE@[47; 48) " " |
38 | L_PAREN@[48; 49) "(" | 38 | TUPLE_EXPR@[48; 50) |
39 | R_PAREN@[49; 50) ")" | 39 | L_PAREN@[48; 49) "(" |
40 | COMMA@[50; 51) "," | 40 | R_PAREN@[49; 50) ")" |
41 | WHITESPACE@[51; 60) "\n " | 41 | COMMA@[50; 51) "," |
42 | MATCH_ARM@[60; 77) | 42 | WHITESPACE@[51; 60) "\n " |
43 | RANGE_PAT@[60; 71) | 43 | MATCH_ARM@[60; 77) |
44 | LITERAL_PAT@[60; 63) | 44 | RANGE_PAT@[60; 71) |
45 | LITERAL@[60; 63) | 45 | LITERAL_PAT@[60; 63) |
46 | INT_NUMBER@[60; 63) "101" | 46 | LITERAL@[60; 63) |
47 | WHITESPACE@[63; 64) " " | 47 | INT_NUMBER@[60; 63) "101" |
48 | DOTDOTEQ@[64; 67) "..=" | 48 | WHITESPACE@[63; 64) " " |
49 | WHITESPACE@[67; 68) " " | 49 | DOTDOTEQ@[64; 67) "..=" |
50 | LITERAL_PAT@[68; 71) | 50 | WHITESPACE@[67; 68) " " |
51 | LITERAL@[68; 71) | 51 | LITERAL_PAT@[68; 71) |
52 | INT_NUMBER@[68; 71) "200" | 52 | LITERAL@[68; 71) |
53 | WHITESPACE@[71; 72) " " | 53 | INT_NUMBER@[68; 71) "200" |
54 | FAT_ARROW@[72; 74) "=>" | 54 | WHITESPACE@[71; 72) " " |
55 | WHITESPACE@[74; 75) " " | 55 | FAT_ARROW@[72; 74) "=>" |
56 | TUPLE_EXPR@[75; 77) | 56 | WHITESPACE@[74; 75) " " |
57 | L_PAREN@[75; 76) "(" | 57 | TUPLE_EXPR@[75; 77) |
58 | R_PAREN@[76; 77) ")" | 58 | L_PAREN@[75; 76) "(" |
59 | COMMA@[77; 78) "," | 59 | R_PAREN@[76; 77) ")" |
60 | WHITESPACE@[78; 87) "\n " | 60 | COMMA@[77; 78) "," |
61 | MATCH_ARM@[87; 102) | 61 | WHITESPACE@[78; 87) "\n " |
62 | RANGE_PAT@[87; 97) | 62 | MATCH_ARM@[87; 102) |
63 | LITERAL_PAT@[87; 90) | 63 | RANGE_PAT@[87; 97) |
64 | LITERAL@[87; 90) | 64 | LITERAL_PAT@[87; 90) |
65 | INT_NUMBER@[87; 90) "200" | 65 | LITERAL@[87; 90) |
66 | WHITESPACE@[90; 91) " " | 66 | INT_NUMBER@[87; 90) "200" |
67 | DOTDOT@[91; 93) ".." | 67 | WHITESPACE@[90; 91) " " |
68 | WHITESPACE@[93; 94) " " | 68 | DOTDOT@[91; 93) ".." |
69 | LITERAL_PAT@[94; 97) | 69 | WHITESPACE@[93; 94) " " |
70 | LITERAL@[94; 97) | 70 | LITERAL_PAT@[94; 97) |
71 | INT_NUMBER@[94; 97) "301" | 71 | LITERAL@[94; 97) |
72 | FAT_ARROW@[97; 99) "=>" | 72 | INT_NUMBER@[94; 97) "301" |
73 | WHITESPACE@[99; 100) " " | 73 | FAT_ARROW@[97; 99) "=>" |
74 | TUPLE_EXPR@[100; 102) | 74 | WHITESPACE@[99; 100) " " |
75 | L_PAREN@[100; 101) "(" | 75 | TUPLE_EXPR@[100; 102) |
76 | R_PAREN@[101; 102) ")" | 76 | L_PAREN@[100; 101) "(" |
77 | COMMA@[102; 103) "," | 77 | R_PAREN@[101; 102) ")" |
78 | WHITESPACE@[103; 108) "\n " | 78 | COMMA@[102; 103) "," |
79 | R_CURLY@[108; 109) "}" | 79 | WHITESPACE@[103; 108) "\n " |
80 | WHITESPACE@[109; 110) "\n" | 80 | R_CURLY@[108; 109) "}" |
81 | R_CURLY@[110; 111) "}" | 81 | WHITESPACE@[109; 110) "\n" |
82 | R_CURLY@[110; 111) "}" | ||
82 | WHITESPACE@[111; 112) "\n" | 83 | WHITESPACE@[111; 112) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt index 949117134..efcd89c4c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.txt | |||
@@ -8,52 +8,53 @@ SOURCE_FILE@[0; 83) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 82) | 11 | BLOCK_EXPR@[9; 82) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 82) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | MATCH_EXPR@[15; 80) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_KW@[15; 20) "match" | 15 | MATCH_EXPR@[15; 80) |
16 | WHITESPACE@[20; 21) " " | 16 | MATCH_KW@[15; 20) "match" |
17 | TUPLE_EXPR@[21; 23) | 17 | WHITESPACE@[20; 21) " " |
18 | L_PAREN@[21; 22) "(" | 18 | TUPLE_EXPR@[21; 23) |
19 | R_PAREN@[22; 23) ")" | 19 | L_PAREN@[21; 22) "(" |
20 | WHITESPACE@[23; 24) " " | 20 | R_PAREN@[22; 23) ")" |
21 | MATCH_ARM_LIST@[24; 80) | 21 | WHITESPACE@[23; 24) " " |
22 | L_CURLY@[24; 25) "{" | 22 | MATCH_ARM_LIST@[24; 80) |
23 | WHITESPACE@[25; 34) "\n " | 23 | L_CURLY@[24; 25) "{" |
24 | MATCH_ARM@[34; 41) | 24 | WHITESPACE@[25; 34) "\n " |
25 | PLACEHOLDER_PAT@[34; 35) | 25 | MATCH_ARM@[34; 41) |
26 | UNDERSCORE@[34; 35) "_" | 26 | PLACEHOLDER_PAT@[34; 35) |
27 | WHITESPACE@[35; 36) " " | 27 | UNDERSCORE@[34; 35) "_" |
28 | FAT_ARROW@[36; 38) "=>" | 28 | WHITESPACE@[35; 36) " " |
29 | WHITESPACE@[38; 39) " " | 29 | FAT_ARROW@[36; 38) "=>" |
30 | TUPLE_EXPR@[39; 41) | 30 | WHITESPACE@[38; 39) " " |
31 | L_PAREN@[39; 40) "(" | 31 | TUPLE_EXPR@[39; 41) |
32 | R_PAREN@[40; 41) ")" | 32 | L_PAREN@[39; 40) "(" |
33 | COMMA@[41; 42) "," | 33 | R_PAREN@[40; 41) ")" |
34 | WHITESPACE@[42; 51) "\n " | 34 | COMMA@[41; 42) "," |
35 | MATCH_ARM@[51; 58) | 35 | WHITESPACE@[42; 51) "\n " |
36 | PLACEHOLDER_PAT@[51; 52) | 36 | MATCH_ARM@[51; 58) |
37 | UNDERSCORE@[51; 52) "_" | 37 | PLACEHOLDER_PAT@[51; 52) |
38 | WHITESPACE@[52; 53) " " | 38 | UNDERSCORE@[51; 52) "_" |
39 | FAT_ARROW@[53; 55) "=>" | 39 | WHITESPACE@[52; 53) " " |
40 | WHITESPACE@[55; 56) " " | 40 | FAT_ARROW@[53; 55) "=>" |
41 | BLOCK_EXPR@[56; 58) | 41 | WHITESPACE@[55; 56) " " |
42 | BLOCK@[56; 58) | 42 | BLOCK_EXPR@[56; 58) |
43 | L_CURLY@[56; 57) "{" | 43 | BLOCK@[56; 58) |
44 | R_CURLY@[57; 58) "}" | 44 | L_CURLY@[56; 57) "{" |
45 | WHITESPACE@[58; 67) "\n " | 45 | R_CURLY@[57; 58) "}" |
46 | MATCH_ARM@[67; 74) | 46 | WHITESPACE@[58; 67) "\n " |
47 | PLACEHOLDER_PAT@[67; 68) | 47 | MATCH_ARM@[67; 74) |
48 | UNDERSCORE@[67; 68) "_" | 48 | PLACEHOLDER_PAT@[67; 68) |
49 | WHITESPACE@[68; 69) " " | 49 | UNDERSCORE@[67; 68) "_" |
50 | FAT_ARROW@[69; 71) "=>" | 50 | WHITESPACE@[68; 69) " " |
51 | WHITESPACE@[71; 72) " " | 51 | FAT_ARROW@[69; 71) "=>" |
52 | TUPLE_EXPR@[72; 74) | 52 | WHITESPACE@[71; 72) " " |
53 | L_PAREN@[72; 73) "(" | 53 | TUPLE_EXPR@[72; 74) |
54 | R_PAREN@[73; 74) ")" | 54 | L_PAREN@[72; 73) "(" |
55 | WHITESPACE@[74; 79) "\n " | 55 | R_PAREN@[73; 74) ")" |
56 | R_CURLY@[79; 80) "}" | 56 | WHITESPACE@[74; 79) "\n " |
57 | WHITESPACE@[80; 81) "\n" | 57 | R_CURLY@[79; 80) "}" |
58 | R_CURLY@[81; 82) "}" | 58 | WHITESPACE@[80; 81) "\n" |
59 | R_CURLY@[81; 82) "}" | ||
59 | WHITESPACE@[82; 83) "\n" | 60 | WHITESPACE@[82; 83) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.txt b/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.txt index 1c915ea0c..dcf527639 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.txt | |||
@@ -8,111 +8,112 @@ SOURCE_FILE@[0; 112) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 111) | 11 | BLOCK_EXPR@[9; 111) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 111) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 20) | 14 | WHITESPACE@[10; 15) "\n " |
15 | RECORD_LIT@[15; 19) | 15 | EXPR_STMT@[15; 20) |
16 | PATH@[15; 16) | 16 | RECORD_LIT@[15; 19) |
17 | PATH_SEGMENT@[15; 16) | 17 | PATH@[15; 16) |
18 | NAME_REF@[15; 16) | 18 | PATH_SEGMENT@[15; 16) |
19 | IDENT@[15; 16) "S" | 19 | NAME_REF@[15; 16) |
20 | WHITESPACE@[16; 17) " " | 20 | IDENT@[15; 16) "S" |
21 | RECORD_FIELD_LIST@[17; 19) | 21 | WHITESPACE@[16; 17) " " |
22 | L_CURLY@[17; 18) "{" | 22 | RECORD_FIELD_LIST@[17; 19) |
23 | R_CURLY@[18; 19) "}" | 23 | L_CURLY@[17; 18) "{" |
24 | SEMI@[19; 20) ";" | 24 | R_CURLY@[18; 19) "}" |
25 | WHITESPACE@[20; 25) "\n " | 25 | SEMI@[19; 20) ";" |
26 | EXPR_STMT@[25; 41) | 26 | WHITESPACE@[20; 25) "\n " |
27 | RECORD_LIT@[25; 40) | 27 | EXPR_STMT@[25; 41) |
28 | PATH@[25; 26) | 28 | RECORD_LIT@[25; 40) |
29 | PATH_SEGMENT@[25; 26) | 29 | PATH@[25; 26) |
30 | NAME_REF@[25; 26) | 30 | PATH_SEGMENT@[25; 26) |
31 | IDENT@[25; 26) "S" | 31 | NAME_REF@[25; 26) |
32 | WHITESPACE@[26; 27) " " | 32 | IDENT@[25; 26) "S" |
33 | RECORD_FIELD_LIST@[27; 40) | 33 | WHITESPACE@[26; 27) " " |
34 | L_CURLY@[27; 28) "{" | 34 | RECORD_FIELD_LIST@[27; 40) |
35 | WHITESPACE@[28; 29) " " | 35 | L_CURLY@[27; 28) "{" |
36 | RECORD_FIELD@[29; 30) | 36 | WHITESPACE@[28; 29) " " |
37 | NAME_REF@[29; 30) | 37 | RECORD_FIELD@[29; 30) |
38 | IDENT@[29; 30) "x" | 38 | NAME_REF@[29; 30) |
39 | COMMA@[30; 31) "," | 39 | IDENT@[29; 30) "x" |
40 | WHITESPACE@[31; 32) " " | 40 | COMMA@[30; 31) "," |
41 | RECORD_FIELD@[32; 37) | 41 | WHITESPACE@[31; 32) " " |
42 | NAME_REF@[32; 33) | 42 | RECORD_FIELD@[32; 37) |
43 | IDENT@[32; 33) "y" | 43 | NAME_REF@[32; 33) |
44 | COLON@[33; 34) ":" | 44 | IDENT@[32; 33) "y" |
45 | WHITESPACE@[34; 35) " " | 45 | COLON@[33; 34) ":" |
46 | LITERAL@[35; 37) | 46 | WHITESPACE@[34; 35) " " |
47 | INT_NUMBER@[35; 37) "32" | 47 | LITERAL@[35; 37) |
48 | COMMA@[37; 38) "," | 48 | INT_NUMBER@[35; 37) "32" |
49 | WHITESPACE@[38; 39) " " | 49 | COMMA@[37; 38) "," |
50 | R_CURLY@[39; 40) "}" | 50 | WHITESPACE@[38; 39) " " |
51 | SEMI@[40; 41) ";" | 51 | R_CURLY@[39; 40) "}" |
52 | WHITESPACE@[41; 46) "\n " | 52 | SEMI@[40; 41) ";" |
53 | EXPR_STMT@[46; 83) | 53 | WHITESPACE@[41; 46) "\n " |
54 | RECORD_LIT@[46; 82) | 54 | EXPR_STMT@[46; 83) |
55 | PATH@[46; 47) | 55 | RECORD_LIT@[46; 82) |
56 | PATH_SEGMENT@[46; 47) | 56 | PATH@[46; 47) |
57 | NAME_REF@[46; 47) | 57 | PATH_SEGMENT@[46; 47) |
58 | IDENT@[46; 47) "S" | 58 | NAME_REF@[46; 47) |
59 | WHITESPACE@[47; 48) " " | 59 | IDENT@[46; 47) "S" |
60 | RECORD_FIELD_LIST@[48; 82) | 60 | WHITESPACE@[47; 48) " " |
61 | L_CURLY@[48; 49) "{" | 61 | RECORD_FIELD_LIST@[48; 82) |
62 | WHITESPACE@[49; 50) " " | 62 | L_CURLY@[48; 49) "{" |
63 | RECORD_FIELD@[50; 51) | 63 | WHITESPACE@[49; 50) " " |
64 | NAME_REF@[50; 51) | 64 | RECORD_FIELD@[50; 51) |
65 | IDENT@[50; 51) "x" | 65 | NAME_REF@[50; 51) |
66 | COMMA@[51; 52) "," | 66 | IDENT@[50; 51) "x" |
67 | WHITESPACE@[52; 53) " " | 67 | COMMA@[51; 52) "," |
68 | RECORD_FIELD@[53; 58) | 68 | WHITESPACE@[52; 53) " " |
69 | NAME_REF@[53; 54) | 69 | RECORD_FIELD@[53; 58) |
70 | IDENT@[53; 54) "y" | 70 | NAME_REF@[53; 54) |
71 | COLON@[54; 55) ":" | 71 | IDENT@[53; 54) "y" |
72 | WHITESPACE@[55; 56) " " | 72 | COLON@[54; 55) ":" |
73 | LITERAL@[56; 58) | 73 | WHITESPACE@[55; 56) " " |
74 | INT_NUMBER@[56; 58) "32" | 74 | LITERAL@[56; 58) |
75 | COMMA@[58; 59) "," | 75 | INT_NUMBER@[56; 58) "32" |
76 | WHITESPACE@[59; 60) " " | 76 | COMMA@[58; 59) "," |
77 | DOTDOT@[60; 62) ".." | 77 | WHITESPACE@[59; 60) " " |
78 | CALL_EXPR@[62; 80) | 78 | DOTDOT@[60; 62) ".." |
79 | PATH_EXPR@[62; 78) | 79 | CALL_EXPR@[62; 80) |
80 | PATH@[62; 78) | 80 | PATH_EXPR@[62; 78) |
81 | PATH@[62; 69) | 81 | PATH@[62; 78) |
82 | PATH_SEGMENT@[62; 69) | 82 | PATH@[62; 69) |
83 | NAME_REF@[62; 69) | 83 | PATH_SEGMENT@[62; 69) |
84 | IDENT@[62; 69) "Default" | 84 | NAME_REF@[62; 69) |
85 | COLONCOLON@[69; 71) "::" | 85 | IDENT@[62; 69) "Default" |
86 | PATH_SEGMENT@[71; 78) | 86 | COLONCOLON@[69; 71) "::" |
87 | NAME_REF@[71; 78) | 87 | PATH_SEGMENT@[71; 78) |
88 | IDENT@[71; 78) "default" | 88 | NAME_REF@[71; 78) |
89 | ARG_LIST@[78; 80) | 89 | IDENT@[71; 78) "default" |
90 | L_PAREN@[78; 79) "(" | 90 | ARG_LIST@[78; 80) |
91 | R_PAREN@[79; 80) ")" | 91 | L_PAREN@[78; 79) "(" |
92 | WHITESPACE@[80; 81) " " | 92 | R_PAREN@[79; 80) ")" |
93 | R_CURLY@[81; 82) "}" | 93 | WHITESPACE@[80; 81) " " |
94 | SEMI@[82; 83) ";" | 94 | R_CURLY@[81; 82) "}" |
95 | WHITESPACE@[83; 88) "\n " | 95 | SEMI@[82; 83) ";" |
96 | EXPR_STMT@[88; 109) | 96 | WHITESPACE@[83; 88) "\n " |
97 | RECORD_LIT@[88; 108) | 97 | EXPR_STMT@[88; 109) |
98 | PATH@[88; 99) | 98 | RECORD_LIT@[88; 108) |
99 | PATH_SEGMENT@[88; 99) | 99 | PATH@[88; 99) |
100 | NAME_REF@[88; 99) | 100 | PATH_SEGMENT@[88; 99) |
101 | IDENT@[88; 99) "TupleStruct" | 101 | NAME_REF@[88; 99) |
102 | WHITESPACE@[99; 100) " " | 102 | IDENT@[88; 99) "TupleStruct" |
103 | RECORD_FIELD_LIST@[100; 108) | 103 | WHITESPACE@[99; 100) " " |
104 | L_CURLY@[100; 101) "{" | 104 | RECORD_FIELD_LIST@[100; 108) |
105 | WHITESPACE@[101; 102) " " | 105 | L_CURLY@[100; 101) "{" |
106 | RECORD_FIELD@[102; 106) | 106 | WHITESPACE@[101; 102) " " |
107 | NAME_REF@[102; 103) | 107 | RECORD_FIELD@[102; 106) |
108 | INT_NUMBER@[102; 103) "0" | 108 | NAME_REF@[102; 103) |
109 | COLON@[103; 104) ":" | 109 | INT_NUMBER@[102; 103) "0" |
110 | WHITESPACE@[104; 105) " " | 110 | COLON@[103; 104) ":" |
111 | LITERAL@[105; 106) | 111 | WHITESPACE@[104; 105) " " |
112 | INT_NUMBER@[105; 106) "1" | 112 | LITERAL@[105; 106) |
113 | WHITESPACE@[106; 107) " " | 113 | INT_NUMBER@[105; 106) "1" |
114 | R_CURLY@[107; 108) "}" | 114 | WHITESPACE@[106; 107) " " |
115 | SEMI@[108; 109) ";" | 115 | R_CURLY@[107; 108) "}" |
116 | WHITESPACE@[109; 110) "\n" | 116 | SEMI@[108; 109) ";" |
117 | R_CURLY@[110; 111) "}" | 117 | WHITESPACE@[109; 110) "\n" |
118 | R_CURLY@[110; 111) "}" | ||
118 | WHITESPACE@[111; 112) "\n" | 119 | WHITESPACE@[111; 112) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt index db2b9a582..6b528c252 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.txt | |||
@@ -8,9 +8,10 @@ SOURCE_FILE@[0; 70) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 11) | 11 | BLOCK_EXPR@[9; 11) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 11) |
13 | R_CURLY@[10; 11) "}" | 13 | L_CURLY@[9; 10) "{" |
14 | R_CURLY@[10; 11) "}" | ||
14 | WHITESPACE@[11; 12) "\n" | 15 | WHITESPACE@[11; 12) "\n" |
15 | MACRO_CALL@[12; 31) | 16 | MACRO_CALL@[12; 31) |
16 | PATH@[12; 23) | 17 | PATH@[12; 23) |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt index 554bda6fb..14ea91fd2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.txt | |||
@@ -8,88 +8,96 @@ SOURCE_FILE@[0; 107) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 106) | 11 | BLOCK_EXPR@[9; 106) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 106) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 26) | 14 | WHITESPACE@[10; 15) "\n " |
15 | IF_EXPR@[15; 25) | 15 | EXPR_STMT@[15; 26) |
16 | IF_KW@[15; 17) "if" | 16 | IF_EXPR@[15; 25) |
17 | WHITESPACE@[17; 18) " " | 17 | IF_KW@[15; 17) "if" |
18 | CONDITION@[18; 22) | 18 | WHITESPACE@[17; 18) " " |
19 | LITERAL@[18; 22) | 19 | CONDITION@[18; 22) |
20 | TRUE_KW@[18; 22) "true" | 20 | LITERAL@[18; 22) |
21 | WHITESPACE@[22; 23) " " | 21 | TRUE_KW@[18; 22) "true" |
22 | BLOCK@[23; 25) | 22 | WHITESPACE@[22; 23) " " |
23 | L_CURLY@[23; 24) "{" | 23 | BLOCK_EXPR@[23; 25) |
24 | R_CURLY@[24; 25) "}" | 24 | BLOCK@[23; 25) |
25 | SEMI@[25; 26) ";" | 25 | L_CURLY@[23; 24) "{" |
26 | WHITESPACE@[26; 31) "\n " | 26 | R_CURLY@[24; 25) "}" |
27 | EXPR_STMT@[31; 50) | 27 | SEMI@[25; 26) ";" |
28 | IF_EXPR@[31; 49) | 28 | WHITESPACE@[26; 31) "\n " |
29 | IF_KW@[31; 33) "if" | 29 | EXPR_STMT@[31; 50) |
30 | WHITESPACE@[33; 34) " " | 30 | IF_EXPR@[31; 49) |
31 | CONDITION@[34; 38) | 31 | IF_KW@[31; 33) "if" |
32 | LITERAL@[34; 38) | 32 | WHITESPACE@[33; 34) " " |
33 | TRUE_KW@[34; 38) "true" | 33 | CONDITION@[34; 38) |
34 | WHITESPACE@[38; 39) " " | 34 | LITERAL@[34; 38) |
35 | BLOCK@[39; 41) | 35 | TRUE_KW@[34; 38) "true" |
36 | L_CURLY@[39; 40) "{" | 36 | WHITESPACE@[38; 39) " " |
37 | R_CURLY@[40; 41) "}" | 37 | BLOCK_EXPR@[39; 41) |
38 | WHITESPACE@[41; 42) " " | 38 | BLOCK@[39; 41) |
39 | ELSE_KW@[42; 46) "else" | 39 | L_CURLY@[39; 40) "{" |
40 | WHITESPACE@[46; 47) " " | 40 | R_CURLY@[40; 41) "}" |
41 | BLOCK@[47; 49) | 41 | WHITESPACE@[41; 42) " " |
42 | L_CURLY@[47; 48) "{" | 42 | ELSE_KW@[42; 46) "else" |
43 | R_CURLY@[48; 49) "}" | 43 | WHITESPACE@[46; 47) " " |
44 | SEMI@[49; 50) ";" | 44 | BLOCK_EXPR@[47; 49) |
45 | WHITESPACE@[50; 55) "\n " | 45 | BLOCK@[47; 49) |
46 | EXPR_STMT@[55; 91) | 46 | L_CURLY@[47; 48) "{" |
47 | IF_EXPR@[55; 90) | 47 | R_CURLY@[48; 49) "}" |
48 | IF_KW@[55; 57) "if" | 48 | SEMI@[49; 50) ";" |
49 | WHITESPACE@[57; 58) " " | 49 | WHITESPACE@[50; 55) "\n " |
50 | CONDITION@[58; 62) | 50 | EXPR_STMT@[55; 91) |
51 | LITERAL@[58; 62) | 51 | IF_EXPR@[55; 90) |
52 | TRUE_KW@[58; 62) "true" | 52 | IF_KW@[55; 57) "if" |
53 | WHITESPACE@[62; 63) " " | 53 | WHITESPACE@[57; 58) " " |
54 | BLOCK@[63; 65) | 54 | CONDITION@[58; 62) |
55 | L_CURLY@[63; 64) "{" | 55 | LITERAL@[58; 62) |
56 | R_CURLY@[64; 65) "}" | 56 | TRUE_KW@[58; 62) "true" |
57 | WHITESPACE@[65; 66) " " | 57 | WHITESPACE@[62; 63) " " |
58 | ELSE_KW@[66; 70) "else" | 58 | BLOCK_EXPR@[63; 65) |
59 | WHITESPACE@[70; 71) " " | 59 | BLOCK@[63; 65) |
60 | IF_EXPR@[71; 90) | 60 | L_CURLY@[63; 64) "{" |
61 | IF_KW@[71; 73) "if" | 61 | R_CURLY@[64; 65) "}" |
62 | WHITESPACE@[73; 74) " " | 62 | WHITESPACE@[65; 66) " " |
63 | CONDITION@[74; 79) | 63 | ELSE_KW@[66; 70) "else" |
64 | LITERAL@[74; 79) | 64 | WHITESPACE@[70; 71) " " |
65 | FALSE_KW@[74; 79) "false" | 65 | IF_EXPR@[71; 90) |
66 | WHITESPACE@[79; 80) " " | 66 | IF_KW@[71; 73) "if" |
67 | BLOCK@[80; 82) | 67 | WHITESPACE@[73; 74) " " |
68 | L_CURLY@[80; 81) "{" | 68 | CONDITION@[74; 79) |
69 | R_CURLY@[81; 82) "}" | 69 | LITERAL@[74; 79) |
70 | WHITESPACE@[82; 83) " " | 70 | FALSE_KW@[74; 79) "false" |
71 | ELSE_KW@[83; 87) "else" | 71 | WHITESPACE@[79; 80) " " |
72 | WHITESPACE@[87; 88) " " | 72 | BLOCK_EXPR@[80; 82) |
73 | BLOCK@[88; 90) | 73 | BLOCK@[80; 82) |
74 | L_CURLY@[88; 89) "{" | 74 | L_CURLY@[80; 81) "{" |
75 | R_CURLY@[89; 90) "}" | 75 | R_CURLY@[81; 82) "}" |
76 | SEMI@[90; 91) ";" | 76 | WHITESPACE@[82; 83) " " |
77 | WHITESPACE@[91; 96) "\n " | 77 | ELSE_KW@[83; 87) "else" |
78 | EXPR_STMT@[96; 104) | 78 | WHITESPACE@[87; 88) " " |
79 | IF_EXPR@[96; 103) | 79 | BLOCK_EXPR@[88; 90) |
80 | IF_KW@[96; 98) "if" | 80 | BLOCK@[88; 90) |
81 | WHITESPACE@[98; 99) " " | 81 | L_CURLY@[88; 89) "{" |
82 | CONDITION@[99; 100) | 82 | R_CURLY@[89; 90) "}" |
83 | PATH_EXPR@[99; 100) | 83 | SEMI@[90; 91) ";" |
84 | PATH@[99; 100) | 84 | WHITESPACE@[91; 96) "\n " |
85 | PATH_SEGMENT@[99; 100) | 85 | EXPR_STMT@[96; 104) |
86 | NAME_REF@[99; 100) | 86 | IF_EXPR@[96; 103) |
87 | IDENT@[99; 100) "S" | 87 | IF_KW@[96; 98) "if" |
88 | WHITESPACE@[100; 101) " " | 88 | WHITESPACE@[98; 99) " " |
89 | BLOCK@[101; 103) | 89 | CONDITION@[99; 100) |
90 | L_CURLY@[101; 102) "{" | 90 | PATH_EXPR@[99; 100) |
91 | R_CURLY@[102; 103) "}" | 91 | PATH@[99; 100) |
92 | SEMI@[103; 104) ";" | 92 | PATH_SEGMENT@[99; 100) |
93 | WHITESPACE@[104; 105) "\n" | 93 | NAME_REF@[99; 100) |
94 | R_CURLY@[105; 106) "}" | 94 | IDENT@[99; 100) "S" |
95 | WHITESPACE@[100; 101) " " | ||
96 | BLOCK_EXPR@[101; 103) | ||
97 | BLOCK@[101; 103) | ||
98 | L_CURLY@[101; 102) "{" | ||
99 | R_CURLY@[102; 103) "}" | ||
100 | SEMI@[103; 104) ";" | ||
101 | WHITESPACE@[104; 105) "\n" | ||
102 | R_CURLY@[105; 106) "}" | ||
95 | WHITESPACE@[106; 107) "\n" | 103 | WHITESPACE@[106; 107) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt index c2f256ac3..87272917b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.txt | |||
@@ -8,142 +8,143 @@ SOURCE_FILE@[0; 167) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 166) | 11 | BLOCK_EXPR@[9; 166) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 166) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 164) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_EXPR@[15; 163) | 15 | EXPR_STMT@[15; 164) |
16 | MATCH_KW@[15; 20) "match" | 16 | MATCH_EXPR@[15; 163) |
17 | WHITESPACE@[20; 21) " " | 17 | MATCH_KW@[15; 20) "match" |
18 | TUPLE_EXPR@[21; 23) | 18 | WHITESPACE@[20; 21) " " |
19 | L_PAREN@[21; 22) "(" | 19 | TUPLE_EXPR@[21; 23) |
20 | R_PAREN@[22; 23) ")" | 20 | L_PAREN@[21; 22) "(" |
21 | WHITESPACE@[23; 24) " " | 21 | R_PAREN@[22; 23) ")" |
22 | MATCH_ARM_LIST@[24; 163) | 22 | WHITESPACE@[23; 24) " " |
23 | L_CURLY@[24; 25) "{" | 23 | MATCH_ARM_LIST@[24; 163) |
24 | WHITESPACE@[25; 34) "\n " | 24 | L_CURLY@[24; 25) "{" |
25 | MATCH_ARM@[34; 41) | 25 | WHITESPACE@[25; 34) "\n " |
26 | PLACEHOLDER_PAT@[34; 35) | 26 | MATCH_ARM@[34; 41) |
27 | UNDERSCORE@[34; 35) "_" | 27 | PLACEHOLDER_PAT@[34; 35) |
28 | WHITESPACE@[35; 36) " " | 28 | UNDERSCORE@[34; 35) "_" |
29 | FAT_ARROW@[36; 38) "=>" | 29 | WHITESPACE@[35; 36) " " |
30 | WHITESPACE@[38; 39) " " | 30 | FAT_ARROW@[36; 38) "=>" |
31 | TUPLE_EXPR@[39; 41) | 31 | WHITESPACE@[38; 39) " " |
32 | L_PAREN@[39; 40) "(" | 32 | TUPLE_EXPR@[39; 41) |
33 | R_PAREN@[40; 41) ")" | 33 | L_PAREN@[39; 40) "(" |
34 | COMMA@[41; 42) "," | 34 | R_PAREN@[40; 41) ")" |
35 | WHITESPACE@[42; 51) "\n " | 35 | COMMA@[41; 42) "," |
36 | MATCH_ARM@[51; 83) | 36 | WHITESPACE@[42; 51) "\n " |
37 | PLACEHOLDER_PAT@[51; 52) | 37 | MATCH_ARM@[51; 83) |
38 | UNDERSCORE@[51; 52) "_" | 38 | PLACEHOLDER_PAT@[51; 52) |
39 | WHITESPACE@[52; 53) " " | 39 | UNDERSCORE@[51; 52) "_" |
40 | MATCH_GUARD@[53; 77) | 40 | WHITESPACE@[52; 53) " " |
41 | IF_KW@[53; 55) "if" | 41 | MATCH_GUARD@[53; 77) |
42 | WHITESPACE@[55; 56) " " | 42 | IF_KW@[53; 55) "if" |
43 | BIN_EXPR@[56; 77) | 43 | WHITESPACE@[55; 56) " " |
44 | PATH_EXPR@[56; 60) | 44 | BIN_EXPR@[56; 77) |
45 | PATH@[56; 60) | 45 | PATH_EXPR@[56; 60) |
46 | PATH_SEGMENT@[56; 60) | 46 | PATH@[56; 60) |
47 | NAME_REF@[56; 60) | 47 | PATH_SEGMENT@[56; 60) |
48 | IDENT@[56; 60) "Test" | 48 | NAME_REF@[56; 60) |
49 | WHITESPACE@[60; 61) " " | 49 | IDENT@[56; 60) "Test" |
50 | R_ANGLE@[61; 62) ">" | 50 | WHITESPACE@[60; 61) " " |
51 | WHITESPACE@[62; 63) " " | 51 | R_ANGLE@[61; 62) ">" |
52 | RECORD_LIT@[63; 77) | 52 | WHITESPACE@[62; 63) " " |
53 | PATH@[63; 67) | 53 | RECORD_LIT@[63; 77) |
54 | PATH_SEGMENT@[63; 67) | 54 | PATH@[63; 67) |
55 | NAME_REF@[63; 67) | 55 | PATH_SEGMENT@[63; 67) |
56 | IDENT@[63; 67) "Test" | 56 | NAME_REF@[63; 67) |
57 | RECORD_FIELD_LIST@[67; 77) | 57 | IDENT@[63; 67) "Test" |
58 | L_CURLY@[67; 68) "{" | 58 | RECORD_FIELD_LIST@[67; 77) |
59 | RECORD_FIELD@[68; 76) | 59 | L_CURLY@[67; 68) "{" |
60 | NAME_REF@[68; 73) | 60 | RECORD_FIELD@[68; 76) |
61 | IDENT@[68; 73) "field" | 61 | NAME_REF@[68; 73) |
62 | COLON@[73; 74) ":" | 62 | IDENT@[68; 73) "field" |
63 | WHITESPACE@[74; 75) " " | 63 | COLON@[73; 74) ":" |
64 | LITERAL@[75; 76) | 64 | WHITESPACE@[74; 75) " " |
65 | INT_NUMBER@[75; 76) "0" | 65 | LITERAL@[75; 76) |
66 | R_CURLY@[76; 77) "}" | 66 | INT_NUMBER@[75; 76) "0" |
67 | WHITESPACE@[77; 78) " " | 67 | R_CURLY@[76; 77) "}" |
68 | FAT_ARROW@[78; 80) "=>" | 68 | WHITESPACE@[77; 78) " " |
69 | WHITESPACE@[80; 81) " " | 69 | FAT_ARROW@[78; 80) "=>" |
70 | TUPLE_EXPR@[81; 83) | 70 | WHITESPACE@[80; 81) " " |
71 | L_PAREN@[81; 82) "(" | 71 | TUPLE_EXPR@[81; 83) |
72 | R_PAREN@[82; 83) ")" | 72 | L_PAREN@[81; 82) "(" |
73 | COMMA@[83; 84) "," | 73 | R_PAREN@[82; 83) ")" |
74 | WHITESPACE@[84; 93) "\n " | 74 | COMMA@[83; 84) "," |
75 | MATCH_ARM@[93; 109) | 75 | WHITESPACE@[84; 93) "\n " |
76 | BIND_PAT@[93; 94) | 76 | MATCH_ARM@[93; 109) |
77 | NAME@[93; 94) | 77 | BIND_PAT@[93; 94) |
78 | IDENT@[93; 94) "X" | 78 | NAME@[93; 94) |
79 | WHITESPACE@[94; 95) " " | 79 | IDENT@[93; 94) "X" |
80 | PIPE@[95; 96) "|" | 80 | WHITESPACE@[94; 95) " " |
81 | WHITESPACE@[96; 97) " " | 81 | PIPE@[95; 96) "|" |
82 | BIND_PAT@[97; 98) | 82 | WHITESPACE@[96; 97) " " |
83 | NAME@[97; 98) | 83 | BIND_PAT@[97; 98) |
84 | IDENT@[97; 98) "Y" | 84 | NAME@[97; 98) |
85 | WHITESPACE@[98; 99) " " | 85 | IDENT@[97; 98) "Y" |
86 | MATCH_GUARD@[99; 103) | 86 | WHITESPACE@[98; 99) " " |
87 | IF_KW@[99; 101) "if" | 87 | MATCH_GUARD@[99; 103) |
88 | WHITESPACE@[101; 102) " " | 88 | IF_KW@[99; 101) "if" |
89 | PATH_EXPR@[102; 103) | 89 | WHITESPACE@[101; 102) " " |
90 | PATH@[102; 103) | 90 | PATH_EXPR@[102; 103) |
91 | PATH_SEGMENT@[102; 103) | 91 | PATH@[102; 103) |
92 | NAME_REF@[102; 103) | 92 | PATH_SEGMENT@[102; 103) |
93 | IDENT@[102; 103) "Z" | 93 | NAME_REF@[102; 103) |
94 | WHITESPACE@[103; 104) " " | 94 | IDENT@[102; 103) "Z" |
95 | FAT_ARROW@[104; 106) "=>" | 95 | WHITESPACE@[103; 104) " " |
96 | WHITESPACE@[106; 107) " " | 96 | FAT_ARROW@[104; 106) "=>" |
97 | TUPLE_EXPR@[107; 109) | 97 | WHITESPACE@[106; 107) " " |
98 | L_PAREN@[107; 108) "(" | 98 | TUPLE_EXPR@[107; 109) |
99 | R_PAREN@[108; 109) ")" | 99 | L_PAREN@[107; 108) "(" |
100 | COMMA@[109; 110) "," | 100 | R_PAREN@[108; 109) ")" |
101 | WHITESPACE@[110; 119) "\n " | 101 | COMMA@[109; 110) "," |
102 | MATCH_ARM@[119; 137) | 102 | WHITESPACE@[110; 119) "\n " |
103 | PIPE@[119; 120) "|" | 103 | MATCH_ARM@[119; 137) |
104 | WHITESPACE@[120; 121) " " | 104 | PIPE@[119; 120) "|" |
105 | BIND_PAT@[121; 122) | 105 | WHITESPACE@[120; 121) " " |
106 | NAME@[121; 122) | 106 | BIND_PAT@[121; 122) |
107 | IDENT@[121; 122) "X" | 107 | NAME@[121; 122) |
108 | WHITESPACE@[122; 123) " " | 108 | IDENT@[121; 122) "X" |
109 | PIPE@[123; 124) "|" | 109 | WHITESPACE@[122; 123) " " |
110 | WHITESPACE@[124; 125) " " | 110 | PIPE@[123; 124) "|" |
111 | BIND_PAT@[125; 126) | 111 | WHITESPACE@[124; 125) " " |
112 | NAME@[125; 126) | 112 | BIND_PAT@[125; 126) |
113 | IDENT@[125; 126) "Y" | 113 | NAME@[125; 126) |
114 | WHITESPACE@[126; 127) " " | 114 | IDENT@[125; 126) "Y" |
115 | MATCH_GUARD@[127; 131) | 115 | WHITESPACE@[126; 127) " " |
116 | IF_KW@[127; 129) "if" | 116 | MATCH_GUARD@[127; 131) |
117 | WHITESPACE@[129; 130) " " | 117 | IF_KW@[127; 129) "if" |
118 | PATH_EXPR@[130; 131) | 118 | WHITESPACE@[129; 130) " " |
119 | PATH@[130; 131) | 119 | PATH_EXPR@[130; 131) |
120 | PATH_SEGMENT@[130; 131) | 120 | PATH@[130; 131) |
121 | NAME_REF@[130; 131) | 121 | PATH_SEGMENT@[130; 131) |
122 | IDENT@[130; 131) "Z" | 122 | NAME_REF@[130; 131) |
123 | WHITESPACE@[131; 132) " " | 123 | IDENT@[130; 131) "Z" |
124 | FAT_ARROW@[132; 134) "=>" | 124 | WHITESPACE@[131; 132) " " |
125 | WHITESPACE@[134; 135) " " | 125 | FAT_ARROW@[132; 134) "=>" |
126 | TUPLE_EXPR@[135; 137) | 126 | WHITESPACE@[134; 135) " " |
127 | L_PAREN@[135; 136) "(" | 127 | TUPLE_EXPR@[135; 137) |
128 | R_PAREN@[136; 137) ")" | 128 | L_PAREN@[135; 136) "(" |
129 | COMMA@[137; 138) "," | 129 | R_PAREN@[136; 137) ")" |
130 | WHITESPACE@[138; 147) "\n " | 130 | COMMA@[137; 138) "," |
131 | MATCH_ARM@[147; 156) | 131 | WHITESPACE@[138; 147) "\n " |
132 | PIPE@[147; 148) "|" | 132 | MATCH_ARM@[147; 156) |
133 | WHITESPACE@[148; 149) " " | 133 | PIPE@[147; 148) "|" |
134 | BIND_PAT@[149; 150) | 134 | WHITESPACE@[148; 149) " " |
135 | NAME@[149; 150) | 135 | BIND_PAT@[149; 150) |
136 | IDENT@[149; 150) "X" | 136 | NAME@[149; 150) |
137 | WHITESPACE@[150; 151) " " | 137 | IDENT@[149; 150) "X" |
138 | FAT_ARROW@[151; 153) "=>" | 138 | WHITESPACE@[150; 151) " " |
139 | WHITESPACE@[153; 154) " " | 139 | FAT_ARROW@[151; 153) "=>" |
140 | TUPLE_EXPR@[154; 156) | 140 | WHITESPACE@[153; 154) " " |
141 | L_PAREN@[154; 155) "(" | 141 | TUPLE_EXPR@[154; 156) |
142 | R_PAREN@[155; 156) ")" | 142 | L_PAREN@[154; 155) "(" |
143 | COMMA@[156; 157) "," | 143 | R_PAREN@[155; 156) ")" |
144 | WHITESPACE@[157; 162) "\n " | 144 | COMMA@[156; 157) "," |
145 | R_CURLY@[162; 163) "}" | 145 | WHITESPACE@[157; 162) "\n " |
146 | SEMI@[163; 164) ";" | 146 | R_CURLY@[162; 163) "}" |
147 | WHITESPACE@[164; 165) "\n" | 147 | SEMI@[163; 164) ";" |
148 | R_CURLY@[165; 166) "}" | 148 | WHITESPACE@[164; 165) "\n" |
149 | R_CURLY@[165; 166) "}" | ||
149 | WHITESPACE@[166; 167) "\n" | 150 | WHITESPACE@[166; 167) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt index 40333d565..cd63d10f7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.txt | |||
@@ -8,45 +8,46 @@ SOURCE_FILE@[0; 46) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 45) | 11 | BLOCK_EXPR@[9; 45) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 45) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 31) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 31) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PLACEHOLDER_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | UNDERSCORE@[19; 20) "_" | 18 | PLACEHOLDER_PAT@[19; 20) |
19 | WHITESPACE@[20; 21) " " | 19 | UNDERSCORE@[19; 20) "_" |
20 | EQ@[21; 22) "=" | 20 | WHITESPACE@[20; 21) " " |
21 | WHITESPACE@[22; 23) " " | 21 | EQ@[21; 22) "=" |
22 | BIN_EXPR@[23; 30) | 22 | WHITESPACE@[22; 23) " " |
23 | BLOCK_EXPR@[23; 26) | 23 | BIN_EXPR@[23; 30) |
24 | BLOCK@[23; 26) | 24 | BLOCK_EXPR@[23; 26) |
25 | L_CURLY@[23; 24) "{" | 25 | BLOCK@[23; 26) |
26 | LITERAL@[24; 25) | 26 | L_CURLY@[23; 24) "{" |
27 | INT_NUMBER@[24; 25) "1" | 27 | LITERAL@[24; 25) |
28 | R_CURLY@[25; 26) "}" | 28 | INT_NUMBER@[24; 25) "1" |
29 | WHITESPACE@[26; 27) " " | 29 | R_CURLY@[25; 26) "}" |
30 | AMP@[27; 28) "&" | 30 | WHITESPACE@[26; 27) " " |
31 | WHITESPACE@[28; 29) " " | 31 | AMP@[27; 28) "&" |
32 | LITERAL@[29; 30) | 32 | WHITESPACE@[28; 29) " " |
33 | INT_NUMBER@[29; 30) "2" | 33 | LITERAL@[29; 30) |
34 | SEMI@[30; 31) ";" | 34 | INT_NUMBER@[29; 30) "2" |
35 | WHITESPACE@[31; 36) "\n " | 35 | SEMI@[30; 31) ";" |
36 | EXPR_STMT@[36; 39) | 36 | WHITESPACE@[31; 36) "\n " |
37 | BLOCK_EXPR@[36; 39) | 37 | EXPR_STMT@[36; 39) |
38 | BLOCK@[36; 39) | 38 | BLOCK_EXPR@[36; 39) |
39 | L_CURLY@[36; 37) "{" | 39 | BLOCK@[36; 39) |
40 | LITERAL@[37; 38) | 40 | L_CURLY@[36; 37) "{" |
41 | INT_NUMBER@[37; 38) "1" | 41 | LITERAL@[37; 38) |
42 | R_CURLY@[38; 39) "}" | 42 | INT_NUMBER@[37; 38) "1" |
43 | WHITESPACE@[39; 40) " " | 43 | R_CURLY@[38; 39) "}" |
44 | EXPR_STMT@[40; 43) | 44 | WHITESPACE@[39; 40) " " |
45 | REF_EXPR@[40; 42) | 45 | EXPR_STMT@[40; 43) |
46 | AMP@[40; 41) "&" | 46 | REF_EXPR@[40; 42) |
47 | LITERAL@[41; 42) | 47 | AMP@[40; 41) "&" |
48 | INT_NUMBER@[41; 42) "2" | 48 | LITERAL@[41; 42) |
49 | SEMI@[42; 43) ";" | 49 | INT_NUMBER@[41; 42) "2" |
50 | WHITESPACE@[43; 44) "\n" | 50 | SEMI@[42; 43) ";" |
51 | R_CURLY@[44; 45) "}" | 51 | WHITESPACE@[43; 44) "\n" |
52 | R_CURLY@[44; 45) "}" | ||
52 | WHITESPACE@[45; 46) "\n" | 53 | WHITESPACE@[45; 46) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt index 658948c66..f62b6c6d5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.txt | |||
@@ -8,37 +8,38 @@ SOURCE_FILE@[0; 47) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 46) | 11 | BLOCK_EXPR@[9; 46) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 46) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 28) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_EXPR@[15; 27) | 15 | EXPR_STMT@[15; 28) |
16 | MATCH_KW@[15; 20) "match" | 16 | MATCH_EXPR@[15; 27) |
17 | WHITESPACE@[20; 21) " " | 17 | MATCH_KW@[15; 20) "match" |
18 | TUPLE_EXPR@[21; 23) | 18 | WHITESPACE@[20; 21) " " |
19 | L_PAREN@[21; 22) "(" | 19 | TUPLE_EXPR@[21; 23) |
20 | R_PAREN@[22; 23) ")" | 20 | L_PAREN@[21; 22) "(" |
21 | WHITESPACE@[23; 24) " " | 21 | R_PAREN@[22; 23) ")" |
22 | MATCH_ARM_LIST@[24; 27) | 22 | WHITESPACE@[23; 24) " " |
23 | L_CURLY@[24; 25) "{" | 23 | MATCH_ARM_LIST@[24; 27) |
24 | WHITESPACE@[25; 26) " " | 24 | L_CURLY@[24; 25) "{" |
25 | R_CURLY@[26; 27) "}" | 25 | WHITESPACE@[25; 26) " " |
26 | SEMI@[27; 28) ";" | 26 | R_CURLY@[26; 27) "}" |
27 | WHITESPACE@[28; 33) "\n " | 27 | SEMI@[27; 28) ";" |
28 | EXPR_STMT@[33; 44) | 28 | WHITESPACE@[28; 33) "\n " |
29 | MATCH_EXPR@[33; 43) | 29 | EXPR_STMT@[33; 44) |
30 | MATCH_KW@[33; 38) "match" | 30 | MATCH_EXPR@[33; 43) |
31 | WHITESPACE@[38; 39) " " | 31 | MATCH_KW@[33; 38) "match" |
32 | PATH_EXPR@[39; 40) | 32 | WHITESPACE@[38; 39) " " |
33 | PATH@[39; 40) | 33 | PATH_EXPR@[39; 40) |
34 | PATH_SEGMENT@[39; 40) | 34 | PATH@[39; 40) |
35 | NAME_REF@[39; 40) | 35 | PATH_SEGMENT@[39; 40) |
36 | IDENT@[39; 40) "S" | 36 | NAME_REF@[39; 40) |
37 | WHITESPACE@[40; 41) " " | 37 | IDENT@[39; 40) "S" |
38 | MATCH_ARM_LIST@[41; 43) | 38 | WHITESPACE@[40; 41) " " |
39 | L_CURLY@[41; 42) "{" | 39 | MATCH_ARM_LIST@[41; 43) |
40 | R_CURLY@[42; 43) "}" | 40 | L_CURLY@[41; 42) "{" |
41 | SEMI@[43; 44) ";" | 41 | R_CURLY@[42; 43) "}" |
42 | WHITESPACE@[44; 45) "\n" | 42 | SEMI@[43; 44) ";" |
43 | R_CURLY@[45; 46) "}" | 43 | WHITESPACE@[44; 45) "\n" |
44 | R_CURLY@[45; 46) "}" | ||
44 | WHITESPACE@[46; 47) "\n" | 45 | WHITESPACE@[46; 47) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt index cd9e10bed..4a83a7200 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.txt | |||
@@ -8,21 +8,22 @@ SOURCE_FILE@[0; 40) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 39) | 11 | BLOCK_EXPR@[9; 39) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 39) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 22) | 14 | WHITESPACE@[10; 15) "\n " |
15 | RETURN_EXPR@[15; 21) | 15 | EXPR_STMT@[15; 22) |
16 | RETURN_KW@[15; 21) "return" | 16 | RETURN_EXPR@[15; 21) |
17 | SEMI@[21; 22) ";" | 17 | RETURN_KW@[15; 21) "return" |
18 | WHITESPACE@[22; 27) "\n " | 18 | SEMI@[21; 22) ";" |
19 | EXPR_STMT@[27; 37) | 19 | WHITESPACE@[22; 27) "\n " |
20 | RETURN_EXPR@[27; 36) | 20 | EXPR_STMT@[27; 37) |
21 | RETURN_KW@[27; 33) "return" | 21 | RETURN_EXPR@[27; 36) |
22 | WHITESPACE@[33; 34) " " | 22 | RETURN_KW@[27; 33) "return" |
23 | LITERAL@[34; 36) | 23 | WHITESPACE@[33; 34) " " |
24 | INT_NUMBER@[34; 36) "92" | 24 | LITERAL@[34; 36) |
25 | SEMI@[36; 37) ";" | 25 | INT_NUMBER@[34; 36) "92" |
26 | WHITESPACE@[37; 38) "\n" | 26 | SEMI@[36; 37) ";" |
27 | R_CURLY@[38; 39) "}" | 27 | WHITESPACE@[37; 38) "\n" |
28 | R_CURLY@[38; 39) "}" | ||
28 | WHITESPACE@[39; 40) "\n" | 29 | WHITESPACE@[39; 40) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt index 48af2f350..cbd2d5fbf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.txt | |||
@@ -8,55 +8,56 @@ SOURCE_FILE@[0; 84) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 83) | 11 | BLOCK_EXPR@[9; 83) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 83) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | MATCH_EXPR@[15; 81) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_KW@[15; 20) "match" | 15 | MATCH_EXPR@[15; 81) |
16 | WHITESPACE@[20; 21) " " | 16 | MATCH_KW@[15; 20) "match" |
17 | TUPLE_EXPR@[21; 23) | 17 | WHITESPACE@[20; 21) " " |
18 | L_PAREN@[21; 22) "(" | 18 | TUPLE_EXPR@[21; 23) |
19 | R_PAREN@[22; 23) ")" | 19 | L_PAREN@[21; 22) "(" |
20 | WHITESPACE@[23; 24) " " | 20 | R_PAREN@[22; 23) ")" |
21 | MATCH_ARM_LIST@[24; 81) | 21 | WHITESPACE@[23; 24) " " |
22 | L_CURLY@[24; 25) "{" | 22 | MATCH_ARM_LIST@[24; 81) |
23 | WHITESPACE@[25; 34) "\n " | 23 | L_CURLY@[24; 25) "{" |
24 | MATCH_ARM@[34; 41) | 24 | WHITESPACE@[25; 34) "\n " |
25 | PLACEHOLDER_PAT@[34; 35) | 25 | MATCH_ARM@[34; 41) |
26 | UNDERSCORE@[34; 35) "_" | 26 | PLACEHOLDER_PAT@[34; 35) |
27 | WHITESPACE@[35; 36) " " | 27 | UNDERSCORE@[34; 35) "_" |
28 | FAT_ARROW@[36; 38) "=>" | 28 | WHITESPACE@[35; 36) " " |
29 | WHITESPACE@[38; 39) " " | 29 | FAT_ARROW@[36; 38) "=>" |
30 | BLOCK_EXPR@[39; 41) | 30 | WHITESPACE@[38; 39) " " |
31 | BLOCK@[39; 41) | 31 | BLOCK_EXPR@[39; 41) |
32 | L_CURLY@[39; 40) "{" | 32 | BLOCK@[39; 41) |
33 | R_CURLY@[40; 41) "}" | 33 | L_CURLY@[39; 40) "{" |
34 | WHITESPACE@[41; 50) "\n " | 34 | R_CURLY@[40; 41) "}" |
35 | MATCH_ARM@[50; 58) | 35 | WHITESPACE@[41; 50) "\n " |
36 | TUPLE_PAT@[50; 52) | 36 | MATCH_ARM@[50; 58) |
37 | L_PAREN@[50; 51) "(" | 37 | TUPLE_PAT@[50; 52) |
38 | R_PAREN@[51; 52) ")" | 38 | L_PAREN@[50; 51) "(" |
39 | WHITESPACE@[52; 53) " " | 39 | R_PAREN@[51; 52) ")" |
40 | FAT_ARROW@[53; 55) "=>" | 40 | WHITESPACE@[52; 53) " " |
41 | WHITESPACE@[55; 56) " " | 41 | FAT_ARROW@[53; 55) "=>" |
42 | BLOCK_EXPR@[56; 58) | 42 | WHITESPACE@[55; 56) " " |
43 | BLOCK@[56; 58) | 43 | BLOCK_EXPR@[56; 58) |
44 | L_CURLY@[56; 57) "{" | 44 | BLOCK@[56; 58) |
45 | R_CURLY@[57; 58) "}" | 45 | L_CURLY@[56; 57) "{" |
46 | WHITESPACE@[58; 67) "\n " | 46 | R_CURLY@[57; 58) "}" |
47 | MATCH_ARM@[67; 75) | 47 | WHITESPACE@[58; 67) "\n " |
48 | SLICE_PAT@[67; 69) | 48 | MATCH_ARM@[67; 75) |
49 | L_BRACK@[67; 68) "[" | 49 | SLICE_PAT@[67; 69) |
50 | R_BRACK@[68; 69) "]" | 50 | L_BRACK@[67; 68) "[" |
51 | WHITESPACE@[69; 70) " " | 51 | R_BRACK@[68; 69) "]" |
52 | FAT_ARROW@[70; 72) "=>" | 52 | WHITESPACE@[69; 70) " " |
53 | WHITESPACE@[72; 73) " " | 53 | FAT_ARROW@[70; 72) "=>" |
54 | BLOCK_EXPR@[73; 75) | 54 | WHITESPACE@[72; 73) " " |
55 | BLOCK@[73; 75) | 55 | BLOCK_EXPR@[73; 75) |
56 | L_CURLY@[73; 74) "{" | 56 | BLOCK@[73; 75) |
57 | R_CURLY@[74; 75) "}" | 57 | L_CURLY@[73; 74) "{" |
58 | WHITESPACE@[75; 80) "\n " | 58 | R_CURLY@[74; 75) "}" |
59 | R_CURLY@[80; 81) "}" | 59 | WHITESPACE@[75; 80) "\n " |
60 | WHITESPACE@[81; 82) "\n" | 60 | R_CURLY@[80; 81) "}" |
61 | R_CURLY@[82; 83) "}" | 61 | WHITESPACE@[81; 82) "\n" |
62 | R_CURLY@[82; 83) "}" | ||
62 | WHITESPACE@[83; 84) "\n" | 63 | WHITESPACE@[83; 84) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt index 36983590f..28d1bad97 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.txt | |||
@@ -8,9 +8,10 @@ SOURCE_FILE@[0; 65) | |||
8 | L_PAREN@[4; 5) "(" | 8 | L_PAREN@[4; 5) "(" |
9 | R_PAREN@[5; 6) ")" | 9 | R_PAREN@[5; 6) ")" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | BLOCK@[7; 9) | 11 | BLOCK_EXPR@[7; 9) |
12 | L_CURLY@[7; 8) "{" | 12 | BLOCK@[7; 9) |
13 | R_CURLY@[8; 9) "}" | 13 | L_CURLY@[7; 8) "{" |
14 | R_CURLY@[8; 9) "}" | ||
14 | WHITESPACE@[9; 10) "\n" | 15 | WHITESPACE@[9; 10) "\n" |
15 | FN_DEF@[10; 31) | 16 | FN_DEF@[10; 31) |
16 | FN_KW@[10; 12) "fn" | 17 | FN_KW@[10; 12) "fn" |
@@ -21,22 +22,23 @@ SOURCE_FILE@[0; 65) | |||
21 | L_PAREN@[14; 15) "(" | 22 | L_PAREN@[14; 15) "(" |
22 | R_PAREN@[15; 16) ")" | 23 | R_PAREN@[15; 16) ")" |
23 | WHITESPACE@[16; 17) " " | 24 | WHITESPACE@[16; 17) " " |
24 | BLOCK@[17; 31) | 25 | BLOCK_EXPR@[17; 31) |
25 | L_CURLY@[17; 18) "{" | 26 | BLOCK@[17; 31) |
26 | WHITESPACE@[18; 19) " " | 27 | L_CURLY@[17; 18) "{" |
27 | LET_STMT@[19; 29) | 28 | WHITESPACE@[18; 19) " " |
28 | LET_KW@[19; 22) "let" | 29 | LET_STMT@[19; 29) |
29 | WHITESPACE@[22; 23) " " | 30 | LET_KW@[19; 22) "let" |
30 | PLACEHOLDER_PAT@[23; 24) | 31 | WHITESPACE@[22; 23) " " |
31 | UNDERSCORE@[23; 24) "_" | 32 | PLACEHOLDER_PAT@[23; 24) |
32 | WHITESPACE@[24; 25) " " | 33 | UNDERSCORE@[23; 24) "_" |
33 | EQ@[25; 26) "=" | 34 | WHITESPACE@[24; 25) " " |
34 | WHITESPACE@[26; 27) " " | 35 | EQ@[25; 26) "=" |
35 | LITERAL@[27; 28) | 36 | WHITESPACE@[26; 27) " " |
36 | INT_NUMBER@[27; 28) "1" | 37 | LITERAL@[27; 28) |
37 | SEMI@[28; 29) ";" | 38 | INT_NUMBER@[27; 28) "1" |
38 | WHITESPACE@[29; 30) " " | 39 | SEMI@[28; 29) ";" |
39 | R_CURLY@[30; 31) "}" | 40 | WHITESPACE@[29; 30) " " |
41 | R_CURLY@[30; 31) "}" | ||
40 | WHITESPACE@[31; 32) "\n" | 42 | WHITESPACE@[31; 32) "\n" |
41 | FN_DEF@[32; 48) | 43 | FN_DEF@[32; 48) |
42 | FN_KW@[32; 34) "fn" | 44 | FN_KW@[32; 34) "fn" |
@@ -47,20 +49,21 @@ SOURCE_FILE@[0; 65) | |||
47 | L_PAREN@[36; 37) "(" | 49 | L_PAREN@[36; 37) "(" |
48 | R_PAREN@[37; 38) ")" | 50 | R_PAREN@[37; 38) ")" |
49 | WHITESPACE@[38; 39) " " | 51 | WHITESPACE@[38; 39) " " |
50 | BLOCK@[39; 48) | 52 | BLOCK_EXPR@[39; 48) |
51 | L_CURLY@[39; 40) "{" | 53 | BLOCK@[39; 48) |
52 | WHITESPACE@[40; 41) " " | 54 | L_CURLY@[39; 40) "{" |
53 | EXPR_STMT@[41; 43) | 55 | WHITESPACE@[40; 41) " " |
54 | LITERAL@[41; 42) | 56 | EXPR_STMT@[41; 43) |
55 | INT_NUMBER@[41; 42) "1" | 57 | LITERAL@[41; 42) |
56 | SEMI@[42; 43) ";" | 58 | INT_NUMBER@[41; 42) "1" |
57 | WHITESPACE@[43; 44) " " | 59 | SEMI@[42; 43) ";" |
58 | EXPR_STMT@[44; 46) | 60 | WHITESPACE@[43; 44) " " |
59 | LITERAL@[44; 45) | 61 | EXPR_STMT@[44; 46) |
60 | INT_NUMBER@[44; 45) "2" | 62 | LITERAL@[44; 45) |
61 | SEMI@[45; 46) ";" | 63 | INT_NUMBER@[44; 45) "2" |
62 | WHITESPACE@[46; 47) " " | 64 | SEMI@[45; 46) ";" |
63 | R_CURLY@[47; 48) "}" | 65 | WHITESPACE@[46; 47) " " |
66 | R_CURLY@[47; 48) "}" | ||
64 | WHITESPACE@[48; 49) "\n" | 67 | WHITESPACE@[48; 49) "\n" |
65 | FN_DEF@[49; 64) | 68 | FN_DEF@[49; 64) |
66 | FN_KW@[49; 51) "fn" | 69 | FN_KW@[49; 51) "fn" |
@@ -71,16 +74,17 @@ SOURCE_FILE@[0; 65) | |||
71 | L_PAREN@[53; 54) "(" | 74 | L_PAREN@[53; 54) "(" |
72 | R_PAREN@[54; 55) ")" | 75 | R_PAREN@[54; 55) ")" |
73 | WHITESPACE@[55; 56) " " | 76 | WHITESPACE@[55; 56) " " |
74 | BLOCK@[56; 64) | 77 | BLOCK_EXPR@[56; 64) |
75 | L_CURLY@[56; 57) "{" | 78 | BLOCK@[56; 64) |
76 | WHITESPACE@[57; 58) " " | 79 | L_CURLY@[56; 57) "{" |
77 | EXPR_STMT@[58; 60) | 80 | WHITESPACE@[57; 58) " " |
78 | LITERAL@[58; 59) | 81 | EXPR_STMT@[58; 60) |
79 | INT_NUMBER@[58; 59) "1" | 82 | LITERAL@[58; 59) |
80 | SEMI@[59; 60) ";" | 83 | INT_NUMBER@[58; 59) "1" |
81 | WHITESPACE@[60; 61) " " | 84 | SEMI@[59; 60) ";" |
82 | LITERAL@[61; 62) | 85 | WHITESPACE@[60; 61) " " |
83 | INT_NUMBER@[61; 62) "2" | 86 | LITERAL@[61; 62) |
84 | WHITESPACE@[62; 63) " " | 87 | INT_NUMBER@[61; 62) "2" |
85 | R_CURLY@[63; 64) "}" | 88 | WHITESPACE@[62; 63) " " |
89 | R_CURLY@[63; 64) "}" | ||
86 | WHITESPACE@[64; 65) "\n" | 90 | WHITESPACE@[64; 65) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt index 32979c523..8e4b63f02 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.txt | |||
@@ -33,7 +33,8 @@ SOURCE_FILE@[0; 29) | |||
33 | NAME_REF@[21; 25) | 33 | NAME_REF@[21; 25) |
34 | IDENT@[21; 25) "Copy" | 34 | IDENT@[21; 25) "Copy" |
35 | WHITESPACE@[25; 26) " " | 35 | WHITESPACE@[25; 26) " " |
36 | BLOCK@[26; 28) | 36 | BLOCK_EXPR@[26; 28) |
37 | L_CURLY@[26; 27) "{" | 37 | BLOCK@[26; 28) |
38 | R_CURLY@[27; 28) "}" | 38 | L_CURLY@[26; 27) "{" |
39 | R_CURLY@[27; 28) "}" | ||
39 | WHITESPACE@[28; 29) "\n" | 40 | WHITESPACE@[28; 29) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt index 72de14b98..18ccfe9ef 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.txt | |||
@@ -8,18 +8,19 @@ SOURCE_FILE@[0; 21) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 20) | 11 | BLOCK_EXPR@[9; 20) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 20) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 18) | 14 | WHITESPACE@[10; 15) "\n " |
15 | TRY_EXPR@[15; 17) | 15 | EXPR_STMT@[15; 18) |
16 | PATH_EXPR@[15; 16) | 16 | TRY_EXPR@[15; 17) |
17 | PATH@[15; 16) | 17 | PATH_EXPR@[15; 16) |
18 | PATH_SEGMENT@[15; 16) | 18 | PATH@[15; 16) |
19 | NAME_REF@[15; 16) | 19 | PATH_SEGMENT@[15; 16) |
20 | IDENT@[15; 16) "x" | 20 | NAME_REF@[15; 16) |
21 | QUESTION@[16; 17) "?" | 21 | IDENT@[15; 16) "x" |
22 | SEMI@[17; 18) ";" | 22 | QUESTION@[16; 17) "?" |
23 | WHITESPACE@[18; 19) "\n" | 23 | SEMI@[17; 18) ";" |
24 | R_CURLY@[19; 20) "}" | 24 | WHITESPACE@[18; 19) "\n" |
25 | R_CURLY@[19; 20) "}" | ||
25 | WHITESPACE@[20; 21) "\n" | 26 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt index 541add812..f3c292f5e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.txt | |||
@@ -8,23 +8,24 @@ SOURCE_FILE@[0; 26) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 25) | 11 | BLOCK_EXPR@[9; 25) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 25) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[11; 23) | 14 | WHITESPACE@[10; 11) " " |
15 | LET_KW@[11; 14) "let" | 15 | LET_STMT@[11; 23) |
16 | WHITESPACE@[14; 15) " " | 16 | LET_KW@[11; 14) "let" |
17 | BIND_PAT@[15; 16) | 17 | WHITESPACE@[14; 15) " " |
18 | NAME@[15; 16) | 18 | BIND_PAT@[15; 16) |
19 | IDENT@[15; 16) "x" | 19 | NAME@[15; 16) |
20 | WHITESPACE@[16; 17) " " | 20 | IDENT@[15; 16) "x" |
21 | EQ@[17; 18) "=" | 21 | WHITESPACE@[16; 17) " " |
22 | WHITESPACE@[18; 19) " " | 22 | EQ@[17; 18) "=" |
23 | RANGE_EXPR@[19; 22) | 23 | WHITESPACE@[18; 19) " " |
24 | LITERAL@[19; 20) | 24 | RANGE_EXPR@[19; 22) |
25 | INT_NUMBER@[19; 20) "1" | 25 | LITERAL@[19; 20) |
26 | DOTDOT@[20; 22) ".." | 26 | INT_NUMBER@[19; 20) "1" |
27 | SEMI@[22; 23) ";" | 27 | DOTDOT@[20; 22) ".." |
28 | WHITESPACE@[23; 24) " " | 28 | SEMI@[22; 23) ";" |
29 | R_CURLY@[24; 25) "}" | 29 | WHITESPACE@[23; 24) " " |
30 | R_CURLY@[24; 25) "}" | ||
30 | WHITESPACE@[25; 26) "\n" | 31 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt index c12ce4ddb..b1353c2c6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.txt | |||
@@ -88,9 +88,10 @@ SOURCE_FILE@[0; 200) | |||
88 | NAME_REF@[68; 76) | 88 | NAME_REF@[68; 76) |
89 | IDENT@[68; 76) "Iterator" | 89 | IDENT@[68; 76) "Iterator" |
90 | WHITESPACE@[76; 77) " " | 90 | WHITESPACE@[76; 77) " " |
91 | BLOCK@[77; 79) | 91 | BLOCK_EXPR@[77; 79) |
92 | L_CURLY@[77; 78) "{" | 92 | BLOCK@[77; 79) |
93 | R_CURLY@[78; 79) "}" | 93 | L_CURLY@[77; 78) "{" |
94 | R_CURLY@[78; 79) "}" | ||
94 | WHITESPACE@[79; 80) "\n" | 95 | WHITESPACE@[79; 80) "\n" |
95 | FN_DEF@[80; 134) | 96 | FN_DEF@[80; 134) |
96 | FN_KW@[80; 82) "fn" | 97 | FN_KW@[80; 82) "fn" |
@@ -153,9 +154,10 @@ SOURCE_FILE@[0; 200) | |||
153 | NAME_REF@[123; 131) | 154 | NAME_REF@[123; 131) |
154 | IDENT@[123; 131) "Iterator" | 155 | IDENT@[123; 131) "Iterator" |
155 | WHITESPACE@[131; 132) " " | 156 | WHITESPACE@[131; 132) " " |
156 | BLOCK@[132; 134) | 157 | BLOCK_EXPR@[132; 134) |
157 | L_CURLY@[132; 133) "{" | 158 | BLOCK@[132; 134) |
158 | R_CURLY@[133; 134) "}" | 159 | L_CURLY@[132; 133) "{" |
160 | R_CURLY@[133; 134) "}" | ||
159 | WHITESPACE@[134; 135) "\n" | 161 | WHITESPACE@[134; 135) "\n" |
160 | FN_DEF@[135; 199) | 162 | FN_DEF@[135; 199) |
161 | FN_KW@[135; 137) "fn" | 163 | FN_KW@[135; 137) "fn" |
@@ -234,7 +236,8 @@ SOURCE_FILE@[0; 200) | |||
234 | NAME_REF@[188; 196) | 236 | NAME_REF@[188; 196) |
235 | IDENT@[188; 196) "Iterator" | 237 | IDENT@[188; 196) "Iterator" |
236 | WHITESPACE@[196; 197) " " | 238 | WHITESPACE@[196; 197) " " |
237 | BLOCK@[197; 199) | 239 | BLOCK_EXPR@[197; 199) |
238 | L_CURLY@[197; 198) "{" | 240 | BLOCK@[197; 199) |
239 | R_CURLY@[198; 199) "}" | 241 | L_CURLY@[197; 198) "{" |
242 | R_CURLY@[198; 199) "}" | ||
240 | WHITESPACE@[199; 200) "\n" | 243 | WHITESPACE@[199; 200) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt index 87a56d8ce..8f34afe76 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.txt | |||
@@ -8,47 +8,48 @@ SOURCE_FILE@[0; 52) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 51) | 11 | BLOCK_EXPR@[9; 51) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 51) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 26) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 26) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PLACEHOLDER_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | UNDERSCORE@[19; 20) "_" | 18 | PLACEHOLDER_PAT@[19; 20) |
19 | WHITESPACE@[20; 21) " " | 19 | UNDERSCORE@[19; 20) "_" |
20 | EQ@[21; 22) "=" | 20 | WHITESPACE@[20; 21) " " |
21 | WHITESPACE@[22; 23) " " | 21 | EQ@[21; 22) "=" |
22 | REF_EXPR@[23; 25) | 22 | WHITESPACE@[22; 23) " " |
23 | AMP@[23; 24) "&" | 23 | REF_EXPR@[23; 25) |
24 | LITERAL@[24; 25) | 24 | AMP@[23; 24) "&" |
25 | INT_NUMBER@[24; 25) "1" | 25 | LITERAL@[24; 25) |
26 | SEMI@[25; 26) ";" | 26 | INT_NUMBER@[24; 25) "1" |
27 | WHITESPACE@[26; 31) "\n " | 27 | SEMI@[25; 26) ";" |
28 | LET_STMT@[31; 49) | 28 | WHITESPACE@[26; 31) "\n " |
29 | LET_KW@[31; 34) "let" | 29 | LET_STMT@[31; 49) |
30 | WHITESPACE@[34; 35) " " | 30 | LET_KW@[31; 34) "let" |
31 | PLACEHOLDER_PAT@[35; 36) | 31 | WHITESPACE@[34; 35) " " |
32 | UNDERSCORE@[35; 36) "_" | 32 | PLACEHOLDER_PAT@[35; 36) |
33 | WHITESPACE@[36; 37) " " | 33 | UNDERSCORE@[35; 36) "_" |
34 | EQ@[37; 38) "=" | 34 | WHITESPACE@[36; 37) " " |
35 | WHITESPACE@[38; 39) " " | 35 | EQ@[37; 38) "=" |
36 | REF_EXPR@[39; 48) | 36 | WHITESPACE@[38; 39) " " |
37 | AMP@[39; 40) "&" | 37 | REF_EXPR@[39; 48) |
38 | MUT_KW@[40; 43) "mut" | 38 | AMP@[39; 40) "&" |
39 | WHITESPACE@[43; 44) " " | 39 | MUT_KW@[40; 43) "mut" |
40 | REF_EXPR@[44; 48) | 40 | WHITESPACE@[43; 44) " " |
41 | AMP@[44; 45) "&" | 41 | REF_EXPR@[44; 48) |
42 | CALL_EXPR@[45; 48) | 42 | AMP@[44; 45) "&" |
43 | PATH_EXPR@[45; 46) | 43 | CALL_EXPR@[45; 48) |
44 | PATH@[45; 46) | 44 | PATH_EXPR@[45; 46) |
45 | PATH_SEGMENT@[45; 46) | 45 | PATH@[45; 46) |
46 | NAME_REF@[45; 46) | 46 | PATH_SEGMENT@[45; 46) |
47 | IDENT@[45; 46) "f" | 47 | NAME_REF@[45; 46) |
48 | ARG_LIST@[46; 48) | 48 | IDENT@[45; 46) "f" |
49 | L_PAREN@[46; 47) "(" | 49 | ARG_LIST@[46; 48) |
50 | R_PAREN@[47; 48) ")" | 50 | L_PAREN@[46; 47) "(" |
51 | SEMI@[48; 49) ";" | 51 | R_PAREN@[47; 48) ")" |
52 | WHITESPACE@[49; 50) "\n" | 52 | SEMI@[48; 49) ";" |
53 | R_CURLY@[50; 51) "}" | 53 | WHITESPACE@[49; 50) "\n" |
54 | R_CURLY@[50; 51) "}" | ||
54 | WHITESPACE@[51; 52) "\n" | 55 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt index 2f2be32b9..2903c6f9a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.txt | |||
@@ -8,128 +8,129 @@ SOURCE_FILE@[0; 189) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 188) | 11 | BLOCK_EXPR@[9; 188) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 188) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 28) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 28) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PLACEHOLDER_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | UNDERSCORE@[19; 20) "_" | 18 | PLACEHOLDER_PAT@[19; 20) |
19 | WHITESPACE@[20; 21) " " | 19 | UNDERSCORE@[19; 20) "_" |
20 | EQ@[21; 22) "=" | 20 | WHITESPACE@[20; 21) " " |
21 | WHITESPACE@[22; 23) " " | 21 | EQ@[21; 22) "=" |
22 | LITERAL@[23; 27) | 22 | WHITESPACE@[22; 23) " " |
23 | TRUE_KW@[23; 27) "true" | 23 | LITERAL@[23; 27) |
24 | SEMI@[27; 28) ";" | 24 | TRUE_KW@[23; 27) "true" |
25 | WHITESPACE@[28; 33) "\n " | 25 | SEMI@[27; 28) ";" |
26 | LET_STMT@[33; 47) | 26 | WHITESPACE@[28; 33) "\n " |
27 | LET_KW@[33; 36) "let" | 27 | LET_STMT@[33; 47) |
28 | WHITESPACE@[36; 37) " " | 28 | LET_KW@[33; 36) "let" |
29 | PLACEHOLDER_PAT@[37; 38) | 29 | WHITESPACE@[36; 37) " " |
30 | UNDERSCORE@[37; 38) "_" | 30 | PLACEHOLDER_PAT@[37; 38) |
31 | WHITESPACE@[38; 39) " " | 31 | UNDERSCORE@[37; 38) "_" |
32 | EQ@[39; 40) "=" | 32 | WHITESPACE@[38; 39) " " |
33 | WHITESPACE@[40; 41) " " | 33 | EQ@[39; 40) "=" |
34 | LITERAL@[41; 46) | 34 | WHITESPACE@[40; 41) " " |
35 | FALSE_KW@[41; 46) "false" | 35 | LITERAL@[41; 46) |
36 | SEMI@[46; 47) ";" | 36 | FALSE_KW@[41; 46) "false" |
37 | WHITESPACE@[47; 52) "\n " | 37 | SEMI@[46; 47) ";" |
38 | LET_STMT@[52; 62) | 38 | WHITESPACE@[47; 52) "\n " |
39 | LET_KW@[52; 55) "let" | 39 | LET_STMT@[52; 62) |
40 | WHITESPACE@[55; 56) " " | 40 | LET_KW@[52; 55) "let" |
41 | PLACEHOLDER_PAT@[56; 57) | 41 | WHITESPACE@[55; 56) " " |
42 | UNDERSCORE@[56; 57) "_" | 42 | PLACEHOLDER_PAT@[56; 57) |
43 | WHITESPACE@[57; 58) " " | 43 | UNDERSCORE@[56; 57) "_" |
44 | EQ@[58; 59) "=" | 44 | WHITESPACE@[57; 58) " " |
45 | WHITESPACE@[59; 60) " " | 45 | EQ@[58; 59) "=" |
46 | LITERAL@[60; 61) | 46 | WHITESPACE@[59; 60) " " |
47 | INT_NUMBER@[60; 61) "1" | 47 | LITERAL@[60; 61) |
48 | SEMI@[61; 62) ";" | 48 | INT_NUMBER@[60; 61) "1" |
49 | WHITESPACE@[62; 67) "\n " | 49 | SEMI@[61; 62) ";" |
50 | LET_STMT@[67; 79) | 50 | WHITESPACE@[62; 67) "\n " |
51 | LET_KW@[67; 70) "let" | 51 | LET_STMT@[67; 79) |
52 | WHITESPACE@[70; 71) " " | 52 | LET_KW@[67; 70) "let" |
53 | PLACEHOLDER_PAT@[71; 72) | 53 | WHITESPACE@[70; 71) " " |
54 | UNDERSCORE@[71; 72) "_" | 54 | PLACEHOLDER_PAT@[71; 72) |
55 | WHITESPACE@[72; 73) " " | 55 | UNDERSCORE@[71; 72) "_" |
56 | EQ@[73; 74) "=" | 56 | WHITESPACE@[72; 73) " " |
57 | WHITESPACE@[74; 75) " " | 57 | EQ@[73; 74) "=" |
58 | LITERAL@[75; 78) | 58 | WHITESPACE@[74; 75) " " |
59 | FLOAT_NUMBER@[75; 78) "2.0" | 59 | LITERAL@[75; 78) |
60 | SEMI@[78; 79) ";" | 60 | FLOAT_NUMBER@[75; 78) "2.0" |
61 | WHITESPACE@[79; 84) "\n " | 61 | SEMI@[78; 79) ";" |
62 | LET_STMT@[84; 97) | 62 | WHITESPACE@[79; 84) "\n " |
63 | LET_KW@[84; 87) "let" | 63 | LET_STMT@[84; 97) |
64 | WHITESPACE@[87; 88) " " | 64 | LET_KW@[84; 87) "let" |
65 | PLACEHOLDER_PAT@[88; 89) | 65 | WHITESPACE@[87; 88) " " |
66 | UNDERSCORE@[88; 89) "_" | 66 | PLACEHOLDER_PAT@[88; 89) |
67 | WHITESPACE@[89; 90) " " | 67 | UNDERSCORE@[88; 89) "_" |
68 | EQ@[90; 91) "=" | 68 | WHITESPACE@[89; 90) " " |
69 | WHITESPACE@[91; 92) " " | 69 | EQ@[90; 91) "=" |
70 | LITERAL@[92; 96) | 70 | WHITESPACE@[91; 92) " " |
71 | BYTE@[92; 96) "b\'a\'" | 71 | LITERAL@[92; 96) |
72 | SEMI@[96; 97) ";" | 72 | BYTE@[92; 96) "b\'a\'" |
73 | WHITESPACE@[97; 102) "\n " | 73 | SEMI@[96; 97) ";" |
74 | LET_STMT@[102; 114) | 74 | WHITESPACE@[97; 102) "\n " |
75 | LET_KW@[102; 105) "let" | 75 | LET_STMT@[102; 114) |
76 | WHITESPACE@[105; 106) " " | 76 | LET_KW@[102; 105) "let" |
77 | PLACEHOLDER_PAT@[106; 107) | 77 | WHITESPACE@[105; 106) " " |
78 | UNDERSCORE@[106; 107) "_" | 78 | PLACEHOLDER_PAT@[106; 107) |
79 | WHITESPACE@[107; 108) " " | 79 | UNDERSCORE@[106; 107) "_" |
80 | EQ@[108; 109) "=" | 80 | WHITESPACE@[107; 108) " " |
81 | WHITESPACE@[109; 110) " " | 81 | EQ@[108; 109) "=" |
82 | LITERAL@[110; 113) | 82 | WHITESPACE@[109; 110) " " |
83 | CHAR@[110; 113) "\'b\'" | 83 | LITERAL@[110; 113) |
84 | SEMI@[113; 114) ";" | 84 | CHAR@[110; 113) "\'b\'" |
85 | WHITESPACE@[114; 119) "\n " | 85 | SEMI@[113; 114) ";" |
86 | LET_STMT@[119; 131) | 86 | WHITESPACE@[114; 119) "\n " |
87 | LET_KW@[119; 122) "let" | 87 | LET_STMT@[119; 131) |
88 | WHITESPACE@[122; 123) " " | 88 | LET_KW@[119; 122) "let" |
89 | PLACEHOLDER_PAT@[123; 124) | 89 | WHITESPACE@[122; 123) " " |
90 | UNDERSCORE@[123; 124) "_" | 90 | PLACEHOLDER_PAT@[123; 124) |
91 | WHITESPACE@[124; 125) " " | 91 | UNDERSCORE@[123; 124) "_" |
92 | EQ@[125; 126) "=" | 92 | WHITESPACE@[124; 125) " " |
93 | WHITESPACE@[126; 127) " " | 93 | EQ@[125; 126) "=" |
94 | LITERAL@[127; 130) | 94 | WHITESPACE@[126; 127) " " |
95 | STRING@[127; 130) "\"c\"" | 95 | LITERAL@[127; 130) |
96 | SEMI@[130; 131) ";" | 96 | STRING@[127; 130) "\"c\"" |
97 | WHITESPACE@[131; 136) "\n " | 97 | SEMI@[130; 131) ";" |
98 | LET_STMT@[136; 149) | 98 | WHITESPACE@[131; 136) "\n " |
99 | LET_KW@[136; 139) "let" | 99 | LET_STMT@[136; 149) |
100 | WHITESPACE@[139; 140) " " | 100 | LET_KW@[136; 139) "let" |
101 | PLACEHOLDER_PAT@[140; 141) | 101 | WHITESPACE@[139; 140) " " |
102 | UNDERSCORE@[140; 141) "_" | 102 | PLACEHOLDER_PAT@[140; 141) |
103 | WHITESPACE@[141; 142) " " | 103 | UNDERSCORE@[140; 141) "_" |
104 | EQ@[142; 143) "=" | 104 | WHITESPACE@[141; 142) " " |
105 | WHITESPACE@[143; 144) " " | 105 | EQ@[142; 143) "=" |
106 | LITERAL@[144; 148) | 106 | WHITESPACE@[143; 144) " " |
107 | RAW_STRING@[144; 148) "r\"d\"" | 107 | LITERAL@[144; 148) |
108 | SEMI@[148; 149) ";" | 108 | RAW_STRING@[144; 148) "r\"d\"" |
109 | WHITESPACE@[149; 154) "\n " | 109 | SEMI@[148; 149) ";" |
110 | LET_STMT@[154; 167) | 110 | WHITESPACE@[149; 154) "\n " |
111 | LET_KW@[154; 157) "let" | 111 | LET_STMT@[154; 167) |
112 | WHITESPACE@[157; 158) " " | 112 | LET_KW@[154; 157) "let" |
113 | PLACEHOLDER_PAT@[158; 159) | 113 | WHITESPACE@[157; 158) " " |
114 | UNDERSCORE@[158; 159) "_" | 114 | PLACEHOLDER_PAT@[158; 159) |
115 | WHITESPACE@[159; 160) " " | 115 | UNDERSCORE@[158; 159) "_" |
116 | EQ@[160; 161) "=" | 116 | WHITESPACE@[159; 160) " " |
117 | WHITESPACE@[161; 162) " " | 117 | EQ@[160; 161) "=" |
118 | LITERAL@[162; 166) | 118 | WHITESPACE@[161; 162) " " |
119 | BYTE_STRING@[162; 166) "b\"e\"" | 119 | LITERAL@[162; 166) |
120 | SEMI@[166; 167) ";" | 120 | BYTE_STRING@[162; 166) "b\"e\"" |
121 | WHITESPACE@[167; 172) "\n " | 121 | SEMI@[166; 167) ";" |
122 | LET_STMT@[172; 186) | 122 | WHITESPACE@[167; 172) "\n " |
123 | LET_KW@[172; 175) "let" | 123 | LET_STMT@[172; 186) |
124 | WHITESPACE@[175; 176) " " | 124 | LET_KW@[172; 175) "let" |
125 | PLACEHOLDER_PAT@[176; 177) | 125 | WHITESPACE@[175; 176) " " |
126 | UNDERSCORE@[176; 177) "_" | 126 | PLACEHOLDER_PAT@[176; 177) |
127 | WHITESPACE@[177; 178) " " | 127 | UNDERSCORE@[176; 177) "_" |
128 | EQ@[178; 179) "=" | 128 | WHITESPACE@[177; 178) " " |
129 | WHITESPACE@[179; 180) " " | 129 | EQ@[178; 179) "=" |
130 | LITERAL@[180; 185) | 130 | WHITESPACE@[179; 180) " " |
131 | RAW_BYTE_STRING@[180; 185) "br\"f\"" | 131 | LITERAL@[180; 185) |
132 | SEMI@[185; 186) ";" | 132 | RAW_BYTE_STRING@[180; 185) "br\"f\"" |
133 | WHITESPACE@[186; 187) "\n" | 133 | SEMI@[185; 186) ";" |
134 | R_CURLY@[187; 188) "}" | 134 | WHITESPACE@[186; 187) "\n" |
135 | R_CURLY@[187; 188) "}" | ||
135 | WHITESPACE@[188; 189) "\n" | 136 | WHITESPACE@[188; 189) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt index ac793c95c..ca1a97161 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.txt | |||
@@ -8,9 +8,10 @@ SOURCE_FILE@[0; 30) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 11) | 11 | BLOCK_EXPR@[9; 11) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 11) |
13 | R_CURLY@[10; 11) "}" | 13 | L_CURLY@[9; 10) "{" |
14 | R_CURLY@[10; 11) "}" | ||
14 | WHITESPACE@[11; 12) "\n" | 15 | WHITESPACE@[11; 12) "\n" |
15 | FN_DEF@[12; 29) | 16 | FN_DEF@[12; 29) |
16 | FN_KW@[12; 14) "fn" | 17 | FN_KW@[12; 14) "fn" |
@@ -28,7 +29,8 @@ SOURCE_FILE@[0; 30) | |||
28 | L_PAREN@[24; 25) "(" | 29 | L_PAREN@[24; 25) "(" |
29 | R_PAREN@[25; 26) ")" | 30 | R_PAREN@[25; 26) ")" |
30 | WHITESPACE@[26; 27) " " | 31 | WHITESPACE@[26; 27) " " |
31 | BLOCK@[27; 29) | 32 | BLOCK_EXPR@[27; 29) |
32 | L_CURLY@[27; 28) "{" | 33 | BLOCK@[27; 29) |
33 | R_CURLY@[28; 29) "}" | 34 | L_CURLY@[27; 28) "{" |
35 | R_CURLY@[28; 29) "}" | ||
34 | WHITESPACE@[29; 30) "\n" | 36 | WHITESPACE@[29; 30) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt index b93a10c5b..b23f43b46 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.txt | |||
@@ -7,59 +7,63 @@ SOURCE_FILE@[0; 88) | |||
7 | PARAM_LIST@[6; 8) | 7 | PARAM_LIST@[6; 8) |
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | BLOCK@[8; 87) | 10 | BLOCK_EXPR@[8; 87) |
11 | L_CURLY@[8; 9) "{" | 11 | BLOCK@[8; 87) |
12 | WHITESPACE@[9; 14) "\n " | 12 | L_CURLY@[8; 9) "{" |
13 | EXPR_STMT@[14; 25) | 13 | WHITESPACE@[9; 14) "\n " |
14 | IF_EXPR@[14; 25) | 14 | EXPR_STMT@[14; 25) |
15 | IF_KW@[14; 16) "if" | 15 | IF_EXPR@[14; 25) |
16 | WHITESPACE@[16; 17) " " | 16 | IF_KW@[14; 16) "if" |
17 | CONDITION@[17; 22) | 17 | WHITESPACE@[16; 17) " " |
18 | BREAK_EXPR@[17; 22) | 18 | CONDITION@[17; 22) |
19 | BREAK_KW@[17; 22) "break" | 19 | BREAK_EXPR@[17; 22) |
20 | WHITESPACE@[22; 23) " " | 20 | BREAK_KW@[17; 22) "break" |
21 | BLOCK@[23; 25) | 21 | WHITESPACE@[22; 23) " " |
22 | L_CURLY@[23; 24) "{" | 22 | BLOCK_EXPR@[23; 25) |
23 | R_CURLY@[24; 25) "}" | 23 | BLOCK@[23; 25) |
24 | WHITESPACE@[25; 30) "\n " | 24 | L_CURLY@[23; 24) "{" |
25 | EXPR_STMT@[30; 44) | 25 | R_CURLY@[24; 25) "}" |
26 | WHILE_EXPR@[30; 44) | 26 | WHITESPACE@[25; 30) "\n " |
27 | WHILE_KW@[30; 35) "while" | 27 | EXPR_STMT@[30; 44) |
28 | WHITESPACE@[35; 36) " " | 28 | WHILE_EXPR@[30; 44) |
29 | CONDITION@[36; 41) | 29 | WHILE_KW@[30; 35) "while" |
30 | BREAK_EXPR@[36; 41) | 30 | WHITESPACE@[35; 36) " " |
31 | BREAK_KW@[36; 41) "break" | 31 | CONDITION@[36; 41) |
32 | WHITESPACE@[41; 42) " " | 32 | BREAK_EXPR@[36; 41) |
33 | BLOCK@[42; 44) | 33 | BREAK_KW@[36; 41) "break" |
34 | L_CURLY@[42; 43) "{" | 34 | WHITESPACE@[41; 42) " " |
35 | R_CURLY@[43; 44) "}" | 35 | BLOCK_EXPR@[42; 44) |
36 | WHITESPACE@[44; 49) "\n " | 36 | BLOCK@[42; 44) |
37 | EXPR_STMT@[49; 66) | 37 | L_CURLY@[42; 43) "{" |
38 | FOR_EXPR@[49; 66) | 38 | R_CURLY@[43; 44) "}" |
39 | FOR_KW@[49; 52) "for" | 39 | WHITESPACE@[44; 49) "\n " |
40 | WHITESPACE@[52; 53) " " | 40 | EXPR_STMT@[49; 66) |
41 | BIND_PAT@[53; 54) | 41 | FOR_EXPR@[49; 66) |
42 | NAME@[53; 54) | 42 | FOR_KW@[49; 52) "for" |
43 | IDENT@[53; 54) "i" | 43 | WHITESPACE@[52; 53) " " |
44 | WHITESPACE@[54; 55) " " | 44 | BIND_PAT@[53; 54) |
45 | IN_KW@[55; 57) "in" | 45 | NAME@[53; 54) |
46 | WHITESPACE@[57; 58) " " | 46 | IDENT@[53; 54) "i" |
47 | BREAK_EXPR@[58; 63) | 47 | WHITESPACE@[54; 55) " " |
48 | BREAK_KW@[58; 63) "break" | 48 | IN_KW@[55; 57) "in" |
49 | WHITESPACE@[63; 64) " " | 49 | WHITESPACE@[57; 58) " " |
50 | BLOCK@[64; 66) | 50 | BREAK_EXPR@[58; 63) |
51 | L_CURLY@[64; 65) "{" | 51 | BREAK_KW@[58; 63) "break" |
52 | R_CURLY@[65; 66) "}" | 52 | WHITESPACE@[63; 64) " " |
53 | WHITESPACE@[66; 71) "\n " | 53 | BLOCK_EXPR@[64; 66) |
54 | MATCH_EXPR@[71; 85) | 54 | BLOCK@[64; 66) |
55 | MATCH_KW@[71; 76) "match" | 55 | L_CURLY@[64; 65) "{" |
56 | WHITESPACE@[76; 77) " " | 56 | R_CURLY@[65; 66) "}" |
57 | BREAK_EXPR@[77; 82) | 57 | WHITESPACE@[66; 71) "\n " |
58 | BREAK_KW@[77; 82) "break" | 58 | MATCH_EXPR@[71; 85) |
59 | WHITESPACE@[82; 83) " " | 59 | MATCH_KW@[71; 76) "match" |
60 | MATCH_ARM_LIST@[83; 85) | 60 | WHITESPACE@[76; 77) " " |
61 | L_CURLY@[83; 84) "{" | 61 | BREAK_EXPR@[77; 82) |
62 | R_CURLY@[84; 85) "}" | 62 | BREAK_KW@[77; 82) "break" |
63 | WHITESPACE@[85; 86) "\n" | 63 | WHITESPACE@[82; 83) " " |
64 | R_CURLY@[86; 87) "}" | 64 | MATCH_ARM_LIST@[83; 85) |
65 | L_CURLY@[83; 84) "{" | ||
66 | R_CURLY@[84; 85) "}" | ||
67 | WHITESPACE@[85; 86) "\n" | ||
68 | R_CURLY@[86; 87) "}" | ||
65 | WHITESPACE@[87; 88) "\n" | 69 | WHITESPACE@[87; 88) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt index ed5339e64..b494f6c59 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.txt | |||
@@ -11,7 +11,8 @@ SOURCE_FILE@[0; 19) | |||
11 | L_PAREN@[13; 14) "(" | 11 | L_PAREN@[13; 14) "(" |
12 | R_PAREN@[14; 15) ")" | 12 | R_PAREN@[14; 15) ")" |
13 | WHITESPACE@[15; 16) " " | 13 | WHITESPACE@[15; 16) " " |
14 | BLOCK@[16; 18) | 14 | BLOCK_EXPR@[16; 18) |
15 | L_CURLY@[16; 17) "{" | 15 | BLOCK@[16; 18) |
16 | R_CURLY@[17; 18) "}" | 16 | L_CURLY@[16; 17) "{" |
17 | R_CURLY@[17; 18) "}" | ||
17 | WHITESPACE@[18; 19) "\n" | 18 | WHITESPACE@[18; 19) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt index b4a71f925..1a979e597 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.txt | |||
@@ -8,26 +8,27 @@ SOURCE_FILE@[0; 26) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 25) | 11 | BLOCK_EXPR@[9; 25) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 25) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 23) | 14 | WHITESPACE@[10; 15) "\n " |
15 | INDEX_EXPR@[15; 22) | 15 | EXPR_STMT@[15; 23) |
16 | INDEX_EXPR@[15; 19) | 16 | INDEX_EXPR@[15; 22) |
17 | PATH_EXPR@[15; 16) | 17 | INDEX_EXPR@[15; 19) |
18 | PATH@[15; 16) | 18 | PATH_EXPR@[15; 16) |
19 | PATH_SEGMENT@[15; 16) | 19 | PATH@[15; 16) |
20 | NAME_REF@[15; 16) | 20 | PATH_SEGMENT@[15; 16) |
21 | IDENT@[15; 16) "x" | 21 | NAME_REF@[15; 16) |
22 | L_BRACK@[16; 17) "[" | 22 | IDENT@[15; 16) "x" |
23 | LITERAL@[17; 18) | 23 | L_BRACK@[16; 17) "[" |
24 | INT_NUMBER@[17; 18) "1" | 24 | LITERAL@[17; 18) |
25 | R_BRACK@[18; 19) "]" | 25 | INT_NUMBER@[17; 18) "1" |
26 | L_BRACK@[19; 20) "[" | 26 | R_BRACK@[18; 19) "]" |
27 | LITERAL@[20; 21) | 27 | L_BRACK@[19; 20) "[" |
28 | INT_NUMBER@[20; 21) "2" | 28 | LITERAL@[20; 21) |
29 | R_BRACK@[21; 22) "]" | 29 | INT_NUMBER@[20; 21) "2" |
30 | SEMI@[22; 23) ";" | 30 | R_BRACK@[21; 22) "]" |
31 | WHITESPACE@[23; 24) "\n" | 31 | SEMI@[22; 23) ";" |
32 | R_CURLY@[24; 25) "}" | 32 | WHITESPACE@[23; 24) "\n" |
33 | R_CURLY@[24; 25) "}" | ||
33 | WHITESPACE@[25; 26) "\n" | 34 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt index f11bc1fc8..fe86894a9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.txt | |||
@@ -8,21 +8,22 @@ SOURCE_FILE@[0; 26) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 25) | 11 | BLOCK_EXPR@[10; 25) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 25) |
13 | WHITESPACE@[11; 12) " " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[12; 23) | 14 | WHITESPACE@[11; 12) " " |
15 | LET_KW@[12; 15) "let" | 15 | LET_STMT@[12; 23) |
16 | WHITESPACE@[15; 16) " " | 16 | LET_KW@[12; 15) "let" |
17 | PLACEHOLDER_PAT@[16; 17) | 17 | WHITESPACE@[15; 16) " " |
18 | UNDERSCORE@[16; 17) "_" | 18 | PLACEHOLDER_PAT@[16; 17) |
19 | WHITESPACE@[17; 18) " " | 19 | UNDERSCORE@[16; 17) "_" |
20 | EQ@[18; 19) "=" | 20 | WHITESPACE@[17; 18) " " |
21 | WHITESPACE@[19; 20) " " | 21 | EQ@[18; 19) "=" |
22 | TUPLE_EXPR@[20; 22) | 22 | WHITESPACE@[19; 20) " " |
23 | L_PAREN@[20; 21) "(" | 23 | TUPLE_EXPR@[20; 22) |
24 | R_PAREN@[21; 22) ")" | 24 | L_PAREN@[20; 21) "(" |
25 | SEMI@[22; 23) ";" | 25 | R_PAREN@[21; 22) ")" |
26 | WHITESPACE@[23; 24) " " | 26 | SEMI@[22; 23) ";" |
27 | R_CURLY@[24; 25) "}" | 27 | WHITESPACE@[23; 24) " " |
28 | R_CURLY@[24; 25) "}" | ||
28 | WHITESPACE@[25; 26) "\n" | 29 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt index 6d24f214e..157aa29f5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.txt | |||
@@ -8,118 +8,123 @@ SOURCE_FILE@[0; 167) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 166) | 11 | BLOCK_EXPR@[9; 166) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 166) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 25) | 14 | WHITESPACE@[10; 15) "\n " |
15 | IF_EXPR@[15; 25) | 15 | EXPR_STMT@[15; 25) |
16 | IF_KW@[15; 17) "if" | 16 | IF_EXPR@[15; 25) |
17 | WHITESPACE@[17; 18) " " | 17 | IF_KW@[15; 17) "if" |
18 | CONDITION@[18; 22) | 18 | WHITESPACE@[17; 18) " " |
19 | LITERAL@[18; 22) | 19 | CONDITION@[18; 22) |
20 | TRUE_KW@[18; 22) "true" | 20 | LITERAL@[18; 22) |
21 | WHITESPACE@[22; 23) " " | 21 | TRUE_KW@[18; 22) "true" |
22 | BLOCK@[23; 25) | 22 | WHITESPACE@[22; 23) " " |
23 | L_CURLY@[23; 24) "{" | 23 | BLOCK_EXPR@[23; 25) |
24 | R_CURLY@[24; 25) "}" | 24 | BLOCK@[23; 25) |
25 | WHITESPACE@[25; 30) "\n " | 25 | L_CURLY@[23; 24) "{" |
26 | EXPR_STMT@[30; 37) | 26 | R_CURLY@[24; 25) "}" |
27 | LOOP_EXPR@[30; 37) | 27 | WHITESPACE@[25; 30) "\n " |
28 | LOOP_KW@[30; 34) "loop" | 28 | EXPR_STMT@[30; 37) |
29 | WHITESPACE@[34; 35) " " | 29 | LOOP_EXPR@[30; 37) |
30 | BLOCK@[35; 37) | 30 | LOOP_KW@[30; 34) "loop" |
31 | L_CURLY@[35; 36) "{" | 31 | WHITESPACE@[34; 35) " " |
32 | R_CURLY@[36; 37) "}" | 32 | BLOCK_EXPR@[35; 37) |
33 | WHITESPACE@[37; 42) "\n " | 33 | BLOCK@[35; 37) |
34 | EXPR_STMT@[42; 53) | 34 | L_CURLY@[35; 36) "{" |
35 | MATCH_EXPR@[42; 53) | 35 | R_CURLY@[36; 37) "}" |
36 | MATCH_KW@[42; 47) "match" | 36 | WHITESPACE@[37; 42) "\n " |
37 | WHITESPACE@[47; 48) " " | 37 | EXPR_STMT@[42; 53) |
38 | TUPLE_EXPR@[48; 50) | 38 | MATCH_EXPR@[42; 53) |
39 | L_PAREN@[48; 49) "(" | 39 | MATCH_KW@[42; 47) "match" |
40 | R_PAREN@[49; 50) ")" | 40 | WHITESPACE@[47; 48) " " |
41 | WHITESPACE@[50; 51) " " | 41 | TUPLE_EXPR@[48; 50) |
42 | MATCH_ARM_LIST@[51; 53) | 42 | L_PAREN@[48; 49) "(" |
43 | L_CURLY@[51; 52) "{" | 43 | R_PAREN@[49; 50) ")" |
44 | R_CURLY@[52; 53) "}" | 44 | WHITESPACE@[50; 51) " " |
45 | WHITESPACE@[53; 58) "\n " | 45 | MATCH_ARM_LIST@[51; 53) |
46 | EXPR_STMT@[58; 71) | 46 | L_CURLY@[51; 52) "{" |
47 | WHILE_EXPR@[58; 71) | 47 | R_CURLY@[52; 53) "}" |
48 | WHILE_KW@[58; 63) "while" | 48 | WHITESPACE@[53; 58) "\n " |
49 | WHITESPACE@[63; 64) " " | 49 | EXPR_STMT@[58; 71) |
50 | CONDITION@[64; 68) | 50 | WHILE_EXPR@[58; 71) |
51 | LITERAL@[64; 68) | 51 | WHILE_KW@[58; 63) "while" |
52 | TRUE_KW@[64; 68) "true" | 52 | WHITESPACE@[63; 64) " " |
53 | WHITESPACE@[68; 69) " " | 53 | CONDITION@[64; 68) |
54 | BLOCK@[69; 71) | 54 | LITERAL@[64; 68) |
55 | L_CURLY@[69; 70) "{" | 55 | TRUE_KW@[64; 68) "true" |
56 | R_CURLY@[70; 71) "}" | 56 | WHITESPACE@[68; 69) " " |
57 | WHITESPACE@[71; 76) "\n " | 57 | BLOCK_EXPR@[69; 71) |
58 | EXPR_STMT@[76; 90) | 58 | BLOCK@[69; 71) |
59 | FOR_EXPR@[76; 90) | 59 | L_CURLY@[69; 70) "{" |
60 | FOR_KW@[76; 79) "for" | 60 | R_CURLY@[70; 71) "}" |
61 | WHITESPACE@[79; 80) " " | 61 | WHITESPACE@[71; 76) "\n " |
62 | PLACEHOLDER_PAT@[80; 81) | 62 | EXPR_STMT@[76; 90) |
63 | UNDERSCORE@[80; 81) "_" | 63 | FOR_EXPR@[76; 90) |
64 | WHITESPACE@[81; 82) " " | 64 | FOR_KW@[76; 79) "for" |
65 | IN_KW@[82; 84) "in" | 65 | WHITESPACE@[79; 80) " " |
66 | WHITESPACE@[84; 85) " " | 66 | PLACEHOLDER_PAT@[80; 81) |
67 | TUPLE_EXPR@[85; 87) | 67 | UNDERSCORE@[80; 81) "_" |
68 | L_PAREN@[85; 86) "(" | 68 | WHITESPACE@[81; 82) " " |
69 | R_PAREN@[86; 87) ")" | 69 | IN_KW@[82; 84) "in" |
70 | WHITESPACE@[87; 88) " " | 70 | WHITESPACE@[84; 85) " " |
71 | BLOCK@[88; 90) | 71 | TUPLE_EXPR@[85; 87) |
72 | L_CURLY@[88; 89) "{" | 72 | L_PAREN@[85; 86) "(" |
73 | R_CURLY@[89; 90) "}" | 73 | R_PAREN@[86; 87) ")" |
74 | WHITESPACE@[90; 95) "\n " | 74 | WHITESPACE@[87; 88) " " |
75 | EXPR_STMT@[95; 97) | 75 | BLOCK_EXPR@[88; 90) |
76 | BLOCK_EXPR@[95; 97) | 76 | BLOCK@[88; 90) |
77 | BLOCK@[95; 97) | 77 | L_CURLY@[88; 89) "{" |
78 | L_CURLY@[95; 96) "{" | 78 | R_CURLY@[89; 90) "}" |
79 | R_CURLY@[96; 97) "}" | 79 | WHITESPACE@[90; 95) "\n " |
80 | WHITESPACE@[97; 102) "\n " | 80 | EXPR_STMT@[95; 97) |
81 | EXPR_STMT@[102; 104) | 81 | BLOCK_EXPR@[95; 97) |
82 | BLOCK_EXPR@[102; 104) | 82 | BLOCK@[95; 97) |
83 | BLOCK@[102; 104) | 83 | L_CURLY@[95; 96) "{" |
84 | L_CURLY@[102; 103) "{" | 84 | R_CURLY@[96; 97) "}" |
85 | R_CURLY@[103; 104) "}" | 85 | WHITESPACE@[97; 102) "\n " |
86 | WHITESPACE@[104; 109) "\n " | 86 | EXPR_STMT@[102; 104) |
87 | EXPR_STMT@[109; 152) | 87 | BLOCK_EXPR@[102; 104) |
88 | MACRO_CALL@[109; 152) | 88 | BLOCK@[102; 104) |
89 | PATH@[109; 120) | 89 | L_CURLY@[102; 103) "{" |
90 | PATH_SEGMENT@[109; 120) | 90 | R_CURLY@[103; 104) "}" |
91 | NAME_REF@[109; 120) | 91 | WHITESPACE@[104; 109) "\n " |
92 | IDENT@[109; 120) "macro_rules" | 92 | EXPR_STMT@[109; 152) |
93 | EXCL@[120; 121) "!" | 93 | MACRO_CALL@[109; 152) |
94 | WHITESPACE@[121; 122) " " | 94 | PATH@[109; 120) |
95 | NAME@[122; 126) | 95 | PATH_SEGMENT@[109; 120) |
96 | IDENT@[122; 126) "test" | 96 | NAME_REF@[109; 120) |
97 | WHITESPACE@[126; 127) " " | 97 | IDENT@[109; 120) "macro_rules" |
98 | TOKEN_TREE@[127; 152) | 98 | EXCL@[120; 121) "!" |
99 | L_CURLY@[127; 128) "{" | 99 | WHITESPACE@[121; 122) " " |
100 | WHITESPACE@[128; 138) "\n " | 100 | NAME@[122; 126) |
101 | TOKEN_TREE@[138; 140) | 101 | IDENT@[122; 126) "test" |
102 | L_PAREN@[138; 139) "(" | 102 | WHITESPACE@[126; 127) " " |
103 | R_PAREN@[139; 140) ")" | 103 | TOKEN_TREE@[127; 152) |
104 | WHITESPACE@[140; 141) " " | 104 | L_CURLY@[127; 128) "{" |
105 | EQ@[141; 142) "=" | 105 | WHITESPACE@[128; 138) "\n " |
106 | R_ANGLE@[142; 143) ">" | 106 | TOKEN_TREE@[138; 140) |
107 | WHITESPACE@[143; 144) " " | 107 | L_PAREN@[138; 139) "(" |
108 | TOKEN_TREE@[144; 146) | 108 | R_PAREN@[139; 140) ")" |
109 | L_CURLY@[144; 145) "{" | 109 | WHITESPACE@[140; 141) " " |
110 | R_CURLY@[145; 146) "}" | 110 | EQ@[141; 142) "=" |
111 | WHITESPACE@[146; 151) "\n " | 111 | R_ANGLE@[142; 143) ">" |
112 | R_CURLY@[151; 152) "}" | 112 | WHITESPACE@[143; 144) " " |
113 | WHITESPACE@[152; 157) "\n " | 113 | TOKEN_TREE@[144; 146) |
114 | MACRO_CALL@[157; 164) | 114 | L_CURLY@[144; 145) "{" |
115 | PATH@[157; 161) | 115 | R_CURLY@[145; 146) "}" |
116 | PATH_SEGMENT@[157; 161) | 116 | WHITESPACE@[146; 151) "\n " |
117 | NAME_REF@[157; 161) | 117 | R_CURLY@[151; 152) "}" |
118 | IDENT@[157; 161) "test" | 118 | WHITESPACE@[152; 157) "\n " |
119 | EXCL@[161; 162) "!" | 119 | MACRO_CALL@[157; 164) |
120 | TOKEN_TREE@[162; 164) | 120 | PATH@[157; 161) |
121 | L_CURLY@[162; 163) "{" | 121 | PATH_SEGMENT@[157; 161) |
122 | R_CURLY@[163; 164) "}" | 122 | NAME_REF@[157; 161) |
123 | WHITESPACE@[164; 165) "\n" | 123 | IDENT@[157; 161) "test" |
124 | R_CURLY@[165; 166) "}" | 124 | EXCL@[161; 162) "!" |
125 | TOKEN_TREE@[162; 164) | ||
126 | L_CURLY@[162; 163) "{" | ||
127 | R_CURLY@[163; 164) "}" | ||
128 | WHITESPACE@[164; 165) "\n" | ||
129 | R_CURLY@[165; 166) "}" | ||
125 | WHITESPACE@[166; 167) "\n" | 130 | WHITESPACE@[166; 167) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt index 0dd42ab8e..072dc9d16 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.txt | |||
@@ -12,7 +12,8 @@ SOURCE_FILE@[0; 25) | |||
12 | L_PAREN@[19; 20) "(" | 12 | L_PAREN@[19; 20) "(" |
13 | R_PAREN@[20; 21) ")" | 13 | R_PAREN@[20; 21) ")" |
14 | WHITESPACE@[21; 22) " " | 14 | WHITESPACE@[21; 22) " " |
15 | BLOCK@[22; 24) | 15 | BLOCK_EXPR@[22; 24) |
16 | L_CURLY@[22; 23) "{" | 16 | BLOCK@[22; 24) |
17 | R_CURLY@[23; 24) "}" | 17 | L_CURLY@[22; 23) "{" |
18 | R_CURLY@[23; 24) "}" | ||
18 | WHITESPACE@[24; 25) "\n" | 19 | WHITESPACE@[24; 25) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt index 80d636819..ed57a9eea 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.txt | |||
@@ -8,9 +8,10 @@ SOURCE_FILE@[0; 67) | |||
8 | L_PAREN@[4; 5) "(" | 8 | L_PAREN@[4; 5) "(" |
9 | R_PAREN@[5; 6) ")" | 9 | R_PAREN@[5; 6) ")" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | BLOCK@[7; 9) | 11 | BLOCK_EXPR@[7; 9) |
12 | L_CURLY@[7; 8) "{" | 12 | BLOCK@[7; 9) |
13 | R_CURLY@[8; 9) "}" | 13 | L_CURLY@[7; 8) "{" |
14 | R_CURLY@[8; 9) "}" | ||
14 | WHITESPACE@[9; 10) "\n" | 15 | WHITESPACE@[9; 10) "\n" |
15 | FN_DEF@[10; 25) | 16 | FN_DEF@[10; 25) |
16 | FN_KW@[10; 12) "fn" | 17 | FN_KW@[10; 12) "fn" |
@@ -32,9 +33,10 @@ SOURCE_FILE@[0; 67) | |||
32 | IDENT@[18; 21) "i32" | 33 | IDENT@[18; 21) "i32" |
33 | R_PAREN@[21; 22) ")" | 34 | R_PAREN@[21; 22) ")" |
34 | WHITESPACE@[22; 23) " " | 35 | WHITESPACE@[22; 23) " " |
35 | BLOCK@[23; 25) | 36 | BLOCK_EXPR@[23; 25) |
36 | L_CURLY@[23; 24) "{" | 37 | BLOCK@[23; 25) |
37 | R_CURLY@[24; 25) "}" | 38 | L_CURLY@[23; 24) "{" |
39 | R_CURLY@[24; 25) "}" | ||
38 | WHITESPACE@[25; 26) "\n" | 40 | WHITESPACE@[25; 26) "\n" |
39 | FN_DEF@[26; 43) | 41 | FN_DEF@[26; 43) |
40 | FN_KW@[26; 28) "fn" | 42 | FN_KW@[26; 28) "fn" |
@@ -58,9 +60,10 @@ SOURCE_FILE@[0; 67) | |||
58 | WHITESPACE@[38; 39) " " | 60 | WHITESPACE@[38; 39) " " |
59 | R_PAREN@[39; 40) ")" | 61 | R_PAREN@[39; 40) ")" |
60 | WHITESPACE@[40; 41) " " | 62 | WHITESPACE@[40; 41) " " |
61 | BLOCK@[41; 43) | 63 | BLOCK_EXPR@[41; 43) |
62 | L_CURLY@[41; 42) "{" | 64 | BLOCK@[41; 43) |
63 | R_CURLY@[42; 43) "}" | 65 | L_CURLY@[41; 42) "{" |
66 | R_CURLY@[42; 43) "}" | ||
64 | WHITESPACE@[43; 44) "\n" | 67 | WHITESPACE@[43; 44) "\n" |
65 | FN_DEF@[44; 66) | 68 | FN_DEF@[44; 66) |
66 | FN_KW@[44; 46) "fn" | 69 | FN_KW@[44; 46) "fn" |
@@ -93,7 +96,8 @@ SOURCE_FILE@[0; 67) | |||
93 | R_PAREN@[61; 62) ")" | 96 | R_PAREN@[61; 62) ")" |
94 | R_PAREN@[62; 63) ")" | 97 | R_PAREN@[62; 63) ")" |
95 | WHITESPACE@[63; 64) " " | 98 | WHITESPACE@[63; 64) " " |
96 | BLOCK@[64; 66) | 99 | BLOCK_EXPR@[64; 66) |
97 | L_CURLY@[64; 65) "{" | 100 | BLOCK@[64; 66) |
98 | R_CURLY@[65; 66) "}" | 101 | L_CURLY@[64; 65) "{" |
102 | R_CURLY@[65; 66) "}" | ||
99 | WHITESPACE@[66; 67) "\n" | 103 | WHITESPACE@[66; 67) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt index 09e108570..83c58d25f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.txt | |||
@@ -8,27 +8,29 @@ SOURCE_FILE@[0; 33) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 32) | 11 | BLOCK_EXPR@[9; 32) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 32) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 30) | 14 | WHITESPACE@[10; 15) "\n " |
15 | FOR_EXPR@[15; 29) | 15 | EXPR_STMT@[15; 30) |
16 | FOR_KW@[15; 18) "for" | 16 | FOR_EXPR@[15; 29) |
17 | WHITESPACE@[18; 19) " " | 17 | FOR_KW@[15; 18) "for" |
18 | BIND_PAT@[19; 20) | 18 | WHITESPACE@[18; 19) " " |
19 | NAME@[19; 20) | 19 | BIND_PAT@[19; 20) |
20 | IDENT@[19; 20) "x" | 20 | NAME@[19; 20) |
21 | WHITESPACE@[20; 21) " " | 21 | IDENT@[19; 20) "x" |
22 | IN_KW@[21; 23) "in" | 22 | WHITESPACE@[20; 21) " " |
23 | WHITESPACE@[23; 24) " " | 23 | IN_KW@[21; 23) "in" |
24 | ARRAY_EXPR@[24; 26) | 24 | WHITESPACE@[23; 24) " " |
25 | L_BRACK@[24; 25) "[" | 25 | ARRAY_EXPR@[24; 26) |
26 | R_BRACK@[25; 26) "]" | 26 | L_BRACK@[24; 25) "[" |
27 | WHITESPACE@[26; 27) " " | 27 | R_BRACK@[25; 26) "]" |
28 | BLOCK@[27; 29) | 28 | WHITESPACE@[26; 27) " " |
29 | L_CURLY@[27; 28) "{" | 29 | BLOCK_EXPR@[27; 29) |
30 | R_CURLY@[28; 29) "}" | 30 | BLOCK@[27; 29) |
31 | SEMI@[29; 30) ";" | 31 | L_CURLY@[27; 28) "{" |
32 | WHITESPACE@[30; 31) "\n" | 32 | R_CURLY@[28; 29) "}" |
33 | R_CURLY@[31; 32) "}" | 33 | SEMI@[29; 30) ";" |
34 | WHITESPACE@[30; 31) "\n" | ||
35 | R_CURLY@[31; 32) "}" | ||
34 | WHITESPACE@[32; 33) "\n" | 36 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt index 1a60f6ffe..b7979fbf5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.txt | |||
@@ -10,7 +10,8 @@ SOURCE_FILE@[0; 19) | |||
10 | L_PAREN@[13; 14) "(" | 10 | L_PAREN@[13; 14) "(" |
11 | R_PAREN@[14; 15) ")" | 11 | R_PAREN@[14; 15) ")" |
12 | WHITESPACE@[15; 16) " " | 12 | WHITESPACE@[15; 16) " " |
13 | BLOCK@[16; 18) | 13 | BLOCK_EXPR@[16; 18) |
14 | L_CURLY@[16; 17) "{" | 14 | BLOCK@[16; 18) |
15 | R_CURLY@[17; 18) "}" | 15 | L_CURLY@[16; 17) "{" |
16 | R_CURLY@[17; 18) "}" | ||
16 | WHITESPACE@[18; 19) "\n" | 17 | WHITESPACE@[18; 19) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.txt b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.txt index 22db72c12..d8e04bd90 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.txt | |||
@@ -8,123 +8,124 @@ SOURCE_FILE@[0; 119) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 118) | 11 | BLOCK_EXPR@[9; 118) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 118) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 29) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 29) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | RECORD_PAT@[19; 23) | 17 | WHITESPACE@[18; 19) " " |
18 | PATH@[19; 20) | 18 | RECORD_PAT@[19; 23) |
19 | PATH_SEGMENT@[19; 20) | 19 | PATH@[19; 20) |
20 | NAME_REF@[19; 20) | 20 | PATH_SEGMENT@[19; 20) |
21 | IDENT@[19; 20) "S" | 21 | NAME_REF@[19; 20) |
22 | WHITESPACE@[20; 21) " " | 22 | IDENT@[19; 20) "S" |
23 | RECORD_FIELD_PAT_LIST@[21; 23) | 23 | WHITESPACE@[20; 21) " " |
24 | L_CURLY@[21; 22) "{" | 24 | RECORD_FIELD_PAT_LIST@[21; 23) |
25 | R_CURLY@[22; 23) "}" | 25 | L_CURLY@[21; 22) "{" |
26 | WHITESPACE@[23; 24) " " | 26 | R_CURLY@[22; 23) "}" |
27 | EQ@[24; 25) "=" | 27 | WHITESPACE@[23; 24) " " |
28 | WHITESPACE@[25; 26) " " | 28 | EQ@[24; 25) "=" |
29 | TUPLE_EXPR@[26; 28) | 29 | WHITESPACE@[25; 26) " " |
30 | L_PAREN@[26; 27) "(" | 30 | TUPLE_EXPR@[26; 28) |
31 | R_PAREN@[27; 28) ")" | 31 | L_PAREN@[26; 27) "(" |
32 | SEMI@[28; 29) ";" | 32 | R_PAREN@[27; 28) ")" |
33 | WHITESPACE@[29; 34) "\n " | 33 | SEMI@[28; 29) ";" |
34 | LET_STMT@[34; 62) | 34 | WHITESPACE@[29; 34) "\n " |
35 | LET_KW@[34; 37) "let" | 35 | LET_STMT@[34; 62) |
36 | WHITESPACE@[37; 38) " " | 36 | LET_KW@[34; 37) "let" |
37 | RECORD_PAT@[38; 56) | 37 | WHITESPACE@[37; 38) " " |
38 | PATH@[38; 39) | 38 | RECORD_PAT@[38; 56) |
39 | PATH_SEGMENT@[38; 39) | 39 | PATH@[38; 39) |
40 | NAME_REF@[38; 39) | 40 | PATH_SEGMENT@[38; 39) |
41 | IDENT@[38; 39) "S" | 41 | NAME_REF@[38; 39) |
42 | WHITESPACE@[39; 40) " " | 42 | IDENT@[38; 39) "S" |
43 | RECORD_FIELD_PAT_LIST@[40; 56) | 43 | WHITESPACE@[39; 40) " " |
44 | L_CURLY@[40; 41) "{" | 44 | RECORD_FIELD_PAT_LIST@[40; 56) |
45 | WHITESPACE@[41; 42) " " | 45 | L_CURLY@[40; 41) "{" |
46 | BIND_PAT@[42; 43) | 46 | WHITESPACE@[41; 42) " " |
47 | NAME@[42; 43) | 47 | BIND_PAT@[42; 43) |
48 | IDENT@[42; 43) "f" | 48 | NAME@[42; 43) |
49 | COMMA@[43; 44) "," | 49 | IDENT@[42; 43) "f" |
50 | WHITESPACE@[44; 45) " " | 50 | COMMA@[43; 44) "," |
51 | BIND_PAT@[45; 54) | 51 | WHITESPACE@[44; 45) " " |
52 | REF_KW@[45; 48) "ref" | 52 | BIND_PAT@[45; 54) |
53 | WHITESPACE@[48; 49) " " | 53 | REF_KW@[45; 48) "ref" |
54 | MUT_KW@[49; 52) "mut" | 54 | WHITESPACE@[48; 49) " " |
55 | WHITESPACE@[52; 53) " " | 55 | MUT_KW@[49; 52) "mut" |
56 | NAME@[53; 54) | 56 | WHITESPACE@[52; 53) " " |
57 | IDENT@[53; 54) "g" | 57 | NAME@[53; 54) |
58 | WHITESPACE@[54; 55) " " | 58 | IDENT@[53; 54) "g" |
59 | R_CURLY@[55; 56) "}" | 59 | WHITESPACE@[54; 55) " " |
60 | WHITESPACE@[56; 57) " " | 60 | R_CURLY@[55; 56) "}" |
61 | EQ@[57; 58) "=" | 61 | WHITESPACE@[56; 57) " " |
62 | WHITESPACE@[58; 59) " " | 62 | EQ@[57; 58) "=" |
63 | TUPLE_EXPR@[59; 61) | 63 | WHITESPACE@[58; 59) " " |
64 | L_PAREN@[59; 60) "(" | 64 | TUPLE_EXPR@[59; 61) |
65 | R_PAREN@[60; 61) ")" | 65 | L_PAREN@[59; 60) "(" |
66 | SEMI@[61; 62) ";" | 66 | R_PAREN@[60; 61) ")" |
67 | WHITESPACE@[62; 67) "\n " | 67 | SEMI@[61; 62) ";" |
68 | LET_STMT@[67; 90) | 68 | WHITESPACE@[62; 67) "\n " |
69 | LET_KW@[67; 70) "let" | 69 | LET_STMT@[67; 90) |
70 | WHITESPACE@[70; 71) " " | 70 | LET_KW@[67; 70) "let" |
71 | RECORD_PAT@[71; 84) | 71 | WHITESPACE@[70; 71) " " |
72 | PATH@[71; 72) | 72 | RECORD_PAT@[71; 84) |
73 | PATH_SEGMENT@[71; 72) | 73 | PATH@[71; 72) |
74 | NAME_REF@[71; 72) | 74 | PATH_SEGMENT@[71; 72) |
75 | IDENT@[71; 72) "S" | 75 | NAME_REF@[71; 72) |
76 | WHITESPACE@[72; 73) " " | 76 | IDENT@[71; 72) "S" |
77 | RECORD_FIELD_PAT_LIST@[73; 84) | 77 | WHITESPACE@[72; 73) " " |
78 | L_CURLY@[73; 74) "{" | 78 | RECORD_FIELD_PAT_LIST@[73; 84) |
79 | WHITESPACE@[74; 75) " " | 79 | L_CURLY@[73; 74) "{" |
80 | RECORD_FIELD_PAT@[75; 79) | 80 | WHITESPACE@[74; 75) " " |
81 | NAME@[75; 76) | 81 | RECORD_FIELD_PAT@[75; 79) |
82 | IDENT@[75; 76) "h" | 82 | NAME@[75; 76) |
83 | COLON@[76; 77) ":" | 83 | IDENT@[75; 76) "h" |
84 | WHITESPACE@[77; 78) " " | 84 | COLON@[76; 77) ":" |
85 | PLACEHOLDER_PAT@[78; 79) | 85 | WHITESPACE@[77; 78) " " |
86 | UNDERSCORE@[78; 79) "_" | 86 | PLACEHOLDER_PAT@[78; 79) |
87 | COMMA@[79; 80) "," | 87 | UNDERSCORE@[78; 79) "_" |
88 | WHITESPACE@[80; 81) " " | 88 | COMMA@[79; 80) "," |
89 | DOTDOT@[81; 83) ".." | 89 | WHITESPACE@[80; 81) " " |
90 | R_CURLY@[83; 84) "}" | 90 | DOTDOT@[81; 83) ".." |
91 | WHITESPACE@[84; 85) " " | 91 | R_CURLY@[83; 84) "}" |
92 | EQ@[85; 86) "=" | 92 | WHITESPACE@[84; 85) " " |
93 | WHITESPACE@[86; 87) " " | 93 | EQ@[85; 86) "=" |
94 | TUPLE_EXPR@[87; 89) | 94 | WHITESPACE@[86; 87) " " |
95 | L_PAREN@[87; 88) "(" | 95 | TUPLE_EXPR@[87; 89) |
96 | R_PAREN@[88; 89) ")" | 96 | L_PAREN@[87; 88) "(" |
97 | SEMI@[89; 90) ";" | 97 | R_PAREN@[88; 89) ")" |
98 | WHITESPACE@[90; 95) "\n " | 98 | SEMI@[89; 90) ";" |
99 | LET_STMT@[95; 116) | 99 | WHITESPACE@[90; 95) "\n " |
100 | LET_KW@[95; 98) "let" | 100 | LET_STMT@[95; 116) |
101 | WHITESPACE@[98; 99) " " | 101 | LET_KW@[95; 98) "let" |
102 | RECORD_PAT@[99; 110) | 102 | WHITESPACE@[98; 99) " " |
103 | PATH@[99; 100) | 103 | RECORD_PAT@[99; 110) |
104 | PATH_SEGMENT@[99; 100) | 104 | PATH@[99; 100) |
105 | NAME_REF@[99; 100) | 105 | PATH_SEGMENT@[99; 100) |
106 | IDENT@[99; 100) "S" | 106 | NAME_REF@[99; 100) |
107 | WHITESPACE@[100; 101) " " | 107 | IDENT@[99; 100) "S" |
108 | RECORD_FIELD_PAT_LIST@[101; 110) | 108 | WHITESPACE@[100; 101) " " |
109 | L_CURLY@[101; 102) "{" | 109 | RECORD_FIELD_PAT_LIST@[101; 110) |
110 | WHITESPACE@[102; 103) " " | 110 | L_CURLY@[101; 102) "{" |
111 | RECORD_FIELD_PAT@[103; 107) | 111 | WHITESPACE@[102; 103) " " |
112 | NAME@[103; 104) | 112 | RECORD_FIELD_PAT@[103; 107) |
113 | IDENT@[103; 104) "h" | 113 | NAME@[103; 104) |
114 | COLON@[104; 105) ":" | 114 | IDENT@[103; 104) "h" |
115 | WHITESPACE@[105; 106) " " | 115 | COLON@[104; 105) ":" |
116 | PLACEHOLDER_PAT@[106; 107) | 116 | WHITESPACE@[105; 106) " " |
117 | UNDERSCORE@[106; 107) "_" | 117 | PLACEHOLDER_PAT@[106; 107) |
118 | COMMA@[107; 108) "," | 118 | UNDERSCORE@[106; 107) "_" |
119 | WHITESPACE@[108; 109) " " | 119 | COMMA@[107; 108) "," |
120 | R_CURLY@[109; 110) "}" | 120 | WHITESPACE@[108; 109) " " |
121 | WHITESPACE@[110; 111) " " | 121 | R_CURLY@[109; 110) "}" |
122 | EQ@[111; 112) "=" | 122 | WHITESPACE@[110; 111) " " |
123 | WHITESPACE@[112; 113) " " | 123 | EQ@[111; 112) "=" |
124 | TUPLE_EXPR@[113; 115) | 124 | WHITESPACE@[112; 113) " " |
125 | L_PAREN@[113; 114) "(" | 125 | TUPLE_EXPR@[113; 115) |
126 | R_PAREN@[114; 115) ")" | 126 | L_PAREN@[113; 114) "(" |
127 | SEMI@[115; 116) ";" | 127 | R_PAREN@[114; 115) ")" |
128 | WHITESPACE@[116; 117) "\n" | 128 | SEMI@[115; 116) ";" |
129 | R_CURLY@[117; 118) "}" | 129 | WHITESPACE@[116; 117) "\n" |
130 | R_CURLY@[117; 118) "}" | ||
130 | WHITESPACE@[118; 119) "\n" | 131 | WHITESPACE@[118; 119) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt index e74e231b3..0db62a1f5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.txt | |||
@@ -8,47 +8,48 @@ SOURCE_FILE@[0; 55) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 54) | 11 | BLOCK_EXPR@[9; 54) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 54) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 18) | 14 | WHITESPACE@[10; 15) "\n " |
15 | ARRAY_EXPR@[15; 17) | 15 | EXPR_STMT@[15; 18) |
16 | L_BRACK@[15; 16) "[" | 16 | ARRAY_EXPR@[15; 17) |
17 | R_BRACK@[16; 17) "]" | 17 | L_BRACK@[15; 16) "[" |
18 | SEMI@[17; 18) ";" | 18 | R_BRACK@[16; 17) "]" |
19 | WHITESPACE@[18; 23) "\n " | 19 | SEMI@[17; 18) ";" |
20 | EXPR_STMT@[23; 27) | 20 | WHITESPACE@[18; 23) "\n " |
21 | ARRAY_EXPR@[23; 26) | 21 | EXPR_STMT@[23; 27) |
22 | L_BRACK@[23; 24) "[" | 22 | ARRAY_EXPR@[23; 26) |
23 | LITERAL@[24; 25) | 23 | L_BRACK@[23; 24) "[" |
24 | INT_NUMBER@[24; 25) "1" | 24 | LITERAL@[24; 25) |
25 | R_BRACK@[25; 26) "]" | 25 | INT_NUMBER@[24; 25) "1" |
26 | SEMI@[26; 27) ";" | 26 | R_BRACK@[25; 26) "]" |
27 | WHITESPACE@[27; 32) "\n " | 27 | SEMI@[26; 27) ";" |
28 | EXPR_STMT@[32; 40) | 28 | WHITESPACE@[27; 32) "\n " |
29 | ARRAY_EXPR@[32; 39) | 29 | EXPR_STMT@[32; 40) |
30 | L_BRACK@[32; 33) "[" | 30 | ARRAY_EXPR@[32; 39) |
31 | LITERAL@[33; 34) | 31 | L_BRACK@[32; 33) "[" |
32 | INT_NUMBER@[33; 34) "1" | 32 | LITERAL@[33; 34) |
33 | COMMA@[34; 35) "," | 33 | INT_NUMBER@[33; 34) "1" |
34 | WHITESPACE@[35; 36) " " | 34 | COMMA@[34; 35) "," |
35 | LITERAL@[36; 37) | 35 | WHITESPACE@[35; 36) " " |
36 | INT_NUMBER@[36; 37) "2" | 36 | LITERAL@[36; 37) |
37 | COMMA@[37; 38) "," | 37 | INT_NUMBER@[36; 37) "2" |
38 | R_BRACK@[38; 39) "]" | 38 | COMMA@[37; 38) "," |
39 | SEMI@[39; 40) ";" | 39 | R_BRACK@[38; 39) "]" |
40 | WHITESPACE@[40; 45) "\n " | 40 | SEMI@[39; 40) ";" |
41 | EXPR_STMT@[45; 52) | 41 | WHITESPACE@[40; 45) "\n " |
42 | ARRAY_EXPR@[45; 51) | 42 | EXPR_STMT@[45; 52) |
43 | L_BRACK@[45; 46) "[" | 43 | ARRAY_EXPR@[45; 51) |
44 | LITERAL@[46; 47) | 44 | L_BRACK@[45; 46) "[" |
45 | INT_NUMBER@[46; 47) "1" | 45 | LITERAL@[46; 47) |
46 | SEMI@[47; 48) ";" | 46 | INT_NUMBER@[46; 47) "1" |
47 | WHITESPACE@[48; 49) " " | 47 | SEMI@[47; 48) ";" |
48 | LITERAL@[49; 50) | 48 | WHITESPACE@[48; 49) " " |
49 | INT_NUMBER@[49; 50) "2" | 49 | LITERAL@[49; 50) |
50 | R_BRACK@[50; 51) "]" | 50 | INT_NUMBER@[49; 50) "2" |
51 | SEMI@[51; 52) ";" | 51 | R_BRACK@[50; 51) "]" |
52 | WHITESPACE@[52; 53) "\n" | 52 | SEMI@[51; 52) ";" |
53 | R_CURLY@[53; 54) "}" | 53 | WHITESPACE@[52; 53) "\n" |
54 | R_CURLY@[53; 54) "}" | ||
54 | WHITESPACE@[54; 55) "\n" | 55 | WHITESPACE@[54; 55) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt index 4bc446a55..6bce37a4f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.txt | |||
@@ -8,35 +8,36 @@ SOURCE_FILE@[0; 52) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 51) | 11 | BLOCK_EXPR@[9; 51) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 51) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 18) | 14 | WHITESPACE@[10; 15) "\n " |
15 | BLOCK_EXPR@[15; 17) | 15 | EXPR_STMT@[15; 18) |
16 | BLOCK@[15; 17) | 16 | BLOCK_EXPR@[15; 17) |
17 | L_CURLY@[15; 16) "{" | 17 | BLOCK@[15; 17) |
18 | R_CURLY@[16; 17) "}" | 18 | L_CURLY@[15; 16) "{" |
19 | SEMI@[17; 18) ";" | 19 | R_CURLY@[16; 17) "}" |
20 | WHITESPACE@[18; 23) "\n " | 20 | SEMI@[17; 18) ";" |
21 | EXPR_STMT@[23; 33) | 21 | WHITESPACE@[18; 23) "\n " |
22 | BLOCK_EXPR@[23; 32) | 22 | EXPR_STMT@[23; 33) |
23 | UNSAFE_KW@[23; 29) "unsafe" | 23 | BLOCK_EXPR@[23; 32) |
24 | WHITESPACE@[29; 30) " " | 24 | UNSAFE_KW@[23; 29) "unsafe" |
25 | BLOCK@[30; 32) | 25 | WHITESPACE@[29; 30) " " |
26 | L_CURLY@[30; 31) "{" | 26 | BLOCK@[30; 32) |
27 | R_CURLY@[31; 32) "}" | 27 | L_CURLY@[30; 31) "{" |
28 | SEMI@[32; 33) ";" | 28 | R_CURLY@[31; 32) "}" |
29 | WHITESPACE@[33; 38) "\n " | 29 | SEMI@[32; 33) ";" |
30 | EXPR_STMT@[38; 49) | 30 | WHITESPACE@[33; 38) "\n " |
31 | BLOCK_EXPR@[38; 48) | 31 | EXPR_STMT@[38; 49) |
32 | LABEL@[38; 45) | 32 | BLOCK_EXPR@[38; 48) |
33 | LIFETIME@[38; 44) "\'label" | 33 | LABEL@[38; 45) |
34 | COLON@[44; 45) ":" | 34 | LIFETIME@[38; 44) "\'label" |
35 | WHITESPACE@[45; 46) " " | 35 | COLON@[44; 45) ":" |
36 | BLOCK@[46; 48) | 36 | WHITESPACE@[45; 46) " " |
37 | L_CURLY@[46; 47) "{" | 37 | BLOCK@[46; 48) |
38 | R_CURLY@[47; 48) "}" | 38 | L_CURLY@[46; 47) "{" |
39 | SEMI@[48; 49) ";" | 39 | R_CURLY@[47; 48) "}" |
40 | WHITESPACE@[49; 50) "\n" | 40 | SEMI@[48; 49) ";" |
41 | R_CURLY@[50; 51) "}" | 41 | WHITESPACE@[49; 50) "\n" |
42 | R_CURLY@[50; 51) "}" | ||
42 | WHITESPACE@[51; 52) "\n" | 43 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt index a05218118..0216123f0 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.txt | |||
@@ -8,132 +8,133 @@ SOURCE_FILE@[0; 134) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 133) | 11 | BLOCK_EXPR@[9; 133) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 133) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 21) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LAMBDA_EXPR@[15; 20) | 15 | EXPR_STMT@[15; 21) |
16 | PARAM_LIST@[15; 17) | 16 | LAMBDA_EXPR@[15; 20) |
17 | PIPE@[15; 16) "|" | 17 | PARAM_LIST@[15; 17) |
18 | PIPE@[16; 17) "|" | 18 | PIPE@[15; 16) "|" |
19 | WHITESPACE@[17; 18) " " | 19 | PIPE@[16; 17) "|" |
20 | TUPLE_EXPR@[18; 20) | 20 | WHITESPACE@[17; 18) " " |
21 | L_PAREN@[18; 19) "(" | 21 | TUPLE_EXPR@[18; 20) |
22 | R_PAREN@[19; 20) ")" | 22 | L_PAREN@[18; 19) "(" |
23 | SEMI@[20; 21) ";" | 23 | R_PAREN@[19; 20) ")" |
24 | WHITESPACE@[21; 26) "\n " | 24 | SEMI@[20; 21) ";" |
25 | EXPR_STMT@[26; 43) | 25 | WHITESPACE@[21; 26) "\n " |
26 | LAMBDA_EXPR@[26; 42) | 26 | EXPR_STMT@[26; 43) |
27 | PARAM_LIST@[26; 28) | 27 | LAMBDA_EXPR@[26; 42) |
28 | PIPE@[26; 27) "|" | 28 | PARAM_LIST@[26; 28) |
29 | PIPE@[27; 28) "|" | 29 | PIPE@[26; 27) "|" |
30 | WHITESPACE@[28; 29) " " | 30 | PIPE@[27; 28) "|" |
31 | RET_TYPE@[29; 35) | 31 | WHITESPACE@[28; 29) " " |
32 | THIN_ARROW@[29; 31) "->" | 32 | RET_TYPE@[29; 35) |
33 | WHITESPACE@[31; 32) " " | 33 | THIN_ARROW@[29; 31) "->" |
34 | PATH_TYPE@[32; 35) | 34 | WHITESPACE@[31; 32) " " |
35 | PATH@[32; 35) | 35 | PATH_TYPE@[32; 35) |
36 | PATH_SEGMENT@[32; 35) | 36 | PATH@[32; 35) |
37 | NAME_REF@[32; 35) | 37 | PATH_SEGMENT@[32; 35) |
38 | IDENT@[32; 35) "i32" | 38 | NAME_REF@[32; 35) |
39 | WHITESPACE@[35; 36) " " | 39 | IDENT@[32; 35) "i32" |
40 | BLOCK_EXPR@[36; 42) | 40 | WHITESPACE@[35; 36) " " |
41 | BLOCK@[36; 42) | 41 | BLOCK_EXPR@[36; 42) |
42 | L_CURLY@[36; 37) "{" | 42 | BLOCK@[36; 42) |
43 | WHITESPACE@[37; 38) " " | 43 | L_CURLY@[36; 37) "{" |
44 | LITERAL@[38; 40) | 44 | WHITESPACE@[37; 38) " " |
45 | INT_NUMBER@[38; 40) "92" | 45 | LITERAL@[38; 40) |
46 | WHITESPACE@[40; 41) " " | 46 | INT_NUMBER@[38; 40) "92" |
47 | R_CURLY@[41; 42) "}" | 47 | WHITESPACE@[40; 41) " " |
48 | SEMI@[42; 43) ";" | 48 | R_CURLY@[41; 42) "}" |
49 | WHITESPACE@[43; 48) "\n " | 49 | SEMI@[42; 43) ";" |
50 | EXPR_STMT@[48; 54) | 50 | WHITESPACE@[43; 48) "\n " |
51 | LAMBDA_EXPR@[48; 53) | 51 | EXPR_STMT@[48; 54) |
52 | PARAM_LIST@[48; 51) | 52 | LAMBDA_EXPR@[48; 53) |
53 | PIPE@[48; 49) "|" | 53 | PARAM_LIST@[48; 51) |
54 | PARAM@[49; 50) | 54 | PIPE@[48; 49) "|" |
55 | BIND_PAT@[49; 50) | 55 | PARAM@[49; 50) |
56 | NAME@[49; 50) | 56 | BIND_PAT@[49; 50) |
57 | IDENT@[49; 50) "x" | 57 | NAME@[49; 50) |
58 | PIPE@[50; 51) "|" | 58 | IDENT@[49; 50) "x" |
59 | WHITESPACE@[51; 52) " " | 59 | PIPE@[50; 51) "|" |
60 | PATH_EXPR@[52; 53) | 60 | WHITESPACE@[51; 52) " " |
61 | PATH@[52; 53) | 61 | PATH_EXPR@[52; 53) |
62 | PATH_SEGMENT@[52; 53) | 62 | PATH@[52; 53) |
63 | NAME_REF@[52; 53) | 63 | PATH_SEGMENT@[52; 53) |
64 | IDENT@[52; 53) "x" | 64 | NAME_REF@[52; 53) |
65 | SEMI@[53; 54) ";" | 65 | IDENT@[52; 53) "x" |
66 | WHITESPACE@[54; 59) "\n " | 66 | SEMI@[53; 54) ";" |
67 | EXPR_STMT@[59; 76) | 67 | WHITESPACE@[54; 59) "\n " |
68 | LAMBDA_EXPR@[59; 75) | 68 | EXPR_STMT@[59; 76) |
69 | MOVE_KW@[59; 63) "move" | 69 | LAMBDA_EXPR@[59; 75) |
70 | WHITESPACE@[63; 64) " " | 70 | MOVE_KW@[59; 63) "move" |
71 | PARAM_LIST@[64; 73) | 71 | WHITESPACE@[63; 64) " " |
72 | PIPE@[64; 65) "|" | 72 | PARAM_LIST@[64; 73) |
73 | PARAM@[65; 71) | 73 | PIPE@[64; 65) "|" |
74 | BIND_PAT@[65; 66) | 74 | PARAM@[65; 71) |
75 | NAME@[65; 66) | 75 | BIND_PAT@[65; 66) |
76 | IDENT@[65; 66) "x" | 76 | NAME@[65; 66) |
77 | COLON@[66; 67) ":" | 77 | IDENT@[65; 66) "x" |
78 | WHITESPACE@[67; 68) " " | 78 | COLON@[66; 67) ":" |
79 | PATH_TYPE@[68; 71) | 79 | WHITESPACE@[67; 68) " " |
80 | PATH@[68; 71) | 80 | PATH_TYPE@[68; 71) |
81 | PATH_SEGMENT@[68; 71) | 81 | PATH@[68; 71) |
82 | NAME_REF@[68; 71) | 82 | PATH_SEGMENT@[68; 71) |
83 | IDENT@[68; 71) "i32" | 83 | NAME_REF@[68; 71) |
84 | COMMA@[71; 72) "," | 84 | IDENT@[68; 71) "i32" |
85 | PIPE@[72; 73) "|" | 85 | COMMA@[71; 72) "," |
86 | WHITESPACE@[73; 74) " " | 86 | PIPE@[72; 73) "|" |
87 | PATH_EXPR@[74; 75) | 87 | WHITESPACE@[73; 74) " " |
88 | PATH@[74; 75) | 88 | PATH_EXPR@[74; 75) |
89 | PATH_SEGMENT@[74; 75) | 89 | PATH@[74; 75) |
90 | NAME_REF@[74; 75) | 90 | PATH_SEGMENT@[74; 75) |
91 | IDENT@[74; 75) "x" | 91 | NAME_REF@[74; 75) |
92 | SEMI@[75; 76) ";" | 92 | IDENT@[74; 75) "x" |
93 | WHITESPACE@[76; 81) "\n " | 93 | SEMI@[75; 76) ";" |
94 | EXPR_STMT@[81; 93) | 94 | WHITESPACE@[76; 81) "\n " |
95 | LAMBDA_EXPR@[81; 92) | 95 | EXPR_STMT@[81; 93) |
96 | ASYNC_KW@[81; 86) "async" | 96 | LAMBDA_EXPR@[81; 92) |
97 | WHITESPACE@[86; 87) " " | 97 | ASYNC_KW@[81; 86) "async" |
98 | PARAM_LIST@[87; 89) | 98 | WHITESPACE@[86; 87) " " |
99 | PIPE@[87; 88) "|" | 99 | PARAM_LIST@[87; 89) |
100 | PIPE@[88; 89) "|" | 100 | PIPE@[87; 88) "|" |
101 | WHITESPACE@[89; 90) " " | 101 | PIPE@[88; 89) "|" |
102 | BLOCK_EXPR@[90; 92) | 102 | WHITESPACE@[89; 90) " " |
103 | BLOCK@[90; 92) | 103 | BLOCK_EXPR@[90; 92) |
104 | L_CURLY@[90; 91) "{" | 104 | BLOCK@[90; 92) |
105 | R_CURLY@[91; 92) "}" | 105 | L_CURLY@[90; 91) "{" |
106 | SEMI@[92; 93) ";" | 106 | R_CURLY@[91; 92) "}" |
107 | WHITESPACE@[93; 98) "\n " | 107 | SEMI@[92; 93) ";" |
108 | EXPR_STMT@[98; 109) | 108 | WHITESPACE@[93; 98) "\n " |
109 | LAMBDA_EXPR@[98; 108) | 109 | EXPR_STMT@[98; 109) |
110 | MOVE_KW@[98; 102) "move" | 110 | LAMBDA_EXPR@[98; 108) |
111 | WHITESPACE@[102; 103) " " | 111 | MOVE_KW@[98; 102) "move" |
112 | PARAM_LIST@[103; 105) | 112 | WHITESPACE@[102; 103) " " |
113 | PIPE@[103; 104) "|" | 113 | PARAM_LIST@[103; 105) |
114 | PIPE@[104; 105) "|" | 114 | PIPE@[103; 104) "|" |
115 | WHITESPACE@[105; 106) " " | 115 | PIPE@[104; 105) "|" |
116 | BLOCK_EXPR@[106; 108) | 116 | WHITESPACE@[105; 106) " " |
117 | BLOCK@[106; 108) | 117 | BLOCK_EXPR@[106; 108) |
118 | L_CURLY@[106; 107) "{" | 118 | BLOCK@[106; 108) |
119 | R_CURLY@[107; 108) "}" | 119 | L_CURLY@[106; 107) "{" |
120 | SEMI@[108; 109) ";" | 120 | R_CURLY@[107; 108) "}" |
121 | WHITESPACE@[109; 114) "\n " | 121 | SEMI@[108; 109) ";" |
122 | EXPR_STMT@[114; 131) | 122 | WHITESPACE@[109; 114) "\n " |
123 | LAMBDA_EXPR@[114; 130) | 123 | EXPR_STMT@[114; 131) |
124 | ASYNC_KW@[114; 119) "async" | 124 | LAMBDA_EXPR@[114; 130) |
125 | WHITESPACE@[119; 120) " " | 125 | ASYNC_KW@[114; 119) "async" |
126 | MOVE_KW@[120; 124) "move" | 126 | WHITESPACE@[119; 120) " " |
127 | WHITESPACE@[124; 125) " " | 127 | MOVE_KW@[120; 124) "move" |
128 | PARAM_LIST@[125; 127) | 128 | WHITESPACE@[124; 125) " " |
129 | PIPE@[125; 126) "|" | 129 | PARAM_LIST@[125; 127) |
130 | PIPE@[126; 127) "|" | 130 | PIPE@[125; 126) "|" |
131 | WHITESPACE@[127; 128) " " | 131 | PIPE@[126; 127) "|" |
132 | BLOCK_EXPR@[128; 130) | 132 | WHITESPACE@[127; 128) " " |
133 | BLOCK@[128; 130) | 133 | BLOCK_EXPR@[128; 130) |
134 | L_CURLY@[128; 129) "{" | 134 | BLOCK@[128; 130) |
135 | R_CURLY@[129; 130) "}" | 135 | L_CURLY@[128; 129) "{" |
136 | SEMI@[130; 131) ";" | 136 | R_CURLY@[129; 130) "}" |
137 | WHITESPACE@[131; 132) "\n" | 137 | SEMI@[130; 131) ";" |
138 | R_CURLY@[132; 133) "}" | 138 | WHITESPACE@[131; 132) "\n" |
139 | R_CURLY@[132; 133) "}" | ||
139 | WHITESPACE@[133; 134) "\n" | 140 | WHITESPACE@[133; 134) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt index bc28b293e..ba478528c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.txt | |||
@@ -8,55 +8,56 @@ SOURCE_FILE@[0; 49) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 48) | 11 | BLOCK_EXPR@[9; 48) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 48) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 23) | 14 | WHITESPACE@[10; 15) "\n " |
15 | METHOD_CALL_EXPR@[15; 22) | 15 | EXPR_STMT@[15; 23) |
16 | PATH_EXPR@[15; 16) | 16 | METHOD_CALL_EXPR@[15; 22) |
17 | PATH@[15; 16) | 17 | PATH_EXPR@[15; 16) |
18 | PATH_SEGMENT@[15; 16) | 18 | PATH@[15; 16) |
19 | NAME_REF@[15; 16) | 19 | PATH_SEGMENT@[15; 16) |
20 | IDENT@[15; 16) "x" | 20 | NAME_REF@[15; 16) |
21 | DOT@[16; 17) "." | 21 | IDENT@[15; 16) "x" |
22 | NAME_REF@[17; 20) | 22 | DOT@[16; 17) "." |
23 | IDENT@[17; 20) "foo" | 23 | NAME_REF@[17; 20) |
24 | ARG_LIST@[20; 22) | 24 | IDENT@[17; 20) "foo" |
25 | L_PAREN@[20; 21) "(" | 25 | ARG_LIST@[20; 22) |
26 | R_PAREN@[21; 22) ")" | 26 | L_PAREN@[20; 21) "(" |
27 | SEMI@[22; 23) ";" | 27 | R_PAREN@[21; 22) ")" |
28 | WHITESPACE@[23; 28) "\n " | 28 | SEMI@[22; 23) ";" |
29 | EXPR_STMT@[28; 46) | 29 | WHITESPACE@[23; 28) "\n " |
30 | METHOD_CALL_EXPR@[28; 45) | 30 | EXPR_STMT@[28; 46) |
31 | PATH_EXPR@[28; 29) | 31 | METHOD_CALL_EXPR@[28; 45) |
32 | PATH@[28; 29) | 32 | PATH_EXPR@[28; 29) |
33 | PATH_SEGMENT@[28; 29) | 33 | PATH@[28; 29) |
34 | NAME_REF@[28; 29) | 34 | PATH_SEGMENT@[28; 29) |
35 | IDENT@[28; 29) "y" | 35 | NAME_REF@[28; 29) |
36 | DOT@[29; 30) "." | 36 | IDENT@[28; 29) "y" |
37 | NAME_REF@[30; 33) | 37 | DOT@[29; 30) "." |
38 | IDENT@[30; 33) "bar" | 38 | NAME_REF@[30; 33) |
39 | TYPE_ARG_LIST@[33; 38) | 39 | IDENT@[30; 33) "bar" |
40 | COLONCOLON@[33; 35) "::" | 40 | TYPE_ARG_LIST@[33; 38) |
41 | L_ANGLE@[35; 36) "<" | 41 | COLONCOLON@[33; 35) "::" |
42 | TYPE_ARG@[36; 37) | 42 | L_ANGLE@[35; 36) "<" |
43 | PATH_TYPE@[36; 37) | 43 | TYPE_ARG@[36; 37) |
44 | PATH@[36; 37) | 44 | PATH_TYPE@[36; 37) |
45 | PATH_SEGMENT@[36; 37) | 45 | PATH@[36; 37) |
46 | NAME_REF@[36; 37) | 46 | PATH_SEGMENT@[36; 37) |
47 | IDENT@[36; 37) "T" | 47 | NAME_REF@[36; 37) |
48 | R_ANGLE@[37; 38) ">" | 48 | IDENT@[36; 37) "T" |
49 | ARG_LIST@[38; 45) | 49 | R_ANGLE@[37; 38) ">" |
50 | L_PAREN@[38; 39) "(" | 50 | ARG_LIST@[38; 45) |
51 | LITERAL@[39; 40) | 51 | L_PAREN@[38; 39) "(" |
52 | INT_NUMBER@[39; 40) "1" | 52 | LITERAL@[39; 40) |
53 | COMMA@[40; 41) "," | 53 | INT_NUMBER@[39; 40) "1" |
54 | WHITESPACE@[41; 42) " " | 54 | COMMA@[40; 41) "," |
55 | LITERAL@[42; 43) | 55 | WHITESPACE@[41; 42) " " |
56 | INT_NUMBER@[42; 43) "2" | 56 | LITERAL@[42; 43) |
57 | COMMA@[43; 44) "," | 57 | INT_NUMBER@[42; 43) "2" |
58 | R_PAREN@[44; 45) ")" | 58 | COMMA@[43; 44) "," |
59 | SEMI@[45; 46) ";" | 59 | R_PAREN@[44; 45) ")" |
60 | WHITESPACE@[46; 47) "\n" | 60 | SEMI@[45; 46) ";" |
61 | R_CURLY@[47; 48) "}" | 61 | WHITESPACE@[46; 47) "\n" |
62 | R_CURLY@[47; 48) "}" | ||
62 | WHITESPACE@[48; 49) "\n" | 63 | WHITESPACE@[48; 49) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt index 32be7a849..6f685ca8d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.txt | |||
@@ -8,31 +8,32 @@ SOURCE_FILE@[0; 40) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 39) | 11 | BLOCK_EXPR@[9; 39) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 39) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 18) | 14 | WHITESPACE@[10; 15) "\n " |
15 | TUPLE_EXPR@[15; 17) | 15 | EXPR_STMT@[15; 18) |
16 | L_PAREN@[15; 16) "(" | 16 | TUPLE_EXPR@[15; 17) |
17 | R_PAREN@[16; 17) ")" | 17 | L_PAREN@[15; 16) "(" |
18 | SEMI@[17; 18) ";" | 18 | R_PAREN@[16; 17) ")" |
19 | WHITESPACE@[18; 23) "\n " | 19 | SEMI@[17; 18) ";" |
20 | EXPR_STMT@[23; 27) | 20 | WHITESPACE@[18; 23) "\n " |
21 | PAREN_EXPR@[23; 26) | 21 | EXPR_STMT@[23; 27) |
22 | L_PAREN@[23; 24) "(" | 22 | PAREN_EXPR@[23; 26) |
23 | LITERAL@[24; 25) | 23 | L_PAREN@[23; 24) "(" |
24 | INT_NUMBER@[24; 25) "1" | 24 | LITERAL@[24; 25) |
25 | R_PAREN@[25; 26) ")" | 25 | INT_NUMBER@[24; 25) "1" |
26 | SEMI@[26; 27) ";" | 26 | R_PAREN@[25; 26) ")" |
27 | WHITESPACE@[27; 32) "\n " | 27 | SEMI@[26; 27) ";" |
28 | EXPR_STMT@[32; 37) | 28 | WHITESPACE@[27; 32) "\n " |
29 | TUPLE_EXPR@[32; 36) | 29 | EXPR_STMT@[32; 37) |
30 | L_PAREN@[32; 33) "(" | 30 | TUPLE_EXPR@[32; 36) |
31 | LITERAL@[33; 34) | 31 | L_PAREN@[32; 33) "(" |
32 | INT_NUMBER@[33; 34) "1" | 32 | LITERAL@[33; 34) |
33 | COMMA@[34; 35) "," | 33 | INT_NUMBER@[33; 34) "1" |
34 | R_PAREN@[35; 36) ")" | 34 | COMMA@[34; 35) "," |
35 | SEMI@[36; 37) ";" | 35 | R_PAREN@[35; 36) ")" |
36 | WHITESPACE@[37; 38) "\n" | 36 | SEMI@[36; 37) ";" |
37 | R_CURLY@[38; 39) "}" | 37 | WHITESPACE@[37; 38) "\n" |
38 | R_CURLY@[38; 39) "}" | ||
38 | WHITESPACE@[39; 40) "\n" | 39 | WHITESPACE@[39; 40) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt index 39e4f4b3e..3376a90cb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.txt | |||
@@ -8,57 +8,61 @@ SOURCE_FILE@[0; 74) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 73) | 11 | BLOCK_EXPR@[9; 73) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 73) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 26) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LOOP_EXPR@[15; 26) | 15 | EXPR_STMT@[15; 26) |
16 | LABEL@[15; 18) | 16 | LOOP_EXPR@[15; 26) |
17 | LIFETIME@[15; 17) "\'a" | 17 | LABEL@[15; 18) |
18 | COLON@[17; 18) ":" | 18 | LIFETIME@[15; 17) "\'a" |
19 | WHITESPACE@[18; 19) " " | 19 | COLON@[17; 18) ":" |
20 | LOOP_KW@[19; 23) "loop" | 20 | WHITESPACE@[18; 19) " " |
21 | WHITESPACE@[23; 24) " " | 21 | LOOP_KW@[19; 23) "loop" |
22 | BLOCK@[24; 26) | 22 | WHITESPACE@[23; 24) " " |
23 | L_CURLY@[24; 25) "{" | 23 | BLOCK_EXPR@[24; 26) |
24 | R_CURLY@[25; 26) "}" | 24 | BLOCK@[24; 26) |
25 | WHITESPACE@[26; 31) "\n " | 25 | L_CURLY@[24; 25) "{" |
26 | EXPR_STMT@[31; 48) | 26 | R_CURLY@[25; 26) "}" |
27 | WHILE_EXPR@[31; 48) | 27 | WHITESPACE@[26; 31) "\n " |
28 | LABEL@[31; 34) | 28 | EXPR_STMT@[31; 48) |
29 | LIFETIME@[31; 33) "\'b" | 29 | WHILE_EXPR@[31; 48) |
30 | COLON@[33; 34) ":" | 30 | LABEL@[31; 34) |
31 | WHITESPACE@[34; 35) " " | 31 | LIFETIME@[31; 33) "\'b" |
32 | WHILE_KW@[35; 40) "while" | 32 | COLON@[33; 34) ":" |
33 | WHITESPACE@[40; 41) " " | 33 | WHITESPACE@[34; 35) " " |
34 | CONDITION@[41; 45) | 34 | WHILE_KW@[35; 40) "while" |
35 | LITERAL@[41; 45) | 35 | WHITESPACE@[40; 41) " " |
36 | TRUE_KW@[41; 45) "true" | 36 | CONDITION@[41; 45) |
37 | WHITESPACE@[45; 46) " " | 37 | LITERAL@[41; 45) |
38 | BLOCK@[46; 48) | 38 | TRUE_KW@[41; 45) "true" |
39 | L_CURLY@[46; 47) "{" | 39 | WHITESPACE@[45; 46) " " |
40 | R_CURLY@[47; 48) "}" | 40 | BLOCK_EXPR@[46; 48) |
41 | WHITESPACE@[48; 53) "\n " | 41 | BLOCK@[46; 48) |
42 | FOR_EXPR@[53; 71) | 42 | L_CURLY@[46; 47) "{" |
43 | LABEL@[53; 56) | 43 | R_CURLY@[47; 48) "}" |
44 | LIFETIME@[53; 55) "\'c" | 44 | WHITESPACE@[48; 53) "\n " |
45 | COLON@[55; 56) ":" | 45 | FOR_EXPR@[53; 71) |
46 | WHITESPACE@[56; 57) " " | 46 | LABEL@[53; 56) |
47 | FOR_KW@[57; 60) "for" | 47 | LIFETIME@[53; 55) "\'c" |
48 | WHITESPACE@[60; 61) " " | 48 | COLON@[55; 56) ":" |
49 | BIND_PAT@[61; 62) | 49 | WHITESPACE@[56; 57) " " |
50 | NAME@[61; 62) | 50 | FOR_KW@[57; 60) "for" |
51 | IDENT@[61; 62) "x" | 51 | WHITESPACE@[60; 61) " " |
52 | WHITESPACE@[62; 63) " " | 52 | BIND_PAT@[61; 62) |
53 | IN_KW@[63; 65) "in" | 53 | NAME@[61; 62) |
54 | WHITESPACE@[65; 66) " " | 54 | IDENT@[61; 62) "x" |
55 | TUPLE_EXPR@[66; 68) | 55 | WHITESPACE@[62; 63) " " |
56 | L_PAREN@[66; 67) "(" | 56 | IN_KW@[63; 65) "in" |
57 | R_PAREN@[67; 68) ")" | 57 | WHITESPACE@[65; 66) " " |
58 | WHITESPACE@[68; 69) " " | 58 | TUPLE_EXPR@[66; 68) |
59 | BLOCK@[69; 71) | 59 | L_PAREN@[66; 67) "(" |
60 | L_CURLY@[69; 70) "{" | 60 | R_PAREN@[67; 68) ")" |
61 | R_CURLY@[70; 71) "}" | 61 | WHITESPACE@[68; 69) " " |
62 | WHITESPACE@[71; 72) "\n" | 62 | BLOCK_EXPR@[69; 71) |
63 | R_CURLY@[72; 73) "}" | 63 | BLOCK@[69; 71) |
64 | L_CURLY@[69; 70) "{" | ||
65 | R_CURLY@[70; 71) "}" | ||
66 | WHITESPACE@[71; 72) "\n" | ||
67 | R_CURLY@[72; 73) "}" | ||
64 | WHITESPACE@[73; 74) "\n" | 68 | WHITESPACE@[73; 74) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt index aef3f7e0f..3fee3a1cf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.txt | |||
@@ -8,33 +8,34 @@ SOURCE_FILE@[0; 39) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 38) | 11 | BLOCK_EXPR@[10; 38) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 38) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 36) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 36) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | TUPLE_PAT@[20; 30) | 17 | WHITESPACE@[19; 20) " " |
18 | L_PAREN@[20; 21) "(" | 18 | TUPLE_PAT@[20; 30) |
19 | BIND_PAT@[21; 22) | 19 | L_PAREN@[20; 21) "(" |
20 | NAME@[21; 22) | 20 | BIND_PAT@[21; 22) |
21 | IDENT@[21; 22) "a" | 21 | NAME@[21; 22) |
22 | COMMA@[22; 23) "," | 22 | IDENT@[21; 22) "a" |
23 | WHITESPACE@[23; 24) " " | 23 | COMMA@[22; 23) "," |
24 | BIND_PAT@[24; 25) | 24 | WHITESPACE@[23; 24) " " |
25 | NAME@[24; 25) | 25 | BIND_PAT@[24; 25) |
26 | IDENT@[24; 25) "b" | 26 | NAME@[24; 25) |
27 | COMMA@[25; 26) "," | 27 | IDENT@[24; 25) "b" |
28 | WHITESPACE@[26; 27) " " | 28 | COMMA@[25; 26) "," |
29 | DOTDOT@[27; 29) ".." | 29 | WHITESPACE@[26; 27) " " |
30 | R_PAREN@[29; 30) ")" | 30 | DOTDOT@[27; 29) ".." |
31 | WHITESPACE@[30; 31) " " | 31 | R_PAREN@[29; 30) ")" |
32 | EQ@[31; 32) "=" | 32 | WHITESPACE@[30; 31) " " |
33 | WHITESPACE@[32; 33) " " | 33 | EQ@[31; 32) "=" |
34 | TUPLE_EXPR@[33; 35) | 34 | WHITESPACE@[32; 33) " " |
35 | L_PAREN@[33; 34) "(" | 35 | TUPLE_EXPR@[33; 35) |
36 | R_PAREN@[34; 35) ")" | 36 | L_PAREN@[33; 34) "(" |
37 | SEMI@[35; 36) ";" | 37 | R_PAREN@[34; 35) ")" |
38 | WHITESPACE@[36; 37) "\n" | 38 | SEMI@[35; 36) ";" |
39 | R_CURLY@[37; 38) "}" | 39 | WHITESPACE@[36; 37) "\n" |
40 | R_CURLY@[37; 38) "}" | ||
40 | WHITESPACE@[38; 39) "\n" | 41 | WHITESPACE@[38; 39) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt index ab0f88507..ad1d47b0e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.txt | |||
@@ -8,120 +8,121 @@ SOURCE_FILE@[0; 146) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 145) | 11 | BLOCK_EXPR@[10; 145) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 145) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 27) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 27) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | BIND_PAT@[20; 21) | 17 | WHITESPACE@[19; 20) " " |
18 | NAME@[20; 21) | 18 | BIND_PAT@[20; 21) |
19 | IDENT@[20; 21) "a" | 19 | NAME@[20; 21) |
20 | WHITESPACE@[21; 22) " " | 20 | IDENT@[20; 21) "a" |
21 | EQ@[22; 23) "=" | 21 | WHITESPACE@[21; 22) " " |
22 | WHITESPACE@[23; 24) " " | 22 | EQ@[22; 23) "=" |
23 | TUPLE_EXPR@[24; 26) | 23 | WHITESPACE@[23; 24) " " |
24 | L_PAREN@[24; 25) "(" | 24 | TUPLE_EXPR@[24; 26) |
25 | R_PAREN@[25; 26) ")" | 25 | L_PAREN@[24; 25) "(" |
26 | SEMI@[26; 27) ";" | 26 | R_PAREN@[25; 26) ")" |
27 | WHITESPACE@[27; 32) "\n " | 27 | SEMI@[26; 27) ";" |
28 | LET_STMT@[32; 47) | 28 | WHITESPACE@[27; 32) "\n " |
29 | LET_KW@[32; 35) "let" | 29 | LET_STMT@[32; 47) |
30 | WHITESPACE@[35; 36) " " | 30 | LET_KW@[32; 35) "let" |
31 | BIND_PAT@[36; 41) | 31 | WHITESPACE@[35; 36) " " |
32 | MUT_KW@[36; 39) "mut" | 32 | BIND_PAT@[36; 41) |
33 | WHITESPACE@[39; 40) " " | 33 | MUT_KW@[36; 39) "mut" |
34 | NAME@[40; 41) | 34 | WHITESPACE@[39; 40) " " |
35 | IDENT@[40; 41) "b" | 35 | NAME@[40; 41) |
36 | WHITESPACE@[41; 42) " " | 36 | IDENT@[40; 41) "b" |
37 | EQ@[42; 43) "=" | 37 | WHITESPACE@[41; 42) " " |
38 | WHITESPACE@[43; 44) " " | 38 | EQ@[42; 43) "=" |
39 | TUPLE_EXPR@[44; 46) | 39 | WHITESPACE@[43; 44) " " |
40 | L_PAREN@[44; 45) "(" | 40 | TUPLE_EXPR@[44; 46) |
41 | R_PAREN@[45; 46) ")" | 41 | L_PAREN@[44; 45) "(" |
42 | SEMI@[46; 47) ";" | 42 | R_PAREN@[45; 46) ")" |
43 | WHITESPACE@[47; 52) "\n " | 43 | SEMI@[46; 47) ";" |
44 | LET_STMT@[52; 67) | 44 | WHITESPACE@[47; 52) "\n " |
45 | LET_KW@[52; 55) "let" | 45 | LET_STMT@[52; 67) |
46 | WHITESPACE@[55; 56) " " | 46 | LET_KW@[52; 55) "let" |
47 | BIND_PAT@[56; 61) | 47 | WHITESPACE@[55; 56) " " |
48 | REF_KW@[56; 59) "ref" | 48 | BIND_PAT@[56; 61) |
49 | WHITESPACE@[59; 60) " " | 49 | REF_KW@[56; 59) "ref" |
50 | NAME@[60; 61) | 50 | WHITESPACE@[59; 60) " " |
51 | IDENT@[60; 61) "c" | 51 | NAME@[60; 61) |
52 | WHITESPACE@[61; 62) " " | 52 | IDENT@[60; 61) "c" |
53 | EQ@[62; 63) "=" | 53 | WHITESPACE@[61; 62) " " |
54 | WHITESPACE@[63; 64) " " | 54 | EQ@[62; 63) "=" |
55 | TUPLE_EXPR@[64; 66) | 55 | WHITESPACE@[63; 64) " " |
56 | L_PAREN@[64; 65) "(" | 56 | TUPLE_EXPR@[64; 66) |
57 | R_PAREN@[65; 66) ")" | 57 | L_PAREN@[64; 65) "(" |
58 | SEMI@[66; 67) ";" | 58 | R_PAREN@[65; 66) ")" |
59 | WHITESPACE@[67; 72) "\n " | 59 | SEMI@[66; 67) ";" |
60 | LET_STMT@[72; 91) | 60 | WHITESPACE@[67; 72) "\n " |
61 | LET_KW@[72; 75) "let" | 61 | LET_STMT@[72; 91) |
62 | WHITESPACE@[75; 76) " " | 62 | LET_KW@[72; 75) "let" |
63 | BIND_PAT@[76; 85) | 63 | WHITESPACE@[75; 76) " " |
64 | REF_KW@[76; 79) "ref" | 64 | BIND_PAT@[76; 85) |
65 | WHITESPACE@[79; 80) " " | 65 | REF_KW@[76; 79) "ref" |
66 | MUT_KW@[80; 83) "mut" | 66 | WHITESPACE@[79; 80) " " |
67 | WHITESPACE@[83; 84) " " | 67 | MUT_KW@[80; 83) "mut" |
68 | NAME@[84; 85) | 68 | WHITESPACE@[83; 84) " " |
69 | IDENT@[84; 85) "d" | 69 | NAME@[84; 85) |
70 | WHITESPACE@[85; 86) " " | 70 | IDENT@[84; 85) "d" |
71 | EQ@[86; 87) "=" | 71 | WHITESPACE@[85; 86) " " |
72 | WHITESPACE@[87; 88) " " | 72 | EQ@[86; 87) "=" |
73 | TUPLE_EXPR@[88; 90) | 73 | WHITESPACE@[87; 88) " " |
74 | L_PAREN@[88; 89) "(" | 74 | TUPLE_EXPR@[88; 90) |
75 | R_PAREN@[89; 90) ")" | 75 | L_PAREN@[88; 89) "(" |
76 | SEMI@[90; 91) ";" | 76 | R_PAREN@[89; 90) ")" |
77 | WHITESPACE@[91; 96) "\n " | 77 | SEMI@[90; 91) ";" |
78 | LET_STMT@[96; 111) | 78 | WHITESPACE@[91; 96) "\n " |
79 | LET_KW@[96; 99) "let" | 79 | LET_STMT@[96; 111) |
80 | WHITESPACE@[99; 100) " " | 80 | LET_KW@[96; 99) "let" |
81 | BIND_PAT@[100; 105) | 81 | WHITESPACE@[99; 100) " " |
82 | NAME@[100; 101) | 82 | BIND_PAT@[100; 105) |
83 | IDENT@[100; 101) "e" | 83 | NAME@[100; 101) |
84 | WHITESPACE@[101; 102) " " | 84 | IDENT@[100; 101) "e" |
85 | AT@[102; 103) "@" | 85 | WHITESPACE@[101; 102) " " |
86 | WHITESPACE@[103; 104) " " | 86 | AT@[102; 103) "@" |
87 | PLACEHOLDER_PAT@[104; 105) | 87 | WHITESPACE@[103; 104) " " |
88 | UNDERSCORE@[104; 105) "_" | 88 | PLACEHOLDER_PAT@[104; 105) |
89 | WHITESPACE@[105; 106) " " | 89 | UNDERSCORE@[104; 105) "_" |
90 | EQ@[106; 107) "=" | 90 | WHITESPACE@[105; 106) " " |
91 | WHITESPACE@[107; 108) " " | 91 | EQ@[106; 107) "=" |
92 | TUPLE_EXPR@[108; 110) | 92 | WHITESPACE@[107; 108) " " |
93 | L_PAREN@[108; 109) "(" | 93 | TUPLE_EXPR@[108; 110) |
94 | R_PAREN@[109; 110) ")" | 94 | L_PAREN@[108; 109) "(" |
95 | SEMI@[110; 111) ";" | 95 | R_PAREN@[109; 110) ")" |
96 | WHITESPACE@[111; 116) "\n " | 96 | SEMI@[110; 111) ";" |
97 | LET_STMT@[116; 143) | 97 | WHITESPACE@[111; 116) "\n " |
98 | LET_KW@[116; 119) "let" | 98 | LET_STMT@[116; 143) |
99 | WHITESPACE@[119; 120) " " | 99 | LET_KW@[116; 119) "let" |
100 | BIND_PAT@[120; 137) | 100 | WHITESPACE@[119; 120) " " |
101 | REF_KW@[120; 123) "ref" | 101 | BIND_PAT@[120; 137) |
102 | WHITESPACE@[123; 124) " " | 102 | REF_KW@[120; 123) "ref" |
103 | MUT_KW@[124; 127) "mut" | 103 | WHITESPACE@[123; 124) " " |
104 | WHITESPACE@[127; 128) " " | 104 | MUT_KW@[124; 127) "mut" |
105 | NAME@[128; 129) | 105 | WHITESPACE@[127; 128) " " |
106 | IDENT@[128; 129) "f" | 106 | NAME@[128; 129) |
107 | WHITESPACE@[129; 130) " " | 107 | IDENT@[128; 129) "f" |
108 | AT@[130; 131) "@" | 108 | WHITESPACE@[129; 130) " " |
109 | WHITESPACE@[131; 132) " " | 109 | AT@[130; 131) "@" |
110 | BIND_PAT@[132; 137) | 110 | WHITESPACE@[131; 132) " " |
111 | NAME@[132; 133) | 111 | BIND_PAT@[132; 137) |
112 | IDENT@[132; 133) "g" | 112 | NAME@[132; 133) |
113 | WHITESPACE@[133; 134) " " | 113 | IDENT@[132; 133) "g" |
114 | AT@[134; 135) "@" | 114 | WHITESPACE@[133; 134) " " |
115 | WHITESPACE@[135; 136) " " | 115 | AT@[134; 135) "@" |
116 | PLACEHOLDER_PAT@[136; 137) | 116 | WHITESPACE@[135; 136) " " |
117 | UNDERSCORE@[136; 137) "_" | 117 | PLACEHOLDER_PAT@[136; 137) |
118 | WHITESPACE@[137; 138) " " | 118 | UNDERSCORE@[136; 137) "_" |
119 | EQ@[138; 139) "=" | 119 | WHITESPACE@[137; 138) " " |
120 | WHITESPACE@[139; 140) " " | 120 | EQ@[138; 139) "=" |
121 | TUPLE_EXPR@[140; 142) | 121 | WHITESPACE@[139; 140) " " |
122 | L_PAREN@[140; 141) "(" | 122 | TUPLE_EXPR@[140; 142) |
123 | R_PAREN@[141; 142) ")" | 123 | L_PAREN@[140; 141) "(" |
124 | SEMI@[142; 143) ";" | 124 | R_PAREN@[141; 142) ")" |
125 | WHITESPACE@[143; 144) "\n" | 125 | SEMI@[142; 143) ";" |
126 | R_CURLY@[144; 145) "}" | 126 | WHITESPACE@[143; 144) "\n" |
127 | R_CURLY@[144; 145) "}" | ||
127 | WHITESPACE@[145; 146) "\n" | 128 | WHITESPACE@[145; 146) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt index 601a5bae9..5db1ff2af 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.txt | |||
@@ -7,50 +7,51 @@ SOURCE_FILE@[0; 50) | |||
7 | PARAM_LIST@[6; 8) | 7 | PARAM_LIST@[6; 8) |
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | BLOCK@[8; 49) | 10 | BLOCK_EXPR@[8; 49) |
11 | L_CURLY@[8; 9) "{" | 11 | BLOCK@[8; 49) |
12 | WHITESPACE@[9; 14) "\n " | 12 | L_CURLY@[8; 9) "{" |
13 | SEMI@[14; 15) ";" | 13 | WHITESPACE@[9; 14) "\n " |
14 | SEMI@[15; 16) ";" | 14 | SEMI@[14; 15) ";" |
15 | SEMI@[16; 17) ";" | 15 | SEMI@[15; 16) ";" |
16 | EXPR_STMT@[17; 29) | 16 | SEMI@[16; 17) ";" |
17 | CALL_EXPR@[17; 28) | 17 | EXPR_STMT@[17; 29) |
18 | PATH_EXPR@[17; 26) | 18 | CALL_EXPR@[17; 28) |
19 | PATH@[17; 26) | 19 | PATH_EXPR@[17; 26) |
20 | PATH_SEGMENT@[17; 26) | 20 | PATH@[17; 26) |
21 | NAME_REF@[17; 26) | 21 | PATH_SEGMENT@[17; 26) |
22 | IDENT@[17; 26) "some_expr" | 22 | NAME_REF@[17; 26) |
23 | ARG_LIST@[26; 28) | 23 | IDENT@[17; 26) "some_expr" |
24 | L_PAREN@[26; 27) "(" | 24 | ARG_LIST@[26; 28) |
25 | R_PAREN@[27; 28) ")" | 25 | L_PAREN@[26; 27) "(" |
26 | SEMI@[28; 29) ";" | 26 | R_PAREN@[27; 28) ")" |
27 | SEMI@[29; 30) ";" | 27 | SEMI@[28; 29) ";" |
28 | SEMI@[30; 31) ";" | 28 | SEMI@[29; 30) ";" |
29 | SEMI@[31; 32) ";" | 29 | SEMI@[30; 31) ";" |
30 | EXPR_STMT@[32; 38) | 30 | SEMI@[31; 32) ";" |
31 | BLOCK_EXPR@[32; 37) | 31 | EXPR_STMT@[32; 38) |
32 | BLOCK@[32; 37) | 32 | BLOCK_EXPR@[32; 37) |
33 | L_CURLY@[32; 33) "{" | 33 | BLOCK@[32; 37) |
34 | SEMI@[33; 34) ";" | 34 | L_CURLY@[32; 33) "{" |
35 | SEMI@[34; 35) ";" | 35 | SEMI@[33; 34) ";" |
36 | SEMI@[35; 36) ";" | 36 | SEMI@[34; 35) ";" |
37 | R_CURLY@[36; 37) "}" | 37 | SEMI@[35; 36) ";" |
38 | SEMI@[37; 38) ";" | 38 | R_CURLY@[36; 37) "}" |
39 | SEMI@[38; 39) ";" | 39 | SEMI@[37; 38) ";" |
40 | SEMI@[39; 40) ";" | 40 | SEMI@[38; 39) ";" |
41 | SEMI@[40; 41) ";" | 41 | SEMI@[39; 40) ";" |
42 | CALL_EXPR@[41; 47) | 42 | SEMI@[40; 41) ";" |
43 | PATH_EXPR@[41; 43) | 43 | CALL_EXPR@[41; 47) |
44 | PATH@[41; 43) | 44 | PATH_EXPR@[41; 43) |
45 | PATH_SEGMENT@[41; 43) | 45 | PATH@[41; 43) |
46 | NAME_REF@[41; 43) | 46 | PATH_SEGMENT@[41; 43) |
47 | IDENT@[41; 43) "Ok" | 47 | NAME_REF@[41; 43) |
48 | ARG_LIST@[43; 47) | 48 | IDENT@[41; 43) "Ok" |
49 | L_PAREN@[43; 44) "(" | 49 | ARG_LIST@[43; 47) |
50 | TUPLE_EXPR@[44; 46) | 50 | L_PAREN@[43; 44) "(" |
51 | L_PAREN@[44; 45) "(" | 51 | TUPLE_EXPR@[44; 46) |
52 | R_PAREN@[45; 46) ")" | 52 | L_PAREN@[44; 45) "(" |
53 | R_PAREN@[46; 47) ")" | 53 | R_PAREN@[45; 46) ")" |
54 | WHITESPACE@[47; 48) "\n" | 54 | R_PAREN@[46; 47) ")" |
55 | R_CURLY@[48; 49) "}" | 55 | WHITESPACE@[47; 48) "\n" |
56 | R_CURLY@[48; 49) "}" | ||
56 | WHITESPACE@[49; 50) "\n" | 57 | WHITESPACE@[49; 50) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt index d53e10e86..852e4e489 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.txt | |||
@@ -8,40 +8,41 @@ SOURCE_FILE@[0; 58) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 57) | 11 | BLOCK_EXPR@[9; 57) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 57) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | MATCH_EXPR@[15; 55) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_KW@[15; 20) "match" | 15 | MATCH_EXPR@[15; 55) |
16 | WHITESPACE@[20; 21) " " | 16 | MATCH_KW@[15; 20) "match" |
17 | TUPLE_EXPR@[21; 23) | 17 | WHITESPACE@[20; 21) " " |
18 | L_PAREN@[21; 22) "(" | 18 | TUPLE_EXPR@[21; 23) |
19 | R_PAREN@[22; 23) ")" | 19 | L_PAREN@[21; 22) "(" |
20 | WHITESPACE@[23; 24) " " | 20 | R_PAREN@[22; 23) ")" |
21 | MATCH_ARM_LIST@[24; 55) | 21 | WHITESPACE@[23; 24) " " |
22 | L_CURLY@[24; 25) "{" | 22 | MATCH_ARM_LIST@[24; 55) |
23 | WHITESPACE@[25; 34) "\n " | 23 | L_CURLY@[24; 25) "{" |
24 | MATCH_ARM@[34; 48) | 24 | WHITESPACE@[25; 34) "\n " |
25 | PLACEHOLDER_PAT@[34; 35) | 25 | MATCH_ARM@[34; 48) |
26 | UNDERSCORE@[34; 35) "_" | 26 | PLACEHOLDER_PAT@[34; 35) |
27 | WHITESPACE@[35; 36) " " | 27 | UNDERSCORE@[34; 35) "_" |
28 | MATCH_GUARD@[36; 42) | 28 | WHITESPACE@[35; 36) " " |
29 | IF_KW@[36; 38) "if" | 29 | MATCH_GUARD@[36; 42) |
30 | WHITESPACE@[38; 39) " " | 30 | IF_KW@[36; 38) "if" |
31 | PATH_EXPR@[39; 42) | 31 | WHITESPACE@[38; 39) " " |
32 | PATH@[39; 42) | 32 | PATH_EXPR@[39; 42) |
33 | PATH_SEGMENT@[39; 42) | 33 | PATH@[39; 42) |
34 | NAME_REF@[39; 42) | 34 | PATH_SEGMENT@[39; 42) |
35 | IDENT@[39; 42) "foo" | 35 | NAME_REF@[39; 42) |
36 | WHITESPACE@[42; 43) " " | 36 | IDENT@[39; 42) "foo" |
37 | FAT_ARROW@[43; 45) "=>" | 37 | WHITESPACE@[42; 43) " " |
38 | WHITESPACE@[45; 46) " " | 38 | FAT_ARROW@[43; 45) "=>" |
39 | TUPLE_EXPR@[46; 48) | 39 | WHITESPACE@[45; 46) " " |
40 | L_PAREN@[46; 47) "(" | 40 | TUPLE_EXPR@[46; 48) |
41 | R_PAREN@[47; 48) ")" | 41 | L_PAREN@[46; 47) "(" |
42 | COMMA@[48; 49) "," | 42 | R_PAREN@[47; 48) ")" |
43 | WHITESPACE@[49; 54) "\n " | 43 | COMMA@[48; 49) "," |
44 | R_CURLY@[54; 55) "}" | 44 | WHITESPACE@[49; 54) "\n " |
45 | WHITESPACE@[55; 56) "\n" | 45 | R_CURLY@[54; 55) "}" |
46 | R_CURLY@[56; 57) "}" | 46 | WHITESPACE@[55; 56) "\n" |
47 | R_CURLY@[56; 57) "}" | ||
47 | WHITESPACE@[57; 58) "\n" | 48 | WHITESPACE@[57; 58) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt index 17c296327..3bbeb62bc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.txt | |||
@@ -8,67 +8,68 @@ SOURCE_FILE@[0; 139) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 138) | 11 | BLOCK_EXPR@[9; 138) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 138) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | MATCH_EXPR@[15; 136) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_KW@[15; 20) "match" | 15 | MATCH_EXPR@[15; 136) |
16 | WHITESPACE@[20; 21) " " | 16 | MATCH_KW@[15; 20) "match" |
17 | TUPLE_EXPR@[21; 23) | 17 | WHITESPACE@[20; 21) " " |
18 | L_PAREN@[21; 22) "(" | 18 | TUPLE_EXPR@[21; 23) |
19 | R_PAREN@[22; 23) ")" | 19 | L_PAREN@[21; 22) "(" |
20 | WHITESPACE@[23; 24) " " | 20 | R_PAREN@[22; 23) ")" |
21 | MATCH_ARM_LIST@[24; 136) | 21 | WHITESPACE@[23; 24) " " |
22 | L_CURLY@[24; 25) "{" | 22 | MATCH_ARM_LIST@[24; 136) |
23 | WHITESPACE@[25; 34) "\n " | 23 | L_CURLY@[24; 25) "{" |
24 | ATTR@[34; 60) | 24 | WHITESPACE@[25; 34) "\n " |
25 | POUND@[34; 35) "#" | 25 | ATTR@[34; 60) |
26 | EXCL@[35; 36) "!" | 26 | POUND@[34; 35) "#" |
27 | TOKEN_TREE@[36; 60) | 27 | EXCL@[35; 36) "!" |
28 | L_BRACK@[36; 37) "[" | 28 | TOKEN_TREE@[36; 60) |
29 | IDENT@[37; 40) "doc" | 29 | L_BRACK@[36; 37) "[" |
30 | TOKEN_TREE@[40; 59) | 30 | IDENT@[37; 40) "doc" |
31 | L_PAREN@[40; 41) "(" | 31 | TOKEN_TREE@[40; 59) |
32 | STRING@[41; 58) "\"Inner attribute\"" | 32 | L_PAREN@[40; 41) "(" |
33 | R_PAREN@[58; 59) ")" | 33 | STRING@[41; 58) "\"Inner attribute\"" |
34 | R_BRACK@[59; 60) "]" | 34 | R_PAREN@[58; 59) ")" |
35 | WHITESPACE@[60; 69) "\n " | 35 | R_BRACK@[59; 60) "]" |
36 | ATTR@[69; 86) | 36 | WHITESPACE@[60; 69) "\n " |
37 | POUND@[69; 70) "#" | 37 | ATTR@[69; 86) |
38 | EXCL@[70; 71) "!" | 38 | POUND@[69; 70) "#" |
39 | TOKEN_TREE@[71; 86) | 39 | EXCL@[70; 71) "!" |
40 | L_BRACK@[71; 72) "[" | 40 | TOKEN_TREE@[71; 86) |
41 | IDENT@[72; 75) "doc" | 41 | L_BRACK@[71; 72) "[" |
42 | TOKEN_TREE@[75; 85) | 42 | IDENT@[72; 75) "doc" |
43 | L_PAREN@[75; 76) "(" | 43 | TOKEN_TREE@[75; 85) |
44 | STRING@[76; 84) "\"Can be\"" | 44 | L_PAREN@[75; 76) "(" |
45 | R_PAREN@[84; 85) ")" | 45 | STRING@[76; 84) "\"Can be\"" |
46 | R_BRACK@[85; 86) "]" | 46 | R_PAREN@[84; 85) ")" |
47 | WHITESPACE@[86; 95) "\n " | 47 | R_BRACK@[85; 86) "]" |
48 | ATTR@[95; 113) | 48 | WHITESPACE@[86; 95) "\n " |
49 | POUND@[95; 96) "#" | 49 | ATTR@[95; 113) |
50 | EXCL@[96; 97) "!" | 50 | POUND@[95; 96) "#" |
51 | TOKEN_TREE@[97; 113) | 51 | EXCL@[96; 97) "!" |
52 | L_BRACK@[97; 98) "[" | 52 | TOKEN_TREE@[97; 113) |
53 | IDENT@[98; 101) "doc" | 53 | L_BRACK@[97; 98) "[" |
54 | TOKEN_TREE@[101; 112) | 54 | IDENT@[98; 101) "doc" |
55 | L_PAREN@[101; 102) "(" | 55 | TOKEN_TREE@[101; 112) |
56 | STRING@[102; 111) "\"Stacked\"" | 56 | L_PAREN@[101; 102) "(" |
57 | R_PAREN@[111; 112) ")" | 57 | STRING@[102; 111) "\"Stacked\"" |
58 | R_BRACK@[112; 113) "]" | 58 | R_PAREN@[111; 112) ")" |
59 | WHITESPACE@[113; 122) "\n " | 59 | R_BRACK@[112; 113) "]" |
60 | MATCH_ARM@[122; 129) | 60 | WHITESPACE@[113; 122) "\n " |
61 | PLACEHOLDER_PAT@[122; 123) | 61 | MATCH_ARM@[122; 129) |
62 | UNDERSCORE@[122; 123) "_" | 62 | PLACEHOLDER_PAT@[122; 123) |
63 | WHITESPACE@[123; 124) " " | 63 | UNDERSCORE@[122; 123) "_" |
64 | FAT_ARROW@[124; 126) "=>" | 64 | WHITESPACE@[123; 124) " " |
65 | WHITESPACE@[126; 127) " " | 65 | FAT_ARROW@[124; 126) "=>" |
66 | TUPLE_EXPR@[127; 129) | 66 | WHITESPACE@[126; 127) " " |
67 | L_PAREN@[127; 128) "(" | 67 | TUPLE_EXPR@[127; 129) |
68 | R_PAREN@[128; 129) ")" | 68 | L_PAREN@[127; 128) "(" |
69 | COMMA@[129; 130) "," | 69 | R_PAREN@[128; 129) ")" |
70 | WHITESPACE@[130; 135) "\n " | 70 | COMMA@[129; 130) "," |
71 | R_CURLY@[135; 136) "}" | 71 | WHITESPACE@[130; 135) "\n " |
72 | WHITESPACE@[136; 137) "\n" | 72 | R_CURLY@[135; 136) "}" |
73 | R_CURLY@[137; 138) "}" | 73 | WHITESPACE@[136; 137) "\n" |
74 | R_CURLY@[137; 138) "}" | ||
74 | WHITESPACE@[138; 139) "\n" | 75 | WHITESPACE@[138; 139) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt index 9c238e869..5fd0adfc2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.txt | |||
@@ -8,128 +8,129 @@ SOURCE_FILE@[0; 259) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 258) | 11 | BLOCK_EXPR@[9; 258) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 258) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | MATCH_EXPR@[15; 256) | 14 | WHITESPACE@[10; 15) "\n " |
15 | MATCH_KW@[15; 20) "match" | 15 | MATCH_EXPR@[15; 256) |
16 | WHITESPACE@[20; 21) " " | 16 | MATCH_KW@[15; 20) "match" |
17 | TUPLE_EXPR@[21; 23) | 17 | WHITESPACE@[20; 21) " " |
18 | L_PAREN@[21; 22) "(" | 18 | TUPLE_EXPR@[21; 23) |
19 | R_PAREN@[22; 23) ")" | 19 | L_PAREN@[21; 22) "(" |
20 | WHITESPACE@[23; 24) " " | 20 | R_PAREN@[22; 23) ")" |
21 | MATCH_ARM_LIST@[24; 256) | 21 | WHITESPACE@[23; 24) " " |
22 | L_CURLY@[24; 25) "{" | 22 | MATCH_ARM_LIST@[24; 256) |
23 | WHITESPACE@[25; 34) "\n " | 23 | L_CURLY@[24; 25) "{" |
24 | MATCH_ARM@[34; 74) | 24 | WHITESPACE@[25; 34) "\n " |
25 | ATTR@[34; 58) | 25 | MATCH_ARM@[34; 74) |
26 | POUND@[34; 35) "#" | 26 | ATTR@[34; 58) |
27 | TOKEN_TREE@[35; 58) | 27 | POUND@[34; 35) "#" |
28 | L_BRACK@[35; 36) "[" | 28 | TOKEN_TREE@[35; 58) |
29 | IDENT@[36; 39) "cfg" | 29 | L_BRACK@[35; 36) "[" |
30 | TOKEN_TREE@[39; 57) | 30 | IDENT@[36; 39) "cfg" |
31 | L_PAREN@[39; 40) "(" | 31 | TOKEN_TREE@[39; 57) |
32 | IDENT@[40; 47) "feature" | 32 | L_PAREN@[39; 40) "(" |
33 | WHITESPACE@[47; 48) " " | 33 | IDENT@[40; 47) "feature" |
34 | EQ@[48; 49) "=" | 34 | WHITESPACE@[47; 48) " " |
35 | WHITESPACE@[49; 50) " " | 35 | EQ@[48; 49) "=" |
36 | STRING@[50; 56) "\"some\"" | 36 | WHITESPACE@[49; 50) " " |
37 | R_PAREN@[56; 57) ")" | 37 | STRING@[50; 56) "\"some\"" |
38 | R_BRACK@[57; 58) "]" | 38 | R_PAREN@[56; 57) ")" |
39 | WHITESPACE@[58; 67) "\n " | 39 | R_BRACK@[57; 58) "]" |
40 | PLACEHOLDER_PAT@[67; 68) | 40 | WHITESPACE@[58; 67) "\n " |
41 | UNDERSCORE@[67; 68) "_" | 41 | PLACEHOLDER_PAT@[67; 68) |
42 | WHITESPACE@[68; 69) " " | 42 | UNDERSCORE@[67; 68) "_" |
43 | FAT_ARROW@[69; 71) "=>" | 43 | WHITESPACE@[68; 69) " " |
44 | WHITESPACE@[71; 72) " " | 44 | FAT_ARROW@[69; 71) "=>" |
45 | TUPLE_EXPR@[72; 74) | 45 | WHITESPACE@[71; 72) " " |
46 | L_PAREN@[72; 73) "(" | 46 | TUPLE_EXPR@[72; 74) |
47 | R_PAREN@[73; 74) ")" | 47 | L_PAREN@[72; 73) "(" |
48 | COMMA@[74; 75) "," | 48 | R_PAREN@[73; 74) ")" |
49 | WHITESPACE@[75; 84) "\n " | 49 | COMMA@[74; 75) "," |
50 | MATCH_ARM@[84; 125) | 50 | WHITESPACE@[75; 84) "\n " |
51 | ATTR@[84; 109) | 51 | MATCH_ARM@[84; 125) |
52 | POUND@[84; 85) "#" | 52 | ATTR@[84; 109) |
53 | TOKEN_TREE@[85; 109) | 53 | POUND@[84; 85) "#" |
54 | L_BRACK@[85; 86) "[" | 54 | TOKEN_TREE@[85; 109) |
55 | IDENT@[86; 89) "cfg" | 55 | L_BRACK@[85; 86) "[" |
56 | TOKEN_TREE@[89; 108) | 56 | IDENT@[86; 89) "cfg" |
57 | L_PAREN@[89; 90) "(" | 57 | TOKEN_TREE@[89; 108) |
58 | IDENT@[90; 97) "feature" | 58 | L_PAREN@[89; 90) "(" |
59 | WHITESPACE@[97; 98) " " | 59 | IDENT@[90; 97) "feature" |
60 | EQ@[98; 99) "=" | 60 | WHITESPACE@[97; 98) " " |
61 | WHITESPACE@[99; 100) " " | 61 | EQ@[98; 99) "=" |
62 | STRING@[100; 107) "\"other\"" | 62 | WHITESPACE@[99; 100) " " |
63 | R_PAREN@[107; 108) ")" | 63 | STRING@[100; 107) "\"other\"" |
64 | R_BRACK@[108; 109) "]" | 64 | R_PAREN@[107; 108) ")" |
65 | WHITESPACE@[109; 118) "\n " | 65 | R_BRACK@[108; 109) "]" |
66 | PLACEHOLDER_PAT@[118; 119) | 66 | WHITESPACE@[109; 118) "\n " |
67 | UNDERSCORE@[118; 119) "_" | 67 | PLACEHOLDER_PAT@[118; 119) |
68 | WHITESPACE@[119; 120) " " | 68 | UNDERSCORE@[118; 119) "_" |
69 | FAT_ARROW@[120; 122) "=>" | 69 | WHITESPACE@[119; 120) " " |
70 | WHITESPACE@[122; 123) " " | 70 | FAT_ARROW@[120; 122) "=>" |
71 | TUPLE_EXPR@[123; 125) | 71 | WHITESPACE@[122; 123) " " |
72 | L_PAREN@[123; 124) "(" | 72 | TUPLE_EXPR@[123; 125) |
73 | R_PAREN@[124; 125) ")" | 73 | L_PAREN@[123; 124) "(" |
74 | COMMA@[125; 126) "," | 74 | R_PAREN@[124; 125) ")" |
75 | WHITESPACE@[126; 135) "\n " | 75 | COMMA@[125; 126) "," |
76 | MATCH_ARM@[135; 249) | 76 | WHITESPACE@[126; 135) "\n " |
77 | ATTR@[135; 159) | 77 | MATCH_ARM@[135; 249) |
78 | POUND@[135; 136) "#" | 78 | ATTR@[135; 159) |
79 | TOKEN_TREE@[136; 159) | 79 | POUND@[135; 136) "#" |
80 | L_BRACK@[136; 137) "[" | 80 | TOKEN_TREE@[136; 159) |
81 | IDENT@[137; 140) "cfg" | 81 | L_BRACK@[136; 137) "[" |
82 | TOKEN_TREE@[140; 158) | 82 | IDENT@[137; 140) "cfg" |
83 | L_PAREN@[140; 141) "(" | 83 | TOKEN_TREE@[140; 158) |
84 | IDENT@[141; 148) "feature" | 84 | L_PAREN@[140; 141) "(" |
85 | WHITESPACE@[148; 149) " " | 85 | IDENT@[141; 148) "feature" |
86 | EQ@[149; 150) "=" | 86 | WHITESPACE@[148; 149) " " |
87 | WHITESPACE@[150; 151) " " | 87 | EQ@[149; 150) "=" |
88 | STRING@[151; 157) "\"many\"" | 88 | WHITESPACE@[150; 151) " " |
89 | R_PAREN@[157; 158) ")" | 89 | STRING@[151; 157) "\"many\"" |
90 | R_BRACK@[158; 159) "]" | 90 | R_PAREN@[157; 158) ")" |
91 | WHITESPACE@[159; 168) "\n " | 91 | R_BRACK@[158; 159) "]" |
92 | ATTR@[168; 198) | 92 | WHITESPACE@[159; 168) "\n " |
93 | POUND@[168; 169) "#" | 93 | ATTR@[168; 198) |
94 | TOKEN_TREE@[169; 198) | 94 | POUND@[168; 169) "#" |
95 | L_BRACK@[169; 170) "[" | 95 | TOKEN_TREE@[169; 198) |
96 | IDENT@[170; 173) "cfg" | 96 | L_BRACK@[169; 170) "[" |
97 | TOKEN_TREE@[173; 197) | 97 | IDENT@[170; 173) "cfg" |
98 | L_PAREN@[173; 174) "(" | 98 | TOKEN_TREE@[173; 197) |
99 | IDENT@[174; 181) "feature" | 99 | L_PAREN@[173; 174) "(" |
100 | WHITESPACE@[181; 182) " " | 100 | IDENT@[174; 181) "feature" |
101 | EQ@[182; 183) "=" | 101 | WHITESPACE@[181; 182) " " |
102 | WHITESPACE@[183; 184) " " | 102 | EQ@[182; 183) "=" |
103 | STRING@[184; 196) "\"attributes\"" | 103 | WHITESPACE@[183; 184) " " |
104 | R_PAREN@[196; 197) ")" | 104 | STRING@[184; 196) "\"attributes\"" |
105 | R_BRACK@[197; 198) "]" | 105 | R_PAREN@[196; 197) ")" |
106 | WHITESPACE@[198; 207) "\n " | 106 | R_BRACK@[197; 198) "]" |
107 | ATTR@[207; 233) | 107 | WHITESPACE@[198; 207) "\n " |
108 | POUND@[207; 208) "#" | 108 | ATTR@[207; 233) |
109 | TOKEN_TREE@[208; 233) | 109 | POUND@[207; 208) "#" |
110 | L_BRACK@[208; 209) "[" | 110 | TOKEN_TREE@[208; 233) |
111 | IDENT@[209; 212) "cfg" | 111 | L_BRACK@[208; 209) "[" |
112 | TOKEN_TREE@[212; 232) | 112 | IDENT@[209; 212) "cfg" |
113 | L_PAREN@[212; 213) "(" | 113 | TOKEN_TREE@[212; 232) |
114 | IDENT@[213; 220) "feature" | 114 | L_PAREN@[212; 213) "(" |
115 | WHITESPACE@[220; 221) " " | 115 | IDENT@[213; 220) "feature" |
116 | EQ@[221; 222) "=" | 116 | WHITESPACE@[220; 221) " " |
117 | WHITESPACE@[222; 223) " " | 117 | EQ@[221; 222) "=" |
118 | STRING@[223; 231) "\"before\"" | 118 | WHITESPACE@[222; 223) " " |
119 | R_PAREN@[231; 232) ")" | 119 | STRING@[223; 231) "\"before\"" |
120 | R_BRACK@[232; 233) "]" | 120 | R_PAREN@[231; 232) ")" |
121 | WHITESPACE@[233; 242) "\n " | 121 | R_BRACK@[232; 233) "]" |
122 | PLACEHOLDER_PAT@[242; 243) | 122 | WHITESPACE@[233; 242) "\n " |
123 | UNDERSCORE@[242; 243) "_" | 123 | PLACEHOLDER_PAT@[242; 243) |
124 | WHITESPACE@[243; 244) " " | 124 | UNDERSCORE@[242; 243) "_" |
125 | FAT_ARROW@[244; 246) "=>" | 125 | WHITESPACE@[243; 244) " " |
126 | WHITESPACE@[246; 247) " " | 126 | FAT_ARROW@[244; 246) "=>" |
127 | TUPLE_EXPR@[247; 249) | 127 | WHITESPACE@[246; 247) " " |
128 | L_PAREN@[247; 248) "(" | 128 | TUPLE_EXPR@[247; 249) |
129 | R_PAREN@[248; 249) ")" | 129 | L_PAREN@[247; 248) "(" |
130 | COMMA@[249; 250) "," | 130 | R_PAREN@[248; 249) ")" |
131 | WHITESPACE@[250; 255) "\n " | 131 | COMMA@[249; 250) "," |
132 | R_CURLY@[255; 256) "}" | 132 | WHITESPACE@[250; 255) "\n " |
133 | WHITESPACE@[256; 257) "\n" | 133 | R_CURLY@[255; 256) "}" |
134 | R_CURLY@[257; 258) "}" | 134 | WHITESPACE@[256; 257) "\n" |
135 | R_CURLY@[257; 258) "}" | ||
135 | WHITESPACE@[258; 259) "\n" | 136 | WHITESPACE@[258; 259) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt index a45995236..bc7b68b90 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.txt | |||
@@ -54,8 +54,9 @@ SOURCE_FILE@[0; 64) | |||
54 | IDENT@[57; 58) "T" | 54 | IDENT@[57; 58) "T" |
55 | R_PAREN@[58; 59) ")" | 55 | R_PAREN@[58; 59) ")" |
56 | WHITESPACE@[59; 60) " " | 56 | WHITESPACE@[59; 60) " " |
57 | BLOCK@[60; 63) | 57 | BLOCK_EXPR@[60; 63) |
58 | L_CURLY@[60; 61) "{" | 58 | BLOCK@[60; 63) |
59 | WHITESPACE@[61; 62) "\n" | 59 | L_CURLY@[60; 61) "{" |
60 | R_CURLY@[62; 63) "}" | 60 | WHITESPACE@[61; 62) "\n" |
61 | R_CURLY@[62; 63) "}" | ||
61 | WHITESPACE@[63; 64) "\n" | 62 | WHITESPACE@[63; 64) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt index f0610e781..9c4bd7f11 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.txt | |||
@@ -10,7 +10,8 @@ SOURCE_FILE@[0; 18) | |||
10 | L_PAREN@[12; 13) "(" | 10 | L_PAREN@[12; 13) "(" |
11 | R_PAREN@[13; 14) ")" | 11 | R_PAREN@[13; 14) ")" |
12 | WHITESPACE@[14; 15) " " | 12 | WHITESPACE@[14; 15) " " |
13 | BLOCK@[15; 17) | 13 | BLOCK_EXPR@[15; 17) |
14 | L_CURLY@[15; 16) "{" | 14 | BLOCK@[15; 17) |
15 | R_CURLY@[16; 17) "}" | 15 | L_CURLY@[15; 16) "{" |
16 | R_CURLY@[16; 17) "}" | ||
16 | WHITESPACE@[17; 18) "\n" | 17 | WHITESPACE@[17; 18) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt index 4afe9c555..6a9f3bf72 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.txt | |||
@@ -8,24 +8,25 @@ SOURCE_FILE@[0; 27) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 26) | 11 | BLOCK_EXPR@[9; 26) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 26) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[11; 24) | 14 | WHITESPACE@[10; 11) " " |
15 | CALL_EXPR@[11; 23) | 15 | EXPR_STMT@[11; 24) |
16 | PATH_EXPR@[11; 21) | 16 | CALL_EXPR@[11; 23) |
17 | PATH@[11; 21) | 17 | PATH_EXPR@[11; 21) |
18 | PATH@[11; 16) | 18 | PATH@[11; 21) |
19 | PATH_SEGMENT@[11; 16) | 19 | PATH@[11; 16) |
20 | CRATE_KW@[11; 16) "crate" | 20 | PATH_SEGMENT@[11; 16) |
21 | COLONCOLON@[16; 18) "::" | 21 | CRATE_KW@[11; 16) "crate" |
22 | PATH_SEGMENT@[18; 21) | 22 | COLONCOLON@[16; 18) "::" |
23 | NAME_REF@[18; 21) | 23 | PATH_SEGMENT@[18; 21) |
24 | IDENT@[18; 21) "foo" | 24 | NAME_REF@[18; 21) |
25 | ARG_LIST@[21; 23) | 25 | IDENT@[18; 21) "foo" |
26 | L_PAREN@[21; 22) "(" | 26 | ARG_LIST@[21; 23) |
27 | R_PAREN@[22; 23) ")" | 27 | L_PAREN@[21; 22) "(" |
28 | SEMI@[23; 24) ";" | 28 | R_PAREN@[22; 23) ")" |
29 | WHITESPACE@[24; 25) " " | 29 | SEMI@[23; 24) ";" |
30 | R_CURLY@[25; 26) "}" | 30 | WHITESPACE@[24; 25) " " |
31 | R_CURLY@[25; 26) "}" | ||
31 | WHITESPACE@[26; 27) "\n" | 32 | WHITESPACE@[26; 27) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt index 8fdf3756f..37cc438d9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.txt | |||
@@ -8,38 +8,39 @@ SOURCE_FILE@[0; 46) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 45) | 11 | BLOCK_EXPR@[10; 45) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 45) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | RECORD_LIT@[16; 43) | 14 | WHITESPACE@[11; 16) "\n " |
15 | PATH@[16; 17) | 15 | RECORD_LIT@[16; 43) |
16 | PATH_SEGMENT@[16; 17) | 16 | PATH@[16; 17) |
17 | NAME_REF@[16; 17) | 17 | PATH_SEGMENT@[16; 17) |
18 | IDENT@[16; 17) "S" | 18 | NAME_REF@[16; 17) |
19 | WHITESPACE@[17; 18) " " | 19 | IDENT@[16; 17) "S" |
20 | RECORD_FIELD_LIST@[18; 43) | 20 | WHITESPACE@[17; 18) " " |
21 | L_CURLY@[18; 19) "{" | 21 | RECORD_FIELD_LIST@[18; 43) |
22 | WHITESPACE@[19; 20) " " | 22 | L_CURLY@[18; 19) "{" |
23 | RECORD_FIELD@[20; 41) | 23 | WHITESPACE@[19; 20) " " |
24 | ATTR@[20; 32) | 24 | RECORD_FIELD@[20; 41) |
25 | POUND@[20; 21) "#" | 25 | ATTR@[20; 32) |
26 | TOKEN_TREE@[21; 32) | 26 | POUND@[20; 21) "#" |
27 | L_BRACK@[21; 22) "[" | 27 | TOKEN_TREE@[21; 32) |
28 | IDENT@[22; 25) "cfg" | 28 | L_BRACK@[21; 22) "[" |
29 | TOKEN_TREE@[25; 31) | 29 | IDENT@[22; 25) "cfg" |
30 | L_PAREN@[25; 26) "(" | 30 | TOKEN_TREE@[25; 31) |
31 | IDENT@[26; 30) "test" | 31 | L_PAREN@[25; 26) "(" |
32 | R_PAREN@[30; 31) ")" | 32 | IDENT@[26; 30) "test" |
33 | R_BRACK@[31; 32) "]" | 33 | R_PAREN@[30; 31) ")" |
34 | WHITESPACE@[32; 33) " " | 34 | R_BRACK@[31; 32) "]" |
35 | NAME_REF@[33; 38) | 35 | WHITESPACE@[32; 33) " " |
36 | IDENT@[33; 38) "field" | 36 | NAME_REF@[33; 38) |
37 | COLON@[38; 39) ":" | 37 | IDENT@[33; 38) "field" |
38 | WHITESPACE@[39; 40) " " | 38 | COLON@[38; 39) ":" |
39 | LITERAL@[40; 41) | 39 | WHITESPACE@[39; 40) " " |
40 | INT_NUMBER@[40; 41) "1" | 40 | LITERAL@[40; 41) |
41 | WHITESPACE@[41; 42) " " | 41 | INT_NUMBER@[40; 41) "1" |
42 | R_CURLY@[42; 43) "}" | 42 | WHITESPACE@[41; 42) " " |
43 | WHITESPACE@[43; 44) "\n" | 43 | R_CURLY@[42; 43) "}" |
44 | R_CURLY@[44; 45) "}" | 44 | WHITESPACE@[43; 44) "\n" |
45 | R_CURLY@[44; 45) "}" | ||
45 | WHITESPACE@[45; 46) "\n" | 46 | WHITESPACE@[45; 46) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt index c15c7573a..6bc0db077 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.txt | |||
@@ -8,81 +8,82 @@ SOURCE_FILE@[0; 82) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 81) | 11 | BLOCK_EXPR@[9; 81) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 81) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 26) | 14 | WHITESPACE@[10; 15) "\n " |
15 | ATTR@[15; 19) | 15 | EXPR_STMT@[15; 26) |
16 | POUND@[15; 16) "#" | 16 | ATTR@[15; 19) |
17 | TOKEN_TREE@[16; 19) | 17 | POUND@[15; 16) "#" |
18 | L_BRACK@[16; 17) "[" | 18 | TOKEN_TREE@[16; 19) |
19 | IDENT@[17; 18) "A" | 19 | L_BRACK@[16; 17) "[" |
20 | R_BRACK@[18; 19) "]" | 20 | IDENT@[17; 18) "A" |
21 | WHITESPACE@[19; 20) " " | 21 | R_BRACK@[18; 19) "]" |
22 | CALL_EXPR@[20; 25) | 22 | WHITESPACE@[19; 20) " " |
23 | PATH_EXPR@[20; 23) | 23 | CALL_EXPR@[20; 25) |
24 | PATH@[20; 23) | 24 | PATH_EXPR@[20; 23) |
25 | PATH_SEGMENT@[20; 23) | 25 | PATH@[20; 23) |
26 | NAME_REF@[20; 23) | 26 | PATH_SEGMENT@[20; 23) |
27 | IDENT@[20; 23) "foo" | 27 | NAME_REF@[20; 23) |
28 | ARG_LIST@[23; 25) | 28 | IDENT@[20; 23) "foo" |
29 | L_PAREN@[23; 24) "(" | 29 | ARG_LIST@[23; 25) |
30 | R_PAREN@[24; 25) ")" | 30 | L_PAREN@[23; 24) "(" |
31 | SEMI@[25; 26) ";" | 31 | R_PAREN@[24; 25) ")" |
32 | WHITESPACE@[26; 31) "\n " | 32 | SEMI@[25; 26) ";" |
33 | EXPR_STMT@[31; 42) | 33 | WHITESPACE@[26; 31) "\n " |
34 | ATTR@[31; 35) | 34 | EXPR_STMT@[31; 42) |
35 | POUND@[31; 32) "#" | 35 | ATTR@[31; 35) |
36 | TOKEN_TREE@[32; 35) | 36 | POUND@[31; 32) "#" |
37 | L_BRACK@[32; 33) "[" | 37 | TOKEN_TREE@[32; 35) |
38 | IDENT@[33; 34) "B" | 38 | L_BRACK@[32; 33) "[" |
39 | R_BRACK@[34; 35) "]" | 39 | IDENT@[33; 34) "B" |
40 | WHITESPACE@[35; 36) " " | 40 | R_BRACK@[34; 35) "]" |
41 | MACRO_CALL@[36; 42) | 41 | WHITESPACE@[35; 36) " " |
42 | PATH@[36; 39) | 42 | MACRO_CALL@[36; 42) |
43 | PATH_SEGMENT@[36; 39) | 43 | PATH@[36; 39) |
44 | NAME_REF@[36; 39) | 44 | PATH_SEGMENT@[36; 39) |
45 | IDENT@[36; 39) "bar" | 45 | NAME_REF@[36; 39) |
46 | EXCL@[39; 40) "!" | 46 | IDENT@[36; 39) "bar" |
47 | TOKEN_TREE@[40; 42) | 47 | EXCL@[39; 40) "!" |
48 | L_CURLY@[40; 41) "{" | 48 | TOKEN_TREE@[40; 42) |
49 | R_CURLY@[41; 42) "}" | 49 | L_CURLY@[40; 41) "{" |
50 | WHITESPACE@[42; 47) "\n " | 50 | R_CURLY@[41; 42) "}" |
51 | EXPR_STMT@[47; 59) | 51 | WHITESPACE@[42; 47) "\n " |
52 | ATTR@[47; 51) | 52 | EXPR_STMT@[47; 59) |
53 | POUND@[47; 48) "#" | 53 | ATTR@[47; 51) |
54 | TOKEN_TREE@[48; 51) | 54 | POUND@[47; 48) "#" |
55 | L_BRACK@[48; 49) "[" | 55 | TOKEN_TREE@[48; 51) |
56 | IDENT@[49; 50) "C" | 56 | L_BRACK@[48; 49) "[" |
57 | R_BRACK@[50; 51) "]" | 57 | IDENT@[49; 50) "C" |
58 | WHITESPACE@[51; 52) " " | 58 | R_BRACK@[50; 51) "]" |
59 | ATTR@[52; 56) | 59 | WHITESPACE@[51; 52) " " |
60 | POUND@[52; 53) "#" | 60 | ATTR@[52; 56) |
61 | TOKEN_TREE@[53; 56) | 61 | POUND@[52; 53) "#" |
62 | L_BRACK@[53; 54) "[" | 62 | TOKEN_TREE@[53; 56) |
63 | IDENT@[54; 55) "D" | 63 | L_BRACK@[53; 54) "[" |
64 | R_BRACK@[55; 56) "]" | 64 | IDENT@[54; 55) "D" |
65 | WHITESPACE@[56; 57) " " | 65 | R_BRACK@[55; 56) "]" |
66 | BLOCK_EXPR@[57; 59) | 66 | WHITESPACE@[56; 57) " " |
67 | BLOCK@[57; 59) | 67 | BLOCK_EXPR@[57; 59) |
68 | L_CURLY@[57; 58) "{" | 68 | BLOCK@[57; 59) |
69 | R_CURLY@[58; 59) "}" | 69 | L_CURLY@[57; 58) "{" |
70 | WHITESPACE@[59; 64) "\n " | 70 | R_CURLY@[58; 59) "}" |
71 | EXPR_STMT@[64; 79) | 71 | WHITESPACE@[59; 64) "\n " |
72 | ATTR@[64; 68) | 72 | EXPR_STMT@[64; 79) |
73 | POUND@[64; 65) "#" | 73 | ATTR@[64; 68) |
74 | TOKEN_TREE@[65; 68) | 74 | POUND@[64; 65) "#" |
75 | L_BRACK@[65; 66) "[" | 75 | TOKEN_TREE@[65; 68) |
76 | IDENT@[66; 67) "D" | 76 | L_BRACK@[65; 66) "[" |
77 | R_BRACK@[67; 68) "]" | 77 | IDENT@[66; 67) "D" |
78 | WHITESPACE@[68; 69) " " | 78 | R_BRACK@[67; 68) "]" |
79 | RETURN_EXPR@[69; 78) | 79 | WHITESPACE@[68; 69) " " |
80 | RETURN_KW@[69; 75) "return" | 80 | RETURN_EXPR@[69; 78) |
81 | WHITESPACE@[75; 76) " " | 81 | RETURN_KW@[69; 75) "return" |
82 | TUPLE_EXPR@[76; 78) | 82 | WHITESPACE@[75; 76) " " |
83 | L_PAREN@[76; 77) "(" | 83 | TUPLE_EXPR@[76; 78) |
84 | R_PAREN@[77; 78) ")" | 84 | L_PAREN@[76; 77) "(" |
85 | SEMI@[78; 79) ";" | 85 | R_PAREN@[77; 78) ")" |
86 | WHITESPACE@[79; 80) "\n" | 86 | SEMI@[78; 79) ";" |
87 | R_CURLY@[80; 81) "}" | 87 | WHITESPACE@[79; 80) "\n" |
88 | R_CURLY@[80; 81) "}" | ||
88 | WHITESPACE@[81; 82) "\n" | 89 | WHITESPACE@[81; 82) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt index 62a6a7bc0..c201196ec 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.txt | |||
@@ -8,47 +8,48 @@ SOURCE_FILE@[0; 47) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 46) | 11 | BLOCK_EXPR@[9; 46) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 46) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 31) | 14 | WHITESPACE@[10; 15) "\n " |
15 | BLOCK_EXPR@[15; 31) | 15 | EXPR_STMT@[15; 31) |
16 | BLOCK@[15; 31) | 16 | BLOCK_EXPR@[15; 31) |
17 | L_CURLY@[15; 16) "{" | 17 | BLOCK@[15; 31) |
18 | WHITESPACE@[16; 17) " " | 18 | L_CURLY@[15; 16) "{" |
19 | TRY_EXPR@[17; 29) | 19 | WHITESPACE@[16; 17) " " |
20 | ATTR@[17; 21) | 20 | TRY_EXPR@[17; 29) |
21 | POUND@[17; 18) "#" | 21 | ATTR@[17; 21) |
22 | TOKEN_TREE@[18; 21) | 22 | POUND@[17; 18) "#" |
23 | L_BRACK@[18; 19) "[" | 23 | TOKEN_TREE@[18; 21) |
24 | IDENT@[19; 20) "A" | 24 | L_BRACK@[18; 19) "[" |
25 | R_BRACK@[20; 21) "]" | 25 | IDENT@[19; 20) "A" |
26 | WHITESPACE@[21; 22) " " | 26 | R_BRACK@[20; 21) "]" |
27 | MACRO_CALL@[22; 28) | 27 | WHITESPACE@[21; 22) " " |
28 | PATH@[22; 25) | 28 | MACRO_CALL@[22; 28) |
29 | PATH_SEGMENT@[22; 25) | 29 | PATH@[22; 25) |
30 | NAME_REF@[22; 25) | 30 | PATH_SEGMENT@[22; 25) |
31 | IDENT@[22; 25) "bar" | 31 | NAME_REF@[22; 25) |
32 | EXCL@[25; 26) "!" | 32 | IDENT@[22; 25) "bar" |
33 | TOKEN_TREE@[26; 28) | 33 | EXCL@[25; 26) "!" |
34 | L_PAREN@[26; 27) "(" | 34 | TOKEN_TREE@[26; 28) |
35 | R_PAREN@[27; 28) ")" | 35 | L_PAREN@[26; 27) "(" |
36 | QUESTION@[28; 29) "?" | 36 | R_PAREN@[27; 28) ")" |
37 | WHITESPACE@[29; 30) " " | 37 | QUESTION@[28; 29) "?" |
38 | R_CURLY@[30; 31) "}" | 38 | WHITESPACE@[29; 30) " " |
39 | WHITESPACE@[31; 36) "\n " | 39 | R_CURLY@[30; 31) "}" |
40 | REF_EXPR@[36; 44) | 40 | WHITESPACE@[31; 36) "\n " |
41 | ATTR@[36; 40) | 41 | REF_EXPR@[36; 44) |
42 | POUND@[36; 37) "#" | 42 | ATTR@[36; 40) |
43 | TOKEN_TREE@[37; 40) | 43 | POUND@[36; 37) "#" |
44 | L_BRACK@[37; 38) "[" | 44 | TOKEN_TREE@[37; 40) |
45 | IDENT@[38; 39) "B" | 45 | L_BRACK@[37; 38) "[" |
46 | R_BRACK@[39; 40) "]" | 46 | IDENT@[38; 39) "B" |
47 | WHITESPACE@[40; 41) " " | 47 | R_BRACK@[39; 40) "]" |
48 | AMP@[41; 42) "&" | 48 | WHITESPACE@[40; 41) " " |
49 | TUPLE_EXPR@[42; 44) | 49 | AMP@[41; 42) "&" |
50 | L_PAREN@[42; 43) "(" | 50 | TUPLE_EXPR@[42; 44) |
51 | R_PAREN@[43; 44) ")" | 51 | L_PAREN@[42; 43) "(" |
52 | WHITESPACE@[44; 45) "\n" | 52 | R_PAREN@[43; 44) ")" |
53 | R_CURLY@[45; 46) "}" | 53 | WHITESPACE@[44; 45) "\n" |
54 | R_CURLY@[45; 46) "}" | ||
54 | WHITESPACE@[46; 47) "\n" | 55 | WHITESPACE@[46; 47) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt index 2a16aeb61..cae75c41d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.txt | |||
@@ -12,9 +12,10 @@ SOURCE_FILE@[0; 50) | |||
12 | L_PAREN@[19; 20) "(" | 12 | L_PAREN@[19; 20) "(" |
13 | R_PAREN@[20; 21) ")" | 13 | R_PAREN@[20; 21) ")" |
14 | WHITESPACE@[21; 22) " " | 14 | WHITESPACE@[21; 22) " " |
15 | BLOCK@[22; 24) | 15 | BLOCK_EXPR@[22; 24) |
16 | L_CURLY@[22; 23) "{" | 16 | BLOCK@[22; 24) |
17 | R_CURLY@[23; 24) "}" | 17 | L_CURLY@[22; 23) "{" |
18 | R_CURLY@[23; 24) "}" | ||
18 | WHITESPACE@[24; 25) "\n" | 19 | WHITESPACE@[24; 25) "\n" |
19 | FN_DEF@[25; 49) | 20 | FN_DEF@[25; 49) |
20 | CONST_KW@[25; 30) "const" | 21 | CONST_KW@[25; 30) "const" |
@@ -29,7 +30,8 @@ SOURCE_FILE@[0; 50) | |||
29 | L_PAREN@[44; 45) "(" | 30 | L_PAREN@[44; 45) "(" |
30 | R_PAREN@[45; 46) ")" | 31 | R_PAREN@[45; 46) ")" |
31 | WHITESPACE@[46; 47) " " | 32 | WHITESPACE@[46; 47) " " |
32 | BLOCK@[47; 49) | 33 | BLOCK_EXPR@[47; 49) |
33 | L_CURLY@[47; 48) "{" | 34 | BLOCK@[47; 49) |
34 | R_CURLY@[48; 49) "}" | 35 | L_CURLY@[47; 48) "{" |
36 | R_CURLY@[48; 49) "}" | ||
35 | WHITESPACE@[49; 50) "\n" | 37 | WHITESPACE@[49; 50) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt index 50b4ab2e7..4a714ad6b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt | |||
@@ -8,29 +8,30 @@ SOURCE_FILE@[0; 33) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 32) | 11 | BLOCK_EXPR@[10; 32) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 32) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 30) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 30) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | MACRO_CALL@[20; 25) | 17 | WHITESPACE@[19; 20) " " |
18 | PATH_PAT@[20; 21) | 18 | MACRO_CALL@[20; 25) |
19 | PATH@[20; 21) | 19 | PATH_PAT@[20; 21) |
20 | PATH_SEGMENT@[20; 21) | 20 | PATH@[20; 21) |
21 | NAME_REF@[20; 21) | 21 | PATH_SEGMENT@[20; 21) |
22 | IDENT@[20; 21) "m" | 22 | NAME_REF@[20; 21) |
23 | EXCL@[21; 22) "!" | 23 | IDENT@[20; 21) "m" |
24 | TOKEN_TREE@[22; 25) | 24 | EXCL@[21; 22) "!" |
25 | L_PAREN@[22; 23) "(" | 25 | TOKEN_TREE@[22; 25) |
26 | IDENT@[23; 24) "x" | 26 | L_PAREN@[22; 23) "(" |
27 | R_PAREN@[24; 25) ")" | 27 | IDENT@[23; 24) "x" |
28 | WHITESPACE@[25; 26) " " | 28 | R_PAREN@[24; 25) ")" |
29 | EQ@[26; 27) "=" | 29 | WHITESPACE@[25; 26) " " |
30 | WHITESPACE@[27; 28) " " | 30 | EQ@[26; 27) "=" |
31 | LITERAL@[28; 29) | 31 | WHITESPACE@[27; 28) " " |
32 | INT_NUMBER@[28; 29) "0" | 32 | LITERAL@[28; 29) |
33 | SEMI@[29; 30) ";" | 33 | INT_NUMBER@[28; 29) "0" |
34 | WHITESPACE@[30; 31) "\n" | 34 | SEMI@[29; 30) ";" |
35 | R_CURLY@[31; 32) "}" | 35 | WHITESPACE@[30; 31) "\n" |
36 | R_CURLY@[31; 32) "}" | ||
36 | WHITESPACE@[32; 33) "\n" | 37 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt index 82c1eb009..97166cfd5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.txt | |||
@@ -8,94 +8,95 @@ SOURCE_FILE@[0; 110) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 109) | 11 | BLOCK_EXPR@[9; 109) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 109) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 21) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 21) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | BIND_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | NAME@[19; 20) | 18 | BIND_PAT@[19; 20) |
19 | IDENT@[19; 20) "a" | 19 | NAME@[19; 20) |
20 | SEMI@[20; 21) ";" | 20 | IDENT@[19; 20) "a" |
21 | WHITESPACE@[21; 26) "\n " | 21 | SEMI@[20; 21) ";" |
22 | LET_STMT@[26; 37) | 22 | WHITESPACE@[21; 26) "\n " |
23 | LET_KW@[26; 29) "let" | 23 | LET_STMT@[26; 37) |
24 | WHITESPACE@[29; 30) " " | 24 | LET_KW@[26; 29) "let" |
25 | BIND_PAT@[30; 31) | 25 | WHITESPACE@[29; 30) " " |
26 | NAME@[30; 31) | 26 | BIND_PAT@[30; 31) |
27 | IDENT@[30; 31) "b" | 27 | NAME@[30; 31) |
28 | COLON@[31; 32) ":" | 28 | IDENT@[30; 31) "b" |
29 | WHITESPACE@[32; 33) " " | 29 | COLON@[31; 32) ":" |
30 | PATH_TYPE@[33; 36) | 30 | WHITESPACE@[32; 33) " " |
31 | PATH@[33; 36) | 31 | PATH_TYPE@[33; 36) |
32 | PATH_SEGMENT@[33; 36) | 32 | PATH@[33; 36) |
33 | NAME_REF@[33; 36) | 33 | PATH_SEGMENT@[33; 36) |
34 | IDENT@[33; 36) "i32" | 34 | NAME_REF@[33; 36) |
35 | SEMI@[36; 37) ";" | 35 | IDENT@[33; 36) "i32" |
36 | WHITESPACE@[37; 42) "\n " | 36 | SEMI@[36; 37) ";" |
37 | LET_STMT@[42; 53) | 37 | WHITESPACE@[37; 42) "\n " |
38 | LET_KW@[42; 45) "let" | 38 | LET_STMT@[42; 53) |
39 | WHITESPACE@[45; 46) " " | 39 | LET_KW@[42; 45) "let" |
40 | BIND_PAT@[46; 47) | 40 | WHITESPACE@[45; 46) " " |
41 | NAME@[46; 47) | 41 | BIND_PAT@[46; 47) |
42 | IDENT@[46; 47) "c" | 42 | NAME@[46; 47) |
43 | WHITESPACE@[47; 48) " " | 43 | IDENT@[46; 47) "c" |
44 | EQ@[48; 49) "=" | 44 | WHITESPACE@[47; 48) " " |
45 | WHITESPACE@[49; 50) " " | 45 | EQ@[48; 49) "=" |
46 | LITERAL@[50; 52) | 46 | WHITESPACE@[49; 50) " " |
47 | INT_NUMBER@[50; 52) "92" | 47 | LITERAL@[50; 52) |
48 | SEMI@[52; 53) ";" | 48 | INT_NUMBER@[50; 52) "92" |
49 | WHITESPACE@[53; 58) "\n " | 49 | SEMI@[52; 53) ";" |
50 | LET_STMT@[58; 74) | 50 | WHITESPACE@[53; 58) "\n " |
51 | LET_KW@[58; 61) "let" | 51 | LET_STMT@[58; 74) |
52 | WHITESPACE@[61; 62) " " | 52 | LET_KW@[58; 61) "let" |
53 | BIND_PAT@[62; 63) | 53 | WHITESPACE@[61; 62) " " |
54 | NAME@[62; 63) | 54 | BIND_PAT@[62; 63) |
55 | IDENT@[62; 63) "d" | 55 | NAME@[62; 63) |
56 | COLON@[63; 64) ":" | 56 | IDENT@[62; 63) "d" |
57 | WHITESPACE@[64; 65) " " | 57 | COLON@[63; 64) ":" |
58 | PATH_TYPE@[65; 68) | 58 | WHITESPACE@[64; 65) " " |
59 | PATH@[65; 68) | 59 | PATH_TYPE@[65; 68) |
60 | PATH_SEGMENT@[65; 68) | 60 | PATH@[65; 68) |
61 | NAME_REF@[65; 68) | 61 | PATH_SEGMENT@[65; 68) |
62 | IDENT@[65; 68) "i32" | 62 | NAME_REF@[65; 68) |
63 | WHITESPACE@[68; 69) " " | 63 | IDENT@[65; 68) "i32" |
64 | EQ@[69; 70) "=" | 64 | WHITESPACE@[68; 69) " " |
65 | WHITESPACE@[70; 71) " " | 65 | EQ@[69; 70) "=" |
66 | LITERAL@[71; 73) | 66 | WHITESPACE@[70; 71) " " |
67 | INT_NUMBER@[71; 73) "92" | 67 | LITERAL@[71; 73) |
68 | SEMI@[73; 74) ";" | 68 | INT_NUMBER@[71; 73) "92" |
69 | WHITESPACE@[74; 79) "\n " | 69 | SEMI@[73; 74) ";" |
70 | LET_STMT@[79; 88) | 70 | WHITESPACE@[74; 79) "\n " |
71 | LET_KW@[79; 82) "let" | 71 | LET_STMT@[79; 88) |
72 | WHITESPACE@[82; 83) " " | 72 | LET_KW@[79; 82) "let" |
73 | BIND_PAT@[83; 84) | 73 | WHITESPACE@[82; 83) " " |
74 | NAME@[83; 84) | 74 | BIND_PAT@[83; 84) |
75 | IDENT@[83; 84) "e" | 75 | NAME@[83; 84) |
76 | COLON@[84; 85) ":" | 76 | IDENT@[83; 84) "e" |
77 | WHITESPACE@[85; 86) " " | 77 | COLON@[84; 85) ":" |
78 | NEVER_TYPE@[86; 87) | 78 | WHITESPACE@[85; 86) " " |
79 | EXCL@[86; 87) "!" | 79 | NEVER_TYPE@[86; 87) |
80 | SEMI@[87; 88) ";" | 80 | EXCL@[86; 87) "!" |
81 | WHITESPACE@[88; 93) "\n " | 81 | SEMI@[87; 88) ";" |
82 | LET_STMT@[93; 107) | 82 | WHITESPACE@[88; 93) "\n " |
83 | LET_KW@[93; 96) "let" | 83 | LET_STMT@[93; 107) |
84 | WHITESPACE@[96; 97) " " | 84 | LET_KW@[93; 96) "let" |
85 | PLACEHOLDER_PAT@[97; 98) | 85 | WHITESPACE@[96; 97) " " |
86 | UNDERSCORE@[97; 98) "_" | 86 | PLACEHOLDER_PAT@[97; 98) |
87 | COLON@[98; 99) ":" | 87 | UNDERSCORE@[97; 98) "_" |
88 | WHITESPACE@[99; 100) " " | 88 | COLON@[98; 99) ":" |
89 | NEVER_TYPE@[100; 101) | 89 | WHITESPACE@[99; 100) " " |
90 | EXCL@[100; 101) "!" | 90 | NEVER_TYPE@[100; 101) |
91 | WHITESPACE@[101; 102) " " | 91 | EXCL@[100; 101) "!" |
92 | EQ@[102; 103) "=" | 92 | WHITESPACE@[101; 102) " " |
93 | WHITESPACE@[103; 104) " " | 93 | EQ@[102; 103) "=" |
94 | BLOCK_EXPR@[104; 106) | 94 | WHITESPACE@[103; 104) " " |
95 | BLOCK@[104; 106) | 95 | BLOCK_EXPR@[104; 106) |
96 | L_CURLY@[104; 105) "{" | 96 | BLOCK@[104; 106) |
97 | R_CURLY@[105; 106) "}" | 97 | L_CURLY@[104; 105) "{" |
98 | SEMI@[106; 107) ";" | 98 | R_CURLY@[105; 106) "}" |
99 | WHITESPACE@[107; 108) "\n" | 99 | SEMI@[106; 107) ";" |
100 | R_CURLY@[108; 109) "}" | 100 | WHITESPACE@[107; 108) "\n" |
101 | R_CURLY@[108; 109) "}" | ||
101 | WHITESPACE@[109; 110) "\n" | 102 | WHITESPACE@[109; 110) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt index 53f49b9b5..d6df1aba2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.txt | |||
@@ -8,24 +8,26 @@ SOURCE_FILE@[0; 33) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 32) | 11 | BLOCK_EXPR@[9; 32) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 32) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 30) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 30) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | PLACEHOLDER_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | UNDERSCORE@[19; 20) "_" | 18 | PLACEHOLDER_PAT@[19; 20) |
19 | WHITESPACE@[20; 21) " " | 19 | UNDERSCORE@[19; 20) "_" |
20 | EQ@[21; 22) "=" | 20 | WHITESPACE@[20; 21) " " |
21 | WHITESPACE@[22; 23) " " | 21 | EQ@[21; 22) "=" |
22 | TRY_EXPR@[23; 29) | 22 | WHITESPACE@[22; 23) " " |
23 | TRY_KW@[23; 26) "try" | 23 | TRY_EXPR@[23; 29) |
24 | WHITESPACE@[26; 27) " " | 24 | TRY_KW@[23; 26) "try" |
25 | BLOCK@[27; 29) | 25 | WHITESPACE@[26; 27) " " |
26 | L_CURLY@[27; 28) "{" | 26 | BLOCK_EXPR@[27; 29) |
27 | R_CURLY@[28; 29) "}" | 27 | BLOCK@[27; 29) |
28 | SEMI@[29; 30) ";" | 28 | L_CURLY@[27; 28) "{" |
29 | WHITESPACE@[30; 31) "\n" | 29 | R_CURLY@[28; 29) "}" |
30 | R_CURLY@[31; 32) "}" | 30 | SEMI@[29; 30) ";" |
31 | WHITESPACE@[30; 31) "\n" | ||
32 | R_CURLY@[31; 32) "}" | ||
31 | WHITESPACE@[32; 33) "\n" | 33 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt index 3d22002a1..12294210e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.txt | |||
@@ -8,82 +8,83 @@ SOURCE_FILE@[0; 106) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 105) | 11 | BLOCK_EXPR@[9; 105) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 105) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[15; 32) | 14 | WHITESPACE@[10; 15) "\n " |
15 | LET_KW@[15; 18) "let" | 15 | LET_STMT@[15; 32) |
16 | WHITESPACE@[18; 19) " " | 16 | LET_KW@[15; 18) "let" |
17 | BIND_PAT@[19; 20) | 17 | WHITESPACE@[18; 19) " " |
18 | NAME@[19; 20) | 18 | BIND_PAT@[19; 20) |
19 | IDENT@[19; 20) "x" | 19 | NAME@[19; 20) |
20 | WHITESPACE@[20; 21) " " | 20 | IDENT@[19; 20) "x" |
21 | EQ@[21; 22) "=" | 21 | WHITESPACE@[20; 21) " " |
22 | WHITESPACE@[22; 23) " " | 22 | EQ@[21; 22) "=" |
23 | BOX_EXPR@[23; 31) | 23 | WHITESPACE@[22; 23) " " |
24 | BOX_KW@[23; 26) "box" | 24 | BOX_EXPR@[23; 31) |
25 | WHITESPACE@[26; 27) " " | 25 | BOX_KW@[23; 26) "box" |
26 | LITERAL@[27; 31) | 26 | WHITESPACE@[26; 27) " " |
27 | INT_NUMBER@[27; 31) "1i32" | 27 | LITERAL@[27; 31) |
28 | SEMI@[31; 32) ";" | 28 | INT_NUMBER@[27; 31) "1i32" |
29 | WHITESPACE@[32; 37) "\n " | 29 | SEMI@[31; 32) ";" |
30 | LET_STMT@[37; 66) | 30 | WHITESPACE@[32; 37) "\n " |
31 | LET_KW@[37; 40) "let" | 31 | LET_STMT@[37; 66) |
32 | WHITESPACE@[40; 41) " " | 32 | LET_KW@[37; 40) "let" |
33 | BIND_PAT@[41; 42) | 33 | WHITESPACE@[40; 41) " " |
34 | NAME@[41; 42) | 34 | BIND_PAT@[41; 42) |
35 | IDENT@[41; 42) "y" | 35 | NAME@[41; 42) |
36 | WHITESPACE@[42; 43) " " | 36 | IDENT@[41; 42) "y" |
37 | EQ@[43; 44) "=" | 37 | WHITESPACE@[42; 43) " " |
38 | WHITESPACE@[44; 45) " " | 38 | EQ@[43; 44) "=" |
39 | TUPLE_EXPR@[45; 65) | 39 | WHITESPACE@[44; 45) " " |
40 | L_PAREN@[45; 46) "(" | 40 | TUPLE_EXPR@[45; 65) |
41 | BOX_EXPR@[46; 54) | 41 | L_PAREN@[45; 46) "(" |
42 | BOX_KW@[46; 49) "box" | 42 | BOX_EXPR@[46; 54) |
43 | WHITESPACE@[49; 50) " " | 43 | BOX_KW@[46; 49) "box" |
44 | LITERAL@[50; 54) | 44 | WHITESPACE@[49; 50) " " |
45 | INT_NUMBER@[50; 54) "1i32" | 45 | LITERAL@[50; 54) |
46 | COMMA@[54; 55) "," | 46 | INT_NUMBER@[50; 54) "1i32" |
47 | WHITESPACE@[55; 56) " " | 47 | COMMA@[54; 55) "," |
48 | BOX_EXPR@[56; 64) | 48 | WHITESPACE@[55; 56) " " |
49 | BOX_KW@[56; 59) "box" | 49 | BOX_EXPR@[56; 64) |
50 | WHITESPACE@[59; 60) " " | 50 | BOX_KW@[56; 59) "box" |
51 | LITERAL@[60; 64) | 51 | WHITESPACE@[59; 60) " " |
52 | INT_NUMBER@[60; 64) "2i32" | 52 | LITERAL@[60; 64) |
53 | R_PAREN@[64; 65) ")" | 53 | INT_NUMBER@[60; 64) "2i32" |
54 | SEMI@[65; 66) ";" | 54 | R_PAREN@[64; 65) ")" |
55 | WHITESPACE@[66; 71) "\n " | 55 | SEMI@[65; 66) ";" |
56 | LET_STMT@[71; 103) | 56 | WHITESPACE@[66; 71) "\n " |
57 | LET_KW@[71; 74) "let" | 57 | LET_STMT@[71; 103) |
58 | WHITESPACE@[74; 75) " " | 58 | LET_KW@[71; 74) "let" |
59 | BIND_PAT@[75; 76) | 59 | WHITESPACE@[74; 75) " " |
60 | NAME@[75; 76) | 60 | BIND_PAT@[75; 76) |
61 | IDENT@[75; 76) "z" | 61 | NAME@[75; 76) |
62 | WHITESPACE@[76; 77) " " | 62 | IDENT@[75; 76) "z" |
63 | EQ@[77; 78) "=" | 63 | WHITESPACE@[76; 77) " " |
64 | WHITESPACE@[78; 79) " " | 64 | EQ@[77; 78) "=" |
65 | CALL_EXPR@[79; 102) | 65 | WHITESPACE@[78; 79) " " |
66 | PATH_EXPR@[79; 82) | 66 | CALL_EXPR@[79; 102) |
67 | PATH@[79; 82) | 67 | PATH_EXPR@[79; 82) |
68 | PATH_SEGMENT@[79; 82) | 68 | PATH@[79; 82) |
69 | NAME_REF@[79; 82) | 69 | PATH_SEGMENT@[79; 82) |
70 | IDENT@[79; 82) "Foo" | 70 | NAME_REF@[79; 82) |
71 | ARG_LIST@[82; 102) | 71 | IDENT@[79; 82) "Foo" |
72 | L_PAREN@[82; 83) "(" | 72 | ARG_LIST@[82; 102) |
73 | BOX_EXPR@[83; 91) | 73 | L_PAREN@[82; 83) "(" |
74 | BOX_KW@[83; 86) "box" | 74 | BOX_EXPR@[83; 91) |
75 | WHITESPACE@[86; 87) " " | 75 | BOX_KW@[83; 86) "box" |
76 | LITERAL@[87; 91) | 76 | WHITESPACE@[86; 87) " " |
77 | INT_NUMBER@[87; 91) "1i32" | 77 | LITERAL@[87; 91) |
78 | COMMA@[91; 92) "," | 78 | INT_NUMBER@[87; 91) "1i32" |
79 | WHITESPACE@[92; 93) " " | 79 | COMMA@[91; 92) "," |
80 | BOX_EXPR@[93; 101) | 80 | WHITESPACE@[92; 93) " " |
81 | BOX_KW@[93; 96) "box" | 81 | BOX_EXPR@[93; 101) |
82 | WHITESPACE@[96; 97) " " | 82 | BOX_KW@[93; 96) "box" |
83 | LITERAL@[97; 101) | 83 | WHITESPACE@[96; 97) " " |
84 | INT_NUMBER@[97; 101) "2i32" | 84 | LITERAL@[97; 101) |
85 | R_PAREN@[101; 102) ")" | 85 | INT_NUMBER@[97; 101) "2i32" |
86 | SEMI@[102; 103) ";" | 86 | R_PAREN@[101; 102) ")" |
87 | WHITESPACE@[103; 104) "\n" | 87 | SEMI@[102; 103) ";" |
88 | R_CURLY@[104; 105) "}" | 88 | WHITESPACE@[103; 104) "\n" |
89 | R_CURLY@[104; 105) "}" | ||
89 | WHITESPACE@[105; 106) "\n" | 90 | WHITESPACE@[105; 106) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt index 384b203d3..022070b0c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.txt | |||
@@ -47,9 +47,10 @@ SOURCE_FILE@[0; 69) | |||
47 | L_PAREN@[61; 62) "(" | 47 | L_PAREN@[61; 62) "(" |
48 | R_PAREN@[62; 63) ")" | 48 | R_PAREN@[62; 63) ")" |
49 | WHITESPACE@[63; 64) " " | 49 | WHITESPACE@[63; 64) " " |
50 | BLOCK@[64; 66) | 50 | BLOCK_EXPR@[64; 66) |
51 | L_CURLY@[64; 65) "{" | 51 | BLOCK@[64; 66) |
52 | R_CURLY@[65; 66) "}" | 52 | L_CURLY@[64; 65) "{" |
53 | R_CURLY@[65; 66) "}" | ||
53 | WHITESPACE@[66; 67) "\n" | 54 | WHITESPACE@[66; 67) "\n" |
54 | R_CURLY@[67; 68) "}" | 55 | R_CURLY@[67; 68) "}" |
55 | WHITESPACE@[68; 69) "\n" | 56 | WHITESPACE@[68; 69) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt index 64cbf4632..14655d332 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.txt | |||
@@ -8,55 +8,57 @@ SOURCE_FILE@[0; 111) | |||
8 | L_PAREN@[18; 19) "(" | 8 | L_PAREN@[18; 19) "(" |
9 | R_PAREN@[19; 20) ")" | 9 | R_PAREN@[19; 20) ")" |
10 | WHITESPACE@[20; 21) " " | 10 | WHITESPACE@[20; 21) " " |
11 | BLOCK@[21; 110) | 11 | BLOCK_EXPR@[21; 110) |
12 | L_CURLY@[21; 22) "{" | 12 | BLOCK@[21; 110) |
13 | WHITESPACE@[22; 27) "\n " | 13 | L_CURLY@[21; 22) "{" |
14 | ENUM_DEF@[27; 75) | 14 | WHITESPACE@[22; 27) "\n " |
15 | ENUM_KW@[27; 31) "enum" | 15 | ENUM_DEF@[27; 75) |
16 | WHITESPACE@[31; 32) " " | 16 | ENUM_KW@[27; 31) "enum" |
17 | NAME@[32; 41) | 17 | WHITESPACE@[31; 32) " " |
18 | IDENT@[32; 41) "LocalEnum" | 18 | NAME@[32; 41) |
19 | WHITESPACE@[41; 42) " " | 19 | IDENT@[32; 41) "LocalEnum" |
20 | ENUM_VARIANT_LIST@[42; 75) | 20 | WHITESPACE@[41; 42) " " |
21 | L_CURLY@[42; 43) "{" | 21 | ENUM_VARIANT_LIST@[42; 75) |
22 | WHITESPACE@[43; 52) "\n " | 22 | L_CURLY@[42; 43) "{" |
23 | ENUM_VARIANT@[52; 55) | 23 | WHITESPACE@[43; 52) "\n " |
24 | NAME@[52; 55) | 24 | ENUM_VARIANT@[52; 55) |
25 | IDENT@[52; 55) "One" | 25 | NAME@[52; 55) |
26 | COMMA@[55; 56) "," | 26 | IDENT@[52; 55) "One" |
27 | WHITESPACE@[56; 65) "\n " | 27 | COMMA@[55; 56) "," |
28 | ENUM_VARIANT@[65; 68) | 28 | WHITESPACE@[56; 65) "\n " |
29 | NAME@[65; 68) | 29 | ENUM_VARIANT@[65; 68) |
30 | IDENT@[65; 68) "Two" | 30 | NAME@[65; 68) |
31 | COMMA@[68; 69) "," | 31 | IDENT@[65; 68) "Two" |
32 | WHITESPACE@[69; 74) "\n " | 32 | COMMA@[68; 69) "," |
33 | R_CURLY@[74; 75) "}" | 33 | WHITESPACE@[69; 74) "\n " |
34 | SEMI@[75; 76) ";" | 34 | R_CURLY@[74; 75) "}" |
35 | WHITESPACE@[76; 81) "\n " | 35 | SEMI@[75; 76) ";" |
36 | FN_DEF@[81; 90) | 36 | WHITESPACE@[76; 81) "\n " |
37 | FN_KW@[81; 83) "fn" | 37 | FN_DEF@[81; 90) |
38 | WHITESPACE@[83; 84) " " | 38 | FN_KW@[81; 83) "fn" |
39 | NAME@[84; 85) | 39 | WHITESPACE@[83; 84) " " |
40 | IDENT@[84; 85) "f" | 40 | NAME@[84; 85) |
41 | PARAM_LIST@[85; 87) | 41 | IDENT@[84; 85) "f" |
42 | L_PAREN@[85; 86) "(" | 42 | PARAM_LIST@[85; 87) |
43 | R_PAREN@[86; 87) ")" | 43 | L_PAREN@[85; 86) "(" |
44 | WHITESPACE@[87; 88) " " | 44 | R_PAREN@[86; 87) ")" |
45 | BLOCK@[88; 90) | 45 | WHITESPACE@[87; 88) " " |
46 | L_CURLY@[88; 89) "{" | 46 | BLOCK_EXPR@[88; 90) |
47 | R_CURLY@[89; 90) "}" | 47 | BLOCK@[88; 90) |
48 | SEMI@[90; 91) ";" | 48 | L_CURLY@[88; 89) "{" |
49 | WHITESPACE@[91; 96) "\n " | 49 | R_CURLY@[89; 90) "}" |
50 | STRUCT_DEF@[96; 107) | 50 | SEMI@[90; 91) ";" |
51 | STRUCT_KW@[96; 102) "struct" | 51 | WHITESPACE@[91; 96) "\n " |
52 | WHITESPACE@[102; 103) " " | 52 | STRUCT_DEF@[96; 107) |
53 | NAME@[103; 104) | 53 | STRUCT_KW@[96; 102) "struct" |
54 | IDENT@[103; 104) "S" | 54 | WHITESPACE@[102; 103) " " |
55 | WHITESPACE@[104; 105) " " | 55 | NAME@[103; 104) |
56 | RECORD_FIELD_DEF_LIST@[105; 107) | 56 | IDENT@[103; 104) "S" |
57 | L_CURLY@[105; 106) "{" | 57 | WHITESPACE@[104; 105) " " |
58 | R_CURLY@[106; 107) "}" | 58 | RECORD_FIELD_DEF_LIST@[105; 107) |
59 | SEMI@[107; 108) ";" | 59 | L_CURLY@[105; 106) "{" |
60 | WHITESPACE@[108; 109) "\n" | 60 | R_CURLY@[106; 107) "}" |
61 | R_CURLY@[109; 110) "}" | 61 | SEMI@[107; 108) ";" |
62 | WHITESPACE@[108; 109) "\n" | ||
63 | R_CURLY@[109; 110) "}" | ||
62 | WHITESPACE@[110; 111) "\n" | 64 | WHITESPACE@[110; 111) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt index 7adb662de..a6ac0dbd8 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.txt | |||
@@ -8,62 +8,63 @@ SOURCE_FILE@[0; 67) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 66) | 11 | BLOCK_EXPR@[9; 66) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 66) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 23) | 14 | WHITESPACE@[10; 15) "\n " |
15 | AWAIT_EXPR@[15; 22) | 15 | EXPR_STMT@[15; 23) |
16 | PATH_EXPR@[15; 16) | 16 | AWAIT_EXPR@[15; 22) |
17 | PATH@[15; 16) | 17 | PATH_EXPR@[15; 16) |
18 | PATH_SEGMENT@[15; 16) | 18 | PATH@[15; 16) |
19 | NAME_REF@[15; 16) | 19 | PATH_SEGMENT@[15; 16) |
20 | IDENT@[15; 16) "x" | 20 | NAME_REF@[15; 16) |
21 | DOT@[16; 17) "." | 21 | IDENT@[15; 16) "x" |
22 | AWAIT_KW@[17; 22) "await" | 22 | DOT@[16; 17) "." |
23 | SEMI@[22; 23) ";" | 23 | AWAIT_KW@[17; 22) "await" |
24 | WHITESPACE@[23; 28) "\n " | 24 | SEMI@[22; 23) ";" |
25 | EXPR_STMT@[28; 38) | 25 | WHITESPACE@[23; 28) "\n " |
26 | AWAIT_EXPR@[28; 37) | 26 | EXPR_STMT@[28; 38) |
27 | FIELD_EXPR@[28; 31) | 27 | AWAIT_EXPR@[28; 37) |
28 | PATH_EXPR@[28; 29) | 28 | FIELD_EXPR@[28; 31) |
29 | PATH@[28; 29) | 29 | PATH_EXPR@[28; 29) |
30 | PATH_SEGMENT@[28; 29) | 30 | PATH@[28; 29) |
31 | NAME_REF@[28; 29) | 31 | PATH_SEGMENT@[28; 29) |
32 | IDENT@[28; 29) "x" | 32 | NAME_REF@[28; 29) |
33 | DOT@[29; 30) "." | 33 | IDENT@[28; 29) "x" |
34 | NAME_REF@[30; 31) | 34 | DOT@[29; 30) "." |
35 | INT_NUMBER@[30; 31) "0" | 35 | NAME_REF@[30; 31) |
36 | DOT@[31; 32) "." | 36 | INT_NUMBER@[30; 31) "0" |
37 | AWAIT_KW@[32; 37) "await" | 37 | DOT@[31; 32) "." |
38 | SEMI@[37; 38) ";" | 38 | AWAIT_KW@[32; 37) "await" |
39 | WHITESPACE@[38; 43) "\n " | 39 | SEMI@[37; 38) ";" |
40 | EXPR_STMT@[43; 64) | 40 | WHITESPACE@[38; 43) "\n " |
41 | METHOD_CALL_EXPR@[43; 63) | 41 | EXPR_STMT@[43; 64) |
42 | TRY_EXPR@[43; 55) | 42 | METHOD_CALL_EXPR@[43; 63) |
43 | AWAIT_EXPR@[43; 54) | 43 | TRY_EXPR@[43; 55) |
44 | CALL_EXPR@[43; 48) | 44 | AWAIT_EXPR@[43; 54) |
45 | FIELD_EXPR@[43; 46) | 45 | CALL_EXPR@[43; 48) |
46 | PATH_EXPR@[43; 44) | 46 | FIELD_EXPR@[43; 46) |
47 | PATH@[43; 44) | 47 | PATH_EXPR@[43; 44) |
48 | PATH_SEGMENT@[43; 44) | 48 | PATH@[43; 44) |
49 | NAME_REF@[43; 44) | 49 | PATH_SEGMENT@[43; 44) |
50 | IDENT@[43; 44) "x" | 50 | NAME_REF@[43; 44) |
51 | DOT@[44; 45) "." | 51 | IDENT@[43; 44) "x" |
52 | NAME_REF@[45; 46) | 52 | DOT@[44; 45) "." |
53 | INT_NUMBER@[45; 46) "0" | 53 | NAME_REF@[45; 46) |
54 | ARG_LIST@[46; 48) | 54 | INT_NUMBER@[45; 46) "0" |
55 | L_PAREN@[46; 47) "(" | 55 | ARG_LIST@[46; 48) |
56 | R_PAREN@[47; 48) ")" | 56 | L_PAREN@[46; 47) "(" |
57 | DOT@[48; 49) "." | 57 | R_PAREN@[47; 48) ")" |
58 | AWAIT_KW@[49; 54) "await" | 58 | DOT@[48; 49) "." |
59 | QUESTION@[54; 55) "?" | 59 | AWAIT_KW@[49; 54) "await" |
60 | DOT@[55; 56) "." | 60 | QUESTION@[54; 55) "?" |
61 | NAME_REF@[56; 61) | 61 | DOT@[55; 56) "." |
62 | IDENT@[56; 61) "hello" | 62 | NAME_REF@[56; 61) |
63 | ARG_LIST@[61; 63) | 63 | IDENT@[56; 61) "hello" |
64 | L_PAREN@[61; 62) "(" | 64 | ARG_LIST@[61; 63) |
65 | R_PAREN@[62; 63) ")" | 65 | L_PAREN@[61; 62) "(" |
66 | SEMI@[63; 64) ";" | 66 | R_PAREN@[62; 63) ")" |
67 | WHITESPACE@[64; 65) "\n" | 67 | SEMI@[63; 64) ";" |
68 | R_CURLY@[65; 66) "}" | 68 | WHITESPACE@[64; 65) "\n" |
69 | R_CURLY@[65; 66) "}" | ||
69 | WHITESPACE@[66; 67) "\n" | 70 | WHITESPACE@[66; 67) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.txt b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.txt index 33e75510d..d18096b47 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.txt | |||
@@ -49,7 +49,8 @@ SOURCE_FILE@[0; 59) | |||
49 | IDENT@[53; 54) "T" | 49 | IDENT@[53; 54) "T" |
50 | R_PAREN@[54; 55) ")" | 50 | R_PAREN@[54; 55) ")" |
51 | WHITESPACE@[55; 56) " " | 51 | WHITESPACE@[55; 56) " " |
52 | BLOCK@[56; 58) | 52 | BLOCK_EXPR@[56; 58) |
53 | L_CURLY@[56; 57) "{" | 53 | BLOCK@[56; 58) |
54 | R_CURLY@[57; 58) "}" | 54 | L_CURLY@[56; 57) "{" |
55 | R_CURLY@[57; 58) "}" | ||
55 | WHITESPACE@[58; 59) "\n" | 56 | WHITESPACE@[58; 59) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt index c4db9da40..df4c04149 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.txt | |||
@@ -8,58 +8,59 @@ SOURCE_FILE@[0; 52) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 51) | 11 | BLOCK_EXPR@[9; 51) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 51) |
13 | WHITESPACE@[10; 14) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[14; 34) | 14 | WHITESPACE@[10; 14) "\n " |
15 | LET_KW@[14; 17) "let" | 15 | LET_STMT@[14; 34) |
16 | WHITESPACE@[17; 18) " " | 16 | LET_KW@[14; 17) "let" |
17 | BIND_PAT@[18; 23) | 17 | WHITESPACE@[17; 18) " " |
18 | MUT_KW@[18; 21) "mut" | 18 | BIND_PAT@[18; 23) |
19 | WHITESPACE@[21; 22) " " | 19 | MUT_KW@[18; 21) "mut" |
20 | NAME@[22; 23) | 20 | WHITESPACE@[21; 22) " " |
21 | IDENT@[22; 23) "p" | 21 | NAME@[22; 23) |
22 | WHITESPACE@[23; 24) " " | 22 | IDENT@[22; 23) "p" |
23 | EQ@[24; 25) "=" | 23 | WHITESPACE@[23; 24) " " |
24 | WHITESPACE@[25; 26) " " | 24 | EQ@[24; 25) "=" |
25 | RECORD_LIT@[26; 33) | 25 | WHITESPACE@[25; 26) " " |
26 | PATH@[26; 27) | 26 | RECORD_LIT@[26; 33) |
27 | PATH_SEGMENT@[26; 27) | 27 | PATH@[26; 27) |
28 | NAME_REF@[26; 27) | 28 | PATH_SEGMENT@[26; 27) |
29 | IDENT@[26; 27) "F" | 29 | NAME_REF@[26; 27) |
30 | RECORD_FIELD_LIST@[27; 33) | 30 | IDENT@[26; 27) "F" |
31 | L_CURLY@[27; 28) "{" | 31 | RECORD_FIELD_LIST@[27; 33) |
32 | RECORD_FIELD@[28; 32) | 32 | L_CURLY@[27; 28) "{" |
33 | NAME_REF@[28; 29) | 33 | RECORD_FIELD@[28; 32) |
34 | IDENT@[28; 29) "x" | 34 | NAME_REF@[28; 29) |
35 | COLON@[29; 30) ":" | 35 | IDENT@[28; 29) "x" |
36 | WHITESPACE@[30; 31) " " | 36 | COLON@[29; 30) ":" |
37 | LITERAL@[31; 32) | 37 | WHITESPACE@[30; 31) " " |
38 | INT_NUMBER@[31; 32) "5" | 38 | LITERAL@[31; 32) |
39 | R_CURLY@[32; 33) "}" | 39 | INT_NUMBER@[31; 32) "5" |
40 | SEMI@[33; 34) ";" | 40 | R_CURLY@[32; 33) "}" |
41 | WHITESPACE@[34; 38) "\n " | 41 | SEMI@[33; 34) ";" |
42 | EXPR_STMT@[38; 49) | 42 | WHITESPACE@[34; 38) "\n " |
43 | BIN_EXPR@[38; 48) | 43 | EXPR_STMT@[38; 49) |
44 | FIELD_EXPR@[38; 43) | 44 | BIN_EXPR@[38; 48) |
45 | BLOCK_EXPR@[38; 41) | 45 | FIELD_EXPR@[38; 43) |
46 | BLOCK@[38; 41) | 46 | BLOCK_EXPR@[38; 41) |
47 | L_CURLY@[38; 39) "{" | 47 | BLOCK@[38; 41) |
48 | PATH_EXPR@[39; 40) | 48 | L_CURLY@[38; 39) "{" |
49 | PATH@[39; 40) | 49 | PATH_EXPR@[39; 40) |
50 | PATH_SEGMENT@[39; 40) | 50 | PATH@[39; 40) |
51 | NAME_REF@[39; 40) | 51 | PATH_SEGMENT@[39; 40) |
52 | IDENT@[39; 40) "p" | 52 | NAME_REF@[39; 40) |
53 | R_CURLY@[40; 41) "}" | 53 | IDENT@[39; 40) "p" |
54 | DOT@[41; 42) "." | 54 | R_CURLY@[40; 41) "}" |
55 | NAME_REF@[42; 43) | 55 | DOT@[41; 42) "." |
56 | IDENT@[42; 43) "x" | 56 | NAME_REF@[42; 43) |
57 | WHITESPACE@[43; 44) " " | 57 | IDENT@[42; 43) "x" |
58 | EQ@[44; 45) "=" | 58 | WHITESPACE@[43; 44) " " |
59 | WHITESPACE@[45; 46) " " | 59 | EQ@[44; 45) "=" |
60 | LITERAL@[46; 48) | 60 | WHITESPACE@[45; 46) " " |
61 | INT_NUMBER@[46; 48) "10" | 61 | LITERAL@[46; 48) |
62 | SEMI@[48; 49) ";" | 62 | INT_NUMBER@[46; 48) "10" |
63 | WHITESPACE@[49; 50) "\n" | 63 | SEMI@[48; 49) ";" |
64 | R_CURLY@[50; 51) "}" | 64 | WHITESPACE@[49; 50) "\n" |
65 | R_CURLY@[50; 51) "}" | ||
65 | WHITESPACE@[51; 52) "\n" | 66 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt index 49b14e632..708fa4773 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.txt | |||
@@ -17,7 +17,8 @@ SOURCE_FILE@[0; 26) | |||
17 | SELF_KW@[17; 21) "self" | 17 | SELF_KW@[17; 21) "self" |
18 | R_PAREN@[21; 22) ")" | 18 | R_PAREN@[21; 22) ")" |
19 | WHITESPACE@[22; 23) " " | 19 | WHITESPACE@[22; 23) " " |
20 | BLOCK@[23; 25) | 20 | BLOCK_EXPR@[23; 25) |
21 | L_CURLY@[23; 24) "{" | 21 | BLOCK@[23; 25) |
22 | R_CURLY@[24; 25) "}" | 22 | L_CURLY@[23; 24) "{" |
23 | R_CURLY@[24; 25) "}" | ||
23 | WHITESPACE@[25; 26) "\n" | 24 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt index 91c5e5f9a..9c0a0d20b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.txt | |||
@@ -26,7 +26,8 @@ SOURCE_FILE@[0; 28) | |||
26 | IDENT@[19; 23) "Type" | 26 | IDENT@[19; 23) "Type" |
27 | R_PAREN@[23; 24) ")" | 27 | R_PAREN@[23; 24) ")" |
28 | WHITESPACE@[24; 25) " " | 28 | WHITESPACE@[24; 25) " " |
29 | BLOCK@[25; 27) | 29 | BLOCK_EXPR@[25; 27) |
30 | L_CURLY@[25; 26) "{" | 30 | BLOCK@[25; 27) |
31 | R_CURLY@[26; 27) "}" | 31 | L_CURLY@[25; 26) "{" |
32 | R_CURLY@[26; 27) "}" | ||
32 | WHITESPACE@[27; 28) "\n" | 33 | WHITESPACE@[27; 28) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.txt b/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.txt index 9e5836233..eec1cba1e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.txt | |||
@@ -8,33 +8,35 @@ SOURCE_FILE@[0; 51) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 50) | 11 | BLOCK_EXPR@[9; 50) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 50) |
13 | WHITESPACE@[10; 14) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | FOR_EXPR@[14; 48) | 14 | WHITESPACE@[10; 14) "\n " |
15 | FOR_KW@[14; 17) "for" | 15 | FOR_EXPR@[14; 48) |
16 | WHITESPACE@[17; 18) " " | 16 | FOR_KW@[14; 17) "for" |
17 | BIND_PAT@[18; 19) | 17 | WHITESPACE@[17; 18) " " |
18 | NAME@[18; 19) | 18 | BIND_PAT@[18; 19) |
19 | IDENT@[18; 19) "x" | 19 | NAME@[18; 19) |
20 | WHITESPACE@[19; 20) " " | 20 | IDENT@[18; 19) "x" |
21 | IN_KW@[20; 22) "in" | 21 | WHITESPACE@[19; 20) " " |
22 | WHITESPACE@[22; 23) " " | 22 | IN_KW@[20; 22) "in" |
23 | RANGE_EXPR@[23; 27) | 23 | WHITESPACE@[22; 23) " " |
24 | LITERAL@[23; 24) | 24 | RANGE_EXPR@[23; 27) |
25 | INT_NUMBER@[23; 24) "0" | 25 | LITERAL@[23; 24) |
26 | WHITESPACE@[24; 25) " " | 26 | INT_NUMBER@[23; 24) "0" |
27 | DOTDOT@[25; 27) ".." | 27 | WHITESPACE@[24; 25) " " |
28 | WHITESPACE@[27; 28) " " | 28 | DOTDOT@[25; 27) ".." |
29 | BLOCK@[28; 48) | 29 | WHITESPACE@[27; 28) " " |
30 | L_CURLY@[28; 29) "{" | 30 | BLOCK_EXPR@[28; 48) |
31 | WHITESPACE@[29; 37) "\n " | 31 | BLOCK@[28; 48) |
32 | EXPR_STMT@[37; 43) | 32 | L_CURLY@[28; 29) "{" |
33 | BREAK_EXPR@[37; 42) | 33 | WHITESPACE@[29; 37) "\n " |
34 | BREAK_KW@[37; 42) "break" | 34 | EXPR_STMT@[37; 43) |
35 | SEMI@[42; 43) ";" | 35 | BREAK_EXPR@[37; 42) |
36 | WHITESPACE@[43; 47) "\n " | 36 | BREAK_KW@[37; 42) "break" |
37 | R_CURLY@[47; 48) "}" | 37 | SEMI@[42; 43) ";" |
38 | WHITESPACE@[48; 49) "\n" | 38 | WHITESPACE@[43; 47) "\n " |
39 | R_CURLY@[49; 50) "}" | 39 | R_CURLY@[47; 48) "}" |
40 | WHITESPACE@[48; 49) "\n" | ||
41 | R_CURLY@[49; 50) "}" | ||
40 | WHITESPACE@[50; 51) "\n" | 42 | WHITESPACE@[50; 51) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.txt index f0db58143..4d2048711 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.txt | |||
@@ -8,102 +8,103 @@ SOURCE_FILE@[0; 118) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 117) | 11 | BLOCK_EXPR@[10; 117) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 117) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 31) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 31) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | BOX_PAT@[20; 25) | 17 | WHITESPACE@[19; 20) " " |
18 | BOX_KW@[20; 23) "box" | 18 | BOX_PAT@[20; 25) |
19 | WHITESPACE@[23; 24) " " | 19 | BOX_KW@[20; 23) "box" |
20 | BIND_PAT@[24; 25) | 20 | WHITESPACE@[23; 24) " " |
21 | NAME@[24; 25) | 21 | BIND_PAT@[24; 25) |
22 | IDENT@[24; 25) "i" | 22 | NAME@[24; 25) |
23 | WHITESPACE@[25; 26) " " | 23 | IDENT@[24; 25) "i" |
24 | EQ@[26; 27) "=" | 24 | WHITESPACE@[25; 26) " " |
25 | WHITESPACE@[27; 28) " " | 25 | EQ@[26; 27) "=" |
26 | TUPLE_EXPR@[28; 30) | 26 | WHITESPACE@[27; 28) " " |
27 | L_PAREN@[28; 29) "(" | 27 | TUPLE_EXPR@[28; 30) |
28 | R_PAREN@[29; 30) ")" | 28 | L_PAREN@[28; 29) "(" |
29 | SEMI@[30; 31) ";" | 29 | R_PAREN@[29; 30) ")" |
30 | WHITESPACE@[31; 36) "\n " | 30 | SEMI@[30; 31) ";" |
31 | LET_STMT@[36; 87) | 31 | WHITESPACE@[31; 36) "\n " |
32 | LET_KW@[36; 39) "let" | 32 | LET_STMT@[36; 87) |
33 | WHITESPACE@[39; 40) " " | 33 | LET_KW@[36; 39) "let" |
34 | BOX_PAT@[40; 81) | 34 | WHITESPACE@[39; 40) " " |
35 | BOX_KW@[40; 43) "box" | 35 | BOX_PAT@[40; 81) |
36 | WHITESPACE@[43; 44) " " | 36 | BOX_KW@[40; 43) "box" |
37 | RECORD_PAT@[44; 81) | 37 | WHITESPACE@[43; 44) " " |
38 | PATH@[44; 49) | 38 | RECORD_PAT@[44; 81) |
39 | PATH_SEGMENT@[44; 49) | 39 | PATH@[44; 49) |
40 | NAME_REF@[44; 49) | 40 | PATH_SEGMENT@[44; 49) |
41 | IDENT@[44; 49) "Outer" | 41 | NAME_REF@[44; 49) |
42 | WHITESPACE@[49; 50) " " | 42 | IDENT@[44; 49) "Outer" |
43 | RECORD_FIELD_PAT_LIST@[50; 81) | 43 | WHITESPACE@[49; 50) " " |
44 | L_CURLY@[50; 51) "{" | 44 | RECORD_FIELD_PAT_LIST@[50; 81) |
45 | WHITESPACE@[51; 52) " " | 45 | L_CURLY@[50; 51) "{" |
46 | BOX_PAT@[52; 57) | 46 | WHITESPACE@[51; 52) " " |
47 | BOX_KW@[52; 55) "box" | 47 | BOX_PAT@[52; 57) |
48 | WHITESPACE@[55; 56) " " | 48 | BOX_KW@[52; 55) "box" |
49 | BIND_PAT@[56; 57) | 49 | WHITESPACE@[55; 56) " " |
50 | NAME@[56; 57) | 50 | BIND_PAT@[56; 57) |
51 | IDENT@[56; 57) "i" | 51 | NAME@[56; 57) |
52 | COMMA@[57; 58) "," | 52 | IDENT@[56; 57) "i" |
53 | WHITESPACE@[58; 59) " " | 53 | COMMA@[57; 58) "," |
54 | RECORD_FIELD_PAT@[59; 79) | 54 | WHITESPACE@[58; 59) " " |
55 | NAME@[59; 60) | 55 | RECORD_FIELD_PAT@[59; 79) |
56 | IDENT@[59; 60) "j" | 56 | NAME@[59; 60) |
57 | COLON@[60; 61) ":" | 57 | IDENT@[59; 60) "j" |
58 | WHITESPACE@[61; 62) " " | 58 | COLON@[60; 61) ":" |
59 | BOX_PAT@[62; 79) | 59 | WHITESPACE@[61; 62) " " |
60 | BOX_KW@[62; 65) "box" | 60 | BOX_PAT@[62; 79) |
61 | WHITESPACE@[65; 66) " " | 61 | BOX_KW@[62; 65) "box" |
62 | TUPLE_STRUCT_PAT@[66; 79) | 62 | WHITESPACE@[65; 66) " " |
63 | PATH@[66; 71) | 63 | TUPLE_STRUCT_PAT@[66; 79) |
64 | PATH_SEGMENT@[66; 71) | 64 | PATH@[66; 71) |
65 | NAME_REF@[66; 71) | 65 | PATH_SEGMENT@[66; 71) |
66 | IDENT@[66; 71) "Inner" | 66 | NAME_REF@[66; 71) |
67 | L_PAREN@[71; 72) "(" | 67 | IDENT@[66; 71) "Inner" |
68 | BOX_PAT@[72; 78) | 68 | L_PAREN@[71; 72) "(" |
69 | BOX_KW@[72; 75) "box" | 69 | BOX_PAT@[72; 78) |
70 | WHITESPACE@[75; 76) " " | 70 | BOX_KW@[72; 75) "box" |
71 | REF_PAT@[76; 78) | 71 | WHITESPACE@[75; 76) " " |
72 | AMP@[76; 77) "&" | 72 | REF_PAT@[76; 78) |
73 | BIND_PAT@[77; 78) | 73 | AMP@[76; 77) "&" |
74 | NAME@[77; 78) | 74 | BIND_PAT@[77; 78) |
75 | IDENT@[77; 78) "x" | 75 | NAME@[77; 78) |
76 | R_PAREN@[78; 79) ")" | 76 | IDENT@[77; 78) "x" |
77 | WHITESPACE@[79; 80) " " | 77 | R_PAREN@[78; 79) ")" |
78 | R_CURLY@[80; 81) "}" | 78 | WHITESPACE@[79; 80) " " |
79 | WHITESPACE@[81; 82) " " | 79 | R_CURLY@[80; 81) "}" |
80 | EQ@[82; 83) "=" | 80 | WHITESPACE@[81; 82) " " |
81 | WHITESPACE@[83; 84) " " | 81 | EQ@[82; 83) "=" |
82 | TUPLE_EXPR@[84; 86) | 82 | WHITESPACE@[83; 84) " " |
83 | L_PAREN@[84; 85) "(" | 83 | TUPLE_EXPR@[84; 86) |
84 | R_PAREN@[85; 86) ")" | 84 | L_PAREN@[84; 85) "(" |
85 | SEMI@[86; 87) ";" | 85 | R_PAREN@[85; 86) ")" |
86 | WHITESPACE@[87; 92) "\n " | 86 | SEMI@[86; 87) ";" |
87 | LET_STMT@[92; 115) | 87 | WHITESPACE@[87; 92) "\n " |
88 | LET_KW@[92; 95) "let" | 88 | LET_STMT@[92; 115) |
89 | WHITESPACE@[95; 96) " " | 89 | LET_KW@[92; 95) "let" |
90 | BOX_PAT@[96; 109) | 90 | WHITESPACE@[95; 96) " " |
91 | BOX_KW@[96; 99) "box" | 91 | BOX_PAT@[96; 109) |
92 | WHITESPACE@[99; 100) " " | 92 | BOX_KW@[96; 99) "box" |
93 | BIND_PAT@[100; 109) | 93 | WHITESPACE@[99; 100) " " |
94 | REF_KW@[100; 103) "ref" | 94 | BIND_PAT@[100; 109) |
95 | WHITESPACE@[103; 104) " " | 95 | REF_KW@[100; 103) "ref" |
96 | MUT_KW@[104; 107) "mut" | 96 | WHITESPACE@[103; 104) " " |
97 | WHITESPACE@[107; 108) " " | 97 | MUT_KW@[104; 107) "mut" |
98 | NAME@[108; 109) | 98 | WHITESPACE@[107; 108) " " |
99 | IDENT@[108; 109) "i" | 99 | NAME@[108; 109) |
100 | WHITESPACE@[109; 110) " " | 100 | IDENT@[108; 109) "i" |
101 | EQ@[110; 111) "=" | 101 | WHITESPACE@[109; 110) " " |
102 | WHITESPACE@[111; 112) " " | 102 | EQ@[110; 111) "=" |
103 | TUPLE_EXPR@[112; 114) | 103 | WHITESPACE@[111; 112) " " |
104 | L_PAREN@[112; 113) "(" | 104 | TUPLE_EXPR@[112; 114) |
105 | R_PAREN@[113; 114) ")" | 105 | L_PAREN@[112; 113) "(" |
106 | SEMI@[114; 115) ";" | 106 | R_PAREN@[113; 114) ")" |
107 | WHITESPACE@[115; 116) "\n" | 107 | SEMI@[114; 115) ";" |
108 | R_CURLY@[116; 117) "}" | 108 | WHITESPACE@[115; 116) "\n" |
109 | R_CURLY@[116; 117) "}" | ||
109 | WHITESPACE@[117; 118) "\n" | 110 | WHITESPACE@[117; 118) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0005_fn_item.txt b/crates/ra_syntax/test_data/parser/ok/0005_fn_item.txt index 9b63a24e4..955b789b5 100644 --- a/crates/ra_syntax/test_data/parser/ok/0005_fn_item.txt +++ b/crates/ra_syntax/test_data/parser/ok/0005_fn_item.txt | |||
@@ -8,8 +8,9 @@ SOURCE_FILE@[0; 13) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 12) | 11 | BLOCK_EXPR@[9; 12) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 12) |
13 | WHITESPACE@[10; 11) "\n" | 13 | L_CURLY@[9; 10) "{" |
14 | R_CURLY@[11; 12) "}" | 14 | WHITESPACE@[10; 11) "\n" |
15 | R_CURLY@[11; 12) "}" | ||
15 | WHITESPACE@[12; 13) "\n" | 16 | WHITESPACE@[12; 13) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.txt b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.txt index 5c16d0be6..35465632d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.txt +++ b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.txt | |||
@@ -35,10 +35,11 @@ SOURCE_FILE@[0; 118) | |||
35 | L_PAREN@[37; 38) "(" | 35 | L_PAREN@[37; 38) "(" |
36 | R_PAREN@[38; 39) ")" | 36 | R_PAREN@[38; 39) ")" |
37 | WHITESPACE@[39; 40) " " | 37 | WHITESPACE@[39; 40) " " |
38 | BLOCK@[40; 47) | 38 | BLOCK_EXPR@[40; 47) |
39 | L_CURLY@[40; 41) "{" | 39 | BLOCK@[40; 47) |
40 | WHITESPACE@[41; 46) "\n " | 40 | L_CURLY@[40; 41) "{" |
41 | R_CURLY@[46; 47) "}" | 41 | WHITESPACE@[41; 46) "\n " |
42 | R_CURLY@[46; 47) "}" | ||
42 | WHITESPACE@[47; 52) "\n " | 43 | WHITESPACE@[47; 52) "\n " |
43 | STRUCT_DEF@[52; 63) | 44 | STRUCT_DEF@[52; 63) |
44 | STRUCT_KW@[52; 58) "struct" | 45 | STRUCT_KW@[52; 58) "struct" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.txt b/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.txt index 2a0dc7bad..a845c5c24 100644 --- a/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.txt +++ b/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.txt | |||
@@ -26,7 +26,8 @@ SOURCE_FILE@[0; 35) | |||
26 | L_PAREN@[29; 30) "(" | 26 | L_PAREN@[29; 30) "(" |
27 | R_PAREN@[30; 31) ")" | 27 | R_PAREN@[30; 31) ")" |
28 | WHITESPACE@[31; 32) " " | 28 | WHITESPACE@[31; 32) " " |
29 | BLOCK@[32; 34) | 29 | BLOCK_EXPR@[32; 34) |
30 | L_CURLY@[32; 33) "{" | 30 | BLOCK@[32; 34) |
31 | R_CURLY@[33; 34) "}" | 31 | L_CURLY@[32; 33) "{" |
32 | R_CURLY@[33; 34) "}" | ||
32 | WHITESPACE@[34; 35) "\n" | 33 | WHITESPACE@[34; 35) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0012_visibility.txt b/crates/ra_syntax/test_data/parser/ok/0012_visibility.txt index c9d038c19..68e692fd0 100644 --- a/crates/ra_syntax/test_data/parser/ok/0012_visibility.txt +++ b/crates/ra_syntax/test_data/parser/ok/0012_visibility.txt | |||
@@ -8,9 +8,10 @@ SOURCE_FILE@[0; 98) | |||
8 | L_PAREN@[4; 5) "(" | 8 | L_PAREN@[4; 5) "(" |
9 | R_PAREN@[5; 6) ")" | 9 | R_PAREN@[5; 6) ")" |
10 | WHITESPACE@[6; 7) " " | 10 | WHITESPACE@[6; 7) " " |
11 | BLOCK@[7; 9) | 11 | BLOCK_EXPR@[7; 9) |
12 | L_CURLY@[7; 8) "{" | 12 | BLOCK@[7; 9) |
13 | R_CURLY@[8; 9) "}" | 13 | L_CURLY@[7; 8) "{" |
14 | R_CURLY@[8; 9) "}" | ||
14 | WHITESPACE@[9; 10) "\n" | 15 | WHITESPACE@[9; 10) "\n" |
15 | FN_DEF@[10; 23) | 16 | FN_DEF@[10; 23) |
16 | VISIBILITY@[10; 13) | 17 | VISIBILITY@[10; 13) |
@@ -24,9 +25,10 @@ SOURCE_FILE@[0; 98) | |||
24 | L_PAREN@[18; 19) "(" | 25 | L_PAREN@[18; 19) "(" |
25 | R_PAREN@[19; 20) ")" | 26 | R_PAREN@[19; 20) ")" |
26 | WHITESPACE@[20; 21) " " | 27 | WHITESPACE@[20; 21) " " |
27 | BLOCK@[21; 23) | 28 | BLOCK_EXPR@[21; 23) |
28 | L_CURLY@[21; 22) "{" | 29 | BLOCK@[21; 23) |
29 | R_CURLY@[22; 23) "}" | 30 | L_CURLY@[21; 22) "{" |
31 | R_CURLY@[22; 23) "}" | ||
30 | WHITESPACE@[23; 24) "\n" | 32 | WHITESPACE@[23; 24) "\n" |
31 | FN_DEF@[24; 44) | 33 | FN_DEF@[24; 44) |
32 | VISIBILITY@[24; 34) | 34 | VISIBILITY@[24; 34) |
@@ -43,9 +45,10 @@ SOURCE_FILE@[0; 98) | |||
43 | L_PAREN@[39; 40) "(" | 45 | L_PAREN@[39; 40) "(" |
44 | R_PAREN@[40; 41) ")" | 46 | R_PAREN@[40; 41) ")" |
45 | WHITESPACE@[41; 42) " " | 47 | WHITESPACE@[41; 42) " " |
46 | BLOCK@[42; 44) | 48 | BLOCK_EXPR@[42; 44) |
47 | L_CURLY@[42; 43) "{" | 49 | BLOCK@[42; 44) |
48 | R_CURLY@[43; 44) "}" | 50 | L_CURLY@[42; 43) "{" |
51 | R_CURLY@[43; 44) "}" | ||
49 | WHITESPACE@[44; 45) "\n" | 52 | WHITESPACE@[44; 45) "\n" |
50 | FN_DEF@[45; 65) | 53 | FN_DEF@[45; 65) |
51 | VISIBILITY@[45; 55) | 54 | VISIBILITY@[45; 55) |
@@ -62,9 +65,10 @@ SOURCE_FILE@[0; 98) | |||
62 | L_PAREN@[60; 61) "(" | 65 | L_PAREN@[60; 61) "(" |
63 | R_PAREN@[61; 62) ")" | 66 | R_PAREN@[61; 62) ")" |
64 | WHITESPACE@[62; 63) " " | 67 | WHITESPACE@[62; 63) " " |
65 | BLOCK@[63; 65) | 68 | BLOCK_EXPR@[63; 65) |
66 | L_CURLY@[63; 64) "{" | 69 | BLOCK@[63; 65) |
67 | R_CURLY@[64; 65) "}" | 70 | L_CURLY@[63; 64) "{" |
71 | R_CURLY@[64; 65) "}" | ||
68 | WHITESPACE@[65; 66) "\n" | 72 | WHITESPACE@[65; 66) "\n" |
69 | FN_DEF@[66; 97) | 73 | FN_DEF@[66; 97) |
70 | VISIBILITY@[66; 87) | 74 | VISIBILITY@[66; 87) |
@@ -96,7 +100,8 @@ SOURCE_FILE@[0; 98) | |||
96 | L_PAREN@[92; 93) "(" | 100 | L_PAREN@[92; 93) "(" |
97 | R_PAREN@[93; 94) ")" | 101 | R_PAREN@[93; 94) ")" |
98 | WHITESPACE@[94; 95) " " | 102 | WHITESPACE@[94; 95) " " |
99 | BLOCK@[95; 97) | 103 | BLOCK_EXPR@[95; 97) |
100 | L_CURLY@[95; 96) "{" | 104 | BLOCK@[95; 97) |
101 | R_CURLY@[96; 97) "}" | 105 | L_CURLY@[95; 96) "{" |
106 | R_CURLY@[96; 97) "}" | ||
102 | WHITESPACE@[97; 98) "\n" | 107 | WHITESPACE@[97; 98) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.txt b/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.txt index cd8f038de..a1084b221 100644 --- a/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.txt +++ b/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.txt | |||
@@ -20,7 +20,8 @@ SOURCE_FILE@[0; 23) | |||
20 | L_PAREN@[17; 18) "(" | 20 | L_PAREN@[17; 18) "(" |
21 | R_PAREN@[18; 19) ")" | 21 | R_PAREN@[18; 19) ")" |
22 | WHITESPACE@[19; 20) " " | 22 | WHITESPACE@[19; 20) " " |
23 | BLOCK@[20; 22) | 23 | BLOCK_EXPR@[20; 22) |
24 | L_CURLY@[20; 21) "{" | 24 | BLOCK@[20; 22) |
25 | R_CURLY@[21; 22) "}" | 25 | L_CURLY@[20; 21) "{" |
26 | R_CURLY@[21; 22) "}" | ||
26 | WHITESPACE@[22; 23) "\n" | 27 | WHITESPACE@[22; 23) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.txt b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.txt index a4e75ec75..974fb9c44 100644 --- a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.txt +++ b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.txt | |||
@@ -11,10 +11,11 @@ SOURCE_FILE@[0; 71) | |||
11 | L_PAREN@[13; 14) "(" | 11 | L_PAREN@[13; 14) "(" |
12 | R_PAREN@[14; 15) ")" | 12 | R_PAREN@[14; 15) ")" |
13 | WHITESPACE@[15; 16) " " | 13 | WHITESPACE@[15; 16) " " |
14 | BLOCK@[16; 19) | 14 | BLOCK_EXPR@[16; 19) |
15 | L_CURLY@[16; 17) "{" | 15 | BLOCK@[16; 19) |
16 | WHITESPACE@[17; 18) "\n" | 16 | L_CURLY@[16; 17) "{" |
17 | R_CURLY@[18; 19) "}" | 17 | WHITESPACE@[17; 18) "\n" |
18 | R_CURLY@[18; 19) "}" | ||
18 | WHITESPACE@[19; 21) "\n\n" | 19 | WHITESPACE@[19; 21) "\n\n" |
19 | FN_DEF@[21; 44) | 20 | FN_DEF@[21; 44) |
20 | ABI@[21; 31) | 21 | ABI@[21; 31) |
@@ -30,10 +31,11 @@ SOURCE_FILE@[0; 71) | |||
30 | L_PAREN@[38; 39) "(" | 31 | L_PAREN@[38; 39) "(" |
31 | R_PAREN@[39; 40) ")" | 32 | R_PAREN@[39; 40) ")" |
32 | WHITESPACE@[40; 41) " " | 33 | WHITESPACE@[40; 41) " " |
33 | BLOCK@[41; 44) | 34 | BLOCK_EXPR@[41; 44) |
34 | L_CURLY@[41; 42) "{" | 35 | BLOCK@[41; 44) |
35 | WHITESPACE@[42; 43) "\n" | 36 | L_CURLY@[41; 42) "{" |
36 | R_CURLY@[43; 44) "}" | 37 | WHITESPACE@[42; 43) "\n" |
38 | R_CURLY@[43; 44) "}" | ||
37 | WHITESPACE@[44; 46) "\n\n" | 39 | WHITESPACE@[44; 46) "\n\n" |
38 | FN_DEF@[46; 70) | 40 | FN_DEF@[46; 70) |
39 | ABI@[46; 57) | 41 | ABI@[46; 57) |
@@ -49,8 +51,9 @@ SOURCE_FILE@[0; 71) | |||
49 | L_PAREN@[64; 65) "(" | 51 | L_PAREN@[64; 65) "(" |
50 | R_PAREN@[65; 66) ")" | 52 | R_PAREN@[65; 66) ")" |
51 | WHITESPACE@[66; 67) " " | 53 | WHITESPACE@[66; 67) " " |
52 | BLOCK@[67; 70) | 54 | BLOCK_EXPR@[67; 70) |
53 | L_CURLY@[67; 68) "{" | 55 | BLOCK@[67; 70) |
54 | WHITESPACE@[68; 69) "\n" | 56 | L_CURLY@[67; 68) "{" |
55 | R_CURLY@[69; 70) "}" | 57 | WHITESPACE@[68; 69) "\n" |
58 | R_CURLY@[69; 70) "}" | ||
56 | WHITESPACE@[70; 71) "\n" | 59 | WHITESPACE@[70; 71) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.txt b/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.txt index a345f4bc2..f5a7a1a5a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.txt +++ b/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.txt | |||
@@ -8,24 +8,26 @@ SOURCE_FILE@[0; 35) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 34) | 11 | BLOCK_EXPR@[10; 34) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 34) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | FN_DEF@[16; 32) | 14 | WHITESPACE@[11; 16) "\n " |
15 | ABI@[16; 22) | 15 | FN_DEF@[16; 32) |
16 | EXTERN_KW@[16; 22) "extern" | 16 | ABI@[16; 22) |
17 | WHITESPACE@[22; 23) " " | 17 | EXTERN_KW@[16; 22) "extern" |
18 | FN_KW@[23; 25) "fn" | 18 | WHITESPACE@[22; 23) " " |
19 | WHITESPACE@[25; 26) " " | 19 | FN_KW@[23; 25) "fn" |
20 | NAME@[26; 27) | 20 | WHITESPACE@[25; 26) " " |
21 | IDENT@[26; 27) "f" | 21 | NAME@[26; 27) |
22 | PARAM_LIST@[27; 29) | 22 | IDENT@[26; 27) "f" |
23 | L_PAREN@[27; 28) "(" | 23 | PARAM_LIST@[27; 29) |
24 | R_PAREN@[28; 29) ")" | 24 | L_PAREN@[27; 28) "(" |
25 | WHITESPACE@[29; 30) " " | 25 | R_PAREN@[28; 29) ")" |
26 | BLOCK@[30; 32) | 26 | WHITESPACE@[29; 30) " " |
27 | L_CURLY@[30; 31) "{" | 27 | BLOCK_EXPR@[30; 32) |
28 | R_CURLY@[31; 32) "}" | 28 | BLOCK@[30; 32) |
29 | WHITESPACE@[32; 33) "\n" | 29 | L_CURLY@[30; 31) "{" |
30 | R_CURLY@[33; 34) "}" | 30 | R_CURLY@[31; 32) "}" |
31 | WHITESPACE@[32; 33) "\n" | ||
32 | R_CURLY@[33; 34) "}" | ||
31 | WHITESPACE@[34; 35) "\n" | 33 | WHITESPACE@[34; 35) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.txt b/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.txt index cbcd15a00..f9b1dcf1a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.txt +++ b/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.txt | |||
@@ -8,23 +8,25 @@ SOURCE_FILE@[0; 34) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 33) | 11 | BLOCK_EXPR@[10; 33) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 33) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | FN_DEF@[16; 31) | 14 | WHITESPACE@[11; 16) "\n " |
15 | CONST_KW@[16; 21) "const" | 15 | FN_DEF@[16; 31) |
16 | WHITESPACE@[21; 22) " " | 16 | CONST_KW@[16; 21) "const" |
17 | FN_KW@[22; 24) "fn" | 17 | WHITESPACE@[21; 22) " " |
18 | WHITESPACE@[24; 25) " " | 18 | FN_KW@[22; 24) "fn" |
19 | NAME@[25; 26) | 19 | WHITESPACE@[24; 25) " " |
20 | IDENT@[25; 26) "f" | 20 | NAME@[25; 26) |
21 | PARAM_LIST@[26; 28) | 21 | IDENT@[25; 26) "f" |
22 | L_PAREN@[26; 27) "(" | 22 | PARAM_LIST@[26; 28) |
23 | R_PAREN@[27; 28) ")" | 23 | L_PAREN@[26; 27) "(" |
24 | WHITESPACE@[28; 29) " " | 24 | R_PAREN@[27; 28) ")" |
25 | BLOCK@[29; 31) | 25 | WHITESPACE@[28; 29) " " |
26 | L_CURLY@[29; 30) "{" | 26 | BLOCK_EXPR@[29; 31) |
27 | R_CURLY@[30; 31) "}" | 27 | BLOCK@[29; 31) |
28 | WHITESPACE@[31; 32) "\n" | 28 | L_CURLY@[29; 30) "{" |
29 | R_CURLY@[32; 33) "}" | 29 | R_CURLY@[30; 31) "}" |
30 | WHITESPACE@[31; 32) "\n" | ||
31 | R_CURLY@[32; 33) "}" | ||
30 | WHITESPACE@[33; 34) "\n" | 32 | WHITESPACE@[33; 34) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.txt b/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.txt index f86375983..9fb7b70a0 100644 --- a/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.txt +++ b/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.txt | |||
@@ -8,34 +8,36 @@ SOURCE_FILE@[0; 53) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 52) | 11 | BLOCK_EXPR@[10; 52) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 52) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | FN_DEF@[16; 32) | 14 | WHITESPACE@[11; 16) "\n " |
15 | UNSAFE_KW@[16; 22) "unsafe" | 15 | FN_DEF@[16; 32) |
16 | WHITESPACE@[22; 23) " " | 16 | UNSAFE_KW@[16; 22) "unsafe" |
17 | FN_KW@[23; 25) "fn" | 17 | WHITESPACE@[22; 23) " " |
18 | WHITESPACE@[25; 26) " " | 18 | FN_KW@[23; 25) "fn" |
19 | NAME@[26; 27) | 19 | WHITESPACE@[25; 26) " " |
20 | IDENT@[26; 27) "f" | 20 | NAME@[26; 27) |
21 | PARAM_LIST@[27; 29) | 21 | IDENT@[26; 27) "f" |
22 | L_PAREN@[27; 28) "(" | 22 | PARAM_LIST@[27; 29) |
23 | R_PAREN@[28; 29) ")" | 23 | L_PAREN@[27; 28) "(" |
24 | WHITESPACE@[29; 30) " " | 24 | R_PAREN@[28; 29) ")" |
25 | BLOCK@[30; 32) | 25 | WHITESPACE@[29; 30) " " |
26 | L_CURLY@[30; 31) "{" | 26 | BLOCK_EXPR@[30; 32) |
27 | R_CURLY@[31; 32) "}" | 27 | BLOCK@[30; 32) |
28 | WHITESPACE@[32; 37) "\n " | 28 | L_CURLY@[30; 31) "{" |
29 | BLOCK_EXPR@[37; 50) | 29 | R_CURLY@[31; 32) "}" |
30 | UNSAFE_KW@[37; 43) "unsafe" | 30 | WHITESPACE@[32; 37) "\n " |
31 | WHITESPACE@[43; 44) " " | 31 | BLOCK_EXPR@[37; 50) |
32 | BLOCK@[44; 50) | 32 | UNSAFE_KW@[37; 43) "unsafe" |
33 | L_CURLY@[44; 45) "{" | 33 | WHITESPACE@[43; 44) " " |
34 | WHITESPACE@[45; 46) " " | 34 | BLOCK@[44; 50) |
35 | LITERAL@[46; 48) | 35 | L_CURLY@[44; 45) "{" |
36 | INT_NUMBER@[46; 48) "92" | 36 | WHITESPACE@[45; 46) " " |
37 | WHITESPACE@[48; 49) " " | 37 | LITERAL@[46; 48) |
38 | R_CURLY@[49; 50) "}" | 38 | INT_NUMBER@[46; 48) "92" |
39 | WHITESPACE@[50; 51) "\n" | 39 | WHITESPACE@[48; 49) " " |
40 | R_CURLY@[51; 52) "}" | 40 | R_CURLY@[49; 50) "}" |
41 | WHITESPACE@[50; 51) "\n" | ||
42 | R_CURLY@[51; 52) "}" | ||
41 | WHITESPACE@[52; 53) "\n" | 43 | WHITESPACE@[52; 53) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.txt b/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.txt index b0667643b..afca1fba2 100644 --- a/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.txt +++ b/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.txt | |||
@@ -8,178 +8,179 @@ SOURCE_FILE@[0; 248) | |||
8 | L_PAREN@[16; 17) "(" | 8 | L_PAREN@[16; 17) "(" |
9 | R_PAREN@[17; 18) ")" | 9 | R_PAREN@[17; 18) ")" |
10 | WHITESPACE@[18; 19) " " | 10 | WHITESPACE@[18; 19) " " |
11 | BLOCK@[19; 247) | 11 | BLOCK_EXPR@[19; 247) |
12 | L_CURLY@[19; 20) "{" | 12 | BLOCK@[19; 247) |
13 | WHITESPACE@[20; 25) "\n " | 13 | L_CURLY@[19; 20) "{" |
14 | LET_STMT@[25; 55) | 14 | WHITESPACE@[20; 25) "\n " |
15 | LET_KW@[25; 28) "let" | 15 | LET_STMT@[25; 55) |
16 | WHITESPACE@[28; 29) " " | 16 | LET_KW@[25; 28) "let" |
17 | BIND_PAT@[29; 30) | 17 | WHITESPACE@[28; 29) " " |
18 | NAME@[29; 30) | 18 | BIND_PAT@[29; 30) |
19 | IDENT@[29; 30) "x" | 19 | NAME@[29; 30) |
20 | WHITESPACE@[30; 31) " " | 20 | IDENT@[29; 30) "x" |
21 | EQ@[31; 32) "=" | 21 | WHITESPACE@[30; 31) " " |
22 | WHITESPACE@[32; 33) " " | 22 | EQ@[31; 32) "=" |
23 | BIN_EXPR@[33; 54) | 23 | WHITESPACE@[32; 33) " " |
24 | BIN_EXPR@[33; 46) | 24 | BIN_EXPR@[33; 54) |
25 | LITERAL@[33; 34) | 25 | BIN_EXPR@[33; 46) |
26 | INT_NUMBER@[33; 34) "1" | 26 | LITERAL@[33; 34) |
27 | WHITESPACE@[34; 35) " " | 27 | INT_NUMBER@[33; 34) "1" |
28 | PLUS@[35; 36) "+" | 28 | WHITESPACE@[34; 35) " " |
29 | WHITESPACE@[36; 37) " " | 29 | PLUS@[35; 36) "+" |
30 | BIN_EXPR@[37; 46) | 30 | WHITESPACE@[36; 37) " " |
31 | BIN_EXPR@[37; 42) | 31 | BIN_EXPR@[37; 46) |
32 | LITERAL@[37; 38) | 32 | BIN_EXPR@[37; 42) |
33 | INT_NUMBER@[37; 38) "2" | 33 | LITERAL@[37; 38) |
34 | WHITESPACE@[38; 39) " " | 34 | INT_NUMBER@[37; 38) "2" |
35 | STAR@[39; 40) "*" | 35 | WHITESPACE@[38; 39) " " |
36 | WHITESPACE@[40; 41) " " | 36 | STAR@[39; 40) "*" |
37 | LITERAL@[41; 42) | 37 | WHITESPACE@[40; 41) " " |
38 | INT_NUMBER@[41; 42) "3" | 38 | LITERAL@[41; 42) |
39 | WHITESPACE@[42; 43) " " | 39 | INT_NUMBER@[41; 42) "3" |
40 | PERCENT@[43; 44) "%" | 40 | WHITESPACE@[42; 43) " " |
41 | WHITESPACE@[44; 45) " " | 41 | PERCENT@[43; 44) "%" |
42 | LITERAL@[45; 46) | 42 | WHITESPACE@[44; 45) " " |
43 | INT_NUMBER@[45; 46) "4" | 43 | LITERAL@[45; 46) |
44 | WHITESPACE@[46; 47) " " | 44 | INT_NUMBER@[45; 46) "4" |
45 | MINUS@[47; 48) "-" | 45 | WHITESPACE@[46; 47) " " |
46 | WHITESPACE@[48; 49) " " | 46 | MINUS@[47; 48) "-" |
47 | BIN_EXPR@[49; 54) | 47 | WHITESPACE@[48; 49) " " |
48 | LITERAL@[49; 50) | 48 | BIN_EXPR@[49; 54) |
49 | INT_NUMBER@[49; 50) "5" | 49 | LITERAL@[49; 50) |
50 | WHITESPACE@[50; 51) " " | 50 | INT_NUMBER@[49; 50) "5" |
51 | SLASH@[51; 52) "/" | 51 | WHITESPACE@[50; 51) " " |
52 | WHITESPACE@[52; 53) " " | 52 | SLASH@[51; 52) "/" |
53 | LITERAL@[53; 54) | 53 | WHITESPACE@[52; 53) " " |
54 | INT_NUMBER@[53; 54) "6" | 54 | LITERAL@[53; 54) |
55 | SEMI@[54; 55) ";" | 55 | INT_NUMBER@[53; 54) "6" |
56 | WHITESPACE@[55; 60) "\n " | 56 | SEMI@[54; 55) ";" |
57 | EXPR_STMT@[60; 70) | 57 | WHITESPACE@[55; 60) "\n " |
58 | BIN_EXPR@[60; 69) | 58 | EXPR_STMT@[60; 70) |
59 | LITERAL@[60; 61) | 59 | BIN_EXPR@[60; 69) |
60 | INT_NUMBER@[60; 61) "1" | 60 | LITERAL@[60; 61) |
61 | WHITESPACE@[61; 62) " " | 61 | INT_NUMBER@[60; 61) "1" |
62 | PLUS@[62; 63) "+" | 62 | WHITESPACE@[61; 62) " " |
63 | WHITESPACE@[63; 64) " " | 63 | PLUS@[62; 63) "+" |
64 | BIN_EXPR@[64; 69) | 64 | WHITESPACE@[63; 64) " " |
65 | LITERAL@[64; 65) | 65 | BIN_EXPR@[64; 69) |
66 | INT_NUMBER@[64; 65) "2" | 66 | LITERAL@[64; 65) |
67 | WHITESPACE@[65; 66) " " | 67 | INT_NUMBER@[64; 65) "2" |
68 | STAR@[66; 67) "*" | 68 | WHITESPACE@[65; 66) " " |
69 | WHITESPACE@[67; 68) " " | 69 | STAR@[66; 67) "*" |
70 | LITERAL@[68; 69) | 70 | WHITESPACE@[67; 68) " " |
71 | INT_NUMBER@[68; 69) "3" | 71 | LITERAL@[68; 69) |
72 | SEMI@[69; 70) ";" | 72 | INT_NUMBER@[68; 69) "3" |
73 | WHITESPACE@[70; 75) "\n " | 73 | SEMI@[69; 70) ";" |
74 | EXPR_STMT@[75; 86) | 74 | WHITESPACE@[70; 75) "\n " |
75 | BIN_EXPR@[75; 85) | 75 | EXPR_STMT@[75; 86) |
76 | LITERAL@[75; 76) | 76 | BIN_EXPR@[75; 85) |
77 | INT_NUMBER@[75; 76) "1" | 77 | LITERAL@[75; 76) |
78 | WHITESPACE@[76; 77) " " | 78 | INT_NUMBER@[75; 76) "1" |
79 | SHL@[77; 79) "<<" | 79 | WHITESPACE@[76; 77) " " |
80 | WHITESPACE@[79; 80) " " | 80 | SHL@[77; 79) "<<" |
81 | BIN_EXPR@[80; 85) | 81 | WHITESPACE@[79; 80) " " |
82 | LITERAL@[80; 81) | 82 | BIN_EXPR@[80; 85) |
83 | INT_NUMBER@[80; 81) "2" | 83 | LITERAL@[80; 81) |
84 | WHITESPACE@[81; 82) " " | 84 | INT_NUMBER@[80; 81) "2" |
85 | PLUS@[82; 83) "+" | 85 | WHITESPACE@[81; 82) " " |
86 | WHITESPACE@[83; 84) " " | 86 | PLUS@[82; 83) "+" |
87 | LITERAL@[84; 85) | 87 | WHITESPACE@[83; 84) " " |
88 | INT_NUMBER@[84; 85) "3" | 88 | LITERAL@[84; 85) |
89 | SEMI@[85; 86) ";" | 89 | INT_NUMBER@[84; 85) "3" |
90 | WHITESPACE@[86; 91) "\n " | 90 | SEMI@[85; 86) ";" |
91 | EXPR_STMT@[91; 102) | 91 | WHITESPACE@[86; 91) "\n " |
92 | BIN_EXPR@[91; 101) | 92 | EXPR_STMT@[91; 102) |
93 | LITERAL@[91; 92) | 93 | BIN_EXPR@[91; 101) |
94 | INT_NUMBER@[91; 92) "1" | 94 | LITERAL@[91; 92) |
95 | WHITESPACE@[92; 93) " " | 95 | INT_NUMBER@[91; 92) "1" |
96 | AMP@[93; 94) "&" | 96 | WHITESPACE@[92; 93) " " |
97 | WHITESPACE@[94; 95) " " | 97 | AMP@[93; 94) "&" |
98 | BIN_EXPR@[95; 101) | 98 | WHITESPACE@[94; 95) " " |
99 | LITERAL@[95; 96) | 99 | BIN_EXPR@[95; 101) |
100 | INT_NUMBER@[95; 96) "2" | 100 | LITERAL@[95; 96) |
101 | WHITESPACE@[96; 97) " " | 101 | INT_NUMBER@[95; 96) "2" |
102 | SHR@[97; 99) ">>" | 102 | WHITESPACE@[96; 97) " " |
103 | WHITESPACE@[99; 100) " " | 103 | SHR@[97; 99) ">>" |
104 | LITERAL@[100; 101) | 104 | WHITESPACE@[99; 100) " " |
105 | INT_NUMBER@[100; 101) "3" | 105 | LITERAL@[100; 101) |
106 | SEMI@[101; 102) ";" | 106 | INT_NUMBER@[100; 101) "3" |
107 | WHITESPACE@[102; 107) "\n " | 107 | SEMI@[101; 102) ";" |
108 | EXPR_STMT@[107; 117) | 108 | WHITESPACE@[102; 107) "\n " |
109 | BIN_EXPR@[107; 116) | 109 | EXPR_STMT@[107; 117) |
110 | LITERAL@[107; 108) | 110 | BIN_EXPR@[107; 116) |
111 | INT_NUMBER@[107; 108) "1" | 111 | LITERAL@[107; 108) |
112 | WHITESPACE@[108; 109) " " | 112 | INT_NUMBER@[107; 108) "1" |
113 | CARET@[109; 110) "^" | 113 | WHITESPACE@[108; 109) " " |
114 | WHITESPACE@[110; 111) " " | 114 | CARET@[109; 110) "^" |
115 | BIN_EXPR@[111; 116) | 115 | WHITESPACE@[110; 111) " " |
116 | LITERAL@[111; 112) | 116 | BIN_EXPR@[111; 116) |
117 | INT_NUMBER@[111; 112) "2" | 117 | LITERAL@[111; 112) |
118 | WHITESPACE@[112; 113) " " | 118 | INT_NUMBER@[111; 112) "2" |
119 | AMP@[113; 114) "&" | 119 | WHITESPACE@[112; 113) " " |
120 | WHITESPACE@[114; 115) " " | 120 | AMP@[113; 114) "&" |
121 | LITERAL@[115; 116) | 121 | WHITESPACE@[114; 115) " " |
122 | INT_NUMBER@[115; 116) "3" | 122 | LITERAL@[115; 116) |
123 | SEMI@[116; 117) ";" | 123 | INT_NUMBER@[115; 116) "3" |
124 | WHITESPACE@[117; 122) "\n " | 124 | SEMI@[116; 117) ";" |
125 | EXPR_STMT@[122; 132) | 125 | WHITESPACE@[117; 122) "\n " |
126 | BIN_EXPR@[122; 131) | 126 | EXPR_STMT@[122; 132) |
127 | LITERAL@[122; 123) | 127 | BIN_EXPR@[122; 131) |
128 | INT_NUMBER@[122; 123) "1" | 128 | LITERAL@[122; 123) |
129 | WHITESPACE@[123; 124) " " | 129 | INT_NUMBER@[122; 123) "1" |
130 | PIPE@[124; 125) "|" | 130 | WHITESPACE@[123; 124) " " |
131 | WHITESPACE@[125; 126) " " | 131 | PIPE@[124; 125) "|" |
132 | BIN_EXPR@[126; 131) | 132 | WHITESPACE@[125; 126) " " |
133 | LITERAL@[126; 127) | 133 | BIN_EXPR@[126; 131) |
134 | INT_NUMBER@[126; 127) "2" | 134 | LITERAL@[126; 127) |
135 | WHITESPACE@[127; 128) " " | 135 | INT_NUMBER@[126; 127) "2" |
136 | CARET@[128; 129) "^" | 136 | WHITESPACE@[127; 128) " " |
137 | WHITESPACE@[129; 130) " " | 137 | CARET@[128; 129) "^" |
138 | LITERAL@[130; 131) | 138 | WHITESPACE@[129; 130) " " |
139 | INT_NUMBER@[130; 131) "3" | 139 | LITERAL@[130; 131) |
140 | SEMI@[131; 132) ";" | 140 | INT_NUMBER@[130; 131) "3" |
141 | WHITESPACE@[132; 137) "\n " | 141 | SEMI@[131; 132) ";" |
142 | EXPR_STMT@[137; 148) | 142 | WHITESPACE@[132; 137) "\n " |
143 | BIN_EXPR@[137; 147) | 143 | EXPR_STMT@[137; 148) |
144 | LITERAL@[137; 138) | 144 | BIN_EXPR@[137; 147) |
145 | INT_NUMBER@[137; 138) "1" | 145 | LITERAL@[137; 138) |
146 | WHITESPACE@[138; 139) " " | 146 | INT_NUMBER@[137; 138) "1" |
147 | EQEQ@[139; 141) "==" | 147 | WHITESPACE@[138; 139) " " |
148 | WHITESPACE@[141; 142) " " | 148 | EQEQ@[139; 141) "==" |
149 | BIN_EXPR@[142; 147) | 149 | WHITESPACE@[141; 142) " " |
150 | LITERAL@[142; 143) | 150 | BIN_EXPR@[142; 147) |
151 | INT_NUMBER@[142; 143) "2" | 151 | LITERAL@[142; 143) |
152 | WHITESPACE@[143; 144) " " | 152 | INT_NUMBER@[142; 143) "2" |
153 | PIPE@[144; 145) "|" | 153 | WHITESPACE@[143; 144) " " |
154 | WHITESPACE@[145; 146) " " | 154 | PIPE@[144; 145) "|" |
155 | LITERAL@[146; 147) | 155 | WHITESPACE@[145; 146) " " |
156 | INT_NUMBER@[146; 147) "3" | 156 | LITERAL@[146; 147) |
157 | SEMI@[147; 148) ";" | 157 | INT_NUMBER@[146; 147) "3" |
158 | WHITESPACE@[148; 153) "\n " | 158 | SEMI@[147; 148) ";" |
159 | EXPR_STMT@[153; 165) | 159 | WHITESPACE@[148; 153) "\n " |
160 | BIN_EXPR@[153; 164) | 160 | EXPR_STMT@[153; 165) |
161 | LITERAL@[153; 154) | 161 | BIN_EXPR@[153; 164) |
162 | INT_NUMBER@[153; 154) "1" | 162 | LITERAL@[153; 154) |
163 | WHITESPACE@[154; 155) " " | 163 | INT_NUMBER@[153; 154) "1" |
164 | AMPAMP@[155; 157) "&&" | 164 | WHITESPACE@[154; 155) " " |
165 | WHITESPACE@[157; 158) " " | 165 | AMPAMP@[155; 157) "&&" |
166 | BIN_EXPR@[158; 164) | 166 | WHITESPACE@[157; 158) " " |
167 | LITERAL@[158; 159) | 167 | BIN_EXPR@[158; 164) |
168 | INT_NUMBER@[158; 159) "2" | 168 | LITERAL@[158; 159) |
169 | WHITESPACE@[159; 160) " " | 169 | INT_NUMBER@[158; 159) "2" |
170 | EQEQ@[160; 162) "==" | 170 | WHITESPACE@[159; 160) " " |
171 | WHITESPACE@[162; 163) " " | 171 | EQEQ@[160; 162) "==" |
172 | LITERAL@[163; 164) | 172 | WHITESPACE@[162; 163) " " |
173 | INT_NUMBER@[163; 164) "3" | 173 | LITERAL@[163; 164) |
174 | SEMI@[164; 165) ";" | 174 | INT_NUMBER@[163; 164) "3" |
175 | WHITESPACE@[165; 170) "\n " | 175 | SEMI@[164; 165) ";" |
176 | COMMENT@[170; 184) "//1 || 2 && 2;" | 176 | WHITESPACE@[165; 170) "\n " |
177 | WHITESPACE@[184; 189) "\n " | 177 | COMMENT@[170; 184) "//1 || 2 && 2;" |
178 | COMMENT@[189; 203) "//1 .. 2 || 3;" | 178 | WHITESPACE@[184; 189) "\n " |
179 | WHITESPACE@[203; 208) "\n " | 179 | COMMENT@[189; 203) "//1 .. 2 || 3;" |
180 | COMMENT@[208; 221) "//1 = 2 .. 3;" | 180 | WHITESPACE@[203; 208) "\n " |
181 | WHITESPACE@[221; 226) "\n " | 181 | COMMENT@[208; 221) "//1 = 2 .. 3;" |
182 | COMMENT@[226; 245) "//---&*1 - --2 * 9;" | 182 | WHITESPACE@[221; 226) "\n " |
183 | WHITESPACE@[245; 246) "\n" | 183 | COMMENT@[226; 245) "//---&*1 - --2 * 9;" |
184 | R_CURLY@[246; 247) "}" | 184 | WHITESPACE@[245; 246) "\n" |
185 | R_CURLY@[246; 247) "}" | ||
185 | WHITESPACE@[247; 248) "\n" | 186 | WHITESPACE@[247; 248) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0029_range_forms.txt b/crates/ra_syntax/test_data/parser/ok/0029_range_forms.txt index e4db98c88..95dae4870 100644 --- a/crates/ra_syntax/test_data/parser/ok/0029_range_forms.txt +++ b/crates/ra_syntax/test_data/parser/ok/0029_range_forms.txt | |||
@@ -8,144 +8,145 @@ SOURCE_FILE@[0; 153) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 152) | 11 | BLOCK_EXPR@[9; 152) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 152) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 23) | 14 | WHITESPACE@[10; 15) "\n " |
15 | RANGE_EXPR@[15; 22) | 15 | EXPR_STMT@[15; 23) |
16 | DOTDOT@[15; 17) ".." | 16 | RANGE_EXPR@[15; 22) |
17 | BIN_EXPR@[17; 22) | 17 | DOTDOT@[15; 17) ".." |
18 | LITERAL@[17; 18) | 18 | BIN_EXPR@[17; 22) |
19 | INT_NUMBER@[17; 18) "1" | 19 | LITERAL@[17; 18) |
20 | WHITESPACE@[18; 19) " " | 20 | INT_NUMBER@[17; 18) "1" |
21 | PLUS@[19; 20) "+" | 21 | WHITESPACE@[18; 19) " " |
22 | WHITESPACE@[20; 21) " " | 22 | PLUS@[19; 20) "+" |
23 | LITERAL@[21; 22) | 23 | WHITESPACE@[20; 21) " " |
24 | INT_NUMBER@[21; 22) "1" | 24 | LITERAL@[21; 22) |
25 | SEMI@[22; 23) ";" | 25 | INT_NUMBER@[21; 22) "1" |
26 | WHITESPACE@[23; 28) "\n " | 26 | SEMI@[22; 23) ";" |
27 | EXPR_STMT@[28; 36) | 27 | WHITESPACE@[23; 28) "\n " |
28 | BIN_EXPR@[28; 35) | 28 | EXPR_STMT@[28; 36) |
29 | RANGE_EXPR@[28; 31) | 29 | BIN_EXPR@[28; 35) |
30 | DOTDOT@[28; 30) ".." | 30 | RANGE_EXPR@[28; 31) |
31 | PATH_EXPR@[30; 31) | 31 | DOTDOT@[28; 30) ".." |
32 | PATH@[30; 31) | 32 | PATH_EXPR@[30; 31) |
33 | PATH_SEGMENT@[30; 31) | 33 | PATH@[30; 31) |
34 | NAME_REF@[30; 31) | 34 | PATH_SEGMENT@[30; 31) |
35 | IDENT@[30; 31) "z" | 35 | NAME_REF@[30; 31) |
36 | WHITESPACE@[31; 32) " " | 36 | IDENT@[30; 31) "z" |
37 | EQ@[32; 33) "=" | 37 | WHITESPACE@[31; 32) " " |
38 | WHITESPACE@[33; 34) " " | 38 | EQ@[32; 33) "=" |
39 | LITERAL@[34; 35) | 39 | WHITESPACE@[33; 34) " " |
40 | INT_NUMBER@[34; 35) "2" | 40 | LITERAL@[34; 35) |
41 | SEMI@[35; 36) ";" | 41 | INT_NUMBER@[34; 35) "2" |
42 | WHITESPACE@[36; 41) "\n " | 42 | SEMI@[35; 36) ";" |
43 | EXPR_STMT@[41; 59) | 43 | WHITESPACE@[36; 41) "\n " |
44 | BIN_EXPR@[41; 58) | 44 | EXPR_STMT@[41; 59) |
45 | PATH_EXPR@[41; 42) | 45 | BIN_EXPR@[41; 58) |
46 | PATH@[41; 42) | 46 | PATH_EXPR@[41; 42) |
47 | PATH_SEGMENT@[41; 42) | 47 | PATH@[41; 42) |
48 | NAME_REF@[41; 42) | 48 | PATH_SEGMENT@[41; 42) |
49 | IDENT@[41; 42) "x" | 49 | NAME_REF@[41; 42) |
50 | WHITESPACE@[42; 43) " " | 50 | IDENT@[41; 42) "x" |
51 | EQ@[43; 44) "=" | 51 | WHITESPACE@[42; 43) " " |
52 | WHITESPACE@[44; 45) " " | 52 | EQ@[43; 44) "=" |
53 | RANGE_EXPR@[45; 58) | 53 | WHITESPACE@[44; 45) " " |
54 | LITERAL@[45; 50) | 54 | RANGE_EXPR@[45; 58) |
55 | FALSE_KW@[45; 50) "false" | 55 | LITERAL@[45; 50) |
56 | DOTDOT@[50; 52) ".." | 56 | FALSE_KW@[45; 50) "false" |
57 | BIN_EXPR@[52; 58) | 57 | DOTDOT@[50; 52) ".." |
58 | LITERAL@[52; 53) | 58 | BIN_EXPR@[52; 58) |
59 | INT_NUMBER@[52; 53) "1" | 59 | LITERAL@[52; 53) |
60 | WHITESPACE@[53; 54) " " | 60 | INT_NUMBER@[52; 53) "1" |
61 | EQEQ@[54; 56) "==" | 61 | WHITESPACE@[53; 54) " " |
62 | WHITESPACE@[56; 57) " " | 62 | EQEQ@[54; 56) "==" |
63 | LITERAL@[57; 58) | 63 | WHITESPACE@[56; 57) " " |
64 | INT_NUMBER@[57; 58) "1" | 64 | LITERAL@[57; 58) |
65 | SEMI@[58; 59) ";" | 65 | INT_NUMBER@[57; 58) "1" |
66 | WHITESPACE@[59; 64) "\n " | 66 | SEMI@[58; 59) ";" |
67 | LET_STMT@[64; 76) | 67 | WHITESPACE@[59; 64) "\n " |
68 | LET_KW@[64; 67) "let" | 68 | LET_STMT@[64; 76) |
69 | WHITESPACE@[67; 68) " " | 69 | LET_KW@[64; 67) "let" |
70 | BIND_PAT@[68; 69) | 70 | WHITESPACE@[67; 68) " " |
71 | NAME@[68; 69) | 71 | BIND_PAT@[68; 69) |
72 | IDENT@[68; 69) "x" | 72 | NAME@[68; 69) |
73 | WHITESPACE@[69; 70) " " | 73 | IDENT@[68; 69) "x" |
74 | EQ@[70; 71) "=" | 74 | WHITESPACE@[69; 70) " " |
75 | WHITESPACE@[71; 72) " " | 75 | EQ@[70; 71) "=" |
76 | RANGE_EXPR@[72; 75) | 76 | WHITESPACE@[71; 72) " " |
77 | LITERAL@[72; 73) | 77 | RANGE_EXPR@[72; 75) |
78 | INT_NUMBER@[72; 73) "1" | 78 | LITERAL@[72; 73) |
79 | DOTDOT@[73; 75) ".." | 79 | INT_NUMBER@[72; 73) "1" |
80 | SEMI@[75; 76) ";" | 80 | DOTDOT@[73; 75) ".." |
81 | WHITESPACE@[76; 86) "\n \n " | 81 | SEMI@[75; 76) ";" |
82 | EXPR_STMT@[86; 95) | 82 | WHITESPACE@[76; 86) "\n \n " |
83 | RANGE_EXPR@[86; 94) | 83 | EXPR_STMT@[86; 95) |
84 | DOTDOTEQ@[86; 89) "..=" | 84 | RANGE_EXPR@[86; 94) |
85 | BIN_EXPR@[89; 94) | 85 | DOTDOTEQ@[86; 89) "..=" |
86 | LITERAL@[89; 90) | 86 | BIN_EXPR@[89; 94) |
87 | INT_NUMBER@[89; 90) "1" | 87 | LITERAL@[89; 90) |
88 | WHITESPACE@[90; 91) " " | 88 | INT_NUMBER@[89; 90) "1" |
89 | PLUS@[91; 92) "+" | 89 | WHITESPACE@[90; 91) " " |
90 | WHITESPACE@[92; 93) " " | 90 | PLUS@[91; 92) "+" |
91 | LITERAL@[93; 94) | 91 | WHITESPACE@[92; 93) " " |
92 | INT_NUMBER@[93; 94) "1" | 92 | LITERAL@[93; 94) |
93 | SEMI@[94; 95) ";" | 93 | INT_NUMBER@[93; 94) "1" |
94 | WHITESPACE@[95; 100) "\n " | 94 | SEMI@[94; 95) ";" |
95 | EXPR_STMT@[100; 109) | 95 | WHITESPACE@[95; 100) "\n " |
96 | BIN_EXPR@[100; 108) | 96 | EXPR_STMT@[100; 109) |
97 | RANGE_EXPR@[100; 104) | 97 | BIN_EXPR@[100; 108) |
98 | DOTDOTEQ@[100; 103) "..=" | 98 | RANGE_EXPR@[100; 104) |
99 | PATH_EXPR@[103; 104) | 99 | DOTDOTEQ@[100; 103) "..=" |
100 | PATH@[103; 104) | 100 | PATH_EXPR@[103; 104) |
101 | PATH_SEGMENT@[103; 104) | 101 | PATH@[103; 104) |
102 | NAME_REF@[103; 104) | 102 | PATH_SEGMENT@[103; 104) |
103 | IDENT@[103; 104) "z" | 103 | NAME_REF@[103; 104) |
104 | WHITESPACE@[104; 105) " " | 104 | IDENT@[103; 104) "z" |
105 | EQ@[105; 106) "=" | 105 | WHITESPACE@[104; 105) " " |
106 | WHITESPACE@[106; 107) " " | 106 | EQ@[105; 106) "=" |
107 | LITERAL@[107; 108) | 107 | WHITESPACE@[106; 107) " " |
108 | INT_NUMBER@[107; 108) "2" | 108 | LITERAL@[107; 108) |
109 | SEMI@[108; 109) ";" | 109 | INT_NUMBER@[107; 108) "2" |
110 | WHITESPACE@[109; 114) "\n " | 110 | SEMI@[108; 109) ";" |
111 | EXPR_STMT@[114; 133) | 111 | WHITESPACE@[109; 114) "\n " |
112 | BIN_EXPR@[114; 132) | 112 | EXPR_STMT@[114; 133) |
113 | PATH_EXPR@[114; 115) | 113 | BIN_EXPR@[114; 132) |
114 | PATH@[114; 115) | 114 | PATH_EXPR@[114; 115) |
115 | PATH_SEGMENT@[114; 115) | 115 | PATH@[114; 115) |
116 | NAME_REF@[114; 115) | 116 | PATH_SEGMENT@[114; 115) |
117 | IDENT@[114; 115) "x" | 117 | NAME_REF@[114; 115) |
118 | WHITESPACE@[115; 116) " " | 118 | IDENT@[114; 115) "x" |
119 | EQ@[116; 117) "=" | 119 | WHITESPACE@[115; 116) " " |
120 | WHITESPACE@[117; 118) " " | 120 | EQ@[116; 117) "=" |
121 | RANGE_EXPR@[118; 132) | 121 | WHITESPACE@[117; 118) " " |
122 | LITERAL@[118; 123) | 122 | RANGE_EXPR@[118; 132) |
123 | FALSE_KW@[118; 123) "false" | 123 | LITERAL@[118; 123) |
124 | DOTDOTEQ@[123; 126) "..=" | 124 | FALSE_KW@[118; 123) "false" |
125 | BIN_EXPR@[126; 132) | 125 | DOTDOTEQ@[123; 126) "..=" |
126 | LITERAL@[126; 127) | 126 | BIN_EXPR@[126; 132) |
127 | INT_NUMBER@[126; 127) "1" | 127 | LITERAL@[126; 127) |
128 | WHITESPACE@[127; 128) " " | 128 | INT_NUMBER@[126; 127) "1" |
129 | EQEQ@[128; 130) "==" | 129 | WHITESPACE@[127; 128) " " |
130 | WHITESPACE@[130; 131) " " | 130 | EQEQ@[128; 130) "==" |
131 | LITERAL@[131; 132) | 131 | WHITESPACE@[130; 131) " " |
132 | INT_NUMBER@[131; 132) "1" | 132 | LITERAL@[131; 132) |
133 | SEMI@[132; 133) ";" | 133 | INT_NUMBER@[131; 132) "1" |
134 | WHITESPACE@[133; 138) "\n " | 134 | SEMI@[132; 133) ";" |
135 | LET_STMT@[138; 150) | 135 | WHITESPACE@[133; 138) "\n " |
136 | LET_KW@[138; 141) "let" | 136 | LET_STMT@[138; 150) |
137 | WHITESPACE@[141; 142) " " | 137 | LET_KW@[138; 141) "let" |
138 | BIND_PAT@[142; 143) | 138 | WHITESPACE@[141; 142) " " |
139 | NAME@[142; 143) | 139 | BIND_PAT@[142; 143) |
140 | IDENT@[142; 143) "x" | 140 | NAME@[142; 143) |
141 | WHITESPACE@[143; 144) " " | 141 | IDENT@[142; 143) "x" |
142 | EQ@[144; 145) "=" | 142 | WHITESPACE@[143; 144) " " |
143 | WHITESPACE@[145; 146) " " | 143 | EQ@[144; 145) "=" |
144 | RANGE_EXPR@[146; 149) | 144 | WHITESPACE@[145; 146) " " |
145 | LITERAL@[146; 147) | 145 | RANGE_EXPR@[146; 149) |
146 | INT_NUMBER@[146; 147) "1" | 146 | LITERAL@[146; 147) |
147 | DOTDOT@[147; 149) ".." | 147 | INT_NUMBER@[146; 147) "1" |
148 | SEMI@[149; 150) ";" | 148 | DOTDOT@[147; 149) ".." |
149 | WHITESPACE@[150; 151) "\n" | 149 | SEMI@[149; 150) ";" |
150 | R_CURLY@[151; 152) "}" | 150 | WHITESPACE@[150; 151) "\n" |
151 | R_CURLY@[151; 152) "}" | ||
151 | WHITESPACE@[152; 153) "\n" | 152 | WHITESPACE@[152; 153) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.txt b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.txt index 4f7e809c5..cdc9f05ae 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.txt +++ b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.txt | |||
@@ -8,56 +8,57 @@ SOURCE_FILE@[0; 112) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 111) | 11 | BLOCK_EXPR@[10; 111) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 111) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | LET_STMT@[16; 31) | 14 | WHITESPACE@[11; 16) "\n " |
15 | LET_KW@[16; 19) "let" | 15 | LET_STMT@[16; 31) |
16 | WHITESPACE@[19; 20) " " | 16 | LET_KW@[16; 19) "let" |
17 | PLACEHOLDER_PAT@[20; 21) | 17 | WHITESPACE@[19; 20) " " |
18 | UNDERSCORE@[20; 21) "_" | 18 | PLACEHOLDER_PAT@[20; 21) |
19 | WHITESPACE@[21; 22) " " | 19 | UNDERSCORE@[20; 21) "_" |
20 | EQ@[22; 23) "=" | 20 | WHITESPACE@[21; 22) " " |
21 | WHITESPACE@[23; 24) " " | 21 | EQ@[22; 23) "=" |
22 | LITERAL@[24; 30) | 22 | WHITESPACE@[23; 24) " " |
23 | CHAR@[24; 30) "\'c\'u32" | 23 | LITERAL@[24; 30) |
24 | SEMI@[30; 31) ";" | 24 | CHAR@[24; 30) "\'c\'u32" |
25 | WHITESPACE@[31; 36) "\n " | 25 | SEMI@[30; 31) ";" |
26 | LET_STMT@[36; 60) | 26 | WHITESPACE@[31; 36) "\n " |
27 | LET_KW@[36; 39) "let" | 27 | LET_STMT@[36; 60) |
28 | WHITESPACE@[39; 40) " " | 28 | LET_KW@[36; 39) "let" |
29 | PLACEHOLDER_PAT@[40; 41) | 29 | WHITESPACE@[39; 40) " " |
30 | UNDERSCORE@[40; 41) "_" | 30 | PLACEHOLDER_PAT@[40; 41) |
31 | WHITESPACE@[41; 42) " " | 31 | UNDERSCORE@[40; 41) "_" |
32 | EQ@[42; 43) "=" | 32 | WHITESPACE@[41; 42) " " |
33 | WHITESPACE@[43; 44) " " | 33 | EQ@[42; 43) "=" |
34 | LITERAL@[44; 59) | 34 | WHITESPACE@[43; 44) " " |
35 | STRING@[44; 59) "\"string\"invalid" | 35 | LITERAL@[44; 59) |
36 | SEMI@[59; 60) ";" | 36 | STRING@[44; 59) "\"string\"invalid" |
37 | WHITESPACE@[60; 65) "\n " | 37 | SEMI@[59; 60) ";" |
38 | LET_STMT@[65; 83) | 38 | WHITESPACE@[60; 65) "\n " |
39 | LET_KW@[65; 68) "let" | 39 | LET_STMT@[65; 83) |
40 | WHITESPACE@[68; 69) " " | 40 | LET_KW@[65; 68) "let" |
41 | PLACEHOLDER_PAT@[69; 70) | 41 | WHITESPACE@[68; 69) " " |
42 | UNDERSCORE@[69; 70) "_" | 42 | PLACEHOLDER_PAT@[69; 70) |
43 | WHITESPACE@[70; 71) " " | 43 | UNDERSCORE@[69; 70) "_" |
44 | EQ@[71; 72) "=" | 44 | WHITESPACE@[70; 71) " " |
45 | WHITESPACE@[72; 73) " " | 45 | EQ@[71; 72) "=" |
46 | LITERAL@[73; 82) | 46 | WHITESPACE@[72; 73) " " |
47 | BYTE@[73; 82) "b\'b\'_suff" | 47 | LITERAL@[73; 82) |
48 | SEMI@[82; 83) ";" | 48 | BYTE@[73; 82) "b\'b\'_suff" |
49 | WHITESPACE@[83; 88) "\n " | 49 | SEMI@[82; 83) ";" |
50 | LET_STMT@[88; 109) | 50 | WHITESPACE@[83; 88) "\n " |
51 | LET_KW@[88; 91) "let" | 51 | LET_STMT@[88; 109) |
52 | WHITESPACE@[91; 92) " " | 52 | LET_KW@[88; 91) "let" |
53 | PLACEHOLDER_PAT@[92; 93) | 53 | WHITESPACE@[91; 92) " " |
54 | UNDERSCORE@[92; 93) "_" | 54 | PLACEHOLDER_PAT@[92; 93) |
55 | WHITESPACE@[93; 94) " " | 55 | UNDERSCORE@[92; 93) "_" |
56 | EQ@[94; 95) "=" | 56 | WHITESPACE@[93; 94) " " |
57 | WHITESPACE@[95; 96) " " | 57 | EQ@[94; 95) "=" |
58 | LITERAL@[96; 108) | 58 | WHITESPACE@[95; 96) " " |
59 | BYTE_STRING@[96; 108) "b\"bs\"invalid" | 59 | LITERAL@[96; 108) |
60 | SEMI@[108; 109) ";" | 60 | BYTE_STRING@[96; 108) "b\"bs\"invalid" |
61 | WHITESPACE@[109; 110) "\n" | 61 | SEMI@[108; 109) ";" |
62 | R_CURLY@[110; 111) "}" | 62 | WHITESPACE@[109; 110) "\n" |
63 | R_CURLY@[110; 111) "}" | ||
63 | WHITESPACE@[111; 112) "\n" | 64 | WHITESPACE@[111; 112) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0032_where_for.txt b/crates/ra_syntax/test_data/parser/ok/0032_where_for.txt index 9b1d0e84a..3a333480e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0032_where_for.txt +++ b/crates/ra_syntax/test_data/parser/ok/0032_where_for.txt | |||
@@ -84,7 +84,8 @@ SOURCE_FILE@[0; 116) | |||
84 | IDENT@[106; 111) "Debug" | 84 | IDENT@[106; 111) "Debug" |
85 | COMMA@[111; 112) "," | 85 | COMMA@[111; 112) "," |
86 | WHITESPACE@[112; 113) "\n" | 86 | WHITESPACE@[112; 113) "\n" |
87 | BLOCK@[113; 115) | 87 | BLOCK_EXPR@[113; 115) |
88 | L_CURLY@[113; 114) "{" | 88 | BLOCK@[113; 115) |
89 | R_CURLY@[114; 115) "}" | 89 | L_CURLY@[113; 114) "{" |
90 | R_CURLY@[114; 115) "}" | ||
90 | WHITESPACE@[115; 116) "\n" | 91 | WHITESPACE@[115; 116) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0033_label_break.txt b/crates/ra_syntax/test_data/parser/ok/0033_label_break.txt index 845a8d7af..bd9e3fd85 100644 --- a/crates/ra_syntax/test_data/parser/ok/0033_label_break.txt +++ b/crates/ra_syntax/test_data/parser/ok/0033_label_break.txt | |||
@@ -10,206 +10,211 @@ SOURCE_FILE@[0; 506) | |||
10 | L_PAREN@[41; 42) "(" | 10 | L_PAREN@[41; 42) "(" |
11 | R_PAREN@[42; 43) ")" | 11 | R_PAREN@[42; 43) ")" |
12 | WHITESPACE@[43; 44) " " | 12 | WHITESPACE@[43; 44) " " |
13 | BLOCK@[44; 505) | 13 | BLOCK_EXPR@[44; 505) |
14 | L_CURLY@[44; 45) "{" | 14 | BLOCK@[44; 505) |
15 | WHITESPACE@[45; 50) "\n " | 15 | L_CURLY@[44; 45) "{" |
16 | EXPR_STMT@[50; 66) | 16 | WHITESPACE@[45; 50) "\n " |
17 | BLOCK_EXPR@[50; 66) | 17 | EXPR_STMT@[50; 66) |
18 | LABEL@[50; 63) | 18 | BLOCK_EXPR@[50; 66) |
19 | LIFETIME@[50; 62) "\'empty_block" | 19 | LABEL@[50; 63) |
20 | COLON@[62; 63) ":" | 20 | LIFETIME@[50; 62) "\'empty_block" |
21 | WHITESPACE@[63; 64) " " | 21 | COLON@[62; 63) ":" |
22 | BLOCK@[64; 66) | 22 | WHITESPACE@[63; 64) " " |
23 | L_CURLY@[64; 65) "{" | 23 | BLOCK@[64; 66) |
24 | R_CURLY@[65; 66) "}" | 24 | L_CURLY@[64; 65) "{" |
25 | WHITESPACE@[66; 72) "\n\n " | 25 | R_CURLY@[65; 66) "}" |
26 | EXPR_STMT@[72; 295) | 26 | WHITESPACE@[66; 72) "\n\n " |
27 | BLOCK_EXPR@[72; 295) | 27 | EXPR_STMT@[72; 295) |
28 | LABEL@[72; 79) | 28 | BLOCK_EXPR@[72; 295) |
29 | LIFETIME@[72; 78) "\'block" | 29 | LABEL@[72; 79) |
30 | COLON@[78; 79) ":" | 30 | LIFETIME@[72; 78) "\'block" |
31 | WHITESPACE@[79; 80) " " | 31 | COLON@[78; 79) ":" |
32 | BLOCK@[80; 295) | 32 | WHITESPACE@[79; 80) " " |
33 | L_CURLY@[80; 81) "{" | 33 | BLOCK@[80; 295) |
34 | WHITESPACE@[81; 90) "\n " | 34 | L_CURLY@[80; 81) "{" |
35 | EXPR_STMT@[90; 101) | 35 | WHITESPACE@[81; 90) "\n " |
36 | CALL_EXPR@[90; 100) | 36 | EXPR_STMT@[90; 101) |
37 | PATH_EXPR@[90; 98) | 37 | CALL_EXPR@[90; 100) |
38 | PATH@[90; 98) | 38 | PATH_EXPR@[90; 98) |
39 | PATH_SEGMENT@[90; 98) | 39 | PATH@[90; 98) |
40 | NAME_REF@[90; 98) | 40 | PATH_SEGMENT@[90; 98) |
41 | IDENT@[90; 98) "do_thing" | 41 | NAME_REF@[90; 98) |
42 | ARG_LIST@[98; 100) | 42 | IDENT@[90; 98) "do_thing" |
43 | L_PAREN@[98; 99) "(" | 43 | ARG_LIST@[98; 100) |
44 | R_PAREN@[99; 100) ")" | 44 | L_PAREN@[98; 99) "(" |
45 | SEMI@[100; 101) ";" | 45 | R_PAREN@[99; 100) ")" |
46 | WHITESPACE@[101; 110) "\n " | 46 | SEMI@[100; 101) ";" |
47 | EXPR_STMT@[110; 170) | 47 | WHITESPACE@[101; 110) "\n " |
48 | IF_EXPR@[110; 170) | 48 | EXPR_STMT@[110; 170) |
49 | IF_KW@[110; 112) "if" | 49 | IF_EXPR@[110; 170) |
50 | WHITESPACE@[112; 113) " " | 50 | IF_KW@[110; 112) "if" |
51 | CONDITION@[113; 132) | 51 | WHITESPACE@[112; 113) " " |
52 | CALL_EXPR@[113; 132) | 52 | CONDITION@[113; 132) |
53 | PATH_EXPR@[113; 130) | 53 | CALL_EXPR@[113; 132) |
54 | PATH@[113; 130) | 54 | PATH_EXPR@[113; 130) |
55 | PATH_SEGMENT@[113; 130) | 55 | PATH@[113; 130) |
56 | NAME_REF@[113; 130) | 56 | PATH_SEGMENT@[113; 130) |
57 | IDENT@[113; 130) "condition_not_met" | 57 | NAME_REF@[113; 130) |
58 | ARG_LIST@[130; 132) | 58 | IDENT@[113; 130) "condition_not_met" |
59 | L_PAREN@[130; 131) "(" | 59 | ARG_LIST@[130; 132) |
60 | R_PAREN@[131; 132) ")" | 60 | L_PAREN@[130; 131) "(" |
61 | WHITESPACE@[132; 133) " " | 61 | R_PAREN@[131; 132) ")" |
62 | BLOCK@[133; 170) | 62 | WHITESPACE@[132; 133) " " |
63 | L_CURLY@[133; 134) "{" | 63 | BLOCK_EXPR@[133; 170) |
64 | WHITESPACE@[134; 147) "\n " | 64 | BLOCK@[133; 170) |
65 | EXPR_STMT@[147; 160) | 65 | L_CURLY@[133; 134) "{" |
66 | BREAK_EXPR@[147; 159) | 66 | WHITESPACE@[134; 147) "\n " |
67 | BREAK_KW@[147; 152) "break" | 67 | EXPR_STMT@[147; 160) |
68 | WHITESPACE@[152; 153) " " | 68 | BREAK_EXPR@[147; 159) |
69 | LIFETIME@[153; 159) "\'block" | 69 | BREAK_KW@[147; 152) "break" |
70 | SEMI@[159; 160) ";" | 70 | WHITESPACE@[152; 153) " " |
71 | WHITESPACE@[160; 169) "\n " | 71 | LIFETIME@[153; 159) "\'block" |
72 | R_CURLY@[169; 170) "}" | 72 | SEMI@[159; 160) ";" |
73 | WHITESPACE@[170; 179) "\n " | 73 | WHITESPACE@[160; 169) "\n " |
74 | EXPR_STMT@[179; 195) | 74 | R_CURLY@[169; 170) "}" |
75 | CALL_EXPR@[179; 194) | 75 | WHITESPACE@[170; 179) "\n " |
76 | PATH_EXPR@[179; 192) | 76 | EXPR_STMT@[179; 195) |
77 | PATH@[179; 192) | 77 | CALL_EXPR@[179; 194) |
78 | PATH_SEGMENT@[179; 192) | 78 | PATH_EXPR@[179; 192) |
79 | NAME_REF@[179; 192) | 79 | PATH@[179; 192) |
80 | IDENT@[179; 192) "do_next_thing" | 80 | PATH_SEGMENT@[179; 192) |
81 | ARG_LIST@[192; 194) | 81 | NAME_REF@[179; 192) |
82 | L_PAREN@[192; 193) "(" | 82 | IDENT@[179; 192) "do_next_thing" |
83 | R_PAREN@[193; 194) ")" | 83 | ARG_LIST@[192; 194) |
84 | SEMI@[194; 195) ";" | 84 | L_PAREN@[192; 193) "(" |
85 | WHITESPACE@[195; 204) "\n " | 85 | R_PAREN@[193; 194) ")" |
86 | EXPR_STMT@[204; 264) | 86 | SEMI@[194; 195) ";" |
87 | IF_EXPR@[204; 264) | 87 | WHITESPACE@[195; 204) "\n " |
88 | IF_KW@[204; 206) "if" | 88 | EXPR_STMT@[204; 264) |
89 | WHITESPACE@[206; 207) " " | 89 | IF_EXPR@[204; 264) |
90 | CONDITION@[207; 226) | 90 | IF_KW@[204; 206) "if" |
91 | CALL_EXPR@[207; 226) | 91 | WHITESPACE@[206; 207) " " |
92 | PATH_EXPR@[207; 224) | 92 | CONDITION@[207; 226) |
93 | PATH@[207; 224) | 93 | CALL_EXPR@[207; 226) |
94 | PATH_SEGMENT@[207; 224) | 94 | PATH_EXPR@[207; 224) |
95 | NAME_REF@[207; 224) | 95 | PATH@[207; 224) |
96 | IDENT@[207; 224) "condition_not_met" | 96 | PATH_SEGMENT@[207; 224) |
97 | ARG_LIST@[224; 226) | 97 | NAME_REF@[207; 224) |
98 | L_PAREN@[224; 225) "(" | 98 | IDENT@[207; 224) "condition_not_met" |
99 | R_PAREN@[225; 226) ")" | 99 | ARG_LIST@[224; 226) |
100 | WHITESPACE@[226; 227) " " | 100 | L_PAREN@[224; 225) "(" |
101 | BLOCK@[227; 264) | 101 | R_PAREN@[225; 226) ")" |
102 | L_CURLY@[227; 228) "{" | 102 | WHITESPACE@[226; 227) " " |
103 | WHITESPACE@[228; 241) "\n " | 103 | BLOCK_EXPR@[227; 264) |
104 | EXPR_STMT@[241; 254) | 104 | BLOCK@[227; 264) |
105 | BREAK_EXPR@[241; 253) | 105 | L_CURLY@[227; 228) "{" |
106 | BREAK_KW@[241; 246) "break" | 106 | WHITESPACE@[228; 241) "\n " |
107 | WHITESPACE@[246; 247) " " | 107 | EXPR_STMT@[241; 254) |
108 | LIFETIME@[247; 253) "\'block" | 108 | BREAK_EXPR@[241; 253) |
109 | SEMI@[253; 254) ";" | 109 | BREAK_KW@[241; 246) "break" |
110 | WHITESPACE@[254; 263) "\n " | 110 | WHITESPACE@[246; 247) " " |
111 | R_CURLY@[263; 264) "}" | 111 | LIFETIME@[247; 253) "\'block" |
112 | WHITESPACE@[264; 273) "\n " | 112 | SEMI@[253; 254) ";" |
113 | EXPR_STMT@[273; 289) | 113 | WHITESPACE@[254; 263) "\n " |
114 | CALL_EXPR@[273; 288) | 114 | R_CURLY@[263; 264) "}" |
115 | PATH_EXPR@[273; 286) | 115 | WHITESPACE@[264; 273) "\n " |
116 | PATH@[273; 286) | 116 | EXPR_STMT@[273; 289) |
117 | PATH_SEGMENT@[273; 286) | 117 | CALL_EXPR@[273; 288) |
118 | NAME_REF@[273; 286) | 118 | PATH_EXPR@[273; 286) |
119 | IDENT@[273; 286) "do_last_thing" | 119 | PATH@[273; 286) |
120 | ARG_LIST@[286; 288) | 120 | PATH_SEGMENT@[273; 286) |
121 | L_PAREN@[286; 287) "(" | 121 | NAME_REF@[273; 286) |
122 | R_PAREN@[287; 288) ")" | 122 | IDENT@[273; 286) "do_last_thing" |
123 | SEMI@[288; 289) ";" | 123 | ARG_LIST@[286; 288) |
124 | WHITESPACE@[289; 294) "\n " | 124 | L_PAREN@[286; 287) "(" |
125 | R_CURLY@[294; 295) "}" | 125 | R_PAREN@[287; 288) ")" |
126 | WHITESPACE@[295; 301) "\n\n " | 126 | SEMI@[288; 289) ";" |
127 | LET_STMT@[301; 503) | 127 | WHITESPACE@[289; 294) "\n " |
128 | LET_KW@[301; 304) "let" | 128 | R_CURLY@[294; 295) "}" |
129 | WHITESPACE@[304; 305) " " | 129 | WHITESPACE@[295; 301) "\n\n " |
130 | BIND_PAT@[305; 311) | 130 | LET_STMT@[301; 503) |
131 | NAME@[305; 311) | 131 | LET_KW@[301; 304) "let" |
132 | IDENT@[305; 311) "result" | 132 | WHITESPACE@[304; 305) " " |
133 | WHITESPACE@[311; 312) " " | 133 | BIND_PAT@[305; 311) |
134 | EQ@[312; 313) "=" | 134 | NAME@[305; 311) |
135 | WHITESPACE@[313; 314) " " | 135 | IDENT@[305; 311) "result" |
136 | BLOCK_EXPR@[314; 502) | 136 | WHITESPACE@[311; 312) " " |
137 | LABEL@[314; 321) | 137 | EQ@[312; 313) "=" |
138 | LIFETIME@[314; 320) "\'block" | 138 | WHITESPACE@[313; 314) " " |
139 | COLON@[320; 321) ":" | 139 | BLOCK_EXPR@[314; 502) |
140 | WHITESPACE@[321; 322) " " | 140 | LABEL@[314; 321) |
141 | BLOCK@[322; 502) | 141 | LIFETIME@[314; 320) "\'block" |
142 | L_CURLY@[322; 323) "{" | 142 | COLON@[320; 321) ":" |
143 | WHITESPACE@[323; 332) "\n " | 143 | WHITESPACE@[321; 322) " " |
144 | EXPR_STMT@[332; 403) | 144 | BLOCK@[322; 502) |
145 | IF_EXPR@[332; 403) | 145 | L_CURLY@[322; 323) "{" |
146 | IF_KW@[332; 334) "if" | 146 | WHITESPACE@[323; 332) "\n " |
147 | WHITESPACE@[334; 335) " " | 147 | EXPR_STMT@[332; 403) |
148 | CONDITION@[335; 340) | 148 | IF_EXPR@[332; 403) |
149 | CALL_EXPR@[335; 340) | 149 | IF_KW@[332; 334) "if" |
150 | PATH_EXPR@[335; 338) | 150 | WHITESPACE@[334; 335) " " |
151 | PATH@[335; 338) | 151 | CONDITION@[335; 340) |
152 | PATH_SEGMENT@[335; 338) | 152 | CALL_EXPR@[335; 340) |
153 | NAME_REF@[335; 338) | 153 | PATH_EXPR@[335; 338) |
154 | IDENT@[335; 338) "foo" | 154 | PATH@[335; 338) |
155 | ARG_LIST@[338; 340) | 155 | PATH_SEGMENT@[335; 338) |
156 | L_PAREN@[338; 339) "(" | 156 | NAME_REF@[335; 338) |
157 | R_PAREN@[339; 340) ")" | 157 | IDENT@[335; 338) "foo" |
158 | WHITESPACE@[340; 341) " " | 158 | ARG_LIST@[338; 340) |
159 | BLOCK@[341; 403) | 159 | L_PAREN@[338; 339) "(" |
160 | L_CURLY@[341; 342) "{" | 160 | R_PAREN@[339; 340) ")" |
161 | WHITESPACE@[342; 355) "\n " | 161 | WHITESPACE@[340; 341) " " |
162 | COMMENT@[355; 365) "// comment" | 162 | BLOCK_EXPR@[341; 403) |
163 | WHITESPACE@[365; 378) "\n " | 163 | BLOCK@[341; 403) |
164 | EXPR_STMT@[378; 393) | 164 | L_CURLY@[341; 342) "{" |
165 | BREAK_EXPR@[378; 392) | 165 | WHITESPACE@[342; 355) "\n " |
166 | BREAK_KW@[378; 383) "break" | 166 | COMMENT@[355; 365) "// comment" |
167 | WHITESPACE@[383; 384) " " | 167 | WHITESPACE@[365; 378) "\n " |
168 | LIFETIME@[384; 390) "\'block" | 168 | EXPR_STMT@[378; 393) |
169 | WHITESPACE@[390; 391) " " | 169 | BREAK_EXPR@[378; 392) |
170 | LITERAL@[391; 392) | 170 | BREAK_KW@[378; 383) "break" |
171 | INT_NUMBER@[391; 392) "1" | 171 | WHITESPACE@[383; 384) " " |
172 | SEMI@[392; 393) ";" | 172 | LIFETIME@[384; 390) "\'block" |
173 | WHITESPACE@[393; 402) "\n " | 173 | WHITESPACE@[390; 391) " " |
174 | R_CURLY@[402; 403) "}" | 174 | LITERAL@[391; 392) |
175 | WHITESPACE@[403; 412) "\n " | 175 | INT_NUMBER@[391; 392) "1" |
176 | EXPR_STMT@[412; 486) | 176 | SEMI@[392; 393) ";" |
177 | IF_EXPR@[412; 486) | 177 | WHITESPACE@[393; 402) "\n " |
178 | IF_KW@[412; 414) "if" | 178 | R_CURLY@[402; 403) "}" |
179 | WHITESPACE@[414; 415) " " | 179 | WHITESPACE@[403; 412) "\n " |
180 | CONDITION@[415; 420) | 180 | EXPR_STMT@[412; 486) |
181 | CALL_EXPR@[415; 420) | 181 | IF_EXPR@[412; 486) |
182 | PATH_EXPR@[415; 418) | 182 | IF_KW@[412; 414) "if" |
183 | PATH@[415; 418) | 183 | WHITESPACE@[414; 415) " " |
184 | PATH_SEGMENT@[415; 418) | 184 | CONDITION@[415; 420) |
185 | NAME_REF@[415; 418) | 185 | CALL_EXPR@[415; 420) |
186 | IDENT@[415; 418) "bar" | 186 | PATH_EXPR@[415; 418) |
187 | ARG_LIST@[418; 420) | 187 | PATH@[415; 418) |
188 | L_PAREN@[418; 419) "(" | 188 | PATH_SEGMENT@[415; 418) |
189 | R_PAREN@[419; 420) ")" | 189 | NAME_REF@[415; 418) |
190 | WHITESPACE@[420; 421) " " | 190 | IDENT@[415; 418) "bar" |
191 | BLOCK@[421; 486) | 191 | ARG_LIST@[418; 420) |
192 | L_CURLY@[421; 422) "{" | 192 | L_PAREN@[418; 419) "(" |
193 | WHITESPACE@[422; 435) "\n " | 193 | R_PAREN@[419; 420) ")" |
194 | COMMENT@[435; 448) "/* comment */" | 194 | WHITESPACE@[420; 421) " " |
195 | WHITESPACE@[448; 461) "\n " | 195 | BLOCK_EXPR@[421; 486) |
196 | EXPR_STMT@[461; 476) | 196 | BLOCK@[421; 486) |
197 | BREAK_EXPR@[461; 475) | 197 | L_CURLY@[421; 422) "{" |
198 | BREAK_KW@[461; 466) "break" | 198 | WHITESPACE@[422; 435) "\n " |
199 | WHITESPACE@[466; 467) " " | 199 | COMMENT@[435; 448) "/* comment */" |
200 | LIFETIME@[467; 473) "\'block" | 200 | WHITESPACE@[448; 461) "\n " |
201 | WHITESPACE@[473; 474) " " | 201 | EXPR_STMT@[461; 476) |
202 | LITERAL@[474; 475) | 202 | BREAK_EXPR@[461; 475) |
203 | INT_NUMBER@[474; 475) "2" | 203 | BREAK_KW@[461; 466) "break" |
204 | SEMI@[475; 476) ";" | 204 | WHITESPACE@[466; 467) " " |
205 | WHITESPACE@[476; 485) "\n " | 205 | LIFETIME@[467; 473) "\'block" |
206 | R_CURLY@[485; 486) "}" | 206 | WHITESPACE@[473; 474) " " |
207 | WHITESPACE@[486; 495) "\n " | 207 | LITERAL@[474; 475) |
208 | LITERAL@[495; 496) | 208 | INT_NUMBER@[474; 475) "2" |
209 | INT_NUMBER@[495; 496) "3" | 209 | SEMI@[475; 476) ";" |
210 | WHITESPACE@[496; 501) "\n " | 210 | WHITESPACE@[476; 485) "\n " |
211 | R_CURLY@[501; 502) "}" | 211 | R_CURLY@[485; 486) "}" |
212 | SEMI@[502; 503) ";" | 212 | WHITESPACE@[486; 495) "\n " |
213 | WHITESPACE@[503; 504) "\n" | 213 | LITERAL@[495; 496) |
214 | R_CURLY@[504; 505) "}" | 214 | INT_NUMBER@[495; 496) "3" |
215 | WHITESPACE@[496; 501) "\n " | ||
216 | R_CURLY@[501; 502) "}" | ||
217 | SEMI@[502; 503) ";" | ||
218 | WHITESPACE@[503; 504) "\n" | ||
219 | R_CURLY@[504; 505) "}" | ||
215 | WHITESPACE@[505; 506) "\n" | 220 | WHITESPACE@[505; 506) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.txt b/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.txt index a77d4aabe..fc0d452f4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.txt +++ b/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.txt | |||
@@ -8,34 +8,35 @@ SOURCE_FILE@[0; 62) | |||
8 | L_PAREN@[7; 8) "(" | 8 | L_PAREN@[7; 8) "(" |
9 | R_PAREN@[8; 9) ")" | 9 | R_PAREN@[8; 9) ")" |
10 | WHITESPACE@[9; 10) " " | 10 | WHITESPACE@[9; 10) " " |
11 | BLOCK@[10; 61) | 11 | BLOCK_EXPR@[10; 61) |
12 | L_CURLY@[10; 11) "{" | 12 | BLOCK@[10; 61) |
13 | WHITESPACE@[11; 16) "\n " | 13 | L_CURLY@[10; 11) "{" |
14 | EXPR_STMT@[16; 59) | 14 | WHITESPACE@[11; 16) "\n " |
15 | CALL_EXPR@[16; 58) | 15 | EXPR_STMT@[16; 59) |
16 | PATH_EXPR@[16; 26) | 16 | CALL_EXPR@[16; 58) |
17 | PATH@[16; 26) | 17 | PATH_EXPR@[16; 26) |
18 | PATH_SEGMENT@[16; 26) | 18 | PATH@[16; 26) |
19 | NAME_REF@[16; 26) | 19 | PATH_SEGMENT@[16; 26) |
20 | IDENT@[16; 26) "make_query" | 20 | NAME_REF@[16; 26) |
21 | ARG_LIST@[26; 58) | 21 | IDENT@[16; 26) "make_query" |
22 | L_PAREN@[26; 27) "(" | 22 | ARG_LIST@[26; 58) |
23 | PATH_EXPR@[27; 57) | 23 | L_PAREN@[26; 27) "(" |
24 | PATH@[27; 57) | 24 | PATH_EXPR@[27; 57) |
25 | PATH@[27; 44) | 25 | PATH@[27; 57) |
26 | PATH@[27; 32) | 26 | PATH@[27; 44) |
27 | PATH_SEGMENT@[27; 32) | 27 | PATH@[27; 32) |
28 | CRATE_KW@[27; 32) "crate" | 28 | PATH_SEGMENT@[27; 32) |
29 | COLONCOLON@[32; 34) "::" | 29 | CRATE_KW@[27; 32) "crate" |
30 | PATH_SEGMENT@[34; 44) | 30 | COLONCOLON@[32; 34) "::" |
31 | NAME_REF@[34; 44) | 31 | PATH_SEGMENT@[34; 44) |
32 | IDENT@[34; 44) "module_map" | 32 | NAME_REF@[34; 44) |
33 | COLONCOLON@[44; 46) "::" | 33 | IDENT@[34; 44) "module_map" |
34 | PATH_SEGMENT@[46; 57) | 34 | COLONCOLON@[44; 46) "::" |
35 | NAME_REF@[46; 57) | 35 | PATH_SEGMENT@[46; 57) |
36 | IDENT@[46; 57) "module_tree" | 36 | NAME_REF@[46; 57) |
37 | R_PAREN@[57; 58) ")" | 37 | IDENT@[46; 57) "module_tree" |
38 | SEMI@[58; 59) ";" | 38 | R_PAREN@[57; 58) ")" |
39 | WHITESPACE@[59; 60) "\n" | 39 | SEMI@[58; 59) ";" |
40 | R_CURLY@[60; 61) "}" | 40 | WHITESPACE@[59; 60) "\n" |
41 | R_CURLY@[60; 61) "}" | ||
41 | WHITESPACE@[61; 62) "\n" | 42 | WHITESPACE@[61; 62) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.txt b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.txt index c13ebfe37..c18e3c329 100644 --- a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.txt +++ b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.txt | |||
@@ -127,33 +127,34 @@ SOURCE_FILE@[0; 3813) | |||
127 | NAME_REF@[536; 540) | 127 | NAME_REF@[536; 540) |
128 | IDENT@[536; 540) "bool" | 128 | IDENT@[536; 540) "bool" |
129 | WHITESPACE@[540; 541) " " | 129 | WHITESPACE@[540; 541) " " |
130 | BLOCK@[541; 572) | 130 | BLOCK_EXPR@[541; 572) |
131 | L_CURLY@[541; 542) "{" | 131 | BLOCK@[541; 572) |
132 | WHITESPACE@[542; 543) " " | 132 | L_CURLY@[541; 542) "{" |
133 | LET_STMT@[543; 570) | 133 | WHITESPACE@[542; 543) " " |
134 | LET_KW@[543; 546) "let" | 134 | LET_STMT@[543; 570) |
135 | WHITESPACE@[546; 547) " " | 135 | LET_KW@[543; 546) "let" |
136 | BIND_PAT@[547; 549) | 136 | WHITESPACE@[546; 547) " " |
137 | NAME@[547; 549) | 137 | BIND_PAT@[547; 549) |
138 | IDENT@[547; 549) "_x" | 138 | NAME@[547; 549) |
139 | COLON@[549; 550) ":" | 139 | IDENT@[547; 549) "_x" |
140 | WHITESPACE@[550; 551) " " | 140 | COLON@[549; 550) ":" |
141 | PATH_TYPE@[551; 555) | 141 | WHITESPACE@[550; 551) " " |
142 | PATH@[551; 555) | 142 | PATH_TYPE@[551; 555) |
143 | PATH_SEGMENT@[551; 555) | 143 | PATH@[551; 555) |
144 | NAME_REF@[551; 555) | 144 | PATH_SEGMENT@[551; 555) |
145 | IDENT@[551; 555) "bool" | 145 | NAME_REF@[551; 555) |
146 | WHITESPACE@[555; 556) " " | 146 | IDENT@[551; 555) "bool" |
147 | EQ@[556; 557) "=" | 147 | WHITESPACE@[555; 556) " " |
148 | WHITESPACE@[557; 558) " " | 148 | EQ@[556; 557) "=" |
149 | RETURN_EXPR@[558; 569) | 149 | WHITESPACE@[557; 558) " " |
150 | RETURN_KW@[558; 564) "return" | 150 | RETURN_EXPR@[558; 569) |
151 | WHITESPACE@[564; 565) " " | 151 | RETURN_KW@[558; 564) "return" |
152 | LITERAL@[565; 569) | 152 | WHITESPACE@[564; 565) " " |
153 | TRUE_KW@[565; 569) "true" | 153 | LITERAL@[565; 569) |
154 | SEMI@[569; 570) ";" | 154 | TRUE_KW@[565; 569) "true" |
155 | WHITESPACE@[570; 571) " " | 155 | SEMI@[569; 570) ";" |
156 | R_CURLY@[571; 572) "}" | 156 | WHITESPACE@[570; 571) " " |
157 | R_CURLY@[571; 572) "}" | ||
157 | WHITESPACE@[572; 574) "\n\n" | 158 | WHITESPACE@[572; 574) "\n\n" |
158 | FN_DEF@[574; 624) | 159 | FN_DEF@[574; 624) |
159 | FN_KW@[574; 576) "fn" | 160 | FN_KW@[574; 576) "fn" |
@@ -164,47 +165,49 @@ SOURCE_FILE@[0; 3813) | |||
164 | L_PAREN@[582; 583) "(" | 165 | L_PAREN@[582; 583) "(" |
165 | R_PAREN@[583; 584) ")" | 166 | R_PAREN@[583; 584) ")" |
166 | WHITESPACE@[584; 585) " " | 167 | WHITESPACE@[584; 585) " " |
167 | BLOCK@[585; 624) | 168 | BLOCK_EXPR@[585; 624) |
168 | L_CURLY@[585; 586) "{" | 169 | BLOCK@[585; 624) |
169 | WHITESPACE@[586; 591) "\n " | 170 | L_CURLY@[585; 586) "{" |
170 | FN_DEF@[591; 607) | 171 | WHITESPACE@[586; 591) "\n " |
171 | FN_KW@[591; 593) "fn" | 172 | FN_DEF@[591; 607) |
172 | WHITESPACE@[593; 594) " " | 173 | FN_KW@[591; 593) "fn" |
173 | NAME@[594; 595) | 174 | WHITESPACE@[593; 594) " " |
174 | IDENT@[594; 595) "f" | 175 | NAME@[594; 595) |
175 | PARAM_LIST@[595; 603) | 176 | IDENT@[594; 595) "f" |
176 | L_PAREN@[595; 596) "(" | 177 | PARAM_LIST@[595; 603) |
177 | PARAM@[596; 602) | 178 | L_PAREN@[595; 596) "(" |
178 | BIND_PAT@[596; 598) | 179 | PARAM@[596; 602) |
179 | NAME@[596; 598) | 180 | BIND_PAT@[596; 598) |
180 | IDENT@[596; 598) "_x" | 181 | NAME@[596; 598) |
181 | COLON@[598; 599) ":" | 182 | IDENT@[596; 598) "_x" |
182 | WHITESPACE@[599; 600) " " | 183 | COLON@[598; 599) ":" |
183 | TUPLE_TYPE@[600; 602) | 184 | WHITESPACE@[599; 600) " " |
184 | L_PAREN@[600; 601) "(" | 185 | TUPLE_TYPE@[600; 602) |
185 | R_PAREN@[601; 602) ")" | 186 | L_PAREN@[600; 601) "(" |
186 | R_PAREN@[602; 603) ")" | 187 | R_PAREN@[601; 602) ")" |
187 | WHITESPACE@[603; 604) " " | 188 | R_PAREN@[602; 603) ")" |
188 | BLOCK@[604; 607) | 189 | WHITESPACE@[603; 604) " " |
189 | L_CURLY@[604; 605) "{" | 190 | BLOCK_EXPR@[604; 607) |
190 | WHITESPACE@[605; 606) " " | 191 | BLOCK@[604; 607) |
191 | R_CURLY@[606; 607) "}" | 192 | L_CURLY@[604; 605) "{" |
192 | WHITESPACE@[607; 612) "\n " | 193 | WHITESPACE@[605; 606) " " |
193 | EXPR_STMT@[612; 622) | 194 | R_CURLY@[606; 607) "}" |
194 | CALL_EXPR@[612; 621) | 195 | WHITESPACE@[607; 612) "\n " |
195 | PATH_EXPR@[612; 613) | 196 | EXPR_STMT@[612; 622) |
196 | PATH@[612; 613) | 197 | CALL_EXPR@[612; 621) |
197 | PATH_SEGMENT@[612; 613) | 198 | PATH_EXPR@[612; 613) |
198 | NAME_REF@[612; 613) | 199 | PATH@[612; 613) |
199 | IDENT@[612; 613) "f" | 200 | PATH_SEGMENT@[612; 613) |
200 | ARG_LIST@[613; 621) | 201 | NAME_REF@[612; 613) |
201 | L_PAREN@[613; 614) "(" | 202 | IDENT@[612; 613) "f" |
202 | RETURN_EXPR@[614; 620) | 203 | ARG_LIST@[613; 621) |
203 | RETURN_KW@[614; 620) "return" | 204 | L_PAREN@[613; 614) "(" |
204 | R_PAREN@[620; 621) ")" | 205 | RETURN_EXPR@[614; 620) |
205 | SEMI@[621; 622) ";" | 206 | RETURN_KW@[614; 620) "return" |
206 | WHITESPACE@[622; 623) "\n" | 207 | R_PAREN@[620; 621) ")" |
207 | R_CURLY@[623; 624) "}" | 208 | SEMI@[621; 622) ";" |
209 | WHITESPACE@[622; 623) "\n" | ||
210 | R_CURLY@[623; 624) "}" | ||
208 | WHITESPACE@[624; 626) "\n\n" | 211 | WHITESPACE@[624; 626) "\n\n" |
209 | FN_DEF@[626; 816) | 212 | FN_DEF@[626; 816) |
210 | FN_KW@[626; 628) "fn" | 213 | FN_KW@[626; 628) "fn" |
@@ -215,187 +218,190 @@ SOURCE_FILE@[0; 3813) | |||
215 | L_PAREN@[633; 634) "(" | 218 | L_PAREN@[633; 634) "(" |
216 | R_PAREN@[634; 635) ")" | 219 | R_PAREN@[634; 635) ")" |
217 | WHITESPACE@[635; 636) " " | 220 | WHITESPACE@[635; 636) " " |
218 | BLOCK@[636; 816) | 221 | BLOCK_EXPR@[636; 816) |
219 | L_CURLY@[636; 637) "{" | 222 | BLOCK@[636; 816) |
220 | WHITESPACE@[637; 642) "\n " | 223 | L_CURLY@[636; 637) "{" |
221 | FN_DEF@[642; 720) | 224 | WHITESPACE@[637; 642) "\n " |
222 | FN_KW@[642; 644) "fn" | 225 | FN_DEF@[642; 720) |
223 | WHITESPACE@[644; 645) " " | 226 | FN_KW@[642; 644) "fn" |
224 | NAME@[645; 648) | 227 | WHITESPACE@[644; 645) " " |
225 | IDENT@[645; 648) "the" | 228 | NAME@[645; 648) |
226 | PARAM_LIST@[648; 664) | 229 | IDENT@[645; 648) "the" |
227 | L_PAREN@[648; 649) "(" | 230 | PARAM_LIST@[648; 664) |
228 | PARAM@[649; 663) | 231 | L_PAREN@[648; 649) "(" |
229 | BIND_PAT@[649; 650) | 232 | PARAM@[649; 663) |
230 | NAME@[649; 650) | 233 | BIND_PAT@[649; 650) |
231 | IDENT@[649; 650) "x" | 234 | NAME@[649; 650) |
232 | COLON@[650; 651) ":" | 235 | IDENT@[649; 650) "x" |
233 | WHITESPACE@[651; 652) " " | 236 | COLON@[650; 651) ":" |
234 | REFERENCE_TYPE@[652; 663) | 237 | WHITESPACE@[651; 652) " " |
235 | AMP@[652; 653) "&" | 238 | REFERENCE_TYPE@[652; 663) |
236 | PATH_TYPE@[653; 663) | 239 | AMP@[652; 653) "&" |
237 | PATH@[653; 663) | 240 | PATH_TYPE@[653; 663) |
238 | PATH_SEGMENT@[653; 663) | 241 | PATH@[653; 663) |
239 | NAME_REF@[653; 657) | 242 | PATH_SEGMENT@[653; 663) |
240 | IDENT@[653; 657) "Cell" | 243 | NAME_REF@[653; 657) |
241 | TYPE_ARG_LIST@[657; 663) | 244 | IDENT@[653; 657) "Cell" |
242 | L_ANGLE@[657; 658) "<" | 245 | TYPE_ARG_LIST@[657; 663) |
243 | TYPE_ARG@[658; 662) | 246 | L_ANGLE@[657; 658) "<" |
244 | PATH_TYPE@[658; 662) | 247 | TYPE_ARG@[658; 662) |
245 | PATH@[658; 662) | 248 | PATH_TYPE@[658; 662) |
246 | PATH_SEGMENT@[658; 662) | 249 | PATH@[658; 662) |
247 | NAME_REF@[658; 662) | 250 | PATH_SEGMENT@[658; 662) |
248 | IDENT@[658; 662) "bool" | 251 | NAME_REF@[658; 662) |
249 | R_ANGLE@[662; 663) ">" | 252 | IDENT@[658; 662) "bool" |
250 | R_PAREN@[663; 664) ")" | 253 | R_ANGLE@[662; 663) ">" |
251 | WHITESPACE@[664; 665) " " | 254 | R_PAREN@[663; 664) ")" |
252 | BLOCK@[665; 720) | 255 | WHITESPACE@[664; 665) " " |
253 | L_CURLY@[665; 666) "{" | 256 | BLOCK_EXPR@[665; 720) |
254 | WHITESPACE@[666; 675) "\n " | 257 | BLOCK@[665; 720) |
255 | EXPR_STMT@[675; 714) | 258 | L_CURLY@[665; 666) "{" |
256 | RETURN_EXPR@[675; 713) | 259 | WHITESPACE@[666; 675) "\n " |
257 | RETURN_KW@[675; 681) "return" | 260 | EXPR_STMT@[675; 714) |
258 | WHITESPACE@[681; 682) " " | 261 | RETURN_EXPR@[675; 713) |
259 | WHILE_EXPR@[682; 713) | 262 | RETURN_KW@[675; 681) "return" |
260 | WHILE_KW@[682; 687) "while" | 263 | WHITESPACE@[681; 682) " " |
261 | WHITESPACE@[687; 688) " " | 264 | WHILE_EXPR@[682; 713) |
262 | CONDITION@[688; 696) | 265 | WHILE_KW@[682; 687) "while" |
263 | PREFIX_EXPR@[688; 696) | 266 | WHITESPACE@[687; 688) " " |
264 | EXCL@[688; 689) "!" | 267 | CONDITION@[688; 696) |
265 | METHOD_CALL_EXPR@[689; 696) | 268 | PREFIX_EXPR@[688; 696) |
266 | PATH_EXPR@[689; 690) | 269 | EXCL@[688; 689) "!" |
267 | PATH@[689; 690) | 270 | METHOD_CALL_EXPR@[689; 696) |
268 | PATH_SEGMENT@[689; 690) | 271 | PATH_EXPR@[689; 690) |
269 | NAME_REF@[689; 690) | 272 | PATH@[689; 690) |
270 | IDENT@[689; 690) "x" | 273 | PATH_SEGMENT@[689; 690) |
271 | DOT@[690; 691) "." | 274 | NAME_REF@[689; 690) |
272 | NAME_REF@[691; 694) | 275 | IDENT@[689; 690) "x" |
273 | IDENT@[691; 694) "get" | 276 | DOT@[690; 691) "." |
274 | ARG_LIST@[694; 696) | 277 | NAME_REF@[691; 694) |
275 | L_PAREN@[694; 695) "(" | 278 | IDENT@[691; 694) "get" |
276 | R_PAREN@[695; 696) ")" | 279 | ARG_LIST@[694; 696) |
277 | WHITESPACE@[696; 697) " " | 280 | L_PAREN@[694; 695) "(" |
278 | BLOCK@[697; 713) | 281 | R_PAREN@[695; 696) ")" |
279 | L_CURLY@[697; 698) "{" | 282 | WHITESPACE@[696; 697) " " |
280 | WHITESPACE@[698; 699) " " | 283 | BLOCK_EXPR@[697; 713) |
281 | EXPR_STMT@[699; 711) | 284 | BLOCK@[697; 713) |
282 | METHOD_CALL_EXPR@[699; 710) | 285 | L_CURLY@[697; 698) "{" |
283 | PATH_EXPR@[699; 700) | 286 | WHITESPACE@[698; 699) " " |
284 | PATH@[699; 700) | 287 | EXPR_STMT@[699; 711) |
285 | PATH_SEGMENT@[699; 700) | 288 | METHOD_CALL_EXPR@[699; 710) |
286 | NAME_REF@[699; 700) | 289 | PATH_EXPR@[699; 700) |
287 | IDENT@[699; 700) "x" | 290 | PATH@[699; 700) |
288 | DOT@[700; 701) "." | 291 | PATH_SEGMENT@[699; 700) |
289 | NAME_REF@[701; 704) | 292 | NAME_REF@[699; 700) |
290 | IDENT@[701; 704) "set" | 293 | IDENT@[699; 700) "x" |
291 | ARG_LIST@[704; 710) | 294 | DOT@[700; 701) "." |
292 | L_PAREN@[704; 705) "(" | 295 | NAME_REF@[701; 704) |
293 | LITERAL@[705; 709) | 296 | IDENT@[701; 704) "set" |
294 | TRUE_KW@[705; 709) "true" | 297 | ARG_LIST@[704; 710) |
295 | R_PAREN@[709; 710) ")" | 298 | L_PAREN@[704; 705) "(" |
296 | SEMI@[710; 711) ";" | 299 | LITERAL@[705; 709) |
297 | WHITESPACE@[711; 712) " " | 300 | TRUE_KW@[705; 709) "true" |
298 | R_CURLY@[712; 713) "}" | 301 | R_PAREN@[709; 710) ")" |
299 | SEMI@[713; 714) ";" | 302 | SEMI@[710; 711) ";" |
300 | WHITESPACE@[714; 719) "\n " | 303 | WHITESPACE@[711; 712) " " |
301 | R_CURLY@[719; 720) "}" | 304 | R_CURLY@[712; 713) "}" |
302 | WHITESPACE@[720; 725) "\n " | 305 | SEMI@[713; 714) ";" |
303 | LET_STMT@[725; 751) | 306 | WHITESPACE@[714; 719) "\n " |
304 | LET_KW@[725; 728) "let" | 307 | R_CURLY@[719; 720) "}" |
305 | WHITESPACE@[728; 729) " " | 308 | WHITESPACE@[720; 725) "\n " |
306 | BIND_PAT@[729; 730) | 309 | LET_STMT@[725; 751) |
307 | NAME@[729; 730) | 310 | LET_KW@[725; 728) "let" |
308 | IDENT@[729; 730) "i" | 311 | WHITESPACE@[728; 729) " " |
309 | WHITESPACE@[730; 731) " " | 312 | BIND_PAT@[729; 730) |
310 | EQ@[731; 732) "=" | 313 | NAME@[729; 730) |
311 | WHITESPACE@[732; 733) " " | 314 | IDENT@[729; 730) "i" |
312 | REF_EXPR@[733; 750) | 315 | WHITESPACE@[730; 731) " " |
313 | AMP@[733; 734) "&" | 316 | EQ@[731; 732) "=" |
314 | CALL_EXPR@[734; 750) | 317 | WHITESPACE@[732; 733) " " |
315 | PATH_EXPR@[734; 743) | 318 | REF_EXPR@[733; 750) |
316 | PATH@[734; 743) | 319 | AMP@[733; 734) "&" |
317 | PATH@[734; 738) | 320 | CALL_EXPR@[734; 750) |
318 | PATH_SEGMENT@[734; 738) | 321 | PATH_EXPR@[734; 743) |
319 | NAME_REF@[734; 738) | 322 | PATH@[734; 743) |
320 | IDENT@[734; 738) "Cell" | 323 | PATH@[734; 738) |
321 | COLONCOLON@[738; 740) "::" | 324 | PATH_SEGMENT@[734; 738) |
322 | PATH_SEGMENT@[740; 743) | 325 | NAME_REF@[734; 738) |
323 | NAME_REF@[740; 743) | 326 | IDENT@[734; 738) "Cell" |
324 | IDENT@[740; 743) "new" | 327 | COLONCOLON@[738; 740) "::" |
325 | ARG_LIST@[743; 750) | 328 | PATH_SEGMENT@[740; 743) |
326 | L_PAREN@[743; 744) "(" | 329 | NAME_REF@[740; 743) |
327 | LITERAL@[744; 749) | 330 | IDENT@[740; 743) "new" |
328 | FALSE_KW@[744; 749) "false" | 331 | ARG_LIST@[743; 750) |
329 | R_PAREN@[749; 750) ")" | 332 | L_PAREN@[743; 744) "(" |
330 | SEMI@[750; 751) ";" | 333 | LITERAL@[744; 749) |
331 | WHITESPACE@[751; 756) "\n " | 334 | FALSE_KW@[744; 749) "false" |
332 | LET_STMT@[756; 778) | 335 | R_PAREN@[749; 750) ")" |
333 | LET_KW@[756; 759) "let" | 336 | SEMI@[750; 751) ";" |
334 | WHITESPACE@[759; 760) " " | 337 | WHITESPACE@[751; 756) "\n " |
335 | BIND_PAT@[760; 764) | 338 | LET_STMT@[756; 778) |
336 | NAME@[760; 764) | 339 | LET_KW@[756; 759) "let" |
337 | IDENT@[760; 764) "dont" | 340 | WHITESPACE@[759; 760) " " |
338 | WHITESPACE@[764; 765) " " | 341 | BIND_PAT@[760; 764) |
339 | EQ@[765; 766) "=" | 342 | NAME@[760; 764) |
340 | WHITESPACE@[766; 767) " " | 343 | IDENT@[760; 764) "dont" |
341 | BLOCK_EXPR@[767; 777) | 344 | WHITESPACE@[764; 765) " " |
342 | BLOCK@[767; 777) | 345 | EQ@[765; 766) "=" |
343 | L_CURLY@[767; 768) "{" | 346 | WHITESPACE@[766; 767) " " |
344 | LAMBDA_EXPR@[768; 776) | 347 | BLOCK_EXPR@[767; 777) |
345 | PARAM_LIST@[768; 770) | 348 | BLOCK@[767; 777) |
346 | PIPE@[768; 769) "|" | 349 | L_CURLY@[767; 768) "{" |
347 | PIPE@[769; 770) "|" | 350 | LAMBDA_EXPR@[768; 776) |
348 | CALL_EXPR@[770; 776) | 351 | PARAM_LIST@[768; 770) |
349 | PATH_EXPR@[770; 773) | 352 | PIPE@[768; 769) "|" |
350 | PATH@[770; 773) | 353 | PIPE@[769; 770) "|" |
351 | PATH_SEGMENT@[770; 773) | 354 | CALL_EXPR@[770; 776) |
352 | NAME_REF@[770; 773) | 355 | PATH_EXPR@[770; 773) |
353 | IDENT@[770; 773) "the" | 356 | PATH@[770; 773) |
354 | ARG_LIST@[773; 776) | 357 | PATH_SEGMENT@[770; 773) |
355 | L_PAREN@[773; 774) "(" | 358 | NAME_REF@[770; 773) |
356 | PATH_EXPR@[774; 775) | 359 | IDENT@[770; 773) "the" |
357 | PATH@[774; 775) | 360 | ARG_LIST@[773; 776) |
358 | PATH_SEGMENT@[774; 775) | 361 | L_PAREN@[773; 774) "(" |
359 | NAME_REF@[774; 775) | 362 | PATH_EXPR@[774; 775) |
360 | IDENT@[774; 775) "i" | 363 | PATH@[774; 775) |
361 | R_PAREN@[775; 776) ")" | 364 | PATH_SEGMENT@[774; 775) |
362 | R_CURLY@[776; 777) "}" | 365 | NAME_REF@[774; 775) |
363 | SEMI@[777; 778) ";" | 366 | IDENT@[774; 775) "i" |
364 | WHITESPACE@[778; 783) "\n " | 367 | R_PAREN@[775; 776) ")" |
365 | EXPR_STMT@[783; 790) | 368 | R_CURLY@[776; 777) "}" |
366 | CALL_EXPR@[783; 789) | 369 | SEMI@[777; 778) ";" |
367 | PATH_EXPR@[783; 787) | 370 | WHITESPACE@[778; 783) "\n " |
368 | PATH@[783; 787) | 371 | EXPR_STMT@[783; 790) |
369 | PATH_SEGMENT@[783; 787) | 372 | CALL_EXPR@[783; 789) |
370 | NAME_REF@[783; 787) | 373 | PATH_EXPR@[783; 787) |
371 | IDENT@[783; 787) "dont" | 374 | PATH@[783; 787) |
372 | ARG_LIST@[787; 789) | 375 | PATH_SEGMENT@[783; 787) |
373 | L_PAREN@[787; 788) "(" | 376 | NAME_REF@[783; 787) |
374 | R_PAREN@[788; 789) ")" | 377 | IDENT@[783; 787) "dont" |
375 | SEMI@[789; 790) ";" | 378 | ARG_LIST@[787; 789) |
376 | WHITESPACE@[790; 795) "\n " | 379 | L_PAREN@[787; 788) "(" |
377 | EXPR_STMT@[795; 814) | 380 | R_PAREN@[788; 789) ")" |
378 | MACRO_CALL@[795; 813) | 381 | SEMI@[789; 790) ";" |
379 | PATH@[795; 801) | 382 | WHITESPACE@[790; 795) "\n " |
380 | PATH_SEGMENT@[795; 801) | 383 | EXPR_STMT@[795; 814) |
381 | NAME_REF@[795; 801) | 384 | MACRO_CALL@[795; 813) |
382 | IDENT@[795; 801) "assert" | 385 | PATH@[795; 801) |
383 | EXCL@[801; 802) "!" | 386 | PATH_SEGMENT@[795; 801) |
384 | TOKEN_TREE@[802; 813) | 387 | NAME_REF@[795; 801) |
385 | L_PAREN@[802; 803) "(" | 388 | IDENT@[795; 801) "assert" |
386 | TOKEN_TREE@[803; 812) | 389 | EXCL@[801; 802) "!" |
387 | L_PAREN@[803; 804) "(" | 390 | TOKEN_TREE@[802; 813) |
388 | IDENT@[804; 805) "i" | 391 | L_PAREN@[802; 803) "(" |
389 | DOT@[805; 806) "." | 392 | TOKEN_TREE@[803; 812) |
390 | IDENT@[806; 809) "get" | 393 | L_PAREN@[803; 804) "(" |
391 | TOKEN_TREE@[809; 811) | 394 | IDENT@[804; 805) "i" |
392 | L_PAREN@[809; 810) "(" | 395 | DOT@[805; 806) "." |
393 | R_PAREN@[810; 811) ")" | 396 | IDENT@[806; 809) "get" |
394 | R_PAREN@[811; 812) ")" | 397 | TOKEN_TREE@[809; 811) |
395 | R_PAREN@[812; 813) ")" | 398 | L_PAREN@[809; 810) "(" |
396 | SEMI@[813; 814) ";" | 399 | R_PAREN@[810; 811) ")" |
397 | WHITESPACE@[814; 815) "\n" | 400 | R_PAREN@[811; 812) ")" |
398 | R_CURLY@[815; 816) "}" | 401 | R_PAREN@[812; 813) ")" |
402 | SEMI@[813; 814) ";" | ||
403 | WHITESPACE@[814; 815) "\n" | ||
404 | R_CURLY@[815; 816) "}" | ||
399 | WHITESPACE@[816; 818) "\n\n" | 405 | WHITESPACE@[816; 818) "\n\n" |
400 | FN_DEF@[818; 1322) | 406 | FN_DEF@[818; 1322) |
401 | FN_KW@[818; 820) "fn" | 407 | FN_KW@[818; 820) "fn" |
@@ -406,163 +412,171 @@ SOURCE_FILE@[0; 3813) | |||
406 | L_PAREN@[832; 833) "(" | 412 | L_PAREN@[832; 833) "(" |
407 | R_PAREN@[833; 834) ")" | 413 | R_PAREN@[833; 834) ")" |
408 | WHITESPACE@[834; 835) " " | 414 | WHITESPACE@[834; 835) " " |
409 | BLOCK@[835; 1322) | 415 | BLOCK_EXPR@[835; 1322) |
410 | L_CURLY@[835; 836) "{" | 416 | BLOCK@[835; 1322) |
411 | WHITESPACE@[836; 841) "\n " | 417 | L_CURLY@[835; 836) "{" |
412 | LOOP_EXPR@[841; 1320) | 418 | WHITESPACE@[836; 841) "\n " |
413 | LOOP_KW@[841; 845) "loop" | 419 | LOOP_EXPR@[841; 1320) |
414 | WHITESPACE@[845; 846) " " | 420 | LOOP_KW@[841; 845) "loop" |
415 | BLOCK@[846; 1320) | 421 | WHITESPACE@[845; 846) " " |
416 | L_CURLY@[846; 847) "{" | 422 | BLOCK_EXPR@[846; 1320) |
417 | WHITESPACE@[847; 856) "\n " | 423 | BLOCK@[846; 1320) |
418 | EXPR_STMT@[856; 1283) | 424 | L_CURLY@[846; 847) "{" |
419 | WHILE_EXPR@[856; 1283) | 425 | WHITESPACE@[847; 856) "\n " |
420 | WHILE_KW@[856; 861) "while" | 426 | EXPR_STMT@[856; 1283) |
421 | WHITESPACE@[861; 862) " " | 427 | WHILE_EXPR@[856; 1283) |
422 | CONDITION@[862; 870) | 428 | WHILE_KW@[856; 861) "while" |
423 | PAREN_EXPR@[862; 870) | 429 | WHITESPACE@[861; 862) " " |
424 | L_PAREN@[862; 863) "(" | 430 | CONDITION@[862; 870) |
425 | RETURN_EXPR@[863; 869) | 431 | PAREN_EXPR@[862; 870) |
426 | RETURN_KW@[863; 869) "return" | 432 | L_PAREN@[862; 863) "(" |
427 | R_PAREN@[869; 870) ")" | 433 | RETURN_EXPR@[863; 869) |
428 | WHITESPACE@[870; 871) " " | 434 | RETURN_KW@[863; 869) "return" |
429 | BLOCK@[871; 1283) | 435 | R_PAREN@[869; 870) ")" |
430 | L_CURLY@[871; 872) "{" | 436 | WHITESPACE@[870; 871) " " |
431 | WHITESPACE@[872; 885) "\n " | 437 | BLOCK_EXPR@[871; 1283) |
432 | IF_EXPR@[885; 1273) | 438 | BLOCK@[871; 1283) |
433 | IF_KW@[885; 887) "if" | 439 | L_CURLY@[871; 872) "{" |
434 | WHITESPACE@[887; 888) " " | 440 | WHITESPACE@[872; 885) "\n " |
435 | CONDITION@[888; 896) | 441 | IF_EXPR@[885; 1273) |
436 | PAREN_EXPR@[888; 896) | 442 | IF_KW@[885; 887) "if" |
437 | L_PAREN@[888; 889) "(" | 443 | WHITESPACE@[887; 888) " " |
438 | RETURN_EXPR@[889; 895) | 444 | CONDITION@[888; 896) |
439 | RETURN_KW@[889; 895) "return" | 445 | PAREN_EXPR@[888; 896) |
440 | R_PAREN@[895; 896) ")" | 446 | L_PAREN@[888; 889) "(" |
441 | WHITESPACE@[896; 897) " " | 447 | RETURN_EXPR@[889; 895) |
442 | BLOCK@[897; 1216) | 448 | RETURN_KW@[889; 895) "return" |
443 | L_CURLY@[897; 898) "{" | 449 | R_PAREN@[895; 896) ")" |
444 | WHITESPACE@[898; 915) "\n " | 450 | WHITESPACE@[896; 897) " " |
445 | EXPR_STMT@[915; 1202) | 451 | BLOCK_EXPR@[897; 1216) |
446 | MATCH_EXPR@[915; 1201) | 452 | BLOCK@[897; 1216) |
447 | MATCH_KW@[915; 920) "match" | 453 | L_CURLY@[897; 898) "{" |
448 | WHITESPACE@[920; 921) " " | 454 | WHITESPACE@[898; 915) "\n " |
449 | PAREN_EXPR@[921; 929) | 455 | EXPR_STMT@[915; 1202) |
450 | L_PAREN@[921; 922) "(" | 456 | MATCH_EXPR@[915; 1201) |
451 | RETURN_EXPR@[922; 928) | 457 | MATCH_KW@[915; 920) "match" |
452 | RETURN_KW@[922; 928) "return" | 458 | WHITESPACE@[920; 921) " " |
453 | R_PAREN@[928; 929) ")" | 459 | PAREN_EXPR@[921; 929) |
454 | WHITESPACE@[929; 930) " " | 460 | L_PAREN@[921; 922) "(" |
455 | MATCH_ARM_LIST@[930; 1201) | 461 | RETURN_EXPR@[922; 928) |
456 | L_CURLY@[930; 931) "{" | 462 | RETURN_KW@[922; 928) "return" |
457 | WHITESPACE@[931; 952) "\n " | 463 | R_PAREN@[928; 929) ")" |
458 | MATCH_ARM@[952; 1147) | 464 | WHITESPACE@[929; 930) " " |
459 | LITERAL_PAT@[952; 953) | 465 | MATCH_ARM_LIST@[930; 1201) |
460 | LITERAL@[952; 953) | 466 | L_CURLY@[930; 931) "{" |
461 | INT_NUMBER@[952; 953) "1" | 467 | WHITESPACE@[931; 952) "\n " |
462 | WHITESPACE@[953; 954) " " | 468 | MATCH_ARM@[952; 1147) |
463 | FAT_ARROW@[954; 956) "=>" | 469 | LITERAL_PAT@[952; 953) |
464 | WHITESPACE@[956; 957) " " | 470 | LITERAL@[952; 953) |
465 | BLOCK_EXPR@[957; 1147) | 471 | INT_NUMBER@[952; 953) "1" |
466 | BLOCK@[957; 1147) | 472 | WHITESPACE@[953; 954) " " |
467 | L_CURLY@[957; 958) "{" | 473 | FAT_ARROW@[954; 956) "=>" |
468 | WHITESPACE@[958; 983) "\n ..." | 474 | WHITESPACE@[956; 957) " " |
469 | IF_EXPR@[983; 1125) | 475 | BLOCK_EXPR@[957; 1147) |
470 | IF_KW@[983; 985) "if" | 476 | BLOCK@[957; 1147) |
471 | WHITESPACE@[985; 986) " " | 477 | L_CURLY@[957; 958) "{" |
472 | CONDITION@[986; 994) | 478 | WHITESPACE@[958; 983) "\n ..." |
473 | PAREN_EXPR@[986; 994) | 479 | IF_EXPR@[983; 1125) |
474 | L_PAREN@[986; 987) "(" | 480 | IF_KW@[983; 985) "if" |
475 | RETURN_EXPR@[987; 993) | 481 | WHITESPACE@[985; 986) " " |
476 | RETURN_KW@[987; 993) "return" | 482 | CONDITION@[986; 994) |
477 | R_PAREN@[993; 994) ")" | 483 | PAREN_EXPR@[986; 994) |
478 | WHITESPACE@[994; 995) " " | 484 | L_PAREN@[986; 987) "(" |
479 | BLOCK@[995; 1057) | 485 | RETURN_EXPR@[987; 993) |
480 | L_CURLY@[995; 996) "{" | 486 | RETURN_KW@[987; 993) "return" |
481 | WHITESPACE@[996; 1025) "\n ..." | 487 | R_PAREN@[993; 994) ")" |
482 | RETURN_EXPR@[1025; 1031) | 488 | WHITESPACE@[994; 995) " " |
483 | RETURN_KW@[1025; 1031) "return" | 489 | BLOCK_EXPR@[995; 1057) |
484 | WHITESPACE@[1031; 1056) "\n ..." | 490 | BLOCK@[995; 1057) |
485 | R_CURLY@[1056; 1057) "}" | 491 | L_CURLY@[995; 996) "{" |
486 | WHITESPACE@[1057; 1058) " " | 492 | WHITESPACE@[996; 1025) "\n ..." |
487 | ELSE_KW@[1058; 1062) "else" | 493 | RETURN_EXPR@[1025; 1031) |
488 | WHITESPACE@[1062; 1063) " " | 494 | RETURN_KW@[1025; 1031) "return" |
489 | BLOCK@[1063; 1125) | 495 | WHITESPACE@[1031; 1056) "\n ..." |
490 | L_CURLY@[1063; 1064) "{" | 496 | R_CURLY@[1056; 1057) "}" |
491 | WHITESPACE@[1064; 1093) "\n ..." | 497 | WHITESPACE@[1057; 1058) " " |
492 | RETURN_EXPR@[1093; 1099) | 498 | ELSE_KW@[1058; 1062) "else" |
493 | RETURN_KW@[1093; 1099) "return" | 499 | WHITESPACE@[1062; 1063) " " |
494 | WHITESPACE@[1099; 1124) "\n ..." | 500 | BLOCK_EXPR@[1063; 1125) |
495 | R_CURLY@[1124; 1125) "}" | 501 | BLOCK@[1063; 1125) |
496 | WHITESPACE@[1125; 1146) "\n " | 502 | L_CURLY@[1063; 1064) "{" |
497 | R_CURLY@[1146; 1147) "}" | 503 | WHITESPACE@[1064; 1093) "\n ..." |
498 | WHITESPACE@[1147; 1168) "\n " | 504 | RETURN_EXPR@[1093; 1099) |
499 | MATCH_ARM@[1168; 1183) | 505 | RETURN_KW@[1093; 1099) "return" |
500 | PLACEHOLDER_PAT@[1168; 1169) | 506 | WHITESPACE@[1099; 1124) "\n ..." |
501 | UNDERSCORE@[1168; 1169) "_" | 507 | R_CURLY@[1124; 1125) "}" |
502 | WHITESPACE@[1169; 1170) " " | 508 | WHITESPACE@[1125; 1146) "\n " |
503 | FAT_ARROW@[1170; 1172) "=>" | 509 | R_CURLY@[1146; 1147) "}" |
504 | WHITESPACE@[1172; 1173) " " | 510 | WHITESPACE@[1147; 1168) "\n " |
505 | BLOCK_EXPR@[1173; 1183) | 511 | MATCH_ARM@[1168; 1183) |
506 | BLOCK@[1173; 1183) | 512 | PLACEHOLDER_PAT@[1168; 1169) |
507 | L_CURLY@[1173; 1174) "{" | 513 | UNDERSCORE@[1168; 1169) "_" |
508 | WHITESPACE@[1174; 1175) " " | 514 | WHITESPACE@[1169; 1170) " " |
509 | RETURN_EXPR@[1175; 1181) | 515 | FAT_ARROW@[1170; 1172) "=>" |
510 | RETURN_KW@[1175; 1181) "return" | 516 | WHITESPACE@[1172; 1173) " " |
511 | WHITESPACE@[1181; 1182) " " | 517 | BLOCK_EXPR@[1173; 1183) |
512 | R_CURLY@[1182; 1183) "}" | 518 | BLOCK@[1173; 1183) |
513 | WHITESPACE@[1183; 1200) "\n " | 519 | L_CURLY@[1173; 1174) "{" |
514 | R_CURLY@[1200; 1201) "}" | 520 | WHITESPACE@[1174; 1175) " " |
515 | SEMI@[1201; 1202) ";" | 521 | RETURN_EXPR@[1175; 1181) |
516 | WHITESPACE@[1202; 1215) "\n " | 522 | RETURN_KW@[1175; 1181) "return" |
517 | R_CURLY@[1215; 1216) "}" | 523 | WHITESPACE@[1181; 1182) " " |
518 | WHITESPACE@[1216; 1217) " " | 524 | R_CURLY@[1182; 1183) "}" |
519 | ELSE_KW@[1217; 1221) "else" | 525 | WHITESPACE@[1183; 1200) "\n " |
520 | WHITESPACE@[1221; 1222) " " | 526 | R_CURLY@[1200; 1201) "}" |
521 | IF_EXPR@[1222; 1273) | 527 | SEMI@[1201; 1202) ";" |
522 | IF_KW@[1222; 1224) "if" | 528 | WHITESPACE@[1202; 1215) "\n " |
523 | WHITESPACE@[1224; 1225) " " | 529 | R_CURLY@[1215; 1216) "}" |
524 | CONDITION@[1225; 1233) | 530 | WHITESPACE@[1216; 1217) " " |
525 | PAREN_EXPR@[1225; 1233) | 531 | ELSE_KW@[1217; 1221) "else" |
526 | L_PAREN@[1225; 1226) "(" | 532 | WHITESPACE@[1221; 1222) " " |
527 | RETURN_EXPR@[1226; 1232) | 533 | IF_EXPR@[1222; 1273) |
528 | RETURN_KW@[1226; 1232) "return" | 534 | IF_KW@[1222; 1224) "if" |
529 | R_PAREN@[1232; 1233) ")" | 535 | WHITESPACE@[1224; 1225) " " |
530 | WHITESPACE@[1233; 1234) " " | 536 | CONDITION@[1225; 1233) |
531 | BLOCK@[1234; 1273) | 537 | PAREN_EXPR@[1225; 1233) |
532 | L_CURLY@[1234; 1235) "{" | 538 | L_PAREN@[1225; 1226) "(" |
533 | WHITESPACE@[1235; 1252) "\n " | 539 | RETURN_EXPR@[1226; 1232) |
534 | EXPR_STMT@[1252; 1259) | 540 | RETURN_KW@[1226; 1232) "return" |
535 | RETURN_EXPR@[1252; 1258) | 541 | R_PAREN@[1232; 1233) ")" |
536 | RETURN_KW@[1252; 1258) "return" | 542 | WHITESPACE@[1233; 1234) " " |
537 | SEMI@[1258; 1259) ";" | 543 | BLOCK_EXPR@[1234; 1273) |
538 | WHITESPACE@[1259; 1272) "\n " | 544 | BLOCK@[1234; 1273) |
539 | R_CURLY@[1272; 1273) "}" | 545 | L_CURLY@[1234; 1235) "{" |
540 | WHITESPACE@[1273; 1282) "\n " | 546 | WHITESPACE@[1235; 1252) "\n " |
541 | R_CURLY@[1282; 1283) "}" | 547 | EXPR_STMT@[1252; 1259) |
542 | WHITESPACE@[1283; 1292) "\n " | 548 | RETURN_EXPR@[1252; 1258) |
543 | IF_EXPR@[1292; 1314) | 549 | RETURN_KW@[1252; 1258) "return" |
544 | IF_KW@[1292; 1294) "if" | 550 | SEMI@[1258; 1259) ";" |
545 | WHITESPACE@[1294; 1295) " " | 551 | WHITESPACE@[1259; 1272) "\n " |
546 | CONDITION@[1295; 1303) | 552 | R_CURLY@[1272; 1273) "}" |
547 | PAREN_EXPR@[1295; 1303) | 553 | WHITESPACE@[1273; 1282) "\n " |
548 | L_PAREN@[1295; 1296) "(" | 554 | R_CURLY@[1282; 1283) "}" |
549 | RETURN_EXPR@[1296; 1302) | 555 | WHITESPACE@[1283; 1292) "\n " |
550 | RETURN_KW@[1296; 1302) "return" | 556 | IF_EXPR@[1292; 1314) |
551 | R_PAREN@[1302; 1303) ")" | 557 | IF_KW@[1292; 1294) "if" |
552 | WHITESPACE@[1303; 1304) " " | 558 | WHITESPACE@[1294; 1295) " " |
553 | BLOCK@[1304; 1314) | 559 | CONDITION@[1295; 1303) |
554 | L_CURLY@[1304; 1305) "{" | 560 | PAREN_EXPR@[1295; 1303) |
555 | WHITESPACE@[1305; 1306) " " | 561 | L_PAREN@[1295; 1296) "(" |
556 | EXPR_STMT@[1306; 1312) | 562 | RETURN_EXPR@[1296; 1302) |
557 | BREAK_EXPR@[1306; 1311) | 563 | RETURN_KW@[1296; 1302) "return" |
558 | BREAK_KW@[1306; 1311) "break" | 564 | R_PAREN@[1302; 1303) ")" |
559 | SEMI@[1311; 1312) ";" | 565 | WHITESPACE@[1303; 1304) " " |
560 | WHITESPACE@[1312; 1313) " " | 566 | BLOCK_EXPR@[1304; 1314) |
561 | R_CURLY@[1313; 1314) "}" | 567 | BLOCK@[1304; 1314) |
562 | WHITESPACE@[1314; 1319) "\n " | 568 | L_CURLY@[1304; 1305) "{" |
563 | R_CURLY@[1319; 1320) "}" | 569 | WHITESPACE@[1305; 1306) " " |
564 | WHITESPACE@[1320; 1321) "\n" | 570 | EXPR_STMT@[1306; 1312) |
565 | R_CURLY@[1321; 1322) "}" | 571 | BREAK_EXPR@[1306; 1311) |
572 | BREAK_KW@[1306; 1311) "break" | ||
573 | SEMI@[1311; 1312) ";" | ||
574 | WHITESPACE@[1312; 1313) " " | ||
575 | R_CURLY@[1313; 1314) "}" | ||
576 | WHITESPACE@[1314; 1319) "\n " | ||
577 | R_CURLY@[1319; 1320) "}" | ||
578 | WHITESPACE@[1320; 1321) "\n" | ||
579 | R_CURLY@[1321; 1322) "}" | ||
566 | WHITESPACE@[1322; 1324) "\n\n" | 580 | WHITESPACE@[1322; 1324) "\n\n" |
567 | FN_DEF@[1324; 1539) | 581 | FN_DEF@[1324; 1539) |
568 | FN_KW@[1324; 1326) "fn" | 582 | FN_KW@[1324; 1326) "fn" |
@@ -573,233 +587,234 @@ SOURCE_FILE@[0; 3813) | |||
573 | L_PAREN@[1334; 1335) "(" | 587 | L_PAREN@[1334; 1335) "(" |
574 | R_PAREN@[1335; 1336) ")" | 588 | R_PAREN@[1335; 1336) ")" |
575 | WHITESPACE@[1336; 1337) " " | 589 | WHITESPACE@[1336; 1337) " " |
576 | BLOCK@[1337; 1539) | 590 | BLOCK_EXPR@[1337; 1539) |
577 | L_CURLY@[1337; 1338) "{" | 591 | BLOCK@[1337; 1539) |
578 | WHITESPACE@[1338; 1343) "\n " | 592 | L_CURLY@[1337; 1338) "{" |
579 | LET_STMT@[1343; 1361) | 593 | WHITESPACE@[1338; 1343) "\n " |
580 | LET_KW@[1343; 1346) "let" | 594 | LET_STMT@[1343; 1361) |
581 | WHITESPACE@[1346; 1347) " " | 595 | LET_KW@[1343; 1346) "let" |
582 | BIND_PAT@[1347; 1353) | 596 | WHITESPACE@[1346; 1347) " " |
583 | MUT_KW@[1347; 1350) "mut" | 597 | BIND_PAT@[1347; 1353) |
584 | WHITESPACE@[1350; 1351) " " | 598 | MUT_KW@[1347; 1350) "mut" |
585 | NAME@[1351; 1353) | 599 | WHITESPACE@[1350; 1351) " " |
586 | IDENT@[1351; 1353) "_x" | 600 | NAME@[1351; 1353) |
587 | COLON@[1353; 1354) ":" | 601 | IDENT@[1351; 1353) "_x" |
588 | WHITESPACE@[1354; 1355) " " | 602 | COLON@[1353; 1354) ":" |
589 | PATH_TYPE@[1355; 1360) | 603 | WHITESPACE@[1354; 1355) " " |
590 | PATH@[1355; 1360) | 604 | PATH_TYPE@[1355; 1360) |
591 | PATH_SEGMENT@[1355; 1360) | 605 | PATH@[1355; 1360) |
592 | NAME_REF@[1355; 1360) | 606 | PATH_SEGMENT@[1355; 1360) |
593 | IDENT@[1355; 1360) "isize" | 607 | NAME_REF@[1355; 1360) |
594 | SEMI@[1360; 1361) ";" | 608 | IDENT@[1355; 1360) "isize" |
595 | WHITESPACE@[1361; 1366) "\n " | 609 | SEMI@[1360; 1361) ";" |
596 | LET_STMT@[1366; 1400) | 610 | WHITESPACE@[1361; 1366) "\n " |
597 | LET_KW@[1366; 1369) "let" | 611 | LET_STMT@[1366; 1400) |
598 | WHITESPACE@[1369; 1370) " " | 612 | LET_KW@[1366; 1369) "let" |
599 | BIND_PAT@[1370; 1376) | 613 | WHITESPACE@[1369; 1370) " " |
600 | MUT_KW@[1370; 1373) "mut" | 614 | BIND_PAT@[1370; 1376) |
601 | WHITESPACE@[1373; 1374) " " | 615 | MUT_KW@[1370; 1373) "mut" |
602 | NAME@[1374; 1376) | 616 | WHITESPACE@[1373; 1374) " " |
603 | IDENT@[1374; 1376) "_y" | 617 | NAME@[1374; 1376) |
604 | WHITESPACE@[1376; 1377) " " | 618 | IDENT@[1374; 1376) "_y" |
605 | EQ@[1377; 1378) "=" | 619 | WHITESPACE@[1376; 1377) " " |
606 | WHITESPACE@[1378; 1379) " " | 620 | EQ@[1377; 1378) "=" |
607 | BIN_EXPR@[1379; 1399) | 621 | WHITESPACE@[1378; 1379) " " |
608 | PAREN_EXPR@[1379; 1387) | 622 | BIN_EXPR@[1379; 1399) |
609 | L_PAREN@[1379; 1380) "(" | 623 | PAREN_EXPR@[1379; 1387) |
610 | BIN_EXPR@[1380; 1386) | 624 | L_PAREN@[1379; 1380) "(" |
611 | PATH_EXPR@[1380; 1382) | 625 | BIN_EXPR@[1380; 1386) |
612 | PATH@[1380; 1382) | 626 | PATH_EXPR@[1380; 1382) |
613 | PATH_SEGMENT@[1380; 1382) | 627 | PATH@[1380; 1382) |
614 | NAME_REF@[1380; 1382) | 628 | PATH_SEGMENT@[1380; 1382) |
615 | IDENT@[1380; 1382) "_x" | 629 | NAME_REF@[1380; 1382) |
616 | WHITESPACE@[1382; 1383) " " | 630 | IDENT@[1380; 1382) "_x" |
617 | EQ@[1383; 1384) "=" | 631 | WHITESPACE@[1382; 1383) " " |
618 | WHITESPACE@[1384; 1385) " " | 632 | EQ@[1383; 1384) "=" |
619 | LITERAL@[1385; 1386) | 633 | WHITESPACE@[1384; 1385) " " |
620 | INT_NUMBER@[1385; 1386) "0" | 634 | LITERAL@[1385; 1386) |
621 | R_PAREN@[1386; 1387) ")" | 635 | INT_NUMBER@[1385; 1386) "0" |
622 | WHITESPACE@[1387; 1388) " " | 636 | R_PAREN@[1386; 1387) ")" |
623 | EQEQ@[1388; 1390) "==" | 637 | WHITESPACE@[1387; 1388) " " |
624 | WHITESPACE@[1390; 1391) " " | 638 | EQEQ@[1388; 1390) "==" |
625 | PAREN_EXPR@[1391; 1399) | 639 | WHITESPACE@[1390; 1391) " " |
626 | L_PAREN@[1391; 1392) "(" | 640 | PAREN_EXPR@[1391; 1399) |
627 | BIN_EXPR@[1392; 1398) | 641 | L_PAREN@[1391; 1392) "(" |
628 | PATH_EXPR@[1392; 1394) | 642 | BIN_EXPR@[1392; 1398) |
629 | PATH@[1392; 1394) | 643 | PATH_EXPR@[1392; 1394) |
630 | PATH_SEGMENT@[1392; 1394) | 644 | PATH@[1392; 1394) |
631 | NAME_REF@[1392; 1394) | 645 | PATH_SEGMENT@[1392; 1394) |
632 | IDENT@[1392; 1394) "_x" | 646 | NAME_REF@[1392; 1394) |
633 | WHITESPACE@[1394; 1395) " " | 647 | IDENT@[1392; 1394) "_x" |
634 | EQ@[1395; 1396) "=" | 648 | WHITESPACE@[1394; 1395) " " |
635 | WHITESPACE@[1396; 1397) " " | 649 | EQ@[1395; 1396) "=" |
636 | LITERAL@[1397; 1398) | 650 | WHITESPACE@[1396; 1397) " " |
637 | INT_NUMBER@[1397; 1398) "0" | 651 | LITERAL@[1397; 1398) |
638 | R_PAREN@[1398; 1399) ")" | 652 | INT_NUMBER@[1397; 1398) "0" |
639 | SEMI@[1399; 1400) ";" | 653 | R_PAREN@[1398; 1399) ")" |
640 | WHITESPACE@[1400; 1405) "\n " | 654 | SEMI@[1399; 1400) ";" |
641 | LET_STMT@[1405; 1438) | 655 | WHITESPACE@[1400; 1405) "\n " |
642 | LET_KW@[1405; 1408) "let" | 656 | LET_STMT@[1405; 1438) |
643 | WHITESPACE@[1408; 1409) " " | 657 | LET_KW@[1405; 1408) "let" |
644 | BIND_PAT@[1409; 1415) | 658 | WHITESPACE@[1408; 1409) " " |
645 | MUT_KW@[1409; 1412) "mut" | 659 | BIND_PAT@[1409; 1415) |
646 | WHITESPACE@[1412; 1413) " " | 660 | MUT_KW@[1409; 1412) "mut" |
647 | NAME@[1413; 1415) | 661 | WHITESPACE@[1412; 1413) " " |
648 | IDENT@[1413; 1415) "_z" | 662 | NAME@[1413; 1415) |
649 | WHITESPACE@[1415; 1416) " " | 663 | IDENT@[1413; 1415) "_z" |
650 | EQ@[1416; 1417) "=" | 664 | WHITESPACE@[1415; 1416) " " |
651 | WHITESPACE@[1417; 1418) " " | 665 | EQ@[1416; 1417) "=" |
652 | BIN_EXPR@[1418; 1437) | 666 | WHITESPACE@[1417; 1418) " " |
653 | PAREN_EXPR@[1418; 1426) | 667 | BIN_EXPR@[1418; 1437) |
654 | L_PAREN@[1418; 1419) "(" | 668 | PAREN_EXPR@[1418; 1426) |
655 | BIN_EXPR@[1419; 1425) | 669 | L_PAREN@[1418; 1419) "(" |
656 | PATH_EXPR@[1419; 1421) | 670 | BIN_EXPR@[1419; 1425) |
657 | PATH@[1419; 1421) | 671 | PATH_EXPR@[1419; 1421) |
658 | PATH_SEGMENT@[1419; 1421) | 672 | PATH@[1419; 1421) |
659 | NAME_REF@[1419; 1421) | 673 | PATH_SEGMENT@[1419; 1421) |
660 | IDENT@[1419; 1421) "_x" | 674 | NAME_REF@[1419; 1421) |
661 | WHITESPACE@[1421; 1422) " " | 675 | IDENT@[1419; 1421) "_x" |
662 | EQ@[1422; 1423) "=" | 676 | WHITESPACE@[1421; 1422) " " |
663 | WHITESPACE@[1423; 1424) " " | 677 | EQ@[1422; 1423) "=" |
664 | LITERAL@[1424; 1425) | 678 | WHITESPACE@[1423; 1424) " " |
665 | INT_NUMBER@[1424; 1425) "0" | 679 | LITERAL@[1424; 1425) |
666 | R_PAREN@[1425; 1426) ")" | 680 | INT_NUMBER@[1424; 1425) "0" |
667 | WHITESPACE@[1426; 1427) " " | 681 | R_PAREN@[1425; 1426) ")" |
668 | L_ANGLE@[1427; 1428) "<" | 682 | WHITESPACE@[1426; 1427) " " |
669 | WHITESPACE@[1428; 1429) " " | 683 | L_ANGLE@[1427; 1428) "<" |
670 | PAREN_EXPR@[1429; 1437) | 684 | WHITESPACE@[1428; 1429) " " |
671 | L_PAREN@[1429; 1430) "(" | 685 | PAREN_EXPR@[1429; 1437) |
672 | BIN_EXPR@[1430; 1436) | 686 | L_PAREN@[1429; 1430) "(" |
673 | PATH_EXPR@[1430; 1432) | 687 | BIN_EXPR@[1430; 1436) |
674 | PATH@[1430; 1432) | 688 | PATH_EXPR@[1430; 1432) |
675 | PATH_SEGMENT@[1430; 1432) | 689 | PATH@[1430; 1432) |
676 | NAME_REF@[1430; 1432) | 690 | PATH_SEGMENT@[1430; 1432) |
677 | IDENT@[1430; 1432) "_x" | 691 | NAME_REF@[1430; 1432) |
678 | WHITESPACE@[1432; 1433) " " | 692 | IDENT@[1430; 1432) "_x" |
679 | EQ@[1433; 1434) "=" | 693 | WHITESPACE@[1432; 1433) " " |
680 | WHITESPACE@[1434; 1435) " " | 694 | EQ@[1433; 1434) "=" |
681 | LITERAL@[1435; 1436) | 695 | WHITESPACE@[1434; 1435) " " |
682 | INT_NUMBER@[1435; 1436) "0" | 696 | LITERAL@[1435; 1436) |
683 | R_PAREN@[1436; 1437) ")" | 697 | INT_NUMBER@[1435; 1436) "0" |
684 | SEMI@[1437; 1438) ";" | 698 | R_PAREN@[1436; 1437) ")" |
685 | WHITESPACE@[1438; 1443) "\n " | 699 | SEMI@[1437; 1438) ";" |
686 | LET_STMT@[1443; 1474) | 700 | WHITESPACE@[1438; 1443) "\n " |
687 | LET_KW@[1443; 1446) "let" | 701 | LET_STMT@[1443; 1474) |
688 | WHITESPACE@[1446; 1447) " " | 702 | LET_KW@[1443; 1446) "let" |
689 | BIND_PAT@[1447; 1449) | 703 | WHITESPACE@[1446; 1447) " " |
690 | NAME@[1447; 1449) | 704 | BIND_PAT@[1447; 1449) |
691 | IDENT@[1447; 1449) "_a" | 705 | NAME@[1447; 1449) |
692 | WHITESPACE@[1449; 1450) " " | 706 | IDENT@[1447; 1449) "_a" |
693 | EQ@[1450; 1451) "=" | 707 | WHITESPACE@[1449; 1450) " " |
694 | WHITESPACE@[1451; 1452) " " | 708 | EQ@[1450; 1451) "=" |
695 | BIN_EXPR@[1452; 1473) | 709 | WHITESPACE@[1451; 1452) " " |
696 | PAREN_EXPR@[1452; 1461) | 710 | BIN_EXPR@[1452; 1473) |
697 | L_PAREN@[1452; 1453) "(" | 711 | PAREN_EXPR@[1452; 1461) |
698 | BIN_EXPR@[1453; 1460) | 712 | L_PAREN@[1452; 1453) "(" |
699 | PATH_EXPR@[1453; 1455) | 713 | BIN_EXPR@[1453; 1460) |
700 | PATH@[1453; 1455) | 714 | PATH_EXPR@[1453; 1455) |
701 | PATH_SEGMENT@[1453; 1455) | 715 | PATH@[1453; 1455) |
702 | NAME_REF@[1453; 1455) | 716 | PATH_SEGMENT@[1453; 1455) |
703 | IDENT@[1453; 1455) "_x" | 717 | NAME_REF@[1453; 1455) |
704 | WHITESPACE@[1455; 1456) " " | 718 | IDENT@[1453; 1455) "_x" |
705 | PLUSEQ@[1456; 1458) "+=" | 719 | WHITESPACE@[1455; 1456) " " |
706 | WHITESPACE@[1458; 1459) " " | 720 | PLUSEQ@[1456; 1458) "+=" |
707 | LITERAL@[1459; 1460) | 721 | WHITESPACE@[1458; 1459) " " |
708 | INT_NUMBER@[1459; 1460) "0" | 722 | LITERAL@[1459; 1460) |
709 | R_PAREN@[1460; 1461) ")" | 723 | INT_NUMBER@[1459; 1460) "0" |
710 | WHITESPACE@[1461; 1462) " " | 724 | R_PAREN@[1460; 1461) ")" |
711 | EQEQ@[1462; 1464) "==" | 725 | WHITESPACE@[1461; 1462) " " |
712 | WHITESPACE@[1464; 1465) " " | 726 | EQEQ@[1462; 1464) "==" |
713 | PAREN_EXPR@[1465; 1473) | 727 | WHITESPACE@[1464; 1465) " " |
714 | L_PAREN@[1465; 1466) "(" | 728 | PAREN_EXPR@[1465; 1473) |
715 | BIN_EXPR@[1466; 1472) | 729 | L_PAREN@[1465; 1466) "(" |
716 | PATH_EXPR@[1466; 1468) | 730 | BIN_EXPR@[1466; 1472) |
717 | PATH@[1466; 1468) | 731 | PATH_EXPR@[1466; 1468) |
718 | PATH_SEGMENT@[1466; 1468) | 732 | PATH@[1466; 1468) |
719 | NAME_REF@[1466; 1468) | 733 | PATH_SEGMENT@[1466; 1468) |
720 | IDENT@[1466; 1468) "_x" | 734 | NAME_REF@[1466; 1468) |
721 | WHITESPACE@[1468; 1469) " " | 735 | IDENT@[1466; 1468) "_x" |
722 | EQ@[1469; 1470) "=" | 736 | WHITESPACE@[1468; 1469) " " |
723 | WHITESPACE@[1470; 1471) " " | 737 | EQ@[1469; 1470) "=" |
724 | LITERAL@[1471; 1472) | 738 | WHITESPACE@[1470; 1471) " " |
725 | INT_NUMBER@[1471; 1472) "0" | 739 | LITERAL@[1471; 1472) |
726 | R_PAREN@[1472; 1473) ")" | 740 | INT_NUMBER@[1471; 1472) "0" |
727 | SEMI@[1473; 1474) ";" | 741 | R_PAREN@[1472; 1473) ")" |
728 | WHITESPACE@[1474; 1479) "\n " | 742 | SEMI@[1473; 1474) ";" |
729 | LET_STMT@[1479; 1537) | 743 | WHITESPACE@[1474; 1479) "\n " |
730 | LET_KW@[1479; 1482) "let" | 744 | LET_STMT@[1479; 1537) |
731 | WHITESPACE@[1482; 1483) " " | 745 | LET_KW@[1479; 1482) "let" |
732 | BIND_PAT@[1483; 1485) | 746 | WHITESPACE@[1482; 1483) " " |
733 | NAME@[1483; 1485) | 747 | BIND_PAT@[1483; 1485) |
734 | IDENT@[1483; 1485) "_b" | 748 | NAME@[1483; 1485) |
735 | WHITESPACE@[1485; 1486) " " | 749 | IDENT@[1483; 1485) "_b" |
736 | EQ@[1486; 1487) "=" | 750 | WHITESPACE@[1485; 1486) " " |
737 | WHITESPACE@[1487; 1488) " " | 751 | EQ@[1486; 1487) "=" |
738 | BIN_EXPR@[1488; 1536) | 752 | WHITESPACE@[1487; 1488) " " |
739 | CALL_EXPR@[1488; 1510) | 753 | BIN_EXPR@[1488; 1536) |
740 | PATH_EXPR@[1488; 1492) | 754 | CALL_EXPR@[1488; 1510) |
741 | PATH@[1488; 1492) | 755 | PATH_EXPR@[1488; 1492) |
742 | PATH_SEGMENT@[1488; 1492) | 756 | PATH@[1488; 1492) |
743 | NAME_REF@[1488; 1492) | 757 | PATH_SEGMENT@[1488; 1492) |
744 | IDENT@[1488; 1492) "swap" | 758 | NAME_REF@[1488; 1492) |
745 | ARG_LIST@[1492; 1510) | 759 | IDENT@[1488; 1492) "swap" |
746 | L_PAREN@[1492; 1493) "(" | 760 | ARG_LIST@[1492; 1510) |
747 | REF_EXPR@[1493; 1500) | 761 | L_PAREN@[1492; 1493) "(" |
748 | AMP@[1493; 1494) "&" | 762 | REF_EXPR@[1493; 1500) |
749 | MUT_KW@[1494; 1497) "mut" | 763 | AMP@[1493; 1494) "&" |
750 | WHITESPACE@[1497; 1498) " " | 764 | MUT_KW@[1494; 1497) "mut" |
751 | PATH_EXPR@[1498; 1500) | 765 | WHITESPACE@[1497; 1498) " " |
752 | PATH@[1498; 1500) | 766 | PATH_EXPR@[1498; 1500) |
753 | PATH_SEGMENT@[1498; 1500) | 767 | PATH@[1498; 1500) |
754 | NAME_REF@[1498; 1500) | 768 | PATH_SEGMENT@[1498; 1500) |
755 | IDENT@[1498; 1500) "_y" | 769 | NAME_REF@[1498; 1500) |
756 | COMMA@[1500; 1501) "," | 770 | IDENT@[1498; 1500) "_y" |
757 | WHITESPACE@[1501; 1502) " " | 771 | COMMA@[1500; 1501) "," |
758 | REF_EXPR@[1502; 1509) | 772 | WHITESPACE@[1501; 1502) " " |
759 | AMP@[1502; 1503) "&" | 773 | REF_EXPR@[1502; 1509) |
760 | MUT_KW@[1503; 1506) "mut" | 774 | AMP@[1502; 1503) "&" |
761 | WHITESPACE@[1506; 1507) " " | 775 | MUT_KW@[1503; 1506) "mut" |
762 | PATH_EXPR@[1507; 1509) | 776 | WHITESPACE@[1506; 1507) " " |
763 | PATH@[1507; 1509) | 777 | PATH_EXPR@[1507; 1509) |
764 | PATH_SEGMENT@[1507; 1509) | 778 | PATH@[1507; 1509) |
765 | NAME_REF@[1507; 1509) | 779 | PATH_SEGMENT@[1507; 1509) |
766 | IDENT@[1507; 1509) "_z" | 780 | NAME_REF@[1507; 1509) |
767 | R_PAREN@[1509; 1510) ")" | 781 | IDENT@[1507; 1509) "_z" |
768 | WHITESPACE@[1510; 1511) " " | 782 | R_PAREN@[1509; 1510) ")" |
769 | EQEQ@[1511; 1513) "==" | 783 | WHITESPACE@[1510; 1511) " " |
770 | WHITESPACE@[1513; 1514) " " | 784 | EQEQ@[1511; 1513) "==" |
771 | CALL_EXPR@[1514; 1536) | 785 | WHITESPACE@[1513; 1514) " " |
772 | PATH_EXPR@[1514; 1518) | 786 | CALL_EXPR@[1514; 1536) |
773 | PATH@[1514; 1518) | 787 | PATH_EXPR@[1514; 1518) |
774 | PATH_SEGMENT@[1514; 1518) | 788 | PATH@[1514; 1518) |
775 | NAME_REF@[1514; 1518) | 789 | PATH_SEGMENT@[1514; 1518) |
776 | IDENT@[1514; 1518) "swap" | 790 | NAME_REF@[1514; 1518) |
777 | ARG_LIST@[1518; 1536) | 791 | IDENT@[1514; 1518) "swap" |
778 | L_PAREN@[1518; 1519) "(" | 792 | ARG_LIST@[1518; 1536) |
779 | REF_EXPR@[1519; 1526) | 793 | L_PAREN@[1518; 1519) "(" |
780 | AMP@[1519; 1520) "&" | 794 | REF_EXPR@[1519; 1526) |
781 | MUT_KW@[1520; 1523) "mut" | 795 | AMP@[1519; 1520) "&" |
782 | WHITESPACE@[1523; 1524) " " | 796 | MUT_KW@[1520; 1523) "mut" |
783 | PATH_EXPR@[1524; 1526) | 797 | WHITESPACE@[1523; 1524) " " |
784 | PATH@[1524; 1526) | 798 | PATH_EXPR@[1524; 1526) |
785 | PATH_SEGMENT@[1524; 1526) | 799 | PATH@[1524; 1526) |
786 | NAME_REF@[1524; 1526) | 800 | PATH_SEGMENT@[1524; 1526) |
787 | IDENT@[1524; 1526) "_y" | 801 | NAME_REF@[1524; 1526) |
788 | COMMA@[1526; 1527) "," | 802 | IDENT@[1524; 1526) "_y" |
789 | WHITESPACE@[1527; 1528) " " | 803 | COMMA@[1526; 1527) "," |
790 | REF_EXPR@[1528; 1535) | 804 | WHITESPACE@[1527; 1528) " " |
791 | AMP@[1528; 1529) "&" | 805 | REF_EXPR@[1528; 1535) |
792 | MUT_KW@[1529; 1532) "mut" | 806 | AMP@[1528; 1529) "&" |
793 | WHITESPACE@[1532; 1533) " " | 807 | MUT_KW@[1529; 1532) "mut" |
794 | PATH_EXPR@[1533; 1535) | 808 | WHITESPACE@[1532; 1533) " " |
795 | PATH@[1533; 1535) | 809 | PATH_EXPR@[1533; 1535) |
796 | PATH_SEGMENT@[1533; 1535) | 810 | PATH@[1533; 1535) |
797 | NAME_REF@[1533; 1535) | 811 | PATH_SEGMENT@[1533; 1535) |
798 | IDENT@[1533; 1535) "_z" | 812 | NAME_REF@[1533; 1535) |
799 | R_PAREN@[1535; 1536) ")" | 813 | IDENT@[1533; 1535) "_z" |
800 | SEMI@[1536; 1537) ";" | 814 | R_PAREN@[1535; 1536) ")" |
801 | WHITESPACE@[1537; 1538) "\n" | 815 | SEMI@[1536; 1537) ";" |
802 | R_CURLY@[1538; 1539) "}" | 816 | WHITESPACE@[1537; 1538) "\n" |
817 | R_CURLY@[1538; 1539) "}" | ||
803 | WHITESPACE@[1539; 1541) "\n\n" | 818 | WHITESPACE@[1539; 1541) "\n\n" |
804 | FN_DEF@[1541; 1741) | 819 | FN_DEF@[1541; 1741) |
805 | FN_KW@[1541; 1543) "fn" | 820 | FN_KW@[1541; 1543) "fn" |
@@ -819,166 +834,168 @@ SOURCE_FILE@[0; 3813) | |||
819 | NAME_REF@[1563; 1568) | 834 | NAME_REF@[1563; 1568) |
820 | IDENT@[1563; 1568) "usize" | 835 | IDENT@[1563; 1568) "usize" |
821 | WHITESPACE@[1568; 1569) " " | 836 | WHITESPACE@[1568; 1569) " " |
822 | BLOCK@[1569; 1741) | 837 | BLOCK_EXPR@[1569; 1741) |
823 | L_CURLY@[1569; 1570) "{" | 838 | BLOCK@[1569; 1741) |
824 | WHITESPACE@[1570; 1575) "\n " | 839 | L_CURLY@[1569; 1570) "{" |
825 | FN_DEF@[1575; 1598) | 840 | WHITESPACE@[1570; 1575) "\n " |
826 | FN_KW@[1575; 1577) "fn" | 841 | FN_DEF@[1575; 1598) |
827 | WHITESPACE@[1577; 1578) " " | 842 | FN_KW@[1575; 1577) "fn" |
828 | NAME@[1578; 1579) | 843 | WHITESPACE@[1577; 1578) " " |
829 | IDENT@[1578; 1579) "p" | 844 | NAME@[1578; 1579) |
830 | PARAM_LIST@[1579; 1581) | 845 | IDENT@[1578; 1579) "p" |
831 | L_PAREN@[1579; 1580) "(" | 846 | PARAM_LIST@[1579; 1581) |
832 | R_PAREN@[1580; 1581) ")" | 847 | L_PAREN@[1579; 1580) "(" |
833 | WHITESPACE@[1581; 1582) " " | 848 | R_PAREN@[1580; 1581) ")" |
834 | RET_TYPE@[1582; 1589) | 849 | WHITESPACE@[1581; 1582) " " |
835 | THIN_ARROW@[1582; 1584) "->" | 850 | RET_TYPE@[1582; 1589) |
836 | WHITESPACE@[1584; 1585) " " | 851 | THIN_ARROW@[1582; 1584) "->" |
837 | PATH_TYPE@[1585; 1589) | 852 | WHITESPACE@[1584; 1585) " " |
838 | PATH@[1585; 1589) | 853 | PATH_TYPE@[1585; 1589) |
839 | PATH_SEGMENT@[1585; 1589) | 854 | PATH@[1585; 1589) |
840 | NAME_REF@[1585; 1589) | 855 | PATH_SEGMENT@[1585; 1589) |
841 | IDENT@[1585; 1589) "bool" | 856 | NAME_REF@[1585; 1589) |
842 | WHITESPACE@[1589; 1590) " " | 857 | IDENT@[1585; 1589) "bool" |
843 | BLOCK@[1590; 1598) | 858 | WHITESPACE@[1589; 1590) " " |
844 | L_CURLY@[1590; 1591) "{" | 859 | BLOCK_EXPR@[1590; 1598) |
845 | WHITESPACE@[1591; 1592) " " | 860 | BLOCK@[1590; 1598) |
846 | LITERAL@[1592; 1596) | 861 | L_CURLY@[1590; 1591) "{" |
847 | TRUE_KW@[1592; 1596) "true" | 862 | WHITESPACE@[1591; 1592) " " |
848 | WHITESPACE@[1596; 1597) " " | 863 | LITERAL@[1592; 1596) |
849 | R_CURLY@[1597; 1598) "}" | 864 | TRUE_KW@[1592; 1596) "true" |
850 | WHITESPACE@[1598; 1603) "\n " | 865 | WHITESPACE@[1596; 1597) " " |
851 | LET_STMT@[1603; 1648) | 866 | R_CURLY@[1597; 1598) "}" |
852 | LET_KW@[1603; 1606) "let" | 867 | WHITESPACE@[1598; 1603) "\n " |
853 | WHITESPACE@[1606; 1607) " " | 868 | LET_STMT@[1603; 1648) |
854 | BIND_PAT@[1607; 1609) | 869 | LET_KW@[1603; 1606) "let" |
855 | NAME@[1607; 1609) | 870 | WHITESPACE@[1606; 1607) " " |
856 | IDENT@[1607; 1609) "_a" | 871 | BIND_PAT@[1607; 1609) |
857 | WHITESPACE@[1609; 1610) " " | 872 | NAME@[1607; 1609) |
858 | EQ@[1610; 1611) "=" | 873 | IDENT@[1607; 1609) "_a" |
859 | WHITESPACE@[1611; 1612) " " | 874 | WHITESPACE@[1609; 1610) " " |
860 | PAREN_EXPR@[1612; 1647) | 875 | EQ@[1610; 1611) "=" |
861 | L_PAREN@[1612; 1613) "(" | 876 | WHITESPACE@[1611; 1612) " " |
862 | BIN_EXPR@[1613; 1646) | 877 | PAREN_EXPR@[1612; 1647) |
863 | MACRO_CALL@[1613; 1628) | 878 | L_PAREN@[1612; 1613) "(" |
864 | PATH@[1613; 1619) | 879 | BIN_EXPR@[1613; 1646) |
865 | PATH_SEGMENT@[1613; 1619) | 880 | MACRO_CALL@[1613; 1628) |
866 | NAME_REF@[1613; 1619) | 881 | PATH@[1613; 1619) |
867 | IDENT@[1613; 1619) "assert" | 882 | PATH_SEGMENT@[1613; 1619) |
868 | EXCL@[1619; 1620) "!" | 883 | NAME_REF@[1613; 1619) |
869 | TOKEN_TREE@[1620; 1628) | 884 | IDENT@[1613; 1619) "assert" |
870 | L_PAREN@[1620; 1621) "(" | 885 | EXCL@[1619; 1620) "!" |
871 | TOKEN_TREE@[1621; 1627) | 886 | TOKEN_TREE@[1620; 1628) |
872 | L_PAREN@[1621; 1622) "(" | 887 | L_PAREN@[1620; 1621) "(" |
873 | TRUE_KW@[1622; 1626) "true" | 888 | TOKEN_TREE@[1621; 1627) |
874 | R_PAREN@[1626; 1627) ")" | 889 | L_PAREN@[1621; 1622) "(" |
875 | R_PAREN@[1627; 1628) ")" | 890 | TRUE_KW@[1622; 1626) "true" |
876 | WHITESPACE@[1628; 1629) " " | 891 | R_PAREN@[1626; 1627) ")" |
877 | EQEQ@[1629; 1631) "==" | 892 | R_PAREN@[1627; 1628) ")" |
878 | WHITESPACE@[1631; 1632) " " | 893 | WHITESPACE@[1628; 1629) " " |
879 | PAREN_EXPR@[1632; 1646) | 894 | EQEQ@[1629; 1631) "==" |
880 | L_PAREN@[1632; 1633) "(" | 895 | WHITESPACE@[1631; 1632) " " |
881 | MACRO_CALL@[1633; 1645) | 896 | PAREN_EXPR@[1632; 1646) |
882 | PATH@[1633; 1639) | 897 | L_PAREN@[1632; 1633) "(" |
883 | PATH_SEGMENT@[1633; 1639) | 898 | MACRO_CALL@[1633; 1645) |
884 | NAME_REF@[1633; 1639) | 899 | PATH@[1633; 1639) |
885 | IDENT@[1633; 1639) "assert" | 900 | PATH_SEGMENT@[1633; 1639) |
886 | EXCL@[1639; 1640) "!" | 901 | NAME_REF@[1633; 1639) |
887 | TOKEN_TREE@[1640; 1645) | 902 | IDENT@[1633; 1639) "assert" |
888 | L_PAREN@[1640; 1641) "(" | 903 | EXCL@[1639; 1640) "!" |
889 | IDENT@[1641; 1642) "p" | 904 | TOKEN_TREE@[1640; 1645) |
890 | TOKEN_TREE@[1642; 1644) | 905 | L_PAREN@[1640; 1641) "(" |
891 | L_PAREN@[1642; 1643) "(" | 906 | IDENT@[1641; 1642) "p" |
892 | R_PAREN@[1643; 1644) ")" | 907 | TOKEN_TREE@[1642; 1644) |
893 | R_PAREN@[1644; 1645) ")" | 908 | L_PAREN@[1642; 1643) "(" |
894 | R_PAREN@[1645; 1646) ")" | 909 | R_PAREN@[1643; 1644) ")" |
895 | R_PAREN@[1646; 1647) ")" | 910 | R_PAREN@[1644; 1645) ")" |
896 | SEMI@[1647; 1648) ";" | 911 | R_PAREN@[1645; 1646) ")" |
897 | WHITESPACE@[1648; 1653) "\n " | 912 | R_PAREN@[1646; 1647) ")" |
898 | LET_STMT@[1653; 1685) | 913 | SEMI@[1647; 1648) ";" |
899 | LET_KW@[1653; 1656) "let" | 914 | WHITESPACE@[1648; 1653) "\n " |
900 | WHITESPACE@[1656; 1657) " " | 915 | LET_STMT@[1653; 1685) |
901 | BIND_PAT@[1657; 1659) | 916 | LET_KW@[1653; 1656) "let" |
902 | NAME@[1657; 1659) | 917 | WHITESPACE@[1656; 1657) " " |
903 | IDENT@[1657; 1659) "_c" | 918 | BIND_PAT@[1657; 1659) |
904 | WHITESPACE@[1659; 1660) " " | 919 | NAME@[1657; 1659) |
905 | EQ@[1660; 1661) "=" | 920 | IDENT@[1657; 1659) "_c" |
906 | WHITESPACE@[1661; 1662) " " | 921 | WHITESPACE@[1659; 1660) " " |
907 | PAREN_EXPR@[1662; 1684) | 922 | EQ@[1660; 1661) "=" |
908 | L_PAREN@[1662; 1663) "(" | 923 | WHITESPACE@[1661; 1662) " " |
909 | BIN_EXPR@[1663; 1683) | 924 | PAREN_EXPR@[1662; 1684) |
910 | MACRO_CALL@[1663; 1677) | 925 | L_PAREN@[1662; 1663) "(" |
911 | PATH@[1663; 1669) | 926 | BIN_EXPR@[1663; 1683) |
912 | PATH_SEGMENT@[1663; 1669) | 927 | MACRO_CALL@[1663; 1677) |
913 | NAME_REF@[1663; 1669) | 928 | PATH@[1663; 1669) |
914 | IDENT@[1663; 1669) "assert" | 929 | PATH_SEGMENT@[1663; 1669) |
915 | EXCL@[1669; 1670) "!" | 930 | NAME_REF@[1663; 1669) |
916 | TOKEN_TREE@[1670; 1677) | 931 | IDENT@[1663; 1669) "assert" |
917 | L_PAREN@[1670; 1671) "(" | 932 | EXCL@[1669; 1670) "!" |
918 | TOKEN_TREE@[1671; 1676) | 933 | TOKEN_TREE@[1670; 1677) |
919 | L_PAREN@[1671; 1672) "(" | 934 | L_PAREN@[1670; 1671) "(" |
920 | IDENT@[1672; 1673) "p" | 935 | TOKEN_TREE@[1671; 1676) |
921 | TOKEN_TREE@[1673; 1675) | 936 | L_PAREN@[1671; 1672) "(" |
922 | L_PAREN@[1673; 1674) "(" | 937 | IDENT@[1672; 1673) "p" |
923 | R_PAREN@[1674; 1675) ")" | 938 | TOKEN_TREE@[1673; 1675) |
924 | R_PAREN@[1675; 1676) ")" | 939 | L_PAREN@[1673; 1674) "(" |
925 | R_PAREN@[1676; 1677) ")" | 940 | R_PAREN@[1674; 1675) ")" |
926 | WHITESPACE@[1677; 1678) " " | 941 | R_PAREN@[1675; 1676) ")" |
927 | EQEQ@[1678; 1680) "==" | 942 | R_PAREN@[1676; 1677) ")" |
928 | WHITESPACE@[1680; 1681) " " | 943 | WHITESPACE@[1677; 1678) " " |
929 | TUPLE_EXPR@[1681; 1683) | 944 | EQEQ@[1678; 1680) "==" |
930 | L_PAREN@[1681; 1682) "(" | 945 | WHITESPACE@[1680; 1681) " " |
931 | R_PAREN@[1682; 1683) ")" | 946 | TUPLE_EXPR@[1681; 1683) |
932 | R_PAREN@[1683; 1684) ")" | 947 | L_PAREN@[1681; 1682) "(" |
933 | SEMI@[1684; 1685) ";" | 948 | R_PAREN@[1682; 1683) ")" |
934 | WHITESPACE@[1685; 1690) "\n " | 949 | R_PAREN@[1683; 1684) ")" |
935 | LET_STMT@[1690; 1739) | 950 | SEMI@[1684; 1685) ";" |
936 | LET_KW@[1690; 1693) "let" | 951 | WHITESPACE@[1685; 1690) "\n " |
937 | WHITESPACE@[1693; 1694) " " | 952 | LET_STMT@[1690; 1739) |
938 | BIND_PAT@[1694; 1696) | 953 | LET_KW@[1690; 1693) "let" |
939 | NAME@[1694; 1696) | 954 | WHITESPACE@[1693; 1694) " " |
940 | IDENT@[1694; 1696) "_b" | 955 | BIND_PAT@[1694; 1696) |
941 | COLON@[1696; 1697) ":" | 956 | NAME@[1694; 1696) |
942 | WHITESPACE@[1697; 1698) " " | 957 | IDENT@[1694; 1696) "_b" |
943 | PATH_TYPE@[1698; 1702) | 958 | COLON@[1696; 1697) ":" |
944 | PATH@[1698; 1702) | 959 | WHITESPACE@[1697; 1698) " " |
945 | PATH_SEGMENT@[1698; 1702) | 960 | PATH_TYPE@[1698; 1702) |
946 | NAME_REF@[1698; 1702) | 961 | PATH@[1698; 1702) |
947 | IDENT@[1698; 1702) "bool" | 962 | PATH_SEGMENT@[1698; 1702) |
948 | WHITESPACE@[1702; 1703) " " | 963 | NAME_REF@[1698; 1702) |
949 | EQ@[1703; 1704) "=" | 964 | IDENT@[1698; 1702) "bool" |
950 | WHITESPACE@[1704; 1705) " " | 965 | WHITESPACE@[1702; 1703) " " |
951 | PAREN_EXPR@[1705; 1738) | 966 | EQ@[1703; 1704) "=" |
952 | L_PAREN@[1705; 1706) "(" | 967 | WHITESPACE@[1704; 1705) " " |
953 | BIN_EXPR@[1706; 1737) | 968 | PAREN_EXPR@[1705; 1738) |
954 | MACRO_CALL@[1706; 1723) | 969 | L_PAREN@[1705; 1706) "(" |
955 | PATH@[1706; 1713) | 970 | BIN_EXPR@[1706; 1737) |
956 | PATH_SEGMENT@[1706; 1713) | 971 | MACRO_CALL@[1706; 1723) |
957 | NAME_REF@[1706; 1713) | 972 | PATH@[1706; 1713) |
958 | IDENT@[1706; 1713) "println" | 973 | PATH_SEGMENT@[1706; 1713) |
959 | EXCL@[1713; 1714) "!" | 974 | NAME_REF@[1706; 1713) |
960 | TOKEN_TREE@[1714; 1723) | 975 | IDENT@[1706; 1713) "println" |
961 | L_PAREN@[1714; 1715) "(" | 976 | EXCL@[1713; 1714) "!" |
962 | STRING@[1715; 1719) "\"{}\"" | 977 | TOKEN_TREE@[1714; 1723) |
963 | COMMA@[1719; 1720) "," | 978 | L_PAREN@[1714; 1715) "(" |
964 | WHITESPACE@[1720; 1721) " " | 979 | STRING@[1715; 1719) "\"{}\"" |
965 | INT_NUMBER@[1721; 1722) "0" | 980 | COMMA@[1719; 1720) "," |
966 | R_PAREN@[1722; 1723) ")" | 981 | WHITESPACE@[1720; 1721) " " |
967 | WHITESPACE@[1723; 1724) " " | 982 | INT_NUMBER@[1721; 1722) "0" |
968 | EQEQ@[1724; 1726) "==" | 983 | R_PAREN@[1722; 1723) ")" |
969 | WHITESPACE@[1726; 1727) " " | 984 | WHITESPACE@[1723; 1724) " " |
970 | PAREN_EXPR@[1727; 1737) | 985 | EQEQ@[1724; 1726) "==" |
971 | L_PAREN@[1727; 1728) "(" | 986 | WHITESPACE@[1726; 1727) " " |
972 | RETURN_EXPR@[1728; 1736) | 987 | PAREN_EXPR@[1727; 1737) |
973 | RETURN_KW@[1728; 1734) "return" | 988 | L_PAREN@[1727; 1728) "(" |
974 | WHITESPACE@[1734; 1735) " " | 989 | RETURN_EXPR@[1728; 1736) |
975 | LITERAL@[1735; 1736) | 990 | RETURN_KW@[1728; 1734) "return" |
976 | INT_NUMBER@[1735; 1736) "0" | 991 | WHITESPACE@[1734; 1735) " " |
977 | R_PAREN@[1736; 1737) ")" | 992 | LITERAL@[1735; 1736) |
978 | R_PAREN@[1737; 1738) ")" | 993 | INT_NUMBER@[1735; 1736) "0" |
979 | SEMI@[1738; 1739) ";" | 994 | R_PAREN@[1736; 1737) ")" |
980 | WHITESPACE@[1739; 1740) "\n" | 995 | R_PAREN@[1737; 1738) ")" |
981 | R_CURLY@[1740; 1741) "}" | 996 | SEMI@[1738; 1739) ";" |
997 | WHITESPACE@[1739; 1740) "\n" | ||
998 | R_CURLY@[1740; 1741) "}" | ||
982 | WHITESPACE@[1741; 1743) "\n\n" | 999 | WHITESPACE@[1741; 1743) "\n\n" |
983 | FN_DEF@[1743; 1904) | 1000 | FN_DEF@[1743; 1904) |
984 | FN_KW@[1743; 1745) "fn" | 1001 | FN_KW@[1743; 1745) "fn" |
@@ -989,140 +1006,145 @@ SOURCE_FILE@[0; 3813) | |||
989 | L_PAREN@[1755; 1756) "(" | 1006 | L_PAREN@[1755; 1756) "(" |
990 | R_PAREN@[1756; 1757) ")" | 1007 | R_PAREN@[1756; 1757) ")" |
991 | WHITESPACE@[1757; 1758) " " | 1008 | WHITESPACE@[1757; 1758) " " |
992 | BLOCK@[1758; 1904) | 1009 | BLOCK_EXPR@[1758; 1904) |
993 | L_CURLY@[1758; 1759) "{" | 1010 | BLOCK@[1758; 1904) |
994 | WHITESPACE@[1759; 1764) "\n " | 1011 | L_CURLY@[1758; 1759) "{" |
995 | EXPR_STMT@[1764; 1785) | 1012 | WHITESPACE@[1759; 1764) "\n " |
996 | LOOP_EXPR@[1764; 1785) | 1013 | EXPR_STMT@[1764; 1785) |
997 | LOOP_KW@[1764; 1768) "loop" | 1014 | LOOP_EXPR@[1764; 1785) |
998 | WHITESPACE@[1768; 1769) " " | 1015 | LOOP_KW@[1764; 1768) "loop" |
999 | BLOCK@[1769; 1785) | 1016 | WHITESPACE@[1768; 1769) " " |
1000 | L_CURLY@[1769; 1770) "{" | 1017 | BLOCK_EXPR@[1769; 1785) |
1001 | WHITESPACE@[1770; 1771) " " | 1018 | BLOCK@[1769; 1785) |
1002 | IF_EXPR@[1771; 1783) | 1019 | L_CURLY@[1769; 1770) "{" |
1003 | IF_KW@[1771; 1773) "if" | 1020 | WHITESPACE@[1770; 1771) " " |
1004 | WHITESPACE@[1773; 1774) " " | 1021 | IF_EXPR@[1771; 1783) |
1005 | CONDITION@[1774; 1779) | 1022 | IF_KW@[1771; 1773) "if" |
1006 | BREAK_EXPR@[1774; 1779) | 1023 | WHITESPACE@[1773; 1774) " " |
1007 | BREAK_KW@[1774; 1779) "break" | 1024 | CONDITION@[1774; 1779) |
1008 | WHITESPACE@[1779; 1780) " " | 1025 | BREAK_EXPR@[1774; 1779) |
1009 | BLOCK@[1780; 1783) | 1026 | BREAK_KW@[1774; 1779) "break" |
1010 | L_CURLY@[1780; 1781) "{" | 1027 | WHITESPACE@[1779; 1780) " " |
1011 | WHITESPACE@[1781; 1782) " " | 1028 | BLOCK_EXPR@[1780; 1783) |
1012 | R_CURLY@[1782; 1783) "}" | 1029 | BLOCK@[1780; 1783) |
1013 | WHITESPACE@[1783; 1784) " " | 1030 | L_CURLY@[1780; 1781) "{" |
1014 | R_CURLY@[1784; 1785) "}" | 1031 | WHITESPACE@[1781; 1782) " " |
1015 | WHITESPACE@[1785; 1790) "\n " | 1032 | R_CURLY@[1782; 1783) "}" |
1016 | LET_STMT@[1790; 1804) | 1033 | WHITESPACE@[1783; 1784) " " |
1017 | LET_KW@[1790; 1793) "let" | 1034 | R_CURLY@[1784; 1785) "}" |
1018 | WHITESPACE@[1793; 1794) " " | 1035 | WHITESPACE@[1785; 1790) "\n " |
1019 | BIND_PAT@[1794; 1799) | 1036 | LET_STMT@[1790; 1804) |
1020 | MUT_KW@[1794; 1797) "mut" | 1037 | LET_KW@[1790; 1793) "let" |
1021 | WHITESPACE@[1797; 1798) " " | 1038 | WHITESPACE@[1793; 1794) " " |
1022 | NAME@[1798; 1799) | 1039 | BIND_PAT@[1794; 1799) |
1023 | IDENT@[1798; 1799) "i" | 1040 | MUT_KW@[1794; 1797) "mut" |
1024 | WHITESPACE@[1799; 1800) " " | 1041 | WHITESPACE@[1797; 1798) " " |
1025 | EQ@[1800; 1801) "=" | 1042 | NAME@[1798; 1799) |
1026 | WHITESPACE@[1801; 1802) " " | 1043 | IDENT@[1798; 1799) "i" |
1027 | LITERAL@[1802; 1803) | 1044 | WHITESPACE@[1799; 1800) " " |
1028 | INT_NUMBER@[1802; 1803) "0" | 1045 | EQ@[1800; 1801) "=" |
1029 | SEMI@[1803; 1804) ";" | 1046 | WHITESPACE@[1801; 1802) " " |
1030 | WHITESPACE@[1804; 1809) "\n " | 1047 | LITERAL@[1802; 1803) |
1031 | LOOP_EXPR@[1809; 1902) | 1048 | INT_NUMBER@[1802; 1803) "0" |
1032 | LOOP_KW@[1809; 1813) "loop" | 1049 | SEMI@[1803; 1804) ";" |
1033 | WHITESPACE@[1813; 1814) " " | 1050 | WHITESPACE@[1804; 1809) "\n " |
1034 | BLOCK@[1814; 1902) | 1051 | LOOP_EXPR@[1809; 1902) |
1035 | L_CURLY@[1814; 1815) "{" | 1052 | LOOP_KW@[1809; 1813) "loop" |
1036 | WHITESPACE@[1815; 1816) " " | 1053 | WHITESPACE@[1813; 1814) " " |
1037 | EXPR_STMT@[1816; 1823) | 1054 | BLOCK_EXPR@[1814; 1902) |
1038 | BIN_EXPR@[1816; 1822) | 1055 | BLOCK@[1814; 1902) |
1039 | PATH_EXPR@[1816; 1817) | 1056 | L_CURLY@[1814; 1815) "{" |
1040 | PATH@[1816; 1817) | 1057 | WHITESPACE@[1815; 1816) " " |
1041 | PATH_SEGMENT@[1816; 1817) | 1058 | EXPR_STMT@[1816; 1823) |
1042 | NAME_REF@[1816; 1817) | 1059 | BIN_EXPR@[1816; 1822) |
1043 | IDENT@[1816; 1817) "i" | 1060 | PATH_EXPR@[1816; 1817) |
1044 | WHITESPACE@[1817; 1818) " " | 1061 | PATH@[1816; 1817) |
1045 | PLUSEQ@[1818; 1820) "+=" | 1062 | PATH_SEGMENT@[1816; 1817) |
1046 | WHITESPACE@[1820; 1821) " " | 1063 | NAME_REF@[1816; 1817) |
1047 | LITERAL@[1821; 1822) | 1064 | IDENT@[1816; 1817) "i" |
1048 | INT_NUMBER@[1821; 1822) "1" | 1065 | WHITESPACE@[1817; 1818) " " |
1049 | SEMI@[1822; 1823) ";" | 1066 | PLUSEQ@[1818; 1820) "+=" |
1050 | WHITESPACE@[1823; 1824) " " | 1067 | WHITESPACE@[1820; 1821) " " |
1051 | EXPR_STMT@[1824; 1887) | 1068 | LITERAL@[1821; 1822) |
1052 | IF_EXPR@[1824; 1887) | 1069 | INT_NUMBER@[1821; 1822) "1" |
1053 | IF_KW@[1824; 1826) "if" | 1070 | SEMI@[1822; 1823) ";" |
1054 | WHITESPACE@[1826; 1827) " " | 1071 | WHITESPACE@[1823; 1824) " " |
1055 | CONDITION@[1827; 1833) | 1072 | EXPR_STMT@[1824; 1887) |
1056 | BIN_EXPR@[1827; 1833) | 1073 | IF_EXPR@[1824; 1887) |
1057 | PATH_EXPR@[1827; 1828) | 1074 | IF_KW@[1824; 1826) "if" |
1058 | PATH@[1827; 1828) | 1075 | WHITESPACE@[1826; 1827) " " |
1059 | PATH_SEGMENT@[1827; 1828) | 1076 | CONDITION@[1827; 1833) |
1060 | NAME_REF@[1827; 1828) | 1077 | BIN_EXPR@[1827; 1833) |
1061 | IDENT@[1827; 1828) "i" | 1078 | PATH_EXPR@[1827; 1828) |
1062 | WHITESPACE@[1828; 1829) " " | 1079 | PATH@[1827; 1828) |
1063 | EQEQ@[1829; 1831) "==" | 1080 | PATH_SEGMENT@[1827; 1828) |
1064 | WHITESPACE@[1831; 1832) " " | 1081 | NAME_REF@[1827; 1828) |
1065 | LITERAL@[1832; 1833) | 1082 | IDENT@[1827; 1828) "i" |
1066 | INT_NUMBER@[1832; 1833) "1" | 1083 | WHITESPACE@[1828; 1829) " " |
1067 | WHITESPACE@[1833; 1834) " " | 1084 | EQEQ@[1829; 1831) "==" |
1068 | BLOCK@[1834; 1887) | 1085 | WHITESPACE@[1831; 1832) " " |
1069 | L_CURLY@[1834; 1835) "{" | 1086 | LITERAL@[1832; 1833) |
1070 | WHITESPACE@[1835; 1836) " " | 1087 | INT_NUMBER@[1832; 1833) "1" |
1071 | MATCH_EXPR@[1836; 1885) | 1088 | WHITESPACE@[1833; 1834) " " |
1072 | MATCH_KW@[1836; 1841) "match" | 1089 | BLOCK_EXPR@[1834; 1887) |
1073 | WHITESPACE@[1841; 1842) " " | 1090 | BLOCK@[1834; 1887) |
1074 | PAREN_EXPR@[1842; 1852) | 1091 | L_CURLY@[1834; 1835) "{" |
1075 | L_PAREN@[1842; 1843) "(" | 1092 | WHITESPACE@[1835; 1836) " " |
1076 | CONTINUE_EXPR@[1843; 1851) | 1093 | MATCH_EXPR@[1836; 1885) |
1077 | CONTINUE_KW@[1843; 1851) "continue" | 1094 | MATCH_KW@[1836; 1841) "match" |
1078 | R_PAREN@[1851; 1852) ")" | 1095 | WHITESPACE@[1841; 1842) " " |
1079 | WHITESPACE@[1852; 1853) " " | 1096 | PAREN_EXPR@[1842; 1852) |
1080 | MATCH_ARM_LIST@[1853; 1885) | 1097 | L_PAREN@[1842; 1843) "(" |
1081 | L_CURLY@[1853; 1854) "{" | 1098 | CONTINUE_EXPR@[1843; 1851) |
1082 | WHITESPACE@[1854; 1855) " " | 1099 | CONTINUE_KW@[1843; 1851) "continue" |
1083 | MATCH_ARM@[1855; 1863) | 1100 | R_PAREN@[1851; 1852) ")" |
1084 | LITERAL_PAT@[1855; 1856) | 1101 | WHITESPACE@[1852; 1853) " " |
1085 | LITERAL@[1855; 1856) | 1102 | MATCH_ARM_LIST@[1853; 1885) |
1086 | INT_NUMBER@[1855; 1856) "1" | 1103 | L_CURLY@[1853; 1854) "{" |
1087 | WHITESPACE@[1856; 1857) " " | 1104 | WHITESPACE@[1854; 1855) " " |
1088 | FAT_ARROW@[1857; 1859) "=>" | 1105 | MATCH_ARM@[1855; 1863) |
1089 | WHITESPACE@[1859; 1860) " " | 1106 | LITERAL_PAT@[1855; 1856) |
1090 | BLOCK_EXPR@[1860; 1863) | 1107 | LITERAL@[1855; 1856) |
1091 | BLOCK@[1860; 1863) | 1108 | INT_NUMBER@[1855; 1856) "1" |
1092 | L_CURLY@[1860; 1861) "{" | 1109 | WHITESPACE@[1856; 1857) " " |
1093 | WHITESPACE@[1861; 1862) " " | 1110 | FAT_ARROW@[1857; 1859) "=>" |
1094 | R_CURLY@[1862; 1863) "}" | 1111 | WHITESPACE@[1859; 1860) " " |
1095 | COMMA@[1863; 1864) "," | 1112 | BLOCK_EXPR@[1860; 1863) |
1096 | WHITESPACE@[1864; 1865) " " | 1113 | BLOCK@[1860; 1863) |
1097 | MATCH_ARM@[1865; 1883) | 1114 | L_CURLY@[1860; 1861) "{" |
1098 | PLACEHOLDER_PAT@[1865; 1866) | 1115 | WHITESPACE@[1861; 1862) " " |
1099 | UNDERSCORE@[1865; 1866) "_" | 1116 | R_CURLY@[1862; 1863) "}" |
1100 | WHITESPACE@[1866; 1867) " " | 1117 | COMMA@[1863; 1864) "," |
1101 | FAT_ARROW@[1867; 1869) "=>" | 1118 | WHITESPACE@[1864; 1865) " " |
1102 | WHITESPACE@[1869; 1870) " " | 1119 | MATCH_ARM@[1865; 1883) |
1103 | MACRO_CALL@[1870; 1883) | 1120 | PLACEHOLDER_PAT@[1865; 1866) |
1104 | PATH@[1870; 1875) | 1121 | UNDERSCORE@[1865; 1866) "_" |
1105 | PATH_SEGMENT@[1870; 1875) | 1122 | WHITESPACE@[1866; 1867) " " |
1106 | NAME_REF@[1870; 1875) | 1123 | FAT_ARROW@[1867; 1869) "=>" |
1107 | IDENT@[1870; 1875) "panic" | 1124 | WHITESPACE@[1869; 1870) " " |
1108 | EXCL@[1875; 1876) "!" | 1125 | MACRO_CALL@[1870; 1883) |
1109 | TOKEN_TREE@[1876; 1883) | 1126 | PATH@[1870; 1875) |
1110 | L_PAREN@[1876; 1877) "(" | 1127 | PATH_SEGMENT@[1870; 1875) |
1111 | STRING@[1877; 1882) "\"wat\"" | 1128 | NAME_REF@[1870; 1875) |
1112 | R_PAREN@[1882; 1883) ")" | 1129 | IDENT@[1870; 1875) "panic" |
1113 | WHITESPACE@[1883; 1884) " " | 1130 | EXCL@[1875; 1876) "!" |
1114 | R_CURLY@[1884; 1885) "}" | 1131 | TOKEN_TREE@[1876; 1883) |
1115 | WHITESPACE@[1885; 1886) " " | 1132 | L_PAREN@[1876; 1877) "(" |
1116 | R_CURLY@[1886; 1887) "}" | 1133 | STRING@[1877; 1882) "\"wat\"" |
1117 | WHITESPACE@[1887; 1894) "\n " | 1134 | R_PAREN@[1882; 1883) ")" |
1118 | EXPR_STMT@[1894; 1900) | 1135 | WHITESPACE@[1883; 1884) " " |
1119 | BREAK_EXPR@[1894; 1899) | 1136 | R_CURLY@[1884; 1885) "}" |
1120 | BREAK_KW@[1894; 1899) "break" | 1137 | WHITESPACE@[1885; 1886) " " |
1121 | SEMI@[1899; 1900) ";" | 1138 | R_CURLY@[1886; 1887) "}" |
1122 | WHITESPACE@[1900; 1901) " " | 1139 | WHITESPACE@[1887; 1894) "\n " |
1123 | R_CURLY@[1901; 1902) "}" | 1140 | EXPR_STMT@[1894; 1900) |
1124 | WHITESPACE@[1902; 1903) "\n" | 1141 | BREAK_EXPR@[1894; 1899) |
1125 | R_CURLY@[1903; 1904) "}" | 1142 | BREAK_KW@[1894; 1899) "break" |
1143 | SEMI@[1899; 1900) ";" | ||
1144 | WHITESPACE@[1900; 1901) " " | ||
1145 | R_CURLY@[1901; 1902) "}" | ||
1146 | WHITESPACE@[1902; 1903) "\n" | ||
1147 | R_CURLY@[1903; 1904) "}" | ||
1126 | WHITESPACE@[1904; 1906) "\n\n" | 1148 | WHITESPACE@[1904; 1906) "\n\n" |
1127 | FN_DEF@[1906; 1960) | 1149 | FN_DEF@[1906; 1960) |
1128 | FN_KW@[1906; 1908) "fn" | 1150 | FN_KW@[1906; 1908) "fn" |
@@ -1133,31 +1155,32 @@ SOURCE_FILE@[0; 3813) | |||
1133 | L_PAREN@[1921; 1922) "(" | 1155 | L_PAREN@[1921; 1922) "(" |
1134 | R_PAREN@[1922; 1923) ")" | 1156 | R_PAREN@[1922; 1923) ")" |
1135 | WHITESPACE@[1923; 1924) " " | 1157 | WHITESPACE@[1923; 1924) " " |
1136 | BLOCK@[1924; 1960) | 1158 | BLOCK_EXPR@[1924; 1960) |
1137 | L_CURLY@[1924; 1925) "{" | 1159 | BLOCK@[1924; 1960) |
1138 | WHITESPACE@[1925; 1926) " " | 1160 | L_CURLY@[1924; 1925) "{" |
1139 | LET_STMT@[1926; 1958) | 1161 | WHITESPACE@[1925; 1926) " " |
1140 | LET_KW@[1926; 1929) "let" | 1162 | LET_STMT@[1926; 1958) |
1141 | WHITESPACE@[1929; 1930) " " | 1163 | LET_KW@[1926; 1929) "let" |
1142 | BIND_PAT@[1930; 1935) | 1164 | WHITESPACE@[1929; 1930) " " |
1143 | NAME@[1930; 1935) | 1165 | BIND_PAT@[1930; 1935) |
1144 | IDENT@[1930; 1935) "_evil" | 1166 | NAME@[1930; 1935) |
1145 | WHITESPACE@[1935; 1936) " " | 1167 | IDENT@[1930; 1935) "_evil" |
1146 | EQ@[1936; 1937) "=" | 1168 | WHITESPACE@[1935; 1936) " " |
1147 | WHITESPACE@[1937; 1938) " " | 1169 | EQ@[1936; 1937) "=" |
1148 | MACRO_CALL@[1938; 1957) | 1170 | WHITESPACE@[1937; 1938) " " |
1149 | PATH@[1938; 1945) | 1171 | MACRO_CALL@[1938; 1957) |
1150 | PATH_SEGMENT@[1938; 1945) | 1172 | PATH@[1938; 1945) |
1151 | NAME_REF@[1938; 1945) | 1173 | PATH_SEGMENT@[1938; 1945) |
1152 | IDENT@[1938; 1945) "println" | 1174 | NAME_REF@[1938; 1945) |
1153 | EXCL@[1945; 1946) "!" | 1175 | IDENT@[1938; 1945) "println" |
1154 | TOKEN_TREE@[1946; 1957) | 1176 | EXCL@[1945; 1946) "!" |
1155 | L_PAREN@[1946; 1947) "(" | 1177 | TOKEN_TREE@[1946; 1957) |
1156 | STRING@[1947; 1956) "\"lincoln\"" | 1178 | L_PAREN@[1946; 1947) "(" |
1157 | R_PAREN@[1956; 1957) ")" | 1179 | STRING@[1947; 1956) "\"lincoln\"" |
1158 | SEMI@[1957; 1958) ";" | 1180 | R_PAREN@[1956; 1957) ")" |
1159 | WHITESPACE@[1958; 1959) " " | 1181 | SEMI@[1957; 1958) ";" |
1160 | R_CURLY@[1959; 1960) "}" | 1182 | WHITESPACE@[1958; 1959) " " |
1183 | R_CURLY@[1959; 1960) "}" | ||
1161 | WHITESPACE@[1960; 1962) "\n\n" | 1184 | WHITESPACE@[1960; 1962) "\n\n" |
1162 | FN_DEF@[1962; 2198) | 1185 | FN_DEF@[1962; 2198) |
1163 | FN_KW@[1962; 1964) "fn" | 1186 | FN_KW@[1962; 1964) "fn" |
@@ -1168,114 +1191,115 @@ SOURCE_FILE@[0; 3813) | |||
1168 | L_PAREN@[1969; 1970) "(" | 1191 | L_PAREN@[1969; 1970) "(" |
1169 | R_PAREN@[1970; 1971) ")" | 1192 | R_PAREN@[1970; 1971) ")" |
1170 | WHITESPACE@[1971; 1972) " " | 1193 | WHITESPACE@[1971; 1972) " " |
1171 | BLOCK@[1972; 2198) | 1194 | BLOCK_EXPR@[1972; 2198) |
1172 | L_CURLY@[1972; 1973) "{" | 1195 | BLOCK@[1972; 2198) |
1173 | WHITESPACE@[1973; 1978) "\n " | 1196 | L_CURLY@[1972; 1973) "{" |
1174 | EXPR_STMT@[1978; 2196) | 1197 | WHITESPACE@[1973; 1978) "\n " |
1175 | MACRO_CALL@[1978; 2195) | 1198 | EXPR_STMT@[1978; 2196) |
1176 | PATH@[1978; 1987) | 1199 | MACRO_CALL@[1978; 2195) |
1177 | PATH_SEGMENT@[1978; 1987) | 1200 | PATH@[1978; 1987) |
1178 | NAME_REF@[1978; 1987) | 1201 | PATH_SEGMENT@[1978; 1987) |
1179 | IDENT@[1978; 1987) "assert_eq" | 1202 | NAME_REF@[1978; 1987) |
1180 | EXCL@[1987; 1988) "!" | 1203 | IDENT@[1978; 1987) "assert_eq" |
1181 | TOKEN_TREE@[1988; 2195) | 1204 | EXCL@[1987; 1988) "!" |
1182 | L_PAREN@[1988; 1989) "(" | 1205 | TOKEN_TREE@[1988; 2195) |
1183 | IDENT@[1989; 1995) "String" | 1206 | L_PAREN@[1988; 1989) "(" |
1184 | COLON@[1995; 1996) ":" | 1207 | IDENT@[1989; 1995) "String" |
1185 | COLON@[1996; 1997) ":" | 1208 | COLON@[1995; 1996) ":" |
1186 | IDENT@[1997; 2001) "from" | 1209 | COLON@[1996; 1997) ":" |
1187 | TOKEN_TREE@[2001; 2055) | 1210 | IDENT@[1997; 2001) "from" |
1188 | L_PAREN@[2001; 2002) "(" | 1211 | TOKEN_TREE@[2001; 2055) |
1189 | STRING@[2002; 2054) "\".................... ..." | 1212 | L_PAREN@[2001; 2002) "(" |
1190 | R_PAREN@[2054; 2055) ")" | 1213 | STRING@[2002; 2054) "\".................... ..." |
1191 | COMMA@[2055; 2056) "," | 1214 | R_PAREN@[2054; 2055) ")" |
1192 | WHITESPACE@[2056; 2072) "\n " | 1215 | COMMA@[2055; 2056) "," |
1193 | IDENT@[2072; 2078) "format" | 1216 | WHITESPACE@[2056; 2072) "\n " |
1194 | EXCL@[2078; 2079) "!" | 1217 | IDENT@[2072; 2078) "format" |
1195 | TOKEN_TREE@[2079; 2194) | 1218 | EXCL@[2078; 2079) "!" |
1196 | L_PAREN@[2079; 2080) "(" | 1219 | TOKEN_TREE@[2079; 2194) |
1197 | STRING@[2080; 2086) "\"{:?}\"" | 1220 | L_PAREN@[2079; 2080) "(" |
1198 | COMMA@[2086; 2087) "," | 1221 | STRING@[2080; 2086) "\"{:?}\"" |
1199 | WHITESPACE@[2087; 2088) " " | 1222 | COMMA@[2086; 2087) "," |
1200 | DOT@[2088; 2089) "." | 1223 | WHITESPACE@[2087; 2088) " " |
1201 | DOT@[2089; 2090) "." | 1224 | DOT@[2088; 2089) "." |
1202 | WHITESPACE@[2090; 2091) " " | 1225 | DOT@[2089; 2090) "." |
1203 | DOT@[2091; 2092) "." | 1226 | WHITESPACE@[2090; 2091) " " |
1204 | DOT@[2092; 2093) "." | 1227 | DOT@[2091; 2092) "." |
1205 | WHITESPACE@[2093; 2094) " " | 1228 | DOT@[2092; 2093) "." |
1206 | DOT@[2094; 2095) "." | 1229 | WHITESPACE@[2093; 2094) " " |
1207 | DOT@[2095; 2096) "." | 1230 | DOT@[2094; 2095) "." |
1208 | WHITESPACE@[2096; 2097) " " | 1231 | DOT@[2095; 2096) "." |
1209 | DOT@[2097; 2098) "." | 1232 | WHITESPACE@[2096; 2097) " " |
1210 | DOT@[2098; 2099) "." | 1233 | DOT@[2097; 2098) "." |
1211 | WHITESPACE@[2099; 2100) " " | 1234 | DOT@[2098; 2099) "." |
1212 | DOT@[2100; 2101) "." | 1235 | WHITESPACE@[2099; 2100) " " |
1213 | DOT@[2101; 2102) "." | 1236 | DOT@[2100; 2101) "." |
1214 | WHITESPACE@[2102; 2103) " " | 1237 | DOT@[2101; 2102) "." |
1215 | DOT@[2103; 2104) "." | 1238 | WHITESPACE@[2102; 2103) " " |
1216 | DOT@[2104; 2105) "." | 1239 | DOT@[2103; 2104) "." |
1217 | WHITESPACE@[2105; 2106) " " | 1240 | DOT@[2104; 2105) "." |
1218 | DOT@[2106; 2107) "." | 1241 | WHITESPACE@[2105; 2106) " " |
1219 | DOT@[2107; 2108) "." | 1242 | DOT@[2106; 2107) "." |
1220 | WHITESPACE@[2108; 2109) " " | 1243 | DOT@[2107; 2108) "." |
1221 | DOT@[2109; 2110) "." | 1244 | WHITESPACE@[2108; 2109) " " |
1222 | DOT@[2110; 2111) "." | 1245 | DOT@[2109; 2110) "." |
1223 | WHITESPACE@[2111; 2112) " " | 1246 | DOT@[2110; 2111) "." |
1224 | DOT@[2112; 2113) "." | 1247 | WHITESPACE@[2111; 2112) " " |
1225 | DOT@[2113; 2114) "." | 1248 | DOT@[2112; 2113) "." |
1226 | WHITESPACE@[2114; 2115) " " | 1249 | DOT@[2113; 2114) "." |
1227 | DOT@[2115; 2116) "." | 1250 | WHITESPACE@[2114; 2115) " " |
1228 | DOT@[2116; 2117) "." | 1251 | DOT@[2115; 2116) "." |
1229 | WHITESPACE@[2117; 2118) " " | 1252 | DOT@[2116; 2117) "." |
1230 | DOT@[2118; 2119) "." | 1253 | WHITESPACE@[2117; 2118) " " |
1231 | DOT@[2119; 2120) "." | 1254 | DOT@[2118; 2119) "." |
1232 | WHITESPACE@[2120; 2121) " " | 1255 | DOT@[2119; 2120) "." |
1233 | DOT@[2121; 2122) "." | 1256 | WHITESPACE@[2120; 2121) " " |
1234 | DOT@[2122; 2123) "." | 1257 | DOT@[2121; 2122) "." |
1235 | WHITESPACE@[2123; 2124) " " | 1258 | DOT@[2122; 2123) "." |
1236 | DOT@[2124; 2125) "." | 1259 | WHITESPACE@[2123; 2124) " " |
1237 | DOT@[2125; 2126) "." | 1260 | DOT@[2124; 2125) "." |
1238 | WHITESPACE@[2126; 2158) "\n ..." | 1261 | DOT@[2125; 2126) "." |
1239 | DOT@[2158; 2159) "." | 1262 | WHITESPACE@[2126; 2158) "\n ..." |
1240 | DOT@[2159; 2160) "." | 1263 | DOT@[2158; 2159) "." |
1241 | WHITESPACE@[2160; 2161) " " | 1264 | DOT@[2159; 2160) "." |
1242 | DOT@[2161; 2162) "." | 1265 | WHITESPACE@[2160; 2161) " " |
1243 | DOT@[2162; 2163) "." | 1266 | DOT@[2161; 2162) "." |
1244 | WHITESPACE@[2163; 2164) " " | 1267 | DOT@[2162; 2163) "." |
1245 | DOT@[2164; 2165) "." | 1268 | WHITESPACE@[2163; 2164) " " |
1246 | DOT@[2165; 2166) "." | 1269 | DOT@[2164; 2165) "." |
1247 | WHITESPACE@[2166; 2167) " " | 1270 | DOT@[2165; 2166) "." |
1248 | DOT@[2167; 2168) "." | 1271 | WHITESPACE@[2166; 2167) " " |
1249 | DOT@[2168; 2169) "." | 1272 | DOT@[2167; 2168) "." |
1250 | WHITESPACE@[2169; 2170) " " | 1273 | DOT@[2168; 2169) "." |
1251 | DOT@[2170; 2171) "." | 1274 | WHITESPACE@[2169; 2170) " " |
1252 | DOT@[2171; 2172) "." | 1275 | DOT@[2170; 2171) "." |
1253 | WHITESPACE@[2172; 2173) " " | 1276 | DOT@[2171; 2172) "." |
1254 | DOT@[2173; 2174) "." | 1277 | WHITESPACE@[2172; 2173) " " |
1255 | DOT@[2174; 2175) "." | 1278 | DOT@[2173; 2174) "." |
1256 | WHITESPACE@[2175; 2176) " " | 1279 | DOT@[2174; 2175) "." |
1257 | DOT@[2176; 2177) "." | 1280 | WHITESPACE@[2175; 2176) " " |
1258 | DOT@[2177; 2178) "." | 1281 | DOT@[2176; 2177) "." |
1259 | WHITESPACE@[2178; 2179) " " | 1282 | DOT@[2177; 2178) "." |
1260 | DOT@[2179; 2180) "." | 1283 | WHITESPACE@[2178; 2179) " " |
1261 | DOT@[2180; 2181) "." | 1284 | DOT@[2179; 2180) "." |
1262 | WHITESPACE@[2181; 2182) " " | 1285 | DOT@[2180; 2181) "." |
1263 | DOT@[2182; 2183) "." | 1286 | WHITESPACE@[2181; 2182) " " |
1264 | DOT@[2183; 2184) "." | 1287 | DOT@[2182; 2183) "." |
1265 | WHITESPACE@[2184; 2185) " " | 1288 | DOT@[2183; 2184) "." |
1266 | DOT@[2185; 2186) "." | 1289 | WHITESPACE@[2184; 2185) " " |
1267 | DOT@[2186; 2187) "." | 1290 | DOT@[2185; 2186) "." |
1268 | WHITESPACE@[2187; 2188) " " | 1291 | DOT@[2186; 2187) "." |
1269 | DOT@[2188; 2189) "." | 1292 | WHITESPACE@[2187; 2188) " " |
1270 | DOT@[2189; 2190) "." | 1293 | DOT@[2188; 2189) "." |
1271 | WHITESPACE@[2190; 2191) " " | 1294 | DOT@[2189; 2190) "." |
1272 | DOT@[2191; 2192) "." | 1295 | WHITESPACE@[2190; 2191) " " |
1273 | DOT@[2192; 2193) "." | 1296 | DOT@[2191; 2192) "." |
1274 | R_PAREN@[2193; 2194) ")" | 1297 | DOT@[2192; 2193) "." |
1275 | R_PAREN@[2194; 2195) ")" | 1298 | R_PAREN@[2193; 2194) ")" |
1276 | SEMI@[2195; 2196) ";" | 1299 | R_PAREN@[2194; 2195) ")" |
1277 | WHITESPACE@[2196; 2197) "\n" | 1300 | SEMI@[2195; 2196) ";" |
1278 | R_CURLY@[2197; 2198) "}" | 1301 | WHITESPACE@[2196; 2197) "\n" |
1302 | R_CURLY@[2197; 2198) "}" | ||
1279 | WHITESPACE@[2198; 2200) "\n\n" | 1303 | WHITESPACE@[2198; 2200) "\n\n" |
1280 | FN_DEF@[2200; 2693) | 1304 | FN_DEF@[2200; 2693) |
1281 | FN_KW@[2200; 2202) "fn" | 1305 | FN_KW@[2200; 2202) "fn" |
@@ -1297,169 +1321,171 @@ SOURCE_FILE@[0; 3813) | |||
1297 | IDENT@[2210; 2212) "u8" | 1321 | IDENT@[2210; 2212) "u8" |
1298 | R_PAREN@[2212; 2213) ")" | 1322 | R_PAREN@[2212; 2213) ")" |
1299 | WHITESPACE@[2213; 2214) " " | 1323 | WHITESPACE@[2213; 2214) " " |
1300 | BLOCK@[2214; 2693) | 1324 | BLOCK_EXPR@[2214; 2693) |
1301 | L_CURLY@[2214; 2215) "{" | 1325 | BLOCK@[2214; 2693) |
1302 | WHITESPACE@[2215; 2220) "\n " | 1326 | L_CURLY@[2214; 2215) "{" |
1303 | IF_EXPR@[2220; 2691) | 1327 | WHITESPACE@[2215; 2220) "\n " |
1304 | IF_KW@[2220; 2222) "if" | 1328 | IF_EXPR@[2220; 2691) |
1305 | WHITESPACE@[2222; 2223) " " | 1329 | IF_KW@[2220; 2222) "if" |
1306 | CONDITION@[2223; 2232) | 1330 | WHITESPACE@[2222; 2223) " " |
1307 | BIN_EXPR@[2223; 2232) | 1331 | CONDITION@[2223; 2232) |
1308 | PATH_EXPR@[2223; 2225) | 1332 | BIN_EXPR@[2223; 2232) |
1309 | PATH@[2223; 2225) | 1333 | PATH_EXPR@[2223; 2225) |
1310 | PATH_SEGMENT@[2223; 2225) | 1334 | PATH@[2223; 2225) |
1311 | NAME_REF@[2223; 2225) | 1335 | PATH_SEGMENT@[2223; 2225) |
1312 | IDENT@[2223; 2225) "u8" | 1336 | NAME_REF@[2223; 2225) |
1313 | WHITESPACE@[2225; 2226) " " | 1337 | IDENT@[2223; 2225) "u8" |
1314 | NEQ@[2226; 2228) "!=" | 1338 | WHITESPACE@[2225; 2226) " " |
1315 | WHITESPACE@[2228; 2229) " " | 1339 | NEQ@[2226; 2228) "!=" |
1316 | LITERAL@[2229; 2232) | 1340 | WHITESPACE@[2228; 2229) " " |
1317 | INT_NUMBER@[2229; 2232) "0u8" | 1341 | LITERAL@[2229; 2232) |
1318 | WHITESPACE@[2232; 2233) " " | 1342 | INT_NUMBER@[2229; 2232) "0u8" |
1319 | BLOCK@[2233; 2691) | 1343 | WHITESPACE@[2232; 2233) " " |
1320 | L_CURLY@[2233; 2234) "{" | 1344 | BLOCK_EXPR@[2233; 2691) |
1321 | WHITESPACE@[2234; 2243) "\n " | 1345 | BLOCK@[2233; 2691) |
1322 | EXPR_STMT@[2243; 2685) | 1346 | L_CURLY@[2233; 2234) "{" |
1323 | MACRO_CALL@[2243; 2684) | 1347 | WHITESPACE@[2234; 2243) "\n " |
1324 | PATH@[2243; 2252) | 1348 | EXPR_STMT@[2243; 2685) |
1325 | PATH_SEGMENT@[2243; 2252) | 1349 | MACRO_CALL@[2243; 2684) |
1326 | NAME_REF@[2243; 2252) | 1350 | PATH@[2243; 2252) |
1327 | IDENT@[2243; 2252) "assert_eq" | 1351 | PATH_SEGMENT@[2243; 2252) |
1328 | EXCL@[2252; 2253) "!" | 1352 | NAME_REF@[2243; 2252) |
1329 | TOKEN_TREE@[2253; 2684) | 1353 | IDENT@[2243; 2252) "assert_eq" |
1330 | L_PAREN@[2253; 2254) "(" | 1354 | EXCL@[2252; 2253) "!" |
1331 | INT_NUMBER@[2254; 2257) "8u8" | 1355 | TOKEN_TREE@[2253; 2684) |
1332 | COMMA@[2257; 2258) "," | 1356 | L_PAREN@[2253; 2254) "(" |
1333 | WHITESPACE@[2258; 2259) " " | 1357 | INT_NUMBER@[2254; 2257) "8u8" |
1334 | TOKEN_TREE@[2259; 2683) | 1358 | COMMA@[2257; 2258) "," |
1335 | L_CURLY@[2259; 2260) "{" | 1359 | WHITESPACE@[2258; 2259) " " |
1336 | WHITESPACE@[2260; 2273) "\n " | 1360 | TOKEN_TREE@[2259; 2683) |
1337 | IDENT@[2273; 2284) "macro_rules" | 1361 | L_CURLY@[2259; 2260) "{" |
1338 | EXCL@[2284; 2285) "!" | 1362 | WHITESPACE@[2260; 2273) "\n " |
1339 | WHITESPACE@[2285; 2286) " " | 1363 | IDENT@[2273; 2284) "macro_rules" |
1340 | IDENT@[2286; 2288) "u8" | 1364 | EXCL@[2284; 2285) "!" |
1341 | WHITESPACE@[2288; 2289) " " | 1365 | WHITESPACE@[2285; 2286) " " |
1342 | TOKEN_TREE@[2289; 2567) | 1366 | IDENT@[2286; 2288) "u8" |
1343 | L_CURLY@[2289; 2290) "{" | 1367 | WHITESPACE@[2288; 2289) " " |
1344 | WHITESPACE@[2290; 2307) "\n " | 1368 | TOKEN_TREE@[2289; 2567) |
1345 | TOKEN_TREE@[2307; 2311) | 1369 | L_CURLY@[2289; 2290) "{" |
1346 | L_PAREN@[2307; 2308) "(" | 1370 | WHITESPACE@[2290; 2307) "\n " |
1347 | IDENT@[2308; 2310) "u8" | 1371 | TOKEN_TREE@[2307; 2311) |
1348 | R_PAREN@[2310; 2311) ")" | 1372 | L_PAREN@[2307; 2308) "(" |
1349 | WHITESPACE@[2311; 2312) " " | 1373 | IDENT@[2308; 2310) "u8" |
1350 | EQ@[2312; 2313) "=" | 1374 | R_PAREN@[2310; 2311) ")" |
1351 | R_ANGLE@[2313; 2314) ">" | 1375 | WHITESPACE@[2311; 2312) " " |
1352 | WHITESPACE@[2314; 2315) " " | 1376 | EQ@[2312; 2313) "=" |
1353 | TOKEN_TREE@[2315; 2552) | 1377 | R_ANGLE@[2313; 2314) ">" |
1354 | L_CURLY@[2315; 2316) "{" | 1378 | WHITESPACE@[2314; 2315) " " |
1355 | WHITESPACE@[2316; 2337) "\n " | 1379 | TOKEN_TREE@[2315; 2552) |
1356 | MOD_KW@[2337; 2340) "mod" | 1380 | L_CURLY@[2315; 2316) "{" |
1357 | WHITESPACE@[2340; 2341) " " | 1381 | WHITESPACE@[2316; 2337) "\n " |
1358 | IDENT@[2341; 2343) "u8" | 1382 | MOD_KW@[2337; 2340) "mod" |
1359 | WHITESPACE@[2343; 2344) " " | 1383 | WHITESPACE@[2340; 2341) " " |
1360 | TOKEN_TREE@[2344; 2534) | 1384 | IDENT@[2341; 2343) "u8" |
1361 | L_CURLY@[2344; 2345) "{" | 1385 | WHITESPACE@[2343; 2344) " " |
1362 | WHITESPACE@[2345; 2370) "\n ..." | 1386 | TOKEN_TREE@[2344; 2534) |
1363 | PUB_KW@[2370; 2373) "pub" | 1387 | L_CURLY@[2344; 2345) "{" |
1364 | WHITESPACE@[2373; 2374) " " | 1388 | WHITESPACE@[2345; 2370) "\n ..." |
1365 | FN_KW@[2374; 2376) "fn" | 1389 | PUB_KW@[2370; 2373) "pub" |
1366 | WHITESPACE@[2376; 2377) " " | 1390 | WHITESPACE@[2373; 2374) " " |
1367 | IDENT@[2377; 2379) "u8" | 1391 | FN_KW@[2374; 2376) "fn" |
1368 | L_ANGLE@[2379; 2380) "<" | 1392 | WHITESPACE@[2376; 2377) " " |
1369 | LIFETIME@[2380; 2383) "\'u8" | 1393 | IDENT@[2377; 2379) "u8" |
1370 | COLON@[2383; 2384) ":" | 1394 | L_ANGLE@[2379; 2380) "<" |
1371 | WHITESPACE@[2384; 2385) " " | 1395 | LIFETIME@[2380; 2383) "\'u8" |
1372 | LIFETIME@[2385; 2388) "\'u8" | 1396 | COLON@[2383; 2384) ":" |
1373 | WHITESPACE@[2388; 2389) " " | 1397 | WHITESPACE@[2384; 2385) " " |
1374 | PLUS@[2389; 2390) "+" | 1398 | LIFETIME@[2385; 2388) "\'u8" |
1375 | WHITESPACE@[2390; 2391) " " | 1399 | WHITESPACE@[2388; 2389) " " |
1376 | LIFETIME@[2391; 2394) "\'u8" | 1400 | PLUS@[2389; 2390) "+" |
1377 | R_ANGLE@[2394; 2395) ">" | 1401 | WHITESPACE@[2390; 2391) " " |
1378 | TOKEN_TREE@[2395; 2408) | 1402 | LIFETIME@[2391; 2394) "\'u8" |
1379 | L_PAREN@[2395; 2396) "(" | 1403 | R_ANGLE@[2394; 2395) ">" |
1380 | IDENT@[2396; 2398) "u8" | 1404 | TOKEN_TREE@[2395; 2408) |
1381 | COLON@[2398; 2399) ":" | 1405 | L_PAREN@[2395; 2396) "(" |
1382 | WHITESPACE@[2399; 2400) " " | 1406 | IDENT@[2396; 2398) "u8" |
1383 | AMP@[2400; 2401) "&" | 1407 | COLON@[2398; 2399) ":" |
1384 | LIFETIME@[2401; 2404) "\'u8" | 1408 | WHITESPACE@[2399; 2400) " " |
1385 | WHITESPACE@[2404; 2405) " " | 1409 | AMP@[2400; 2401) "&" |
1386 | IDENT@[2405; 2407) "u8" | 1410 | LIFETIME@[2401; 2404) "\'u8" |
1387 | R_PAREN@[2407; 2408) ")" | 1411 | WHITESPACE@[2404; 2405) " " |
1388 | WHITESPACE@[2408; 2409) " " | 1412 | IDENT@[2405; 2407) "u8" |
1389 | MINUS@[2409; 2410) "-" | 1413 | R_PAREN@[2407; 2408) ")" |
1390 | R_ANGLE@[2410; 2411) ">" | 1414 | WHITESPACE@[2408; 2409) " " |
1391 | WHITESPACE@[2411; 2412) " " | 1415 | MINUS@[2409; 2410) "-" |
1392 | AMP@[2412; 2413) "&" | 1416 | R_ANGLE@[2410; 2411) ">" |
1393 | LIFETIME@[2413; 2416) "\'u8" | 1417 | WHITESPACE@[2411; 2412) " " |
1394 | WHITESPACE@[2416; 2417) " " | 1418 | AMP@[2412; 2413) "&" |
1395 | IDENT@[2417; 2419) "u8" | 1419 | LIFETIME@[2413; 2416) "\'u8" |
1396 | WHITESPACE@[2419; 2420) " " | 1420 | WHITESPACE@[2416; 2417) " " |
1397 | TOKEN_TREE@[2420; 2512) | 1421 | IDENT@[2417; 2419) "u8" |
1398 | L_CURLY@[2420; 2421) "{" | 1422 | WHITESPACE@[2419; 2420) " " |
1399 | WHITESPACE@[2421; 2450) "\n ..." | 1423 | TOKEN_TREE@[2420; 2512) |
1400 | STRING@[2450; 2454) "\"u8\"" | 1424 | L_CURLY@[2420; 2421) "{" |
1401 | SEMI@[2454; 2455) ";" | 1425 | WHITESPACE@[2421; 2450) "\n ..." |
1402 | WHITESPACE@[2455; 2484) "\n ..." | 1426 | STRING@[2450; 2454) "\"u8\"" |
1403 | IDENT@[2484; 2486) "u8" | 1427 | SEMI@[2454; 2455) ";" |
1404 | WHITESPACE@[2486; 2511) "\n ..." | 1428 | WHITESPACE@[2455; 2484) "\n ..." |
1405 | R_CURLY@[2511; 2512) "}" | 1429 | IDENT@[2484; 2486) "u8" |
1406 | WHITESPACE@[2512; 2533) "\n " | 1430 | WHITESPACE@[2486; 2511) "\n ..." |
1407 | R_CURLY@[2533; 2534) "}" | 1431 | R_CURLY@[2511; 2512) "}" |
1408 | WHITESPACE@[2534; 2551) "\n " | 1432 | WHITESPACE@[2512; 2533) "\n " |
1409 | R_CURLY@[2551; 2552) "}" | 1433 | R_CURLY@[2533; 2534) "}" |
1410 | SEMI@[2552; 2553) ";" | 1434 | WHITESPACE@[2534; 2551) "\n " |
1411 | WHITESPACE@[2553; 2566) "\n " | 1435 | R_CURLY@[2551; 2552) "}" |
1412 | R_CURLY@[2566; 2567) "}" | 1436 | SEMI@[2552; 2553) ";" |
1413 | WHITESPACE@[2567; 2581) "\n\n " | 1437 | WHITESPACE@[2553; 2566) "\n " |
1414 | IDENT@[2581; 2583) "u8" | 1438 | R_CURLY@[2566; 2567) "}" |
1415 | EXCL@[2583; 2584) "!" | 1439 | WHITESPACE@[2567; 2581) "\n\n " |
1416 | TOKEN_TREE@[2584; 2588) | 1440 | IDENT@[2581; 2583) "u8" |
1417 | L_PAREN@[2584; 2585) "(" | 1441 | EXCL@[2583; 2584) "!" |
1418 | IDENT@[2585; 2587) "u8" | 1442 | TOKEN_TREE@[2584; 2588) |
1419 | R_PAREN@[2587; 2588) ")" | 1443 | L_PAREN@[2584; 2585) "(" |
1420 | SEMI@[2588; 2589) ";" | 1444 | IDENT@[2585; 2587) "u8" |
1421 | WHITESPACE@[2589; 2602) "\n " | 1445 | R_PAREN@[2587; 2588) ")" |
1422 | LET_KW@[2602; 2605) "let" | 1446 | SEMI@[2588; 2589) ";" |
1423 | WHITESPACE@[2605; 2606) " " | 1447 | WHITESPACE@[2589; 2602) "\n " |
1424 | AMP@[2606; 2607) "&" | 1448 | LET_KW@[2602; 2605) "let" |
1425 | IDENT@[2607; 2609) "u8" | 1449 | WHITESPACE@[2605; 2606) " " |
1426 | COLON@[2609; 2610) ":" | 1450 | AMP@[2606; 2607) "&" |
1427 | WHITESPACE@[2610; 2611) " " | 1451 | IDENT@[2607; 2609) "u8" |
1428 | AMP@[2611; 2612) "&" | 1452 | COLON@[2609; 2610) ":" |
1429 | IDENT@[2612; 2614) "u8" | 1453 | WHITESPACE@[2610; 2611) " " |
1430 | WHITESPACE@[2614; 2615) " " | 1454 | AMP@[2611; 2612) "&" |
1431 | EQ@[2615; 2616) "=" | 1455 | IDENT@[2612; 2614) "u8" |
1432 | WHITESPACE@[2616; 2617) " " | 1456 | WHITESPACE@[2614; 2615) " " |
1433 | IDENT@[2617; 2619) "u8" | 1457 | EQ@[2615; 2616) "=" |
1434 | COLON@[2619; 2620) ":" | 1458 | WHITESPACE@[2616; 2617) " " |
1435 | COLON@[2620; 2621) ":" | 1459 | IDENT@[2617; 2619) "u8" |
1436 | IDENT@[2621; 2623) "u8" | 1460 | COLON@[2619; 2620) ":" |
1437 | TOKEN_TREE@[2623; 2629) | 1461 | COLON@[2620; 2621) ":" |
1438 | L_PAREN@[2623; 2624) "(" | 1462 | IDENT@[2621; 2623) "u8" |
1439 | AMP@[2624; 2625) "&" | 1463 | TOKEN_TREE@[2623; 2629) |
1440 | INT_NUMBER@[2625; 2628) "8u8" | 1464 | L_PAREN@[2623; 2624) "(" |
1441 | R_PAREN@[2628; 2629) ")" | 1465 | AMP@[2624; 2625) "&" |
1442 | SEMI@[2629; 2630) ";" | 1466 | INT_NUMBER@[2625; 2628) "8u8" |
1443 | WHITESPACE@[2630; 2643) "\n " | 1467 | R_PAREN@[2628; 2629) ")" |
1444 | CRATE_KW@[2643; 2648) "crate" | 1468 | SEMI@[2629; 2630) ";" |
1445 | COLON@[2648; 2649) ":" | 1469 | WHITESPACE@[2630; 2643) "\n " |
1446 | COLON@[2649; 2650) ":" | 1470 | CRATE_KW@[2643; 2648) "crate" |
1447 | IDENT@[2650; 2652) "u8" | 1471 | COLON@[2648; 2649) ":" |
1448 | TOKEN_TREE@[2652; 2657) | 1472 | COLON@[2649; 2650) ":" |
1449 | L_PAREN@[2652; 2653) "(" | 1473 | IDENT@[2650; 2652) "u8" |
1450 | INT_NUMBER@[2653; 2656) "0u8" | 1474 | TOKEN_TREE@[2652; 2657) |
1451 | R_PAREN@[2656; 2657) ")" | 1475 | L_PAREN@[2652; 2653) "(" |
1452 | SEMI@[2657; 2658) ";" | 1476 | INT_NUMBER@[2653; 2656) "0u8" |
1453 | WHITESPACE@[2658; 2671) "\n " | 1477 | R_PAREN@[2656; 2657) ")" |
1454 | IDENT@[2671; 2673) "u8" | 1478 | SEMI@[2657; 2658) ";" |
1455 | WHITESPACE@[2673; 2682) "\n " | 1479 | WHITESPACE@[2658; 2671) "\n " |
1456 | R_CURLY@[2682; 2683) "}" | 1480 | IDENT@[2671; 2673) "u8" |
1457 | R_PAREN@[2683; 2684) ")" | 1481 | WHITESPACE@[2673; 2682) "\n " |
1458 | SEMI@[2684; 2685) ";" | 1482 | R_CURLY@[2682; 2683) "}" |
1459 | WHITESPACE@[2685; 2690) "\n " | 1483 | R_PAREN@[2683; 2684) ")" |
1460 | R_CURLY@[2690; 2691) "}" | 1484 | SEMI@[2684; 2685) ";" |
1461 | WHITESPACE@[2691; 2692) "\n" | 1485 | WHITESPACE@[2685; 2690) "\n " |
1462 | R_CURLY@[2692; 2693) "}" | 1486 | R_CURLY@[2690; 2691) "}" |
1487 | WHITESPACE@[2691; 2692) "\n" | ||
1488 | R_CURLY@[2692; 2693) "}" | ||
1463 | WHITESPACE@[2693; 2695) "\n\n" | 1489 | WHITESPACE@[2693; 2695) "\n\n" |
1464 | FN_DEF@[2695; 2832) | 1490 | FN_DEF@[2695; 2832) |
1465 | FN_KW@[2695; 2697) "fn" | 1491 | FN_KW@[2695; 2697) "fn" |
@@ -1470,76 +1496,77 @@ SOURCE_FILE@[0; 3813) | |||
1470 | L_PAREN@[2703; 2704) "(" | 1496 | L_PAREN@[2703; 2704) "(" |
1471 | R_PAREN@[2704; 2705) ")" | 1497 | R_PAREN@[2704; 2705) ")" |
1472 | WHITESPACE@[2705; 2706) " " | 1498 | WHITESPACE@[2705; 2706) " " |
1473 | BLOCK@[2706; 2832) | 1499 | BLOCK_EXPR@[2706; 2832) |
1474 | L_CURLY@[2706; 2707) "{" | 1500 | BLOCK@[2706; 2832) |
1475 | WHITESPACE@[2707; 2712) "\n " | 1501 | L_CURLY@[2706; 2707) "{" |
1476 | EXPR_STMT@[2712; 2830) | 1502 | WHITESPACE@[2707; 2712) "\n " |
1477 | MACRO_CALL@[2712; 2829) | 1503 | EXPR_STMT@[2712; 2830) |
1478 | PATH@[2712; 2721) | 1504 | MACRO_CALL@[2712; 2829) |
1479 | PATH_SEGMENT@[2712; 2721) | 1505 | PATH@[2712; 2721) |
1480 | NAME_REF@[2712; 2721) | 1506 | PATH_SEGMENT@[2712; 2721) |
1481 | IDENT@[2712; 2721) "assert_eq" | 1507 | NAME_REF@[2712; 2721) |
1482 | EXCL@[2721; 2722) "!" | 1508 | IDENT@[2712; 2721) "assert_eq" |
1483 | TOKEN_TREE@[2722; 2829) | 1509 | EXCL@[2721; 2722) "!" |
1484 | L_PAREN@[2722; 2723) "(" | 1510 | TOKEN_TREE@[2722; 2829) |
1485 | IDENT@[2723; 2729) "String" | 1511 | L_PAREN@[2722; 2723) "(" |
1486 | COLON@[2729; 2730) ":" | 1512 | IDENT@[2723; 2729) "String" |
1487 | COLON@[2730; 2731) ":" | 1513 | COLON@[2729; 2730) ":" |
1488 | IDENT@[2731; 2735) "from" | 1514 | COLON@[2730; 2731) ":" |
1489 | TOKEN_TREE@[2735; 2742) | 1515 | IDENT@[2731; 2735) "from" |
1490 | L_PAREN@[2735; 2736) "(" | 1516 | TOKEN_TREE@[2735; 2742) |
1491 | STRING@[2736; 2741) "\"><>\"" | 1517 | L_PAREN@[2735; 2736) "(" |
1492 | R_PAREN@[2741; 2742) ")" | 1518 | STRING@[2736; 2741) "\"><>\"" |
1493 | COMMA@[2742; 2743) "," | 1519 | R_PAREN@[2741; 2742) ")" |
1494 | WHITESPACE@[2743; 2759) "\n " | 1520 | COMMA@[2742; 2743) "," |
1495 | IDENT@[2759; 2765) "String" | 1521 | WHITESPACE@[2743; 2759) "\n " |
1496 | COLON@[2765; 2766) ":" | 1522 | IDENT@[2759; 2765) "String" |
1497 | COLON@[2766; 2767) ":" | 1523 | COLON@[2765; 2766) ":" |
1498 | L_ANGLE@[2767; 2768) "<" | 1524 | COLON@[2766; 2767) ":" |
1499 | R_ANGLE@[2768; 2769) ">" | 1525 | L_ANGLE@[2767; 2768) "<" |
1500 | COLON@[2769; 2770) ":" | 1526 | R_ANGLE@[2768; 2769) ">" |
1501 | COLON@[2770; 2771) ":" | 1527 | COLON@[2769; 2770) ":" |
1502 | IDENT@[2771; 2775) "from" | 1528 | COLON@[2770; 2771) ":" |
1503 | COLON@[2775; 2776) ":" | 1529 | IDENT@[2771; 2775) "from" |
1504 | COLON@[2776; 2777) ":" | 1530 | COLON@[2775; 2776) ":" |
1505 | L_ANGLE@[2777; 2778) "<" | 1531 | COLON@[2776; 2777) ":" |
1506 | R_ANGLE@[2778; 2779) ">" | 1532 | L_ANGLE@[2777; 2778) "<" |
1507 | TOKEN_TREE@[2779; 2786) | 1533 | R_ANGLE@[2778; 2779) ">" |
1508 | L_PAREN@[2779; 2780) "(" | 1534 | TOKEN_TREE@[2779; 2786) |
1509 | STRING@[2780; 2785) "\"><>\"" | 1535 | L_PAREN@[2779; 2780) "(" |
1510 | R_PAREN@[2785; 2786) ")" | 1536 | STRING@[2780; 2785) "\"><>\"" |
1511 | DOT@[2786; 2787) "." | 1537 | R_PAREN@[2785; 2786) ")" |
1512 | IDENT@[2787; 2792) "chars" | 1538 | DOT@[2786; 2787) "." |
1513 | COLON@[2792; 2793) ":" | 1539 | IDENT@[2787; 2792) "chars" |
1514 | COLON@[2793; 2794) ":" | 1540 | COLON@[2792; 2793) ":" |
1515 | L_ANGLE@[2794; 2795) "<" | 1541 | COLON@[2793; 2794) ":" |
1516 | R_ANGLE@[2795; 2796) ">" | 1542 | L_ANGLE@[2794; 2795) "<" |
1517 | TOKEN_TREE@[2796; 2798) | 1543 | R_ANGLE@[2795; 2796) ">" |
1518 | L_PAREN@[2796; 2797) "(" | 1544 | TOKEN_TREE@[2796; 2798) |
1519 | R_PAREN@[2797; 2798) ")" | 1545 | L_PAREN@[2796; 2797) "(" |
1520 | DOT@[2798; 2799) "." | 1546 | R_PAREN@[2797; 2798) ")" |
1521 | IDENT@[2799; 2802) "rev" | 1547 | DOT@[2798; 2799) "." |
1522 | COLON@[2802; 2803) ":" | 1548 | IDENT@[2799; 2802) "rev" |
1523 | COLON@[2803; 2804) ":" | 1549 | COLON@[2802; 2803) ":" |
1524 | L_ANGLE@[2804; 2805) "<" | 1550 | COLON@[2803; 2804) ":" |
1525 | R_ANGLE@[2805; 2806) ">" | 1551 | L_ANGLE@[2804; 2805) "<" |
1526 | TOKEN_TREE@[2806; 2808) | 1552 | R_ANGLE@[2805; 2806) ">" |
1527 | L_PAREN@[2806; 2807) "(" | 1553 | TOKEN_TREE@[2806; 2808) |
1528 | R_PAREN@[2807; 2808) ")" | 1554 | L_PAREN@[2806; 2807) "(" |
1529 | DOT@[2808; 2809) "." | 1555 | R_PAREN@[2807; 2808) ")" |
1530 | IDENT@[2809; 2816) "collect" | 1556 | DOT@[2808; 2809) "." |
1531 | COLON@[2816; 2817) ":" | 1557 | IDENT@[2809; 2816) "collect" |
1532 | COLON@[2817; 2818) ":" | 1558 | COLON@[2816; 2817) ":" |
1533 | L_ANGLE@[2818; 2819) "<" | 1559 | COLON@[2817; 2818) ":" |
1534 | IDENT@[2819; 2825) "String" | 1560 | L_ANGLE@[2818; 2819) "<" |
1535 | R_ANGLE@[2825; 2826) ">" | 1561 | IDENT@[2819; 2825) "String" |
1536 | TOKEN_TREE@[2826; 2828) | 1562 | R_ANGLE@[2825; 2826) ">" |
1537 | L_PAREN@[2826; 2827) "(" | 1563 | TOKEN_TREE@[2826; 2828) |
1538 | R_PAREN@[2827; 2828) ")" | 1564 | L_PAREN@[2826; 2827) "(" |
1539 | R_PAREN@[2828; 2829) ")" | 1565 | R_PAREN@[2827; 2828) ")" |
1540 | SEMI@[2829; 2830) ";" | 1566 | R_PAREN@[2828; 2829) ")" |
1541 | WHITESPACE@[2830; 2831) "\n" | 1567 | SEMI@[2829; 2830) ";" |
1542 | R_CURLY@[2831; 2832) "}" | 1568 | WHITESPACE@[2830; 2831) "\n" |
1569 | R_CURLY@[2831; 2832) "}" | ||
1543 | WHITESPACE@[2832; 2834) "\n\n" | 1570 | WHITESPACE@[2832; 2834) "\n\n" |
1544 | FN_DEF@[2834; 2906) | 1571 | FN_DEF@[2834; 2906) |
1545 | FN_KW@[2834; 2836) "fn" | 1572 | FN_KW@[2834; 2836) "fn" |
@@ -1550,47 +1577,48 @@ SOURCE_FILE@[0; 3813) | |||
1550 | L_PAREN@[2842; 2843) "(" | 1577 | L_PAREN@[2842; 2843) "(" |
1551 | R_PAREN@[2843; 2844) ")" | 1578 | R_PAREN@[2843; 2844) ")" |
1552 | WHITESPACE@[2844; 2845) " " | 1579 | WHITESPACE@[2844; 2845) " " |
1553 | BLOCK@[2845; 2906) | 1580 | BLOCK_EXPR@[2845; 2906) |
1554 | L_CURLY@[2845; 2846) "{" | 1581 | BLOCK@[2845; 2906) |
1555 | WHITESPACE@[2846; 2851) "\n " | 1582 | L_CURLY@[2845; 2846) "{" |
1556 | STRUCT_DEF@[2851; 2904) | 1583 | WHITESPACE@[2846; 2851) "\n " |
1557 | UNION_KW@[2851; 2856) "union" | 1584 | STRUCT_DEF@[2851; 2904) |
1558 | WHITESPACE@[2856; 2857) " " | 1585 | UNION_KW@[2851; 2856) "union" |
1559 | NAME@[2857; 2862) | 1586 | WHITESPACE@[2856; 2857) " " |
1560 | IDENT@[2857; 2862) "union" | 1587 | NAME@[2857; 2862) |
1561 | TYPE_PARAM_LIST@[2862; 2870) | 1588 | IDENT@[2857; 2862) "union" |
1562 | L_ANGLE@[2862; 2863) "<" | 1589 | TYPE_PARAM_LIST@[2862; 2870) |
1563 | LIFETIME_PARAM@[2863; 2869) | 1590 | L_ANGLE@[2862; 2863) "<" |
1564 | LIFETIME@[2863; 2869) "\'union" | 1591 | LIFETIME_PARAM@[2863; 2869) |
1565 | R_ANGLE@[2869; 2870) ">" | 1592 | LIFETIME@[2863; 2869) "\'union" |
1566 | WHITESPACE@[2870; 2871) " " | 1593 | R_ANGLE@[2869; 2870) ">" |
1567 | RECORD_FIELD_DEF_LIST@[2871; 2904) | 1594 | WHITESPACE@[2870; 2871) " " |
1568 | L_CURLY@[2871; 2872) "{" | 1595 | RECORD_FIELD_DEF_LIST@[2871; 2904) |
1569 | WHITESPACE@[2872; 2873) " " | 1596 | L_CURLY@[2871; 2872) "{" |
1570 | RECORD_FIELD_DEF@[2873; 2901) | 1597 | WHITESPACE@[2872; 2873) " " |
1571 | NAME@[2873; 2878) | 1598 | RECORD_FIELD_DEF@[2873; 2901) |
1572 | IDENT@[2873; 2878) "union" | 1599 | NAME@[2873; 2878) |
1573 | COLON@[2878; 2879) ":" | 1600 | IDENT@[2873; 2878) "union" |
1574 | WHITESPACE@[2879; 2880) " " | 1601 | COLON@[2878; 2879) ":" |
1575 | REFERENCE_TYPE@[2880; 2901) | 1602 | WHITESPACE@[2879; 2880) " " |
1576 | AMP@[2880; 2881) "&" | 1603 | REFERENCE_TYPE@[2880; 2901) |
1577 | LIFETIME@[2881; 2887) "\'union" | 1604 | AMP@[2880; 2881) "&" |
1578 | WHITESPACE@[2887; 2888) " " | 1605 | LIFETIME@[2881; 2887) "\'union" |
1579 | PATH_TYPE@[2888; 2901) | 1606 | WHITESPACE@[2887; 2888) " " |
1580 | PATH@[2888; 2901) | 1607 | PATH_TYPE@[2888; 2901) |
1581 | PATH_SEGMENT@[2888; 2901) | 1608 | PATH@[2888; 2901) |
1582 | NAME_REF@[2888; 2893) | 1609 | PATH_SEGMENT@[2888; 2901) |
1583 | IDENT@[2888; 2893) "union" | 1610 | NAME_REF@[2888; 2893) |
1584 | TYPE_ARG_LIST@[2893; 2901) | 1611 | IDENT@[2888; 2893) "union" |
1585 | L_ANGLE@[2893; 2894) "<" | 1612 | TYPE_ARG_LIST@[2893; 2901) |
1586 | LIFETIME_ARG@[2894; 2900) | 1613 | L_ANGLE@[2893; 2894) "<" |
1587 | LIFETIME@[2894; 2900) "\'union" | 1614 | LIFETIME_ARG@[2894; 2900) |
1588 | R_ANGLE@[2900; 2901) ">" | 1615 | LIFETIME@[2894; 2900) "\'union" |
1589 | COMMA@[2901; 2902) "," | 1616 | R_ANGLE@[2900; 2901) ">" |
1590 | WHITESPACE@[2902; 2903) " " | 1617 | COMMA@[2901; 2902) "," |
1591 | R_CURLY@[2903; 2904) "}" | 1618 | WHITESPACE@[2902; 2903) " " |
1592 | WHITESPACE@[2904; 2905) "\n" | 1619 | R_CURLY@[2903; 2904) "}" |
1593 | R_CURLY@[2905; 2906) "}" | 1620 | WHITESPACE@[2904; 2905) "\n" |
1621 | R_CURLY@[2905; 2906) "}" | ||
1594 | WHITESPACE@[2906; 2908) "\n\n" | 1622 | WHITESPACE@[2906; 2908) "\n\n" |
1595 | FN_DEF@[2908; 3042) | 1623 | FN_DEF@[2908; 3042) |
1596 | FN_KW@[2908; 2910) "fn" | 1624 | FN_KW@[2908; 2910) "fn" |
@@ -1601,120 +1629,121 @@ SOURCE_FILE@[0; 3813) | |||
1601 | L_PAREN@[2929; 2930) "(" | 1629 | L_PAREN@[2929; 2930) "(" |
1602 | R_PAREN@[2930; 2931) ")" | 1630 | R_PAREN@[2930; 2931) ")" |
1603 | WHITESPACE@[2931; 2932) " " | 1631 | WHITESPACE@[2931; 2932) " " |
1604 | BLOCK@[2932; 3042) | 1632 | BLOCK_EXPR@[2932; 3042) |
1605 | L_CURLY@[2932; 2933) "{" | 1633 | BLOCK@[2932; 3042) |
1606 | WHITESPACE@[2933; 2938) "\n " | 1634 | L_CURLY@[2932; 2933) "{" |
1607 | LET_STMT@[2938; 3021) | 1635 | WHITESPACE@[2933; 2938) "\n " |
1608 | LET_KW@[2938; 2941) "let" | 1636 | LET_STMT@[2938; 3021) |
1609 | WHITESPACE@[2941; 2942) " " | 1637 | LET_KW@[2938; 2941) "let" |
1610 | BIND_PAT@[2942; 2945) | 1638 | WHITESPACE@[2941; 2942) " " |
1611 | NAME@[2942; 2945) | 1639 | BIND_PAT@[2942; 2945) |
1612 | IDENT@[2942; 2945) "val" | 1640 | NAME@[2942; 2945) |
1613 | WHITESPACE@[2945; 2946) " " | 1641 | IDENT@[2942; 2945) "val" |
1614 | EQ@[2946; 2947) "=" | 1642 | WHITESPACE@[2945; 2946) " " |
1615 | WHITESPACE@[2947; 2948) " " | 1643 | EQ@[2946; 2947) "=" |
1616 | PREFIX_EXPR@[2948; 3013) | 1644 | WHITESPACE@[2947; 2948) " " |
1617 | EXCL@[2948; 2949) "!" | 1645 | PREFIX_EXPR@[2948; 3013) |
1618 | PAREN_EXPR@[2949; 3013) | 1646 | EXCL@[2948; 2949) "!" |
1619 | L_PAREN@[2949; 2950) "(" | 1647 | PAREN_EXPR@[2949; 3013) |
1620 | BIN_EXPR@[2950; 3012) | 1648 | L_PAREN@[2949; 2950) "(" |
1621 | CALL_EXPR@[2950; 2995) | 1649 | BIN_EXPR@[2950; 3012) |
1622 | PAREN_EXPR@[2950; 2971) | 1650 | CALL_EXPR@[2950; 2995) |
1623 | L_PAREN@[2950; 2951) "(" | 1651 | PAREN_EXPR@[2950; 2971) |
1624 | LAMBDA_EXPR@[2951; 2970) | 1652 | L_PAREN@[2950; 2951) "(" |
1625 | PARAM_LIST@[2951; 2968) | 1653 | LAMBDA_EXPR@[2951; 2970) |
1626 | PIPE@[2951; 2952) "|" | 1654 | PARAM_LIST@[2951; 2968) |
1627 | PARAM@[2952; 2962) | 1655 | PIPE@[2951; 2952) "|" |
1628 | TUPLE_PAT@[2952; 2956) | 1656 | PARAM@[2952; 2962) |
1629 | L_PAREN@[2952; 2953) "(" | 1657 | TUPLE_PAT@[2952; 2956) |
1630 | DOTDOT@[2953; 2955) ".." | 1658 | L_PAREN@[2952; 2953) "(" |
1631 | R_PAREN@[2955; 2956) ")" | 1659 | DOTDOT@[2953; 2955) ".." |
1632 | COLON@[2956; 2957) ":" | 1660 | R_PAREN@[2955; 2956) ")" |
1633 | TUPLE_TYPE@[2957; 2962) | 1661 | COLON@[2956; 2957) ":" |
1634 | L_PAREN@[2957; 2958) "(" | 1662 | TUPLE_TYPE@[2957; 2962) |
1635 | PLACEHOLDER_TYPE@[2958; 2959) | 1663 | L_PAREN@[2957; 2958) "(" |
1636 | UNDERSCORE@[2958; 2959) "_" | 1664 | PLACEHOLDER_TYPE@[2958; 2959) |
1637 | COMMA@[2959; 2960) "," | 1665 | UNDERSCORE@[2958; 2959) "_" |
1638 | PLACEHOLDER_TYPE@[2960; 2961) | 1666 | COMMA@[2959; 2960) "," |
1639 | UNDERSCORE@[2960; 2961) "_" | 1667 | PLACEHOLDER_TYPE@[2960; 2961) |
1640 | R_PAREN@[2961; 2962) ")" | 1668 | UNDERSCORE@[2960; 2961) "_" |
1641 | COMMA@[2962; 2963) "," | 1669 | R_PAREN@[2961; 2962) ")" |
1642 | PARAM@[2963; 2967) | 1670 | COMMA@[2962; 2963) "," |
1643 | BIND_PAT@[2963; 2967) | 1671 | PARAM@[2963; 2967) |
1644 | NAME@[2963; 2965) | 1672 | BIND_PAT@[2963; 2967) |
1645 | IDENT@[2963; 2965) "__" | 1673 | NAME@[2963; 2965) |
1646 | AT@[2965; 2966) "@" | 1674 | IDENT@[2963; 2965) "__" |
1647 | PLACEHOLDER_PAT@[2966; 2967) | 1675 | AT@[2965; 2966) "@" |
1648 | UNDERSCORE@[2966; 2967) "_" | 1676 | PLACEHOLDER_PAT@[2966; 2967) |
1649 | PIPE@[2967; 2968) "|" | 1677 | UNDERSCORE@[2966; 2967) "_" |
1650 | PATH_EXPR@[2968; 2970) | 1678 | PIPE@[2967; 2968) "|" |
1651 | PATH@[2968; 2970) | 1679 | PATH_EXPR@[2968; 2970) |
1652 | PATH_SEGMENT@[2968; 2970) | 1680 | PATH@[2968; 2970) |
1653 | NAME_REF@[2968; 2970) | 1681 | PATH_SEGMENT@[2968; 2970) |
1654 | IDENT@[2968; 2970) "__" | 1682 | NAME_REF@[2968; 2970) |
1655 | R_PAREN@[2970; 2971) ")" | 1683 | IDENT@[2968; 2970) "__" |
1656 | ARG_LIST@[2971; 2995) | 1684 | R_PAREN@[2970; 2971) ")" |
1657 | L_PAREN@[2971; 2972) "(" | 1685 | ARG_LIST@[2971; 2995) |
1658 | TUPLE_EXPR@[2972; 2987) | 1686 | L_PAREN@[2971; 2972) "(" |
1659 | L_PAREN@[2972; 2973) "(" | 1687 | TUPLE_EXPR@[2972; 2987) |
1660 | REF_EXPR@[2973; 2979) | 1688 | L_PAREN@[2972; 2973) "(" |
1661 | AMP@[2973; 2974) "&" | 1689 | REF_EXPR@[2973; 2979) |
1662 | PREFIX_EXPR@[2974; 2979) | 1690 | AMP@[2973; 2974) "&" |
1663 | STAR@[2974; 2975) "*" | 1691 | PREFIX_EXPR@[2974; 2979) |
1664 | LITERAL@[2975; 2979) | 1692 | STAR@[2974; 2975) "*" |
1665 | STRING@[2975; 2979) "\"\\\\\"" | 1693 | LITERAL@[2975; 2979) |
1666 | COMMA@[2979; 2980) "," | 1694 | STRING@[2975; 2979) "\"\\\\\"" |
1667 | LITERAL@[2980; 2986) | 1695 | COMMA@[2979; 2980) "," |
1668 | CHAR@[2980; 2986) "\'🤔\'" | 1696 | LITERAL@[2980; 2986) |
1669 | R_PAREN@[2986; 2987) ")" | 1697 | CHAR@[2980; 2986) "\'🤔\'" |
1670 | COMMENT@[2987; 2991) "/**/" | 1698 | R_PAREN@[2986; 2987) ")" |
1671 | COMMA@[2991; 2992) "," | 1699 | COMMENT@[2987; 2991) "/**/" |
1672 | BLOCK_EXPR@[2992; 2994) | 1700 | COMMA@[2991; 2992) "," |
1673 | BLOCK@[2992; 2994) | 1701 | BLOCK_EXPR@[2992; 2994) |
1674 | L_CURLY@[2992; 2993) "{" | 1702 | BLOCK@[2992; 2994) |
1675 | R_CURLY@[2993; 2994) "}" | 1703 | L_CURLY@[2992; 2993) "{" |
1676 | R_PAREN@[2994; 2995) ")" | 1704 | R_CURLY@[2993; 2994) "}" |
1677 | EQEQ@[2995; 2997) "==" | 1705 | R_PAREN@[2994; 2995) ")" |
1678 | BLOCK_EXPR@[2997; 3012) | 1706 | EQEQ@[2995; 2997) "==" |
1679 | BLOCK@[2997; 3012) | 1707 | BLOCK_EXPR@[2997; 3012) |
1680 | L_CURLY@[2997; 2998) "{" | 1708 | BLOCK@[2997; 3012) |
1681 | EXPR_STMT@[2998; 3011) | 1709 | L_CURLY@[2997; 2998) "{" |
1682 | REF_EXPR@[2998; 3010) | 1710 | EXPR_STMT@[2998; 3011) |
1683 | AMP@[2998; 2999) "&" | 1711 | REF_EXPR@[2998; 3010) |
1684 | INDEX_EXPR@[2999; 3010) | 1712 | AMP@[2998; 2999) "&" |
1685 | ARRAY_EXPR@[2999; 3006) | 1713 | INDEX_EXPR@[2999; 3010) |
1686 | L_BRACK@[2999; 3000) "[" | 1714 | ARRAY_EXPR@[2999; 3006) |
1687 | RANGE_EXPR@[3000; 3005) | 1715 | L_BRACK@[2999; 3000) "[" |
1688 | DOTDOTEQ@[3000; 3003) "..=" | 1716 | RANGE_EXPR@[3000; 3005) |
1689 | RANGE_EXPR@[3003; 3005) | 1717 | DOTDOTEQ@[3000; 3003) "..=" |
1690 | DOTDOT@[3003; 3005) ".." | 1718 | RANGE_EXPR@[3003; 3005) |
1691 | R_BRACK@[3005; 3006) "]" | 1719 | DOTDOT@[3003; 3005) ".." |
1692 | L_BRACK@[3006; 3007) "[" | 1720 | R_BRACK@[3005; 3006) "]" |
1693 | RANGE_EXPR@[3007; 3009) | 1721 | L_BRACK@[3006; 3007) "[" |
1694 | DOTDOT@[3007; 3009) ".." | 1722 | RANGE_EXPR@[3007; 3009) |
1695 | R_BRACK@[3009; 3010) "]" | 1723 | DOTDOT@[3007; 3009) ".." |
1696 | SEMI@[3010; 3011) ";" | 1724 | R_BRACK@[3009; 3010) "]" |
1697 | R_CURLY@[3011; 3012) "}" | 1725 | SEMI@[3010; 3011) ";" |
1698 | R_PAREN@[3012; 3013) ")" | 1726 | R_CURLY@[3011; 3012) "}" |
1699 | COMMENT@[3013; 3015) "//" | 1727 | R_PAREN@[3012; 3013) ")" |
1700 | WHITESPACE@[3015; 3020) "\n " | 1728 | COMMENT@[3013; 3015) "//" |
1701 | SEMI@[3020; 3021) ";" | 1729 | WHITESPACE@[3015; 3020) "\n " |
1702 | WHITESPACE@[3021; 3026) "\n " | 1730 | SEMI@[3020; 3021) ";" |
1703 | EXPR_STMT@[3026; 3040) | 1731 | WHITESPACE@[3021; 3026) "\n " |
1704 | MACRO_CALL@[3026; 3039) | 1732 | EXPR_STMT@[3026; 3040) |
1705 | PATH@[3026; 3032) | 1733 | MACRO_CALL@[3026; 3039) |
1706 | PATH_SEGMENT@[3026; 3032) | 1734 | PATH@[3026; 3032) |
1707 | NAME_REF@[3026; 3032) | 1735 | PATH_SEGMENT@[3026; 3032) |
1708 | IDENT@[3026; 3032) "assert" | 1736 | NAME_REF@[3026; 3032) |
1709 | EXCL@[3032; 3033) "!" | 1737 | IDENT@[3026; 3032) "assert" |
1710 | TOKEN_TREE@[3033; 3039) | 1738 | EXCL@[3032; 3033) "!" |
1711 | L_PAREN@[3033; 3034) "(" | 1739 | TOKEN_TREE@[3033; 3039) |
1712 | EXCL@[3034; 3035) "!" | 1740 | L_PAREN@[3033; 3034) "(" |
1713 | IDENT@[3035; 3038) "val" | 1741 | EXCL@[3034; 3035) "!" |
1714 | R_PAREN@[3038; 3039) ")" | 1742 | IDENT@[3035; 3038) "val" |
1715 | SEMI@[3039; 3040) ";" | 1743 | R_PAREN@[3038; 3039) ")" |
1716 | WHITESPACE@[3040; 3041) "\n" | 1744 | SEMI@[3039; 3040) ";" |
1717 | R_CURLY@[3041; 3042) "}" | 1745 | WHITESPACE@[3040; 3041) "\n" |
1746 | R_CURLY@[3041; 3042) "}" | ||
1718 | WHITESPACE@[3042; 3044) "\n\n" | 1747 | WHITESPACE@[3042; 3044) "\n\n" |
1719 | FN_DEF@[3044; 3514) | 1748 | FN_DEF@[3044; 3514) |
1720 | FN_KW@[3044; 3046) "fn" | 1749 | FN_KW@[3044; 3046) "fn" |
@@ -1749,306 +1778,307 @@ SOURCE_FILE@[0; 3813) | |||
1749 | NAME_REF@[3078; 3083) | 1778 | NAME_REF@[3078; 3083) |
1750 | IDENT@[3078; 3083) "Debug" | 1779 | IDENT@[3078; 3083) "Debug" |
1751 | WHITESPACE@[3083; 3084) " " | 1780 | WHITESPACE@[3083; 3084) " " |
1752 | BLOCK@[3084; 3514) | 1781 | BLOCK_EXPR@[3084; 3514) |
1753 | L_CURLY@[3084; 3085) "{" | 1782 | BLOCK@[3084; 3514) |
1754 | WHITESPACE@[3085; 3090) "\n " | 1783 | L_CURLY@[3084; 3085) "{" |
1755 | RANGE_EXPR@[3090; 3512) | 1784 | WHITESPACE@[3085; 3090) "\n " |
1756 | DOTDOTEQ@[3090; 3093) "..=" | 1785 | RANGE_EXPR@[3090; 3512) |
1757 | RANGE_EXPR@[3093; 3512) | 1786 | DOTDOTEQ@[3090; 3093) "..=" |
1758 | DOTDOTEQ@[3093; 3096) "..=" | 1787 | RANGE_EXPR@[3093; 3512) |
1759 | RANGE_EXPR@[3096; 3512) | 1788 | DOTDOTEQ@[3093; 3096) "..=" |
1760 | DOTDOT@[3096; 3098) ".." | 1789 | RANGE_EXPR@[3096; 3512) |
1761 | WHITESPACE@[3098; 3099) " " | 1790 | DOTDOT@[3096; 3098) ".." |
1762 | RANGE_EXPR@[3099; 3512) | 1791 | WHITESPACE@[3098; 3099) " " |
1763 | DOTDOT@[3099; 3101) ".." | 1792 | RANGE_EXPR@[3099; 3512) |
1764 | WHITESPACE@[3101; 3105) " " | 1793 | DOTDOT@[3099; 3101) ".." |
1765 | RANGE_EXPR@[3105; 3512) | 1794 | WHITESPACE@[3101; 3105) " " |
1766 | DOTDOT@[3105; 3107) ".." | 1795 | RANGE_EXPR@[3105; 3512) |
1767 | WHITESPACE@[3107; 3108) " " | 1796 | DOTDOT@[3105; 3107) ".." |
1768 | RANGE_EXPR@[3108; 3512) | 1797 | WHITESPACE@[3107; 3108) " " |
1769 | DOTDOT@[3108; 3110) ".." | 1798 | RANGE_EXPR@[3108; 3512) |
1770 | WHITESPACE@[3110; 3111) " " | 1799 | DOTDOT@[3108; 3110) ".." |
1771 | RANGE_EXPR@[3111; 3512) | 1800 | WHITESPACE@[3110; 3111) " " |
1772 | DOTDOT@[3111; 3113) ".." | 1801 | RANGE_EXPR@[3111; 3512) |
1773 | WHITESPACE@[3113; 3114) " " | 1802 | DOTDOT@[3111; 3113) ".." |
1774 | RANGE_EXPR@[3114; 3512) | 1803 | WHITESPACE@[3113; 3114) " " |
1775 | DOTDOT@[3114; 3116) ".." | 1804 | RANGE_EXPR@[3114; 3512) |
1776 | WHITESPACE@[3116; 3120) " " | 1805 | DOTDOT@[3114; 3116) ".." |
1777 | RANGE_EXPR@[3120; 3512) | 1806 | WHITESPACE@[3116; 3120) " " |
1778 | DOTDOT@[3120; 3122) ".." | 1807 | RANGE_EXPR@[3120; 3512) |
1779 | WHITESPACE@[3122; 3123) " " | 1808 | DOTDOT@[3120; 3122) ".." |
1780 | RANGE_EXPR@[3123; 3512) | 1809 | WHITESPACE@[3122; 3123) " " |
1781 | DOTDOT@[3123; 3125) ".." | 1810 | RANGE_EXPR@[3123; 3512) |
1782 | WHITESPACE@[3125; 3126) " " | 1811 | DOTDOT@[3123; 3125) ".." |
1783 | RANGE_EXPR@[3126; 3512) | 1812 | WHITESPACE@[3125; 3126) " " |
1784 | DOTDOT@[3126; 3128) ".." | 1813 | RANGE_EXPR@[3126; 3512) |
1785 | WHITESPACE@[3128; 3129) " " | 1814 | DOTDOT@[3126; 3128) ".." |
1786 | RANGE_EXPR@[3129; 3512) | 1815 | WHITESPACE@[3128; 3129) " " |
1787 | DOTDOT@[3129; 3131) ".." | 1816 | RANGE_EXPR@[3129; 3512) |
1788 | WHITESPACE@[3131; 3135) " " | 1817 | DOTDOT@[3129; 3131) ".." |
1789 | RANGE_EXPR@[3135; 3512) | 1818 | WHITESPACE@[3131; 3135) " " |
1790 | DOTDOT@[3135; 3137) ".." | 1819 | RANGE_EXPR@[3135; 3512) |
1791 | WHITESPACE@[3137; 3138) " " | 1820 | DOTDOT@[3135; 3137) ".." |
1792 | RANGE_EXPR@[3138; 3512) | 1821 | WHITESPACE@[3137; 3138) " " |
1793 | DOTDOTEQ@[3138; 3141) "..=" | 1822 | RANGE_EXPR@[3138; 3512) |
1794 | RANGE_EXPR@[3141; 3512) | 1823 | DOTDOTEQ@[3138; 3141) "..=" |
1795 | DOTDOT@[3141; 3143) ".." | 1824 | RANGE_EXPR@[3141; 3512) |
1796 | WHITESPACE@[3143; 3144) " " | 1825 | DOTDOT@[3141; 3143) ".." |
1797 | RANGE_EXPR@[3144; 3512) | 1826 | WHITESPACE@[3143; 3144) " " |
1798 | DOTDOT@[3144; 3146) ".." | 1827 | RANGE_EXPR@[3144; 3512) |
1799 | WHITESPACE@[3146; 3151) "\n " | 1828 | DOTDOT@[3144; 3146) ".." |
1800 | RANGE_EXPR@[3151; 3512) | 1829 | WHITESPACE@[3146; 3151) "\n " |
1801 | DOTDOTEQ@[3151; 3154) "..=" | 1830 | RANGE_EXPR@[3151; 3512) |
1802 | RANGE_EXPR@[3154; 3512) | 1831 | DOTDOTEQ@[3151; 3154) "..=" |
1803 | DOTDOT@[3154; 3156) ".." | 1832 | RANGE_EXPR@[3154; 3512) |
1804 | WHITESPACE@[3156; 3157) " " | 1833 | DOTDOT@[3154; 3156) ".." |
1805 | RANGE_EXPR@[3157; 3512) | 1834 | WHITESPACE@[3156; 3157) " " |
1806 | DOTDOTEQ@[3157; 3160) "..=" | 1835 | RANGE_EXPR@[3157; 3512) |
1807 | RANGE_EXPR@[3160; 3512) | 1836 | DOTDOTEQ@[3157; 3160) "..=" |
1808 | DOTDOT@[3160; 3162) ".." | 1837 | RANGE_EXPR@[3160; 3512) |
1809 | WHITESPACE@[3162; 3166) " " | 1838 | DOTDOT@[3160; 3162) ".." |
1810 | RANGE_EXPR@[3166; 3512) | 1839 | WHITESPACE@[3162; 3166) " " |
1811 | DOTDOT@[3166; 3168) ".." | 1840 | RANGE_EXPR@[3166; 3512) |
1812 | WHITESPACE@[3168; 3169) " " | 1841 | DOTDOT@[3166; 3168) ".." |
1813 | RANGE_EXPR@[3169; 3512) | 1842 | WHITESPACE@[3168; 3169) " " |
1814 | DOTDOT@[3169; 3171) ".." | 1843 | RANGE_EXPR@[3169; 3512) |
1815 | WHITESPACE@[3171; 3172) " " | 1844 | DOTDOT@[3169; 3171) ".." |
1816 | RANGE_EXPR@[3172; 3512) | 1845 | WHITESPACE@[3171; 3172) " " |
1817 | DOTDOT@[3172; 3174) ".." | 1846 | RANGE_EXPR@[3172; 3512) |
1818 | WHITESPACE@[3174; 3175) " " | 1847 | DOTDOT@[3172; 3174) ".." |
1819 | RANGE_EXPR@[3175; 3512) | 1848 | WHITESPACE@[3174; 3175) " " |
1820 | DOTDOT@[3175; 3177) ".." | 1849 | RANGE_EXPR@[3175; 3512) |
1821 | WHITESPACE@[3177; 3181) " " | 1850 | DOTDOT@[3175; 3177) ".." |
1822 | RANGE_EXPR@[3181; 3512) | 1851 | WHITESPACE@[3177; 3181) " " |
1823 | DOTDOT@[3181; 3183) ".." | 1852 | RANGE_EXPR@[3181; 3512) |
1824 | WHITESPACE@[3183; 3184) " " | 1853 | DOTDOT@[3181; 3183) ".." |
1825 | RANGE_EXPR@[3184; 3512) | 1854 | WHITESPACE@[3183; 3184) " " |
1826 | DOTDOT@[3184; 3186) ".." | 1855 | RANGE_EXPR@[3184; 3512) |
1827 | WHITESPACE@[3186; 3187) " " | 1856 | DOTDOT@[3184; 3186) ".." |
1828 | RANGE_EXPR@[3187; 3512) | 1857 | WHITESPACE@[3186; 3187) " " |
1829 | DOTDOT@[3187; 3189) ".." | 1858 | RANGE_EXPR@[3187; 3512) |
1830 | WHITESPACE@[3189; 3190) " " | 1859 | DOTDOT@[3187; 3189) ".." |
1831 | RANGE_EXPR@[3190; 3512) | 1860 | WHITESPACE@[3189; 3190) " " |
1832 | DOTDOT@[3190; 3192) ".." | 1861 | RANGE_EXPR@[3190; 3512) |
1833 | WHITESPACE@[3192; 3196) " " | 1862 | DOTDOT@[3190; 3192) ".." |
1834 | RANGE_EXPR@[3196; 3512) | 1863 | WHITESPACE@[3192; 3196) " " |
1835 | DOTDOTEQ@[3196; 3199) "..=" | 1864 | RANGE_EXPR@[3196; 3512) |
1836 | RANGE_EXPR@[3199; 3512) | 1865 | DOTDOTEQ@[3196; 3199) "..=" |
1837 | DOTDOTEQ@[3199; 3202) "..=" | 1866 | RANGE_EXPR@[3199; 3512) |
1838 | RANGE_EXPR@[3202; 3512) | 1867 | DOTDOTEQ@[3199; 3202) "..=" |
1839 | DOTDOTEQ@[3202; 3205) "..=" | 1868 | RANGE_EXPR@[3202; 3512) |
1840 | RANGE_EXPR@[3205; 3512) | 1869 | DOTDOTEQ@[3202; 3205) "..=" |
1841 | DOTDOT@[3205; 3207) ".." | 1870 | RANGE_EXPR@[3205; 3512) |
1842 | WHITESPACE@[3207; 3212) "\n " | 1871 | DOTDOT@[3205; 3207) ".." |
1843 | RANGE_EXPR@[3212; 3512) | 1872 | WHITESPACE@[3207; 3212) "\n " |
1844 | DOTDOTEQ@[3212; 3215) "..=" | 1873 | RANGE_EXPR@[3212; 3512) |
1845 | RANGE_EXPR@[3215; 3512) | 1874 | DOTDOTEQ@[3212; 3215) "..=" |
1846 | DOTDOT@[3215; 3217) ".." | 1875 | RANGE_EXPR@[3215; 3512) |
1847 | WHITESPACE@[3217; 3218) " " | 1876 | DOTDOT@[3215; 3217) ".." |
1848 | RANGE_EXPR@[3218; 3512) | 1877 | WHITESPACE@[3217; 3218) " " |
1849 | DOTDOTEQ@[3218; 3221) "..=" | 1878 | RANGE_EXPR@[3218; 3512) |
1850 | RANGE_EXPR@[3221; 3512) | 1879 | DOTDOTEQ@[3218; 3221) "..=" |
1851 | DOTDOT@[3221; 3223) ".." | 1880 | RANGE_EXPR@[3221; 3512) |
1852 | WHITESPACE@[3223; 3227) " " | 1881 | DOTDOT@[3221; 3223) ".." |
1853 | RANGE_EXPR@[3227; 3512) | 1882 | WHITESPACE@[3223; 3227) " " |
1854 | DOTDOTEQ@[3227; 3230) "..=" | 1883 | RANGE_EXPR@[3227; 3512) |
1855 | RANGE_EXPR@[3230; 3512) | 1884 | DOTDOTEQ@[3227; 3230) "..=" |
1856 | DOTDOT@[3230; 3232) ".." | 1885 | RANGE_EXPR@[3230; 3512) |
1857 | WHITESPACE@[3232; 3233) " " | 1886 | DOTDOT@[3230; 3232) ".." |
1858 | RANGE_EXPR@[3233; 3512) | 1887 | WHITESPACE@[3232; 3233) " " |
1859 | DOTDOTEQ@[3233; 3236) "..=" | 1888 | RANGE_EXPR@[3233; 3512) |
1860 | RANGE_EXPR@[3236; 3512) | 1889 | DOTDOTEQ@[3233; 3236) "..=" |
1861 | DOTDOT@[3236; 3238) ".." | 1890 | RANGE_EXPR@[3236; 3512) |
1862 | WHITESPACE@[3238; 3242) " " | 1891 | DOTDOT@[3236; 3238) ".." |
1863 | RANGE_EXPR@[3242; 3512) | 1892 | WHITESPACE@[3238; 3242) " " |
1864 | DOTDOT@[3242; 3244) ".." | 1893 | RANGE_EXPR@[3242; 3512) |
1865 | WHITESPACE@[3244; 3245) " " | 1894 | DOTDOT@[3242; 3244) ".." |
1866 | RANGE_EXPR@[3245; 3512) | 1895 | WHITESPACE@[3244; 3245) " " |
1867 | DOTDOTEQ@[3245; 3248) "..=" | 1896 | RANGE_EXPR@[3245; 3512) |
1868 | RANGE_EXPR@[3248; 3512) | 1897 | DOTDOTEQ@[3245; 3248) "..=" |
1869 | DOTDOTEQ@[3248; 3251) "..=" | 1898 | RANGE_EXPR@[3248; 3512) |
1870 | RANGE_EXPR@[3251; 3512) | 1899 | DOTDOTEQ@[3248; 3251) "..=" |
1871 | DOTDOT@[3251; 3253) ".." | 1900 | RANGE_EXPR@[3251; 3512) |
1872 | WHITESPACE@[3253; 3257) " " | 1901 | DOTDOT@[3251; 3253) ".." |
1873 | RANGE_EXPR@[3257; 3512) | 1902 | WHITESPACE@[3253; 3257) " " |
1874 | DOTDOT@[3257; 3259) ".." | 1903 | RANGE_EXPR@[3257; 3512) |
1875 | WHITESPACE@[3259; 3260) " " | 1904 | DOTDOT@[3257; 3259) ".." |
1876 | RANGE_EXPR@[3260; 3512) | 1905 | WHITESPACE@[3259; 3260) " " |
1877 | DOTDOTEQ@[3260; 3263) "..=" | 1906 | RANGE_EXPR@[3260; 3512) |
1878 | RANGE_EXPR@[3263; 3512) | 1907 | DOTDOTEQ@[3260; 3263) "..=" |
1879 | DOTDOT@[3263; 3265) ".." | 1908 | RANGE_EXPR@[3263; 3512) |
1880 | WHITESPACE@[3265; 3266) " " | 1909 | DOTDOT@[3263; 3265) ".." |
1881 | RANGE_EXPR@[3266; 3512) | 1910 | WHITESPACE@[3265; 3266) " " |
1882 | DOTDOT@[3266; 3268) ".." | 1911 | RANGE_EXPR@[3266; 3512) |
1883 | WHITESPACE@[3268; 3273) "\n " | 1912 | DOTDOT@[3266; 3268) ".." |
1884 | RANGE_EXPR@[3273; 3512) | 1913 | WHITESPACE@[3268; 3273) "\n " |
1885 | DOTDOTEQ@[3273; 3276) "..=" | 1914 | RANGE_EXPR@[3273; 3512) |
1886 | RANGE_EXPR@[3276; 3512) | 1915 | DOTDOTEQ@[3273; 3276) "..=" |
1887 | DOTDOTEQ@[3276; 3279) "..=" | 1916 | RANGE_EXPR@[3276; 3512) |
1888 | RANGE_EXPR@[3279; 3512) | 1917 | DOTDOTEQ@[3276; 3279) "..=" |
1889 | DOTDOT@[3279; 3281) ".." | 1918 | RANGE_EXPR@[3279; 3512) |
1890 | WHITESPACE@[3281; 3282) " " | 1919 | DOTDOT@[3279; 3281) ".." |
1891 | RANGE_EXPR@[3282; 3512) | 1920 | WHITESPACE@[3281; 3282) " " |
1892 | DOTDOT@[3282; 3284) ".." | 1921 | RANGE_EXPR@[3282; 3512) |
1893 | WHITESPACE@[3284; 3288) " " | 1922 | DOTDOT@[3282; 3284) ".." |
1894 | RANGE_EXPR@[3288; 3512) | 1923 | WHITESPACE@[3284; 3288) " " |
1895 | DOTDOTEQ@[3288; 3291) "..=" | 1924 | RANGE_EXPR@[3288; 3512) |
1896 | RANGE_EXPR@[3291; 3512) | 1925 | DOTDOTEQ@[3288; 3291) "..=" |
1897 | DOTDOT@[3291; 3293) ".." | 1926 | RANGE_EXPR@[3291; 3512) |
1898 | WHITESPACE@[3293; 3294) " " | 1927 | DOTDOT@[3291; 3293) ".." |
1899 | RANGE_EXPR@[3294; 3512) | 1928 | WHITESPACE@[3293; 3294) " " |
1900 | DOTDOTEQ@[3294; 3297) "..=" | 1929 | RANGE_EXPR@[3294; 3512) |
1901 | RANGE_EXPR@[3297; 3512) | 1930 | DOTDOTEQ@[3294; 3297) "..=" |
1902 | DOTDOT@[3297; 3299) ".." | 1931 | RANGE_EXPR@[3297; 3512) |
1903 | WHITESPACE@[3299; 3303) " " | 1932 | DOTDOT@[3297; 3299) ".." |
1904 | RANGE_EXPR@[3303; 3512) | 1933 | WHITESPACE@[3299; 3303) " " |
1905 | DOTDOTEQ@[3303; 3306) "..=" | 1934 | RANGE_EXPR@[3303; 3512) |
1906 | RANGE_EXPR@[3306; 3512) | 1935 | DOTDOTEQ@[3303; 3306) "..=" |
1907 | DOTDOT@[3306; 3308) ".." | 1936 | RANGE_EXPR@[3306; 3512) |
1908 | WHITESPACE@[3308; 3309) " " | 1937 | DOTDOT@[3306; 3308) ".." |
1909 | RANGE_EXPR@[3309; 3512) | 1938 | WHITESPACE@[3308; 3309) " " |
1910 | DOTDOT@[3309; 3311) ".." | 1939 | RANGE_EXPR@[3309; 3512) |
1911 | WHITESPACE@[3311; 3312) " " | 1940 | DOTDOT@[3309; 3311) ".." |
1912 | RANGE_EXPR@[3312; 3512) | 1941 | WHITESPACE@[3311; 3312) " " |
1913 | DOTDOT@[3312; 3314) ".." | 1942 | RANGE_EXPR@[3312; 3512) |
1914 | WHITESPACE@[3314; 3318) " " | 1943 | DOTDOT@[3312; 3314) ".." |
1915 | RANGE_EXPR@[3318; 3512) | 1944 | WHITESPACE@[3314; 3318) " " |
1916 | DOTDOT@[3318; 3320) ".." | 1945 | RANGE_EXPR@[3318; 3512) |
1917 | WHITESPACE@[3320; 3321) " " | 1946 | DOTDOT@[3318; 3320) ".." |
1918 | RANGE_EXPR@[3321; 3512) | 1947 | WHITESPACE@[3320; 3321) " " |
1919 | DOTDOTEQ@[3321; 3324) "..=" | 1948 | RANGE_EXPR@[3321; 3512) |
1920 | RANGE_EXPR@[3324; 3512) | 1949 | DOTDOTEQ@[3321; 3324) "..=" |
1921 | DOTDOT@[3324; 3326) ".." | 1950 | RANGE_EXPR@[3324; 3512) |
1922 | WHITESPACE@[3326; 3327) " " | 1951 | DOTDOT@[3324; 3326) ".." |
1923 | RANGE_EXPR@[3327; 3512) | 1952 | WHITESPACE@[3326; 3327) " " |
1924 | DOTDOT@[3327; 3329) ".." | 1953 | RANGE_EXPR@[3327; 3512) |
1925 | WHITESPACE@[3329; 3334) "\n " | 1954 | DOTDOT@[3327; 3329) ".." |
1926 | RANGE_EXPR@[3334; 3512) | 1955 | WHITESPACE@[3329; 3334) "\n " |
1927 | DOTDOTEQ@[3334; 3337) "..=" | 1956 | RANGE_EXPR@[3334; 3512) |
1928 | RANGE_EXPR@[3337; 3512) | 1957 | DOTDOTEQ@[3334; 3337) "..=" |
1929 | DOTDOT@[3337; 3339) ".." | 1958 | RANGE_EXPR@[3337; 3512) |
1930 | WHITESPACE@[3339; 3340) " " | 1959 | DOTDOT@[3337; 3339) ".." |
1931 | RANGE_EXPR@[3340; 3512) | 1960 | WHITESPACE@[3339; 3340) " " |
1932 | DOTDOTEQ@[3340; 3343) "..=" | 1961 | RANGE_EXPR@[3340; 3512) |
1933 | RANGE_EXPR@[3343; 3512) | 1962 | DOTDOTEQ@[3340; 3343) "..=" |
1934 | DOTDOT@[3343; 3345) ".." | 1963 | RANGE_EXPR@[3343; 3512) |
1935 | WHITESPACE@[3345; 3349) " " | 1964 | DOTDOT@[3343; 3345) ".." |
1936 | RANGE_EXPR@[3349; 3512) | 1965 | WHITESPACE@[3345; 3349) " " |
1937 | DOTDOTEQ@[3349; 3352) "..=" | 1966 | RANGE_EXPR@[3349; 3512) |
1938 | RANGE_EXPR@[3352; 3512) | 1967 | DOTDOTEQ@[3349; 3352) "..=" |
1939 | DOTDOT@[3352; 3354) ".." | 1968 | RANGE_EXPR@[3352; 3512) |
1940 | WHITESPACE@[3354; 3355) " " | 1969 | DOTDOT@[3352; 3354) ".." |
1941 | RANGE_EXPR@[3355; 3512) | 1970 | WHITESPACE@[3354; 3355) " " |
1942 | DOTDOTEQ@[3355; 3358) "..=" | 1971 | RANGE_EXPR@[3355; 3512) |
1943 | RANGE_EXPR@[3358; 3512) | 1972 | DOTDOTEQ@[3355; 3358) "..=" |
1944 | DOTDOT@[3358; 3360) ".." | 1973 | RANGE_EXPR@[3358; 3512) |
1945 | WHITESPACE@[3360; 3364) " " | 1974 | DOTDOT@[3358; 3360) ".." |
1946 | RANGE_EXPR@[3364; 3512) | 1975 | WHITESPACE@[3360; 3364) " " |
1947 | DOTDOT@[3364; 3366) ".." | 1976 | RANGE_EXPR@[3364; 3512) |
1948 | WHITESPACE@[3366; 3367) " " | 1977 | DOTDOT@[3364; 3366) ".." |
1949 | RANGE_EXPR@[3367; 3512) | 1978 | WHITESPACE@[3366; 3367) " " |
1950 | DOTDOTEQ@[3367; 3370) "..=" | 1979 | RANGE_EXPR@[3367; 3512) |
1951 | RANGE_EXPR@[3370; 3512) | 1980 | DOTDOTEQ@[3367; 3370) "..=" |
1952 | DOTDOT@[3370; 3372) ".." | 1981 | RANGE_EXPR@[3370; 3512) |
1953 | WHITESPACE@[3372; 3373) " " | 1982 | DOTDOT@[3370; 3372) ".." |
1954 | RANGE_EXPR@[3373; 3512) | 1983 | WHITESPACE@[3372; 3373) " " |
1955 | DOTDOT@[3373; 3375) ".." | 1984 | RANGE_EXPR@[3373; 3512) |
1956 | WHITESPACE@[3375; 3379) " " | 1985 | DOTDOT@[3373; 3375) ".." |
1957 | RANGE_EXPR@[3379; 3512) | 1986 | WHITESPACE@[3375; 3379) " " |
1958 | DOTDOT@[3379; 3381) ".." | 1987 | RANGE_EXPR@[3379; 3512) |
1959 | WHITESPACE@[3381; 3382) " " | 1988 | DOTDOT@[3379; 3381) ".." |
1960 | RANGE_EXPR@[3382; 3512) | 1989 | WHITESPACE@[3381; 3382) " " |
1961 | DOTDOTEQ@[3382; 3385) "..=" | 1990 | RANGE_EXPR@[3382; 3512) |
1962 | RANGE_EXPR@[3385; 3512) | 1991 | DOTDOTEQ@[3382; 3385) "..=" |
1963 | DOTDOT@[3385; 3387) ".." | 1992 | RANGE_EXPR@[3385; 3512) |
1964 | WHITESPACE@[3387; 3388) " " | 1993 | DOTDOT@[3385; 3387) ".." |
1965 | RANGE_EXPR@[3388; 3512) | 1994 | WHITESPACE@[3387; 3388) " " |
1966 | DOTDOT@[3388; 3390) ".." | 1995 | RANGE_EXPR@[3388; 3512) |
1967 | WHITESPACE@[3390; 3395) "\n " | 1996 | DOTDOT@[3388; 3390) ".." |
1968 | RANGE_EXPR@[3395; 3512) | 1997 | WHITESPACE@[3390; 3395) "\n " |
1969 | DOTDOTEQ@[3395; 3398) "..=" | 1998 | RANGE_EXPR@[3395; 3512) |
1970 | RANGE_EXPR@[3398; 3512) | 1999 | DOTDOTEQ@[3395; 3398) "..=" |
1971 | DOTDOT@[3398; 3400) ".." | 2000 | RANGE_EXPR@[3398; 3512) |
1972 | WHITESPACE@[3400; 3401) " " | 2001 | DOTDOT@[3398; 3400) ".." |
1973 | RANGE_EXPR@[3401; 3512) | 2002 | WHITESPACE@[3400; 3401) " " |
1974 | DOTDOTEQ@[3401; 3404) "..=" | 2003 | RANGE_EXPR@[3401; 3512) |
1975 | RANGE_EXPR@[3404; 3512) | 2004 | DOTDOTEQ@[3401; 3404) "..=" |
1976 | DOTDOT@[3404; 3406) ".." | 2005 | RANGE_EXPR@[3404; 3512) |
1977 | WHITESPACE@[3406; 3410) " " | 2006 | DOTDOT@[3404; 3406) ".." |
1978 | RANGE_EXPR@[3410; 3512) | 2007 | WHITESPACE@[3406; 3410) " " |
1979 | DOTDOTEQ@[3410; 3413) "..=" | 2008 | RANGE_EXPR@[3410; 3512) |
1980 | RANGE_EXPR@[3413; 3512) | 2009 | DOTDOTEQ@[3410; 3413) "..=" |
1981 | DOTDOT@[3413; 3415) ".." | 2010 | RANGE_EXPR@[3413; 3512) |
1982 | WHITESPACE@[3415; 3416) " " | 2011 | DOTDOT@[3413; 3415) ".." |
1983 | RANGE_EXPR@[3416; 3512) | 2012 | WHITESPACE@[3415; 3416) " " |
1984 | DOTDOTEQ@[3416; 3419) "..=" | 2013 | RANGE_EXPR@[3416; 3512) |
1985 | RANGE_EXPR@[3419; 3512) | 2014 | DOTDOTEQ@[3416; 3419) "..=" |
1986 | DOTDOT@[3419; 3421) ".." | 2015 | RANGE_EXPR@[3419; 3512) |
1987 | WHITESPACE@[3421; 3425) " " | 2016 | DOTDOT@[3419; 3421) ".." |
1988 | RANGE_EXPR@[3425; 3512) | 2017 | WHITESPACE@[3421; 3425) " " |
1989 | DOTDOT@[3425; 3427) ".." | 2018 | RANGE_EXPR@[3425; 3512) |
1990 | WHITESPACE@[3427; 3428) " " | 2019 | DOTDOT@[3425; 3427) ".." |
1991 | RANGE_EXPR@[3428; 3512) | 2020 | WHITESPACE@[3427; 3428) " " |
1992 | DOTDOT@[3428; 3430) ".." | 2021 | RANGE_EXPR@[3428; 3512) |
1993 | WHITESPACE@[3430; 3431) " " | 2022 | DOTDOT@[3428; 3430) ".." |
1994 | RANGE_EXPR@[3431; 3512) | 2023 | WHITESPACE@[3430; 3431) " " |
1995 | DOTDOTEQ@[3431; 3434) "..=" | 2024 | RANGE_EXPR@[3431; 3512) |
1996 | RANGE_EXPR@[3434; 3512) | 2025 | DOTDOTEQ@[3431; 3434) "..=" |
1997 | DOTDOT@[3434; 3436) ".." | 2026 | RANGE_EXPR@[3434; 3512) |
1998 | WHITESPACE@[3436; 3440) " " | 2027 | DOTDOT@[3434; 3436) ".." |
1999 | RANGE_EXPR@[3440; 3512) | 2028 | WHITESPACE@[3436; 3440) " " |
2000 | DOTDOT@[3440; 3442) ".." | 2029 | RANGE_EXPR@[3440; 3512) |
2001 | WHITESPACE@[3442; 3443) " " | 2030 | DOTDOT@[3440; 3442) ".." |
2002 | RANGE_EXPR@[3443; 3512) | 2031 | WHITESPACE@[3442; 3443) " " |
2003 | DOTDOTEQ@[3443; 3446) "..=" | 2032 | RANGE_EXPR@[3443; 3512) |
2004 | RANGE_EXPR@[3446; 3512) | 2033 | DOTDOTEQ@[3443; 3446) "..=" |
2005 | DOTDOT@[3446; 3448) ".." | 2034 | RANGE_EXPR@[3446; 3512) |
2006 | WHITESPACE@[3448; 3449) " " | 2035 | DOTDOT@[3446; 3448) ".." |
2007 | RANGE_EXPR@[3449; 3512) | 2036 | WHITESPACE@[3448; 3449) " " |
2008 | DOTDOT@[3449; 3451) ".." | 2037 | RANGE_EXPR@[3449; 3512) |
2009 | WHITESPACE@[3451; 3456) "\n " | 2038 | DOTDOT@[3449; 3451) ".." |
2010 | RANGE_EXPR@[3456; 3512) | 2039 | WHITESPACE@[3451; 3456) "\n " |
2011 | DOTDOTEQ@[3456; 3459) "..=" | 2040 | RANGE_EXPR@[3456; 3512) |
2012 | RANGE_EXPR@[3459; 3512) | 2041 | DOTDOTEQ@[3456; 3459) "..=" |
2013 | DOTDOT@[3459; 3461) ".." | 2042 | RANGE_EXPR@[3459; 3512) |
2014 | WHITESPACE@[3461; 3462) " " | 2043 | DOTDOT@[3459; 3461) ".." |
2015 | RANGE_EXPR@[3462; 3512) | 2044 | WHITESPACE@[3461; 3462) " " |
2016 | DOTDOTEQ@[3462; 3465) "..=" | 2045 | RANGE_EXPR@[3462; 3512) |
2017 | RANGE_EXPR@[3465; 3512) | 2046 | DOTDOTEQ@[3462; 3465) "..=" |
2018 | DOTDOT@[3465; 3467) ".." | 2047 | RANGE_EXPR@[3465; 3512) |
2019 | WHITESPACE@[3467; 3471) " " | 2048 | DOTDOT@[3465; 3467) ".." |
2020 | RANGE_EXPR@[3471; 3512) | 2049 | WHITESPACE@[3467; 3471) " " |
2021 | DOTDOT@[3471; 3473) ".." | 2050 | RANGE_EXPR@[3471; 3512) |
2022 | WHITESPACE@[3473; 3474) " " | 2051 | DOTDOT@[3471; 3473) ".." |
2023 | RANGE_EXPR@[3474; 3512) | 2052 | WHITESPACE@[3473; 3474) " " |
2024 | DOTDOTEQ@[3474; 3477) "..=" | 2053 | RANGE_EXPR@[3474; 3512) |
2025 | RANGE_EXPR@[3477; 3512) | 2054 | DOTDOTEQ@[3474; 3477) "..=" |
2026 | DOTDOTEQ@[3477; 3480) "..=" | 2055 | RANGE_EXPR@[3477; 3512) |
2027 | RANGE_EXPR@[3480; 3512) | 2056 | DOTDOTEQ@[3477; 3480) "..=" |
2028 | DOTDOT@[3480; 3482) ".." | 2057 | RANGE_EXPR@[3480; 3512) |
2029 | WHITESPACE@[3482; 3486) " " | 2058 | DOTDOT@[3480; 3482) ".." |
2030 | RANGE_EXPR@[3486; 3512) | 2059 | WHITESPACE@[3482; 3486) " " |
2031 | DOTDOTEQ@[3486; 3489) "..=" | 2060 | RANGE_EXPR@[3486; 3512) |
2032 | RANGE_EXPR@[3489; 3512) | 2061 | DOTDOTEQ@[3486; 3489) "..=" |
2033 | DOTDOTEQ@[3489; 3492) "..=" | 2062 | RANGE_EXPR@[3489; 3512) |
2034 | RANGE_EXPR@[3492; 3512) | 2063 | DOTDOTEQ@[3489; 3492) "..=" |
2035 | DOTDOT@[3492; 3494) ".." | 2064 | RANGE_EXPR@[3492; 3512) |
2036 | WHITESPACE@[3494; 3495) " " | 2065 | DOTDOT@[3492; 3494) ".." |
2037 | RANGE_EXPR@[3495; 3512) | 2066 | WHITESPACE@[3494; 3495) " " |
2038 | DOTDOT@[3495; 3497) ".." | 2067 | RANGE_EXPR@[3495; 3512) |
2039 | WHITESPACE@[3497; 3501) " " | 2068 | DOTDOT@[3495; 3497) ".." |
2040 | RANGE_EXPR@[3501; 3512) | 2069 | WHITESPACE@[3497; 3501) " " |
2041 | DOTDOT@[3501; 3503) ".." | 2070 | RANGE_EXPR@[3501; 3512) |
2042 | WHITESPACE@[3503; 3504) " " | 2071 | DOTDOT@[3501; 3503) ".." |
2043 | RANGE_EXPR@[3504; 3512) | 2072 | WHITESPACE@[3503; 3504) " " |
2044 | DOTDOTEQ@[3504; 3507) "..=" | 2073 | RANGE_EXPR@[3504; 3512) |
2045 | RANGE_EXPR@[3507; 3512) | 2074 | DOTDOTEQ@[3504; 3507) "..=" |
2046 | DOTDOT@[3507; 3509) ".." | 2075 | RANGE_EXPR@[3507; 3512) |
2047 | WHITESPACE@[3509; 3510) " " | 2076 | DOTDOT@[3507; 3509) ".." |
2048 | RANGE_EXPR@[3510; 3512) | 2077 | WHITESPACE@[3509; 3510) " " |
2049 | DOTDOT@[3510; 3512) ".." | 2078 | RANGE_EXPR@[3510; 3512) |
2050 | WHITESPACE@[3512; 3513) "\n" | 2079 | DOTDOT@[3510; 3512) ".." |
2051 | R_CURLY@[3513; 3514) "}" | 2080 | WHITESPACE@[3512; 3513) "\n" |
2081 | R_CURLY@[3513; 3514) "}" | ||
2052 | WHITESPACE@[3514; 3516) "\n\n" | 2082 | WHITESPACE@[3514; 3516) "\n\n" |
2053 | FN_DEF@[3516; 3552) | 2083 | FN_DEF@[3516; 3552) |
2054 | FN_KW@[3516; 3518) "fn" | 2084 | FN_KW@[3516; 3518) "fn" |
@@ -2059,30 +2089,31 @@ SOURCE_FILE@[0; 3813) | |||
2059 | L_PAREN@[3525; 3526) "(" | 2089 | L_PAREN@[3525; 3526) "(" |
2060 | R_PAREN@[3526; 3527) ")" | 2090 | R_PAREN@[3526; 3527) ")" |
2061 | WHITESPACE@[3527; 3528) " " | 2091 | WHITESPACE@[3527; 3528) " " |
2062 | BLOCK@[3528; 3552) | 2092 | BLOCK_EXPR@[3528; 3552) |
2063 | L_CURLY@[3528; 3529) "{" | 2093 | BLOCK@[3528; 3552) |
2064 | WHITESPACE@[3529; 3534) "\n " | 2094 | L_CURLY@[3528; 3529) "{" |
2065 | SEMI@[3534; 3535) ";" | 2095 | WHITESPACE@[3529; 3534) "\n " |
2066 | SEMI@[3535; 3536) ";" | 2096 | SEMI@[3534; 3535) ";" |
2067 | SEMI@[3536; 3537) ";" | 2097 | SEMI@[3535; 3536) ";" |
2068 | EXPR_STMT@[3537; 3540) | 2098 | SEMI@[3536; 3537) ";" |
2069 | TUPLE_EXPR@[3537; 3539) | 2099 | EXPR_STMT@[3537; 3540) |
2070 | L_PAREN@[3537; 3538) "(" | 2100 | TUPLE_EXPR@[3537; 3539) |
2071 | R_PAREN@[3538; 3539) ")" | 2101 | L_PAREN@[3537; 3538) "(" |
2072 | SEMI@[3539; 3540) ";" | 2102 | R_PAREN@[3538; 3539) ")" |
2073 | SEMI@[3540; 3541) ";" | 2103 | SEMI@[3539; 3540) ";" |
2074 | SEMI@[3541; 3542) ";" | 2104 | SEMI@[3540; 3541) ";" |
2075 | SEMI@[3542; 3543) ";" | 2105 | SEMI@[3541; 3542) ";" |
2076 | SEMI@[3543; 3544) ";" | 2106 | SEMI@[3542; 3543) ";" |
2077 | SEMI@[3544; 3545) ";" | 2107 | SEMI@[3543; 3544) ";" |
2078 | SEMI@[3545; 3546) ";" | 2108 | SEMI@[3544; 3545) ";" |
2079 | SEMI@[3546; 3547) ";" | 2109 | SEMI@[3545; 3546) ";" |
2080 | SEMI@[3547; 3548) ";" | 2110 | SEMI@[3546; 3547) ";" |
2081 | TUPLE_EXPR@[3548; 3550) | 2111 | SEMI@[3547; 3548) ";" |
2082 | L_PAREN@[3548; 3549) "(" | 2112 | TUPLE_EXPR@[3548; 3550) |
2083 | R_PAREN@[3549; 3550) ")" | 2113 | L_PAREN@[3548; 3549) "(" |
2084 | WHITESPACE@[3550; 3551) "\n" | 2114 | R_PAREN@[3549; 3550) ")" |
2085 | R_CURLY@[3551; 3552) "}" | 2115 | WHITESPACE@[3550; 3551) "\n" |
2116 | R_CURLY@[3551; 3552) "}" | ||
2086 | WHITESPACE@[3552; 3554) "\n\n" | 2117 | WHITESPACE@[3552; 3554) "\n\n" |
2087 | FN_DEF@[3554; 3812) | 2118 | FN_DEF@[3554; 3812) |
2088 | VISIBILITY@[3554; 3557) | 2119 | VISIBILITY@[3554; 3557) |
@@ -2096,190 +2127,191 @@ SOURCE_FILE@[0; 3813) | |||
2096 | L_PAREN@[3565; 3566) "(" | 2127 | L_PAREN@[3565; 3566) "(" |
2097 | R_PAREN@[3566; 3567) ")" | 2128 | R_PAREN@[3566; 3567) ")" |
2098 | WHITESPACE@[3567; 3568) " " | 2129 | WHITESPACE@[3567; 3568) " " |
2099 | BLOCK@[3568; 3812) | 2130 | BLOCK_EXPR@[3568; 3812) |
2100 | L_CURLY@[3568; 3569) "{" | 2131 | BLOCK@[3568; 3812) |
2101 | WHITESPACE@[3569; 3574) "\n " | 2132 | L_CURLY@[3568; 3569) "{" |
2102 | EXPR_STMT@[3574; 3584) | 2133 | WHITESPACE@[3569; 3574) "\n " |
2103 | CALL_EXPR@[3574; 3583) | 2134 | EXPR_STMT@[3574; 3584) |
2104 | PATH_EXPR@[3574; 3581) | 2135 | CALL_EXPR@[3574; 3583) |
2105 | PATH@[3574; 3581) | 2136 | PATH_EXPR@[3574; 3581) |
2106 | PATH_SEGMENT@[3574; 3581) | 2137 | PATH@[3574; 3581) |
2107 | NAME_REF@[3574; 3581) | 2138 | PATH_SEGMENT@[3574; 3581) |
2108 | IDENT@[3574; 3581) "strange" | 2139 | NAME_REF@[3574; 3581) |
2109 | ARG_LIST@[3581; 3583) | 2140 | IDENT@[3574; 3581) "strange" |
2110 | L_PAREN@[3581; 3582) "(" | 2141 | ARG_LIST@[3581; 3583) |
2111 | R_PAREN@[3582; 3583) ")" | 2142 | L_PAREN@[3581; 3582) "(" |
2112 | SEMI@[3583; 3584) ";" | 2143 | R_PAREN@[3582; 3583) ")" |
2113 | WHITESPACE@[3584; 3589) "\n " | 2144 | SEMI@[3583; 3584) ";" |
2114 | EXPR_STMT@[3589; 3597) | 2145 | WHITESPACE@[3584; 3589) "\n " |
2115 | CALL_EXPR@[3589; 3596) | 2146 | EXPR_STMT@[3589; 3597) |
2116 | PATH_EXPR@[3589; 3594) | 2147 | CALL_EXPR@[3589; 3596) |
2117 | PATH@[3589; 3594) | 2148 | PATH_EXPR@[3589; 3594) |
2118 | PATH_SEGMENT@[3589; 3594) | 2149 | PATH@[3589; 3594) |
2119 | NAME_REF@[3589; 3594) | 2150 | PATH_SEGMENT@[3589; 3594) |
2120 | IDENT@[3589; 3594) "funny" | 2151 | NAME_REF@[3589; 3594) |
2121 | ARG_LIST@[3594; 3596) | 2152 | IDENT@[3589; 3594) "funny" |
2122 | L_PAREN@[3594; 3595) "(" | 2153 | ARG_LIST@[3594; 3596) |
2123 | R_PAREN@[3595; 3596) ")" | 2154 | L_PAREN@[3594; 3595) "(" |
2124 | SEMI@[3596; 3597) ";" | 2155 | R_PAREN@[3595; 3596) ")" |
2125 | WHITESPACE@[3597; 3602) "\n " | 2156 | SEMI@[3596; 3597) ";" |
2126 | EXPR_STMT@[3602; 3609) | 2157 | WHITESPACE@[3597; 3602) "\n " |
2127 | CALL_EXPR@[3602; 3608) | 2158 | EXPR_STMT@[3602; 3609) |
2128 | PATH_EXPR@[3602; 3606) | 2159 | CALL_EXPR@[3602; 3608) |
2129 | PATH@[3602; 3606) | 2160 | PATH_EXPR@[3602; 3606) |
2130 | PATH_SEGMENT@[3602; 3606) | 2161 | PATH@[3602; 3606) |
2131 | NAME_REF@[3602; 3606) | 2162 | PATH_SEGMENT@[3602; 3606) |
2132 | IDENT@[3602; 3606) "what" | 2163 | NAME_REF@[3602; 3606) |
2133 | ARG_LIST@[3606; 3608) | 2164 | IDENT@[3602; 3606) "what" |
2134 | L_PAREN@[3606; 3607) "(" | 2165 | ARG_LIST@[3606; 3608) |
2135 | R_PAREN@[3607; 3608) ")" | 2166 | L_PAREN@[3606; 3607) "(" |
2136 | SEMI@[3608; 3609) ";" | 2167 | R_PAREN@[3607; 3608) ")" |
2137 | WHITESPACE@[3609; 3614) "\n " | 2168 | SEMI@[3608; 3609) ";" |
2138 | EXPR_STMT@[3614; 3628) | 2169 | WHITESPACE@[3609; 3614) "\n " |
2139 | CALL_EXPR@[3614; 3627) | 2170 | EXPR_STMT@[3614; 3628) |
2140 | PATH_EXPR@[3614; 3625) | 2171 | CALL_EXPR@[3614; 3627) |
2141 | PATH@[3614; 3625) | 2172 | PATH_EXPR@[3614; 3625) |
2142 | PATH_SEGMENT@[3614; 3625) | 2173 | PATH@[3614; 3625) |
2143 | NAME_REF@[3614; 3625) | 2174 | PATH_SEGMENT@[3614; 3625) |
2144 | IDENT@[3614; 3625) "zombiejesus" | 2175 | NAME_REF@[3614; 3625) |
2145 | ARG_LIST@[3625; 3627) | 2176 | IDENT@[3614; 3625) "zombiejesus" |
2146 | L_PAREN@[3625; 3626) "(" | 2177 | ARG_LIST@[3625; 3627) |
2147 | R_PAREN@[3626; 3627) ")" | 2178 | L_PAREN@[3625; 3626) "(" |
2148 | SEMI@[3627; 3628) ";" | 2179 | R_PAREN@[3626; 3627) ")" |
2149 | WHITESPACE@[3628; 3633) "\n " | 2180 | SEMI@[3627; 3628) ";" |
2150 | EXPR_STMT@[3633; 3643) | 2181 | WHITESPACE@[3628; 3633) "\n " |
2151 | CALL_EXPR@[3633; 3642) | 2182 | EXPR_STMT@[3633; 3643) |
2152 | PATH_EXPR@[3633; 3640) | 2183 | CALL_EXPR@[3633; 3642) |
2153 | PATH@[3633; 3640) | 2184 | PATH_EXPR@[3633; 3640) |
2154 | PATH_SEGMENT@[3633; 3640) | 2185 | PATH@[3633; 3640) |
2155 | NAME_REF@[3633; 3640) | 2186 | PATH_SEGMENT@[3633; 3640) |
2156 | IDENT@[3633; 3640) "notsure" | 2187 | NAME_REF@[3633; 3640) |
2157 | ARG_LIST@[3640; 3642) | 2188 | IDENT@[3633; 3640) "notsure" |
2158 | L_PAREN@[3640; 3641) "(" | 2189 | ARG_LIST@[3640; 3642) |
2159 | R_PAREN@[3641; 3642) ")" | 2190 | L_PAREN@[3640; 3641) "(" |
2160 | SEMI@[3642; 3643) ";" | 2191 | R_PAREN@[3641; 3642) ")" |
2161 | WHITESPACE@[3643; 3648) "\n " | 2192 | SEMI@[3642; 3643) ";" |
2162 | EXPR_STMT@[3648; 3664) | 2193 | WHITESPACE@[3643; 3648) "\n " |
2163 | CALL_EXPR@[3648; 3663) | 2194 | EXPR_STMT@[3648; 3664) |
2164 | PATH_EXPR@[3648; 3661) | 2195 | CALL_EXPR@[3648; 3663) |
2165 | PATH@[3648; 3661) | 2196 | PATH_EXPR@[3648; 3661) |
2166 | PATH_SEGMENT@[3648; 3661) | 2197 | PATH@[3648; 3661) |
2167 | NAME_REF@[3648; 3661) | 2198 | PATH_SEGMENT@[3648; 3661) |
2168 | IDENT@[3648; 3661) "canttouchthis" | 2199 | NAME_REF@[3648; 3661) |
2169 | ARG_LIST@[3661; 3663) | 2200 | IDENT@[3648; 3661) "canttouchthis" |
2170 | L_PAREN@[3661; 3662) "(" | 2201 | ARG_LIST@[3661; 3663) |
2171 | R_PAREN@[3662; 3663) ")" | 2202 | L_PAREN@[3661; 3662) "(" |
2172 | SEMI@[3663; 3664) ";" | 2203 | R_PAREN@[3662; 3663) ")" |
2173 | WHITESPACE@[3664; 3669) "\n " | 2204 | SEMI@[3663; 3664) ";" |
2174 | EXPR_STMT@[3669; 3681) | 2205 | WHITESPACE@[3664; 3669) "\n " |
2175 | CALL_EXPR@[3669; 3680) | 2206 | EXPR_STMT@[3669; 3681) |
2176 | PATH_EXPR@[3669; 3678) | 2207 | CALL_EXPR@[3669; 3680) |
2177 | PATH@[3669; 3678) | 2208 | PATH_EXPR@[3669; 3678) |
2178 | PATH_SEGMENT@[3669; 3678) | 2209 | PATH@[3669; 3678) |
2179 | NAME_REF@[3669; 3678) | 2210 | PATH_SEGMENT@[3669; 3678) |
2180 | IDENT@[3669; 3678) "angrydome" | 2211 | NAME_REF@[3669; 3678) |
2181 | ARG_LIST@[3678; 3680) | 2212 | IDENT@[3669; 3678) "angrydome" |
2182 | L_PAREN@[3678; 3679) "(" | 2213 | ARG_LIST@[3678; 3680) |
2183 | R_PAREN@[3679; 3680) ")" | 2214 | L_PAREN@[3678; 3679) "(" |
2184 | SEMI@[3680; 3681) ";" | 2215 | R_PAREN@[3679; 3680) ")" |
2185 | WHITESPACE@[3681; 3686) "\n " | 2216 | SEMI@[3680; 3681) ";" |
2186 | EXPR_STMT@[3686; 3701) | 2217 | WHITESPACE@[3681; 3686) "\n " |
2187 | CALL_EXPR@[3686; 3700) | 2218 | EXPR_STMT@[3686; 3701) |
2188 | PATH_EXPR@[3686; 3698) | 2219 | CALL_EXPR@[3686; 3700) |
2189 | PATH@[3686; 3698) | 2220 | PATH_EXPR@[3686; 3698) |
2190 | PATH_SEGMENT@[3686; 3698) | 2221 | PATH@[3686; 3698) |
2191 | NAME_REF@[3686; 3698) | 2222 | PATH_SEGMENT@[3686; 3698) |
2192 | IDENT@[3686; 3698) "evil_lincoln" | 2223 | NAME_REF@[3686; 3698) |
2193 | ARG_LIST@[3698; 3700) | 2224 | IDENT@[3686; 3698) "evil_lincoln" |
2194 | L_PAREN@[3698; 3699) "(" | 2225 | ARG_LIST@[3698; 3700) |
2195 | R_PAREN@[3699; 3700) ")" | 2226 | L_PAREN@[3698; 3699) "(" |
2196 | SEMI@[3700; 3701) ";" | 2227 | R_PAREN@[3699; 3700) ")" |
2197 | WHITESPACE@[3701; 3706) "\n " | 2228 | SEMI@[3700; 3701) ";" |
2198 | EXPR_STMT@[3706; 3713) | 2229 | WHITESPACE@[3701; 3706) "\n " |
2199 | CALL_EXPR@[3706; 3712) | 2230 | EXPR_STMT@[3706; 3713) |
2200 | PATH_EXPR@[3706; 3710) | 2231 | CALL_EXPR@[3706; 3712) |
2201 | PATH@[3706; 3710) | 2232 | PATH_EXPR@[3706; 3710) |
2202 | PATH_SEGMENT@[3706; 3710) | 2233 | PATH@[3706; 3710) |
2203 | NAME_REF@[3706; 3710) | 2234 | PATH_SEGMENT@[3706; 3710) |
2204 | IDENT@[3706; 3710) "dots" | 2235 | NAME_REF@[3706; 3710) |
2205 | ARG_LIST@[3710; 3712) | 2236 | IDENT@[3706; 3710) "dots" |
2206 | L_PAREN@[3710; 3711) "(" | 2237 | ARG_LIST@[3710; 3712) |
2207 | R_PAREN@[3711; 3712) ")" | 2238 | L_PAREN@[3710; 3711) "(" |
2208 | SEMI@[3712; 3713) ";" | 2239 | R_PAREN@[3711; 3712) ")" |
2209 | WHITESPACE@[3713; 3718) "\n " | 2240 | SEMI@[3712; 3713) ";" |
2210 | EXPR_STMT@[3718; 3726) | 2241 | WHITESPACE@[3713; 3718) "\n " |
2211 | CALL_EXPR@[3718; 3725) | 2242 | EXPR_STMT@[3718; 3726) |
2212 | PATH_EXPR@[3718; 3720) | 2243 | CALL_EXPR@[3718; 3725) |
2213 | PATH@[3718; 3720) | 2244 | PATH_EXPR@[3718; 3720) |
2214 | PATH_SEGMENT@[3718; 3720) | 2245 | PATH@[3718; 3720) |
2215 | NAME_REF@[3718; 3720) | 2246 | PATH_SEGMENT@[3718; 3720) |
2216 | IDENT@[3718; 3720) "u8" | 2247 | NAME_REF@[3718; 3720) |
2217 | ARG_LIST@[3720; 3725) | 2248 | IDENT@[3718; 3720) "u8" |
2218 | L_PAREN@[3720; 3721) "(" | 2249 | ARG_LIST@[3720; 3725) |
2219 | LITERAL@[3721; 3724) | 2250 | L_PAREN@[3720; 3721) "(" |
2220 | INT_NUMBER@[3721; 3724) "8u8" | 2251 | LITERAL@[3721; 3724) |
2221 | R_PAREN@[3724; 3725) ")" | 2252 | INT_NUMBER@[3721; 3724) "8u8" |
2222 | SEMI@[3725; 3726) ";" | 2253 | R_PAREN@[3724; 3725) ")" |
2223 | WHITESPACE@[3726; 3731) "\n " | 2254 | SEMI@[3725; 3726) ";" |
2224 | EXPR_STMT@[3731; 3739) | 2255 | WHITESPACE@[3726; 3731) "\n " |
2225 | CALL_EXPR@[3731; 3738) | 2256 | EXPR_STMT@[3731; 3739) |
2226 | PATH_EXPR@[3731; 3736) | 2257 | CALL_EXPR@[3731; 3738) |
2227 | PATH@[3731; 3736) | 2258 | PATH_EXPR@[3731; 3736) |
2228 | PATH_SEGMENT@[3731; 3736) | 2259 | PATH@[3731; 3736) |
2229 | NAME_REF@[3731; 3736) | 2260 | PATH_SEGMENT@[3731; 3736) |
2230 | IDENT@[3731; 3736) "fishy" | 2261 | NAME_REF@[3731; 3736) |
2231 | ARG_LIST@[3736; 3738) | 2262 | IDENT@[3731; 3736) "fishy" |
2232 | L_PAREN@[3736; 3737) "(" | 2263 | ARG_LIST@[3736; 3738) |
2233 | R_PAREN@[3737; 3738) ")" | 2264 | L_PAREN@[3736; 3737) "(" |
2234 | SEMI@[3738; 3739) ";" | 2265 | R_PAREN@[3737; 3738) ")" |
2235 | WHITESPACE@[3739; 3744) "\n " | 2266 | SEMI@[3738; 3739) ";" |
2236 | EXPR_STMT@[3744; 3752) | 2267 | WHITESPACE@[3739; 3744) "\n " |
2237 | CALL_EXPR@[3744; 3751) | 2268 | EXPR_STMT@[3744; 3752) |
2238 | PATH_EXPR@[3744; 3749) | 2269 | CALL_EXPR@[3744; 3751) |
2239 | PATH@[3744; 3749) | 2270 | PATH_EXPR@[3744; 3749) |
2240 | PATH_SEGMENT@[3744; 3749) | 2271 | PATH@[3744; 3749) |
2241 | NAME_REF@[3744; 3749) | 2272 | PATH_SEGMENT@[3744; 3749) |
2242 | IDENT@[3744; 3749) "union" | 2273 | NAME_REF@[3744; 3749) |
2243 | ARG_LIST@[3749; 3751) | 2274 | IDENT@[3744; 3749) "union" |
2244 | L_PAREN@[3749; 3750) "(" | 2275 | ARG_LIST@[3749; 3751) |
2245 | R_PAREN@[3750; 3751) ")" | 2276 | L_PAREN@[3749; 3750) "(" |
2246 | SEMI@[3751; 3752) ";" | 2277 | R_PAREN@[3750; 3751) ")" |
2247 | WHITESPACE@[3752; 3757) "\n " | 2278 | SEMI@[3751; 3752) ";" |
2248 | EXPR_STMT@[3757; 3778) | 2279 | WHITESPACE@[3752; 3757) "\n " |
2249 | CALL_EXPR@[3757; 3777) | 2280 | EXPR_STMT@[3757; 3778) |
2250 | PATH_EXPR@[3757; 3775) | 2281 | CALL_EXPR@[3757; 3777) |
2251 | PATH@[3757; 3775) | 2282 | PATH_EXPR@[3757; 3775) |
2252 | PATH_SEGMENT@[3757; 3775) | 2283 | PATH@[3757; 3775) |
2253 | NAME_REF@[3757; 3775) | 2284 | PATH_SEGMENT@[3757; 3775) |
2254 | IDENT@[3757; 3775) "special_characters" | 2285 | NAME_REF@[3757; 3775) |
2255 | ARG_LIST@[3775; 3777) | 2286 | IDENT@[3757; 3775) "special_characters" |
2256 | L_PAREN@[3775; 3776) "(" | 2287 | ARG_LIST@[3775; 3777) |
2257 | R_PAREN@[3776; 3777) ")" | 2288 | L_PAREN@[3775; 3776) "(" |
2258 | SEMI@[3777; 3778) ";" | 2289 | R_PAREN@[3776; 3777) ")" |
2259 | WHITESPACE@[3778; 3783) "\n " | 2290 | SEMI@[3777; 3778) ";" |
2260 | EXPR_STMT@[3783; 3796) | 2291 | WHITESPACE@[3778; 3783) "\n " |
2261 | CALL_EXPR@[3783; 3795) | 2292 | EXPR_STMT@[3783; 3796) |
2262 | PATH_EXPR@[3783; 3793) | 2293 | CALL_EXPR@[3783; 3795) |
2263 | PATH@[3783; 3793) | 2294 | PATH_EXPR@[3783; 3793) |
2264 | PATH_SEGMENT@[3783; 3793) | 2295 | PATH@[3783; 3793) |
2265 | NAME_REF@[3783; 3793) | 2296 | PATH_SEGMENT@[3783; 3793) |
2266 | IDENT@[3783; 3793) "punch_card" | 2297 | NAME_REF@[3783; 3793) |
2267 | ARG_LIST@[3793; 3795) | 2298 | IDENT@[3783; 3793) "punch_card" |
2268 | L_PAREN@[3793; 3794) "(" | 2299 | ARG_LIST@[3793; 3795) |
2269 | R_PAREN@[3794; 3795) ")" | 2300 | L_PAREN@[3793; 3794) "(" |
2270 | SEMI@[3795; 3796) ";" | 2301 | R_PAREN@[3794; 3795) ")" |
2271 | WHITESPACE@[3796; 3801) "\n " | 2302 | SEMI@[3795; 3796) ";" |
2272 | EXPR_STMT@[3801; 3810) | 2303 | WHITESPACE@[3796; 3801) "\n " |
2273 | CALL_EXPR@[3801; 3809) | 2304 | EXPR_STMT@[3801; 3810) |
2274 | PATH_EXPR@[3801; 3807) | 2305 | CALL_EXPR@[3801; 3809) |
2275 | PATH@[3801; 3807) | 2306 | PATH_EXPR@[3801; 3807) |
2276 | PATH_SEGMENT@[3801; 3807) | 2307 | PATH@[3801; 3807) |
2277 | NAME_REF@[3801; 3807) | 2308 | PATH_SEGMENT@[3801; 3807) |
2278 | IDENT@[3801; 3807) "ktulhu" | 2309 | NAME_REF@[3801; 3807) |
2279 | ARG_LIST@[3807; 3809) | 2310 | IDENT@[3801; 3807) "ktulhu" |
2280 | L_PAREN@[3807; 3808) "(" | 2311 | ARG_LIST@[3807; 3809) |
2281 | R_PAREN@[3808; 3809) ")" | 2312 | L_PAREN@[3807; 3808) "(" |
2282 | SEMI@[3809; 3810) ";" | 2313 | R_PAREN@[3808; 3809) ")" |
2283 | WHITESPACE@[3810; 3811) "\n" | 2314 | SEMI@[3809; 3810) ";" |
2284 | R_CURLY@[3811; 3812) "}" | 2315 | WHITESPACE@[3810; 3811) "\n" |
2316 | R_CURLY@[3811; 3812) "}" | ||
2285 | WHITESPACE@[3812; 3813) "\n" | 2317 | WHITESPACE@[3812; 3813) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.txt b/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.txt index 86263c0bb..ac5444087 100644 --- a/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.txt +++ b/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.txt | |||
@@ -75,18 +75,19 @@ SOURCE_FILE@[0; 157) | |||
75 | IDENT@[131; 133) "Eq" | 75 | IDENT@[131; 133) "Eq" |
76 | COMMA@[133; 134) "," | 76 | COMMA@[133; 134) "," |
77 | WHITESPACE@[134; 135) "\n" | 77 | WHITESPACE@[134; 135) "\n" |
78 | BLOCK@[135; 156) | 78 | BLOCK_EXPR@[135; 156) |
79 | L_CURLY@[135; 136) "{" | 79 | BLOCK@[135; 156) |
80 | WHITESPACE@[136; 141) "\n " | 80 | L_CURLY@[135; 136) "{" |
81 | METHOD_CALL_EXPR@[141; 154) | 81 | WHITESPACE@[136; 141) "\n " |
82 | LITERAL@[141; 143) | 82 | METHOD_CALL_EXPR@[141; 154) |
83 | STRING@[141; 143) "\"\"" | 83 | LITERAL@[141; 143) |
84 | DOT@[143; 144) "." | 84 | STRING@[141; 143) "\"\"" |
85 | NAME_REF@[144; 152) | 85 | DOT@[143; 144) "." |
86 | IDENT@[144; 152) "to_owned" | 86 | NAME_REF@[144; 152) |
87 | ARG_LIST@[152; 154) | 87 | IDENT@[144; 152) "to_owned" |
88 | L_PAREN@[152; 153) "(" | 88 | ARG_LIST@[152; 154) |
89 | R_PAREN@[153; 154) ")" | 89 | L_PAREN@[152; 153) "(" |
90 | WHITESPACE@[154; 155) "\n" | 90 | R_PAREN@[153; 154) ")" |
91 | R_CURLY@[155; 156) "}" | 91 | WHITESPACE@[154; 155) "\n" |
92 | R_CURLY@[155; 156) "}" | ||
92 | WHITESPACE@[156; 157) "\n" | 93 | WHITESPACE@[156; 157) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.txt b/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.txt index 7a5507473..377367914 100644 --- a/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.txt +++ b/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.txt | |||
@@ -37,6 +37,7 @@ SOURCE_FILE@[0; 34) | |||
37 | NAME_REF@[28; 31) | 37 | NAME_REF@[28; 31) |
38 | IDENT@[28; 31) "Foo" | 38 | IDENT@[28; 31) "Foo" |
39 | WHITESPACE@[31; 32) " " | 39 | WHITESPACE@[31; 32) " " |
40 | BLOCK@[32; 34) | 40 | BLOCK_EXPR@[32; 34) |
41 | L_CURLY@[32; 33) "{" | 41 | BLOCK@[32; 34) |
42 | R_CURLY@[33; 34) "}" | 42 | L_CURLY@[32; 33) "{" |
43 | R_CURLY@[33; 34) "}" | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.txt b/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.txt index 69fac87e3..9936892e9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.txt +++ b/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.txt | |||
@@ -8,8 +8,9 @@ SOURCE_FILE@[0; 15) | |||
8 | L_PAREN@[8; 9) "(" | 8 | L_PAREN@[8; 9) "(" |
9 | R_PAREN@[9; 10) ")" | 9 | R_PAREN@[9; 10) ")" |
10 | WHITESPACE@[10; 11) " " | 10 | WHITESPACE@[10; 11) " " |
11 | BLOCK@[11; 14) | 11 | BLOCK_EXPR@[11; 14) |
12 | L_CURLY@[11; 12) "{" | 12 | BLOCK@[11; 14) |
13 | WHITESPACE@[12; 13) "\n" | 13 | L_CURLY@[11; 12) "{" |
14 | R_CURLY@[13; 14) "}" | 14 | WHITESPACE@[12; 13) "\n" |
15 | R_CURLY@[13; 14) "}" | ||
15 | WHITESPACE@[14; 15) "\n" | 16 | WHITESPACE@[14; 15) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.txt b/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.txt index 554b52f85..64c70e196 100644 --- a/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.txt +++ b/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.txt | |||
@@ -8,42 +8,43 @@ SOURCE_FILE@[0; 59) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 59) | 11 | BLOCK_EXPR@[9; 59) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 59) |
13 | WHITESPACE@[10; 11) " " | 13 | L_CURLY@[9; 10) "{" |
14 | LET_STMT@[11; 29) | 14 | WHITESPACE@[10; 11) " " |
15 | LET_KW@[11; 14) "let" | 15 | LET_STMT@[11; 29) |
16 | WHITESPACE@[14; 15) " " | 16 | LET_KW@[11; 14) "let" |
17 | BIND_PAT@[15; 23) | 17 | WHITESPACE@[14; 15) " " |
18 | NAME@[15; 23) | 18 | BIND_PAT@[15; 23) |
19 | IDENT@[15; 23) "r#struct" | 19 | NAME@[15; 23) |
20 | WHITESPACE@[23; 24) " " | 20 | IDENT@[15; 23) "r#struct" |
21 | EQ@[24; 25) "=" | 21 | WHITESPACE@[23; 24) " " |
22 | WHITESPACE@[25; 26) " " | 22 | EQ@[24; 25) "=" |
23 | LITERAL@[26; 28) | 23 | WHITESPACE@[25; 26) " " |
24 | INT_NUMBER@[26; 28) "92" | 24 | LITERAL@[26; 28) |
25 | SEMI@[28; 29) ";" | 25 | INT_NUMBER@[26; 28) "92" |
26 | WHITESPACE@[29; 30) " " | 26 | SEMI@[28; 29) ";" |
27 | LET_STMT@[30; 57) | 27 | WHITESPACE@[29; 30) " " |
28 | LET_KW@[30; 33) "let" | 28 | LET_STMT@[30; 57) |
29 | WHITESPACE@[33; 34) " " | 29 | LET_KW@[30; 33) "let" |
30 | BIND_PAT@[34; 41) | 30 | WHITESPACE@[33; 34) " " |
31 | NAME@[34; 41) | 31 | BIND_PAT@[34; 41) |
32 | IDENT@[34; 41) "r#trait" | 32 | NAME@[34; 41) |
33 | WHITESPACE@[41; 42) " " | 33 | IDENT@[34; 41) "r#trait" |
34 | EQ@[42; 43) "=" | 34 | WHITESPACE@[41; 42) " " |
35 | WHITESPACE@[43; 44) " " | 35 | EQ@[42; 43) "=" |
36 | BIN_EXPR@[44; 56) | 36 | WHITESPACE@[43; 44) " " |
37 | PATH_EXPR@[44; 52) | 37 | BIN_EXPR@[44; 56) |
38 | PATH@[44; 52) | 38 | PATH_EXPR@[44; 52) |
39 | PATH_SEGMENT@[44; 52) | 39 | PATH@[44; 52) |
40 | NAME_REF@[44; 52) | 40 | PATH_SEGMENT@[44; 52) |
41 | IDENT@[44; 52) "r#struct" | 41 | NAME_REF@[44; 52) |
42 | WHITESPACE@[52; 53) " " | 42 | IDENT@[44; 52) "r#struct" |
43 | STAR@[53; 54) "*" | 43 | WHITESPACE@[52; 53) " " |
44 | WHITESPACE@[54; 55) " " | 44 | STAR@[53; 54) "*" |
45 | LITERAL@[55; 56) | 45 | WHITESPACE@[54; 55) " " |
46 | INT_NUMBER@[55; 56) "2" | 46 | LITERAL@[55; 56) |
47 | SEMI@[56; 57) ";" | 47 | INT_NUMBER@[55; 56) "2" |
48 | WHITESPACE@[57; 58) " " | 48 | SEMI@[56; 57) ";" |
49 | R_CURLY@[58; 59) "}" | 49 | WHITESPACE@[57; 58) " " |
50 | R_CURLY@[58; 59) "}" | ||
diff --git a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.txt b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.txt index 19951011e..72f053dfc 100644 --- a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.txt +++ b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.txt | |||
@@ -38,20 +38,21 @@ SOURCE_FILE@[0; 199) | |||
38 | NAME_REF@[102; 106) | 38 | NAME_REF@[102; 106) |
39 | IDENT@[102; 106) "bool" | 39 | IDENT@[102; 106) "bool" |
40 | WHITESPACE@[106; 107) " " | 40 | WHITESPACE@[106; 107) " " |
41 | BLOCK@[107; 139) | 41 | BLOCK_EXPR@[107; 139) |
42 | L_CURLY@[107; 108) "{" | 42 | BLOCK@[107; 139) |
43 | WHITESPACE@[108; 117) "\n " | 43 | L_CURLY@[107; 108) "{" |
44 | MACRO_CALL@[117; 133) | 44 | WHITESPACE@[108; 117) "\n " |
45 | PATH@[117; 130) | 45 | MACRO_CALL@[117; 133) |
46 | PATH_SEGMENT@[117; 130) | 46 | PATH@[117; 130) |
47 | NAME_REF@[117; 130) | 47 | PATH_SEGMENT@[117; 130) |
48 | IDENT@[117; 130) "unimplemented" | 48 | NAME_REF@[117; 130) |
49 | EXCL@[130; 131) "!" | 49 | IDENT@[117; 130) "unimplemented" |
50 | TOKEN_TREE@[131; 133) | 50 | EXCL@[130; 131) "!" |
51 | L_PAREN@[131; 132) "(" | 51 | TOKEN_TREE@[131; 133) |
52 | R_PAREN@[132; 133) ")" | 52 | L_PAREN@[131; 132) "(" |
53 | WHITESPACE@[133; 138) "\n " | 53 | R_PAREN@[132; 133) ")" |
54 | R_CURLY@[138; 139) "}" | 54 | WHITESPACE@[133; 138) "\n " |
55 | R_CURLY@[138; 139) "}" | ||
55 | WHITESPACE@[139; 140) "\n" | 56 | WHITESPACE@[139; 140) "\n" |
56 | R_CURLY@[140; 141) "}" | 57 | R_CURLY@[140; 141) "}" |
57 | WHITESPACE@[141; 143) "\n\n" | 58 | WHITESPACE@[141; 143) "\n\n" |
@@ -74,9 +75,10 @@ SOURCE_FILE@[0; 199) | |||
74 | IDENT@[153; 157) "bool" | 75 | IDENT@[153; 157) "bool" |
75 | R_PAREN@[157; 158) ")" | 76 | R_PAREN@[157; 158) ")" |
76 | WHITESPACE@[158; 159) " " | 77 | WHITESPACE@[158; 159) " " |
77 | BLOCK@[159; 161) | 78 | BLOCK_EXPR@[159; 161) |
78 | L_CURLY@[159; 160) "{" | 79 | BLOCK@[159; 161) |
79 | R_CURLY@[160; 161) "}" | 80 | L_CURLY@[159; 160) "{" |
81 | R_CURLY@[160; 161) "}" | ||
80 | WHITESPACE@[161; 163) "\n\n" | 82 | WHITESPACE@[161; 163) "\n\n" |
81 | FN_DEF@[163; 198) | 83 | FN_DEF@[163; 198) |
82 | FN_KW@[163; 165) "fn" | 84 | FN_KW@[163; 165) "fn" |
@@ -87,37 +89,38 @@ SOURCE_FILE@[0; 199) | |||
87 | L_PAREN@[170; 171) "(" | 89 | L_PAREN@[170; 171) "(" |
88 | R_PAREN@[171; 172) ")" | 90 | R_PAREN@[171; 172) ")" |
89 | WHITESPACE@[172; 173) " " | 91 | WHITESPACE@[172; 173) " " |
90 | BLOCK@[173; 198) | 92 | BLOCK_EXPR@[173; 198) |
91 | L_CURLY@[173; 174) "{" | 93 | BLOCK@[173; 198) |
92 | WHITESPACE@[174; 179) "\n " | 94 | L_CURLY@[173; 174) "{" |
93 | CALL_EXPR@[179; 196) | 95 | WHITESPACE@[174; 179) "\n " |
94 | PATH_EXPR@[179; 182) | 96 | CALL_EXPR@[179; 196) |
95 | PATH@[179; 182) | 97 | PATH_EXPR@[179; 182) |
96 | PATH_SEGMENT@[179; 182) | 98 | PATH@[179; 182) |
97 | NAME_REF@[179; 182) | 99 | PATH_SEGMENT@[179; 182) |
98 | IDENT@[179; 182) "baz" | 100 | NAME_REF@[179; 182) |
99 | ARG_LIST@[182; 196) | 101 | IDENT@[179; 182) "baz" |
100 | L_PAREN@[182; 183) "(" | 102 | ARG_LIST@[182; 196) |
101 | CALL_EXPR@[183; 195) | 103 | L_PAREN@[182; 183) "(" |
102 | PATH_EXPR@[183; 193) | 104 | CALL_EXPR@[183; 195) |
103 | PATH@[183; 193) | 105 | PATH_EXPR@[183; 193) |
104 | PATH@[183; 188) | 106 | PATH@[183; 193) |
105 | PATH_SEGMENT@[183; 188) | 107 | PATH@[183; 188) |
106 | L_ANGLE@[183; 184) "<" | 108 | PATH_SEGMENT@[183; 188) |
107 | PATH_TYPE@[184; 187) | 109 | L_ANGLE@[183; 184) "<" |
108 | PATH@[184; 187) | 110 | PATH_TYPE@[184; 187) |
109 | PATH_SEGMENT@[184; 187) | 111 | PATH@[184; 187) |
110 | NAME_REF@[184; 187) | 112 | PATH_SEGMENT@[184; 187) |
111 | IDENT@[184; 187) "Foo" | 113 | NAME_REF@[184; 187) |
112 | R_ANGLE@[187; 188) ">" | 114 | IDENT@[184; 187) "Foo" |
113 | COLONCOLON@[188; 190) "::" | 115 | R_ANGLE@[187; 188) ">" |
114 | PATH_SEGMENT@[190; 193) | 116 | COLONCOLON@[188; 190) "::" |
115 | NAME_REF@[190; 193) | 117 | PATH_SEGMENT@[190; 193) |
116 | IDENT@[190; 193) "bar" | 118 | NAME_REF@[190; 193) |
117 | ARG_LIST@[193; 195) | 119 | IDENT@[190; 193) "bar" |
118 | L_PAREN@[193; 194) "(" | 120 | ARG_LIST@[193; 195) |
119 | R_PAREN@[194; 195) ")" | 121 | L_PAREN@[193; 194) "(" |
120 | R_PAREN@[195; 196) ")" | 122 | R_PAREN@[194; 195) ")" |
121 | WHITESPACE@[196; 197) "\n" | 123 | R_PAREN@[195; 196) ")" |
122 | R_CURLY@[197; 198) "}" | 124 | WHITESPACE@[196; 197) "\n" |
125 | R_CURLY@[197; 198) "}" | ||
123 | WHITESPACE@[198; 199) "\n" | 126 | WHITESPACE@[198; 199) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.txt b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.txt index 1f2456afa..c5821afd0 100644 --- a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.txt +++ b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.txt | |||
@@ -39,71 +39,72 @@ SOURCE_FILE@[0; 160) | |||
39 | L_PAREN@[98; 99) "(" | 39 | L_PAREN@[98; 99) "(" |
40 | R_PAREN@[99; 100) ")" | 40 | R_PAREN@[99; 100) ")" |
41 | WHITESPACE@[100; 101) " " | 41 | WHITESPACE@[100; 101) " " |
42 | BLOCK@[101; 159) | 42 | BLOCK_EXPR@[101; 159) |
43 | L_CURLY@[101; 102) "{" | 43 | BLOCK@[101; 159) |
44 | WHITESPACE@[102; 107) "\n " | 44 | L_CURLY@[101; 102) "{" |
45 | EXPR_STMT@[107; 136) | 45 | WHITESPACE@[102; 107) "\n " |
46 | BIN_EXPR@[107; 135) | 46 | EXPR_STMT@[107; 136) |
47 | INDEX_EXPR@[107; 131) | 47 | BIN_EXPR@[107; 135) |
48 | FIELD_EXPR@[107; 128) | 48 | INDEX_EXPR@[107; 131) |
49 | RECORD_LIT@[107; 124) | 49 | FIELD_EXPR@[107; 128) |
50 | PATH@[107; 111) | 50 | RECORD_LIT@[107; 124) |
51 | PATH_SEGMENT@[107; 111) | 51 | PATH@[107; 111) |
52 | NAME_REF@[107; 111) | 52 | PATH_SEGMENT@[107; 111) |
53 | IDENT@[107; 111) "Repr" | 53 | NAME_REF@[107; 111) |
54 | WHITESPACE@[111; 112) " " | 54 | IDENT@[107; 111) "Repr" |
55 | RECORD_FIELD_LIST@[112; 124) | 55 | WHITESPACE@[111; 112) " " |
56 | L_CURLY@[112; 113) "{" | 56 | RECORD_FIELD_LIST@[112; 124) |
57 | WHITESPACE@[113; 114) " " | 57 | L_CURLY@[112; 113) "{" |
58 | RECORD_FIELD@[114; 122) | 58 | WHITESPACE@[113; 114) " " |
59 | NAME_REF@[114; 117) | 59 | RECORD_FIELD@[114; 122) |
60 | IDENT@[114; 117) "raw" | 60 | NAME_REF@[114; 117) |
61 | COLON@[117; 118) ":" | 61 | IDENT@[114; 117) "raw" |
62 | WHITESPACE@[118; 119) " " | 62 | COLON@[117; 118) ":" |
63 | ARRAY_EXPR@[119; 122) | 63 | WHITESPACE@[118; 119) " " |
64 | L_BRACK@[119; 120) "[" | 64 | ARRAY_EXPR@[119; 122) |
65 | LITERAL@[120; 121) | 65 | L_BRACK@[119; 120) "[" |
66 | INT_NUMBER@[120; 121) "0" | 66 | LITERAL@[120; 121) |
67 | R_BRACK@[121; 122) "]" | 67 | INT_NUMBER@[120; 121) "0" |
68 | WHITESPACE@[122; 123) " " | 68 | R_BRACK@[121; 122) "]" |
69 | R_CURLY@[123; 124) "}" | 69 | WHITESPACE@[122; 123) " " |
70 | DOT@[124; 125) "." | 70 | R_CURLY@[123; 124) "}" |
71 | NAME_REF@[125; 128) | 71 | DOT@[124; 125) "." |
72 | IDENT@[125; 128) "raw" | 72 | NAME_REF@[125; 128) |
73 | L_BRACK@[128; 129) "[" | 73 | IDENT@[125; 128) "raw" |
74 | LITERAL@[129; 130) | 74 | L_BRACK@[128; 129) "[" |
75 | INT_NUMBER@[129; 130) "0" | 75 | LITERAL@[129; 130) |
76 | R_BRACK@[130; 131) "]" | 76 | INT_NUMBER@[129; 130) "0" |
77 | WHITESPACE@[131; 132) " " | 77 | R_BRACK@[130; 131) "]" |
78 | EQ@[132; 133) "=" | 78 | WHITESPACE@[131; 132) " " |
79 | WHITESPACE@[133; 134) " " | 79 | EQ@[132; 133) "=" |
80 | LITERAL@[134; 135) | 80 | WHITESPACE@[133; 134) " " |
81 | INT_NUMBER@[134; 135) "0" | 81 | LITERAL@[134; 135) |
82 | SEMI@[135; 136) ";" | 82 | INT_NUMBER@[134; 135) "0" |
83 | WHITESPACE@[136; 141) "\n " | 83 | SEMI@[135; 136) ";" |
84 | EXPR_STMT@[141; 157) | 84 | WHITESPACE@[136; 141) "\n " |
85 | CALL_EXPR@[141; 156) | 85 | EXPR_STMT@[141; 157) |
86 | RECORD_LIT@[141; 154) | 86 | CALL_EXPR@[141; 156) |
87 | PATH@[141; 145) | 87 | RECORD_LIT@[141; 154) |
88 | PATH_SEGMENT@[141; 145) | 88 | PATH@[141; 145) |
89 | NAME_REF@[141; 145) | 89 | PATH_SEGMENT@[141; 145) |
90 | IDENT@[141; 145) "Repr" | 90 | NAME_REF@[141; 145) |
91 | RECORD_FIELD_LIST@[145; 154) | 91 | IDENT@[141; 145) "Repr" |
92 | L_CURLY@[145; 146) "{" | 92 | RECORD_FIELD_LIST@[145; 154) |
93 | RECORD_FIELD@[146; 153) | 93 | L_CURLY@[145; 146) "{" |
94 | NAME_REF@[146; 149) | 94 | RECORD_FIELD@[146; 153) |
95 | IDENT@[146; 149) "raw" | 95 | NAME_REF@[146; 149) |
96 | COLON@[149; 150) ":" | 96 | IDENT@[146; 149) "raw" |
97 | ARRAY_EXPR@[150; 153) | 97 | COLON@[149; 150) ":" |
98 | L_BRACK@[150; 151) "[" | 98 | ARRAY_EXPR@[150; 153) |
99 | LITERAL@[151; 152) | 99 | L_BRACK@[150; 151) "[" |
100 | INT_NUMBER@[151; 152) "0" | 100 | LITERAL@[151; 152) |
101 | R_BRACK@[152; 153) "]" | 101 | INT_NUMBER@[151; 152) "0" |
102 | R_CURLY@[153; 154) "}" | 102 | R_BRACK@[152; 153) "]" |
103 | ARG_LIST@[154; 156) | 103 | R_CURLY@[153; 154) "}" |
104 | L_PAREN@[154; 155) "(" | 104 | ARG_LIST@[154; 156) |
105 | R_PAREN@[155; 156) ")" | 105 | L_PAREN@[154; 155) "(" |
106 | SEMI@[156; 157) ";" | 106 | R_PAREN@[155; 156) ")" |
107 | WHITESPACE@[157; 158) "\n" | 107 | SEMI@[156; 157) ";" |
108 | R_CURLY@[158; 159) "}" | 108 | WHITESPACE@[157; 158) "\n" |
109 | R_CURLY@[158; 159) "}" | ||
109 | WHITESPACE@[159; 160) "\n" | 110 | WHITESPACE@[159; 160) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.txt b/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.txt index b928adaad..7dabe535f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.txt +++ b/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.txt | |||
@@ -10,64 +10,65 @@ SOURCE_FILE@[0; 166) | |||
10 | L_PAREN@[68; 69) "(" | 10 | L_PAREN@[68; 69) "(" |
11 | R_PAREN@[69; 70) ")" | 11 | R_PAREN@[69; 70) ")" |
12 | WHITESPACE@[70; 71) " " | 12 | WHITESPACE@[70; 71) " " |
13 | BLOCK@[71; 165) | 13 | BLOCK_EXPR@[71; 165) |
14 | L_CURLY@[71; 72) "{" | 14 | BLOCK@[71; 165) |
15 | WHITESPACE@[72; 77) "\n " | 15 | L_CURLY@[71; 72) "{" |
16 | LET_STMT@[77; 163) | 16 | WHITESPACE@[72; 77) "\n " |
17 | ATTR@[77; 106) | 17 | LET_STMT@[77; 163) |
18 | POUND@[77; 78) "#" | 18 | ATTR@[77; 106) |
19 | TOKEN_TREE@[78; 106) | 19 | POUND@[77; 78) "#" |
20 | L_BRACK@[78; 79) "[" | 20 | TOKEN_TREE@[78; 106) |
21 | IDENT@[79; 82) "cfg" | 21 | L_BRACK@[78; 79) "[" |
22 | TOKEN_TREE@[82; 105) | 22 | IDENT@[79; 82) "cfg" |
23 | L_PAREN@[82; 83) "(" | 23 | TOKEN_TREE@[82; 105) |
24 | IDENT@[83; 90) "feature" | 24 | L_PAREN@[82; 83) "(" |
25 | WHITESPACE@[90; 91) " " | 25 | IDENT@[83; 90) "feature" |
26 | EQ@[91; 92) "=" | 26 | WHITESPACE@[90; 91) " " |
27 | WHITESPACE@[92; 93) " " | 27 | EQ@[91; 92) "=" |
28 | STRING@[93; 104) "\"backtrace\"" | 28 | WHITESPACE@[92; 93) " " |
29 | R_PAREN@[104; 105) ")" | 29 | STRING@[93; 104) "\"backtrace\"" |
30 | R_BRACK@[105; 106) "]" | 30 | R_PAREN@[104; 105) ")" |
31 | WHITESPACE@[106; 111) "\n " | 31 | R_BRACK@[105; 106) "]" |
32 | LET_KW@[111; 114) "let" | 32 | WHITESPACE@[106; 111) "\n " |
33 | WHITESPACE@[114; 115) " " | 33 | LET_KW@[111; 114) "let" |
34 | BIND_PAT@[115; 124) | 34 | WHITESPACE@[114; 115) " " |
35 | NAME@[115; 124) | 35 | BIND_PAT@[115; 124) |
36 | IDENT@[115; 124) "exit_code" | 36 | NAME@[115; 124) |
37 | WHITESPACE@[124; 125) " " | 37 | IDENT@[115; 124) "exit_code" |
38 | EQ@[125; 126) "=" | 38 | WHITESPACE@[124; 125) " " |
39 | WHITESPACE@[126; 127) " " | 39 | EQ@[125; 126) "=" |
40 | CALL_EXPR@[127; 162) | 40 | WHITESPACE@[126; 127) " " |
41 | PATH_EXPR@[127; 146) | 41 | CALL_EXPR@[127; 162) |
42 | PATH@[127; 146) | 42 | PATH_EXPR@[127; 146) |
43 | PATH@[127; 132) | 43 | PATH@[127; 146) |
44 | PATH_SEGMENT@[127; 132) | 44 | PATH@[127; 132) |
45 | NAME_REF@[127; 132) | 45 | PATH_SEGMENT@[127; 132) |
46 | IDENT@[127; 132) "panic" | 46 | NAME_REF@[127; 132) |
47 | COLONCOLON@[132; 134) "::" | 47 | IDENT@[127; 132) "panic" |
48 | PATH_SEGMENT@[134; 146) | 48 | COLONCOLON@[132; 134) "::" |
49 | NAME_REF@[134; 146) | 49 | PATH_SEGMENT@[134; 146) |
50 | IDENT@[134; 146) "catch_unwind" | 50 | NAME_REF@[134; 146) |
51 | ARG_LIST@[146; 162) | 51 | IDENT@[134; 146) "catch_unwind" |
52 | L_PAREN@[146; 147) "(" | 52 | ARG_LIST@[146; 162) |
53 | LAMBDA_EXPR@[147; 161) | 53 | L_PAREN@[146; 147) "(" |
54 | MOVE_KW@[147; 151) "move" | 54 | LAMBDA_EXPR@[147; 161) |
55 | WHITESPACE@[151; 152) " " | 55 | MOVE_KW@[147; 151) "move" |
56 | PARAM_LIST@[152; 154) | 56 | WHITESPACE@[151; 152) " " |
57 | PIPE@[152; 153) "|" | 57 | PARAM_LIST@[152; 154) |
58 | PIPE@[153; 154) "|" | 58 | PIPE@[152; 153) "|" |
59 | WHITESPACE@[154; 155) " " | 59 | PIPE@[153; 154) "|" |
60 | CALL_EXPR@[155; 161) | 60 | WHITESPACE@[154; 155) " " |
61 | PATH_EXPR@[155; 159) | 61 | CALL_EXPR@[155; 161) |
62 | PATH@[155; 159) | 62 | PATH_EXPR@[155; 159) |
63 | PATH_SEGMENT@[155; 159) | 63 | PATH@[155; 159) |
64 | NAME_REF@[155; 159) | 64 | PATH_SEGMENT@[155; 159) |
65 | IDENT@[155; 159) "main" | 65 | NAME_REF@[155; 159) |
66 | ARG_LIST@[159; 161) | 66 | IDENT@[155; 159) "main" |
67 | L_PAREN@[159; 160) "(" | 67 | ARG_LIST@[159; 161) |
68 | R_PAREN@[160; 161) ")" | 68 | L_PAREN@[159; 160) "(" |
69 | R_PAREN@[161; 162) ")" | 69 | R_PAREN@[160; 161) ")" |
70 | SEMI@[162; 163) ";" | 70 | R_PAREN@[161; 162) ")" |
71 | WHITESPACE@[163; 164) "\n" | 71 | SEMI@[162; 163) ";" |
72 | R_CURLY@[164; 165) "}" | 72 | WHITESPACE@[163; 164) "\n" |
73 | R_CURLY@[164; 165) "}" | ||
73 | WHITESPACE@[165; 166) "\n" | 74 | WHITESPACE@[165; 166) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.txt b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.txt index f6d3bf302..e8be8203b 100644 --- a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.txt +++ b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.txt | |||
@@ -8,78 +8,79 @@ SOURCE_FILE@[0; 686) | |||
8 | L_PAREN@[8; 9) "(" | 8 | L_PAREN@[8; 9) "(" |
9 | R_PAREN@[9; 10) ")" | 9 | R_PAREN@[9; 10) ")" |
10 | WHITESPACE@[10; 11) " " | 10 | WHITESPACE@[10; 11) " " |
11 | BLOCK@[11; 461) | 11 | BLOCK_EXPR@[11; 461) |
12 | L_CURLY@[11; 12) "{" | 12 | BLOCK@[11; 461) |
13 | WHITESPACE@[12; 17) "\n " | 13 | L_CURLY@[11; 12) "{" |
14 | ATTR@[17; 57) | 14 | WHITESPACE@[12; 17) "\n " |
15 | POUND@[17; 18) "#" | 15 | ATTR@[17; 57) |
16 | EXCL@[18; 19) "!" | 16 | POUND@[17; 18) "#" |
17 | TOKEN_TREE@[19; 57) | 17 | EXCL@[18; 19) "!" |
18 | L_BRACK@[19; 20) "[" | 18 | TOKEN_TREE@[19; 57) |
19 | IDENT@[20; 23) "doc" | 19 | L_BRACK@[19; 20) "[" |
20 | TOKEN_TREE@[23; 56) | 20 | IDENT@[20; 23) "doc" |
21 | L_PAREN@[23; 24) "(" | 21 | TOKEN_TREE@[23; 56) |
22 | STRING@[24; 55) "\"Inner attributes all ..." | 22 | L_PAREN@[23; 24) "(" |
23 | R_PAREN@[55; 56) ")" | 23 | STRING@[24; 55) "\"Inner attributes all ..." |
24 | R_BRACK@[56; 57) "]" | 24 | R_PAREN@[55; 56) ")" |
25 | WHITESPACE@[57; 62) "\n " | 25 | R_BRACK@[56; 57) "]" |
26 | COMMENT@[62; 97) "//! As are ModuleDoc ..." | 26 | WHITESPACE@[57; 62) "\n " |
27 | WHITESPACE@[97; 102) "\n " | 27 | COMMENT@[62; 97) "//! As are ModuleDoc ..." |
28 | EXPR_STMT@[102; 295) | 28 | WHITESPACE@[97; 102) "\n " |
29 | BLOCK_EXPR@[102; 294) | 29 | EXPR_STMT@[102; 295) |
30 | BLOCK@[102; 294) | 30 | BLOCK_EXPR@[102; 294) |
31 | L_CURLY@[102; 103) "{" | 31 | BLOCK@[102; 294) |
32 | WHITESPACE@[103; 112) "\n " | 32 | L_CURLY@[102; 103) "{" |
33 | ATTR@[112; 180) | 33 | WHITESPACE@[103; 112) "\n " |
34 | POUND@[112; 113) "#" | 34 | ATTR@[112; 180) |
35 | EXCL@[113; 114) "!" | 35 | POUND@[112; 113) "#" |
36 | TOKEN_TREE@[114; 180) | 36 | EXCL@[113; 114) "!" |
37 | L_BRACK@[114; 115) "[" | 37 | TOKEN_TREE@[114; 180) |
38 | IDENT@[115; 118) "doc" | 38 | L_BRACK@[114; 115) "[" |
39 | TOKEN_TREE@[118; 179) | 39 | IDENT@[115; 118) "doc" |
40 | L_PAREN@[118; 119) "(" | 40 | TOKEN_TREE@[118; 179) |
41 | STRING@[119; 178) "\"Inner attributes are ..." | 41 | L_PAREN@[118; 119) "(" |
42 | R_PAREN@[178; 179) ")" | 42 | STRING@[119; 178) "\"Inner attributes are ..." |
43 | R_BRACK@[179; 180) "]" | 43 | R_PAREN@[178; 179) ")" |
44 | WHITESPACE@[180; 189) "\n " | 44 | R_BRACK@[179; 180) "]" |
45 | ATTR@[189; 244) | 45 | WHITESPACE@[180; 189) "\n " |
46 | POUND@[189; 190) "#" | 46 | ATTR@[189; 244) |
47 | EXCL@[190; 191) "!" | 47 | POUND@[189; 190) "#" |
48 | TOKEN_TREE@[191; 244) | 48 | EXCL@[190; 191) "!" |
49 | L_BRACK@[191; 192) "[" | 49 | TOKEN_TREE@[191; 244) |
50 | IDENT@[192; 195) "doc" | 50 | L_BRACK@[191; 192) "[" |
51 | TOKEN_TREE@[195; 243) | 51 | IDENT@[192; 195) "doc" |
52 | L_PAREN@[195; 196) "(" | 52 | TOKEN_TREE@[195; 243) |
53 | STRING@[196; 242) "\"Being validated is n ..." | 53 | L_PAREN@[195; 196) "(" |
54 | R_PAREN@[242; 243) ")" | 54 | STRING@[196; 242) "\"Being validated is n ..." |
55 | R_BRACK@[243; 244) "]" | 55 | R_PAREN@[242; 243) ")" |
56 | WHITESPACE@[244; 253) "\n " | 56 | R_BRACK@[243; 244) "]" |
57 | COMMENT@[253; 288) "//! As are ModuleDoc ..." | 57 | WHITESPACE@[244; 253) "\n " |
58 | WHITESPACE@[288; 293) "\n " | 58 | COMMENT@[253; 288) "//! As are ModuleDoc ..." |
59 | R_CURLY@[293; 294) "}" | 59 | WHITESPACE@[288; 293) "\n " |
60 | SEMI@[294; 295) ";" | 60 | R_CURLY@[293; 294) "}" |
61 | WHITESPACE@[295; 300) "\n " | 61 | SEMI@[294; 295) ";" |
62 | BLOCK_EXPR@[300; 459) | 62 | WHITESPACE@[295; 300) "\n " |
63 | BLOCK@[300; 459) | 63 | BLOCK_EXPR@[300; 459) |
64 | L_CURLY@[300; 301) "{" | 64 | BLOCK@[300; 459) |
65 | WHITESPACE@[301; 310) "\n " | 65 | L_CURLY@[300; 301) "{" |
66 | ATTR@[310; 409) | 66 | WHITESPACE@[301; 310) "\n " |
67 | POUND@[310; 311) "#" | 67 | ATTR@[310; 409) |
68 | EXCL@[311; 312) "!" | 68 | POUND@[310; 311) "#" |
69 | TOKEN_TREE@[312; 409) | 69 | EXCL@[311; 312) "!" |
70 | L_BRACK@[312; 313) "[" | 70 | TOKEN_TREE@[312; 409) |
71 | IDENT@[313; 316) "doc" | 71 | L_BRACK@[312; 313) "[" |
72 | TOKEN_TREE@[316; 408) | 72 | IDENT@[313; 316) "doc" |
73 | L_PAREN@[316; 317) "(" | 73 | TOKEN_TREE@[316; 408) |
74 | STRING@[317; 407) "\"Inner attributes are ..." | 74 | L_PAREN@[316; 317) "(" |
75 | R_PAREN@[407; 408) ")" | 75 | STRING@[317; 407) "\"Inner attributes are ..." |
76 | R_BRACK@[408; 409) "]" | 76 | R_PAREN@[407; 408) ")" |
77 | WHITESPACE@[409; 418) "\n " | 77 | R_BRACK@[408; 409) "]" |
78 | COMMENT@[418; 453) "//! As are ModuleDoc ..." | 78 | WHITESPACE@[409; 418) "\n " |
79 | WHITESPACE@[453; 458) "\n " | 79 | COMMENT@[418; 453) "//! As are ModuleDoc ..." |
80 | R_CURLY@[458; 459) "}" | 80 | WHITESPACE@[453; 458) "\n " |
81 | WHITESPACE@[459; 460) "\n" | 81 | R_CURLY@[458; 459) "}" |
82 | R_CURLY@[460; 461) "}" | 82 | WHITESPACE@[459; 460) "\n" |
83 | R_CURLY@[460; 461) "}" | ||
83 | WHITESPACE@[461; 463) "\n\n" | 84 | WHITESPACE@[461; 463) "\n\n" |
84 | COMMENT@[463; 523) "// https://github.com ..." | 85 | COMMENT@[463; 523) "// https://github.com ..." |
85 | WHITESPACE@[523; 524) "\n" | 86 | WHITESPACE@[523; 524) "\n" |
@@ -146,24 +147,25 @@ SOURCE_FILE@[0; 686) | |||
146 | R_ANGLE@[599; 600) ">" | 147 | R_ANGLE@[599; 600) ">" |
147 | R_PAREN@[600; 601) ")" | 148 | R_PAREN@[600; 601) ")" |
148 | WHITESPACE@[601; 602) " " | 149 | WHITESPACE@[601; 602) " " |
149 | BLOCK@[602; 683) | 150 | BLOCK_EXPR@[602; 683) |
150 | L_CURLY@[602; 603) "{" | 151 | BLOCK@[602; 683) |
151 | WHITESPACE@[603; 612) "\n " | 152 | L_CURLY@[602; 603) "{" |
152 | ATTR@[612; 639) | 153 | WHITESPACE@[603; 612) "\n " |
153 | POUND@[612; 613) "#" | 154 | ATTR@[612; 639) |
154 | EXCL@[613; 614) "!" | 155 | POUND@[612; 613) "#" |
155 | TOKEN_TREE@[614; 639) | 156 | EXCL@[613; 614) "!" |
156 | L_BRACK@[614; 615) "[" | 157 | TOKEN_TREE@[614; 639) |
157 | IDENT@[615; 620) "allow" | 158 | L_BRACK@[614; 615) "[" |
158 | TOKEN_TREE@[620; 638) | 159 | IDENT@[615; 620) "allow" |
159 | L_PAREN@[620; 621) "(" | 160 | TOKEN_TREE@[620; 638) |
160 | IDENT@[621; 637) "unused_variables" | 161 | L_PAREN@[620; 621) "(" |
161 | R_PAREN@[637; 638) ")" | 162 | IDENT@[621; 637) "unused_variables" |
162 | R_BRACK@[638; 639) "]" | 163 | R_PAREN@[637; 638) ")" |
163 | WHITESPACE@[639; 640) " " | 164 | R_BRACK@[638; 639) "]" |
164 | COMMENT@[640; 677) "// this is `inner_at ..." | 165 | WHITESPACE@[639; 640) " " |
165 | WHITESPACE@[677; 682) "\n " | 166 | COMMENT@[640; 677) "// this is `inner_at ..." |
166 | R_CURLY@[682; 683) "}" | 167 | WHITESPACE@[677; 682) "\n " |
168 | R_CURLY@[682; 683) "}" | ||
167 | WHITESPACE@[683; 684) "\n" | 169 | WHITESPACE@[683; 684) "\n" |
168 | R_CURLY@[684; 685) "}" | 170 | R_CURLY@[684; 685) "}" |
169 | WHITESPACE@[685; 686) "\n" | 171 | WHITESPACE@[685; 686) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.txt b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.txt index 136e2aae1..07a5fbf2d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.txt +++ b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.txt | |||
@@ -10,251 +10,253 @@ SOURCE_FILE@[0; 395) | |||
10 | L_PAREN@[69; 70) "(" | 10 | L_PAREN@[69; 70) "(" |
11 | R_PAREN@[70; 71) ")" | 11 | R_PAREN@[70; 71) ")" |
12 | WHITESPACE@[71; 72) " " | 12 | WHITESPACE@[71; 72) " " |
13 | BLOCK@[72; 341) | 13 | BLOCK_EXPR@[72; 341) |
14 | L_CURLY@[72; 73) "{" | 14 | BLOCK@[72; 341) |
15 | WHITESPACE@[73; 78) "\n " | 15 | L_CURLY@[72; 73) "{" |
16 | EXPR_STMT@[78; 141) | 16 | WHITESPACE@[73; 78) "\n " |
17 | MATCH_EXPR@[78; 141) | 17 | EXPR_STMT@[78; 141) |
18 | MATCH_KW@[78; 83) "match" | 18 | MATCH_EXPR@[78; 141) |
19 | WHITESPACE@[83; 84) " " | 19 | MATCH_KW@[78; 83) "match" |
20 | CALL_EXPR@[84; 92) | 20 | WHITESPACE@[83; 84) " " |
21 | PATH_EXPR@[84; 88) | 21 | CALL_EXPR@[84; 92) |
22 | PATH@[84; 88) | 22 | PATH_EXPR@[84; 88) |
23 | PATH_SEGMENT@[84; 88) | 23 | PATH@[84; 88) |
24 | NAME_REF@[84; 88) | 24 | PATH_SEGMENT@[84; 88) |
25 | IDENT@[84; 88) "Some" | 25 | NAME_REF@[84; 88) |
26 | ARG_LIST@[88; 92) | 26 | IDENT@[84; 88) "Some" |
27 | L_PAREN@[88; 89) "(" | 27 | ARG_LIST@[88; 92) |
28 | PREFIX_EXPR@[89; 91) | 28 | L_PAREN@[88; 89) "(" |
29 | MINUS@[89; 90) "-" | 29 | PREFIX_EXPR@[89; 91) |
30 | LITERAL@[90; 91) | 30 | MINUS@[89; 90) "-" |
31 | INT_NUMBER@[90; 91) "1" | 31 | LITERAL@[90; 91) |
32 | R_PAREN@[91; 92) ")" | 32 | INT_NUMBER@[90; 91) "1" |
33 | WHITESPACE@[92; 93) " " | 33 | R_PAREN@[91; 92) ")" |
34 | MATCH_ARM_LIST@[93; 141) | 34 | WHITESPACE@[92; 93) " " |
35 | L_CURLY@[93; 94) "{" | 35 | MATCH_ARM_LIST@[93; 141) |
36 | WHITESPACE@[94; 103) "\n " | 36 | L_CURLY@[93; 94) "{" |
37 | MATCH_ARM@[103; 117) | 37 | WHITESPACE@[94; 103) "\n " |
38 | TUPLE_STRUCT_PAT@[103; 111) | 38 | MATCH_ARM@[103; 117) |
39 | PATH@[103; 107) | 39 | TUPLE_STRUCT_PAT@[103; 111) |
40 | PATH_SEGMENT@[103; 107) | 40 | PATH@[103; 107) |
41 | NAME_REF@[103; 107) | 41 | PATH_SEGMENT@[103; 107) |
42 | IDENT@[103; 107) "Some" | 42 | NAME_REF@[103; 107) |
43 | L_PAREN@[107; 108) "(" | 43 | IDENT@[103; 107) "Some" |
44 | LITERAL_PAT@[108; 110) | 44 | L_PAREN@[107; 108) "(" |
45 | MINUS@[108; 109) "-" | 45 | LITERAL_PAT@[108; 110) |
46 | LITERAL@[109; 110) | 46 | MINUS@[108; 109) "-" |
47 | INT_NUMBER@[109; 110) "1" | 47 | LITERAL@[109; 110) |
48 | R_PAREN@[110; 111) ")" | 48 | INT_NUMBER@[109; 110) "1" |
49 | WHITESPACE@[111; 112) " " | 49 | R_PAREN@[110; 111) ")" |
50 | FAT_ARROW@[112; 114) "=>" | 50 | WHITESPACE@[111; 112) " " |
51 | WHITESPACE@[114; 115) " " | 51 | FAT_ARROW@[112; 114) "=>" |
52 | TUPLE_EXPR@[115; 117) | 52 | WHITESPACE@[114; 115) " " |
53 | L_PAREN@[115; 116) "(" | 53 | TUPLE_EXPR@[115; 117) |
54 | R_PAREN@[116; 117) ")" | 54 | L_PAREN@[115; 116) "(" |
55 | COMMA@[117; 118) "," | 55 | R_PAREN@[116; 117) ")" |
56 | WHITESPACE@[118; 127) "\n " | 56 | COMMA@[117; 118) "," |
57 | MATCH_ARM@[127; 134) | 57 | WHITESPACE@[118; 127) "\n " |
58 | PLACEHOLDER_PAT@[127; 128) | 58 | MATCH_ARM@[127; 134) |
59 | UNDERSCORE@[127; 128) "_" | 59 | PLACEHOLDER_PAT@[127; 128) |
60 | WHITESPACE@[128; 129) " " | 60 | UNDERSCORE@[127; 128) "_" |
61 | FAT_ARROW@[129; 131) "=>" | 61 | WHITESPACE@[128; 129) " " |
62 | WHITESPACE@[131; 132) " " | 62 | FAT_ARROW@[129; 131) "=>" |
63 | TUPLE_EXPR@[132; 134) | 63 | WHITESPACE@[131; 132) " " |
64 | L_PAREN@[132; 133) "(" | 64 | TUPLE_EXPR@[132; 134) |
65 | R_PAREN@[133; 134) ")" | 65 | L_PAREN@[132; 133) "(" |
66 | COMMA@[134; 135) "," | 66 | R_PAREN@[133; 134) ")" |
67 | WHITESPACE@[135; 140) "\n " | 67 | COMMA@[134; 135) "," |
68 | R_CURLY@[140; 141) "}" | 68 | WHITESPACE@[135; 140) "\n " |
69 | WHITESPACE@[141; 147) "\n\n " | 69 | R_CURLY@[140; 141) "}" |
70 | EXPR_STMT@[147; 222) | 70 | WHITESPACE@[141; 147) "\n\n " |
71 | MATCH_EXPR@[147; 222) | 71 | EXPR_STMT@[147; 222) |
72 | MATCH_KW@[147; 152) "match" | 72 | MATCH_EXPR@[147; 222) |
73 | WHITESPACE@[152; 153) " " | 73 | MATCH_KW@[147; 152) "match" |
74 | CALL_EXPR@[153; 167) | 74 | WHITESPACE@[152; 153) " " |
75 | PATH_EXPR@[153; 157) | 75 | CALL_EXPR@[153; 167) |
76 | PATH@[153; 157) | 76 | PATH_EXPR@[153; 157) |
77 | PATH_SEGMENT@[153; 157) | 77 | PATH@[153; 157) |
78 | NAME_REF@[153; 157) | 78 | PATH_SEGMENT@[153; 157) |
79 | IDENT@[153; 157) "Some" | 79 | NAME_REF@[153; 157) |
80 | ARG_LIST@[157; 167) | 80 | IDENT@[153; 157) "Some" |
81 | L_PAREN@[157; 158) "(" | 81 | ARG_LIST@[157; 167) |
82 | TUPLE_EXPR@[158; 166) | 82 | L_PAREN@[157; 158) "(" |
83 | L_PAREN@[158; 159) "(" | 83 | TUPLE_EXPR@[158; 166) |
84 | PREFIX_EXPR@[159; 161) | 84 | L_PAREN@[158; 159) "(" |
85 | MINUS@[159; 160) "-" | 85 | PREFIX_EXPR@[159; 161) |
86 | LITERAL@[160; 161) | 86 | MINUS@[159; 160) "-" |
87 | INT_NUMBER@[160; 161) "1" | 87 | LITERAL@[160; 161) |
88 | COMMA@[161; 162) "," | 88 | INT_NUMBER@[160; 161) "1" |
89 | WHITESPACE@[162; 163) " " | 89 | COMMA@[161; 162) "," |
90 | PREFIX_EXPR@[163; 165) | 90 | WHITESPACE@[162; 163) " " |
91 | MINUS@[163; 164) "-" | 91 | PREFIX_EXPR@[163; 165) |
92 | LITERAL@[164; 165) | 92 | MINUS@[163; 164) "-" |
93 | INT_NUMBER@[164; 165) "1" | 93 | LITERAL@[164; 165) |
94 | R_PAREN@[165; 166) ")" | 94 | INT_NUMBER@[164; 165) "1" |
95 | R_PAREN@[166; 167) ")" | 95 | R_PAREN@[165; 166) ")" |
96 | WHITESPACE@[167; 168) " " | 96 | R_PAREN@[166; 167) ")" |
97 | MATCH_ARM_LIST@[168; 222) | 97 | WHITESPACE@[167; 168) " " |
98 | L_CURLY@[168; 169) "{" | 98 | MATCH_ARM_LIST@[168; 222) |
99 | WHITESPACE@[169; 178) "\n " | 99 | L_CURLY@[168; 169) "{" |
100 | MATCH_ARM@[178; 198) | 100 | WHITESPACE@[169; 178) "\n " |
101 | TUPLE_STRUCT_PAT@[178; 192) | 101 | MATCH_ARM@[178; 198) |
102 | PATH@[178; 182) | 102 | TUPLE_STRUCT_PAT@[178; 192) |
103 | PATH_SEGMENT@[178; 182) | 103 | PATH@[178; 182) |
104 | NAME_REF@[178; 182) | 104 | PATH_SEGMENT@[178; 182) |
105 | IDENT@[178; 182) "Some" | 105 | NAME_REF@[178; 182) |
106 | L_PAREN@[182; 183) "(" | 106 | IDENT@[178; 182) "Some" |
107 | TUPLE_PAT@[183; 191) | 107 | L_PAREN@[182; 183) "(" |
108 | L_PAREN@[183; 184) "(" | 108 | TUPLE_PAT@[183; 191) |
109 | LITERAL_PAT@[184; 186) | 109 | L_PAREN@[183; 184) "(" |
110 | MINUS@[184; 185) "-" | 110 | LITERAL_PAT@[184; 186) |
111 | LITERAL@[185; 186) | 111 | MINUS@[184; 185) "-" |
112 | INT_NUMBER@[185; 186) "1" | 112 | LITERAL@[185; 186) |
113 | COMMA@[186; 187) "," | 113 | INT_NUMBER@[185; 186) "1" |
114 | WHITESPACE@[187; 188) " " | 114 | COMMA@[186; 187) "," |
115 | LITERAL_PAT@[188; 190) | 115 | WHITESPACE@[187; 188) " " |
116 | MINUS@[188; 189) "-" | 116 | LITERAL_PAT@[188; 190) |
117 | LITERAL@[189; 190) | 117 | MINUS@[188; 189) "-" |
118 | INT_NUMBER@[189; 190) "1" | 118 | LITERAL@[189; 190) |
119 | R_PAREN@[190; 191) ")" | 119 | INT_NUMBER@[189; 190) "1" |
120 | R_PAREN@[191; 192) ")" | 120 | R_PAREN@[190; 191) ")" |
121 | WHITESPACE@[192; 193) " " | 121 | R_PAREN@[191; 192) ")" |
122 | FAT_ARROW@[193; 195) "=>" | 122 | WHITESPACE@[192; 193) " " |
123 | WHITESPACE@[195; 196) " " | 123 | FAT_ARROW@[193; 195) "=>" |
124 | TUPLE_EXPR@[196; 198) | 124 | WHITESPACE@[195; 196) " " |
125 | L_PAREN@[196; 197) "(" | 125 | TUPLE_EXPR@[196; 198) |
126 | R_PAREN@[197; 198) ")" | 126 | L_PAREN@[196; 197) "(" |
127 | COMMA@[198; 199) "," | 127 | R_PAREN@[197; 198) ")" |
128 | WHITESPACE@[199; 208) "\n " | 128 | COMMA@[198; 199) "," |
129 | MATCH_ARM@[208; 215) | 129 | WHITESPACE@[199; 208) "\n " |
130 | PLACEHOLDER_PAT@[208; 209) | 130 | MATCH_ARM@[208; 215) |
131 | UNDERSCORE@[208; 209) "_" | 131 | PLACEHOLDER_PAT@[208; 209) |
132 | WHITESPACE@[209; 210) " " | 132 | UNDERSCORE@[208; 209) "_" |
133 | FAT_ARROW@[210; 212) "=>" | 133 | WHITESPACE@[209; 210) " " |
134 | WHITESPACE@[212; 213) " " | 134 | FAT_ARROW@[210; 212) "=>" |
135 | TUPLE_EXPR@[213; 215) | 135 | WHITESPACE@[212; 213) " " |
136 | L_PAREN@[213; 214) "(" | 136 | TUPLE_EXPR@[213; 215) |
137 | R_PAREN@[214; 215) ")" | 137 | L_PAREN@[213; 214) "(" |
138 | COMMA@[215; 216) "," | 138 | R_PAREN@[214; 215) ")" |
139 | WHITESPACE@[216; 221) "\n " | 139 | COMMA@[215; 216) "," |
140 | R_CURLY@[221; 222) "}" | 140 | WHITESPACE@[216; 221) "\n " |
141 | WHITESPACE@[222; 228) "\n\n " | 141 | R_CURLY@[221; 222) "}" |
142 | EXPR_STMT@[228; 299) | 142 | WHITESPACE@[222; 228) "\n\n " |
143 | MATCH_EXPR@[228; 299) | 143 | EXPR_STMT@[228; 299) |
144 | MATCH_KW@[228; 233) "match" | 144 | MATCH_EXPR@[228; 299) |
145 | WHITESPACE@[233; 234) " " | 145 | MATCH_KW@[228; 233) "match" |
146 | CALL_EXPR@[234; 246) | 146 | WHITESPACE@[233; 234) " " |
147 | PATH_EXPR@[234; 238) | 147 | CALL_EXPR@[234; 246) |
148 | PATH@[234; 238) | 148 | PATH_EXPR@[234; 238) |
149 | PATH@[234; 235) | 149 | PATH@[234; 238) |
150 | PATH_SEGMENT@[234; 235) | 150 | PATH@[234; 235) |
151 | NAME_REF@[234; 235) | 151 | PATH_SEGMENT@[234; 235) |
152 | IDENT@[234; 235) "A" | 152 | NAME_REF@[234; 235) |
153 | COLONCOLON@[235; 237) "::" | 153 | IDENT@[234; 235) "A" |
154 | PATH_SEGMENT@[237; 238) | 154 | COLONCOLON@[235; 237) "::" |
155 | NAME_REF@[237; 238) | 155 | PATH_SEGMENT@[237; 238) |
156 | IDENT@[237; 238) "B" | 156 | NAME_REF@[237; 238) |
157 | ARG_LIST@[238; 246) | 157 | IDENT@[237; 238) "B" |
158 | L_PAREN@[238; 239) "(" | 158 | ARG_LIST@[238; 246) |
159 | PREFIX_EXPR@[239; 241) | 159 | L_PAREN@[238; 239) "(" |
160 | MINUS@[239; 240) "-" | 160 | PREFIX_EXPR@[239; 241) |
161 | LITERAL@[240; 241) | 161 | MINUS@[239; 240) "-" |
162 | INT_NUMBER@[240; 241) "1" | 162 | LITERAL@[240; 241) |
163 | COMMA@[241; 242) "," | 163 | INT_NUMBER@[240; 241) "1" |
164 | WHITESPACE@[242; 243) " " | 164 | COMMA@[241; 242) "," |
165 | PREFIX_EXPR@[243; 245) | 165 | WHITESPACE@[242; 243) " " |
166 | MINUS@[243; 244) "-" | 166 | PREFIX_EXPR@[243; 245) |
167 | LITERAL@[244; 245) | 167 | MINUS@[243; 244) "-" |
168 | INT_NUMBER@[244; 245) "1" | 168 | LITERAL@[244; 245) |
169 | R_PAREN@[245; 246) ")" | 169 | INT_NUMBER@[244; 245) "1" |
170 | WHITESPACE@[246; 247) " " | 170 | R_PAREN@[245; 246) ")" |
171 | MATCH_ARM_LIST@[247; 299) | 171 | WHITESPACE@[246; 247) " " |
172 | L_CURLY@[247; 248) "{" | 172 | MATCH_ARM_LIST@[247; 299) |
173 | WHITESPACE@[248; 257) "\n " | 173 | L_CURLY@[247; 248) "{" |
174 | MATCH_ARM@[257; 275) | 174 | WHITESPACE@[248; 257) "\n " |
175 | TUPLE_STRUCT_PAT@[257; 269) | 175 | MATCH_ARM@[257; 275) |
176 | PATH@[257; 261) | 176 | TUPLE_STRUCT_PAT@[257; 269) |
177 | PATH@[257; 258) | 177 | PATH@[257; 261) |
178 | PATH_SEGMENT@[257; 258) | 178 | PATH@[257; 258) |
179 | NAME_REF@[257; 258) | 179 | PATH_SEGMENT@[257; 258) |
180 | IDENT@[257; 258) "A" | 180 | NAME_REF@[257; 258) |
181 | COLONCOLON@[258; 260) "::" | 181 | IDENT@[257; 258) "A" |
182 | PATH_SEGMENT@[260; 261) | 182 | COLONCOLON@[258; 260) "::" |
183 | NAME_REF@[260; 261) | 183 | PATH_SEGMENT@[260; 261) |
184 | IDENT@[260; 261) "B" | 184 | NAME_REF@[260; 261) |
185 | L_PAREN@[261; 262) "(" | 185 | IDENT@[260; 261) "B" |
186 | LITERAL_PAT@[262; 264) | 186 | L_PAREN@[261; 262) "(" |
187 | MINUS@[262; 263) "-" | 187 | LITERAL_PAT@[262; 264) |
188 | LITERAL@[263; 264) | 188 | MINUS@[262; 263) "-" |
189 | INT_NUMBER@[263; 264) "1" | 189 | LITERAL@[263; 264) |
190 | COMMA@[264; 265) "," | 190 | INT_NUMBER@[263; 264) "1" |
191 | WHITESPACE@[265; 266) " " | 191 | COMMA@[264; 265) "," |
192 | LITERAL_PAT@[266; 268) | 192 | WHITESPACE@[265; 266) " " |
193 | MINUS@[266; 267) "-" | 193 | LITERAL_PAT@[266; 268) |
194 | LITERAL@[267; 268) | 194 | MINUS@[266; 267) "-" |
195 | INT_NUMBER@[267; 268) "1" | 195 | LITERAL@[267; 268) |
196 | R_PAREN@[268; 269) ")" | 196 | INT_NUMBER@[267; 268) "1" |
197 | WHITESPACE@[269; 270) " " | 197 | R_PAREN@[268; 269) ")" |
198 | FAT_ARROW@[270; 272) "=>" | 198 | WHITESPACE@[269; 270) " " |
199 | WHITESPACE@[272; 273) " " | 199 | FAT_ARROW@[270; 272) "=>" |
200 | TUPLE_EXPR@[273; 275) | 200 | WHITESPACE@[272; 273) " " |
201 | L_PAREN@[273; 274) "(" | 201 | TUPLE_EXPR@[273; 275) |
202 | R_PAREN@[274; 275) ")" | 202 | L_PAREN@[273; 274) "(" |
203 | COMMA@[275; 276) "," | 203 | R_PAREN@[274; 275) ")" |
204 | WHITESPACE@[276; 285) "\n " | 204 | COMMA@[275; 276) "," |
205 | MATCH_ARM@[285; 292) | 205 | WHITESPACE@[276; 285) "\n " |
206 | PLACEHOLDER_PAT@[285; 286) | 206 | MATCH_ARM@[285; 292) |
207 | UNDERSCORE@[285; 286) "_" | 207 | PLACEHOLDER_PAT@[285; 286) |
208 | WHITESPACE@[286; 287) " " | 208 | UNDERSCORE@[285; 286) "_" |
209 | FAT_ARROW@[287; 289) "=>" | 209 | WHITESPACE@[286; 287) " " |
210 | WHITESPACE@[289; 290) " " | 210 | FAT_ARROW@[287; 289) "=>" |
211 | TUPLE_EXPR@[290; 292) | 211 | WHITESPACE@[289; 290) " " |
212 | L_PAREN@[290; 291) "(" | 212 | TUPLE_EXPR@[290; 292) |
213 | R_PAREN@[291; 292) ")" | 213 | L_PAREN@[290; 291) "(" |
214 | COMMA@[292; 293) "," | 214 | R_PAREN@[291; 292) ")" |
215 | WHITESPACE@[293; 298) "\n " | 215 | COMMA@[292; 293) "," |
216 | R_CURLY@[298; 299) "}" | 216 | WHITESPACE@[293; 298) "\n " |
217 | WHITESPACE@[299; 305) "\n\n " | 217 | R_CURLY@[298; 299) "}" |
218 | IF_EXPR@[305; 339) | 218 | WHITESPACE@[299; 305) "\n\n " |
219 | IF_KW@[305; 307) "if" | 219 | IF_EXPR@[305; 339) |
220 | WHITESPACE@[307; 308) " " | 220 | IF_KW@[305; 307) "if" |
221 | CONDITION@[308; 331) | 221 | WHITESPACE@[307; 308) " " |
222 | LET_KW@[308; 311) "let" | 222 | CONDITION@[308; 331) |
223 | WHITESPACE@[311; 312) " " | 223 | LET_KW@[308; 311) "let" |
224 | TUPLE_STRUCT_PAT@[312; 320) | 224 | WHITESPACE@[311; 312) " " |
225 | PATH@[312; 316) | 225 | TUPLE_STRUCT_PAT@[312; 320) |
226 | PATH_SEGMENT@[312; 316) | 226 | PATH@[312; 316) |
227 | NAME_REF@[312; 316) | 227 | PATH_SEGMENT@[312; 316) |
228 | IDENT@[312; 316) "Some" | 228 | NAME_REF@[312; 316) |
229 | L_PAREN@[316; 317) "(" | 229 | IDENT@[312; 316) "Some" |
230 | LITERAL_PAT@[317; 319) | 230 | L_PAREN@[316; 317) "(" |
231 | MINUS@[317; 318) "-" | 231 | LITERAL_PAT@[317; 319) |
232 | LITERAL@[318; 319) | 232 | MINUS@[317; 318) "-" |
233 | INT_NUMBER@[318; 319) "1" | 233 | LITERAL@[318; 319) |
234 | R_PAREN@[319; 320) ")" | 234 | INT_NUMBER@[318; 319) "1" |
235 | WHITESPACE@[320; 321) " " | 235 | R_PAREN@[319; 320) ")" |
236 | EQ@[321; 322) "=" | 236 | WHITESPACE@[320; 321) " " |
237 | WHITESPACE@[322; 323) " " | 237 | EQ@[321; 322) "=" |
238 | CALL_EXPR@[323; 331) | 238 | WHITESPACE@[322; 323) " " |
239 | PATH_EXPR@[323; 327) | 239 | CALL_EXPR@[323; 331) |
240 | PATH@[323; 327) | 240 | PATH_EXPR@[323; 327) |
241 | PATH_SEGMENT@[323; 327) | 241 | PATH@[323; 327) |
242 | NAME_REF@[323; 327) | 242 | PATH_SEGMENT@[323; 327) |
243 | IDENT@[323; 327) "Some" | 243 | NAME_REF@[323; 327) |
244 | ARG_LIST@[327; 331) | 244 | IDENT@[323; 327) "Some" |
245 | L_PAREN@[327; 328) "(" | 245 | ARG_LIST@[327; 331) |
246 | PREFIX_EXPR@[328; 330) | 246 | L_PAREN@[327; 328) "(" |
247 | MINUS@[328; 329) "-" | 247 | PREFIX_EXPR@[328; 330) |
248 | LITERAL@[329; 330) | 248 | MINUS@[328; 329) "-" |
249 | INT_NUMBER@[329; 330) "1" | 249 | LITERAL@[329; 330) |
250 | R_PAREN@[330; 331) ")" | 250 | INT_NUMBER@[329; 330) "1" |
251 | WHITESPACE@[331; 332) " " | 251 | R_PAREN@[330; 331) ")" |
252 | BLOCK@[332; 339) | 252 | WHITESPACE@[331; 332) " " |
253 | L_CURLY@[332; 333) "{" | 253 | BLOCK_EXPR@[332; 339) |
254 | WHITESPACE@[333; 338) "\n " | 254 | BLOCK@[332; 339) |
255 | R_CURLY@[338; 339) "}" | 255 | L_CURLY@[332; 333) "{" |
256 | WHITESPACE@[339; 340) "\n" | 256 | WHITESPACE@[333; 338) "\n " |
257 | R_CURLY@[340; 341) "}" | 257 | R_CURLY@[338; 339) "}" |
258 | WHITESPACE@[339; 340) "\n" | ||
259 | R_CURLY@[340; 341) "}" | ||
258 | WHITESPACE@[341; 343) "\n\n" | 260 | WHITESPACE@[341; 343) "\n\n" |
259 | ENUM_DEF@[343; 367) | 261 | ENUM_DEF@[343; 367) |
260 | ENUM_KW@[343; 347) "enum" | 262 | ENUM_KW@[343; 347) "enum" |
@@ -314,7 +316,8 @@ SOURCE_FILE@[0; 395) | |||
314 | IDENT@[388; 390) "i8" | 316 | IDENT@[388; 390) "i8" |
315 | R_PAREN@[390; 391) ")" | 317 | R_PAREN@[390; 391) ")" |
316 | WHITESPACE@[391; 392) " " | 318 | WHITESPACE@[391; 392) " " |
317 | BLOCK@[392; 394) | 319 | BLOCK_EXPR@[392; 394) |
318 | L_CURLY@[392; 393) "{" | 320 | BLOCK@[392; 394) |
319 | R_CURLY@[393; 394) "}" | 321 | L_CURLY@[392; 393) "{" |
322 | R_CURLY@[393; 394) "}" | ||
320 | WHITESPACE@[394; 395) "\n" | 323 | WHITESPACE@[394; 395) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.txt b/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.txt index 3fca4993a..c9cf84ffd 100644 --- a/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.txt +++ b/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.txt | |||
@@ -10,191 +10,192 @@ SOURCE_FILE@[0; 257) | |||
10 | L_PAREN@[82; 83) "(" | 10 | L_PAREN@[82; 83) "(" |
11 | R_PAREN@[83; 84) ")" | 11 | R_PAREN@[83; 84) ")" |
12 | WHITESPACE@[84; 85) " " | 12 | WHITESPACE@[84; 85) " " |
13 | BLOCK@[85; 256) | 13 | BLOCK_EXPR@[85; 256) |
14 | L_CURLY@[85; 86) "{" | 14 | BLOCK@[85; 256) |
15 | WHITESPACE@[86; 91) "\n " | 15 | L_CURLY@[85; 86) "{" |
16 | LET_STMT@[91; 105) | 16 | WHITESPACE@[86; 91) "\n " |
17 | LET_KW@[91; 94) "let" | 17 | LET_STMT@[91; 105) |
18 | WHITESPACE@[94; 95) " " | 18 | LET_KW@[91; 94) "let" |
19 | BIND_PAT@[95; 100) | 19 | WHITESPACE@[94; 95) " " |
20 | MUT_KW@[95; 98) "mut" | 20 | BIND_PAT@[95; 100) |
21 | WHITESPACE@[98; 99) " " | 21 | MUT_KW@[95; 98) "mut" |
22 | NAME@[99; 100) | 22 | WHITESPACE@[98; 99) " " |
23 | IDENT@[99; 100) "a" | 23 | NAME@[99; 100) |
24 | WHITESPACE@[100; 101) " " | 24 | IDENT@[99; 100) "a" |
25 | EQ@[101; 102) "=" | 25 | WHITESPACE@[100; 101) " " |
26 | WHITESPACE@[102; 103) " " | 26 | EQ@[101; 102) "=" |
27 | LITERAL@[103; 104) | 27 | WHITESPACE@[102; 103) " " |
28 | INT_NUMBER@[103; 104) "0" | 28 | LITERAL@[103; 104) |
29 | SEMI@[104; 105) ";" | 29 | INT_NUMBER@[103; 104) "0" |
30 | WHITESPACE@[105; 110) "\n " | 30 | SEMI@[104; 105) ";" |
31 | EXPR_STMT@[110; 117) | 31 | WHITESPACE@[105; 110) "\n " |
32 | BIN_EXPR@[110; 116) | 32 | EXPR_STMT@[110; 117) |
33 | PATH_EXPR@[110; 111) | 33 | BIN_EXPR@[110; 116) |
34 | PATH@[110; 111) | 34 | PATH_EXPR@[110; 111) |
35 | PATH_SEGMENT@[110; 111) | 35 | PATH@[110; 111) |
36 | NAME_REF@[110; 111) | 36 | PATH_SEGMENT@[110; 111) |
37 | IDENT@[110; 111) "a" | 37 | NAME_REF@[110; 111) |
38 | WHITESPACE@[111; 112) " " | 38 | IDENT@[110; 111) "a" |
39 | PLUSEQ@[112; 114) "+=" | 39 | WHITESPACE@[111; 112) " " |
40 | WHITESPACE@[114; 115) " " | 40 | PLUSEQ@[112; 114) "+=" |
41 | LITERAL@[115; 116) | 41 | WHITESPACE@[114; 115) " " |
42 | INT_NUMBER@[115; 116) "1" | 42 | LITERAL@[115; 116) |
43 | SEMI@[116; 117) ";" | 43 | INT_NUMBER@[115; 116) "1" |
44 | WHITESPACE@[117; 122) "\n " | 44 | SEMI@[116; 117) ";" |
45 | EXPR_STMT@[122; 129) | 45 | WHITESPACE@[117; 122) "\n " |
46 | BIN_EXPR@[122; 128) | 46 | EXPR_STMT@[122; 129) |
47 | PATH_EXPR@[122; 123) | 47 | BIN_EXPR@[122; 128) |
48 | PATH@[122; 123) | 48 | PATH_EXPR@[122; 123) |
49 | PATH_SEGMENT@[122; 123) | 49 | PATH@[122; 123) |
50 | NAME_REF@[122; 123) | 50 | PATH_SEGMENT@[122; 123) |
51 | IDENT@[122; 123) "a" | 51 | NAME_REF@[122; 123) |
52 | WHITESPACE@[123; 124) " " | 52 | IDENT@[122; 123) "a" |
53 | MINUSEQ@[124; 126) "-=" | 53 | WHITESPACE@[123; 124) " " |
54 | WHITESPACE@[126; 127) " " | 54 | MINUSEQ@[124; 126) "-=" |
55 | LITERAL@[127; 128) | 55 | WHITESPACE@[126; 127) " " |
56 | INT_NUMBER@[127; 128) "2" | 56 | LITERAL@[127; 128) |
57 | SEMI@[128; 129) ";" | 57 | INT_NUMBER@[127; 128) "2" |
58 | WHITESPACE@[129; 134) "\n " | 58 | SEMI@[128; 129) ";" |
59 | EXPR_STMT@[134; 141) | 59 | WHITESPACE@[129; 134) "\n " |
60 | BIN_EXPR@[134; 140) | 60 | EXPR_STMT@[134; 141) |
61 | PATH_EXPR@[134; 135) | 61 | BIN_EXPR@[134; 140) |
62 | PATH@[134; 135) | 62 | PATH_EXPR@[134; 135) |
63 | PATH_SEGMENT@[134; 135) | 63 | PATH@[134; 135) |
64 | NAME_REF@[134; 135) | 64 | PATH_SEGMENT@[134; 135) |
65 | IDENT@[134; 135) "a" | 65 | NAME_REF@[134; 135) |
66 | WHITESPACE@[135; 136) " " | 66 | IDENT@[134; 135) "a" |
67 | STAREQ@[136; 138) "*=" | 67 | WHITESPACE@[135; 136) " " |
68 | WHITESPACE@[138; 139) " " | 68 | STAREQ@[136; 138) "*=" |
69 | LITERAL@[139; 140) | 69 | WHITESPACE@[138; 139) " " |
70 | INT_NUMBER@[139; 140) "3" | 70 | LITERAL@[139; 140) |
71 | SEMI@[140; 141) ";" | 71 | INT_NUMBER@[139; 140) "3" |
72 | WHITESPACE@[141; 146) "\n " | 72 | SEMI@[140; 141) ";" |
73 | EXPR_STMT@[146; 153) | 73 | WHITESPACE@[141; 146) "\n " |
74 | BIN_EXPR@[146; 152) | 74 | EXPR_STMT@[146; 153) |
75 | PATH_EXPR@[146; 147) | 75 | BIN_EXPR@[146; 152) |
76 | PATH@[146; 147) | 76 | PATH_EXPR@[146; 147) |
77 | PATH_SEGMENT@[146; 147) | 77 | PATH@[146; 147) |
78 | NAME_REF@[146; 147) | 78 | PATH_SEGMENT@[146; 147) |
79 | IDENT@[146; 147) "a" | 79 | NAME_REF@[146; 147) |
80 | WHITESPACE@[147; 148) " " | 80 | IDENT@[146; 147) "a" |
81 | PERCENTEQ@[148; 150) "%=" | 81 | WHITESPACE@[147; 148) " " |
82 | WHITESPACE@[150; 151) " " | 82 | PERCENTEQ@[148; 150) "%=" |
83 | LITERAL@[151; 152) | 83 | WHITESPACE@[150; 151) " " |
84 | INT_NUMBER@[151; 152) "4" | 84 | LITERAL@[151; 152) |
85 | SEMI@[152; 153) ";" | 85 | INT_NUMBER@[151; 152) "4" |
86 | WHITESPACE@[153; 158) "\n " | 86 | SEMI@[152; 153) ";" |
87 | EXPR_STMT@[158; 165) | 87 | WHITESPACE@[153; 158) "\n " |
88 | BIN_EXPR@[158; 164) | 88 | EXPR_STMT@[158; 165) |
89 | PATH_EXPR@[158; 159) | 89 | BIN_EXPR@[158; 164) |
90 | PATH@[158; 159) | 90 | PATH_EXPR@[158; 159) |
91 | PATH_SEGMENT@[158; 159) | 91 | PATH@[158; 159) |
92 | NAME_REF@[158; 159) | 92 | PATH_SEGMENT@[158; 159) |
93 | IDENT@[158; 159) "a" | 93 | NAME_REF@[158; 159) |
94 | WHITESPACE@[159; 160) " " | 94 | IDENT@[158; 159) "a" |
95 | SLASHEQ@[160; 162) "/=" | 95 | WHITESPACE@[159; 160) " " |
96 | WHITESPACE@[162; 163) " " | 96 | SLASHEQ@[160; 162) "/=" |
97 | LITERAL@[163; 164) | 97 | WHITESPACE@[162; 163) " " |
98 | INT_NUMBER@[163; 164) "5" | 98 | LITERAL@[163; 164) |
99 | SEMI@[164; 165) ";" | 99 | INT_NUMBER@[163; 164) "5" |
100 | WHITESPACE@[165; 170) "\n " | 100 | SEMI@[164; 165) ";" |
101 | EXPR_STMT@[170; 177) | 101 | WHITESPACE@[165; 170) "\n " |
102 | BIN_EXPR@[170; 176) | 102 | EXPR_STMT@[170; 177) |
103 | PATH_EXPR@[170; 171) | 103 | BIN_EXPR@[170; 176) |
104 | PATH@[170; 171) | 104 | PATH_EXPR@[170; 171) |
105 | PATH_SEGMENT@[170; 171) | 105 | PATH@[170; 171) |
106 | NAME_REF@[170; 171) | 106 | PATH_SEGMENT@[170; 171) |
107 | IDENT@[170; 171) "a" | 107 | NAME_REF@[170; 171) |
108 | WHITESPACE@[171; 172) " " | 108 | IDENT@[170; 171) "a" |
109 | PIPEEQ@[172; 174) "|=" | 109 | WHITESPACE@[171; 172) " " |
110 | WHITESPACE@[174; 175) " " | 110 | PIPEEQ@[172; 174) "|=" |
111 | LITERAL@[175; 176) | 111 | WHITESPACE@[174; 175) " " |
112 | INT_NUMBER@[175; 176) "6" | 112 | LITERAL@[175; 176) |
113 | SEMI@[176; 177) ";" | 113 | INT_NUMBER@[175; 176) "6" |
114 | WHITESPACE@[177; 182) "\n " | 114 | SEMI@[176; 177) ";" |
115 | EXPR_STMT@[182; 189) | 115 | WHITESPACE@[177; 182) "\n " |
116 | BIN_EXPR@[182; 188) | 116 | EXPR_STMT@[182; 189) |
117 | PATH_EXPR@[182; 183) | 117 | BIN_EXPR@[182; 188) |
118 | PATH@[182; 183) | 118 | PATH_EXPR@[182; 183) |
119 | PATH_SEGMENT@[182; 183) | 119 | PATH@[182; 183) |
120 | NAME_REF@[182; 183) | 120 | PATH_SEGMENT@[182; 183) |
121 | IDENT@[182; 183) "a" | 121 | NAME_REF@[182; 183) |
122 | WHITESPACE@[183; 184) " " | 122 | IDENT@[182; 183) "a" |
123 | AMPEQ@[184; 186) "&=" | 123 | WHITESPACE@[183; 184) " " |
124 | WHITESPACE@[186; 187) " " | 124 | AMPEQ@[184; 186) "&=" |
125 | LITERAL@[187; 188) | 125 | WHITESPACE@[186; 187) " " |
126 | INT_NUMBER@[187; 188) "7" | 126 | LITERAL@[187; 188) |
127 | SEMI@[188; 189) ";" | 127 | INT_NUMBER@[187; 188) "7" |
128 | WHITESPACE@[189; 194) "\n " | 128 | SEMI@[188; 189) ";" |
129 | EXPR_STMT@[194; 201) | 129 | WHITESPACE@[189; 194) "\n " |
130 | BIN_EXPR@[194; 200) | 130 | EXPR_STMT@[194; 201) |
131 | PATH_EXPR@[194; 195) | 131 | BIN_EXPR@[194; 200) |
132 | PATH@[194; 195) | 132 | PATH_EXPR@[194; 195) |
133 | PATH_SEGMENT@[194; 195) | 133 | PATH@[194; 195) |
134 | NAME_REF@[194; 195) | 134 | PATH_SEGMENT@[194; 195) |
135 | IDENT@[194; 195) "a" | 135 | NAME_REF@[194; 195) |
136 | WHITESPACE@[195; 196) " " | 136 | IDENT@[194; 195) "a" |
137 | CARETEQ@[196; 198) "^=" | 137 | WHITESPACE@[195; 196) " " |
138 | WHITESPACE@[198; 199) " " | 138 | CARETEQ@[196; 198) "^=" |
139 | LITERAL@[199; 200) | 139 | WHITESPACE@[198; 199) " " |
140 | INT_NUMBER@[199; 200) "8" | 140 | LITERAL@[199; 200) |
141 | SEMI@[200; 201) ";" | 141 | INT_NUMBER@[199; 200) "8" |
142 | WHITESPACE@[201; 206) "\n " | 142 | SEMI@[200; 201) ";" |
143 | EXPR_STMT@[206; 213) | 143 | WHITESPACE@[201; 206) "\n " |
144 | BIN_EXPR@[206; 212) | 144 | EXPR_STMT@[206; 213) |
145 | PATH_EXPR@[206; 207) | 145 | BIN_EXPR@[206; 212) |
146 | PATH@[206; 207) | 146 | PATH_EXPR@[206; 207) |
147 | PATH_SEGMENT@[206; 207) | 147 | PATH@[206; 207) |
148 | NAME_REF@[206; 207) | 148 | PATH_SEGMENT@[206; 207) |
149 | IDENT@[206; 207) "a" | 149 | NAME_REF@[206; 207) |
150 | WHITESPACE@[207; 208) " " | 150 | IDENT@[206; 207) "a" |
151 | LTEQ@[208; 210) "<=" | 151 | WHITESPACE@[207; 208) " " |
152 | WHITESPACE@[210; 211) " " | 152 | LTEQ@[208; 210) "<=" |
153 | LITERAL@[211; 212) | 153 | WHITESPACE@[210; 211) " " |
154 | INT_NUMBER@[211; 212) "9" | 154 | LITERAL@[211; 212) |
155 | SEMI@[212; 213) ";" | 155 | INT_NUMBER@[211; 212) "9" |
156 | WHITESPACE@[213; 218) "\n " | 156 | SEMI@[212; 213) ";" |
157 | EXPR_STMT@[218; 226) | 157 | WHITESPACE@[213; 218) "\n " |
158 | BIN_EXPR@[218; 225) | 158 | EXPR_STMT@[218; 226) |
159 | PATH_EXPR@[218; 219) | 159 | BIN_EXPR@[218; 225) |
160 | PATH@[218; 219) | 160 | PATH_EXPR@[218; 219) |
161 | PATH_SEGMENT@[218; 219) | 161 | PATH@[218; 219) |
162 | NAME_REF@[218; 219) | 162 | PATH_SEGMENT@[218; 219) |
163 | IDENT@[218; 219) "a" | 163 | NAME_REF@[218; 219) |
164 | WHITESPACE@[219; 220) " " | 164 | IDENT@[218; 219) "a" |
165 | GTEQ@[220; 222) ">=" | 165 | WHITESPACE@[219; 220) " " |
166 | WHITESPACE@[222; 223) " " | 166 | GTEQ@[220; 222) ">=" |
167 | LITERAL@[223; 225) | 167 | WHITESPACE@[222; 223) " " |
168 | INT_NUMBER@[223; 225) "10" | 168 | LITERAL@[223; 225) |
169 | SEMI@[225; 226) ";" | 169 | INT_NUMBER@[223; 225) "10" |
170 | WHITESPACE@[226; 231) "\n " | 170 | SEMI@[225; 226) ";" |
171 | EXPR_STMT@[231; 240) | 171 | WHITESPACE@[226; 231) "\n " |
172 | BIN_EXPR@[231; 239) | 172 | EXPR_STMT@[231; 240) |
173 | PATH_EXPR@[231; 232) | 173 | BIN_EXPR@[231; 239) |
174 | PATH@[231; 232) | 174 | PATH_EXPR@[231; 232) |
175 | PATH_SEGMENT@[231; 232) | 175 | PATH@[231; 232) |
176 | NAME_REF@[231; 232) | 176 | PATH_SEGMENT@[231; 232) |
177 | IDENT@[231; 232) "a" | 177 | NAME_REF@[231; 232) |
178 | WHITESPACE@[232; 233) " " | 178 | IDENT@[231; 232) "a" |
179 | SHREQ@[233; 236) ">>=" | 179 | WHITESPACE@[232; 233) " " |
180 | WHITESPACE@[236; 237) " " | 180 | SHREQ@[233; 236) ">>=" |
181 | LITERAL@[237; 239) | 181 | WHITESPACE@[236; 237) " " |
182 | INT_NUMBER@[237; 239) "11" | 182 | LITERAL@[237; 239) |
183 | SEMI@[239; 240) ";" | 183 | INT_NUMBER@[237; 239) "11" |
184 | WHITESPACE@[240; 245) "\n " | 184 | SEMI@[239; 240) ";" |
185 | EXPR_STMT@[245; 254) | 185 | WHITESPACE@[240; 245) "\n " |
186 | BIN_EXPR@[245; 253) | 186 | EXPR_STMT@[245; 254) |
187 | PATH_EXPR@[245; 246) | 187 | BIN_EXPR@[245; 253) |
188 | PATH@[245; 246) | 188 | PATH_EXPR@[245; 246) |
189 | PATH_SEGMENT@[245; 246) | 189 | PATH@[245; 246) |
190 | NAME_REF@[245; 246) | 190 | PATH_SEGMENT@[245; 246) |
191 | IDENT@[245; 246) "a" | 191 | NAME_REF@[245; 246) |
192 | WHITESPACE@[246; 247) " " | 192 | IDENT@[245; 246) "a" |
193 | SHLEQ@[247; 250) "<<=" | 193 | WHITESPACE@[246; 247) " " |
194 | WHITESPACE@[250; 251) " " | 194 | SHLEQ@[247; 250) "<<=" |
195 | LITERAL@[251; 253) | 195 | WHITESPACE@[250; 251) " " |
196 | INT_NUMBER@[251; 253) "12" | 196 | LITERAL@[251; 253) |
197 | SEMI@[253; 254) ";" | 197 | INT_NUMBER@[251; 253) "12" |
198 | WHITESPACE@[254; 255) "\n" | 198 | SEMI@[253; 254) ";" |
199 | R_CURLY@[255; 256) "}" | 199 | WHITESPACE@[254; 255) "\n" |
200 | R_CURLY@[255; 256) "}" | ||
200 | WHITESPACE@[256; 257) "\n" | 201 | WHITESPACE@[256; 257) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0049_async_block.txt b/crates/ra_syntax/test_data/parser/ok/0049_async_block.txt index 517982ddc..aa6daff7d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0049_async_block.txt +++ b/crates/ra_syntax/test_data/parser/ok/0049_async_block.txt | |||
@@ -8,28 +8,29 @@ SOURCE_FILE@[0; 47) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 45) | 11 | BLOCK_EXPR@[9; 45) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 45) |
13 | WHITESPACE@[10; 15) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | EXPR_STMT@[15; 24) | 14 | WHITESPACE@[10; 15) "\n " |
15 | BLOCK_EXPR@[15; 23) | 15 | EXPR_STMT@[15; 24) |
16 | ASYNC_KW@[15; 20) "async" | 16 | BLOCK_EXPR@[15; 23) |
17 | WHITESPACE@[20; 21) " " | 17 | ASYNC_KW@[15; 20) "async" |
18 | BLOCK@[21; 23) | 18 | WHITESPACE@[20; 21) " " |
19 | L_CURLY@[21; 22) "{" | 19 | BLOCK@[21; 23) |
20 | R_CURLY@[22; 23) "}" | 20 | L_CURLY@[21; 22) "{" |
21 | SEMI@[23; 24) ";" | 21 | R_CURLY@[22; 23) "}" |
22 | WHITESPACE@[24; 29) "\n " | 22 | SEMI@[23; 24) ";" |
23 | EXPR_STMT@[29; 43) | 23 | WHITESPACE@[24; 29) "\n " |
24 | BLOCK_EXPR@[29; 42) | 24 | EXPR_STMT@[29; 43) |
25 | ASYNC_KW@[29; 34) "async" | 25 | BLOCK_EXPR@[29; 42) |
26 | WHITESPACE@[34; 35) " " | 26 | ASYNC_KW@[29; 34) "async" |
27 | MOVE_KW@[35; 39) "move" | 27 | WHITESPACE@[34; 35) " " |
28 | WHITESPACE@[39; 40) " " | 28 | MOVE_KW@[35; 39) "move" |
29 | BLOCK@[40; 42) | 29 | WHITESPACE@[39; 40) " " |
30 | L_CURLY@[40; 41) "{" | 30 | BLOCK@[40; 42) |
31 | R_CURLY@[41; 42) "}" | 31 | L_CURLY@[40; 41) "{" |
32 | SEMI@[42; 43) ";" | 32 | R_CURLY@[41; 42) "}" |
33 | WHITESPACE@[43; 44) "\n" | 33 | SEMI@[42; 43) ";" |
34 | R_CURLY@[44; 45) "}" | 34 | WHITESPACE@[43; 44) "\n" |
35 | R_CURLY@[44; 45) "}" | ||
35 | WHITESPACE@[45; 47) "\n\n" | 36 | WHITESPACE@[45; 47) "\n\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.txt b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.txt index 64da5878b..435f27970 100644 --- a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.txt +++ b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.txt | |||
@@ -48,9 +48,10 @@ SOURCE_FILE@[0; 95) | |||
48 | R_ANGLE@[47; 48) ">" | 48 | R_ANGLE@[47; 48) ">" |
49 | R_PAREN@[48; 49) ")" | 49 | R_PAREN@[48; 49) ")" |
50 | WHITESPACE@[49; 50) " " | 50 | WHITESPACE@[49; 50) " " |
51 | BLOCK@[50; 52) | 51 | BLOCK_EXPR@[50; 52) |
52 | L_CURLY@[50; 51) "{" | 52 | BLOCK@[50; 52) |
53 | R_CURLY@[51; 52) "}" | 53 | L_CURLY@[50; 51) "{" |
54 | R_CURLY@[51; 52) "}" | ||
54 | WHITESPACE@[52; 54) "\n\n" | 55 | WHITESPACE@[52; 54) "\n\n" |
55 | FN_DEF@[54; 94) | 56 | FN_DEF@[54; 94) |
56 | FN_KW@[54; 56) "fn" | 57 | FN_KW@[54; 56) "fn" |
@@ -61,30 +62,31 @@ SOURCE_FILE@[0; 95) | |||
61 | L_PAREN@[61; 62) "(" | 62 | L_PAREN@[61; 62) "(" |
62 | R_PAREN@[62; 63) ")" | 63 | R_PAREN@[62; 63) ")" |
63 | WHITESPACE@[63; 64) " " | 64 | WHITESPACE@[63; 64) " " |
64 | BLOCK@[64; 94) | 65 | BLOCK_EXPR@[64; 94) |
65 | L_CURLY@[64; 65) "{" | 66 | BLOCK@[64; 94) |
66 | WHITESPACE@[65; 70) "\n " | 67 | L_CURLY@[64; 65) "{" |
67 | CALL_EXPR@[70; 92) | 68 | WHITESPACE@[65; 70) "\n " |
68 | PATH_EXPR@[70; 73) | 69 | CALL_EXPR@[70; 92) |
69 | PATH@[70; 73) | 70 | PATH_EXPR@[70; 73) |
70 | PATH_SEGMENT@[70; 73) | 71 | PATH@[70; 73) |
71 | NAME_REF@[70; 73) | 72 | PATH_SEGMENT@[70; 73) |
72 | IDENT@[70; 73) "foo" | 73 | NAME_REF@[70; 73) |
73 | ARG_LIST@[73; 92) | 74 | IDENT@[70; 73) "foo" |
74 | L_PAREN@[73; 74) "(" | 75 | ARG_LIST@[73; 92) |
75 | BLOCK_EXPR@[74; 91) | 76 | L_PAREN@[73; 74) "(" |
76 | ASYNC_KW@[74; 79) "async" | 77 | BLOCK_EXPR@[74; 91) |
77 | WHITESPACE@[79; 80) " " | 78 | ASYNC_KW@[74; 79) "async" |
78 | MOVE_KW@[80; 84) "move" | 79 | WHITESPACE@[79; 80) " " |
79 | WHITESPACE@[84; 85) " " | 80 | MOVE_KW@[80; 84) "move" |
80 | BLOCK@[85; 91) | 81 | WHITESPACE@[84; 85) " " |
81 | L_CURLY@[85; 86) "{" | 82 | BLOCK@[85; 91) |
82 | WHITESPACE@[86; 87) " " | 83 | L_CURLY@[85; 86) "{" |
83 | LITERAL@[87; 89) | 84 | WHITESPACE@[86; 87) " " |
84 | INT_NUMBER@[87; 89) "12" | 85 | LITERAL@[87; 89) |
85 | WHITESPACE@[89; 90) " " | 86 | INT_NUMBER@[87; 89) "12" |
86 | R_CURLY@[90; 91) "}" | 87 | WHITESPACE@[89; 90) " " |
87 | R_PAREN@[91; 92) ")" | 88 | R_CURLY@[90; 91) "}" |
88 | WHITESPACE@[92; 93) "\n" | 89 | R_PAREN@[91; 92) ")" |
89 | R_CURLY@[93; 94) "}" | 90 | WHITESPACE@[92; 93) "\n" |
91 | R_CURLY@[93; 94) "}" | ||
90 | WHITESPACE@[94; 95) "\n" | 92 | WHITESPACE@[94; 95) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt index b360f29f4..e08fb4988 100644 --- a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.txt | |||
@@ -33,9 +33,10 @@ SOURCE_FILE@[0; 519) | |||
33 | IDENT@[29; 33) "Type" | 33 | IDENT@[29; 33) "Type" |
34 | R_PAREN@[33; 34) ")" | 34 | R_PAREN@[33; 34) ")" |
35 | WHITESPACE@[34; 35) " " | 35 | WHITESPACE@[34; 35) " " |
36 | BLOCK@[35; 37) | 36 | BLOCK_EXPR@[35; 37) |
37 | L_CURLY@[35; 36) "{" | 37 | BLOCK@[35; 37) |
38 | R_CURLY@[36; 37) "}" | 38 | L_CURLY@[35; 36) "{" |
39 | R_CURLY@[36; 37) "}" | ||
39 | WHITESPACE@[37; 38) "\n" | 40 | WHITESPACE@[37; 38) "\n" |
40 | FN_DEF@[38; 62) | 41 | FN_DEF@[38; 62) |
41 | FN_KW@[38; 40) "fn" | 42 | FN_KW@[38; 40) "fn" |
@@ -64,9 +65,10 @@ SOURCE_FILE@[0; 519) | |||
64 | IDENT@[56; 58) "u8" | 65 | IDENT@[56; 58) "u8" |
65 | R_PAREN@[58; 59) ")" | 66 | R_PAREN@[58; 59) ")" |
66 | WHITESPACE@[59; 60) " " | 67 | WHITESPACE@[59; 60) " " |
67 | BLOCK@[60; 62) | 68 | BLOCK_EXPR@[60; 62) |
68 | L_CURLY@[60; 61) "{" | 69 | BLOCK@[60; 62) |
69 | R_CURLY@[61; 62) "}" | 70 | L_CURLY@[60; 61) "{" |
71 | R_CURLY@[61; 62) "}" | ||
70 | WHITESPACE@[62; 64) "\n\n" | 72 | WHITESPACE@[62; 64) "\n\n" |
71 | EXTERN_BLOCK@[64; 128) | 73 | EXTERN_BLOCK@[64; 128) |
72 | ABI@[64; 74) | 74 | ABI@[64; 74) |
@@ -171,9 +173,10 @@ SOURCE_FILE@[0; 519) | |||
171 | PARAM_LIST@[168; 170) | 173 | PARAM_LIST@[168; 170) |
172 | L_PAREN@[168; 169) "(" | 174 | L_PAREN@[168; 169) "(" |
173 | R_PAREN@[169; 170) ")" | 175 | R_PAREN@[169; 170) ")" |
174 | BLOCK@[170; 172) | 176 | BLOCK_EXPR@[170; 172) |
175 | L_CURLY@[170; 171) "{" | 177 | BLOCK@[170; 172) |
176 | R_CURLY@[171; 172) "}" | 178 | L_CURLY@[170; 171) "{" |
179 | R_CURLY@[171; 172) "}" | ||
177 | WHITESPACE@[172; 174) "\n\n" | 180 | WHITESPACE@[172; 174) "\n\n" |
178 | TRAIT_DEF@[174; 236) | 181 | TRAIT_DEF@[174; 236) |
179 | TRAIT_KW@[174; 179) "trait" | 182 | TRAIT_KW@[174; 179) "trait" |
@@ -266,9 +269,10 @@ SOURCE_FILE@[0; 519) | |||
266 | SELF_KW@[269; 273) "self" | 269 | SELF_KW@[269; 273) "self" |
267 | R_PAREN@[273; 274) ")" | 270 | R_PAREN@[273; 274) ")" |
268 | WHITESPACE@[274; 275) " " | 271 | WHITESPACE@[274; 275) " " |
269 | BLOCK@[275; 277) | 272 | BLOCK_EXPR@[275; 277) |
270 | L_CURLY@[275; 276) "{" | 273 | BLOCK@[275; 277) |
271 | R_CURLY@[276; 277) "}" | 274 | L_CURLY@[275; 276) "{" |
275 | R_CURLY@[276; 277) "}" | ||
272 | WHITESPACE@[277; 283) "\n " | 276 | WHITESPACE@[277; 283) "\n " |
273 | FN_DEF@[283; 305) | 277 | FN_DEF@[283; 305) |
274 | FN_KW@[283; 285) "fn" | 278 | FN_KW@[283; 285) "fn" |
@@ -288,9 +292,10 @@ SOURCE_FILE@[0; 519) | |||
288 | SELF_KW@[297; 301) "self" | 292 | SELF_KW@[297; 301) "self" |
289 | R_PAREN@[301; 302) ")" | 293 | R_PAREN@[301; 302) ")" |
290 | WHITESPACE@[302; 303) " " | 294 | WHITESPACE@[302; 303) " " |
291 | BLOCK@[303; 305) | 295 | BLOCK_EXPR@[303; 305) |
292 | L_CURLY@[303; 304) "{" | 296 | BLOCK@[303; 305) |
293 | R_CURLY@[304; 305) "}" | 297 | L_CURLY@[303; 304) "{" |
298 | R_CURLY@[304; 305) "}" | ||
294 | WHITESPACE@[305; 311) "\n " | 299 | WHITESPACE@[305; 311) "\n " |
295 | FN_DEF@[311; 334) | 300 | FN_DEF@[311; 334) |
296 | FN_KW@[311; 313) "fn" | 301 | FN_KW@[311; 313) "fn" |
@@ -311,9 +316,10 @@ SOURCE_FILE@[0; 519) | |||
311 | SELF_KW@[326; 330) "self" | 316 | SELF_KW@[326; 330) "self" |
312 | R_PAREN@[330; 331) ")" | 317 | R_PAREN@[330; 331) ")" |
313 | WHITESPACE@[331; 332) " " | 318 | WHITESPACE@[331; 332) " " |
314 | BLOCK@[332; 334) | 319 | BLOCK_EXPR@[332; 334) |
315 | L_CURLY@[332; 333) "{" | 320 | BLOCK@[332; 334) |
316 | R_CURLY@[333; 334) "}" | 321 | L_CURLY@[332; 333) "{" |
322 | R_CURLY@[333; 334) "}" | ||
317 | WHITESPACE@[334; 340) "\n " | 323 | WHITESPACE@[334; 340) "\n " |
318 | FN_DEF@[340; 371) | 324 | FN_DEF@[340; 371) |
319 | FN_KW@[340; 342) "fn" | 325 | FN_KW@[340; 342) "fn" |
@@ -341,9 +347,10 @@ SOURCE_FILE@[0; 519) | |||
341 | SELF_KW@[363; 367) "self" | 347 | SELF_KW@[363; 367) "self" |
342 | R_PAREN@[367; 368) ")" | 348 | R_PAREN@[367; 368) ")" |
343 | WHITESPACE@[368; 369) " " | 349 | WHITESPACE@[368; 369) " " |
344 | BLOCK@[369; 371) | 350 | BLOCK_EXPR@[369; 371) |
345 | L_CURLY@[369; 370) "{" | 351 | BLOCK@[369; 371) |
346 | R_CURLY@[370; 371) "}" | 352 | L_CURLY@[369; 370) "{" |
353 | R_CURLY@[370; 371) "}" | ||
347 | WHITESPACE@[371; 377) "\n " | 354 | WHITESPACE@[371; 377) "\n " |
348 | FN_DEF@[377; 407) | 355 | FN_DEF@[377; 407) |
349 | FN_KW@[377; 379) "fn" | 356 | FN_KW@[377; 379) "fn" |
@@ -371,9 +378,10 @@ SOURCE_FILE@[0; 519) | |||
371 | SELF_KW@[399; 403) "self" | 378 | SELF_KW@[399; 403) "self" |
372 | R_PAREN@[403; 404) ")" | 379 | R_PAREN@[403; 404) ")" |
373 | WHITESPACE@[404; 405) " " | 380 | WHITESPACE@[404; 405) " " |
374 | BLOCK@[405; 407) | 381 | BLOCK_EXPR@[405; 407) |
375 | L_CURLY@[405; 406) "{" | 382 | BLOCK@[405; 407) |
376 | R_CURLY@[406; 407) "}" | 383 | L_CURLY@[405; 406) "{" |
384 | R_CURLY@[406; 407) "}" | ||
377 | WHITESPACE@[407; 413) "\n " | 385 | WHITESPACE@[407; 413) "\n " |
378 | FN_DEF@[413; 447) | 386 | FN_DEF@[413; 447) |
379 | FN_KW@[413; 415) "fn" | 387 | FN_KW@[413; 415) "fn" |
@@ -403,9 +411,10 @@ SOURCE_FILE@[0; 519) | |||
403 | SELF_KW@[439; 443) "self" | 411 | SELF_KW@[439; 443) "self" |
404 | R_PAREN@[443; 444) ")" | 412 | R_PAREN@[443; 444) ")" |
405 | WHITESPACE@[444; 445) " " | 413 | WHITESPACE@[444; 445) " " |
406 | BLOCK@[445; 447) | 414 | BLOCK_EXPR@[445; 447) |
407 | L_CURLY@[445; 446) "{" | 415 | BLOCK@[445; 447) |
408 | R_CURLY@[446; 447) "}" | 416 | L_CURLY@[445; 446) "{" |
417 | R_CURLY@[446; 447) "}" | ||
409 | WHITESPACE@[447; 453) "\n " | 418 | WHITESPACE@[447; 453) "\n " |
410 | FN_DEF@[453; 480) | 419 | FN_DEF@[453; 480) |
411 | FN_KW@[453; 455) "fn" | 420 | FN_KW@[453; 455) "fn" |
@@ -432,9 +441,10 @@ SOURCE_FILE@[0; 519) | |||
432 | IDENT@[472; 476) "Self" | 441 | IDENT@[472; 476) "Self" |
433 | R_PAREN@[476; 477) ")" | 442 | R_PAREN@[476; 477) ")" |
434 | WHITESPACE@[477; 478) " " | 443 | WHITESPACE@[477; 478) " " |
435 | BLOCK@[478; 480) | 444 | BLOCK_EXPR@[478; 480) |
436 | L_CURLY@[478; 479) "{" | 445 | BLOCK@[478; 480) |
437 | R_CURLY@[479; 480) "}" | 446 | L_CURLY@[478; 479) "{" |
447 | R_CURLY@[479; 480) "}" | ||
438 | WHITESPACE@[480; 486) "\n " | 448 | WHITESPACE@[480; 486) "\n " |
439 | FN_DEF@[486; 517) | 449 | FN_DEF@[486; 517) |
440 | FN_KW@[486; 488) "fn" | 450 | FN_KW@[486; 488) "fn" |
@@ -470,8 +480,9 @@ SOURCE_FILE@[0; 519) | |||
470 | R_ANGLE@[512; 513) ">" | 480 | R_ANGLE@[512; 513) ">" |
471 | R_PAREN@[513; 514) ")" | 481 | R_PAREN@[513; 514) ")" |
472 | WHITESPACE@[514; 515) " " | 482 | WHITESPACE@[514; 515) " " |
473 | BLOCK@[515; 517) | 483 | BLOCK_EXPR@[515; 517) |
474 | L_CURLY@[515; 516) "{" | 484 | BLOCK@[515; 517) |
475 | R_CURLY@[516; 517) "}" | 485 | L_CURLY@[515; 516) "{" |
486 | R_CURLY@[516; 517) "}" | ||
476 | WHITESPACE@[517; 518) "\n" | 487 | WHITESPACE@[517; 518) "\n" |
477 | R_CURLY@[518; 519) "}" | 488 | R_CURLY@[518; 519) "}" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt index 858f042c6..374c58670 100644 --- a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt +++ b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.txt | |||
@@ -8,72 +8,74 @@ SOURCE_FILE@[0; 80) | |||
8 | L_PAREN@[6; 7) "(" | 8 | L_PAREN@[6; 7) "(" |
9 | R_PAREN@[7; 8) ")" | 9 | R_PAREN@[7; 8) ")" |
10 | WHITESPACE@[8; 9) " " | 10 | WHITESPACE@[8; 9) " " |
11 | BLOCK@[9; 79) | 11 | BLOCK_EXPR@[9; 79) |
12 | L_CURLY@[9; 10) "{" | 12 | BLOCK@[9; 79) |
13 | WHITESPACE@[10; 14) "\n " | 13 | L_CURLY@[9; 10) "{" |
14 | FOR_EXPR@[14; 77) | 14 | WHITESPACE@[10; 14) "\n " |
15 | FOR_KW@[14; 17) "for" | 15 | FOR_EXPR@[14; 77) |
16 | WHITESPACE@[17; 18) " " | 16 | FOR_KW@[14; 17) "for" |
17 | BIND_PAT@[18; 20) | 17 | WHITESPACE@[17; 18) " " |
18 | NAME@[18; 20) | 18 | BIND_PAT@[18; 20) |
19 | IDENT@[18; 20) "_x" | 19 | NAME@[18; 20) |
20 | WHITESPACE@[20; 21) " " | 20 | IDENT@[18; 20) "_x" |
21 | IN_KW@[21; 23) "in" | 21 | WHITESPACE@[20; 21) " " |
22 | WHITESPACE@[23; 24) " " | 22 | IN_KW@[21; 23) "in" |
23 | RANGE_EXPR@[24; 56) | 23 | WHITESPACE@[23; 24) " " |
24 | LITERAL@[24; 25) | 24 | RANGE_EXPR@[24; 56) |
25 | INT_NUMBER@[24; 25) "0" | 25 | LITERAL@[24; 25) |
26 | WHITESPACE@[25; 26) " " | 26 | INT_NUMBER@[24; 25) "0" |
27 | DOTDOT@[26; 28) ".." | 27 | WHITESPACE@[25; 26) " " |
28 | WHITESPACE@[28; 29) " " | 28 | DOTDOT@[26; 28) ".." |
29 | METHOD_CALL_EXPR@[29; 56) | 29 | WHITESPACE@[28; 29) " " |
30 | PAREN_EXPR@[29; 43) | 30 | METHOD_CALL_EXPR@[29; 56) |
31 | L_PAREN@[29; 30) "(" | 31 | PAREN_EXPR@[29; 43) |
32 | RANGE_EXPR@[30; 42) | 32 | L_PAREN@[29; 30) "(" |
33 | LITERAL@[30; 31) | 33 | RANGE_EXPR@[30; 42) |
34 | INT_NUMBER@[30; 31) "0" | 34 | LITERAL@[30; 31) |
35 | WHITESPACE@[31; 32) " " | 35 | INT_NUMBER@[30; 31) "0" |
36 | DOTDOT@[32; 34) ".." | 36 | WHITESPACE@[31; 32) " " |
37 | WHITESPACE@[34; 35) " " | 37 | DOTDOT@[32; 34) ".." |
38 | BLOCK_EXPR@[35; 42) | 38 | WHITESPACE@[34; 35) " " |
39 | BLOCK@[35; 42) | 39 | BLOCK_EXPR@[35; 42) |
40 | L_CURLY@[35; 36) "{" | 40 | BLOCK@[35; 42) |
41 | BIN_EXPR@[36; 41) | 41 | L_CURLY@[35; 36) "{" |
42 | LITERAL@[36; 37) | 42 | BIN_EXPR@[36; 41) |
43 | INT_NUMBER@[36; 37) "1" | 43 | LITERAL@[36; 37) |
44 | WHITESPACE@[37; 38) " " | 44 | INT_NUMBER@[36; 37) "1" |
45 | PLUS@[38; 39) "+" | 45 | WHITESPACE@[37; 38) " " |
46 | WHITESPACE@[39; 40) " " | 46 | PLUS@[38; 39) "+" |
47 | LITERAL@[40; 41) | 47 | WHITESPACE@[39; 40) " " |
48 | INT_NUMBER@[40; 41) "2" | 48 | LITERAL@[40; 41) |
49 | R_CURLY@[41; 42) "}" | 49 | INT_NUMBER@[40; 41) "2" |
50 | R_PAREN@[42; 43) ")" | 50 | R_CURLY@[41; 42) "}" |
51 | DOT@[43; 44) "." | 51 | R_PAREN@[42; 43) ")" |
52 | NAME_REF@[44; 47) | 52 | DOT@[43; 44) "." |
53 | IDENT@[44; 47) "sum" | 53 | NAME_REF@[44; 47) |
54 | TYPE_ARG_LIST@[47; 54) | 54 | IDENT@[44; 47) "sum" |
55 | COLONCOLON@[47; 49) "::" | 55 | TYPE_ARG_LIST@[47; 54) |
56 | L_ANGLE@[49; 50) "<" | 56 | COLONCOLON@[47; 49) "::" |
57 | TYPE_ARG@[50; 53) | 57 | L_ANGLE@[49; 50) "<" |
58 | PATH_TYPE@[50; 53) | 58 | TYPE_ARG@[50; 53) |
59 | PATH@[50; 53) | 59 | PATH_TYPE@[50; 53) |
60 | PATH_SEGMENT@[50; 53) | 60 | PATH@[50; 53) |
61 | NAME_REF@[50; 53) | 61 | PATH_SEGMENT@[50; 53) |
62 | IDENT@[50; 53) "u32" | 62 | NAME_REF@[50; 53) |
63 | R_ANGLE@[53; 54) ">" | 63 | IDENT@[50; 53) "u32" |
64 | ARG_LIST@[54; 56) | 64 | R_ANGLE@[53; 54) ">" |
65 | L_PAREN@[54; 55) "(" | 65 | ARG_LIST@[54; 56) |
66 | R_PAREN@[55; 56) ")" | 66 | L_PAREN@[54; 55) "(" |
67 | WHITESPACE@[56; 57) " " | 67 | R_PAREN@[55; 56) ")" |
68 | BLOCK@[57; 77) | 68 | WHITESPACE@[56; 57) " " |
69 | L_CURLY@[57; 58) "{" | 69 | BLOCK_EXPR@[57; 77) |
70 | WHITESPACE@[58; 66) "\n " | 70 | BLOCK@[57; 77) |
71 | EXPR_STMT@[66; 72) | 71 | L_CURLY@[57; 58) "{" |
72 | BREAK_EXPR@[66; 71) | 72 | WHITESPACE@[58; 66) "\n " |
73 | BREAK_KW@[66; 71) "break" | 73 | EXPR_STMT@[66; 72) |
74 | SEMI@[71; 72) ";" | 74 | BREAK_EXPR@[66; 71) |
75 | WHITESPACE@[72; 76) "\n " | 75 | BREAK_KW@[66; 71) "break" |
76 | R_CURLY@[76; 77) "}" | 76 | SEMI@[71; 72) ";" |
77 | WHITESPACE@[77; 78) "\n" | 77 | WHITESPACE@[72; 76) "\n " |
78 | R_CURLY@[78; 79) "}" | 78 | R_CURLY@[76; 77) "}" |
79 | WHITESPACE@[77; 78) "\n" | ||
80 | R_CURLY@[78; 79) "}" | ||
79 | WHITESPACE@[79; 80) "\n" | 81 | WHITESPACE@[79; 80) "\n" |
diff --git a/website/src/index.html b/website/src/index.html new file mode 100644 index 000000000..6fe22227b --- /dev/null +++ b/website/src/index.html | |||
@@ -0,0 +1,21 @@ | |||
1 | <!DOCTYPE HTML> | ||
2 | <html> | ||
3 | |||
4 | <head> | ||
5 | <meta charset="utf-8"> | ||
6 | <title>Hello World! Site Title</title> | ||
7 | </head> | ||
8 | |||
9 | <body> | ||
10 | <h1>rust-analyzer</h1> | ||
11 | <ul> | ||
12 | <li> | ||
13 | <a href="./api-docs/ra_ide_api/">API Docs</a> | ||
14 | </li> | ||
15 | <li> | ||
16 | <a href="./wasm-demo/">WASM Demo</a> | ||
17 | </li> | ||
18 | </ul> | ||
19 | </body> | ||
20 | |||
21 | </html> | ||
diff --git a/website/src/wasm-demo/index.html b/website/src/wasm-demo/index.html new file mode 100644 index 000000000..e81ccb0f7 --- /dev/null +++ b/website/src/wasm-demo/index.html | |||
@@ -0,0 +1,13 @@ | |||
1 | <!DOCTYPE HTML> | ||
2 | <html> | ||
3 | |||
4 | <head> | ||
5 | <meta charset="utf-8"> | ||
6 | <title>Hello World! Site Title</title> | ||
7 | </head> | ||
8 | |||
9 | <body> | ||
10 | TBD | ||
11 | </body> | ||
12 | |||
13 | </html> | ||
diff --git a/website/website-gen/Cargo.toml b/website/website-gen/Cargo.toml new file mode 100644 index 000000000..b471a81fd --- /dev/null +++ b/website/website-gen/Cargo.toml | |||
@@ -0,0 +1,9 @@ | |||
1 | [package] | ||
2 | name = "website-gen" | ||
3 | version = "0.0.0" | ||
4 | authors = ["Aleksey Kladov <[email protected]>"] | ||
5 | edition = "2018" | ||
6 | publish = false | ||
7 | |||
8 | [dependencies] | ||
9 | walkdir = "2.2.0" | ||
diff --git a/website/website-gen/src/main.rs b/website/website-gen/src/main.rs new file mode 100644 index 000000000..7d35a37cf --- /dev/null +++ b/website/website-gen/src/main.rs | |||
@@ -0,0 +1,64 @@ | |||
1 | use std::{fs, path::Path, process::Command}; | ||
2 | |||
3 | type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; | ||
4 | |||
5 | /// This tool builds the github-pages website to the `./target/website` folder | ||
6 | fn main() { | ||
7 | if let Err(err) = try_main() { | ||
8 | eprintln!("{}", err); | ||
9 | std::process::exit(-1); | ||
10 | } | ||
11 | } | ||
12 | |||
13 | fn try_main() -> Result<()> { | ||
14 | check_cwd()?; | ||
15 | build_scaffold()?; | ||
16 | build_docs()?; | ||
17 | println!("Finished\n./target/website/index.html"); | ||
18 | Ok(()) | ||
19 | } | ||
20 | |||
21 | fn cargo() -> Command { | ||
22 | Command::new("cargo") | ||
23 | } | ||
24 | |||
25 | fn check_cwd() -> Result<()> { | ||
26 | let toml = std::fs::read_to_string("./Cargo.toml")?; | ||
27 | if !toml.contains("[workspace]") { | ||
28 | Err("website-gen should be run from the root of workspace")?; | ||
29 | } | ||
30 | Ok(()) | ||
31 | } | ||
32 | |||
33 | fn build_docs() -> Result<()> { | ||
34 | let status = cargo().args(&["doc", "--all", "--no-deps"]).status()?; | ||
35 | if !status.success() { | ||
36 | Err("cargo doc failed")?; | ||
37 | } | ||
38 | sync_dir("./target/doc", "./target/website/api-docs")?; | ||
39 | Ok(()) | ||
40 | } | ||
41 | |||
42 | fn build_scaffold() -> Result<()> { | ||
43 | sync_dir("./website/src", "./target/website") | ||
44 | } | ||
45 | |||
46 | fn sync_dir(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<()> { | ||
47 | return sync_dir(src.as_ref(), dst.as_ref()); | ||
48 | |||
49 | fn sync_dir(src: &Path, dst: &Path) -> Result<()> { | ||
50 | let _ = fs::remove_dir_all(dst); | ||
51 | fs::create_dir_all(dst)?; | ||
52 | for entry in walkdir::WalkDir::new(src) { | ||
53 | let entry = entry?; | ||
54 | let src_path = entry.path(); | ||
55 | let dst_path = dst.join(src_path.strip_prefix(src)?); | ||
56 | if src_path.is_dir() { | ||
57 | fs::create_dir_all(dst_path)?; | ||
58 | } else { | ||
59 | fs::copy(src_path, dst_path)?; | ||
60 | } | ||
61 | } | ||
62 | Ok(()) | ||
63 | } | ||
64 | } | ||