diff options
Diffstat (limited to 'crates/syntax')
21 files changed, 87 insertions, 41 deletions
diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 1456270d0..827ae78f9 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs | |||
@@ -879,7 +879,7 @@ use crate::AstNode; | |||
879 | 879 | ||
880 | replacements: | 880 | replacements: |
881 | 881 | ||
882 | Line 2: Node(NAME_REF@5..14) -> crate | 882 | Line 2: Token(IDENT@5..14 "text_edit") -> crate |
883 | Line 2: Token(IDENT@16..24 "TextEdit") -> AstNode | 883 | Line 2: Token(IDENT@16..24 "TextEdit") -> AstNode |
884 | Line 2: Token(WHITESPACE@25..27 "\n\n") -> "\n" | 884 | Line 2: Token(WHITESPACE@25..27 "\n\n") -> "\n" |
885 | 885 | ||
diff --git a/crates/syntax/src/ast/generated/nodes.rs b/crates/syntax/src/ast/generated/nodes.rs index 9c96d3d07..1d722db3c 100644 --- a/crates/syntax/src/ast/generated/nodes.rs +++ b/crates/syntax/src/ast/generated/nodes.rs | |||
@@ -18,6 +18,9 @@ pub struct NameRef { | |||
18 | } | 18 | } |
19 | impl NameRef { | 19 | impl NameRef { |
20 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } | 20 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } |
21 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
22 | pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) } | ||
23 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } | ||
21 | } | 24 | } |
22 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 25 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
23 | pub struct Lifetime { | 26 | pub struct Lifetime { |
@@ -42,9 +45,6 @@ pub struct PathSegment { | |||
42 | pub(crate) syntax: SyntaxNode, | 45 | pub(crate) syntax: SyntaxNode, |
43 | } | 46 | } |
44 | impl PathSegment { | 47 | impl PathSegment { |
45 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } | ||
46 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
47 | pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) } | ||
48 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } | 48 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
49 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 49 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
50 | pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) } | 50 | pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) } |
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index 27381ba80..b8ce71d27 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs | |||
@@ -156,14 +156,28 @@ impl ast::PathSegment { | |||
156 | .expect("segments are always nested in paths") | 156 | .expect("segments are always nested in paths") |
157 | } | 157 | } |
158 | 158 | ||
159 | pub fn crate_token(&self) -> Option<SyntaxToken> { | ||
160 | self.name_ref().and_then(|it| it.crate_token()) | ||
161 | } | ||
162 | |||
163 | pub fn self_token(&self) -> Option<SyntaxToken> { | ||
164 | self.name_ref().and_then(|it| it.self_token()) | ||
165 | } | ||
166 | |||
167 | pub fn super_token(&self) -> Option<SyntaxToken> { | ||
168 | self.name_ref().and_then(|it| it.super_token()) | ||
169 | } | ||
170 | |||
159 | pub fn kind(&self) -> Option<PathSegmentKind> { | 171 | pub fn kind(&self) -> Option<PathSegmentKind> { |
160 | let res = if let Some(name_ref) = self.name_ref() { | 172 | let res = if let Some(name_ref) = self.name_ref() { |
161 | PathSegmentKind::Name(name_ref) | 173 | match name_ref.syntax().first_token().map(|it| it.kind()) { |
174 | Some(T![self]) => PathSegmentKind::SelfKw, | ||
175 | Some(T![super]) => PathSegmentKind::SuperKw, | ||
176 | Some(T![crate]) => PathSegmentKind::CrateKw, | ||
177 | _ => PathSegmentKind::Name(name_ref), | ||
178 | } | ||
162 | } else { | 179 | } else { |
163 | match self.syntax().first_child_or_token()?.kind() { | 180 | match self.syntax().first_child_or_token()?.kind() { |
164 | T![self] => PathSegmentKind::SelfKw, | ||
165 | T![super] => PathSegmentKind::SuperKw, | ||
166 | T![crate] => PathSegmentKind::CrateKw, | ||
167 | T![<] => { | 181 | T![<] => { |
168 | // <T> or <T as Trait> | 182 | // <T> or <T as Trait> |
169 | // T is any TypeRef, Trait has to be a PathType | 183 | // T is any TypeRef, Trait has to be a PathType |
diff --git a/crates/syntax/src/validation.rs b/crates/syntax/src/validation.rs index bfa2dc4ba..7901580ee 100644 --- a/crates/syntax/src/validation.rs +++ b/crates/syntax/src/validation.rs | |||
@@ -256,7 +256,7 @@ fn validate_path_keywords(segment: ast::PathSegment, errors: &mut Vec<SyntaxErro | |||
256 | )); | 256 | )); |
257 | } | 257 | } |
258 | } else if let Some(token) = segment.super_token() { | 258 | } else if let Some(token) = segment.super_token() { |
259 | if !all_supers(&path) { | 259 | if segment.coloncolon_token().is_some() || !all_supers(&path) { |
260 | errors.push(SyntaxError::new( | 260 | errors.push(SyntaxError::new( |
261 | "The `super` keyword may only be preceded by other `super`s", | 261 | "The `super` keyword may only be preceded by other `super`s", |
262 | token.text_range(), | 262 | token.text_range(), |
diff --git a/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast index 72939fc98..060f47dc4 100644 --- a/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast +++ b/crates/syntax/test_data/parser/err/0018_incomplete_fn.rast | |||
@@ -49,7 +49,8 @@ SOURCE_FILE@0..183 | |||
49 | PATH_EXPR@67..71 | 49 | PATH_EXPR@67..71 |
50 | PATH@67..71 | 50 | PATH@67..71 |
51 | PATH_SEGMENT@67..71 | 51 | PATH_SEGMENT@67..71 |
52 | SELF_KW@67..71 "self" | 52 | NAME_REF@67..71 |
53 | SELF_KW@67..71 "self" | ||
53 | DOT@71..72 "." | 54 | DOT@71..72 "." |
54 | NAME_REF@72..78 | 55 | NAME_REF@72..78 |
55 | IDENT@72..78 "scopes" | 56 | IDENT@72..78 "scopes" |
@@ -66,7 +67,8 @@ SOURCE_FILE@0..183 | |||
66 | PATH_EXPR@94..98 | 67 | PATH_EXPR@94..98 |
67 | PATH@94..98 | 68 | PATH@94..98 |
68 | PATH_SEGMENT@94..98 | 69 | PATH_SEGMENT@94..98 |
69 | SELF_KW@94..98 "self" | 70 | NAME_REF@94..98 |
71 | SELF_KW@94..98 "self" | ||
70 | DOT@98..99 "." | 72 | DOT@98..99 "." |
71 | NAME_REF@99..105 | 73 | NAME_REF@99..105 |
72 | IDENT@99..105 "scopes" | 74 | IDENT@99..105 "scopes" |
diff --git a/crates/syntax/test_data/parser/err/0035_use_recover.rast b/crates/syntax/test_data/parser/err/0035_use_recover.rast index 2f03709eb..a95151bc5 100644 --- a/crates/syntax/test_data/parser/err/0035_use_recover.rast +++ b/crates/syntax/test_data/parser/err/0035_use_recover.rast | |||
@@ -24,7 +24,8 @@ SOURCE_FILE@0..48 | |||
24 | PATH@22..32 | 24 | PATH@22..32 |
25 | PATH@22..27 | 25 | PATH@22..27 |
26 | PATH_SEGMENT@22..27 | 26 | PATH_SEGMENT@22..27 |
27 | CRATE_KW@22..27 "crate" | 27 | NAME_REF@22..27 |
28 | CRATE_KW@22..27 "crate" | ||
28 | COLON2@27..29 "::" | 29 | COLON2@27..29 "::" |
29 | PATH_SEGMENT@29..32 | 30 | PATH_SEGMENT@29..32 |
30 | NAME_REF@29..32 | 31 | NAME_REF@29..32 |
diff --git a/crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rast b/crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rast index 284c8715b..7449b5ddf 100644 --- a/crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rast +++ b/crates/syntax/test_data/parser/err/0040_illegal_crate_kw_location.rast | |||
@@ -6,7 +6,8 @@ SOURCE_FILE@0..98 | |||
6 | PATH@4..11 | 6 | PATH@4..11 |
7 | PATH_SEGMENT@4..11 | 7 | PATH_SEGMENT@4..11 |
8 | COLON2@4..6 "::" | 8 | COLON2@4..6 "::" |
9 | CRATE_KW@6..11 "crate" | 9 | NAME_REF@6..11 |
10 | CRATE_KW@6..11 "crate" | ||
10 | SEMICOLON@11..12 ";" | 11 | SEMICOLON@11..12 ";" |
11 | WHITESPACE@12..13 "\n" | 12 | WHITESPACE@12..13 "\n" |
12 | USE@13..54 | 13 | USE@13..54 |
@@ -18,7 +19,8 @@ SOURCE_FILE@0..98 | |||
18 | USE_TREE@18..23 | 19 | USE_TREE@18..23 |
19 | PATH@18..23 | 20 | PATH@18..23 |
20 | PATH_SEGMENT@18..23 | 21 | PATH_SEGMENT@18..23 |
21 | CRATE_KW@18..23 "crate" | 22 | NAME_REF@18..23 |
23 | CRATE_KW@18..23 "crate" | ||
22 | COMMA@23..24 "," | 24 | COMMA@23..24 "," |
23 | WHITESPACE@24..25 " " | 25 | WHITESPACE@24..25 " " |
24 | USE_TREE@25..52 | 26 | USE_TREE@25..52 |
@@ -35,7 +37,8 @@ SOURCE_FILE@0..98 | |||
35 | PATH@31..41 | 37 | PATH@31..41 |
36 | PATH@31..36 | 38 | PATH@31..36 |
37 | PATH_SEGMENT@31..36 | 39 | PATH_SEGMENT@31..36 |
38 | CRATE_KW@31..36 "crate" | 40 | NAME_REF@31..36 |
41 | CRATE_KW@31..36 "crate" | ||
39 | COLON2@36..38 "::" | 42 | COLON2@36..38 "::" |
40 | PATH_SEGMENT@38..41 | 43 | PATH_SEGMENT@38..41 |
41 | NAME_REF@38..41 | 44 | NAME_REF@38..41 |
@@ -63,7 +66,8 @@ SOURCE_FILE@0..98 | |||
63 | IDENT@59..64 "hello" | 66 | IDENT@59..64 "hello" |
64 | COLON2@64..66 "::" | 67 | COLON2@64..66 "::" |
65 | PATH_SEGMENT@66..71 | 68 | PATH_SEGMENT@66..71 |
66 | CRATE_KW@66..71 "crate" | 69 | NAME_REF@66..71 |
70 | CRATE_KW@66..71 "crate" | ||
67 | SEMICOLON@71..72 ";" | 71 | SEMICOLON@71..72 ";" |
68 | WHITESPACE@72..73 "\n" | 72 | WHITESPACE@72..73 "\n" |
69 | USE@73..97 | 73 | USE@73..97 |
@@ -78,7 +82,8 @@ SOURCE_FILE@0..98 | |||
78 | IDENT@77..82 "hello" | 82 | IDENT@77..82 "hello" |
79 | COLON2@82..84 "::" | 83 | COLON2@82..84 "::" |
80 | PATH_SEGMENT@84..89 | 84 | PATH_SEGMENT@84..89 |
81 | CRATE_KW@84..89 "crate" | 85 | NAME_REF@84..89 |
86 | CRATE_KW@84..89 "crate" | ||
82 | COLON2@89..91 "::" | 87 | COLON2@89..91 "::" |
83 | PATH_SEGMENT@91..96 | 88 | PATH_SEGMENT@91..96 |
84 | NAME_REF@91..96 | 89 | NAME_REF@91..96 |
diff --git a/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast b/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast index 2049a9d72..271f8d780 100644 --- a/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast +++ b/crates/syntax/test_data/parser/err/0041_illegal_super_keyword_location.rast | |||
@@ -6,7 +6,8 @@ SOURCE_FILE@0..67 | |||
6 | PATH@4..11 | 6 | PATH@4..11 |
7 | PATH_SEGMENT@4..11 | 7 | PATH_SEGMENT@4..11 |
8 | COLON2@4..6 "::" | 8 | COLON2@4..6 "::" |
9 | SUPER_KW@6..11 "super" | 9 | NAME_REF@6..11 |
10 | SUPER_KW@6..11 "super" | ||
10 | SEMICOLON@11..12 ";" | 11 | SEMICOLON@11..12 ";" |
11 | WHITESPACE@12..13 "\n" | 12 | WHITESPACE@12..13 "\n" |
12 | USE@13..26 | 13 | USE@13..26 |
@@ -20,7 +21,8 @@ SOURCE_FILE@0..67 | |||
20 | IDENT@17..18 "a" | 21 | IDENT@17..18 "a" |
21 | COLON2@18..20 "::" | 22 | COLON2@18..20 "::" |
22 | PATH_SEGMENT@20..25 | 23 | PATH_SEGMENT@20..25 |
23 | SUPER_KW@20..25 "super" | 24 | NAME_REF@20..25 |
25 | SUPER_KW@20..25 "super" | ||
24 | SEMICOLON@25..26 ";" | 26 | SEMICOLON@25..26 ";" |
25 | WHITESPACE@26..27 "\n" | 27 | WHITESPACE@26..27 "\n" |
26 | USE@27..47 | 28 | USE@27..47 |
@@ -31,14 +33,16 @@ SOURCE_FILE@0..67 | |||
31 | PATH@31..39 | 33 | PATH@31..39 |
32 | PATH@31..36 | 34 | PATH@31..36 |
33 | PATH_SEGMENT@31..36 | 35 | PATH_SEGMENT@31..36 |
34 | SUPER_KW@31..36 "super" | 36 | NAME_REF@31..36 |
37 | SUPER_KW@31..36 "super" | ||
35 | COLON2@36..38 "::" | 38 | COLON2@36..38 "::" |
36 | PATH_SEGMENT@38..39 | 39 | PATH_SEGMENT@38..39 |
37 | NAME_REF@38..39 | 40 | NAME_REF@38..39 |
38 | IDENT@38..39 "a" | 41 | IDENT@38..39 "a" |
39 | COLON2@39..41 "::" | 42 | COLON2@39..41 "::" |
40 | PATH_SEGMENT@41..46 | 43 | PATH_SEGMENT@41..46 |
41 | SUPER_KW@41..46 "super" | 44 | NAME_REF@41..46 |
45 | SUPER_KW@41..46 "super" | ||
42 | SEMICOLON@46..47 ";" | 46 | SEMICOLON@46..47 ";" |
43 | WHITESPACE@47..48 "\n" | 47 | WHITESPACE@47..48 "\n" |
44 | USE@48..66 | 48 | USE@48..66 |
@@ -56,7 +60,8 @@ SOURCE_FILE@0..67 | |||
56 | PATH@56..64 | 60 | PATH@56..64 |
57 | PATH@56..61 | 61 | PATH@56..61 |
58 | PATH_SEGMENT@56..61 | 62 | PATH_SEGMENT@56..61 |
59 | SUPER_KW@56..61 "super" | 63 | NAME_REF@56..61 |
64 | SUPER_KW@56..61 "super" | ||
60 | COLON2@61..63 "::" | 65 | COLON2@61..63 "::" |
61 | PATH_SEGMENT@63..64 | 66 | PATH_SEGMENT@63..64 |
62 | NAME_REF@63..64 | 67 | NAME_REF@63..64 |
diff --git a/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast b/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast index deadf56b4..01f601091 100644 --- a/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast +++ b/crates/syntax/test_data/parser/err/0042_illegal_self_keyword_location.rast | |||
@@ -6,7 +6,8 @@ SOURCE_FILE@0..25 | |||
6 | PATH@4..10 | 6 | PATH@4..10 |
7 | PATH_SEGMENT@4..10 | 7 | PATH_SEGMENT@4..10 |
8 | COLON2@4..6 "::" | 8 | COLON2@4..6 "::" |
9 | SELF_KW@6..10 "self" | 9 | NAME_REF@6..10 |
10 | SELF_KW@6..10 "self" | ||
10 | SEMICOLON@10..11 ";" | 11 | SEMICOLON@10..11 ";" |
11 | WHITESPACE@11..12 "\n" | 12 | WHITESPACE@11..12 "\n" |
12 | USE@12..24 | 13 | USE@12..24 |
@@ -20,7 +21,8 @@ SOURCE_FILE@0..25 | |||
20 | IDENT@16..17 "a" | 21 | IDENT@16..17 "a" |
21 | COLON2@17..19 "::" | 22 | COLON2@17..19 "::" |
22 | PATH_SEGMENT@19..23 | 23 | PATH_SEGMENT@19..23 |
23 | SELF_KW@19..23 "self" | 24 | NAME_REF@19..23 |
25 | SELF_KW@19..23 "self" | ||
24 | SEMICOLON@23..24 ";" | 26 | SEMICOLON@23..24 ";" |
25 | WHITESPACE@24..25 "\n" | 27 | WHITESPACE@24..25 "\n" |
26 | error 6..10: The `self` keyword is only allowed as the first segment of a path | 28 | error 6..10: The `self` keyword is only allowed as the first segment of a path |
diff --git a/crates/syntax/test_data/parser/inline/err/0015_empty_segment.rast b/crates/syntax/test_data/parser/inline/err/0015_empty_segment.rast index e872526d9..d3c5dde58 100644 --- a/crates/syntax/test_data/parser/inline/err/0015_empty_segment.rast +++ b/crates/syntax/test_data/parser/inline/err/0015_empty_segment.rast | |||
@@ -6,7 +6,8 @@ SOURCE_FILE@0..13 | |||
6 | PATH@4..11 | 6 | PATH@4..11 |
7 | PATH@4..9 | 7 | PATH@4..9 |
8 | PATH_SEGMENT@4..9 | 8 | PATH_SEGMENT@4..9 |
9 | CRATE_KW@4..9 "crate" | 9 | NAME_REF@4..9 |
10 | CRATE_KW@4..9 "crate" | ||
10 | COLON2@9..11 "::" | 11 | COLON2@9..11 "::" |
11 | SEMICOLON@11..12 ";" | 12 | SEMICOLON@11..12 ";" |
12 | WHITESPACE@12..13 "\n" | 13 | WHITESPACE@12..13 "\n" |
diff --git a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast b/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast index f40500e38..970826739 100644 --- a/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast +++ b/crates/syntax/test_data/parser/inline/ok/0002_use_tree_list.rast | |||
@@ -11,7 +11,8 @@ SOURCE_FILE@0..248 | |||
11 | PATH@5..16 | 11 | PATH@5..16 |
12 | PATH@5..10 | 12 | PATH@5..10 |
13 | PATH_SEGMENT@5..10 | 13 | PATH_SEGMENT@5..10 |
14 | CRATE_KW@5..10 "crate" | 14 | NAME_REF@5..10 |
15 | CRATE_KW@5..10 "crate" | ||
15 | COLON2@10..12 "::" | 16 | COLON2@10..12 "::" |
16 | PATH_SEGMENT@12..16 | 17 | PATH_SEGMENT@12..16 |
17 | NAME_REF@12..16 | 18 | NAME_REF@12..16 |
diff --git a/crates/syntax/test_data/parser/inline/ok/0052_path_type.rast b/crates/syntax/test_data/parser/inline/ok/0052_path_type.rast index 9bc36bea7..46a103d5b 100644 --- a/crates/syntax/test_data/parser/inline/ok/0052_path_type.rast +++ b/crates/syntax/test_data/parser/inline/ok/0052_path_type.rast | |||
@@ -42,7 +42,8 @@ SOURCE_FILE@0..71 | |||
42 | PATH@39..48 | 42 | PATH@39..48 |
43 | PATH@39..43 | 43 | PATH@39..43 |
44 | PATH_SEGMENT@39..43 | 44 | PATH_SEGMENT@39..43 |
45 | SELF_KW@39..43 "self" | 45 | NAME_REF@39..43 |
46 | SELF_KW@39..43 "self" | ||
46 | COLON2@43..45 "::" | 47 | COLON2@43..45 "::" |
47 | PATH_SEGMENT@45..48 | 48 | PATH_SEGMENT@45..48 |
48 | NAME_REF@45..48 | 49 | NAME_REF@45..48 |
@@ -61,7 +62,8 @@ SOURCE_FILE@0..71 | |||
61 | PATH@59..69 | 62 | PATH@59..69 |
62 | PATH@59..64 | 63 | PATH@59..64 |
63 | PATH_SEGMENT@59..64 | 64 | PATH_SEGMENT@59..64 |
64 | SUPER_KW@59..64 "super" | 65 | NAME_REF@59..64 |
66 | SUPER_KW@59..64 "super" | ||
65 | COLON2@64..66 "::" | 67 | COLON2@64..66 "::" |
66 | PATH_SEGMENT@66..69 | 68 | PATH_SEGMENT@66..69 |
67 | NAME_REF@66..69 | 69 | NAME_REF@66..69 |
diff --git a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast index e4fb32de1..583dcac7e 100644 --- a/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast +++ b/crates/syntax/test_data/parser/inline/ok/0062_mod_contents.rast | |||
@@ -43,7 +43,8 @@ SOURCE_FILE@0..70 | |||
43 | PATH@45..55 | 43 | PATH@45..55 |
44 | PATH@45..50 | 44 | PATH@45..50 |
45 | PATH_SEGMENT@45..50 | 45 | PATH_SEGMENT@45..50 |
46 | SUPER_KW@45..50 "super" | 46 | NAME_REF@45..50 |
47 | SUPER_KW@45..50 "super" | ||
47 | COLON2@50..52 "::" | 48 | COLON2@50..52 "::" |
48 | PATH_SEGMENT@52..55 | 49 | PATH_SEGMENT@52..55 |
49 | NAME_REF@52..55 | 50 | NAME_REF@52..55 |
diff --git a/crates/syntax/test_data/parser/inline/ok/0067_crate_path.rast b/crates/syntax/test_data/parser/inline/ok/0067_crate_path.rast index 702f2e0b0..87c0c48dc 100644 --- a/crates/syntax/test_data/parser/inline/ok/0067_crate_path.rast +++ b/crates/syntax/test_data/parser/inline/ok/0067_crate_path.rast | |||
@@ -6,7 +6,8 @@ SOURCE_FILE@0..16 | |||
6 | PATH@4..14 | 6 | PATH@4..14 |
7 | PATH@4..9 | 7 | PATH@4..9 |
8 | PATH_SEGMENT@4..9 | 8 | PATH_SEGMENT@4..9 |
9 | CRATE_KW@4..9 "crate" | 9 | NAME_REF@4..9 |
10 | CRATE_KW@4..9 "crate" | ||
10 | COLON2@9..11 "::" | 11 | COLON2@9..11 "::" |
11 | PATH_SEGMENT@11..14 | 12 | PATH_SEGMENT@11..14 |
12 | NAME_REF@11..14 | 13 | NAME_REF@11..14 |
diff --git a/crates/syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast b/crates/syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast index c4c5bc51e..192a9cca6 100644 --- a/crates/syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast +++ b/crates/syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast | |||
@@ -5,7 +5,8 @@ SOURCE_FILE@0..37 | |||
5 | USE_TREE@4..17 | 5 | USE_TREE@4..17 |
6 | PATH@4..9 | 6 | PATH@4..9 |
7 | PATH_SEGMENT@4..9 | 7 | PATH_SEGMENT@4..9 |
8 | CRATE_KW@4..9 "crate" | 8 | NAME_REF@4..9 |
9 | CRATE_KW@4..9 "crate" | ||
9 | COLON2@9..11 "::" | 10 | COLON2@9..11 "::" |
10 | USE_TREE_LIST@11..17 | 11 | USE_TREE_LIST@11..17 |
11 | L_CURLY@11..12 "{" | 12 | L_CURLY@11..12 "{" |
@@ -23,7 +24,8 @@ SOURCE_FILE@0..37 | |||
23 | USE_TREE@23..35 | 24 | USE_TREE@23..35 |
24 | PATH@23..27 | 25 | PATH@23..27 |
25 | PATH_SEGMENT@23..27 | 26 | PATH_SEGMENT@23..27 |
26 | SELF_KW@23..27 "self" | 27 | NAME_REF@23..27 |
28 | SELF_KW@23..27 "self" | ||
27 | COLON2@27..29 "::" | 29 | COLON2@27..29 "::" |
28 | USE_TREE_LIST@29..35 | 30 | USE_TREE_LIST@29..35 |
29 | L_CURLY@29..30 "{" | 31 | L_CURLY@29..30 "{" |
diff --git a/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast b/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast index f3d4ad72c..3016a6574 100644 --- a/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast +++ b/crates/syntax/test_data/parser/inline/ok/0117_macro_call_type.rast | |||
@@ -30,7 +30,8 @@ SOURCE_FILE@0..41 | |||
30 | PATH@26..36 | 30 | PATH@26..36 |
31 | PATH@26..31 | 31 | PATH@26..31 |
32 | PATH_SEGMENT@26..31 | 32 | PATH_SEGMENT@26..31 |
33 | CRATE_KW@26..31 "crate" | 33 | NAME_REF@26..31 |
34 | CRATE_KW@26..31 "crate" | ||
34 | COLON2@31..33 "::" | 35 | COLON2@31..33 "::" |
35 | PATH_SEGMENT@33..36 | 36 | PATH_SEGMENT@33..36 |
36 | NAME_REF@33..36 | 37 | NAME_REF@33..36 |
diff --git a/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast b/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast index aa4d7a784..0fed2d311 100644 --- a/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast +++ b/crates/syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast | |||
@@ -17,7 +17,8 @@ SOURCE_FILE@0..27 | |||
17 | PATH@11..21 | 17 | PATH@11..21 |
18 | PATH@11..16 | 18 | PATH@11..16 |
19 | PATH_SEGMENT@11..16 | 19 | PATH_SEGMENT@11..16 |
20 | CRATE_KW@11..16 "crate" | 20 | NAME_REF@11..16 |
21 | CRATE_KW@11..16 "crate" | ||
21 | COLON2@16..18 "::" | 22 | COLON2@16..18 "::" |
22 | PATH_SEGMENT@18..21 | 23 | PATH_SEGMENT@18..21 |
23 | NAME_REF@18..21 | 24 | NAME_REF@18..21 |
diff --git a/crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rast b/crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rast index c204f0e2d..a5ee07499 100644 --- a/crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rast +++ b/crates/syntax/test_data/parser/inline/ok/0153_pub_parens_typepath.rast | |||
@@ -16,7 +16,8 @@ SOURCE_FILE@0..53 | |||
16 | PATH@14..22 | 16 | PATH@14..22 |
17 | PATH@14..19 | 17 | PATH@14..19 |
18 | PATH_SEGMENT@14..19 | 18 | PATH_SEGMENT@14..19 |
19 | SUPER_KW@14..19 "super" | 19 | NAME_REF@14..19 |
20 | SUPER_KW@14..19 "super" | ||
20 | COLON2@19..21 "::" | 21 | COLON2@19..21 "::" |
21 | PATH_SEGMENT@21..22 | 22 | PATH_SEGMENT@21..22 |
22 | NAME_REF@21..22 | 23 | NAME_REF@21..22 |
@@ -42,7 +43,8 @@ SOURCE_FILE@0..53 | |||
42 | PATH@40..48 | 43 | PATH@40..48 |
43 | PATH@40..45 | 44 | PATH@40..45 |
44 | PATH_SEGMENT@40..45 | 45 | PATH_SEGMENT@40..45 |
45 | CRATE_KW@40..45 "crate" | 46 | NAME_REF@40..45 |
47 | CRATE_KW@40..45 "crate" | ||
46 | COLON2@45..47 "::" | 48 | COLON2@45..47 "::" |
47 | PATH_SEGMENT@47..48 | 49 | PATH_SEGMENT@47..48 |
48 | NAME_REF@47..48 | 50 | NAME_REF@47..48 |
diff --git a/crates/syntax/test_data/parser/ok/0013_use_path_self_super.rast b/crates/syntax/test_data/parser/ok/0013_use_path_self_super.rast index 66ab13660..dba74e222 100644 --- a/crates/syntax/test_data/parser/ok/0013_use_path_self_super.rast +++ b/crates/syntax/test_data/parser/ok/0013_use_path_self_super.rast | |||
@@ -6,7 +6,8 @@ SOURCE_FILE@0..38 | |||
6 | PATH@4..13 | 6 | PATH@4..13 |
7 | PATH@4..8 | 7 | PATH@4..8 |
8 | PATH_SEGMENT@4..8 | 8 | PATH_SEGMENT@4..8 |
9 | SELF_KW@4..8 "self" | 9 | NAME_REF@4..8 |
10 | SELF_KW@4..8 "self" | ||
10 | COLON2@8..10 "::" | 11 | COLON2@8..10 "::" |
11 | PATH_SEGMENT@10..13 | 12 | PATH_SEGMENT@10..13 |
12 | NAME_REF@10..13 | 13 | NAME_REF@10..13 |
@@ -21,10 +22,12 @@ SOURCE_FILE@0..38 | |||
21 | PATH@19..31 | 22 | PATH@19..31 |
22 | PATH@19..24 | 23 | PATH@19..24 |
23 | PATH_SEGMENT@19..24 | 24 | PATH_SEGMENT@19..24 |
24 | SUPER_KW@19..24 "super" | 25 | NAME_REF@19..24 |
26 | SUPER_KW@19..24 "super" | ||
25 | COLON2@24..26 "::" | 27 | COLON2@24..26 "::" |
26 | PATH_SEGMENT@26..31 | 28 | PATH_SEGMENT@26..31 |
27 | SUPER_KW@26..31 "super" | 29 | NAME_REF@26..31 |
30 | SUPER_KW@26..31 "super" | ||
28 | COLON2@31..33 "::" | 31 | COLON2@31..33 "::" |
29 | PATH_SEGMENT@33..36 | 32 | PATH_SEGMENT@33..36 |
30 | NAME_REF@33..36 | 33 | NAME_REF@33..36 |
diff --git a/crates/syntax/test_data/parser/ok/0020_type_param_bounds.rast b/crates/syntax/test_data/parser/ok/0020_type_param_bounds.rast index 0612a71de..21c564a20 100644 --- a/crates/syntax/test_data/parser/ok/0020_type_param_bounds.rast +++ b/crates/syntax/test_data/parser/ok/0020_type_param_bounds.rast | |||
@@ -187,7 +187,8 @@ SOURCE_FILE@0..250 | |||
187 | PATH@164..173 | 187 | PATH@164..173 |
188 | PATH@164..168 | 188 | PATH@164..168 |
189 | PATH_SEGMENT@164..168 | 189 | PATH_SEGMENT@164..168 |
190 | SELF_KW@164..168 "self" | 190 | NAME_REF@164..168 |
191 | SELF_KW@164..168 "self" | ||
191 | COLON2@168..170 "::" | 192 | COLON2@168..170 "::" |
192 | PATH_SEGMENT@170..173 | 193 | PATH_SEGMENT@170..173 |
193 | NAME_REF@170..173 | 194 | NAME_REF@170..173 |
diff --git a/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast b/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast index 5ad8c570d..a0a5ca7f5 100644 --- a/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast +++ b/crates/syntax/test_data/parser/ok/0034_crate_path_in_call.rast | |||
@@ -25,7 +25,8 @@ SOURCE_FILE@0..62 | |||
25 | PATH@27..44 | 25 | PATH@27..44 |
26 | PATH@27..32 | 26 | PATH@27..32 |
27 | PATH_SEGMENT@27..32 | 27 | PATH_SEGMENT@27..32 |
28 | CRATE_KW@27..32 "crate" | 28 | NAME_REF@27..32 |
29 | CRATE_KW@27..32 "crate" | ||
29 | COLON2@32..34 "::" | 30 | COLON2@32..34 "::" |
30 | PATH_SEGMENT@34..44 | 31 | PATH_SEGMENT@34..44 |
31 | NAME_REF@34..44 | 32 | NAME_REF@34..44 |