diff options
255 files changed, 2629 insertions, 5124 deletions
diff --git a/Cargo.lock b/Cargo.lock index f695a7f2c..975c1aef8 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -614,9 +614,9 @@ checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" | |||
614 | 614 | ||
615 | [[package]] | 615 | [[package]] |
616 | name = "lock_api" | 616 | name = "lock_api" |
617 | version = "0.3.3" | 617 | version = "0.3.4" |
618 | source = "registry+https://github.com/rust-lang/crates.io-index" | 618 | source = "registry+https://github.com/rust-lang/crates.io-index" |
619 | checksum = "79b2de95ecb4691949fea4716ca53cdbcfccb2c612e19644a8bad05edcf9f47b" | 619 | checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" |
620 | dependencies = [ | 620 | dependencies = [ |
621 | "scopeguard", | 621 | "scopeguard", |
622 | ] | 622 | ] |
@@ -779,9 +779,9 @@ checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" | |||
779 | 779 | ||
780 | [[package]] | 780 | [[package]] |
781 | name = "parking_lot" | 781 | name = "parking_lot" |
782 | version = "0.10.0" | 782 | version = "0.10.1" |
783 | source = "registry+https://github.com/rust-lang/crates.io-index" | 783 | source = "registry+https://github.com/rust-lang/crates.io-index" |
784 | checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" | 784 | checksum = "6fdfcb5f20930a79e326f7ec992a9fdb5b7bd809254b1e735bdd5a99f78bee0d" |
785 | dependencies = [ | 785 | dependencies = [ |
786 | "lock_api", | 786 | "lock_api", |
787 | "parking_lot_core", | 787 | "parking_lot_core", |
@@ -789,9 +789,9 @@ dependencies = [ | |||
789 | 789 | ||
790 | [[package]] | 790 | [[package]] |
791 | name = "parking_lot_core" | 791 | name = "parking_lot_core" |
792 | version = "0.7.0" | 792 | version = "0.7.1" |
793 | source = "registry+https://github.com/rust-lang/crates.io-index" | 793 | source = "registry+https://github.com/rust-lang/crates.io-index" |
794 | checksum = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" | 794 | checksum = "0e136c1904604defe99ce5fd71a28d473fa60a12255d511aa78a9ddf11237aeb" |
795 | dependencies = [ | 795 | dependencies = [ |
796 | "cfg-if", | 796 | "cfg-if", |
797 | "cloudabi", | 797 | "cloudabi", |
@@ -1021,6 +1021,7 @@ dependencies = [ | |||
1021 | "ra_prof", | 1021 | "ra_prof", |
1022 | "ra_syntax", | 1022 | "ra_syntax", |
1023 | "rustc-hash", | 1023 | "rustc-hash", |
1024 | "scoped-tls", | ||
1024 | "smallvec", | 1025 | "smallvec", |
1025 | "stdx", | 1026 | "stdx", |
1026 | "test_utils", | 1027 | "test_utils", |
@@ -1420,6 +1421,12 @@ dependencies = [ | |||
1420 | ] | 1421 | ] |
1421 | 1422 | ||
1422 | [[package]] | 1423 | [[package]] |
1424 | name = "scoped-tls" | ||
1425 | version = "1.0.0" | ||
1426 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1427 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" | ||
1428 | |||
1429 | [[package]] | ||
1423 | name = "scopeguard" | 1430 | name = "scopeguard" |
1424 | version = "1.1.0" | 1431 | version = "1.1.0" |
1425 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1523,9 +1530,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" | |||
1523 | 1530 | ||
1524 | [[package]] | 1531 | [[package]] |
1525 | name = "smallvec" | 1532 | name = "smallvec" |
1526 | version = "1.2.0" | 1533 | version = "1.3.0" |
1527 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1534 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1528 | checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" | 1535 | checksum = "05720e22615919e4734f6a99ceae50d00226c3c5aca406e102ebc33298214e0a" |
1529 | 1536 | ||
1530 | [[package]] | 1537 | [[package]] |
1531 | name = "smol_str" | 1538 | name = "smol_str" |
@@ -1573,9 +1580,9 @@ dependencies = [ | |||
1573 | 1580 | ||
1574 | [[package]] | 1581 | [[package]] |
1575 | name = "termios" | 1582 | name = "termios" |
1576 | version = "0.3.1" | 1583 | version = "0.3.2" |
1577 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1584 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1578 | checksum = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" | 1585 | checksum = "6f0fcee7b24a25675de40d5bb4de6e41b0df07bc9856295e7e2b3a3600c400c2" |
1579 | dependencies = [ | 1586 | dependencies = [ |
1580 | "libc", | 1587 | "libc", |
1581 | ] | 1588 | ] |
diff --git a/crates/ra_assists/src/handlers/add_explicit_type.rs b/crates/ra_assists/src/handlers/add_explicit_type.rs index e7dcfb44e..d86d804b2 100644 --- a/crates/ra_assists/src/handlers/add_explicit_type.rs +++ b/crates/ra_assists/src/handlers/add_explicit_type.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use hir::HirDisplay; | 1 | use hir::HirDisplay; |
2 | use ra_syntax::{ | 2 | use ra_syntax::{ |
3 | ast::{self, AstNode, AstToken, LetStmt, NameOwner, TypeAscriptionOwner}, | 3 | ast::{self, AstNode, LetStmt, NameOwner, TypeAscriptionOwner}, |
4 | TextRange, | 4 | TextRange, |
5 | }; | 5 | }; |
6 | 6 | ||
@@ -35,7 +35,7 @@ pub(crate) fn add_explicit_type(ctx: AssistCtx) -> Option<Assist> { | |||
35 | let name = pat.name()?; | 35 | let name = pat.name()?; |
36 | let name_range = name.syntax().text_range(); | 36 | let name_range = name.syntax().text_range(); |
37 | let stmt_range = stmt.syntax().text_range(); | 37 | let stmt_range = stmt.syntax().text_range(); |
38 | let eq_range = stmt.eq_token()?.syntax().text_range(); | 38 | let eq_range = stmt.eq_token()?.text_range(); |
39 | // Assist should only be applicable if cursor is between 'let' and '=' | 39 | // Assist should only be applicable if cursor is between 'let' and '=' |
40 | let let_range = TextRange::from_to(stmt_range.start(), eq_range.start()); | 40 | let let_range = TextRange::from_to(stmt_range.start(), eq_range.start()); |
41 | let cursor_in_range = ctx.frange.range.is_subrange(&let_range); | 41 | let cursor_in_range = ctx.frange.range.is_subrange(&let_range); |
diff --git a/crates/ra_assists/src/handlers/add_impl.rs b/crates/ra_assists/src/handlers/add_impl.rs index 26dfed237..6622eadb2 100644 --- a/crates/ra_assists/src/handlers/add_impl.rs +++ b/crates/ra_assists/src/handlers/add_impl.rs | |||
@@ -1,5 +1,5 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | ast::{self, AstNode, AstToken, NameOwner, TypeParamsOwner}, | 2 | ast::{self, AstNode, NameOwner, TypeParamsOwner}, |
3 | TextUnit, | 3 | TextUnit, |
4 | }; | 4 | }; |
5 | use stdx::{format_to, SepBy}; | 5 | use stdx::{format_to, SepBy}; |
diff --git a/crates/ra_assists/src/handlers/add_new.rs b/crates/ra_assists/src/handlers/add_new.rs index 30360af94..240b19fa3 100644 --- a/crates/ra_assists/src/handlers/add_new.rs +++ b/crates/ra_assists/src/handlers/add_new.rs | |||
@@ -1,8 +1,7 @@ | |||
1 | use hir::Adt; | 1 | use hir::Adt; |
2 | use ra_syntax::{ | 2 | use ra_syntax::{ |
3 | ast::{ | 3 | ast::{ |
4 | self, AstNode, AstToken, NameOwner, StructKind, TypeAscriptionOwner, TypeParamsOwner, | 4 | self, AstNode, NameOwner, StructKind, TypeAscriptionOwner, TypeParamsOwner, VisibilityOwner, |
5 | VisibilityOwner, | ||
6 | }, | 5 | }, |
7 | TextUnit, T, | 6 | TextUnit, T, |
8 | }; | 7 | }; |
diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs index b9eb09676..c4fb425b0 100644 --- a/crates/ra_assists/src/handlers/inline_local_variable.rs +++ b/crates/ra_assists/src/handlers/inline_local_variable.rs | |||
@@ -29,7 +29,7 @@ pub(crate) fn inline_local_variable(ctx: AssistCtx) -> Option<Assist> { | |||
29 | ast::Pat::BindPat(pat) => pat, | 29 | ast::Pat::BindPat(pat) => pat, |
30 | _ => return None, | 30 | _ => return None, |
31 | }; | 31 | }; |
32 | if bind_pat.mut_kw_token().is_some() { | 32 | if bind_pat.mut_token().is_some() { |
33 | tested_by!(test_not_inline_mut_variable); | 33 | tested_by!(test_not_inline_mut_variable); |
34 | return None; | 34 | return None; |
35 | } | 35 | } |
diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs index ab6bdf6bb..8d0f7e922 100644 --- a/crates/ra_assists/src/handlers/introduce_variable.rs +++ b/crates/ra_assists/src/handlers/introduce_variable.rs | |||
@@ -61,7 +61,7 @@ pub(crate) fn introduce_variable(ctx: AssistCtx) -> Option<Assist> { | |||
61 | }; | 61 | }; |
62 | if is_full_stmt { | 62 | if is_full_stmt { |
63 | tested_by!(test_introduce_var_expr_stmt); | 63 | tested_by!(test_introduce_var_expr_stmt); |
64 | if full_stmt.unwrap().semi_token().is_none() { | 64 | if full_stmt.unwrap().semicolon_token().is_none() { |
65 | buf.push_str(";"); | 65 | buf.push_str(";"); |
66 | } | 66 | } |
67 | edit.replace(expr.syntax().text_range(), buf); | 67 | edit.replace(expr.syntax().text_range(), buf); |
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index 936d50ab4..0958f52f1 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs | |||
@@ -3,7 +3,7 @@ use std::iter::successors; | |||
3 | use ra_syntax::{ | 3 | use ra_syntax::{ |
4 | algo::{neighbor, SyntaxRewriter}, | 4 | algo::{neighbor, SyntaxRewriter}, |
5 | ast::{self, edit::AstNodeEdit, make}, | 5 | ast::{self, edit::AstNodeEdit, make}, |
6 | AstNode, AstToken, Direction, InsertPosition, SyntaxElement, T, | 6 | AstNode, Direction, InsertPosition, SyntaxElement, T, |
7 | }; | 7 | }; |
8 | 8 | ||
9 | use crate::{Assist, AssistCtx, AssistId}; | 9 | use crate::{Assist, AssistCtx, AssistId}; |
@@ -82,7 +82,7 @@ fn try_merge_trees(old: &ast::UseTree, new: &ast::UseTree) -> Option<ast::UseTre | |||
82 | .filter(|it| it.kind() != T!['{'] && it.kind() != T!['}']), | 82 | .filter(|it| it.kind() != T!['{'] && it.kind() != T!['}']), |
83 | ); | 83 | ); |
84 | let use_tree_list = lhs.use_tree_list()?; | 84 | let use_tree_list = lhs.use_tree_list()?; |
85 | let pos = InsertPosition::Before(use_tree_list.r_curly_token()?.syntax().clone().into()); | 85 | let pos = InsertPosition::Before(use_tree_list.r_curly_token()?.into()); |
86 | let use_tree_list = use_tree_list.insert_children(pos, to_insert); | 86 | let use_tree_list = use_tree_list.insert_children(pos, to_insert); |
87 | Some(lhs.with_use_tree_list(use_tree_list)) | 87 | Some(lhs.with_use_tree_list(use_tree_list)) |
88 | } | 88 | } |
diff --git a/crates/ra_assists/src/handlers/move_bounds.rs b/crates/ra_assists/src/handlers/move_bounds.rs index 93f26f51a..0f26884dc 100644 --- a/crates/ra_assists/src/handlers/move_bounds.rs +++ b/crates/ra_assists/src/handlers/move_bounds.rs | |||
@@ -2,6 +2,7 @@ use ra_syntax::{ | |||
2 | ast::{self, edit::AstNodeEdit, make, AstNode, NameOwner, TypeBoundsOwner}, | 2 | ast::{self, edit::AstNodeEdit, make, AstNode, NameOwner, TypeBoundsOwner}, |
3 | match_ast, | 3 | match_ast, |
4 | SyntaxKind::*, | 4 | SyntaxKind::*, |
5 | T, | ||
5 | }; | 6 | }; |
6 | 7 | ||
7 | use crate::{Assist, AssistCtx, AssistId}; | 8 | use crate::{Assist, AssistCtx, AssistId}; |
@@ -42,7 +43,7 @@ pub(crate) fn move_bounds_to_where_clause(ctx: AssistCtx) -> Option<Assist> { | |||
42 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), | 43 | ast::EnumDef(it) => it.variant_list()?.syntax().clone().into(), |
43 | ast::StructDef(it) => { | 44 | ast::StructDef(it) => { |
44 | it.syntax().children_with_tokens() | 45 | it.syntax().children_with_tokens() |
45 | .find(|it| it.kind() == RECORD_FIELD_DEF_LIST || it.kind() == SEMI)? | 46 | .find(|it| it.kind() == RECORD_FIELD_DEF_LIST || it.kind() == T![;])? |
46 | }, | 47 | }, |
47 | _ => return None | 48 | _ => return None |
48 | } | 49 | } |
diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index 45631f8fd..226fb4534 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs | |||
@@ -255,7 +255,7 @@ impl SourceAnalyzer { | |||
255 | _ => return None, | 255 | _ => return None, |
256 | }; | 256 | }; |
257 | 257 | ||
258 | let (variant, missing_fields) = | 258 | let (variant, missing_fields, _exhaustive) = |
259 | record_pattern_missing_fields(db, infer, pat_id, &body[pat_id])?; | 259 | record_pattern_missing_fields(db, infer, pat_id, &body[pat_id])?; |
260 | let res = self.missing_fields(db, krate, substs, variant, missing_fields); | 260 | let res = self.missing_fields(db, krate, substs, variant, missing_fields); |
261 | Some(res) | 261 | Some(res) |
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index 7fc4cd76e..be4b0accb 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs | |||
@@ -4,6 +4,7 @@ use std::sync::Arc; | |||
4 | 4 | ||
5 | use either::Either; | 5 | use either::Either; |
6 | use hir_expand::{ | 6 | use hir_expand::{ |
7 | hygiene::Hygiene, | ||
7 | name::{AsName, Name}, | 8 | name::{AsName, Name}, |
8 | InFile, | 9 | InFile, |
9 | }; | 10 | }; |
@@ -12,9 +13,9 @@ use ra_prof::profile; | |||
12 | use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner, VisibilityOwner}; | 13 | use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner, VisibilityOwner}; |
13 | 14 | ||
14 | use crate::{ | 15 | use crate::{ |
15 | db::DefDatabase, src::HasChildSource, src::HasSource, trace::Trace, type_ref::TypeRef, | 16 | attr::Attrs, db::DefDatabase, src::HasChildSource, src::HasSource, trace::Trace, |
16 | visibility::RawVisibility, EnumId, LocalEnumVariantId, LocalStructFieldId, Lookup, StructId, | 17 | type_ref::TypeRef, visibility::RawVisibility, EnumId, HasModule, LocalEnumVariantId, |
17 | UnionId, VariantId, | 18 | LocalStructFieldId, Lookup, ModuleId, StructId, UnionId, VariantId, |
18 | }; | 19 | }; |
19 | 20 | ||
20 | /// Note that we use `StructData` for unions as well! | 21 | /// Note that we use `StructData` for unions as well! |
@@ -56,7 +57,8 @@ impl StructData { | |||
56 | let src = id.lookup(db).source(db); | 57 | let src = id.lookup(db).source(db); |
57 | 58 | ||
58 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); | 59 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); |
59 | let variant_data = VariantData::new(db, src.map(|s| s.kind())); | 60 | let variant_data = |
61 | VariantData::new(db, src.map(|s| s.kind()), id.lookup(db).container.module(db)); | ||
60 | let variant_data = Arc::new(variant_data); | 62 | let variant_data = Arc::new(variant_data); |
61 | Arc::new(StructData { name, variant_data }) | 63 | Arc::new(StructData { name, variant_data }) |
62 | } | 64 | } |
@@ -70,6 +72,7 @@ impl StructData { | |||
70 | .map(ast::StructKind::Record) | 72 | .map(ast::StructKind::Record) |
71 | .unwrap_or(ast::StructKind::Unit) | 73 | .unwrap_or(ast::StructKind::Unit) |
72 | }), | 74 | }), |
75 | id.lookup(db).container.module(db), | ||
73 | ); | 76 | ); |
74 | let variant_data = Arc::new(variant_data); | 77 | let variant_data = Arc::new(variant_data); |
75 | Arc::new(StructData { name, variant_data }) | 78 | Arc::new(StructData { name, variant_data }) |
@@ -82,7 +85,7 @@ impl EnumData { | |||
82 | let src = e.lookup(db).source(db); | 85 | let src = e.lookup(db).source(db); |
83 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); | 86 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); |
84 | let mut trace = Trace::new_for_arena(); | 87 | let mut trace = Trace::new_for_arena(); |
85 | lower_enum(db, &mut trace, &src); | 88 | lower_enum(db, &mut trace, &src, e.lookup(db).container.module(db)); |
86 | Arc::new(EnumData { name, variants: trace.into_arena() }) | 89 | Arc::new(EnumData { name, variants: trace.into_arena() }) |
87 | } | 90 | } |
88 | 91 | ||
@@ -98,7 +101,7 @@ impl HasChildSource for EnumId { | |||
98 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { | 101 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { |
99 | let src = self.lookup(db).source(db); | 102 | let src = self.lookup(db).source(db); |
100 | let mut trace = Trace::new_for_map(); | 103 | let mut trace = Trace::new_for_map(); |
101 | lower_enum(db, &mut trace, &src); | 104 | lower_enum(db, &mut trace, &src, self.lookup(db).container.module(db)); |
102 | src.with_value(trace.into_map()) | 105 | src.with_value(trace.into_map()) |
103 | } | 106 | } |
104 | } | 107 | } |
@@ -107,22 +110,23 @@ fn lower_enum( | |||
107 | db: &dyn DefDatabase, | 110 | db: &dyn DefDatabase, |
108 | trace: &mut Trace<EnumVariantData, ast::EnumVariant>, | 111 | trace: &mut Trace<EnumVariantData, ast::EnumVariant>, |
109 | ast: &InFile<ast::EnumDef>, | 112 | ast: &InFile<ast::EnumDef>, |
113 | module_id: ModuleId, | ||
110 | ) { | 114 | ) { |
111 | for var in ast.value.variant_list().into_iter().flat_map(|it| it.variants()) { | 115 | for var in ast.value.variant_list().into_iter().flat_map(|it| it.variants()) { |
112 | trace.alloc( | 116 | trace.alloc( |
113 | || var.clone(), | 117 | || var.clone(), |
114 | || EnumVariantData { | 118 | || EnumVariantData { |
115 | name: var.name().map_or_else(Name::missing, |it| it.as_name()), | 119 | name: var.name().map_or_else(Name::missing, |it| it.as_name()), |
116 | variant_data: Arc::new(VariantData::new(db, ast.with_value(var.kind()))), | 120 | variant_data: Arc::new(VariantData::new(db, ast.with_value(var.kind()), module_id)), |
117 | }, | 121 | }, |
118 | ); | 122 | ); |
119 | } | 123 | } |
120 | } | 124 | } |
121 | 125 | ||
122 | impl VariantData { | 126 | impl VariantData { |
123 | fn new(db: &dyn DefDatabase, flavor: InFile<ast::StructKind>) -> Self { | 127 | fn new(db: &dyn DefDatabase, flavor: InFile<ast::StructKind>, module_id: ModuleId) -> Self { |
124 | let mut trace = Trace::new_for_arena(); | 128 | let mut trace = Trace::new_for_arena(); |
125 | match lower_struct(db, &mut trace, &flavor) { | 129 | match lower_struct(db, &mut trace, &flavor, module_id) { |
126 | StructKind::Tuple => VariantData::Tuple(trace.into_arena()), | 130 | StructKind::Tuple => VariantData::Tuple(trace.into_arena()), |
127 | StructKind::Record => VariantData::Record(trace.into_arena()), | 131 | StructKind::Record => VariantData::Record(trace.into_arena()), |
128 | StructKind::Unit => VariantData::Unit, | 132 | StructKind::Unit => VariantData::Unit, |
@@ -155,22 +159,27 @@ impl HasChildSource for VariantId { | |||
155 | type Value = Either<ast::TupleFieldDef, ast::RecordFieldDef>; | 159 | type Value = Either<ast::TupleFieldDef, ast::RecordFieldDef>; |
156 | 160 | ||
157 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { | 161 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { |
158 | let src = match self { | 162 | let (src, module_id) = match self { |
159 | VariantId::EnumVariantId(it) => { | 163 | VariantId::EnumVariantId(it) => { |
160 | // I don't really like the fact that we call into parent source | 164 | // I don't really like the fact that we call into parent source |
161 | // here, this might add to more queries then necessary. | 165 | // here, this might add to more queries then necessary. |
162 | let src = it.parent.child_source(db); | 166 | let src = it.parent.child_source(db); |
163 | src.map(|map| map[it.local_id].kind()) | 167 | (src.map(|map| map[it.local_id].kind()), it.parent.lookup(db).container.module(db)) |
164 | } | 168 | } |
165 | VariantId::StructId(it) => it.lookup(db).source(db).map(|it| it.kind()), | 169 | VariantId::StructId(it) => { |
166 | VariantId::UnionId(it) => it.lookup(db).source(db).map(|it| { | 170 | (it.lookup(db).source(db).map(|it| it.kind()), it.lookup(db).container.module(db)) |
167 | it.record_field_def_list() | 171 | } |
168 | .map(ast::StructKind::Record) | 172 | VariantId::UnionId(it) => ( |
169 | .unwrap_or(ast::StructKind::Unit) | 173 | it.lookup(db).source(db).map(|it| { |
170 | }), | 174 | it.record_field_def_list() |
175 | .map(ast::StructKind::Record) | ||
176 | .unwrap_or(ast::StructKind::Unit) | ||
177 | }), | ||
178 | it.lookup(db).container.module(db), | ||
179 | ), | ||
171 | }; | 180 | }; |
172 | let mut trace = Trace::new_for_map(); | 181 | let mut trace = Trace::new_for_map(); |
173 | lower_struct(db, &mut trace, &src); | 182 | lower_struct(db, &mut trace, &src, module_id); |
174 | src.with_value(trace.into_map()) | 183 | src.with_value(trace.into_map()) |
175 | } | 184 | } |
176 | } | 185 | } |
@@ -186,10 +195,17 @@ fn lower_struct( | |||
186 | db: &dyn DefDatabase, | 195 | db: &dyn DefDatabase, |
187 | trace: &mut Trace<StructFieldData, Either<ast::TupleFieldDef, ast::RecordFieldDef>>, | 196 | trace: &mut Trace<StructFieldData, Either<ast::TupleFieldDef, ast::RecordFieldDef>>, |
188 | ast: &InFile<ast::StructKind>, | 197 | ast: &InFile<ast::StructKind>, |
198 | module_id: ModuleId, | ||
189 | ) -> StructKind { | 199 | ) -> StructKind { |
200 | let crate_graph = db.crate_graph(); | ||
190 | match &ast.value { | 201 | match &ast.value { |
191 | ast::StructKind::Tuple(fl) => { | 202 | ast::StructKind::Tuple(fl) => { |
192 | for (i, fd) in fl.fields().enumerate() { | 203 | for (i, fd) in fl.fields().enumerate() { |
204 | let attrs = Attrs::new(&fd, &Hygiene::new(db.upcast(), ast.file_id)); | ||
205 | if !attrs.is_cfg_enabled(&crate_graph[module_id.krate].cfg_options) { | ||
206 | continue; | ||
207 | } | ||
208 | |||
193 | trace.alloc( | 209 | trace.alloc( |
194 | || Either::Left(fd.clone()), | 210 | || Either::Left(fd.clone()), |
195 | || StructFieldData { | 211 | || StructFieldData { |
@@ -203,6 +219,11 @@ fn lower_struct( | |||
203 | } | 219 | } |
204 | ast::StructKind::Record(fl) => { | 220 | ast::StructKind::Record(fl) => { |
205 | for fd in fl.fields() { | 221 | for fd in fl.fields() { |
222 | let attrs = Attrs::new(&fd, &Hygiene::new(db.upcast(), ast.file_id)); | ||
223 | if !attrs.is_cfg_enabled(&crate_graph[module_id.krate].cfg_options) { | ||
224 | continue; | ||
225 | } | ||
226 | |||
206 | trace.alloc( | 227 | trace.alloc( |
207 | || Either::Right(fd.clone()), | 228 | || Either::Right(fd.clone()), |
208 | || StructFieldData { | 229 | || StructFieldData { |
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs index 71a18f5e1..7b0c506b1 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/ra_hir_def/src/attr.rs | |||
@@ -5,6 +5,7 @@ use std::{ops, sync::Arc}; | |||
5 | use either::Either; | 5 | use either::Either; |
6 | use hir_expand::{hygiene::Hygiene, AstId, InFile}; | 6 | use hir_expand::{hygiene::Hygiene, AstId, InFile}; |
7 | use mbe::ast_to_token_tree; | 7 | use mbe::ast_to_token_tree; |
8 | use ra_cfg::CfgOptions; | ||
8 | use ra_syntax::{ | 9 | use ra_syntax::{ |
9 | ast::{self, AstNode, AttrsOwner}, | 10 | ast::{self, AstNode, AttrsOwner}, |
10 | SmolStr, | 11 | SmolStr, |
@@ -90,6 +91,10 @@ impl Attrs { | |||
90 | pub fn by_key(&self, key: &'static str) -> AttrQuery<'_> { | 91 | pub fn by_key(&self, key: &'static str) -> AttrQuery<'_> { |
91 | AttrQuery { attrs: self, key } | 92 | AttrQuery { attrs: self, key } |
92 | } | 93 | } |
94 | |||
95 | pub(crate) fn is_cfg_enabled(&self, cfg_options: &CfgOptions) -> bool { | ||
96 | self.by_key("cfg").tt_values().all(|tt| cfg_options.is_cfg_enabled(tt) != Some(false)) | ||
97 | } | ||
93 | } | 98 | } |
94 | 99 | ||
95 | #[derive(Debug, Clone, PartialEq, Eq)] | 100 | #[derive(Debug, Clone, PartialEq, Eq)] |
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 5f9d53ecb..e09996c6f 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -236,7 +236,7 @@ impl Index<PatId> for Body { | |||
236 | 236 | ||
237 | impl BodySourceMap { | 237 | impl BodySourceMap { |
238 | pub fn expr_syntax(&self, expr: ExprId) -> Result<ExprSource, SyntheticSyntax> { | 238 | pub fn expr_syntax(&self, expr: ExprId) -> Result<ExprSource, SyntheticSyntax> { |
239 | self.expr_map_back[expr] | 239 | self.expr_map_back[expr].clone() |
240 | } | 240 | } |
241 | 241 | ||
242 | pub fn node_expr(&self, node: InFile<&ast::Expr>) -> Option<ExprId> { | 242 | pub fn node_expr(&self, node: InFile<&ast::Expr>) -> Option<ExprId> { |
@@ -255,7 +255,7 @@ impl BodySourceMap { | |||
255 | } | 255 | } |
256 | 256 | ||
257 | pub fn pat_syntax(&self, pat: PatId) -> Result<PatSource, SyntheticSyntax> { | 257 | pub fn pat_syntax(&self, pat: PatId) -> Result<PatSource, SyntheticSyntax> { |
258 | self.pat_map_back[pat] | 258 | self.pat_map_back[pat].clone() |
259 | } | 259 | } |
260 | 260 | ||
261 | pub fn node_pat(&self, node: InFile<&ast::Pat>) -> Option<PatId> { | 261 | pub fn node_pat(&self, node: InFile<&ast::Pat>) -> Option<PatId> { |
@@ -264,6 +264,6 @@ impl BodySourceMap { | |||
264 | } | 264 | } |
265 | 265 | ||
266 | pub fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::RecordField> { | 266 | pub fn field_syntax(&self, expr: ExprId, field: usize) -> AstPtr<ast::RecordField> { |
267 | self.field_map[&(expr, field)] | 267 | self.field_map[&(expr, field)].clone() |
268 | } | 268 | } |
269 | } | 269 | } |
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index c4a5ec59c..9d6ee095e 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -4,6 +4,7 @@ | |||
4 | use either::Either; | 4 | use either::Either; |
5 | 5 | ||
6 | use hir_expand::{ | 6 | use hir_expand::{ |
7 | hygiene::Hygiene, | ||
7 | name::{name, AsName, Name}, | 8 | name::{name, AsName, Name}, |
8 | MacroDefId, MacroDefKind, | 9 | MacroDefId, MacroDefKind, |
9 | }; | 10 | }; |
@@ -20,6 +21,7 @@ use test_utils::tested_by; | |||
20 | use super::{ExprSource, PatSource}; | 21 | use super::{ExprSource, PatSource}; |
21 | use crate::{ | 22 | use crate::{ |
22 | adt::StructKind, | 23 | adt::StructKind, |
24 | attr::Attrs, | ||
23 | body::{Body, BodySourceMap, Expander, PatPtr, SyntheticSyntax}, | 25 | body::{Body, BodySourceMap, Expander, PatPtr, SyntheticSyntax}, |
24 | builtin_type::{BuiltinFloat, BuiltinInt}, | 26 | builtin_type::{BuiltinFloat, BuiltinInt}, |
25 | db::DefDatabase, | 27 | db::DefDatabase, |
@@ -31,8 +33,8 @@ use crate::{ | |||
31 | path::GenericArgs, | 33 | path::GenericArgs, |
32 | path::Path, | 34 | path::Path, |
33 | type_ref::{Mutability, TypeRef}, | 35 | type_ref::{Mutability, TypeRef}, |
34 | AdtId, ConstLoc, ContainerId, DefWithBodyId, EnumLoc, FunctionLoc, Intern, ModuleDefId, | 36 | AdtId, ConstLoc, ContainerId, DefWithBodyId, EnumLoc, FunctionLoc, HasModule, Intern, |
35 | StaticLoc, StructLoc, TraitLoc, TypeAliasLoc, UnionLoc, | 37 | ModuleDefId, StaticLoc, StructLoc, TraitLoc, TypeAliasLoc, UnionLoc, |
36 | }; | 38 | }; |
37 | 39 | ||
38 | pub(super) fn lower( | 40 | pub(super) fn lower( |
@@ -104,7 +106,7 @@ impl ExprCollector<'_> { | |||
104 | fn alloc_expr(&mut self, expr: Expr, ptr: AstPtr<ast::Expr>) -> ExprId { | 106 | fn alloc_expr(&mut self, expr: Expr, ptr: AstPtr<ast::Expr>) -> ExprId { |
105 | let ptr = Either::Left(ptr); | 107 | let ptr = Either::Left(ptr); |
106 | let src = self.expander.to_source(ptr); | 108 | let src = self.expander.to_source(ptr); |
107 | let id = self.make_expr(expr, Ok(src)); | 109 | let id = self.make_expr(expr, Ok(src.clone())); |
108 | self.source_map.expr_map.insert(src, id); | 110 | self.source_map.expr_map.insert(src, id); |
109 | id | 111 | id |
110 | } | 112 | } |
@@ -116,7 +118,7 @@ impl ExprCollector<'_> { | |||
116 | fn alloc_expr_field_shorthand(&mut self, expr: Expr, ptr: AstPtr<ast::RecordField>) -> ExprId { | 118 | fn alloc_expr_field_shorthand(&mut self, expr: Expr, ptr: AstPtr<ast::RecordField>) -> ExprId { |
117 | let ptr = Either::Right(ptr); | 119 | let ptr = Either::Right(ptr); |
118 | let src = self.expander.to_source(ptr); | 120 | let src = self.expander.to_source(ptr); |
119 | let id = self.make_expr(expr, Ok(src)); | 121 | let id = self.make_expr(expr, Ok(src.clone())); |
120 | self.source_map.expr_map.insert(src, id); | 122 | self.source_map.expr_map.insert(src, id); |
121 | id | 123 | id |
122 | } | 124 | } |
@@ -134,7 +136,7 @@ impl ExprCollector<'_> { | |||
134 | 136 | ||
135 | fn alloc_pat(&mut self, pat: Pat, ptr: PatPtr) -> PatId { | 137 | fn alloc_pat(&mut self, pat: Pat, ptr: PatPtr) -> PatId { |
136 | let src = self.expander.to_source(ptr); | 138 | let src = self.expander.to_source(ptr); |
137 | let id = self.make_pat(pat, Ok(src)); | 139 | let id = self.make_pat(pat, Ok(src.clone())); |
138 | self.source_map.pat_map.insert(src, id); | 140 | self.source_map.pat_map.insert(src, id); |
139 | id | 141 | id |
140 | } | 142 | } |
@@ -298,28 +300,41 @@ impl ExprCollector<'_> { | |||
298 | self.alloc_expr(Expr::Return { expr }, syntax_ptr) | 300 | self.alloc_expr(Expr::Return { expr }, syntax_ptr) |
299 | } | 301 | } |
300 | ast::Expr::RecordLit(e) => { | 302 | ast::Expr::RecordLit(e) => { |
303 | let crate_graph = self.db.crate_graph(); | ||
301 | let path = e.path().and_then(|path| self.expander.parse_path(path)); | 304 | let path = e.path().and_then(|path| self.expander.parse_path(path)); |
302 | let mut field_ptrs = Vec::new(); | 305 | let mut field_ptrs = Vec::new(); |
303 | let record_lit = if let Some(nfl) = e.record_field_list() { | 306 | let record_lit = if let Some(nfl) = e.record_field_list() { |
304 | let fields = nfl | 307 | let fields = nfl |
305 | .fields() | 308 | .fields() |
306 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) | 309 | .inspect(|field| field_ptrs.push(AstPtr::new(field))) |
307 | .map(|field| RecordLitField { | 310 | .filter_map(|field| { |
308 | name: field | 311 | let module_id = ContainerId::DefWithBodyId(self.def).module(self.db); |
309 | .name_ref() | 312 | let attrs = Attrs::new( |
310 | .map(|nr| nr.as_name()) | 313 | &field, |
311 | .unwrap_or_else(Name::missing), | 314 | &Hygiene::new(self.db.upcast(), self.expander.current_file_id), |
312 | expr: if let Some(e) = field.expr() { | 315 | ); |
313 | self.collect_expr(e) | 316 | |
314 | } else if let Some(nr) = field.name_ref() { | 317 | if !attrs.is_cfg_enabled(&crate_graph[module_id.krate].cfg_options) { |
315 | // field shorthand | 318 | return None; |
316 | self.alloc_expr_field_shorthand( | 319 | } |
317 | Expr::Path(Path::from_name_ref(&nr)), | 320 | |
318 | AstPtr::new(&field), | 321 | Some(RecordLitField { |
319 | ) | 322 | name: field |
320 | } else { | 323 | .name_ref() |
321 | self.missing_expr() | 324 | .map(|nr| nr.as_name()) |
322 | }, | 325 | .unwrap_or_else(Name::missing), |
326 | expr: if let Some(e) = field.expr() { | ||
327 | self.collect_expr(e) | ||
328 | } else if let Some(nr) = field.name_ref() { | ||
329 | // field shorthand | ||
330 | self.alloc_expr_field_shorthand( | ||
331 | Expr::Path(Path::from_name_ref(&nr)), | ||
332 | AstPtr::new(&field), | ||
333 | ) | ||
334 | } else { | ||
335 | self.missing_expr() | ||
336 | }, | ||
337 | }) | ||
323 | }) | 338 | }) |
324 | .collect(); | 339 | .collect(); |
325 | let spread = nfl.spread().map(|s| self.collect_expr(s)); | 340 | let spread = nfl.spread().map(|s| self.collect_expr(s)); |
@@ -357,7 +372,7 @@ impl ExprCollector<'_> { | |||
357 | } | 372 | } |
358 | ast::Expr::RefExpr(e) => { | 373 | ast::Expr::RefExpr(e) => { |
359 | let expr = self.collect_expr_opt(e.expr()); | 374 | let expr = self.collect_expr_opt(e.expr()); |
360 | let mutability = Mutability::from_mutable(e.is_mut()); | 375 | let mutability = Mutability::from_mutable(e.mut_token().is_some()); |
361 | self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) | 376 | self.alloc_expr(Expr::Ref { expr, mutability }, syntax_ptr) |
362 | } | 377 | } |
363 | ast::Expr::PrefixExpr(e) => { | 378 | ast::Expr::PrefixExpr(e) => { |
@@ -572,10 +587,8 @@ impl ExprCollector<'_> { | |||
572 | let pattern = match &pat { | 587 | let pattern = match &pat { |
573 | ast::Pat::BindPat(bp) => { | 588 | ast::Pat::BindPat(bp) => { |
574 | let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); | 589 | let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); |
575 | let annotation = BindingAnnotation::new( | 590 | let annotation = |
576 | bp.mut_kw_token().is_some(), | 591 | BindingAnnotation::new(bp.mut_token().is_some(), bp.ref_token().is_some()); |
577 | bp.ref_kw_token().is_some(), | ||
578 | ); | ||
579 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); | 592 | let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); |
580 | if annotation == BindingAnnotation::Unannotated && subpat.is_none() { | 593 | if annotation == BindingAnnotation::Unannotated && subpat.is_none() { |
581 | // This could also be a single-segment path pattern. To | 594 | // This could also be a single-segment path pattern. To |
@@ -616,7 +629,7 @@ impl ExprCollector<'_> { | |||
616 | } | 629 | } |
617 | ast::Pat::RefPat(p) => { | 630 | ast::Pat::RefPat(p) => { |
618 | let pat = self.collect_pat_opt(p.pat()); | 631 | let pat = self.collect_pat_opt(p.pat()); |
619 | let mutability = Mutability::from_mutable(p.mut_kw_token().is_some()); | 632 | let mutability = Mutability::from_mutable(p.mut_token().is_some()); |
620 | Pat::Ref { pat, mutability } | 633 | Pat::Ref { pat, mutability } |
621 | } | 634 | } |
622 | ast::Pat::PathPat(p) => { | 635 | ast::Pat::PathPat(p) => { |
@@ -655,7 +668,9 @@ impl ExprCollector<'_> { | |||
655 | }); | 668 | }); |
656 | fields.extend(iter); | 669 | fields.extend(iter); |
657 | 670 | ||
658 | Pat::Record { path, args: fields } | 671 | let ellipsis = record_field_pat_list.dotdot_token().is_some(); |
672 | |||
673 | Pat::Record { path, args: fields, ellipsis } | ||
659 | } | 674 | } |
660 | ast::Pat::SlicePat(p) => { | 675 | ast::Pat::SlicePat(p) => { |
661 | let SlicePatComponents { prefix, slice, suffix } = p.components(); | 676 | let SlicePatComponents { prefix, slice, suffix } = p.components(); |
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 689bb6c5c..b8fbf0ed4 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -7,7 +7,6 @@ use hir_expand::{ | |||
7 | name::{name, AsName, Name}, | 7 | name::{name, AsName, Name}, |
8 | AstId, InFile, | 8 | AstId, InFile, |
9 | }; | 9 | }; |
10 | use ra_cfg::CfgOptions; | ||
11 | use ra_prof::profile; | 10 | use ra_prof::profile; |
12 | use ra_syntax::ast::{ | 11 | use ra_syntax::ast::{ |
13 | self, AstNode, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner, VisibilityOwner, | 12 | self, AstNode, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner, VisibilityOwner, |
@@ -75,7 +74,7 @@ impl FunctionData { | |||
75 | TypeRef::unit() | 74 | TypeRef::unit() |
76 | }; | 75 | }; |
77 | 76 | ||
78 | let ret_type = if src.value.async_kw_token().is_some() { | 77 | let ret_type = if src.value.async_token().is_some() { |
79 | let future_impl = desugar_future_path(ret_type); | 78 | let future_impl = desugar_future_path(ret_type); |
80 | let ty_bound = TypeBound::Path(future_impl); | 79 | let ty_bound = TypeBound::Path(future_impl); |
81 | TypeRef::ImplTrait(vec![ty_bound]) | 80 | TypeRef::ImplTrait(vec![ty_bound]) |
@@ -136,7 +135,7 @@ impl TraitData { | |||
136 | pub(crate) fn trait_data_query(db: &dyn DefDatabase, tr: TraitId) -> Arc<TraitData> { | 135 | pub(crate) fn trait_data_query(db: &dyn DefDatabase, tr: TraitId) -> Arc<TraitData> { |
137 | let src = tr.lookup(db).source(db); | 136 | let src = tr.lookup(db).source(db); |
138 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); | 137 | let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); |
139 | let auto = src.value.auto_kw_token().is_some(); | 138 | let auto = src.value.auto_token().is_some(); |
140 | let ast_id_map = db.ast_id_map(src.file_id); | 139 | let ast_id_map = db.ast_id_map(src.file_id); |
141 | 140 | ||
142 | let container = AssocContainerId::TraitId(tr); | 141 | let container = AssocContainerId::TraitId(tr); |
@@ -318,10 +317,6 @@ fn collect_impl_items_in_macro( | |||
318 | } | 317 | } |
319 | } | 318 | } |
320 | 319 | ||
321 | fn is_cfg_enabled(cfg_options: &CfgOptions, attrs: &Attrs) -> bool { | ||
322 | attrs.by_key("cfg").tt_values().all(|tt| cfg_options.is_cfg_enabled(tt) != Some(false)) | ||
323 | } | ||
324 | |||
325 | fn collect_impl_items( | 320 | fn collect_impl_items( |
326 | db: &dyn DefDatabase, | 321 | db: &dyn DefDatabase, |
327 | impl_items: impl Iterator<Item = ImplItem>, | 322 | impl_items: impl Iterator<Item = ImplItem>, |
@@ -341,10 +336,11 @@ fn collect_impl_items( | |||
341 | } | 336 | } |
342 | .intern(db); | 337 | .intern(db); |
343 | 338 | ||
344 | if !is_cfg_enabled( | 339 | if !db |
345 | &crate_graph[module_id.krate].cfg_options, | 340 | .function_data(def) |
346 | &db.function_data(def).attrs, | 341 | .attrs |
347 | ) { | 342 | .is_cfg_enabled(&crate_graph[module_id.krate].cfg_options) |
343 | { | ||
348 | None | 344 | None |
349 | } else { | 345 | } else { |
350 | Some(def.into()) | 346 | Some(def.into()) |
diff --git a/crates/ra_hir_def/src/diagnostics.rs b/crates/ra_hir_def/src/diagnostics.rs index 095498429..cfa0f2f76 100644 --- a/crates/ra_hir_def/src/diagnostics.rs +++ b/crates/ra_hir_def/src/diagnostics.rs | |||
@@ -20,7 +20,7 @@ impl Diagnostic for UnresolvedModule { | |||
20 | "unresolved module".to_string() | 20 | "unresolved module".to_string() |
21 | } | 21 | } |
22 | fn source(&self) -> InFile<SyntaxNodePtr> { | 22 | fn source(&self) -> InFile<SyntaxNodePtr> { |
23 | InFile { file_id: self.file, value: self.decl.into() } | 23 | InFile { file_id: self.file, value: self.decl.clone().into() } |
24 | } | 24 | } |
25 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 25 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
26 | self | 26 | self |
diff --git a/crates/ra_hir_def/src/expr.rs b/crates/ra_hir_def/src/expr.rs index 197bbe9bd..e11bdf3ec 100644 --- a/crates/ra_hir_def/src/expr.rs +++ b/crates/ra_hir_def/src/expr.rs | |||
@@ -376,35 +376,14 @@ pub enum Pat { | |||
376 | Wild, | 376 | Wild, |
377 | Tuple(Vec<PatId>), | 377 | Tuple(Vec<PatId>), |
378 | Or(Vec<PatId>), | 378 | Or(Vec<PatId>), |
379 | Record { | 379 | Record { path: Option<Path>, args: Vec<RecordFieldPat>, ellipsis: bool }, |
380 | path: Option<Path>, | 380 | Range { start: ExprId, end: ExprId }, |
381 | args: Vec<RecordFieldPat>, | 381 | Slice { prefix: Vec<PatId>, slice: Option<PatId>, suffix: Vec<PatId> }, |
382 | // FIXME: 'ellipsis' option | ||
383 | }, | ||
384 | Range { | ||
385 | start: ExprId, | ||
386 | end: ExprId, | ||
387 | }, | ||
388 | Slice { | ||
389 | prefix: Vec<PatId>, | ||
390 | slice: Option<PatId>, | ||
391 | suffix: Vec<PatId>, | ||
392 | }, | ||
393 | Path(Path), | 382 | Path(Path), |
394 | Lit(ExprId), | 383 | Lit(ExprId), |
395 | Bind { | 384 | Bind { mode: BindingAnnotation, name: Name, subpat: Option<PatId> }, |
396 | mode: BindingAnnotation, | 385 | TupleStruct { path: Option<Path>, args: Vec<PatId> }, |
397 | name: Name, | 386 | Ref { pat: PatId, mutability: Mutability }, |
398 | subpat: Option<PatId>, | ||
399 | }, | ||
400 | TupleStruct { | ||
401 | path: Option<Path>, | ||
402 | args: Vec<PatId>, | ||
403 | }, | ||
404 | Ref { | ||
405 | pat: PatId, | ||
406 | mutability: Mutability, | ||
407 | }, | ||
408 | } | 387 | } |
409 | 388 | ||
410 | impl Pat { | 389 | impl Pat { |
diff --git a/crates/ra_hir_def/src/lang_item.rs b/crates/ra_hir_def/src/lang_item.rs index 01b367278..d96ac8c0a 100644 --- a/crates/ra_hir_def/src/lang_item.rs +++ b/crates/ra_hir_def/src/lang_item.rs | |||
@@ -4,6 +4,7 @@ | |||
4 | //! features, such as Fn family of traits. | 4 | //! features, such as Fn family of traits. |
5 | use std::sync::Arc; | 5 | use std::sync::Arc; |
6 | 6 | ||
7 | use ra_prof::profile; | ||
7 | use ra_syntax::SmolStr; | 8 | use ra_syntax::SmolStr; |
8 | use rustc_hash::FxHashMap; | 9 | use rustc_hash::FxHashMap; |
9 | 10 | ||
@@ -78,6 +79,8 @@ impl LangItems { | |||
78 | 79 | ||
79 | /// Salsa query. This will look for lang items in a specific crate. | 80 | /// Salsa query. This will look for lang items in a specific crate. |
80 | pub(crate) fn crate_lang_items_query(db: &dyn DefDatabase, krate: CrateId) -> Arc<LangItems> { | 81 | pub(crate) fn crate_lang_items_query(db: &dyn DefDatabase, krate: CrateId) -> Arc<LangItems> { |
82 | let _p = profile("crate_lang_items_query"); | ||
83 | |||
81 | let mut lang_items = LangItems::default(); | 84 | let mut lang_items = LangItems::default(); |
82 | 85 | ||
83 | let crate_def_map = db.crate_def_map(krate); | 86 | let crate_def_map = db.crate_def_map(krate); |
@@ -95,6 +98,7 @@ impl LangItems { | |||
95 | db: &dyn DefDatabase, | 98 | db: &dyn DefDatabase, |
96 | module: ModuleId, | 99 | module: ModuleId, |
97 | ) -> Option<Arc<LangItems>> { | 100 | ) -> Option<Arc<LangItems>> { |
101 | let _p = profile("module_lang_items_query"); | ||
98 | let mut lang_items = LangItems::default(); | 102 | let mut lang_items = LangItems::default(); |
99 | lang_items.collect_lang_items(db, module); | 103 | lang_items.collect_lang_items(db, module); |
100 | if lang_items.items.is_empty() { | 104 | if lang_items.items.is_empty() { |
@@ -111,6 +115,7 @@ impl LangItems { | |||
111 | start_crate: CrateId, | 115 | start_crate: CrateId, |
112 | item: SmolStr, | 116 | item: SmolStr, |
113 | ) -> Option<LangItemTarget> { | 117 | ) -> Option<LangItemTarget> { |
118 | let _p = profile("lang_item_query"); | ||
114 | let lang_items = db.crate_lang_items(start_crate); | 119 | let lang_items = db.crate_lang_items(start_crate); |
115 | let start_crate_target = lang_items.items.get(&item); | 120 | let start_crate_target = lang_items.items.get(&item); |
116 | if let Some(target) = start_crate_target { | 121 | if let Some(target) = start_crate_target { |
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs index e72ba52cf..afd538e4a 100644 --- a/crates/ra_hir_def/src/nameres/raw.rs +++ b/crates/ra_hir_def/src/nameres/raw.rs | |||
@@ -287,7 +287,7 @@ impl RawItemsCollector { | |||
287 | let visibility = RawVisibility::from_ast_with_hygiene(module.visibility(), &self.hygiene); | 287 | let visibility = RawVisibility::from_ast_with_hygiene(module.visibility(), &self.hygiene); |
288 | 288 | ||
289 | let ast_id = self.source_ast_id_map.ast_id(&module); | 289 | let ast_id = self.source_ast_id_map.ast_id(&module); |
290 | if module.semi_token().is_some() { | 290 | if module.semicolon_token().is_some() { |
291 | let item = | 291 | let item = |
292 | self.raw_items.modules.alloc(ModuleData::Declaration { name, visibility, ast_id }); | 292 | self.raw_items.modules.alloc(ModuleData::Declaration { name, visibility, ast_id }); |
293 | self.push_item(current_module, attrs, RawItemKind::Module(item)); | 293 | self.push_item(current_module, attrs, RawItemKind::Module(item)); |
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/ra_hir_def/src/type_ref.rs index 7a8338937..ea29c4176 100644 --- a/crates/ra_hir_def/src/type_ref.rs +++ b/crates/ra_hir_def/src/type_ref.rs | |||
@@ -77,7 +77,7 @@ impl TypeRef { | |||
77 | } | 77 | } |
78 | ast::TypeRef::PointerType(inner) => { | 78 | ast::TypeRef::PointerType(inner) => { |
79 | let inner_ty = TypeRef::from_ast_opt(inner.type_ref()); | 79 | let inner_ty = TypeRef::from_ast_opt(inner.type_ref()); |
80 | let mutability = Mutability::from_mutable(inner.mut_kw_token().is_some()); | 80 | let mutability = Mutability::from_mutable(inner.mut_token().is_some()); |
81 | TypeRef::RawPtr(Box::new(inner_ty), mutability) | 81 | TypeRef::RawPtr(Box::new(inner_ty), mutability) |
82 | } | 82 | } |
83 | ast::TypeRef::ArrayType(inner) => { | 83 | ast::TypeRef::ArrayType(inner) => { |
@@ -88,7 +88,7 @@ impl TypeRef { | |||
88 | } | 88 | } |
89 | ast::TypeRef::ReferenceType(inner) => { | 89 | ast::TypeRef::ReferenceType(inner) => { |
90 | let inner_ty = TypeRef::from_ast_opt(inner.type_ref()); | 90 | let inner_ty = TypeRef::from_ast_opt(inner.type_ref()); |
91 | let mutability = Mutability::from_mutable(inner.mut_kw_token().is_some()); | 91 | let mutability = Mutability::from_mutable(inner.mut_token().is_some()); |
92 | TypeRef::Reference(Box::new(inner_ty), mutability) | 92 | TypeRef::Reference(Box::new(inner_ty), mutability) |
93 | } | 93 | } |
94 | ast::TypeRef::PlaceholderType(_inner) => TypeRef::Placeholder, | 94 | ast::TypeRef::PlaceholderType(_inner) => TypeRef::Placeholder, |
diff --git a/crates/ra_hir_expand/src/ast_id_map.rs b/crates/ra_hir_expand/src/ast_id_map.rs index 5643ecdce..a3ca302c2 100644 --- a/crates/ra_hir_expand/src/ast_id_map.rs +++ b/crates/ra_hir_expand/src/ast_id_map.rs | |||
@@ -90,7 +90,7 @@ impl AstIdMap { | |||
90 | } | 90 | } |
91 | 91 | ||
92 | pub(crate) fn get<N: AstNode>(&self, id: FileAstId<N>) -> AstPtr<N> { | 92 | pub(crate) fn get<N: AstNode>(&self, id: FileAstId<N>) -> AstPtr<N> { |
93 | self.arena[id.raw].cast::<N>().unwrap() | 93 | self.arena[id.raw].clone().cast::<N>().unwrap() |
94 | } | 94 | } |
95 | 95 | ||
96 | fn alloc(&mut self, item: &SyntaxNode) -> ErasedFileAstId { | 96 | fn alloc(&mut self, item: &SyntaxNode) -> ErasedFileAstId { |
diff --git a/crates/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml index 9a4a7aa6f..59efc1c31 100644 --- a/crates/ra_hir_ty/Cargo.toml +++ b/crates/ra_hir_ty/Cargo.toml | |||
@@ -24,6 +24,8 @@ ra_prof = { path = "../ra_prof" } | |||
24 | ra_syntax = { path = "../ra_syntax" } | 24 | ra_syntax = { path = "../ra_syntax" } |
25 | test_utils = { path = "../test_utils" } | 25 | test_utils = { path = "../test_utils" } |
26 | 26 | ||
27 | scoped-tls = "1" | ||
28 | |||
27 | chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "039fc904a05f8cb3d0c682c9a57a63dda7a35356" } | 29 | chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "039fc904a05f8cb3d0c682c9a57a63dda7a35356" } |
28 | chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "039fc904a05f8cb3d0c682c9a57a63dda7a35356" } | 30 | chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "039fc904a05f8cb3d0c682c9a57a63dda7a35356" } |
29 | chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "039fc904a05f8cb3d0c682c9a57a63dda7a35356" } | 31 | chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "039fc904a05f8cb3d0c682c9a57a63dda7a35356" } |
diff --git a/crates/ra_hir_ty/src/diagnostics.rs b/crates/ra_hir_ty/src/diagnostics.rs index 8cbce1168..927896d6f 100644 --- a/crates/ra_hir_ty/src/diagnostics.rs +++ b/crates/ra_hir_ty/src/diagnostics.rs | |||
@@ -21,7 +21,7 @@ impl Diagnostic for NoSuchField { | |||
21 | } | 21 | } |
22 | 22 | ||
23 | fn source(&self) -> InFile<SyntaxNodePtr> { | 23 | fn source(&self) -> InFile<SyntaxNodePtr> { |
24 | InFile { file_id: self.file, value: self.field.into() } | 24 | InFile { file_id: self.file, value: self.field.clone().into() } |
25 | } | 25 | } |
26 | 26 | ||
27 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 27 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
@@ -45,7 +45,7 @@ impl Diagnostic for MissingFields { | |||
45 | buf | 45 | buf |
46 | } | 46 | } |
47 | fn source(&self) -> InFile<SyntaxNodePtr> { | 47 | fn source(&self) -> InFile<SyntaxNodePtr> { |
48 | InFile { file_id: self.file, value: self.field_list.into() } | 48 | InFile { file_id: self.file, value: self.field_list.clone().into() } |
49 | } | 49 | } |
50 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 50 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
51 | self | 51 | self |
@@ -63,6 +63,29 @@ impl AstDiagnostic for MissingFields { | |||
63 | } | 63 | } |
64 | 64 | ||
65 | #[derive(Debug)] | 65 | #[derive(Debug)] |
66 | pub struct MissingPatFields { | ||
67 | pub file: HirFileId, | ||
68 | pub field_list: AstPtr<ast::RecordFieldPatList>, | ||
69 | pub missed_fields: Vec<Name>, | ||
70 | } | ||
71 | |||
72 | impl Diagnostic for MissingPatFields { | ||
73 | fn message(&self) -> String { | ||
74 | let mut buf = String::from("Missing structure fields:\n"); | ||
75 | for field in &self.missed_fields { | ||
76 | format_to!(buf, "- {}", field); | ||
77 | } | ||
78 | buf | ||
79 | } | ||
80 | fn source(&self) -> InFile<SyntaxNodePtr> { | ||
81 | InFile { file_id: self.file, value: self.field_list.clone().into() } | ||
82 | } | ||
83 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | ||
84 | self | ||
85 | } | ||
86 | } | ||
87 | |||
88 | #[derive(Debug)] | ||
66 | pub struct MissingMatchArms { | 89 | pub struct MissingMatchArms { |
67 | pub file: HirFileId, | 90 | pub file: HirFileId, |
68 | pub match_expr: AstPtr<ast::Expr>, | 91 | pub match_expr: AstPtr<ast::Expr>, |
@@ -74,7 +97,7 @@ impl Diagnostic for MissingMatchArms { | |||
74 | String::from("Missing match arm") | 97 | String::from("Missing match arm") |
75 | } | 98 | } |
76 | fn source(&self) -> InFile<SyntaxNodePtr> { | 99 | fn source(&self) -> InFile<SyntaxNodePtr> { |
77 | InFile { file_id: self.file, value: self.match_expr.into() } | 100 | InFile { file_id: self.file, value: self.match_expr.clone().into() } |
78 | } | 101 | } |
79 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 102 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
80 | self | 103 | self |
@@ -92,7 +115,7 @@ impl Diagnostic for MissingOkInTailExpr { | |||
92 | "wrap return expression in Ok".to_string() | 115 | "wrap return expression in Ok".to_string() |
93 | } | 116 | } |
94 | fn source(&self) -> InFile<SyntaxNodePtr> { | 117 | fn source(&self) -> InFile<SyntaxNodePtr> { |
95 | InFile { file_id: self.file, value: self.expr.into() } | 118 | InFile { file_id: self.file, value: self.expr.clone().into() } |
96 | } | 119 | } |
97 | fn as_any(&self) -> &(dyn Any + Send + 'static) { | 120 | fn as_any(&self) -> &(dyn Any + Send + 'static) { |
98 | self | 121 | self |
diff --git a/crates/ra_hir_ty/src/display.rs b/crates/ra_hir_ty/src/display.rs index 0e9313aa1..d03bbd5a7 100644 --- a/crates/ra_hir_ty/src/display.rs +++ b/crates/ra_hir_ty/src/display.rs | |||
@@ -247,19 +247,21 @@ impl HirDisplay for ApplicationTy { | |||
247 | } | 247 | } |
248 | } | 248 | } |
249 | TypeCtor::Closure { .. } => { | 249 | TypeCtor::Closure { .. } => { |
250 | let sig = self.parameters[0] | 250 | let sig = self.parameters[0].callable_sig(f.db); |
251 | .callable_sig(f.db) | 251 | if let Some(sig) = sig { |
252 | .expect("first closure parameter should contain signature"); | 252 | if sig.params().is_empty() { |
253 | if sig.params().is_empty() { | 253 | write!(f, "||")?; |
254 | write!(f, "||")?; | 254 | } else if f.omit_verbose_types() { |
255 | } else if f.omit_verbose_types() { | 255 | write!(f, "|{}|", TYPE_HINT_TRUNCATION)?; |
256 | write!(f, "|{}|", TYPE_HINT_TRUNCATION)?; | 256 | } else { |
257 | write!(f, "|")?; | ||
258 | f.write_joined(sig.params(), ", ")?; | ||
259 | write!(f, "|")?; | ||
260 | }; | ||
261 | write!(f, " -> {}", sig.ret().display(f.db))?; | ||
257 | } else { | 262 | } else { |
258 | write!(f, "|")?; | 263 | write!(f, "{{closure}}")?; |
259 | f.write_joined(sig.params(), ", ")?; | 264 | } |
260 | write!(f, "|")?; | ||
261 | }; | ||
262 | write!(f, " -> {}", sig.ret().display(f.db))?; | ||
263 | } | 265 | } |
264 | } | 266 | } |
265 | Ok(()) | 267 | Ok(()) |
diff --git a/crates/ra_hir_ty/src/expr.rs b/crates/ra_hir_ty/src/expr.rs index e45e9ea14..827b687de 100644 --- a/crates/ra_hir_ty/src/expr.rs +++ b/crates/ra_hir_ty/src/expr.rs | |||
@@ -9,7 +9,7 @@ use rustc_hash::FxHashSet; | |||
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | db::HirDatabase, | 11 | db::HirDatabase, |
12 | diagnostics::{MissingFields, MissingMatchArms, MissingOkInTailExpr}, | 12 | diagnostics::{MissingFields, MissingMatchArms, MissingOkInTailExpr, MissingPatFields}, |
13 | utils::variant_data, | 13 | utils::variant_data, |
14 | ApplicationTy, InferenceResult, Ty, TypeCtor, | 14 | ApplicationTy, InferenceResult, Ty, TypeCtor, |
15 | _match::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, | 15 | _match::{is_useful, MatchCheckCtx, Matrix, PatStack, Usefulness}, |
@@ -49,39 +49,97 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
49 | if let Some((variant_def, missed_fields, true)) = | 49 | if let Some((variant_def, missed_fields, true)) = |
50 | record_literal_missing_fields(db, &self.infer, id, expr) | 50 | record_literal_missing_fields(db, &self.infer, id, expr) |
51 | { | 51 | { |
52 | // XXX: only look at source_map if we do have missing fields | 52 | self.create_record_literal_missing_fields_diagnostic( |
53 | let (_, source_map) = db.body_with_source_map(self.func.into()); | 53 | id, |
54 | 54 | db, | |
55 | if let Ok(source_ptr) = source_map.expr_syntax(id) { | 55 | variant_def, |
56 | if let Some(expr) = source_ptr.value.left() { | 56 | missed_fields, |
57 | let root = source_ptr.file_syntax(db.upcast()); | 57 | ); |
58 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { | ||
59 | if let Some(field_list) = record_lit.record_field_list() { | ||
60 | let variant_data = variant_data(db.upcast(), variant_def); | ||
61 | let missed_fields = missed_fields | ||
62 | .into_iter() | ||
63 | .map(|idx| variant_data.fields()[idx].name.clone()) | ||
64 | .collect(); | ||
65 | self.sink.push(MissingFields { | ||
66 | file: source_ptr.file_id, | ||
67 | field_list: AstPtr::new(&field_list), | ||
68 | missed_fields, | ||
69 | }) | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | } | ||
74 | } | 58 | } |
75 | if let Expr::Match { expr, arms } = expr { | 59 | if let Expr::Match { expr, arms } = expr { |
76 | self.validate_match(id, *expr, arms, db, self.infer.clone()); | 60 | self.validate_match(id, *expr, arms, db, self.infer.clone()); |
77 | } | 61 | } |
78 | } | 62 | } |
63 | for (id, pat) in body.pats.iter() { | ||
64 | if let Some((variant_def, missed_fields, true)) = | ||
65 | record_pattern_missing_fields(db, &self.infer, id, pat) | ||
66 | { | ||
67 | self.create_record_pattern_missing_fields_diagnostic( | ||
68 | id, | ||
69 | db, | ||
70 | variant_def, | ||
71 | missed_fields, | ||
72 | ); | ||
73 | } | ||
74 | } | ||
79 | let body_expr = &body[body.body_expr]; | 75 | let body_expr = &body[body.body_expr]; |
80 | if let Expr::Block { tail: Some(t), .. } = body_expr { | 76 | if let Expr::Block { tail: Some(t), .. } = body_expr { |
81 | self.validate_results_in_tail_expr(body.body_expr, *t, db); | 77 | self.validate_results_in_tail_expr(body.body_expr, *t, db); |
82 | } | 78 | } |
83 | } | 79 | } |
84 | 80 | ||
81 | fn create_record_literal_missing_fields_diagnostic( | ||
82 | &mut self, | ||
83 | id: ExprId, | ||
84 | db: &dyn HirDatabase, | ||
85 | variant_def: VariantId, | ||
86 | missed_fields: Vec<LocalStructFieldId>, | ||
87 | ) { | ||
88 | // XXX: only look at source_map if we do have missing fields | ||
89 | let (_, source_map) = db.body_with_source_map(self.func.into()); | ||
90 | |||
91 | if let Ok(source_ptr) = source_map.expr_syntax(id) { | ||
92 | if let Some(expr) = source_ptr.value.as_ref().left() { | ||
93 | let root = source_ptr.file_syntax(db.upcast()); | ||
94 | if let ast::Expr::RecordLit(record_lit) = expr.to_node(&root) { | ||
95 | if let Some(field_list) = record_lit.record_field_list() { | ||
96 | let variant_data = variant_data(db.upcast(), variant_def); | ||
97 | let missed_fields = missed_fields | ||
98 | .into_iter() | ||
99 | .map(|idx| variant_data.fields()[idx].name.clone()) | ||
100 | .collect(); | ||
101 | self.sink.push(MissingFields { | ||
102 | file: source_ptr.file_id, | ||
103 | field_list: AstPtr::new(&field_list), | ||
104 | missed_fields, | ||
105 | }) | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
112 | fn create_record_pattern_missing_fields_diagnostic( | ||
113 | &mut self, | ||
114 | id: PatId, | ||
115 | db: &dyn HirDatabase, | ||
116 | variant_def: VariantId, | ||
117 | missed_fields: Vec<LocalStructFieldId>, | ||
118 | ) { | ||
119 | // XXX: only look at source_map if we do have missing fields | ||
120 | let (_, source_map) = db.body_with_source_map(self.func.into()); | ||
121 | |||
122 | if let Ok(source_ptr) = source_map.pat_syntax(id) { | ||
123 | if let Some(expr) = source_ptr.value.as_ref().left() { | ||
124 | let root = source_ptr.file_syntax(db.upcast()); | ||
125 | if let ast::Pat::RecordPat(record_pat) = expr.to_node(&root) { | ||
126 | if let Some(field_list) = record_pat.record_field_pat_list() { | ||
127 | let variant_data = variant_data(db.upcast(), variant_def); | ||
128 | let missed_fields = missed_fields | ||
129 | .into_iter() | ||
130 | .map(|idx| variant_data.fields()[idx].name.clone()) | ||
131 | .collect(); | ||
132 | self.sink.push(MissingPatFields { | ||
133 | file: source_ptr.file_id, | ||
134 | field_list: AstPtr::new(&field_list), | ||
135 | missed_fields, | ||
136 | }) | ||
137 | } | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | } | ||
142 | |||
85 | fn validate_match( | 143 | fn validate_match( |
86 | &mut self, | 144 | &mut self, |
87 | id: ExprId, | 145 | id: ExprId, |
@@ -147,7 +205,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { | |||
147 | } | 205 | } |
148 | 206 | ||
149 | if let Ok(source_ptr) = source_map.expr_syntax(id) { | 207 | if let Ok(source_ptr) = source_map.expr_syntax(id) { |
150 | if let Some(expr) = source_ptr.value.left() { | 208 | if let Some(expr) = source_ptr.value.as_ref().left() { |
151 | let root = source_ptr.file_syntax(db.upcast()); | 209 | let root = source_ptr.file_syntax(db.upcast()); |
152 | if let ast::Expr::MatchExpr(match_expr) = expr.to_node(&root) { | 210 | if let ast::Expr::MatchExpr(match_expr) = expr.to_node(&root) { |
153 | if let (Some(match_expr), Some(arms)) = | 211 | if let (Some(match_expr), Some(arms)) = |
@@ -232,9 +290,9 @@ pub fn record_pattern_missing_fields( | |||
232 | infer: &InferenceResult, | 290 | infer: &InferenceResult, |
233 | id: PatId, | 291 | id: PatId, |
234 | pat: &Pat, | 292 | pat: &Pat, |
235 | ) -> Option<(VariantId, Vec<LocalStructFieldId>)> { | 293 | ) -> Option<(VariantId, Vec<LocalStructFieldId>, /*exhaustive*/ bool)> { |
236 | let fields = match pat { | 294 | let (fields, exhaustive) = match pat { |
237 | Pat::Record { path: _, args } => args, | 295 | Pat::Record { path: _, args, ellipsis } => (args, !ellipsis), |
238 | _ => return None, | 296 | _ => return None, |
239 | }; | 297 | }; |
240 | 298 | ||
@@ -254,5 +312,5 @@ pub fn record_pattern_missing_fields( | |||
254 | if missed_fields.is_empty() { | 312 | if missed_fields.is_empty() { |
255 | return None; | 313 | return None; |
256 | } | 314 | } |
257 | Some((variant_def, missed_fields)) | 315 | Some((variant_def, missed_fields, exhaustive)) |
258 | } | 316 | } |
diff --git a/crates/ra_hir_ty/src/infer/pat.rs b/crates/ra_hir_ty/src/infer/pat.rs index 69bbb4307..078476f76 100644 --- a/crates/ra_hir_ty/src/infer/pat.rs +++ b/crates/ra_hir_ty/src/infer/pat.rs | |||
@@ -158,7 +158,7 @@ impl<'a> InferenceContext<'a> { | |||
158 | Pat::TupleStruct { path: p, args: subpats } => { | 158 | Pat::TupleStruct { path: p, args: subpats } => { |
159 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm, pat) | 159 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm, pat) |
160 | } | 160 | } |
161 | Pat::Record { path: p, args: fields } => { | 161 | Pat::Record { path: p, args: fields, ellipsis: _ } => { |
162 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) | 162 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) |
163 | } | 163 | } |
164 | Pat::Path(path) => { | 164 | Pat::Path(path) => { |
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index f97e0bfeb..54e31602f 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -23,7 +23,7 @@ use insta::assert_snapshot; | |||
23 | use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; | 23 | use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; |
24 | use ra_syntax::{ | 24 | use ra_syntax::{ |
25 | algo, | 25 | algo, |
26 | ast::{self, AstNode, AstToken}, | 26 | ast::{self, AstNode}, |
27 | }; | 27 | }; |
28 | use stdx::format_to; | 28 | use stdx::format_to; |
29 | 29 | ||
@@ -87,7 +87,7 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { | |||
87 | } | 87 | } |
88 | Err(SyntheticSyntax) => continue, | 88 | Err(SyntheticSyntax) => continue, |
89 | }; | 89 | }; |
90 | types.push((syntax_ptr, ty)); | 90 | types.push((syntax_ptr.clone(), ty)); |
91 | if let Some(mismatch) = inference_result.type_mismatch_for_expr(expr) { | 91 | if let Some(mismatch) = inference_result.type_mismatch_for_expr(expr) { |
92 | mismatches.push((syntax_ptr, mismatch)); | 92 | mismatches.push((syntax_ptr, mismatch)); |
93 | } | 93 | } |
@@ -101,7 +101,7 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { | |||
101 | let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db)); | 101 | let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db)); |
102 | 102 | ||
103 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { | 103 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { |
104 | (self_param.self_kw_token().unwrap().syntax().text_range(), "self".to_string()) | 104 | (self_param.self_token().unwrap().text_range(), "self".to_string()) |
105 | } else { | 105 | } else { |
106 | (src_ptr.value.range(), node.text().to_string().replace("\n", " ")) | 106 | (src_ptr.value.range(), node.text().to_string().replace("\n", " ")) |
107 | }; | 107 | }; |
@@ -349,3 +349,103 @@ fn no_such_field_with_feature_flag_diagnostics() { | |||
349 | 349 | ||
350 | assert_snapshot!(diagnostics, @r###""###); | 350 | assert_snapshot!(diagnostics, @r###""###); |
351 | } | 351 | } |
352 | |||
353 | #[test] | ||
354 | fn no_such_field_with_feature_flag_diagnostics_on_struct_lit() { | ||
355 | let diagnostics = TestDB::with_files( | ||
356 | r#" | ||
357 | //- /lib.rs crate:foo cfg:feature=foo | ||
358 | struct S { | ||
359 | #[cfg(feature = "foo")] | ||
360 | foo: u32, | ||
361 | #[cfg(not(feature = "foo"))] | ||
362 | bar: u32, | ||
363 | } | ||
364 | |||
365 | impl S { | ||
366 | #[cfg(feature = "foo")] | ||
367 | fn new(foo: u32) -> Self { | ||
368 | Self { foo } | ||
369 | } | ||
370 | #[cfg(not(feature = "foo"))] | ||
371 | fn new(bar: u32) -> Self { | ||
372 | Self { bar } | ||
373 | } | ||
374 | } | ||
375 | "#, | ||
376 | ) | ||
377 | .diagnostics() | ||
378 | .0; | ||
379 | |||
380 | assert_snapshot!(diagnostics, @r###""###); | ||
381 | } | ||
382 | |||
383 | #[test] | ||
384 | fn no_such_field_with_feature_flag_diagnostics_on_struct_fields() { | ||
385 | let diagnostics = TestDB::with_files( | ||
386 | r#" | ||
387 | //- /lib.rs crate:foo cfg:feature=foo | ||
388 | struct S { | ||
389 | #[cfg(feature = "foo")] | ||
390 | foo: u32, | ||
391 | #[cfg(not(feature = "foo"))] | ||
392 | bar: u32, | ||
393 | } | ||
394 | |||
395 | impl S { | ||
396 | fn new(val: u32) -> Self { | ||
397 | Self { | ||
398 | #[cfg(feature = "foo")] | ||
399 | foo: val, | ||
400 | #[cfg(not(feature = "foo"))] | ||
401 | bar: val, | ||
402 | } | ||
403 | } | ||
404 | } | ||
405 | "#, | ||
406 | ) | ||
407 | .diagnostics() | ||
408 | .0; | ||
409 | |||
410 | assert_snapshot!(diagnostics, @r###""###); | ||
411 | } | ||
412 | |||
413 | #[test] | ||
414 | fn missing_record_pat_field_diagnostic() { | ||
415 | let diagnostics = TestDB::with_files( | ||
416 | r" | ||
417 | //- /lib.rs | ||
418 | struct S { foo: i32, bar: () } | ||
419 | fn baz(s: S) { | ||
420 | let S { foo: _ } = s; | ||
421 | } | ||
422 | ", | ||
423 | ) | ||
424 | .diagnostics() | ||
425 | .0; | ||
426 | |||
427 | assert_snapshot!(diagnostics, @r###" | ||
428 | "{ foo: _ }": Missing structure fields: | ||
429 | - bar | ||
430 | "### | ||
431 | ); | ||
432 | } | ||
433 | |||
434 | #[test] | ||
435 | fn missing_record_pat_field_no_diagnostic_if_not_exhaustive() { | ||
436 | let diagnostics = TestDB::with_files( | ||
437 | r" | ||
438 | //- /lib.rs | ||
439 | struct S { foo: i32, bar: () } | ||
440 | fn baz(s: S) -> i32 { | ||
441 | match s { | ||
442 | S { foo, .. } => foo, | ||
443 | } | ||
444 | } | ||
445 | ", | ||
446 | ) | ||
447 | .diagnostics() | ||
448 | .0; | ||
449 | |||
450 | assert_snapshot!(diagnostics, @""); | ||
451 | } | ||
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index ff4599b71..f2a9b1c40 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs | |||
@@ -1,10 +1,13 @@ | |||
1 | use std::fs; | ||
2 | |||
1 | use insta::assert_snapshot; | 3 | use insta::assert_snapshot; |
2 | use ra_db::fixture::WithFixture; | 4 | use ra_db::fixture::WithFixture; |
3 | 5 | use test_utils::project_dir; | |
4 | use super::{infer, type_at, type_at_pos}; | ||
5 | 6 | ||
6 | use crate::test_db::TestDB; | 7 | use crate::test_db::TestDB; |
7 | 8 | ||
9 | use super::{infer, type_at, type_at_pos}; | ||
10 | |||
8 | #[test] | 11 | #[test] |
9 | fn cfg_impl_def() { | 12 | fn cfg_impl_def() { |
10 | let (db, pos) = TestDB::with_position( | 13 | let (db, pos) = TestDB::with_position( |
@@ -482,6 +485,30 @@ fn bar() -> u32 {0} | |||
482 | } | 485 | } |
483 | 486 | ||
484 | #[test] | 487 | #[test] |
488 | #[ignore] | ||
489 | fn include_accidentally_quadratic() { | ||
490 | let file = project_dir().join("crates/ra_syntax/test_data/accidentally_quadratic"); | ||
491 | let big_file = fs::read_to_string(file).unwrap(); | ||
492 | let big_file = vec![big_file; 10].join("\n"); | ||
493 | |||
494 | let fixture = r#" | ||
495 | //- /main.rs | ||
496 | #[rustc_builtin_macro] | ||
497 | macro_rules! include {() => {}} | ||
498 | |||
499 | include!("foo.rs"); | ||
500 | |||
501 | fn main() { | ||
502 | RegisterBlock { }<|>; | ||
503 | } | ||
504 | "#; | ||
505 | let fixture = format!("{}\n//- /foo.rs\n{}", fixture, big_file); | ||
506 | |||
507 | let (db, pos) = TestDB::with_position(&fixture); | ||
508 | assert_eq!("RegisterBlock", type_at_pos(&db, pos)); | ||
509 | } | ||
510 | |||
511 | #[test] | ||
485 | fn infer_builtin_macros_include_concat() { | 512 | fn infer_builtin_macros_include_concat() { |
486 | let (db, pos) = TestDB::with_position( | 513 | let (db, pos) = TestDB::with_position( |
487 | r#" | 514 | r#" |
diff --git a/crates/ra_hir_ty/src/traits.rs b/crates/ra_hir_ty/src/traits.rs index 5a1e12ce9..21e233379 100644 --- a/crates/ra_hir_ty/src/traits.rs +++ b/crates/ra_hir_ty/src/traits.rs | |||
@@ -177,7 +177,7 @@ fn solve( | |||
177 | 177 | ||
178 | let fuel = std::cell::Cell::new(CHALK_SOLVER_FUEL); | 178 | let fuel = std::cell::Cell::new(CHALK_SOLVER_FUEL); |
179 | 179 | ||
180 | let solution = solver.solve_limited(&context, goal, || { | 180 | let should_continue = || { |
181 | context.db.check_canceled(); | 181 | context.db.check_canceled(); |
182 | let remaining = fuel.get(); | 182 | let remaining = fuel.get(); |
183 | fuel.set(remaining - 1); | 183 | fuel.set(remaining - 1); |
@@ -185,12 +185,21 @@ fn solve( | |||
185 | log::debug!("fuel exhausted"); | 185 | log::debug!("fuel exhausted"); |
186 | } | 186 | } |
187 | remaining > 0 | 187 | remaining > 0 |
188 | }); | 188 | }; |
189 | let mut solve = || solver.solve_limited(&context, goal, should_continue); | ||
190 | // don't set the TLS for Chalk unless Chalk debugging is active, to make | ||
191 | // extra sure we only use it for debugging | ||
192 | let solution = | ||
193 | if is_chalk_debug() { chalk::tls::set_current_program(db, solve) } else { solve() }; | ||
189 | 194 | ||
190 | log::debug!("solve({:?}) => {:?}", goal, solution); | 195 | log::debug!("solve({:?}) => {:?}", goal, solution); |
191 | solution | 196 | solution |
192 | } | 197 | } |
193 | 198 | ||
199 | fn is_chalk_debug() -> bool { | ||
200 | std::env::var("CHALK_DEBUG").is_ok() | ||
201 | } | ||
202 | |||
194 | fn solution_from_chalk( | 203 | fn solution_from_chalk( |
195 | db: &dyn HirDatabase, | 204 | db: &dyn HirDatabase, |
196 | solution: chalk_solve::Solution<Interner>, | 205 | solution: chalk_solve::Solution<Interner>, |
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 1bc0f0713..c5f1b5232 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -20,6 +20,8 @@ use crate::{ | |||
20 | ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 20 | ProjectionTy, Substs, TraitRef, Ty, TypeCtor, |
21 | }; | 21 | }; |
22 | 22 | ||
23 | pub(super) mod tls; | ||
24 | |||
23 | #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] | 25 | #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] |
24 | pub struct Interner; | 26 | pub struct Interner; |
25 | 27 | ||
@@ -33,90 +35,85 @@ impl chalk_ir::interner::Interner for Interner { | |||
33 | type Identifier = TypeAliasId; | 35 | type Identifier = TypeAliasId; |
34 | type DefId = InternId; | 36 | type DefId = InternId; |
35 | 37 | ||
36 | // FIXME: implement these | ||
37 | fn debug_struct_id( | 38 | fn debug_struct_id( |
38 | _type_kind_id: chalk_ir::StructId<Self>, | 39 | type_kind_id: StructId, |
39 | _fmt: &mut fmt::Formatter<'_>, | 40 | fmt: &mut fmt::Formatter<'_>, |
40 | ) -> Option<fmt::Result> { | 41 | ) -> Option<fmt::Result> { |
41 | None | 42 | tls::with_current_program(|prog| Some(prog?.debug_struct_id(type_kind_id, fmt))) |
42 | } | 43 | } |
43 | 44 | ||
44 | fn debug_trait_id( | 45 | fn debug_trait_id(type_kind_id: TraitId, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { |
45 | _type_kind_id: chalk_ir::TraitId<Self>, | 46 | tls::with_current_program(|prog| Some(prog?.debug_trait_id(type_kind_id, fmt))) |
46 | _fmt: &mut fmt::Formatter<'_>, | ||
47 | ) -> Option<fmt::Result> { | ||
48 | None | ||
49 | } | 47 | } |
50 | 48 | ||
51 | fn debug_assoc_type_id( | 49 | fn debug_assoc_type_id(id: AssocTypeId, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { |
52 | _id: chalk_ir::AssocTypeId<Self>, | 50 | tls::with_current_program(|prog| Some(prog?.debug_assoc_type_id(id, fmt))) |
53 | _fmt: &mut fmt::Formatter<'_>, | ||
54 | ) -> Option<fmt::Result> { | ||
55 | None | ||
56 | } | 51 | } |
57 | 52 | ||
58 | fn debug_alias( | 53 | fn debug_alias( |
59 | _projection: &chalk_ir::AliasTy<Self>, | 54 | alias: &chalk_ir::AliasTy<Interner>, |
60 | _fmt: &mut fmt::Formatter<'_>, | 55 | fmt: &mut fmt::Formatter<'_>, |
61 | ) -> Option<fmt::Result> { | 56 | ) -> Option<fmt::Result> { |
62 | None | 57 | tls::with_current_program(|prog| Some(prog?.debug_alias(alias, fmt))) |
63 | } | 58 | } |
64 | 59 | ||
65 | fn debug_ty(_ty: &chalk_ir::Ty<Self>, _fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { | 60 | fn debug_ty(ty: &chalk_ir::Ty<Interner>, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { |
66 | None | 61 | tls::with_current_program(|prog| Some(prog?.debug_ty(ty, fmt))) |
67 | } | 62 | } |
68 | 63 | ||
69 | fn debug_lifetime( | 64 | fn debug_lifetime( |
70 | _lifetime: &chalk_ir::Lifetime<Self>, | 65 | lifetime: &chalk_ir::Lifetime<Interner>, |
71 | _fmt: &mut fmt::Formatter<'_>, | 66 | fmt: &mut fmt::Formatter<'_>, |
72 | ) -> Option<fmt::Result> { | 67 | ) -> Option<fmt::Result> { |
73 | None | 68 | tls::with_current_program(|prog| Some(prog?.debug_lifetime(lifetime, fmt))) |
74 | } | 69 | } |
75 | 70 | ||
76 | fn debug_parameter( | 71 | fn debug_parameter( |
77 | _parameter: &Parameter<Self>, | 72 | parameter: &Parameter<Interner>, |
78 | _fmt: &mut fmt::Formatter<'_>, | 73 | fmt: &mut fmt::Formatter<'_>, |
79 | ) -> Option<fmt::Result> { | 74 | ) -> Option<fmt::Result> { |
80 | None | 75 | tls::with_current_program(|prog| Some(prog?.debug_parameter(parameter, fmt))) |
81 | } | 76 | } |
82 | 77 | ||
83 | fn debug_goal(_goal: &Goal<Self>, _fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { | 78 | fn debug_goal(goal: &Goal<Interner>, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { |
84 | None | 79 | tls::with_current_program(|prog| Some(prog?.debug_goal(goal, fmt))) |
85 | } | 80 | } |
86 | 81 | ||
87 | fn debug_goals( | 82 | fn debug_goals( |
88 | _goals: &chalk_ir::Goals<Self>, | 83 | goals: &chalk_ir::Goals<Interner>, |
89 | _fmt: &mut fmt::Formatter<'_>, | 84 | fmt: &mut fmt::Formatter<'_>, |
90 | ) -> Option<fmt::Result> { | 85 | ) -> Option<fmt::Result> { |
91 | None | 86 | tls::with_current_program(|prog| Some(prog?.debug_goals(goals, fmt))) |
92 | } | 87 | } |
93 | 88 | ||
94 | fn debug_program_clause_implication( | 89 | fn debug_program_clause_implication( |
95 | _pci: &chalk_ir::ProgramClauseImplication<Self>, | 90 | pci: &chalk_ir::ProgramClauseImplication<Interner>, |
96 | _fmt: &mut fmt::Formatter<'_>, | 91 | fmt: &mut fmt::Formatter<'_>, |
97 | ) -> Option<fmt::Result> { | 92 | ) -> Option<fmt::Result> { |
98 | None | 93 | tls::with_current_program(|prog| Some(prog?.debug_program_clause_implication(pci, fmt))) |
99 | } | 94 | } |
100 | 95 | ||
101 | fn debug_application_ty( | 96 | fn debug_application_ty( |
102 | _application_ty: &chalk_ir::ApplicationTy<Self>, | 97 | application_ty: &chalk_ir::ApplicationTy<Interner>, |
103 | _fmt: &mut fmt::Formatter<'_>, | 98 | fmt: &mut fmt::Formatter<'_>, |
104 | ) -> Option<fmt::Result> { | 99 | ) -> Option<fmt::Result> { |
105 | None | 100 | tls::with_current_program(|prog| Some(prog?.debug_application_ty(application_ty, fmt))) |
106 | } | 101 | } |
107 | 102 | ||
108 | fn debug_substitution( | 103 | fn debug_substitution( |
109 | _substitution: &chalk_ir::Substitution<Self>, | 104 | substitution: &chalk_ir::Substitution<Interner>, |
110 | _fmt: &mut fmt::Formatter<'_>, | 105 | fmt: &mut fmt::Formatter<'_>, |
111 | ) -> Option<fmt::Result> { | 106 | ) -> Option<fmt::Result> { |
112 | None | 107 | tls::with_current_program(|prog| Some(prog?.debug_substitution(substitution, fmt))) |
113 | } | 108 | } |
114 | 109 | ||
115 | fn debug_separator_trait_ref( | 110 | fn debug_separator_trait_ref( |
116 | _separator_trait_ref: &chalk_ir::SeparatorTraitRef<Self>, | 111 | separator_trait_ref: &chalk_ir::SeparatorTraitRef<Interner>, |
117 | _fmt: &mut fmt::Formatter<'_>, | 112 | fmt: &mut fmt::Formatter<'_>, |
118 | ) -> Option<fmt::Result> { | 113 | ) -> Option<fmt::Result> { |
119 | None | 114 | tls::with_current_program(|prog| { |
115 | Some(prog?.debug_separator_trait_ref(separator_trait_ref, fmt)) | ||
116 | }) | ||
120 | } | 117 | } |
121 | 118 | ||
122 | fn intern_ty(&self, ty: chalk_ir::TyData<Self>) -> Box<chalk_ir::TyData<Self>> { | 119 | fn intern_ty(&self, ty: chalk_ir::TyData<Self>) -> Box<chalk_ir::TyData<Self>> { |
diff --git a/crates/ra_hir_ty/src/traits/chalk/tls.rs b/crates/ra_hir_ty/src/traits/chalk/tls.rs new file mode 100644 index 000000000..d9bbb54a5 --- /dev/null +++ b/crates/ra_hir_ty/src/traits/chalk/tls.rs | |||
@@ -0,0 +1,231 @@ | |||
1 | //! Implementation of Chalk debug helper functions using TLS. | ||
2 | use std::fmt; | ||
3 | |||
4 | use chalk_ir::{AliasTy, Goal, Goals, Lifetime, Parameter, ProgramClauseImplication, TypeName}; | ||
5 | |||
6 | use super::{from_chalk, Interner}; | ||
7 | use crate::{db::HirDatabase, CallableDef, TypeCtor}; | ||
8 | use hir_def::{AdtId, AssocContainerId, Lookup, TypeAliasId}; | ||
9 | |||
10 | pub use unsafe_tls::{set_current_program, with_current_program}; | ||
11 | |||
12 | pub struct DebugContext<'a>(&'a (dyn HirDatabase + 'a)); | ||
13 | |||
14 | impl DebugContext<'_> { | ||
15 | pub fn debug_struct_id( | ||
16 | &self, | ||
17 | id: super::StructId, | ||
18 | f: &mut fmt::Formatter<'_>, | ||
19 | ) -> Result<(), fmt::Error> { | ||
20 | let type_ctor: TypeCtor = from_chalk(self.0, TypeName::Struct(id)); | ||
21 | match type_ctor { | ||
22 | TypeCtor::Bool => write!(f, "bool")?, | ||
23 | TypeCtor::Char => write!(f, "char")?, | ||
24 | TypeCtor::Int(t) => write!(f, "{}", t)?, | ||
25 | TypeCtor::Float(t) => write!(f, "{}", t)?, | ||
26 | TypeCtor::Str => write!(f, "str")?, | ||
27 | TypeCtor::Slice => write!(f, "slice")?, | ||
28 | TypeCtor::Array => write!(f, "array")?, | ||
29 | TypeCtor::RawPtr(m) => write!(f, "*{}", m.as_keyword_for_ptr())?, | ||
30 | TypeCtor::Ref(m) => write!(f, "&{}", m.as_keyword_for_ref())?, | ||
31 | TypeCtor::Never => write!(f, "!")?, | ||
32 | TypeCtor::Tuple { .. } => { | ||
33 | write!(f, "()")?; | ||
34 | } | ||
35 | TypeCtor::FnPtr { .. } => { | ||
36 | write!(f, "fn")?; | ||
37 | } | ||
38 | TypeCtor::FnDef(def) => { | ||
39 | let name = match def { | ||
40 | CallableDef::FunctionId(ff) => self.0.function_data(ff).name.clone(), | ||
41 | CallableDef::StructId(s) => self.0.struct_data(s).name.clone(), | ||
42 | CallableDef::EnumVariantId(e) => { | ||
43 | let enum_data = self.0.enum_data(e.parent); | ||
44 | enum_data.variants[e.local_id].name.clone() | ||
45 | } | ||
46 | }; | ||
47 | match def { | ||
48 | CallableDef::FunctionId(_) => write!(f, "{{fn {}}}", name)?, | ||
49 | CallableDef::StructId(_) | CallableDef::EnumVariantId(_) => { | ||
50 | write!(f, "{{ctor {}}}", name)? | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | TypeCtor::Adt(def_id) => { | ||
55 | let name = match def_id { | ||
56 | AdtId::StructId(it) => self.0.struct_data(it).name.clone(), | ||
57 | AdtId::UnionId(it) => self.0.union_data(it).name.clone(), | ||
58 | AdtId::EnumId(it) => self.0.enum_data(it).name.clone(), | ||
59 | }; | ||
60 | write!(f, "{}", name)?; | ||
61 | } | ||
62 | TypeCtor::AssociatedType(type_alias) => { | ||
63 | let trait_ = match type_alias.lookup(self.0.upcast()).container { | ||
64 | AssocContainerId::TraitId(it) => it, | ||
65 | _ => panic!("not an associated type"), | ||
66 | }; | ||
67 | let trait_name = self.0.trait_data(trait_).name.clone(); | ||
68 | let name = self.0.type_alias_data(type_alias).name.clone(); | ||
69 | write!(f, "{}::{}", trait_name, name)?; | ||
70 | } | ||
71 | TypeCtor::Closure { def, expr } => { | ||
72 | write!(f, "{{closure {:?} in {:?}}}", expr.into_raw(), def)?; | ||
73 | } | ||
74 | } | ||
75 | Ok(()) | ||
76 | } | ||
77 | |||
78 | pub fn debug_trait_id( | ||
79 | &self, | ||
80 | id: super::TraitId, | ||
81 | fmt: &mut fmt::Formatter<'_>, | ||
82 | ) -> Result<(), fmt::Error> { | ||
83 | let trait_: hir_def::TraitId = from_chalk(self.0, id); | ||
84 | let trait_data = self.0.trait_data(trait_); | ||
85 | write!(fmt, "{}", trait_data.name) | ||
86 | } | ||
87 | |||
88 | pub fn debug_assoc_type_id( | ||
89 | &self, | ||
90 | id: super::AssocTypeId, | ||
91 | fmt: &mut fmt::Formatter<'_>, | ||
92 | ) -> Result<(), fmt::Error> { | ||
93 | let type_alias: TypeAliasId = from_chalk(self.0, id); | ||
94 | let type_alias_data = self.0.type_alias_data(type_alias); | ||
95 | let trait_ = match type_alias.lookup(self.0.upcast()).container { | ||
96 | AssocContainerId::TraitId(t) => t, | ||
97 | _ => panic!("associated type not in trait"), | ||
98 | }; | ||
99 | let trait_data = self.0.trait_data(trait_); | ||
100 | write!(fmt, "{}::{}", trait_data.name, type_alias_data.name) | ||
101 | } | ||
102 | |||
103 | pub fn debug_alias( | ||
104 | &self, | ||
105 | alias: &AliasTy<Interner>, | ||
106 | fmt: &mut fmt::Formatter<'_>, | ||
107 | ) -> Result<(), fmt::Error> { | ||
108 | let type_alias: TypeAliasId = from_chalk(self.0, alias.associated_ty_id); | ||
109 | let type_alias_data = self.0.type_alias_data(type_alias); | ||
110 | let trait_ = match type_alias.lookup(self.0.upcast()).container { | ||
111 | AssocContainerId::TraitId(t) => t, | ||
112 | _ => panic!("associated type not in trait"), | ||
113 | }; | ||
114 | let trait_data = self.0.trait_data(trait_); | ||
115 | let params = alias.substitution.parameters(&Interner); | ||
116 | write!( | ||
117 | fmt, | ||
118 | "<{:?} as {}<{:?}>>::{}", | ||
119 | ¶ms[0], | ||
120 | trait_data.name, | ||
121 | ¶ms[1..], | ||
122 | type_alias_data.name | ||
123 | ) | ||
124 | } | ||
125 | |||
126 | pub fn debug_ty( | ||
127 | &self, | ||
128 | ty: &chalk_ir::Ty<Interner>, | ||
129 | fmt: &mut fmt::Formatter<'_>, | ||
130 | ) -> Result<(), fmt::Error> { | ||
131 | write!(fmt, "{:?}", ty.data(&Interner)) | ||
132 | } | ||
133 | |||
134 | pub fn debug_lifetime( | ||
135 | &self, | ||
136 | lifetime: &Lifetime<Interner>, | ||
137 | fmt: &mut fmt::Formatter<'_>, | ||
138 | ) -> Result<(), fmt::Error> { | ||
139 | write!(fmt, "{:?}", lifetime.data(&Interner)) | ||
140 | } | ||
141 | |||
142 | pub fn debug_parameter( | ||
143 | &self, | ||
144 | parameter: &Parameter<Interner>, | ||
145 | fmt: &mut fmt::Formatter<'_>, | ||
146 | ) -> Result<(), fmt::Error> { | ||
147 | write!(fmt, "{:?}", parameter.data(&Interner).inner_debug()) | ||
148 | } | ||
149 | |||
150 | pub fn debug_goal( | ||
151 | &self, | ||
152 | goal: &Goal<Interner>, | ||
153 | fmt: &mut fmt::Formatter<'_>, | ||
154 | ) -> Result<(), fmt::Error> { | ||
155 | let goal_data = goal.data(&Interner); | ||
156 | write!(fmt, "{:?}", goal_data) | ||
157 | } | ||
158 | |||
159 | pub fn debug_goals( | ||
160 | &self, | ||
161 | goals: &Goals<Interner>, | ||
162 | fmt: &mut fmt::Formatter<'_>, | ||
163 | ) -> Result<(), fmt::Error> { | ||
164 | write!(fmt, "{:?}", goals.debug(&Interner)) | ||
165 | } | ||
166 | |||
167 | pub fn debug_program_clause_implication( | ||
168 | &self, | ||
169 | pci: &ProgramClauseImplication<Interner>, | ||
170 | fmt: &mut fmt::Formatter<'_>, | ||
171 | ) -> Result<(), fmt::Error> { | ||
172 | write!(fmt, "{:?}", pci.debug(&Interner)) | ||
173 | } | ||
174 | |||
175 | pub fn debug_application_ty( | ||
176 | &self, | ||
177 | application_ty: &chalk_ir::ApplicationTy<Interner>, | ||
178 | fmt: &mut fmt::Formatter<'_>, | ||
179 | ) -> Result<(), fmt::Error> { | ||
180 | write!(fmt, "{:?}", application_ty.debug(&Interner)) | ||
181 | } | ||
182 | |||
183 | pub fn debug_substitution( | ||
184 | &self, | ||
185 | substitution: &chalk_ir::Substitution<Interner>, | ||
186 | fmt: &mut fmt::Formatter<'_>, | ||
187 | ) -> Result<(), fmt::Error> { | ||
188 | write!(fmt, "{:?}", substitution.debug(&Interner)) | ||
189 | } | ||
190 | |||
191 | pub fn debug_separator_trait_ref( | ||
192 | &self, | ||
193 | separator_trait_ref: &chalk_ir::SeparatorTraitRef<Interner>, | ||
194 | fmt: &mut fmt::Formatter<'_>, | ||
195 | ) -> Result<(), fmt::Error> { | ||
196 | write!(fmt, "{:?}", separator_trait_ref.debug(&Interner)) | ||
197 | } | ||
198 | } | ||
199 | |||
200 | mod unsafe_tls { | ||
201 | use super::DebugContext; | ||
202 | use crate::db::HirDatabase; | ||
203 | use scoped_tls::scoped_thread_local; | ||
204 | |||
205 | scoped_thread_local!(static PROGRAM: DebugContext); | ||
206 | |||
207 | pub fn with_current_program<R>( | ||
208 | op: impl for<'a> FnOnce(Option<&'a DebugContext<'a>>) -> R, | ||
209 | ) -> R { | ||
210 | if PROGRAM.is_set() { | ||
211 | PROGRAM.with(|prog| op(Some(prog))) | ||
212 | } else { | ||
213 | op(None) | ||
214 | } | ||
215 | } | ||
216 | |||
217 | pub fn set_current_program<OP, R>(p: &dyn HirDatabase, op: OP) -> R | ||
218 | where | ||
219 | OP: FnOnce() -> R, | ||
220 | { | ||
221 | let ctx = DebugContext(p); | ||
222 | // we're transmuting the lifetime in the DebugContext to static. This is | ||
223 | // fine because we only keep the reference for the lifetime of this | ||
224 | // function, *and* the only way to access the context is through | ||
225 | // `with_current_program`, which hides the lifetime through the `for` | ||
226 | // type. | ||
227 | let static_p: &DebugContext<'static> = | ||
228 | unsafe { std::mem::transmute::<&DebugContext, &DebugContext<'static>>(&ctx) }; | ||
229 | PROGRAM.set(static_p, || op()) | ||
230 | } | ||
231 | } | ||
diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index 62ae5ccb4..f84b559fc 100644 --- a/crates/ra_ide/src/completion/complete_fn_param.rs +++ b/crates/ra_ide/src/completion/complete_fn_param.rs | |||
@@ -1,6 +1,9 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use ra_syntax::{ast, match_ast, AstNode}; | 3 | use ra_syntax::{ |
4 | ast::{self, ModuleItemOwner}, | ||
5 | match_ast, AstNode, | ||
6 | }; | ||
4 | use rustc_hash::FxHashMap; | 7 | use rustc_hash::FxHashMap; |
5 | 8 | ||
6 | use crate::completion::{CompletionContext, CompletionItem, CompletionKind, Completions}; | 9 | use crate::completion::{CompletionContext, CompletionItem, CompletionKind, Completions}; |
@@ -16,11 +19,19 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) | |||
16 | 19 | ||
17 | let mut params = FxHashMap::default(); | 20 | let mut params = FxHashMap::default(); |
18 | for node in ctx.token.parent().ancestors() { | 21 | for node in ctx.token.parent().ancestors() { |
19 | match_ast! { | 22 | let items = match_ast! { |
20 | match node { | 23 | match node { |
21 | ast::SourceFile(it) => process(it, &mut params), | 24 | ast::SourceFile(it) => it.items(), |
22 | ast::ItemList(it) => process(it, &mut params), | 25 | ast::ItemList(it) => it.items(), |
23 | _ => (), | 26 | _ => continue, |
27 | } | ||
28 | }; | ||
29 | for item in items { | ||
30 | if let ast::ModuleItem::FnDef(func) = item { | ||
31 | func.param_list().into_iter().flat_map(|it| it.params()).for_each(|param| { | ||
32 | let text = param.syntax().text().to_string(); | ||
33 | params.entry(text).or_insert((0, param)).0 += 1; | ||
34 | }) | ||
24 | } | 35 | } |
25 | } | 36 | } |
26 | } | 37 | } |
@@ -39,15 +50,6 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) | |||
39 | .lookup_by(lookup) | 50 | .lookup_by(lookup) |
40 | .add_to(acc) | 51 | .add_to(acc) |
41 | }); | 52 | }); |
42 | |||
43 | fn process<N: ast::FnDefOwner>(node: N, params: &mut FxHashMap<String, (u32, ast::Param)>) { | ||
44 | node.functions().filter_map(|it| it.param_list()).flat_map(|it| it.params()).for_each( | ||
45 | |param| { | ||
46 | let text = param.syntax().text().to_string(); | ||
47 | params.entry(text).or_insert((0, param)).0 += 1; | ||
48 | }, | ||
49 | ) | ||
50 | } | ||
51 | } | 53 | } |
52 | 54 | ||
53 | #[cfg(test)] | 55 | #[cfg(test)] |
diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index ded1ff3bc..fab02945c 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs | |||
@@ -35,7 +35,7 @@ use hir::{self, Docs, HasSource}; | |||
35 | use ra_assists::utils::get_missing_impl_items; | 35 | use ra_assists::utils::get_missing_impl_items; |
36 | use ra_syntax::{ | 36 | use ra_syntax::{ |
37 | ast::{self, edit, ImplDef}, | 37 | ast::{self, edit, ImplDef}, |
38 | AstNode, SyntaxKind, SyntaxNode, TextRange, | 38 | AstNode, SyntaxKind, SyntaxNode, TextRange, T, |
39 | }; | 39 | }; |
40 | use ra_text_edit::TextEdit; | 40 | use ra_text_edit::TextEdit; |
41 | 41 | ||
@@ -204,7 +204,7 @@ fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { | |||
204 | let end = const_ | 204 | let end = const_ |
205 | .syntax() | 205 | .syntax() |
206 | .children_with_tokens() | 206 | .children_with_tokens() |
207 | .find(|s| s.kind() == SyntaxKind::SEMI || s.kind() == SyntaxKind::EQ) | 207 | .find(|s| s.kind() == T![;] || s.kind() == T![=]) |
208 | .map_or(const_end, |f| f.text_range().start()); | 208 | .map_or(const_end, |f| f.text_range().start()); |
209 | 209 | ||
210 | let len = end - start; | 210 | let len = end - start; |
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 0e34d85db..6637afaf7 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs | |||
@@ -191,8 +191,8 @@ impl<'a> CompletionContext<'a> { | |||
191 | if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { | 191 | if let Some(bind_pat) = name.syntax().ancestors().find_map(ast::BindPat::cast) { |
192 | self.is_pat_binding_or_const = true; | 192 | self.is_pat_binding_or_const = true; |
193 | if bind_pat.at_token().is_some() | 193 | if bind_pat.at_token().is_some() |
194 | || bind_pat.ref_kw_token().is_some() | 194 | || bind_pat.ref_token().is_some() |
195 | || bind_pat.mut_kw_token().is_some() | 195 | || bind_pat.mut_token().is_some() |
196 | { | 196 | { |
197 | self.is_pat_binding_or_const = false; | 197 | self.is_pat_binding_or_const = false; |
198 | } | 198 | } |
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 4b133b19b..da9f55a69 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! This module defines multiple types of inlay hints and their visibility |
2 | 2 | ||
3 | use hir::{Adt, HirDisplay, Semantics, Type}; | 3 | use hir::{Adt, HirDisplay, Semantics, Type}; |
4 | use ra_ide_db::RootDatabase; | 4 | use ra_ide_db::RootDatabase; |
@@ -235,8 +235,7 @@ fn should_show_param_hint( | |||
235 | param_name: &str, | 235 | param_name: &str, |
236 | argument: &ast::Expr, | 236 | argument: &ast::Expr, |
237 | ) -> bool { | 237 | ) -> bool { |
238 | let argument_string = argument.syntax().to_string(); | 238 | if param_name.is_empty() || is_argument_similar_to_param(argument, param_name) { |
239 | if param_name.is_empty() || argument_string.ends_with(param_name) { | ||
240 | return false; | 239 | return false; |
241 | } | 240 | } |
242 | 241 | ||
@@ -245,14 +244,37 @@ fn should_show_param_hint( | |||
245 | } else { | 244 | } else { |
246 | fn_signature.parameters.len() | 245 | fn_signature.parameters.len() |
247 | }; | 246 | }; |
247 | |||
248 | // avoid displaying hints for common functions like map, filter, etc. | 248 | // avoid displaying hints for common functions like map, filter, etc. |
249 | if parameters_len == 1 && (param_name.len() == 1 || param_name == "predicate") { | 249 | // or other obvious words used in std |
250 | if parameters_len == 1 && is_obvious_param(param_name) { | ||
250 | return false; | 251 | return false; |
251 | } | 252 | } |
252 | |||
253 | true | 253 | true |
254 | } | 254 | } |
255 | 255 | ||
256 | fn is_argument_similar_to_param(argument: &ast::Expr, param_name: &str) -> bool { | ||
257 | let argument_string = remove_ref(argument.clone()).syntax().to_string(); | ||
258 | argument_string.starts_with(¶m_name) || argument_string.ends_with(¶m_name) | ||
259 | } | ||
260 | |||
261 | fn remove_ref(expr: ast::Expr) -> ast::Expr { | ||
262 | if let ast::Expr::RefExpr(ref_expr) = &expr { | ||
263 | if let Some(inner) = ref_expr.expr() { | ||
264 | return inner; | ||
265 | } | ||
266 | } | ||
267 | expr | ||
268 | } | ||
269 | |||
270 | fn is_obvious_param(param_name: &str) -> bool { | ||
271 | let is_obvious_param_name = match param_name { | ||
272 | "predicate" | "value" | "pat" | "rhs" | "other" => true, | ||
273 | _ => false, | ||
274 | }; | ||
275 | param_name.len() == 1 || is_obvious_param_name | ||
276 | } | ||
277 | |||
256 | fn get_fn_signature(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<FunctionSignature> { | 278 | fn get_fn_signature(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<FunctionSignature> { |
257 | match expr { | 279 | match expr { |
258 | ast::Expr::CallExpr(expr) => { | 280 | ast::Expr::CallExpr(expr) => { |
@@ -1059,9 +1081,18 @@ impl Test { | |||
1059 | self | 1081 | self |
1060 | } | 1082 | } |
1061 | 1083 | ||
1084 | fn field(self, value: i32) -> Self { | ||
1085 | self | ||
1086 | } | ||
1087 | |||
1062 | fn no_hints_expected(&self, _: i32, test_var: i32) {} | 1088 | fn no_hints_expected(&self, _: i32, test_var: i32) {} |
1063 | } | 1089 | } |
1064 | 1090 | ||
1091 | struct Param {} | ||
1092 | |||
1093 | fn different_order(param: &Param) {} | ||
1094 | fn different_order_mut(param: &mut Param) {} | ||
1095 | |||
1065 | fn main() { | 1096 | fn main() { |
1066 | let container: TestVarContainer = TestVarContainer { test_var: 42 }; | 1097 | let container: TestVarContainer = TestVarContainer { test_var: 42 }; |
1067 | let test: Test = Test {}; | 1098 | let test: Test = Test {}; |
@@ -1069,11 +1100,20 @@ fn main() { | |||
1069 | map(22); | 1100 | map(22); |
1070 | filter(33); | 1101 | filter(33); |
1071 | 1102 | ||
1072 | let test_processed: Test = test.map(1).filter(2); | 1103 | let test_processed: Test = test.map(1).filter(2).field(3); |
1073 | 1104 | ||
1074 | let test_var: i32 = 55; | 1105 | let test_var: i32 = 55; |
1075 | test_processed.no_hints_expected(22, test_var); | 1106 | test_processed.no_hints_expected(22, test_var); |
1076 | test_processed.no_hints_expected(33, container.test_var); | 1107 | test_processed.no_hints_expected(33, container.test_var); |
1108 | |||
1109 | let param_begin: Param = Param {}; | ||
1110 | different_order(¶m_begin); | ||
1111 | different_order(&mut param_begin); | ||
1112 | |||
1113 | let a: f64 = 7.0; | ||
1114 | let b: f64 = 4.0; | ||
1115 | let _: f64 = a.div_euclid(b); | ||
1116 | let _: f64 = a.abs_sub(b); | ||
1077 | }"#, | 1117 | }"#, |
1078 | ); | 1118 | ); |
1079 | 1119 | ||
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index ad6fd50aa..7d0544ff4 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs | |||
@@ -152,7 +152,7 @@ fn decl_access(def: &Definition, syntax: &SyntaxNode, range: TextRange) -> Optio | |||
152 | if stmt.initializer().is_some() { | 152 | if stmt.initializer().is_some() { |
153 | let pat = stmt.pat()?; | 153 | let pat = stmt.pat()?; |
154 | if let ast::Pat::BindPat(it) = pat { | 154 | if let ast::Pat::BindPat(it) = pat { |
155 | if it.mut_kw_token().is_some() { | 155 | if it.mut_token().is_some() { |
156 | return Some(ReferenceAccess::Write); | 156 | return Some(ReferenceAccess::Write); |
157 | } | 157 | } |
158 | } | 158 | } |
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index f58e436d1..5842ae2e8 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs | |||
@@ -165,7 +165,7 @@ SOURCE_FILE@[0; 60) | |||
165 | PATH_SEGMENT@[16; 22) | 165 | PATH_SEGMENT@[16; 22) |
166 | NAME_REF@[16; 22) | 166 | NAME_REF@[16; 22) |
167 | IDENT@[16; 22) "assert" | 167 | IDENT@[16; 22) "assert" |
168 | EXCL@[22; 23) "!" | 168 | BANG@[22; 23) "!" |
169 | TOKEN_TREE@[23; 57) | 169 | TOKEN_TREE@[23; 57) |
170 | L_PAREN@[23; 24) "(" | 170 | L_PAREN@[23; 24) "(" |
171 | STRING@[24; 52) "\"\n fn foo() {\n ..." | 171 | STRING@[24; 52) "\"\n fn foo() {\n ..." |
@@ -173,7 +173,7 @@ SOURCE_FILE@[0; 60) | |||
173 | WHITESPACE@[53; 54) " " | 173 | WHITESPACE@[53; 54) " " |
174 | STRING@[54; 56) "\"\"" | 174 | STRING@[54; 56) "\"\"" |
175 | R_PAREN@[56; 57) ")" | 175 | R_PAREN@[56; 57) ")" |
176 | SEMI@[57; 58) ";" | 176 | SEMICOLON@[57; 58) ";" |
177 | WHITESPACE@[58; 59) "\n" | 177 | WHITESPACE@[58; 59) "\n" |
178 | R_CURLY@[59; 60) "}" | 178 | R_CURLY@[59; 60) "}" |
179 | "# | 179 | "# |
@@ -226,7 +226,7 @@ EXPR_STMT@[16; 58) | |||
226 | PATH_SEGMENT@[16; 22) | 226 | PATH_SEGMENT@[16; 22) |
227 | NAME_REF@[16; 22) | 227 | NAME_REF@[16; 22) |
228 | IDENT@[16; 22) "assert" | 228 | IDENT@[16; 22) "assert" |
229 | EXCL@[22; 23) "!" | 229 | BANG@[22; 23) "!" |
230 | TOKEN_TREE@[23; 57) | 230 | TOKEN_TREE@[23; 57) |
231 | L_PAREN@[23; 24) "(" | 231 | L_PAREN@[23; 24) "(" |
232 | STRING@[24; 52) "\"\n fn foo() {\n ..." | 232 | STRING@[24; 52) "\"\n fn foo() {\n ..." |
@@ -234,7 +234,7 @@ EXPR_STMT@[16; 58) | |||
234 | WHITESPACE@[53; 54) " " | 234 | WHITESPACE@[53; 54) " " |
235 | STRING@[54; 56) "\"\"" | 235 | STRING@[54; 56) "\"\"" |
236 | R_PAREN@[56; 57) ")" | 236 | R_PAREN@[56; 57) ")" |
237 | SEMI@[57; 58) ";" | 237 | SEMICOLON@[57; 58) ";" |
238 | "# | 238 | "# |
239 | .trim() | 239 | .trim() |
240 | ); | 240 | ); |
diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs index 71d2bcb04..f55cd3bf5 100644 --- a/crates/ra_ide/src/typing.rs +++ b/crates/ra_ide/src/typing.rs | |||
@@ -63,7 +63,7 @@ fn on_char_typed_inner( | |||
63 | fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option<SingleFileChange> { | 63 | fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option<SingleFileChange> { |
64 | assert_eq!(file.syntax().text().char_at(offset), Some('=')); | 64 | assert_eq!(file.syntax().text().char_at(offset), Some('=')); |
65 | let let_stmt: ast::LetStmt = find_node_at_offset(file.syntax(), offset)?; | 65 | let let_stmt: ast::LetStmt = find_node_at_offset(file.syntax(), offset)?; |
66 | if let_stmt.semi_token().is_some() { | 66 | if let_stmt.semicolon_token().is_some() { |
67 | return None; | 67 | return None; |
68 | } | 68 | } |
69 | if let Some(expr) = let_stmt.initializer() { | 69 | if let Some(expr) = let_stmt.initializer() { |
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 8e8ae2b29..9fb5cb058 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs | |||
@@ -137,21 +137,23 @@ impl TokenMap { | |||
137 | token_id: tt::TokenId, | 137 | token_id: tt::TokenId, |
138 | open_relative_range: TextRange, | 138 | open_relative_range: TextRange, |
139 | close_relative_range: TextRange, | 139 | close_relative_range: TextRange, |
140 | ) { | 140 | ) -> usize { |
141 | let res = self.entries.len(); | ||
141 | self.entries | 142 | self.entries |
142 | .push((token_id, TokenTextRange::Delimiter(open_relative_range, close_relative_range))); | 143 | .push((token_id, TokenTextRange::Delimiter(open_relative_range, close_relative_range))); |
144 | res | ||
143 | } | 145 | } |
144 | 146 | ||
145 | fn update_close_delim(&mut self, token_id: tt::TokenId, close_relative_range: TextRange) { | 147 | fn update_close_delim(&mut self, idx: usize, close_relative_range: TextRange) { |
146 | if let Some(entry) = self.entries.iter_mut().find(|(tid, _)| *tid == token_id) { | 148 | let (_, token_text_range) = &mut self.entries[idx]; |
147 | if let TokenTextRange::Delimiter(dim, _) = entry.1 { | 149 | if let TokenTextRange::Delimiter(dim, _) = token_text_range { |
148 | entry.1 = TokenTextRange::Delimiter(dim, close_relative_range); | 150 | *token_text_range = TokenTextRange::Delimiter(*dim, close_relative_range); |
149 | } | ||
150 | } | 151 | } |
151 | } | 152 | } |
152 | 153 | ||
153 | fn remove_delim(&mut self, token_id: tt::TokenId) { | 154 | fn remove_delim(&mut self, idx: usize) { |
154 | self.entries.retain(|(tid, _)| *tid != token_id); | 155 | // FIXME: This could be accidently quadratic |
156 | self.entries.remove(idx); | ||
155 | } | 157 | } |
156 | } | 158 | } |
157 | 159 | ||
@@ -238,24 +240,24 @@ impl TokenIdAlloc { | |||
238 | token_id | 240 | token_id |
239 | } | 241 | } |
240 | 242 | ||
241 | fn open_delim(&mut self, open_abs_range: TextRange) -> tt::TokenId { | 243 | fn open_delim(&mut self, open_abs_range: TextRange) -> (tt::TokenId, usize) { |
242 | let token_id = tt::TokenId(self.next_id); | 244 | let token_id = tt::TokenId(self.next_id); |
243 | self.next_id += 1; | 245 | self.next_id += 1; |
244 | self.map.insert_delim( | 246 | let idx = self.map.insert_delim( |
245 | token_id, | 247 | token_id, |
246 | open_abs_range - self.global_offset, | 248 | open_abs_range - self.global_offset, |
247 | open_abs_range - self.global_offset, | 249 | open_abs_range - self.global_offset, |
248 | ); | 250 | ); |
249 | token_id | 251 | (token_id, idx) |
250 | } | 252 | } |
251 | 253 | ||
252 | fn close_delim(&mut self, id: tt::TokenId, close_abs_range: Option<TextRange>) { | 254 | fn close_delim(&mut self, idx: usize, close_abs_range: Option<TextRange>) { |
253 | match close_abs_range { | 255 | match close_abs_range { |
254 | None => { | 256 | None => { |
255 | self.map.remove_delim(id); | 257 | self.map.remove_delim(idx); |
256 | } | 258 | } |
257 | Some(close) => { | 259 | Some(close) => { |
258 | self.map.update_close_delim(id, close - self.global_offset); | 260 | self.map.update_close_delim(idx, close - self.global_offset); |
259 | } | 261 | } |
260 | } | 262 | } |
261 | } | 263 | } |
@@ -322,7 +324,7 @@ trait TokenConvertor { | |||
322 | 324 | ||
323 | if let Some((kind, closed)) = delim { | 325 | if let Some((kind, closed)) = delim { |
324 | let mut subtree = tt::Subtree::default(); | 326 | let mut subtree = tt::Subtree::default(); |
325 | let id = self.id_alloc().open_delim(range); | 327 | let (id, idx) = self.id_alloc().open_delim(range); |
326 | subtree.delimiter = Some(tt::Delimiter { kind, id }); | 328 | subtree.delimiter = Some(tt::Delimiter { kind, id }); |
327 | 329 | ||
328 | while self.peek().map(|it| it.kind() != closed).unwrap_or(false) { | 330 | while self.peek().map(|it| it.kind() != closed).unwrap_or(false) { |
@@ -331,7 +333,7 @@ trait TokenConvertor { | |||
331 | let last_range = match self.bump() { | 333 | let last_range = match self.bump() { |
332 | None => { | 334 | None => { |
333 | // For error resilience, we insert an char punct for the opening delim here | 335 | // For error resilience, we insert an char punct for the opening delim here |
334 | self.id_alloc().close_delim(id, None); | 336 | self.id_alloc().close_delim(idx, None); |
335 | let leaf: tt::Leaf = tt::Punct { | 337 | let leaf: tt::Leaf = tt::Punct { |
336 | id: self.id_alloc().alloc(range), | 338 | id: self.id_alloc().alloc(range), |
337 | char: token.to_char().unwrap(), | 339 | char: token.to_char().unwrap(), |
@@ -344,7 +346,7 @@ trait TokenConvertor { | |||
344 | } | 346 | } |
345 | Some(it) => it.1, | 347 | Some(it) => it.1, |
346 | }; | 348 | }; |
347 | self.id_alloc().close_delim(id, Some(last_range)); | 349 | self.id_alloc().close_delim(idx, Some(last_range)); |
348 | subtree.into() | 350 | subtree.into() |
349 | } else { | 351 | } else { |
350 | let spacing = match self.peek() { | 352 | let spacing = match self.peek() { |
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 1ef6f6eed..5d1274d21 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs | |||
@@ -252,7 +252,7 @@ fn test_expr_order() { | |||
252 | STAR@[11; 12) "*" | 252 | STAR@[11; 12) "*" |
253 | LITERAL@[12; 13) | 253 | LITERAL@[12; 13) |
254 | INT_NUMBER@[12; 13) "2" | 254 | INT_NUMBER@[12; 13) "2" |
255 | SEMI@[13; 14) ";" | 255 | SEMICOLON@[13; 14) ";" |
256 | R_CURLY@[14; 15) "}""#, | 256 | R_CURLY@[14; 15) "}""#, |
257 | ); | 257 | ); |
258 | } | 258 | } |
@@ -605,7 +605,7 @@ fn test_tt_to_stmts() { | |||
605 | EQ@[4; 5) "=" | 605 | EQ@[4; 5) "=" |
606 | LITERAL@[5; 6) | 606 | LITERAL@[5; 6) |
607 | INT_NUMBER@[5; 6) "0" | 607 | INT_NUMBER@[5; 6) "0" |
608 | SEMI@[6; 7) ";" | 608 | SEMICOLON@[6; 7) ";" |
609 | EXPR_STMT@[7; 14) | 609 | EXPR_STMT@[7; 14) |
610 | BIN_EXPR@[7; 13) | 610 | BIN_EXPR@[7; 13) |
611 | PATH_EXPR@[7; 8) | 611 | PATH_EXPR@[7; 8) |
@@ -620,7 +620,7 @@ fn test_tt_to_stmts() { | |||
620 | PLUS@[11; 12) "+" | 620 | PLUS@[11; 12) "+" |
621 | LITERAL@[12; 13) | 621 | LITERAL@[12; 13) |
622 | INT_NUMBER@[12; 13) "1" | 622 | INT_NUMBER@[12; 13) "1" |
623 | SEMI@[13; 14) ";" | 623 | SEMICOLON@[13; 14) ";" |
624 | EXPR_STMT@[14; 15) | 624 | EXPR_STMT@[14; 15) |
625 | PATH_EXPR@[14; 15) | 625 | PATH_EXPR@[14; 15) |
626 | PATH@[14; 15) | 626 | PATH@[14; 15) |
@@ -953,7 +953,7 @@ fn test_tt_composite2() { | |||
953 | PATH_SEGMENT@[0; 3) | 953 | PATH_SEGMENT@[0; 3) |
954 | NAME_REF@[0; 3) | 954 | NAME_REF@[0; 3) |
955 | IDENT@[0; 3) "abs" | 955 | IDENT@[0; 3) "abs" |
956 | EXCL@[3; 4) "!" | 956 | BANG@[3; 4) "!" |
957 | TOKEN_TREE@[4; 10) | 957 | TOKEN_TREE@[4; 10) |
958 | L_PAREN@[4; 5) "(" | 958 | L_PAREN@[4; 5) "(" |
959 | EQ@[5; 6) "=" | 959 | EQ@[5; 6) "=" |
@@ -1073,14 +1073,14 @@ fn test_vec() { | |||
1073 | PATH_SEGMENT@[9; 12) | 1073 | PATH_SEGMENT@[9; 12) |
1074 | NAME_REF@[9; 12) | 1074 | NAME_REF@[9; 12) |
1075 | IDENT@[9; 12) "Vec" | 1075 | IDENT@[9; 12) "Vec" |
1076 | COLONCOLON@[12; 14) "::" | 1076 | COLON2@[12; 14) "::" |
1077 | PATH_SEGMENT@[14; 17) | 1077 | PATH_SEGMENT@[14; 17) |
1078 | NAME_REF@[14; 17) | 1078 | NAME_REF@[14; 17) |
1079 | IDENT@[14; 17) "new" | 1079 | IDENT@[14; 17) "new" |
1080 | ARG_LIST@[17; 19) | 1080 | ARG_LIST@[17; 19) |
1081 | L_PAREN@[17; 18) "(" | 1081 | L_PAREN@[17; 18) "(" |
1082 | R_PAREN@[18; 19) ")" | 1082 | R_PAREN@[18; 19) ")" |
1083 | SEMI@[19; 20) ";" | 1083 | SEMICOLON@[19; 20) ";" |
1084 | EXPR_STMT@[20; 33) | 1084 | EXPR_STMT@[20; 33) |
1085 | METHOD_CALL_EXPR@[20; 32) | 1085 | METHOD_CALL_EXPR@[20; 32) |
1086 | PATH_EXPR@[20; 21) | 1086 | PATH_EXPR@[20; 21) |
@@ -1096,7 +1096,7 @@ fn test_vec() { | |||
1096 | LITERAL@[27; 31) | 1096 | LITERAL@[27; 31) |
1097 | INT_NUMBER@[27; 31) "1u32" | 1097 | INT_NUMBER@[27; 31) "1u32" |
1098 | R_PAREN@[31; 32) ")" | 1098 | R_PAREN@[31; 32) ")" |
1099 | SEMI@[32; 33) ";" | 1099 | SEMICOLON@[32; 33) ";" |
1100 | EXPR_STMT@[33; 43) | 1100 | EXPR_STMT@[33; 43) |
1101 | METHOD_CALL_EXPR@[33; 42) | 1101 | METHOD_CALL_EXPR@[33; 42) |
1102 | PATH_EXPR@[33; 34) | 1102 | PATH_EXPR@[33; 34) |
@@ -1112,7 +1112,7 @@ fn test_vec() { | |||
1112 | LITERAL@[40; 41) | 1112 | LITERAL@[40; 41) |
1113 | INT_NUMBER@[40; 41) "2" | 1113 | INT_NUMBER@[40; 41) "2" |
1114 | R_PAREN@[41; 42) ")" | 1114 | R_PAREN@[41; 42) ")" |
1115 | SEMI@[42; 43) ";" | 1115 | SEMICOLON@[42; 43) ";" |
1116 | PATH_EXPR@[43; 44) | 1116 | PATH_EXPR@[43; 44) |
1117 | PATH@[43; 44) | 1117 | PATH@[43; 44) |
1118 | PATH_SEGMENT@[43; 44) | 1118 | PATH_SEGMENT@[43; 44) |
@@ -1760,7 +1760,7 @@ fn test_no_space_after_semi_colon() { | |||
1760 | MOD_KW@[21; 24) "mod" | 1760 | MOD_KW@[21; 24) "mod" |
1761 | NAME@[24; 25) | 1761 | NAME@[24; 25) |
1762 | IDENT@[24; 25) "m" | 1762 | IDENT@[24; 25) "m" |
1763 | SEMI@[25; 26) ";" | 1763 | SEMICOLON@[25; 26) ";" |
1764 | MODULE@[26; 52) | 1764 | MODULE@[26; 52) |
1765 | ATTR@[26; 47) | 1765 | ATTR@[26; 47) |
1766 | POUND@[26; 27) "#" | 1766 | POUND@[26; 27) "#" |
@@ -1779,7 +1779,7 @@ fn test_no_space_after_semi_colon() { | |||
1779 | MOD_KW@[47; 50) "mod" | 1779 | MOD_KW@[47; 50) "mod" |
1780 | NAME@[50; 51) | 1780 | NAME@[50; 51) |
1781 | IDENT@[50; 51) "f" | 1781 | IDENT@[50; 51) "f" |
1782 | SEMI@[51; 52) ";""###, | 1782 | SEMICOLON@[51; 52) ";""###, |
1783 | ); | 1783 | ); |
1784 | } | 1784 | } |
1785 | 1785 | ||
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index c486c0211..a1bd53063 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -339,7 +339,8 @@ fn expr_bp(p: &mut Parser, mut r: Restrictions, bp: u8) -> (Option<CompletedMark | |||
339 | (Some(lhs), BlockLike::NotBlock) | 339 | (Some(lhs), BlockLike::NotBlock) |
340 | } | 340 | } |
341 | 341 | ||
342 | const LHS_FIRST: TokenSet = atom::ATOM_EXPR_FIRST.union(token_set![AMP, STAR, EXCL, DOT, MINUS]); | 342 | const LHS_FIRST: TokenSet = |
343 | atom::ATOM_EXPR_FIRST.union(token_set![T![&], T![*], T![!], T![.], T![-]]); | ||
343 | 344 | ||
344 | fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { | 345 | fn lhs(p: &mut Parser, r: Restrictions) -> Option<(CompletedMarker, BlockLike)> { |
345 | let m; | 346 | let m; |
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index 386969d2d..fe1a039cb 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs | |||
@@ -3,8 +3,19 @@ | |||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(token_set![ | 5 | pub(super) const TYPE_FIRST: TokenSet = paths::PATH_FIRST.union(token_set![ |
6 | L_PAREN, EXCL, STAR, L_BRACK, AMP, UNDERSCORE, FN_KW, UNSAFE_KW, EXTERN_KW, FOR_KW, IMPL_KW, | 6 | T!['('], |
7 | DYN_KW, L_ANGLE, | 7 | T!['['], |
8 | T![<], | ||
9 | T![!], | ||
10 | T![*], | ||
11 | T![&], | ||
12 | T![_], | ||
13 | T![fn], | ||
14 | T![unsafe], | ||
15 | T![extern], | ||
16 | T![for], | ||
17 | T![impl], | ||
18 | T![dyn], | ||
8 | ]); | 19 | ]); |
9 | 20 | ||
10 | const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA, L_DOLLAR]; | 21 | const TYPE_RECOVERY_SET: TokenSet = token_set![R_PAREN, COMMA, L_DOLLAR]; |
diff --git a/crates/ra_parser/src/syntax_kind/generated.rs b/crates/ra_parser/src/syntax_kind/generated.rs index 004f4e564..524e7d784 100644 --- a/crates/ra_parser/src/syntax_kind/generated.rs +++ b/crates/ra_parser/src/syntax_kind/generated.rs | |||
@@ -9,7 +9,7 @@ pub enum SyntaxKind { | |||
9 | TOMBSTONE, | 9 | TOMBSTONE, |
10 | #[doc(hidden)] | 10 | #[doc(hidden)] |
11 | EOF, | 11 | EOF, |
12 | SEMI, | 12 | SEMICOLON, |
13 | COMMA, | 13 | COMMA, |
14 | L_PAREN, | 14 | L_PAREN, |
15 | R_PAREN, | 15 | R_PAREN, |
@@ -33,15 +33,15 @@ pub enum SyntaxKind { | |||
33 | PERCENT, | 33 | PERCENT, |
34 | UNDERSCORE, | 34 | UNDERSCORE, |
35 | DOT, | 35 | DOT, |
36 | DOTDOT, | 36 | DOT2, |
37 | DOTDOTDOT, | 37 | DOT3, |
38 | DOTDOTEQ, | 38 | DOT2EQ, |
39 | COLON, | 39 | COLON, |
40 | COLONCOLON, | 40 | COLON2, |
41 | EQ, | 41 | EQ, |
42 | EQEQ, | 42 | EQ2, |
43 | FAT_ARROW, | 43 | FAT_ARROW, |
44 | EXCL, | 44 | BANG, |
45 | NEQ, | 45 | NEQ, |
46 | MINUS, | 46 | MINUS, |
47 | THIN_ARROW, | 47 | THIN_ARROW, |
@@ -55,8 +55,8 @@ pub enum SyntaxKind { | |||
55 | SLASHEQ, | 55 | SLASHEQ, |
56 | STAREQ, | 56 | STAREQ, |
57 | PERCENTEQ, | 57 | PERCENTEQ, |
58 | AMPAMP, | 58 | AMP2, |
59 | PIPEPIPE, | 59 | PIPE2, |
60 | SHL, | 60 | SHL, |
61 | SHR, | 61 | SHR, |
62 | SHLEQ, | 62 | SHLEQ, |
@@ -265,12 +265,12 @@ impl SyntaxKind { | |||
265 | } | 265 | } |
266 | pub fn is_punct(self) -> bool { | 266 | pub fn is_punct(self) -> bool { |
267 | match self { | 267 | match self { |
268 | SEMI | COMMA | L_PAREN | R_PAREN | L_CURLY | R_CURLY | L_BRACK | R_BRACK | L_ANGLE | 268 | SEMICOLON | COMMA | L_PAREN | R_PAREN | L_CURLY | R_CURLY | L_BRACK | R_BRACK |
269 | | R_ANGLE | AT | POUND | TILDE | QUESTION | DOLLAR | AMP | PIPE | PLUS | STAR | 269 | | L_ANGLE | R_ANGLE | AT | POUND | TILDE | QUESTION | DOLLAR | AMP | PIPE | PLUS |
270 | | SLASH | CARET | PERCENT | UNDERSCORE | DOT | DOTDOT | DOTDOTDOT | DOTDOTEQ | 270 | | STAR | SLASH | CARET | PERCENT | UNDERSCORE | DOT | DOT2 | DOT3 | DOT2EQ | COLON |
271 | | COLON | COLONCOLON | EQ | EQEQ | FAT_ARROW | EXCL | NEQ | MINUS | THIN_ARROW | 271 | | COLON2 | EQ | EQ2 | FAT_ARROW | BANG | NEQ | MINUS | THIN_ARROW | LTEQ | GTEQ |
272 | | LTEQ | GTEQ | PLUSEQ | MINUSEQ | PIPEEQ | AMPEQ | CARETEQ | SLASHEQ | STAREQ | 272 | | PLUSEQ | MINUSEQ | PIPEEQ | AMPEQ | CARETEQ | SLASHEQ | STAREQ | PERCENTEQ | AMP2 |
273 | | PERCENTEQ | AMPAMP | PIPEPIPE | SHL | SHR | SHLEQ | SHREQ => true, | 273 | | PIPE2 | SHL | SHR | SHLEQ | SHREQ => true, |
274 | _ => false, | 274 | _ => false, |
275 | } | 275 | } |
276 | } | 276 | } |
@@ -329,7 +329,7 @@ impl SyntaxKind { | |||
329 | } | 329 | } |
330 | pub fn from_char(c: char) -> Option<SyntaxKind> { | 330 | pub fn from_char(c: char) -> Option<SyntaxKind> { |
331 | let tok = match c { | 331 | let tok = match c { |
332 | ';' => SEMI, | 332 | ';' => SEMICOLON, |
333 | ',' => COMMA, | 333 | ',' => COMMA, |
334 | '(' => L_PAREN, | 334 | '(' => L_PAREN, |
335 | ')' => R_PAREN, | 335 | ')' => R_PAREN, |
@@ -355,7 +355,7 @@ impl SyntaxKind { | |||
355 | '.' => DOT, | 355 | '.' => DOT, |
356 | ':' => COLON, | 356 | ':' => COLON, |
357 | '=' => EQ, | 357 | '=' => EQ, |
358 | '!' => EXCL, | 358 | '!' => BANG, |
359 | '-' => MINUS, | 359 | '-' => MINUS, |
360 | _ => return None, | 360 | _ => return None, |
361 | }; | 361 | }; |
@@ -363,296 +363,4 @@ impl SyntaxKind { | |||
363 | } | 363 | } |
364 | } | 364 | } |
365 | #[macro_export] | 365 | #[macro_export] |
366 | macro_rules! T { | 366 | macro_rules ! T { [ ; ] => { $ crate :: SyntaxKind :: SEMICOLON } ; [ , ] => { $ crate :: SyntaxKind :: COMMA } ; [ '(' ] => { $ crate :: SyntaxKind :: L_PAREN } ; [ ')' ] => { $ crate :: SyntaxKind :: R_PAREN } ; [ '{' ] => { $ crate :: SyntaxKind :: L_CURLY } ; [ '}' ] => { $ crate :: SyntaxKind :: R_CURLY } ; [ '[' ] => { $ crate :: SyntaxKind :: L_BRACK } ; [ ']' ] => { $ crate :: SyntaxKind :: R_BRACK } ; [ < ] => { $ crate :: SyntaxKind :: L_ANGLE } ; [ > ] => { $ crate :: SyntaxKind :: R_ANGLE } ; [ @ ] => { $ crate :: SyntaxKind :: AT } ; [ # ] => { $ crate :: SyntaxKind :: POUND } ; [ ~ ] => { $ crate :: SyntaxKind :: TILDE } ; [ ? ] => { $ crate :: SyntaxKind :: QUESTION } ; [ $ ] => { $ crate :: SyntaxKind :: DOLLAR } ; [ & ] => { $ crate :: SyntaxKind :: AMP } ; [ | ] => { $ crate :: SyntaxKind :: PIPE } ; [ + ] => { $ crate :: SyntaxKind :: PLUS } ; [ * ] => { $ crate :: SyntaxKind :: STAR } ; [ / ] => { $ crate :: SyntaxKind :: SLASH } ; [ ^ ] => { $ crate :: SyntaxKind :: CARET } ; [ % ] => { $ crate :: SyntaxKind :: PERCENT } ; [ _ ] => { $ crate :: SyntaxKind :: UNDERSCORE } ; [ . ] => { $ crate :: SyntaxKind :: DOT } ; [ .. ] => { $ crate :: SyntaxKind :: DOT2 } ; [ ... ] => { $ crate :: SyntaxKind :: DOT3 } ; [ ..= ] => { $ crate :: SyntaxKind :: DOT2EQ } ; [ : ] => { $ crate :: SyntaxKind :: COLON } ; [ :: ] => { $ crate :: SyntaxKind :: COLON2 } ; [ = ] => { $ crate :: SyntaxKind :: EQ } ; [ == ] => { $ crate :: SyntaxKind :: EQ2 } ; [ => ] => { $ crate :: SyntaxKind :: FAT_ARROW } ; [ ! ] => { $ crate :: SyntaxKind :: BANG } ; [ != ] => { $ crate :: SyntaxKind :: NEQ } ; [ - ] => { $ crate :: SyntaxKind :: MINUS } ; [ -> ] => { $ crate :: SyntaxKind :: THIN_ARROW } ; [ <= ] => { $ crate :: SyntaxKind :: LTEQ } ; [ >= ] => { $ crate :: SyntaxKind :: GTEQ } ; [ += ] => { $ crate :: SyntaxKind :: PLUSEQ } ; [ -= ] => { $ crate :: SyntaxKind :: MINUSEQ } ; [ |= ] => { $ crate :: SyntaxKind :: PIPEEQ } ; [ &= ] => { $ crate :: SyntaxKind :: AMPEQ } ; [ ^= ] => { $ crate :: SyntaxKind :: CARETEQ } ; [ /= ] => { $ crate :: SyntaxKind :: SLASHEQ } ; [ *= ] => { $ crate :: SyntaxKind :: STAREQ } ; [ %= ] => { $ crate :: SyntaxKind :: PERCENTEQ } ; [ && ] => { $ crate :: SyntaxKind :: AMP2 } ; [ || ] => { $ crate :: SyntaxKind :: PIPE2 } ; [ << ] => { $ crate :: SyntaxKind :: SHL } ; [ >> ] => { $ crate :: SyntaxKind :: SHR } ; [ <<= ] => { $ crate :: SyntaxKind :: SHLEQ } ; [ >>= ] => { $ crate :: SyntaxKind :: SHREQ } ; [ as ] => { $ crate :: SyntaxKind :: AS_KW } ; [ async ] => { $ crate :: SyntaxKind :: ASYNC_KW } ; [ await ] => { $ crate :: SyntaxKind :: AWAIT_KW } ; [ box ] => { $ crate :: SyntaxKind :: BOX_KW } ; [ break ] => { $ crate :: SyntaxKind :: BREAK_KW } ; [ const ] => { $ crate :: SyntaxKind :: CONST_KW } ; [ continue ] => { $ crate :: SyntaxKind :: CONTINUE_KW } ; [ crate ] => { $ crate :: SyntaxKind :: CRATE_KW } ; [ dyn ] => { $ crate :: SyntaxKind :: DYN_KW } ; [ else ] => { $ crate :: SyntaxKind :: ELSE_KW } ; [ enum ] => { $ crate :: SyntaxKind :: ENUM_KW } ; [ extern ] => { $ crate :: SyntaxKind :: EXTERN_KW } ; [ false ] => { $ crate :: SyntaxKind :: FALSE_KW } ; [ fn ] => { $ crate :: SyntaxKind :: FN_KW } ; [ for ] => { $ crate :: SyntaxKind :: FOR_KW } ; [ if ] => { $ crate :: SyntaxKind :: IF_KW } ; [ impl ] => { $ crate :: SyntaxKind :: IMPL_KW } ; [ in ] => { $ crate :: SyntaxKind :: IN_KW } ; [ let ] => { $ crate :: SyntaxKind :: LET_KW } ; [ loop ] => { $ crate :: SyntaxKind :: LOOP_KW } ; [ macro ] => { $ crate :: SyntaxKind :: MACRO_KW } ; [ match ] => { $ crate :: SyntaxKind :: MATCH_KW } ; [ mod ] => { $ crate :: SyntaxKind :: MOD_KW } ; [ move ] => { $ crate :: SyntaxKind :: MOVE_KW } ; [ mut ] => { $ crate :: SyntaxKind :: MUT_KW } ; [ pub ] => { $ crate :: SyntaxKind :: PUB_KW } ; [ ref ] => { $ crate :: SyntaxKind :: REF_KW } ; [ return ] => { $ crate :: SyntaxKind :: RETURN_KW } ; [ self ] => { $ crate :: SyntaxKind :: SELF_KW } ; [ static ] => { $ crate :: SyntaxKind :: STATIC_KW } ; [ struct ] => { $ crate :: SyntaxKind :: STRUCT_KW } ; [ super ] => { $ crate :: SyntaxKind :: SUPER_KW } ; [ trait ] => { $ crate :: SyntaxKind :: TRAIT_KW } ; [ true ] => { $ crate :: SyntaxKind :: TRUE_KW } ; [ try ] => { $ crate :: SyntaxKind :: TRY_KW } ; [ type ] => { $ crate :: SyntaxKind :: TYPE_KW } ; [ unsafe ] => { $ crate :: SyntaxKind :: UNSAFE_KW } ; [ use ] => { $ crate :: SyntaxKind :: USE_KW } ; [ where ] => { $ crate :: SyntaxKind :: WHERE_KW } ; [ while ] => { $ crate :: SyntaxKind :: WHILE_KW } ; [ auto ] => { $ crate :: SyntaxKind :: AUTO_KW } ; [ default ] => { $ crate :: SyntaxKind :: DEFAULT_KW } ; [ existential ] => { $ crate :: SyntaxKind :: EXISTENTIAL_KW } ; [ union ] => { $ crate :: SyntaxKind :: UNION_KW } ; [ raw ] => { $ crate :: SyntaxKind :: RAW_KW } ; [ lifetime ] => { $ crate :: SyntaxKind :: LIFETIME } ; [ ident ] => { $ crate :: SyntaxKind :: IDENT } ; } |
367 | ( ; ) => { | ||
368 | $crate::SyntaxKind::SEMI | ||
369 | }; | ||
370 | ( , ) => { | ||
371 | $crate::SyntaxKind::COMMA | ||
372 | }; | ||
373 | ( '(' ) => { | ||
374 | $crate::SyntaxKind::L_PAREN | ||
375 | }; | ||
376 | ( ')' ) => { | ||
377 | $crate::SyntaxKind::R_PAREN | ||
378 | }; | ||
379 | ( '{' ) => { | ||
380 | $crate::SyntaxKind::L_CURLY | ||
381 | }; | ||
382 | ( '}' ) => { | ||
383 | $crate::SyntaxKind::R_CURLY | ||
384 | }; | ||
385 | ( '[' ) => { | ||
386 | $crate::SyntaxKind::L_BRACK | ||
387 | }; | ||
388 | ( ']' ) => { | ||
389 | $crate::SyntaxKind::R_BRACK | ||
390 | }; | ||
391 | ( < ) => { | ||
392 | $crate::SyntaxKind::L_ANGLE | ||
393 | }; | ||
394 | ( > ) => { | ||
395 | $crate::SyntaxKind::R_ANGLE | ||
396 | }; | ||
397 | ( @ ) => { | ||
398 | $crate::SyntaxKind::AT | ||
399 | }; | ||
400 | ( # ) => { | ||
401 | $crate::SyntaxKind::POUND | ||
402 | }; | ||
403 | ( ~ ) => { | ||
404 | $crate::SyntaxKind::TILDE | ||
405 | }; | ||
406 | ( ? ) => { | ||
407 | $crate::SyntaxKind::QUESTION | ||
408 | }; | ||
409 | ( $ ) => { | ||
410 | $crate::SyntaxKind::DOLLAR | ||
411 | }; | ||
412 | ( & ) => { | ||
413 | $crate::SyntaxKind::AMP | ||
414 | }; | ||
415 | ( | ) => { | ||
416 | $crate::SyntaxKind::PIPE | ||
417 | }; | ||
418 | ( + ) => { | ||
419 | $crate::SyntaxKind::PLUS | ||
420 | }; | ||
421 | ( * ) => { | ||
422 | $crate::SyntaxKind::STAR | ||
423 | }; | ||
424 | ( / ) => { | ||
425 | $crate::SyntaxKind::SLASH | ||
426 | }; | ||
427 | ( ^ ) => { | ||
428 | $crate::SyntaxKind::CARET | ||
429 | }; | ||
430 | ( % ) => { | ||
431 | $crate::SyntaxKind::PERCENT | ||
432 | }; | ||
433 | ( _ ) => { | ||
434 | $crate::SyntaxKind::UNDERSCORE | ||
435 | }; | ||
436 | ( . ) => { | ||
437 | $crate::SyntaxKind::DOT | ||
438 | }; | ||
439 | ( .. ) => { | ||
440 | $crate::SyntaxKind::DOTDOT | ||
441 | }; | ||
442 | ( ... ) => { | ||
443 | $crate::SyntaxKind::DOTDOTDOT | ||
444 | }; | ||
445 | ( ..= ) => { | ||
446 | $crate::SyntaxKind::DOTDOTEQ | ||
447 | }; | ||
448 | ( : ) => { | ||
449 | $crate::SyntaxKind::COLON | ||
450 | }; | ||
451 | ( :: ) => { | ||
452 | $crate::SyntaxKind::COLONCOLON | ||
453 | }; | ||
454 | ( = ) => { | ||
455 | $crate::SyntaxKind::EQ | ||
456 | }; | ||
457 | ( == ) => { | ||
458 | $crate::SyntaxKind::EQEQ | ||
459 | }; | ||
460 | ( => ) => { | ||
461 | $crate::SyntaxKind::FAT_ARROW | ||
462 | }; | ||
463 | ( ! ) => { | ||
464 | $crate::SyntaxKind::EXCL | ||
465 | }; | ||
466 | ( != ) => { | ||
467 | $crate::SyntaxKind::NEQ | ||
468 | }; | ||
469 | ( - ) => { | ||
470 | $crate::SyntaxKind::MINUS | ||
471 | }; | ||
472 | ( -> ) => { | ||
473 | $crate::SyntaxKind::THIN_ARROW | ||
474 | }; | ||
475 | ( <= ) => { | ||
476 | $crate::SyntaxKind::LTEQ | ||
477 | }; | ||
478 | ( >= ) => { | ||
479 | $crate::SyntaxKind::GTEQ | ||
480 | }; | ||
481 | ( += ) => { | ||
482 | $crate::SyntaxKind::PLUSEQ | ||
483 | }; | ||
484 | ( -= ) => { | ||
485 | $crate::SyntaxKind::MINUSEQ | ||
486 | }; | ||
487 | ( |= ) => { | ||
488 | $crate::SyntaxKind::PIPEEQ | ||
489 | }; | ||
490 | ( &= ) => { | ||
491 | $crate::SyntaxKind::AMPEQ | ||
492 | }; | ||
493 | ( ^= ) => { | ||
494 | $crate::SyntaxKind::CARETEQ | ||
495 | }; | ||
496 | ( /= ) => { | ||
497 | $crate::SyntaxKind::SLASHEQ | ||
498 | }; | ||
499 | ( *= ) => { | ||
500 | $crate::SyntaxKind::STAREQ | ||
501 | }; | ||
502 | ( %= ) => { | ||
503 | $crate::SyntaxKind::PERCENTEQ | ||
504 | }; | ||
505 | ( && ) => { | ||
506 | $crate::SyntaxKind::AMPAMP | ||
507 | }; | ||
508 | ( || ) => { | ||
509 | $crate::SyntaxKind::PIPEPIPE | ||
510 | }; | ||
511 | ( << ) => { | ||
512 | $crate::SyntaxKind::SHL | ||
513 | }; | ||
514 | ( >> ) => { | ||
515 | $crate::SyntaxKind::SHR | ||
516 | }; | ||
517 | ( <<= ) => { | ||
518 | $crate::SyntaxKind::SHLEQ | ||
519 | }; | ||
520 | ( >>= ) => { | ||
521 | $crate::SyntaxKind::SHREQ | ||
522 | }; | ||
523 | ( as ) => { | ||
524 | $crate::SyntaxKind::AS_KW | ||
525 | }; | ||
526 | ( async ) => { | ||
527 | $crate::SyntaxKind::ASYNC_KW | ||
528 | }; | ||
529 | ( await ) => { | ||
530 | $crate::SyntaxKind::AWAIT_KW | ||
531 | }; | ||
532 | ( box ) => { | ||
533 | $crate::SyntaxKind::BOX_KW | ||
534 | }; | ||
535 | ( break ) => { | ||
536 | $crate::SyntaxKind::BREAK_KW | ||
537 | }; | ||
538 | ( const ) => { | ||
539 | $crate::SyntaxKind::CONST_KW | ||
540 | }; | ||
541 | ( continue ) => { | ||
542 | $crate::SyntaxKind::CONTINUE_KW | ||
543 | }; | ||
544 | ( crate ) => { | ||
545 | $crate::SyntaxKind::CRATE_KW | ||
546 | }; | ||
547 | ( dyn ) => { | ||
548 | $crate::SyntaxKind::DYN_KW | ||
549 | }; | ||
550 | ( else ) => { | ||
551 | $crate::SyntaxKind::ELSE_KW | ||
552 | }; | ||
553 | ( enum ) => { | ||
554 | $crate::SyntaxKind::ENUM_KW | ||
555 | }; | ||
556 | ( extern ) => { | ||
557 | $crate::SyntaxKind::EXTERN_KW | ||
558 | }; | ||
559 | ( false ) => { | ||
560 | $crate::SyntaxKind::FALSE_KW | ||
561 | }; | ||
562 | ( fn ) => { | ||
563 | $crate::SyntaxKind::FN_KW | ||
564 | }; | ||
565 | ( for ) => { | ||
566 | $crate::SyntaxKind::FOR_KW | ||
567 | }; | ||
568 | ( if ) => { | ||
569 | $crate::SyntaxKind::IF_KW | ||
570 | }; | ||
571 | ( impl ) => { | ||
572 | $crate::SyntaxKind::IMPL_KW | ||
573 | }; | ||
574 | ( in ) => { | ||
575 | $crate::SyntaxKind::IN_KW | ||
576 | }; | ||
577 | ( let ) => { | ||
578 | $crate::SyntaxKind::LET_KW | ||
579 | }; | ||
580 | ( loop ) => { | ||
581 | $crate::SyntaxKind::LOOP_KW | ||
582 | }; | ||
583 | ( macro ) => { | ||
584 | $crate::SyntaxKind::MACRO_KW | ||
585 | }; | ||
586 | ( match ) => { | ||
587 | $crate::SyntaxKind::MATCH_KW | ||
588 | }; | ||
589 | ( mod ) => { | ||
590 | $crate::SyntaxKind::MOD_KW | ||
591 | }; | ||
592 | ( move ) => { | ||
593 | $crate::SyntaxKind::MOVE_KW | ||
594 | }; | ||
595 | ( mut ) => { | ||
596 | $crate::SyntaxKind::MUT_KW | ||
597 | }; | ||
598 | ( pub ) => { | ||
599 | $crate::SyntaxKind::PUB_KW | ||
600 | }; | ||
601 | ( ref ) => { | ||
602 | $crate::SyntaxKind::REF_KW | ||
603 | }; | ||
604 | ( return ) => { | ||
605 | $crate::SyntaxKind::RETURN_KW | ||
606 | }; | ||
607 | ( self ) => { | ||
608 | $crate::SyntaxKind::SELF_KW | ||
609 | }; | ||
610 | ( static ) => { | ||
611 | $crate::SyntaxKind::STATIC_KW | ||
612 | }; | ||
613 | ( struct ) => { | ||
614 | $crate::SyntaxKind::STRUCT_KW | ||
615 | }; | ||
616 | ( super ) => { | ||
617 | $crate::SyntaxKind::SUPER_KW | ||
618 | }; | ||
619 | ( trait ) => { | ||
620 | $crate::SyntaxKind::TRAIT_KW | ||
621 | }; | ||
622 | ( true ) => { | ||
623 | $crate::SyntaxKind::TRUE_KW | ||
624 | }; | ||
625 | ( try ) => { | ||
626 | $crate::SyntaxKind::TRY_KW | ||
627 | }; | ||
628 | ( type ) => { | ||
629 | $crate::SyntaxKind::TYPE_KW | ||
630 | }; | ||
631 | ( unsafe ) => { | ||
632 | $crate::SyntaxKind::UNSAFE_KW | ||
633 | }; | ||
634 | ( use ) => { | ||
635 | $crate::SyntaxKind::USE_KW | ||
636 | }; | ||
637 | ( where ) => { | ||
638 | $crate::SyntaxKind::WHERE_KW | ||
639 | }; | ||
640 | ( while ) => { | ||
641 | $crate::SyntaxKind::WHILE_KW | ||
642 | }; | ||
643 | ( auto ) => { | ||
644 | $crate::SyntaxKind::AUTO_KW | ||
645 | }; | ||
646 | ( default ) => { | ||
647 | $crate::SyntaxKind::DEFAULT_KW | ||
648 | }; | ||
649 | ( existential ) => { | ||
650 | $crate::SyntaxKind::EXISTENTIAL_KW | ||
651 | }; | ||
652 | ( union ) => { | ||
653 | $crate::SyntaxKind::UNION_KW | ||
654 | }; | ||
655 | ( raw ) => { | ||
656 | $crate::SyntaxKind::RAW_KW | ||
657 | }; | ||
658 | } | ||
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs index 00ea3a9b0..2d4f68f5e 100644 --- a/crates/ra_prof/src/lib.rs +++ b/crates/ra_prof/src/lib.rs | |||
@@ -113,21 +113,6 @@ pub fn profile(label: Label) -> Profiler { | |||
113 | }) | 113 | }) |
114 | } | 114 | } |
115 | 115 | ||
116 | pub fn print_time(label: Label) -> impl Drop { | ||
117 | struct Guard { | ||
118 | label: Label, | ||
119 | start: Instant, | ||
120 | } | ||
121 | |||
122 | impl Drop for Guard { | ||
123 | fn drop(&mut self) { | ||
124 | eprintln!("{}: {:?}", self.label, self.start.elapsed()) | ||
125 | } | ||
126 | } | ||
127 | |||
128 | Guard { label, start: Instant::now() } | ||
129 | } | ||
130 | |||
131 | pub struct Profiler { | 116 | pub struct Profiler { |
132 | label: Option<Label>, | 117 | label: Option<Label>, |
133 | detail: Option<String>, | 118 | detail: Option<String>, |
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 15a8279f3..99c6b7219 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -42,11 +42,6 @@ pub trait AstNode { | |||
42 | fn syntax(&self) -> &SyntaxNode; | 42 | fn syntax(&self) -> &SyntaxNode; |
43 | } | 43 | } |
44 | 44 | ||
45 | #[test] | ||
46 | fn assert_ast_is_object_safe() { | ||
47 | fn _f(_: &dyn AstNode, _: &dyn NameOwner) {} | ||
48 | } | ||
49 | |||
50 | /// Like `AstNode`, but wraps tokens rather than interior nodes. | 45 | /// Like `AstNode`, but wraps tokens rather than interior nodes. |
51 | pub trait AstToken { | 46 | pub trait AstToken { |
52 | fn can_cast(token: SyntaxKind) -> bool | 47 | fn can_cast(token: SyntaxKind) -> bool |
@@ -64,22 +59,6 @@ pub trait AstToken { | |||
64 | } | 59 | } |
65 | } | 60 | } |
66 | 61 | ||
67 | mod support { | ||
68 | use super::{AstChildren, AstNode, AstToken, SyntaxNode}; | ||
69 | |||
70 | pub(super) fn child<N: AstNode>(parent: &SyntaxNode) -> Option<N> { | ||
71 | parent.children().find_map(N::cast) | ||
72 | } | ||
73 | |||
74 | pub(super) fn children<N: AstNode>(parent: &SyntaxNode) -> AstChildren<N> { | ||
75 | AstChildren::new(parent) | ||
76 | } | ||
77 | |||
78 | pub(super) fn token<T: AstToken>(parent: &SyntaxNode) -> Option<T> { | ||
79 | parent.children_with_tokens().filter_map(|it| it.into_token()).find_map(T::cast) | ||
80 | } | ||
81 | } | ||
82 | |||
83 | /// An iterator over `SyntaxNode` children of a particular AST type. | 62 | /// An iterator over `SyntaxNode` children of a particular AST type. |
84 | #[derive(Debug, Clone)] | 63 | #[derive(Debug, Clone)] |
85 | pub struct AstChildren<N> { | 64 | pub struct AstChildren<N> { |
@@ -100,12 +79,25 @@ impl<N: AstNode> Iterator for AstChildren<N> { | |||
100 | } | 79 | } |
101 | } | 80 | } |
102 | 81 | ||
103 | fn child_opt<P: AstNode + ?Sized, C: AstNode>(parent: &P) -> Option<C> { | 82 | mod support { |
104 | children(parent).next() | 83 | use super::{AstChildren, AstNode, SyntaxKind, SyntaxNode, SyntaxToken}; |
84 | |||
85 | pub(super) fn child<N: AstNode>(parent: &SyntaxNode) -> Option<N> { | ||
86 | parent.children().find_map(N::cast) | ||
87 | } | ||
88 | |||
89 | pub(super) fn children<N: AstNode>(parent: &SyntaxNode) -> AstChildren<N> { | ||
90 | AstChildren::new(parent) | ||
91 | } | ||
92 | |||
93 | pub(super) fn token(parent: &SyntaxNode, kind: SyntaxKind) -> Option<SyntaxToken> { | ||
94 | parent.children_with_tokens().filter_map(|it| it.into_token()).find(|it| it.kind() == kind) | ||
95 | } | ||
105 | } | 96 | } |
106 | 97 | ||
107 | fn children<P: AstNode + ?Sized, C: AstNode>(parent: &P) -> AstChildren<C> { | 98 | #[test] |
108 | AstChildren::new(parent.syntax()) | 99 | fn assert_ast_is_object_safe() { |
100 | fn _f(_: &dyn AstNode, _: &dyn NameOwner) {} | ||
109 | } | 101 | } |
110 | 102 | ||
111 | #[test] | 103 | #[test] |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 069c6ee82..9e5411ee5 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -6,7 +6,7 @@ use std::{iter, ops::RangeInclusive}; | |||
6 | use arrayvec::ArrayVec; | 6 | use arrayvec::ArrayVec; |
7 | 7 | ||
8 | use crate::{ | 8 | use crate::{ |
9 | algo, | 9 | algo::{self, neighbor, SyntaxRewriter}, |
10 | ast::{ | 10 | ast::{ |
11 | self, | 11 | self, |
12 | make::{self, tokens}, | 12 | make::{self, tokens}, |
@@ -16,7 +16,6 @@ use crate::{ | |||
16 | SyntaxKind::{ATTR, COMMENT, WHITESPACE}, | 16 | SyntaxKind::{ATTR, COMMENT, WHITESPACE}, |
17 | SyntaxNode, SyntaxToken, T, | 17 | SyntaxNode, SyntaxToken, T, |
18 | }; | 18 | }; |
19 | use algo::{neighbor, SyntaxRewriter}; | ||
20 | 19 | ||
21 | impl ast::BinExpr { | 20 | impl ast::BinExpr { |
22 | #[must_use] | 21 | #[must_use] |
@@ -33,9 +32,9 @@ impl ast::FnDef { | |||
33 | let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); | 32 | let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); |
34 | let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { | 33 | let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() { |
35 | old_body.syntax().clone().into() | 34 | old_body.syntax().clone().into() |
36 | } else if let Some(semi) = self.semi_token() { | 35 | } else if let Some(semi) = self.semicolon_token() { |
37 | to_insert.push(make::tokens::single_space().into()); | 36 | to_insert.push(make::tokens::single_space().into()); |
38 | semi.syntax.clone().into() | 37 | semi.into() |
39 | } else { | 38 | } else { |
40 | to_insert.push(make::tokens::single_space().into()); | 39 | to_insert.push(make::tokens::single_space().into()); |
41 | to_insert.push(body.syntax().clone().into()); | 40 | to_insert.push(body.syntax().clone().into()); |
@@ -99,7 +98,7 @@ impl ast::ItemList { | |||
99 | None => match self.l_curly_token() { | 98 | None => match self.l_curly_token() { |
100 | Some(it) => ( | 99 | Some(it) => ( |
101 | " ".to_string() + &leading_indent(self.syntax()).unwrap_or_default(), | 100 | " ".to_string() + &leading_indent(self.syntax()).unwrap_or_default(), |
102 | InsertPosition::After(it.syntax().clone().into()), | 101 | InsertPosition::After(it.into()), |
103 | ), | 102 | ), |
104 | None => return self.clone(), | 103 | None => return self.clone(), |
105 | }, | 104 | }, |
@@ -143,7 +142,7 @@ impl ast::RecordFieldList { | |||
143 | macro_rules! after_l_curly { | 142 | macro_rules! after_l_curly { |
144 | () => {{ | 143 | () => {{ |
145 | let anchor = match self.l_curly_token() { | 144 | let anchor = match self.l_curly_token() { |
146 | Some(it) => it.syntax().clone().into(), | 145 | Some(it) => it.into(), |
147 | None => return self.clone(), | 146 | None => return self.clone(), |
148 | }; | 147 | }; |
149 | InsertPosition::After(anchor) | 148 | InsertPosition::After(anchor) |
@@ -190,15 +189,15 @@ impl ast::RecordFieldList { | |||
190 | impl ast::TypeParam { | 189 | impl ast::TypeParam { |
191 | #[must_use] | 190 | #[must_use] |
192 | pub fn remove_bounds(&self) -> ast::TypeParam { | 191 | pub fn remove_bounds(&self) -> ast::TypeParam { |
193 | let colon = match self.colon() { | 192 | let colon = match self.colon_token() { |
194 | Some(it) => it, | 193 | Some(it) => it, |
195 | None => return self.clone(), | 194 | None => return self.clone(), |
196 | }; | 195 | }; |
197 | let end = match self.type_bound_list() { | 196 | let end = match self.type_bound_list() { |
198 | Some(it) => it.syntax().clone().into(), | 197 | Some(it) => it.syntax().clone().into(), |
199 | None => colon.syntax().clone().into(), | 198 | None => colon.clone().into(), |
200 | }; | 199 | }; |
201 | self.replace_children(colon.syntax().clone().into()..=end, iter::empty()) | 200 | self.replace_children(colon.into()..=end, iter::empty()) |
202 | } | 201 | } |
203 | } | 202 | } |
204 | 203 | ||
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index 40c8fca3b..93aa3d45f 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! Various extension methods to ast Expr Nodes, which are hard to code-generate. | 1 | //! Various extension methods to ast Expr Nodes, which are hard to code-generate. |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | ast::{self, child_opt, children, AstChildren, AstNode}, | 4 | ast::{self, support, AstChildren, AstNode}, |
5 | SmolStr, | 5 | SmolStr, |
6 | SyntaxKind::*, | 6 | SyntaxKind::*, |
7 | SyntaxToken, T, | 7 | SyntaxToken, T, |
@@ -36,7 +36,7 @@ impl ast::IfExpr { | |||
36 | let res = match self.blocks().nth(1) { | 36 | let res = match self.blocks().nth(1) { |
37 | Some(block) => ElseBranch::Block(block), | 37 | Some(block) => ElseBranch::Block(block), |
38 | None => { | 38 | None => { |
39 | let elif: ast::IfExpr = child_opt(self)?; | 39 | let elif: ast::IfExpr = support::child(self.syntax())?; |
40 | ElseBranch::IfExpr(elif) | 40 | ElseBranch::IfExpr(elif) |
41 | } | 41 | } |
42 | }; | 42 | }; |
@@ -44,17 +44,7 @@ impl ast::IfExpr { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | fn blocks(&self) -> AstChildren<ast::BlockExpr> { | 46 | fn blocks(&self) -> AstChildren<ast::BlockExpr> { |
47 | children(self) | 47 | support::children(self.syntax()) |
48 | } | ||
49 | } | ||
50 | |||
51 | impl ast::RefExpr { | ||
52 | pub fn is_mut(&self) -> bool { | ||
53 | self.syntax().children_with_tokens().any(|n| n.kind() == T![mut]) | ||
54 | } | ||
55 | |||
56 | pub fn raw_token(&self) -> Option<SyntaxToken> { | ||
57 | None // FIXME: implement &raw | ||
58 | } | 48 | } |
59 | } | 49 | } |
60 | 50 | ||
@@ -212,15 +202,15 @@ impl ast::BinExpr { | |||
212 | } | 202 | } |
213 | 203 | ||
214 | pub fn lhs(&self) -> Option<ast::Expr> { | 204 | pub fn lhs(&self) -> Option<ast::Expr> { |
215 | children(self).next() | 205 | support::children(self.syntax()).next() |
216 | } | 206 | } |
217 | 207 | ||
218 | pub fn rhs(&self) -> Option<ast::Expr> { | 208 | pub fn rhs(&self) -> Option<ast::Expr> { |
219 | children(self).nth(1) | 209 | support::children(self.syntax()).nth(1) |
220 | } | 210 | } |
221 | 211 | ||
222 | pub fn sub_exprs(&self) -> (Option<ast::Expr>, Option<ast::Expr>) { | 212 | pub fn sub_exprs(&self) -> (Option<ast::Expr>, Option<ast::Expr>) { |
223 | let mut children = children(self); | 213 | let mut children = support::children(self.syntax()); |
224 | let first = children.next(); | 214 | let first = children.next(); |
225 | let second = children.next(); | 215 | let second = children.next(); |
226 | (first, second) | 216 | (first, second) |
@@ -275,10 +265,10 @@ impl ast::RangeExpr { | |||
275 | 265 | ||
276 | impl ast::IndexExpr { | 266 | impl ast::IndexExpr { |
277 | pub fn base(&self) -> Option<ast::Expr> { | 267 | pub fn base(&self) -> Option<ast::Expr> { |
278 | children(self).next() | 268 | support::children(self.syntax()).next() |
279 | } | 269 | } |
280 | pub fn index(&self) -> Option<ast::Expr> { | 270 | pub fn index(&self) -> Option<ast::Expr> { |
281 | children(self).nth(1) | 271 | support::children(self.syntax()).nth(1) |
282 | } | 272 | } |
283 | } | 273 | } |
284 | 274 | ||
@@ -291,11 +281,11 @@ impl ast::ArrayExpr { | |||
291 | pub fn kind(&self) -> ArrayExprKind { | 281 | pub fn kind(&self) -> ArrayExprKind { |
292 | if self.is_repeat() { | 282 | if self.is_repeat() { |
293 | ArrayExprKind::Repeat { | 283 | ArrayExprKind::Repeat { |
294 | initializer: children(self).next(), | 284 | initializer: support::children(self.syntax()).next(), |
295 | repeat: children(self).nth(1), | 285 | repeat: support::children(self.syntax()).nth(1), |
296 | } | 286 | } |
297 | } else { | 287 | } else { |
298 | ArrayExprKind::ElementList(children(self)) | 288 | ArrayExprKind::ElementList(support::children(self.syntax())) |
299 | } | 289 | } |
300 | } | 290 | } |
301 | 291 | ||
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs index b50a89864..76b7655e6 100644 --- a/crates/ra_syntax/src/ast/extensions.rs +++ b/crates/ra_syntax/src/ast/extensions.rs | |||
@@ -5,9 +5,7 @@ use itertools::Itertools; | |||
5 | use ra_parser::SyntaxKind; | 5 | use ra_parser::SyntaxKind; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | ast::{ | 8 | ast::{self, support, AstNode, AttrInput, NameOwner, SyntaxNode}, |
9 | self, child_opt, children, support, AstNode, AstToken, AttrInput, NameOwner, SyntaxNode, | ||
10 | }, | ||
11 | SmolStr, SyntaxElement, SyntaxToken, T, | 9 | SmolStr, SyntaxElement, SyntaxToken, T, |
12 | }; | 10 | }; |
13 | 11 | ||
@@ -23,11 +21,7 @@ impl ast::NameRef { | |||
23 | } | 21 | } |
24 | 22 | ||
25 | pub fn as_tuple_field(&self) -> Option<usize> { | 23 | pub fn as_tuple_field(&self) -> Option<usize> { |
26 | if let Some(ast::NameRefToken::IntNumber(token)) = self.name_ref_token_token() { | 24 | self.text().parse().ok() |
27 | token.text().as_str().parse().ok() | ||
28 | } else { | ||
29 | None | ||
30 | } | ||
31 | } | 25 | } |
32 | } | 26 | } |
33 | 27 | ||
@@ -83,7 +77,7 @@ impl ast::Attr { | |||
83 | first_token.and_then(|token| token.next_token()).as_ref().map(SyntaxToken::kind); | 77 | first_token.and_then(|token| token.next_token()).as_ref().map(SyntaxToken::kind); |
84 | 78 | ||
85 | match (first_token_kind, second_token_kind) { | 79 | match (first_token_kind, second_token_kind) { |
86 | (Some(SyntaxKind::POUND), Some(SyntaxKind::EXCL)) => AttrKind::Inner, | 80 | (Some(SyntaxKind::POUND), Some(T![!])) => AttrKind::Inner, |
87 | _ => AttrKind::Outer, | 81 | _ => AttrKind::Outer, |
88 | } | 82 | } |
89 | } | 83 | } |
@@ -161,7 +155,7 @@ impl ast::ImplDef { | |||
161 | } | 155 | } |
162 | 156 | ||
163 | fn target(&self) -> (Option<ast::TypeRef>, Option<ast::TypeRef>) { | 157 | fn target(&self) -> (Option<ast::TypeRef>, Option<ast::TypeRef>) { |
164 | let mut types = children(self); | 158 | let mut types = support::children(self.syntax()); |
165 | let first = types.next(); | 159 | let first = types.next(); |
166 | let second = types.next(); | 160 | let second = types.next(); |
167 | (first, second) | 161 | (first, second) |
@@ -177,9 +171,9 @@ pub enum StructKind { | |||
177 | 171 | ||
178 | impl StructKind { | 172 | impl StructKind { |
179 | fn from_node<N: AstNode>(node: &N) -> StructKind { | 173 | fn from_node<N: AstNode>(node: &N) -> StructKind { |
180 | if let Some(nfdl) = child_opt::<_, ast::RecordFieldDefList>(node) { | 174 | if let Some(nfdl) = support::child::<ast::RecordFieldDefList>(node.syntax()) { |
181 | StructKind::Record(nfdl) | 175 | StructKind::Record(nfdl) |
182 | } else if let Some(pfl) = child_opt::<_, ast::TupleFieldDefList>(node) { | 176 | } else if let Some(pfl) = support::child::<ast::TupleFieldDefList>(node.syntax()) { |
183 | StructKind::Tuple(pfl) | 177 | StructKind::Tuple(pfl) |
184 | } else { | 178 | } else { |
185 | StructKind::Unit | 179 | StructKind::Unit |
@@ -281,7 +275,7 @@ pub enum SelfParamKind { | |||
281 | impl ast::SelfParam { | 275 | impl ast::SelfParam { |
282 | pub fn kind(&self) -> SelfParamKind { | 276 | pub fn kind(&self) -> SelfParamKind { |
283 | if self.amp_token().is_some() { | 277 | if self.amp_token().is_some() { |
284 | if self.amp_mut_kw_token().is_some() { | 278 | if self.mut_token().is_some() { |
285 | SelfParamKind::MutRef | 279 | SelfParamKind::MutRef |
286 | } else { | 280 | } else { |
287 | SelfParamKind::Ref | 281 | SelfParamKind::Ref |
@@ -290,24 +284,6 @@ impl ast::SelfParam { | |||
290 | SelfParamKind::Owned | 284 | SelfParamKind::Owned |
291 | } | 285 | } |
292 | } | 286 | } |
293 | |||
294 | /// the "mut" in "mut self", not the one in "&mut self" | ||
295 | pub fn mut_kw_token(&self) -> Option<ast::MutKw> { | ||
296 | self.syntax() | ||
297 | .children_with_tokens() | ||
298 | .filter_map(|it| it.into_token()) | ||
299 | .take_while(|it| it.kind() != T![&]) | ||
300 | .find_map(ast::MutKw::cast) | ||
301 | } | ||
302 | |||
303 | /// the "mut" in "&mut self", not the one in "mut self" | ||
304 | pub fn amp_mut_kw_token(&self) -> Option<ast::MutKw> { | ||
305 | self.syntax() | ||
306 | .children_with_tokens() | ||
307 | .filter_map(|it| it.into_token()) | ||
308 | .skip_while(|it| it.kind() != T![&]) | ||
309 | .find_map(ast::MutKw::cast) | ||
310 | } | ||
311 | } | 287 | } |
312 | 288 | ||
313 | #[derive(Clone, Debug, PartialEq, Eq, Hash)] | 289 | #[derive(Clone, Debug, PartialEq, Eq, Hash)] |
@@ -317,14 +293,14 @@ pub enum TypeBoundKind { | |||
317 | /// for<'a> ... | 293 | /// for<'a> ... |
318 | ForType(ast::ForType), | 294 | ForType(ast::ForType), |
319 | /// 'a | 295 | /// 'a |
320 | Lifetime(ast::Lifetime), | 296 | Lifetime(SyntaxToken), |
321 | } | 297 | } |
322 | 298 | ||
323 | impl ast::TypeBound { | 299 | impl ast::TypeBound { |
324 | pub fn kind(&self) -> TypeBoundKind { | 300 | pub fn kind(&self) -> TypeBoundKind { |
325 | if let Some(path_type) = children(self).next() { | 301 | if let Some(path_type) = support::children(self.syntax()).next() { |
326 | TypeBoundKind::PathType(path_type) | 302 | TypeBoundKind::PathType(path_type) |
327 | } else if let Some(for_type) = children(self).next() { | 303 | } else if let Some(for_type) = support::children(self.syntax()).next() { |
328 | TypeBoundKind::ForType(for_type) | 304 | TypeBoundKind::ForType(for_type) |
329 | } else if let Some(lifetime) = self.lifetime_token() { | 305 | } else if let Some(lifetime) = self.lifetime_token() { |
330 | TypeBoundKind::Lifetime(lifetime) | 306 | TypeBoundKind::Lifetime(lifetime) |
@@ -333,23 +309,23 @@ impl ast::TypeBound { | |||
333 | } | 309 | } |
334 | } | 310 | } |
335 | 311 | ||
336 | pub fn const_question_token(&self) -> Option<ast::Question> { | 312 | pub fn const_question_token(&self) -> Option<SyntaxToken> { |
337 | self.syntax() | 313 | self.syntax() |
338 | .children_with_tokens() | 314 | .children_with_tokens() |
339 | .filter_map(|it| it.into_token()) | 315 | .filter_map(|it| it.into_token()) |
340 | .take_while(|it| it.kind() != T![const]) | 316 | .take_while(|it| it.kind() != T![const]) |
341 | .find_map(ast::Question::cast) | 317 | .find(|it| it.kind() == T![?]) |
342 | } | 318 | } |
343 | 319 | ||
344 | pub fn question_token(&self) -> Option<ast::Question> { | 320 | pub fn question_token(&self) -> Option<SyntaxToken> { |
345 | if self.const_kw_token().is_some() { | 321 | if self.const_token().is_some() { |
346 | self.syntax() | 322 | self.syntax() |
347 | .children_with_tokens() | 323 | .children_with_tokens() |
348 | .filter_map(|it| it.into_token()) | 324 | .filter_map(|it| it.into_token()) |
349 | .skip_while(|it| it.kind() != T![const]) | 325 | .skip_while(|it| it.kind() != T![const]) |
350 | .find_map(ast::Question::cast) | 326 | .find(|it| it.kind() == T![?]) |
351 | } else { | 327 | } else { |
352 | support::token(&self.syntax) | 328 | support::token(&self.syntax, T![?]) |
353 | } | 329 | } |
354 | } | 330 | } |
355 | } | 331 | } |
@@ -364,13 +340,13 @@ pub enum VisibilityKind { | |||
364 | 340 | ||
365 | impl ast::Visibility { | 341 | impl ast::Visibility { |
366 | pub fn kind(&self) -> VisibilityKind { | 342 | pub fn kind(&self) -> VisibilityKind { |
367 | if let Some(path) = children(self).next() { | 343 | if let Some(path) = support::children(self.syntax()).next() { |
368 | VisibilityKind::In(path) | 344 | VisibilityKind::In(path) |
369 | } else if self.crate_kw_token().is_some() { | 345 | } else if self.crate_token().is_some() { |
370 | VisibilityKind::PubCrate | 346 | VisibilityKind::PubCrate |
371 | } else if self.super_kw_token().is_some() { | 347 | } else if self.super_token().is_some() { |
372 | VisibilityKind::PubSuper | 348 | VisibilityKind::PubSuper |
373 | } else if self.self_kw_token().is_some() { | 349 | } else if self.self_token().is_some() { |
374 | VisibilityKind::PubSuper | 350 | VisibilityKind::PubSuper |
375 | } else { | 351 | } else { |
376 | VisibilityKind::Pub | 352 | VisibilityKind::Pub |
@@ -390,12 +366,12 @@ impl ast::MacroCall { | |||
390 | } | 366 | } |
391 | 367 | ||
392 | impl ast::LifetimeParam { | 368 | impl ast::LifetimeParam { |
393 | pub fn lifetime_bounds(&self) -> impl Iterator<Item = ast::Lifetime> { | 369 | pub fn lifetime_bounds(&self) -> impl Iterator<Item = SyntaxToken> { |
394 | self.syntax() | 370 | self.syntax() |
395 | .children_with_tokens() | 371 | .children_with_tokens() |
396 | .filter_map(|it| it.into_token()) | 372 | .filter_map(|it| it.into_token()) |
397 | .skip_while(|x| x.kind() != T![:]) | 373 | .skip_while(|x| x.kind() != T![:]) |
398 | .filter_map(ast::Lifetime::cast) | 374 | .filter(|it| it.kind() == T![lifetime]) |
399 | } | 375 | } |
400 | } | 376 | } |
401 | 377 | ||
@@ -403,7 +379,7 @@ impl ast::RangePat { | |||
403 | pub fn start(&self) -> Option<ast::Pat> { | 379 | pub fn start(&self) -> Option<ast::Pat> { |
404 | self.syntax() | 380 | self.syntax() |
405 | .children_with_tokens() | 381 | .children_with_tokens() |
406 | .take_while(|it| !ast::RangeSeparator::can_cast(it.kind())) | 382 | .take_while(|it| !(it.kind() == T![..] || it.kind() == T![..=])) |
407 | .filter_map(|it| it.into_node()) | 383 | .filter_map(|it| it.into_node()) |
408 | .find_map(ast::Pat::cast) | 384 | .find_map(ast::Pat::cast) |
409 | } | 385 | } |
@@ -411,18 +387,24 @@ impl ast::RangePat { | |||
411 | pub fn end(&self) -> Option<ast::Pat> { | 387 | pub fn end(&self) -> Option<ast::Pat> { |
412 | self.syntax() | 388 | self.syntax() |
413 | .children_with_tokens() | 389 | .children_with_tokens() |
414 | .skip_while(|it| !ast::RangeSeparator::can_cast(it.kind())) | 390 | .skip_while(|it| !(it.kind() == T![..] || it.kind() == T![..=])) |
415 | .filter_map(|it| it.into_node()) | 391 | .filter_map(|it| it.into_node()) |
416 | .find_map(ast::Pat::cast) | 392 | .find_map(ast::Pat::cast) |
417 | } | 393 | } |
418 | } | 394 | } |
419 | 395 | ||
420 | impl ast::TokenTree { | 396 | impl ast::TokenTree { |
421 | pub fn left_delimiter(&self) -> Option<ast::LeftDelimiter> { | 397 | pub fn left_delimiter_token(&self) -> Option<SyntaxToken> { |
422 | self.syntax().first_child_or_token()?.into_token().and_then(ast::LeftDelimiter::cast) | 398 | self.syntax().first_child_or_token()?.into_token().filter(|it| match it.kind() { |
423 | } | 399 | T!['{'] | T!['('] | T!['['] => true, |
424 | 400 | _ => false, | |
425 | pub fn right_delimiter(&self) -> Option<ast::RightDelimiter> { | 401 | }) |
426 | self.syntax().last_child_or_token()?.into_token().and_then(ast::RightDelimiter::cast) | 402 | } |
403 | |||
404 | pub fn right_delimiter_token(&self) -> Option<SyntaxToken> { | ||
405 | self.syntax().last_child_or_token()?.into_token().filter(|it| match it.kind() { | ||
406 | T!['{'] | T!['('] | T!['['] => true, | ||
407 | _ => false, | ||
408 | }) | ||
427 | } | 409 | } |
428 | } | 410 | } |
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index bcbfd1129..f1098755b 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -1,11 +1,11 @@ | |||
1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` | 1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` |
2 | 2 | ||
3 | use super::tokens::*; | ||
4 | use crate::{ | 3 | use crate::{ |
5 | ast::{self, support, AstChildren, AstNode}, | 4 | ast::{self, support, AstChildren, AstNode}, |
6 | SyntaxKind::{self, *}, | 5 | SyntaxKind::{self, *}, |
7 | SyntaxNode, | 6 | SyntaxNode, SyntaxToken, T, |
8 | }; | 7 | }; |
8 | |||
9 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 9 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
10 | pub struct SourceFile { | 10 | pub struct SourceFile { |
11 | pub(crate) syntax: SyntaxNode, | 11 | pub(crate) syntax: SyntaxNode, |
@@ -22,11 +22,11 @@ impl AstNode for SourceFile { | |||
22 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 22 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
23 | } | 23 | } |
24 | impl ast::ModuleItemOwner for SourceFile {} | 24 | impl ast::ModuleItemOwner for SourceFile {} |
25 | impl ast::FnDefOwner for SourceFile {} | ||
26 | impl ast::AttrsOwner for SourceFile {} | 25 | impl ast::AttrsOwner for SourceFile {} |
27 | impl SourceFile { | 26 | impl SourceFile { |
28 | pub fn modules(&self) -> AstChildren<Module> { support::children(&self.syntax) } | 27 | pub fn modules(&self) -> AstChildren<Module> { support::children(&self.syntax) } |
29 | } | 28 | } |
29 | |||
30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
31 | pub struct FnDef { | 31 | pub struct FnDef { |
32 | pub(crate) syntax: SyntaxNode, | 32 | pub(crate) syntax: SyntaxNode, |
@@ -49,16 +49,17 @@ impl ast::DocCommentsOwner for FnDef {} | |||
49 | impl ast::AttrsOwner for FnDef {} | 49 | impl ast::AttrsOwner for FnDef {} |
50 | impl FnDef { | 50 | impl FnDef { |
51 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | 51 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } |
52 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 52 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
53 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 53 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
54 | pub fn async_kw_token(&self) -> Option<AsyncKw> { support::token(&self.syntax) } | 54 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
55 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 55 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
56 | pub fn fn_kw_token(&self) -> Option<FnKw> { support::token(&self.syntax) } | 56 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } |
57 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 57 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
58 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 58 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
59 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | 59 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } |
60 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 60 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
61 | } | 61 | } |
62 | |||
62 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 63 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
63 | pub struct RetType { | 64 | pub struct RetType { |
64 | pub(crate) syntax: SyntaxNode, | 65 | pub(crate) syntax: SyntaxNode, |
@@ -75,9 +76,10 @@ impl AstNode for RetType { | |||
75 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 76 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
76 | } | 77 | } |
77 | impl RetType { | 78 | impl RetType { |
78 | pub fn thin_arrow_token(&self) -> Option<ThinArrow> { support::token(&self.syntax) } | 79 | pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) } |
79 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 80 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
80 | } | 81 | } |
82 | |||
81 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 83 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
82 | pub struct StructDef { | 84 | pub struct StructDef { |
83 | pub(crate) syntax: SyntaxNode, | 85 | pub(crate) syntax: SyntaxNode, |
@@ -99,10 +101,11 @@ impl ast::TypeParamsOwner for StructDef {} | |||
99 | impl ast::AttrsOwner for StructDef {} | 101 | impl ast::AttrsOwner for StructDef {} |
100 | impl ast::DocCommentsOwner for StructDef {} | 102 | impl ast::DocCommentsOwner for StructDef {} |
101 | impl StructDef { | 103 | impl StructDef { |
102 | pub fn struct_kw_token(&self) -> Option<StructKw> { support::token(&self.syntax) } | 104 | pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } |
103 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } | 105 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } |
104 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 106 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
105 | } | 107 | } |
108 | |||
106 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 109 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
107 | pub struct UnionDef { | 110 | pub struct UnionDef { |
108 | pub(crate) syntax: SyntaxNode, | 111 | pub(crate) syntax: SyntaxNode, |
@@ -124,11 +127,12 @@ impl ast::TypeParamsOwner for UnionDef {} | |||
124 | impl ast::AttrsOwner for UnionDef {} | 127 | impl ast::AttrsOwner for UnionDef {} |
125 | impl ast::DocCommentsOwner for UnionDef {} | 128 | impl ast::DocCommentsOwner for UnionDef {} |
126 | impl UnionDef { | 129 | impl UnionDef { |
127 | pub fn union_kw_token(&self) -> Option<UnionKw> { support::token(&self.syntax) } | 130 | pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) } |
128 | pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { | 131 | pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { |
129 | support::child(&self.syntax) | 132 | support::child(&self.syntax) |
130 | } | 133 | } |
131 | } | 134 | } |
135 | |||
132 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 136 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
133 | pub struct RecordFieldDefList { | 137 | pub struct RecordFieldDefList { |
134 | pub(crate) syntax: SyntaxNode, | 138 | pub(crate) syntax: SyntaxNode, |
@@ -145,10 +149,11 @@ impl AstNode for RecordFieldDefList { | |||
145 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 149 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
146 | } | 150 | } |
147 | impl RecordFieldDefList { | 151 | impl RecordFieldDefList { |
148 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 152 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
149 | pub fn fields(&self) -> AstChildren<RecordFieldDef> { support::children(&self.syntax) } | 153 | pub fn fields(&self) -> AstChildren<RecordFieldDef> { support::children(&self.syntax) } |
150 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 154 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
151 | } | 155 | } |
156 | |||
152 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 157 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
153 | pub struct RecordFieldDef { | 158 | pub struct RecordFieldDef { |
154 | pub(crate) syntax: SyntaxNode, | 159 | pub(crate) syntax: SyntaxNode, |
@@ -170,6 +175,7 @@ impl ast::AttrsOwner for RecordFieldDef {} | |||
170 | impl ast::DocCommentsOwner for RecordFieldDef {} | 175 | impl ast::DocCommentsOwner for RecordFieldDef {} |
171 | impl ast::TypeAscriptionOwner for RecordFieldDef {} | 176 | impl ast::TypeAscriptionOwner for RecordFieldDef {} |
172 | impl RecordFieldDef {} | 177 | impl RecordFieldDef {} |
178 | |||
173 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 179 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
174 | pub struct TupleFieldDefList { | 180 | pub struct TupleFieldDefList { |
175 | pub(crate) syntax: SyntaxNode, | 181 | pub(crate) syntax: SyntaxNode, |
@@ -186,10 +192,11 @@ impl AstNode for TupleFieldDefList { | |||
186 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 192 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
187 | } | 193 | } |
188 | impl TupleFieldDefList { | 194 | impl TupleFieldDefList { |
189 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 195 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
190 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } | 196 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } |
191 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 197 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
192 | } | 198 | } |
199 | |||
193 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 200 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
194 | pub struct TupleFieldDef { | 201 | pub struct TupleFieldDef { |
195 | pub(crate) syntax: SyntaxNode, | 202 | pub(crate) syntax: SyntaxNode, |
@@ -210,6 +217,7 @@ impl ast::AttrsOwner for TupleFieldDef {} | |||
210 | impl TupleFieldDef { | 217 | impl TupleFieldDef { |
211 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 218 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
212 | } | 219 | } |
220 | |||
213 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 221 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
214 | pub struct EnumDef { | 222 | pub struct EnumDef { |
215 | pub(crate) syntax: SyntaxNode, | 223 | pub(crate) syntax: SyntaxNode, |
@@ -231,9 +239,10 @@ impl ast::TypeParamsOwner for EnumDef {} | |||
231 | impl ast::AttrsOwner for EnumDef {} | 239 | impl ast::AttrsOwner for EnumDef {} |
232 | impl ast::DocCommentsOwner for EnumDef {} | 240 | impl ast::DocCommentsOwner for EnumDef {} |
233 | impl EnumDef { | 241 | impl EnumDef { |
234 | pub fn enum_kw_token(&self) -> Option<EnumKw> { support::token(&self.syntax) } | 242 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } |
235 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } | 243 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } |
236 | } | 244 | } |
245 | |||
237 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 246 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
238 | pub struct EnumVariantList { | 247 | pub struct EnumVariantList { |
239 | pub(crate) syntax: SyntaxNode, | 248 | pub(crate) syntax: SyntaxNode, |
@@ -250,10 +259,11 @@ impl AstNode for EnumVariantList { | |||
250 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 259 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
251 | } | 260 | } |
252 | impl EnumVariantList { | 261 | impl EnumVariantList { |
253 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 262 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
254 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } | 263 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } |
255 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 264 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
256 | } | 265 | } |
266 | |||
257 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 267 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
258 | pub struct EnumVariant { | 268 | pub struct EnumVariant { |
259 | pub(crate) syntax: SyntaxNode, | 269 | pub(crate) syntax: SyntaxNode, |
@@ -275,9 +285,10 @@ impl ast::DocCommentsOwner for EnumVariant {} | |||
275 | impl ast::AttrsOwner for EnumVariant {} | 285 | impl ast::AttrsOwner for EnumVariant {} |
276 | impl EnumVariant { | 286 | impl EnumVariant { |
277 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } | 287 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } |
278 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 288 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
279 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 289 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
280 | } | 290 | } |
291 | |||
281 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 292 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
282 | pub struct TraitDef { | 293 | pub struct TraitDef { |
283 | pub(crate) syntax: SyntaxNode, | 294 | pub(crate) syntax: SyntaxNode, |
@@ -300,11 +311,12 @@ impl ast::DocCommentsOwner for TraitDef {} | |||
300 | impl ast::TypeParamsOwner for TraitDef {} | 311 | impl ast::TypeParamsOwner for TraitDef {} |
301 | impl ast::TypeBoundsOwner for TraitDef {} | 312 | impl ast::TypeBoundsOwner for TraitDef {} |
302 | impl TraitDef { | 313 | impl TraitDef { |
303 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 314 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
304 | pub fn auto_kw_token(&self) -> Option<AutoKw> { support::token(&self.syntax) } | 315 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } |
305 | pub fn trait_kw_token(&self) -> Option<TraitKw> { support::token(&self.syntax) } | 316 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } |
306 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 317 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } |
307 | } | 318 | } |
319 | |||
308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 320 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
309 | pub struct Module { | 321 | pub struct Module { |
310 | pub(crate) syntax: SyntaxNode, | 322 | pub(crate) syntax: SyntaxNode, |
@@ -325,10 +337,11 @@ impl ast::NameOwner for Module {} | |||
325 | impl ast::AttrsOwner for Module {} | 337 | impl ast::AttrsOwner for Module {} |
326 | impl ast::DocCommentsOwner for Module {} | 338 | impl ast::DocCommentsOwner for Module {} |
327 | impl Module { | 339 | impl Module { |
328 | pub fn mod_kw_token(&self) -> Option<ModKw> { support::token(&self.syntax) } | 340 | pub fn mod_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mod]) } |
329 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 341 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } |
330 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 342 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
331 | } | 343 | } |
344 | |||
332 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 345 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
333 | pub struct ItemList { | 346 | pub struct ItemList { |
334 | pub(crate) syntax: SyntaxNode, | 347 | pub(crate) syntax: SyntaxNode, |
@@ -344,13 +357,13 @@ impl AstNode for ItemList { | |||
344 | } | 357 | } |
345 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 358 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
346 | } | 359 | } |
347 | impl ast::FnDefOwner for ItemList {} | ||
348 | impl ast::ModuleItemOwner for ItemList {} | 360 | impl ast::ModuleItemOwner for ItemList {} |
349 | impl ItemList { | 361 | impl ItemList { |
350 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 362 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
351 | pub fn impl_items(&self) -> AstChildren<ImplItem> { support::children(&self.syntax) } | 363 | pub fn impl_items(&self) -> AstChildren<ImplItem> { support::children(&self.syntax) } |
352 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 364 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
353 | } | 365 | } |
366 | |||
354 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 367 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
355 | pub struct ConstDef { | 368 | pub struct ConstDef { |
356 | pub(crate) syntax: SyntaxNode, | 369 | pub(crate) syntax: SyntaxNode, |
@@ -373,12 +386,13 @@ impl ast::AttrsOwner for ConstDef {} | |||
373 | impl ast::DocCommentsOwner for ConstDef {} | 386 | impl ast::DocCommentsOwner for ConstDef {} |
374 | impl ast::TypeAscriptionOwner for ConstDef {} | 387 | impl ast::TypeAscriptionOwner for ConstDef {} |
375 | impl ConstDef { | 388 | impl ConstDef { |
376 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 389 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
377 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 390 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
378 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 391 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
379 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 392 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
380 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 393 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
381 | } | 394 | } |
395 | |||
382 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 396 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
383 | pub struct StaticDef { | 397 | pub struct StaticDef { |
384 | pub(crate) syntax: SyntaxNode, | 398 | pub(crate) syntax: SyntaxNode, |
@@ -401,12 +415,13 @@ impl ast::AttrsOwner for StaticDef {} | |||
401 | impl ast::DocCommentsOwner for StaticDef {} | 415 | impl ast::DocCommentsOwner for StaticDef {} |
402 | impl ast::TypeAscriptionOwner for StaticDef {} | 416 | impl ast::TypeAscriptionOwner for StaticDef {} |
403 | impl StaticDef { | 417 | impl StaticDef { |
404 | pub fn static_kw_token(&self) -> Option<StaticKw> { support::token(&self.syntax) } | 418 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
405 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 419 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
406 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 420 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
407 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 421 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
408 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 422 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
409 | } | 423 | } |
424 | |||
410 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 425 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
411 | pub struct TypeAliasDef { | 426 | pub struct TypeAliasDef { |
412 | pub(crate) syntax: SyntaxNode, | 427 | pub(crate) syntax: SyntaxNode, |
@@ -429,12 +444,13 @@ impl ast::AttrsOwner for TypeAliasDef {} | |||
429 | impl ast::DocCommentsOwner for TypeAliasDef {} | 444 | impl ast::DocCommentsOwner for TypeAliasDef {} |
430 | impl ast::TypeBoundsOwner for TypeAliasDef {} | 445 | impl ast::TypeBoundsOwner for TypeAliasDef {} |
431 | impl TypeAliasDef { | 446 | impl TypeAliasDef { |
432 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 447 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
433 | pub fn type_kw_token(&self) -> Option<TypeKw> { support::token(&self.syntax) } | 448 | pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } |
434 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 449 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
435 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 450 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
436 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 451 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
437 | } | 452 | } |
453 | |||
438 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 454 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
439 | pub struct ImplDef { | 455 | pub struct ImplDef { |
440 | pub(crate) syntax: SyntaxNode, | 456 | pub(crate) syntax: SyntaxNode, |
@@ -453,14 +469,15 @@ impl AstNode for ImplDef { | |||
453 | impl ast::TypeParamsOwner for ImplDef {} | 469 | impl ast::TypeParamsOwner for ImplDef {} |
454 | impl ast::AttrsOwner for ImplDef {} | 470 | impl ast::AttrsOwner for ImplDef {} |
455 | impl ImplDef { | 471 | impl ImplDef { |
456 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 472 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
457 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 473 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
458 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 474 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
459 | pub fn impl_kw_token(&self) -> Option<ImplKw> { support::token(&self.syntax) } | 475 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
460 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 476 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
461 | pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) } | 477 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
462 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 478 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } |
463 | } | 479 | } |
480 | |||
464 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 481 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
465 | pub struct ParenType { | 482 | pub struct ParenType { |
466 | pub(crate) syntax: SyntaxNode, | 483 | pub(crate) syntax: SyntaxNode, |
@@ -477,10 +494,11 @@ impl AstNode for ParenType { | |||
477 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 494 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
478 | } | 495 | } |
479 | impl ParenType { | 496 | impl ParenType { |
480 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 497 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
481 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 498 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
482 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 499 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
483 | } | 500 | } |
501 | |||
484 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 502 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
485 | pub struct TupleType { | 503 | pub struct TupleType { |
486 | pub(crate) syntax: SyntaxNode, | 504 | pub(crate) syntax: SyntaxNode, |
@@ -497,10 +515,11 @@ impl AstNode for TupleType { | |||
497 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 515 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
498 | } | 516 | } |
499 | impl TupleType { | 517 | impl TupleType { |
500 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 518 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
501 | pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } | 519 | pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } |
502 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 520 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
503 | } | 521 | } |
522 | |||
504 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 523 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
505 | pub struct NeverType { | 524 | pub struct NeverType { |
506 | pub(crate) syntax: SyntaxNode, | 525 | pub(crate) syntax: SyntaxNode, |
@@ -517,8 +536,9 @@ impl AstNode for NeverType { | |||
517 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 536 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
518 | } | 537 | } |
519 | impl NeverType { | 538 | impl NeverType { |
520 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 539 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
521 | } | 540 | } |
541 | |||
522 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 542 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
523 | pub struct PathType { | 543 | pub struct PathType { |
524 | pub(crate) syntax: SyntaxNode, | 544 | pub(crate) syntax: SyntaxNode, |
@@ -537,6 +557,7 @@ impl AstNode for PathType { | |||
537 | impl PathType { | 557 | impl PathType { |
538 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 558 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
539 | } | 559 | } |
560 | |||
540 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 561 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
541 | pub struct PointerType { | 562 | pub struct PointerType { |
542 | pub(crate) syntax: SyntaxNode, | 563 | pub(crate) syntax: SyntaxNode, |
@@ -553,11 +574,12 @@ impl AstNode for PointerType { | |||
553 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 574 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
554 | } | 575 | } |
555 | impl PointerType { | 576 | impl PointerType { |
556 | pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) } | 577 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } |
557 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 578 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
558 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 579 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
559 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 580 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
560 | } | 581 | } |
582 | |||
561 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 583 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
562 | pub struct ArrayType { | 584 | pub struct ArrayType { |
563 | pub(crate) syntax: SyntaxNode, | 585 | pub(crate) syntax: SyntaxNode, |
@@ -574,12 +596,13 @@ impl AstNode for ArrayType { | |||
574 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 596 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
575 | } | 597 | } |
576 | impl ArrayType { | 598 | impl ArrayType { |
577 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 599 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
578 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 600 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
579 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 601 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
580 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 602 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
581 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 603 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
582 | } | 604 | } |
605 | |||
583 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 606 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
584 | pub struct SliceType { | 607 | pub struct SliceType { |
585 | pub(crate) syntax: SyntaxNode, | 608 | pub(crate) syntax: SyntaxNode, |
@@ -596,10 +619,11 @@ impl AstNode for SliceType { | |||
596 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 619 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
597 | } | 620 | } |
598 | impl SliceType { | 621 | impl SliceType { |
599 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 622 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
600 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 623 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
601 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 624 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
602 | } | 625 | } |
626 | |||
603 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 627 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
604 | pub struct ReferenceType { | 628 | pub struct ReferenceType { |
605 | pub(crate) syntax: SyntaxNode, | 629 | pub(crate) syntax: SyntaxNode, |
@@ -616,11 +640,14 @@ impl AstNode for ReferenceType { | |||
616 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 640 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
617 | } | 641 | } |
618 | impl ReferenceType { | 642 | impl ReferenceType { |
619 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 643 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
620 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 644 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
621 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 645 | support::token(&self.syntax, T![lifetime]) |
646 | } | ||
647 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | ||
622 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 648 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
623 | } | 649 | } |
650 | |||
624 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 651 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
625 | pub struct PlaceholderType { | 652 | pub struct PlaceholderType { |
626 | pub(crate) syntax: SyntaxNode, | 653 | pub(crate) syntax: SyntaxNode, |
@@ -637,8 +664,9 @@ impl AstNode for PlaceholderType { | |||
637 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 664 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
638 | } | 665 | } |
639 | impl PlaceholderType { | 666 | impl PlaceholderType { |
640 | pub fn underscore_token(&self) -> Option<Underscore> { support::token(&self.syntax) } | 667 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } |
641 | } | 668 | } |
669 | |||
642 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 670 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
643 | pub struct FnPointerType { | 671 | pub struct FnPointerType { |
644 | pub(crate) syntax: SyntaxNode, | 672 | pub(crate) syntax: SyntaxNode, |
@@ -656,11 +684,12 @@ impl AstNode for FnPointerType { | |||
656 | } | 684 | } |
657 | impl FnPointerType { | 685 | impl FnPointerType { |
658 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | 686 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } |
659 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 687 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
660 | pub fn fn_kw_token(&self) -> Option<FnKw> { support::token(&self.syntax) } | 688 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } |
661 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 689 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
662 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 690 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
663 | } | 691 | } |
692 | |||
664 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 693 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
665 | pub struct ForType { | 694 | pub struct ForType { |
666 | pub(crate) syntax: SyntaxNode, | 695 | pub(crate) syntax: SyntaxNode, |
@@ -677,10 +706,11 @@ impl AstNode for ForType { | |||
677 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 706 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
678 | } | 707 | } |
679 | impl ForType { | 708 | impl ForType { |
680 | pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) } | 709 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
681 | pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } | 710 | pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } |
682 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 711 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
683 | } | 712 | } |
713 | |||
684 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 714 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
685 | pub struct ImplTraitType { | 715 | pub struct ImplTraitType { |
686 | pub(crate) syntax: SyntaxNode, | 716 | pub(crate) syntax: SyntaxNode, |
@@ -698,8 +728,9 @@ impl AstNode for ImplTraitType { | |||
698 | } | 728 | } |
699 | impl ast::TypeBoundsOwner for ImplTraitType {} | 729 | impl ast::TypeBoundsOwner for ImplTraitType {} |
700 | impl ImplTraitType { | 730 | impl ImplTraitType { |
701 | pub fn impl_kw_token(&self) -> Option<ImplKw> { support::token(&self.syntax) } | 731 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
702 | } | 732 | } |
733 | |||
703 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 734 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
704 | pub struct DynTraitType { | 735 | pub struct DynTraitType { |
705 | pub(crate) syntax: SyntaxNode, | 736 | pub(crate) syntax: SyntaxNode, |
@@ -717,8 +748,9 @@ impl AstNode for DynTraitType { | |||
717 | } | 748 | } |
718 | impl ast::TypeBoundsOwner for DynTraitType {} | 749 | impl ast::TypeBoundsOwner for DynTraitType {} |
719 | impl DynTraitType { | 750 | impl DynTraitType { |
720 | pub fn dyn_kw_token(&self) -> Option<DynKw> { support::token(&self.syntax) } | 751 | pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) } |
721 | } | 752 | } |
753 | |||
722 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 754 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
723 | pub struct TupleExpr { | 755 | pub struct TupleExpr { |
724 | pub(crate) syntax: SyntaxNode, | 756 | pub(crate) syntax: SyntaxNode, |
@@ -736,10 +768,11 @@ impl AstNode for TupleExpr { | |||
736 | } | 768 | } |
737 | impl ast::AttrsOwner for TupleExpr {} | 769 | impl ast::AttrsOwner for TupleExpr {} |
738 | impl TupleExpr { | 770 | impl TupleExpr { |
739 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 771 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
740 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 772 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
741 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 773 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
742 | } | 774 | } |
775 | |||
743 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 776 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
744 | pub struct ArrayExpr { | 777 | pub struct ArrayExpr { |
745 | pub(crate) syntax: SyntaxNode, | 778 | pub(crate) syntax: SyntaxNode, |
@@ -757,11 +790,12 @@ impl AstNode for ArrayExpr { | |||
757 | } | 790 | } |
758 | impl ast::AttrsOwner for ArrayExpr {} | 791 | impl ast::AttrsOwner for ArrayExpr {} |
759 | impl ArrayExpr { | 792 | impl ArrayExpr { |
760 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 793 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
761 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 794 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
762 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 795 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
763 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 796 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
764 | } | 797 | } |
798 | |||
765 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 799 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
766 | pub struct ParenExpr { | 800 | pub struct ParenExpr { |
767 | pub(crate) syntax: SyntaxNode, | 801 | pub(crate) syntax: SyntaxNode, |
@@ -779,10 +813,11 @@ impl AstNode for ParenExpr { | |||
779 | } | 813 | } |
780 | impl ast::AttrsOwner for ParenExpr {} | 814 | impl ast::AttrsOwner for ParenExpr {} |
781 | impl ParenExpr { | 815 | impl ParenExpr { |
782 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 816 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
783 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 817 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
784 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 818 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
785 | } | 819 | } |
820 | |||
786 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 821 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
787 | pub struct PathExpr { | 822 | pub struct PathExpr { |
788 | pub(crate) syntax: SyntaxNode, | 823 | pub(crate) syntax: SyntaxNode, |
@@ -801,6 +836,7 @@ impl AstNode for PathExpr { | |||
801 | impl PathExpr { | 836 | impl PathExpr { |
802 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 837 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
803 | } | 838 | } |
839 | |||
804 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 840 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
805 | pub struct LambdaExpr { | 841 | pub struct LambdaExpr { |
806 | pub(crate) syntax: SyntaxNode, | 842 | pub(crate) syntax: SyntaxNode, |
@@ -818,13 +854,14 @@ impl AstNode for LambdaExpr { | |||
818 | } | 854 | } |
819 | impl ast::AttrsOwner for LambdaExpr {} | 855 | impl ast::AttrsOwner for LambdaExpr {} |
820 | impl LambdaExpr { | 856 | impl LambdaExpr { |
821 | pub fn static_kw_token(&self) -> Option<StaticKw> { support::token(&self.syntax) } | 857 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
822 | pub fn async_kw_token(&self) -> Option<AsyncKw> { support::token(&self.syntax) } | 858 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
823 | pub fn move_kw_token(&self) -> Option<MoveKw> { support::token(&self.syntax) } | 859 | pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) } |
824 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 860 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
825 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 861 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
826 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 862 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
827 | } | 863 | } |
864 | |||
828 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 865 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
829 | pub struct IfExpr { | 866 | pub struct IfExpr { |
830 | pub(crate) syntax: SyntaxNode, | 867 | pub(crate) syntax: SyntaxNode, |
@@ -842,9 +879,10 @@ impl AstNode for IfExpr { | |||
842 | } | 879 | } |
843 | impl ast::AttrsOwner for IfExpr {} | 880 | impl ast::AttrsOwner for IfExpr {} |
844 | impl IfExpr { | 881 | impl IfExpr { |
845 | pub fn if_kw_token(&self) -> Option<IfKw> { support::token(&self.syntax) } | 882 | pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } |
846 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } | 883 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } |
847 | } | 884 | } |
885 | |||
848 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 886 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
849 | pub struct LoopExpr { | 887 | pub struct LoopExpr { |
850 | pub(crate) syntax: SyntaxNode, | 888 | pub(crate) syntax: SyntaxNode, |
@@ -863,8 +901,9 @@ impl AstNode for LoopExpr { | |||
863 | impl ast::AttrsOwner for LoopExpr {} | 901 | impl ast::AttrsOwner for LoopExpr {} |
864 | impl ast::LoopBodyOwner for LoopExpr {} | 902 | impl ast::LoopBodyOwner for LoopExpr {} |
865 | impl LoopExpr { | 903 | impl LoopExpr { |
866 | pub fn loop_kw_token(&self) -> Option<LoopKw> { support::token(&self.syntax) } | 904 | pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) } |
867 | } | 905 | } |
906 | |||
868 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 907 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
869 | pub struct TryBlockExpr { | 908 | pub struct TryBlockExpr { |
870 | pub(crate) syntax: SyntaxNode, | 909 | pub(crate) syntax: SyntaxNode, |
@@ -882,9 +921,10 @@ impl AstNode for TryBlockExpr { | |||
882 | } | 921 | } |
883 | impl ast::AttrsOwner for TryBlockExpr {} | 922 | impl ast::AttrsOwner for TryBlockExpr {} |
884 | impl TryBlockExpr { | 923 | impl TryBlockExpr { |
885 | pub fn try_kw_token(&self) -> Option<TryKw> { support::token(&self.syntax) } | 924 | pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) } |
886 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | 925 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } |
887 | } | 926 | } |
927 | |||
888 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 928 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
889 | pub struct ForExpr { | 929 | pub struct ForExpr { |
890 | pub(crate) syntax: SyntaxNode, | 930 | pub(crate) syntax: SyntaxNode, |
@@ -903,11 +943,12 @@ impl AstNode for ForExpr { | |||
903 | impl ast::AttrsOwner for ForExpr {} | 943 | impl ast::AttrsOwner for ForExpr {} |
904 | impl ast::LoopBodyOwner for ForExpr {} | 944 | impl ast::LoopBodyOwner for ForExpr {} |
905 | impl ForExpr { | 945 | impl ForExpr { |
906 | pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) } | 946 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
907 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 947 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
908 | pub fn in_kw_token(&self) -> Option<InKw> { support::token(&self.syntax) } | 948 | pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) } |
909 | pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) } | 949 | pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) } |
910 | } | 950 | } |
951 | |||
911 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 952 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
912 | pub struct WhileExpr { | 953 | pub struct WhileExpr { |
913 | pub(crate) syntax: SyntaxNode, | 954 | pub(crate) syntax: SyntaxNode, |
@@ -926,9 +967,10 @@ impl AstNode for WhileExpr { | |||
926 | impl ast::AttrsOwner for WhileExpr {} | 967 | impl ast::AttrsOwner for WhileExpr {} |
927 | impl ast::LoopBodyOwner for WhileExpr {} | 968 | impl ast::LoopBodyOwner for WhileExpr {} |
928 | impl WhileExpr { | 969 | impl WhileExpr { |
929 | pub fn while_kw_token(&self) -> Option<WhileKw> { support::token(&self.syntax) } | 970 | pub fn while_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![while]) } |
930 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } | 971 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } |
931 | } | 972 | } |
973 | |||
932 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 974 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
933 | pub struct ContinueExpr { | 975 | pub struct ContinueExpr { |
934 | pub(crate) syntax: SyntaxNode, | 976 | pub(crate) syntax: SyntaxNode, |
@@ -946,9 +988,14 @@ impl AstNode for ContinueExpr { | |||
946 | } | 988 | } |
947 | impl ast::AttrsOwner for ContinueExpr {} | 989 | impl ast::AttrsOwner for ContinueExpr {} |
948 | impl ContinueExpr { | 990 | impl ContinueExpr { |
949 | pub fn continue_kw_token(&self) -> Option<ContinueKw> { support::token(&self.syntax) } | 991 | pub fn continue_token(&self) -> Option<SyntaxToken> { |
950 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 992 | support::token(&self.syntax, T![continue]) |
993 | } | ||
994 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | ||
995 | support::token(&self.syntax, T![lifetime]) | ||
996 | } | ||
951 | } | 997 | } |
998 | |||
952 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 999 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
953 | pub struct BreakExpr { | 1000 | pub struct BreakExpr { |
954 | pub(crate) syntax: SyntaxNode, | 1001 | pub(crate) syntax: SyntaxNode, |
@@ -966,10 +1013,13 @@ impl AstNode for BreakExpr { | |||
966 | } | 1013 | } |
967 | impl ast::AttrsOwner for BreakExpr {} | 1014 | impl ast::AttrsOwner for BreakExpr {} |
968 | impl BreakExpr { | 1015 | impl BreakExpr { |
969 | pub fn break_kw_token(&self) -> Option<BreakKw> { support::token(&self.syntax) } | 1016 | pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) } |
970 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 1017 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1018 | support::token(&self.syntax, T![lifetime]) | ||
1019 | } | ||
971 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1020 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
972 | } | 1021 | } |
1022 | |||
973 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1023 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
974 | pub struct Label { | 1024 | pub struct Label { |
975 | pub(crate) syntax: SyntaxNode, | 1025 | pub(crate) syntax: SyntaxNode, |
@@ -986,8 +1036,11 @@ impl AstNode for Label { | |||
986 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1036 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
987 | } | 1037 | } |
988 | impl Label { | 1038 | impl Label { |
989 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 1039 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1040 | support::token(&self.syntax, T![lifetime]) | ||
1041 | } | ||
990 | } | 1042 | } |
1043 | |||
991 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1044 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
992 | pub struct BlockExpr { | 1045 | pub struct BlockExpr { |
993 | pub(crate) syntax: SyntaxNode, | 1046 | pub(crate) syntax: SyntaxNode, |
@@ -1006,9 +1059,10 @@ impl AstNode for BlockExpr { | |||
1006 | impl ast::AttrsOwner for BlockExpr {} | 1059 | impl ast::AttrsOwner for BlockExpr {} |
1007 | impl BlockExpr { | 1060 | impl BlockExpr { |
1008 | pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } | 1061 | pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } |
1009 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 1062 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
1010 | pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } | 1063 | pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } |
1011 | } | 1064 | } |
1065 | |||
1012 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1066 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1013 | pub struct ReturnExpr { | 1067 | pub struct ReturnExpr { |
1014 | pub(crate) syntax: SyntaxNode, | 1068 | pub(crate) syntax: SyntaxNode, |
@@ -1028,6 +1082,7 @@ impl ast::AttrsOwner for ReturnExpr {} | |||
1028 | impl ReturnExpr { | 1082 | impl ReturnExpr { |
1029 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1083 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1030 | } | 1084 | } |
1085 | |||
1031 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1086 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1032 | pub struct CallExpr { | 1087 | pub struct CallExpr { |
1033 | pub(crate) syntax: SyntaxNode, | 1088 | pub(crate) syntax: SyntaxNode, |
@@ -1047,6 +1102,7 @@ impl ast::ArgListOwner for CallExpr {} | |||
1047 | impl CallExpr { | 1102 | impl CallExpr { |
1048 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1103 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1049 | } | 1104 | } |
1105 | |||
1050 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1106 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1051 | pub struct MethodCallExpr { | 1107 | pub struct MethodCallExpr { |
1052 | pub(crate) syntax: SyntaxNode, | 1108 | pub(crate) syntax: SyntaxNode, |
@@ -1066,10 +1122,11 @@ impl ast::AttrsOwner for MethodCallExpr {} | |||
1066 | impl ast::ArgListOwner for MethodCallExpr {} | 1122 | impl ast::ArgListOwner for MethodCallExpr {} |
1067 | impl MethodCallExpr { | 1123 | impl MethodCallExpr { |
1068 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1124 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1069 | pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } | 1125 | pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } |
1070 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1126 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1071 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } | 1127 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } |
1072 | } | 1128 | } |
1129 | |||
1073 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1130 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1074 | pub struct IndexExpr { | 1131 | pub struct IndexExpr { |
1075 | pub(crate) syntax: SyntaxNode, | 1132 | pub(crate) syntax: SyntaxNode, |
@@ -1087,9 +1144,10 @@ impl AstNode for IndexExpr { | |||
1087 | } | 1144 | } |
1088 | impl ast::AttrsOwner for IndexExpr {} | 1145 | impl ast::AttrsOwner for IndexExpr {} |
1089 | impl IndexExpr { | 1146 | impl IndexExpr { |
1090 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1147 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
1091 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1148 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
1092 | } | 1149 | } |
1150 | |||
1093 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1151 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1094 | pub struct FieldExpr { | 1152 | pub struct FieldExpr { |
1095 | pub(crate) syntax: SyntaxNode, | 1153 | pub(crate) syntax: SyntaxNode, |
@@ -1108,9 +1166,10 @@ impl AstNode for FieldExpr { | |||
1108 | impl ast::AttrsOwner for FieldExpr {} | 1166 | impl ast::AttrsOwner for FieldExpr {} |
1109 | impl FieldExpr { | 1167 | impl FieldExpr { |
1110 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1168 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1111 | pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } | 1169 | pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } |
1112 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1170 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1113 | } | 1171 | } |
1172 | |||
1114 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1173 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1115 | pub struct AwaitExpr { | 1174 | pub struct AwaitExpr { |
1116 | pub(crate) syntax: SyntaxNode, | 1175 | pub(crate) syntax: SyntaxNode, |
@@ -1129,9 +1188,10 @@ impl AstNode for AwaitExpr { | |||
1129 | impl ast::AttrsOwner for AwaitExpr {} | 1188 | impl ast::AttrsOwner for AwaitExpr {} |
1130 | impl AwaitExpr { | 1189 | impl AwaitExpr { |
1131 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1190 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1132 | pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } | 1191 | pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } |
1133 | pub fn await_kw_token(&self) -> Option<AwaitKw> { support::token(&self.syntax) } | 1192 | pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) } |
1134 | } | 1193 | } |
1194 | |||
1135 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1195 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1136 | pub struct TryExpr { | 1196 | pub struct TryExpr { |
1137 | pub(crate) syntax: SyntaxNode, | 1197 | pub(crate) syntax: SyntaxNode, |
@@ -1149,9 +1209,10 @@ impl AstNode for TryExpr { | |||
1149 | } | 1209 | } |
1150 | impl ast::AttrsOwner for TryExpr {} | 1210 | impl ast::AttrsOwner for TryExpr {} |
1151 | impl TryExpr { | 1211 | impl TryExpr { |
1152 | pub fn try_kw_token(&self) -> Option<TryKw> { support::token(&self.syntax) } | 1212 | pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) } |
1153 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1213 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1154 | } | 1214 | } |
1215 | |||
1155 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1216 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1156 | pub struct CastExpr { | 1217 | pub struct CastExpr { |
1157 | pub(crate) syntax: SyntaxNode, | 1218 | pub(crate) syntax: SyntaxNode, |
@@ -1170,9 +1231,10 @@ impl AstNode for CastExpr { | |||
1170 | impl ast::AttrsOwner for CastExpr {} | 1231 | impl ast::AttrsOwner for CastExpr {} |
1171 | impl CastExpr { | 1232 | impl CastExpr { |
1172 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1233 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1173 | pub fn as_kw_token(&self) -> Option<AsKw> { support::token(&self.syntax) } | 1234 | pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) } |
1174 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 1235 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
1175 | } | 1236 | } |
1237 | |||
1176 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1238 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1177 | pub struct RefExpr { | 1239 | pub struct RefExpr { |
1178 | pub(crate) syntax: SyntaxNode, | 1240 | pub(crate) syntax: SyntaxNode, |
@@ -1190,11 +1252,12 @@ impl AstNode for RefExpr { | |||
1190 | } | 1252 | } |
1191 | impl ast::AttrsOwner for RefExpr {} | 1253 | impl ast::AttrsOwner for RefExpr {} |
1192 | impl RefExpr { | 1254 | impl RefExpr { |
1193 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 1255 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
1194 | pub fn raw_kw_token(&self) -> Option<RawKw> { support::token(&self.syntax) } | 1256 | pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) } |
1195 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 1257 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1196 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1258 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1197 | } | 1259 | } |
1260 | |||
1198 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1261 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1199 | pub struct PrefixExpr { | 1262 | pub struct PrefixExpr { |
1200 | pub(crate) syntax: SyntaxNode, | 1263 | pub(crate) syntax: SyntaxNode, |
@@ -1212,9 +1275,9 @@ impl AstNode for PrefixExpr { | |||
1212 | } | 1275 | } |
1213 | impl ast::AttrsOwner for PrefixExpr {} | 1276 | impl ast::AttrsOwner for PrefixExpr {} |
1214 | impl PrefixExpr { | 1277 | impl PrefixExpr { |
1215 | pub fn prefix_op_token(&self) -> Option<PrefixOp> { support::token(&self.syntax) } | ||
1216 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1278 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1217 | } | 1279 | } |
1280 | |||
1218 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1281 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1219 | pub struct BoxExpr { | 1282 | pub struct BoxExpr { |
1220 | pub(crate) syntax: SyntaxNode, | 1283 | pub(crate) syntax: SyntaxNode, |
@@ -1232,9 +1295,10 @@ impl AstNode for BoxExpr { | |||
1232 | } | 1295 | } |
1233 | impl ast::AttrsOwner for BoxExpr {} | 1296 | impl ast::AttrsOwner for BoxExpr {} |
1234 | impl BoxExpr { | 1297 | impl BoxExpr { |
1235 | pub fn box_kw_token(&self) -> Option<BoxKw> { support::token(&self.syntax) } | 1298 | pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } |
1236 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1299 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1237 | } | 1300 | } |
1301 | |||
1238 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1302 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1239 | pub struct RangeExpr { | 1303 | pub struct RangeExpr { |
1240 | pub(crate) syntax: SyntaxNode, | 1304 | pub(crate) syntax: SyntaxNode, |
@@ -1251,9 +1315,8 @@ impl AstNode for RangeExpr { | |||
1251 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1315 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1252 | } | 1316 | } |
1253 | impl ast::AttrsOwner for RangeExpr {} | 1317 | impl ast::AttrsOwner for RangeExpr {} |
1254 | impl RangeExpr { | 1318 | impl RangeExpr {} |
1255 | pub fn range_op_token(&self) -> Option<RangeOp> { support::token(&self.syntax) } | 1319 | |
1256 | } | ||
1257 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1320 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1258 | pub struct BinExpr { | 1321 | pub struct BinExpr { |
1259 | pub(crate) syntax: SyntaxNode, | 1322 | pub(crate) syntax: SyntaxNode, |
@@ -1270,9 +1333,8 @@ impl AstNode for BinExpr { | |||
1270 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1333 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1271 | } | 1334 | } |
1272 | impl ast::AttrsOwner for BinExpr {} | 1335 | impl ast::AttrsOwner for BinExpr {} |
1273 | impl BinExpr { | 1336 | impl BinExpr {} |
1274 | pub fn bin_op_token(&self) -> Option<BinOp> { support::token(&self.syntax) } | 1337 | |
1275 | } | ||
1276 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1338 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1277 | pub struct Literal { | 1339 | pub struct Literal { |
1278 | pub(crate) syntax: SyntaxNode, | 1340 | pub(crate) syntax: SyntaxNode, |
@@ -1288,9 +1350,8 @@ impl AstNode for Literal { | |||
1288 | } | 1350 | } |
1289 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1351 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1290 | } | 1352 | } |
1291 | impl Literal { | 1353 | impl Literal {} |
1292 | pub fn literal_token_token(&self) -> Option<LiteralToken> { support::token(&self.syntax) } | 1354 | |
1293 | } | ||
1294 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1355 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1295 | pub struct MatchExpr { | 1356 | pub struct MatchExpr { |
1296 | pub(crate) syntax: SyntaxNode, | 1357 | pub(crate) syntax: SyntaxNode, |
@@ -1308,10 +1369,11 @@ impl AstNode for MatchExpr { | |||
1308 | } | 1369 | } |
1309 | impl ast::AttrsOwner for MatchExpr {} | 1370 | impl ast::AttrsOwner for MatchExpr {} |
1310 | impl MatchExpr { | 1371 | impl MatchExpr { |
1311 | pub fn match_kw_token(&self) -> Option<MatchKw> { support::token(&self.syntax) } | 1372 | pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) } |
1312 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1373 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1313 | pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) } | 1374 | pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) } |
1314 | } | 1375 | } |
1376 | |||
1315 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1377 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1316 | pub struct MatchArmList { | 1378 | pub struct MatchArmList { |
1317 | pub(crate) syntax: SyntaxNode, | 1379 | pub(crate) syntax: SyntaxNode, |
@@ -1329,10 +1391,11 @@ impl AstNode for MatchArmList { | |||
1329 | } | 1391 | } |
1330 | impl ast::AttrsOwner for MatchArmList {} | 1392 | impl ast::AttrsOwner for MatchArmList {} |
1331 | impl MatchArmList { | 1393 | impl MatchArmList { |
1332 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 1394 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
1333 | pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) } | 1395 | pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) } |
1334 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 1396 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1335 | } | 1397 | } |
1398 | |||
1336 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1399 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1337 | pub struct MatchArm { | 1400 | pub struct MatchArm { |
1338 | pub(crate) syntax: SyntaxNode, | 1401 | pub(crate) syntax: SyntaxNode, |
@@ -1352,9 +1415,10 @@ impl ast::AttrsOwner for MatchArm {} | |||
1352 | impl MatchArm { | 1415 | impl MatchArm { |
1353 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1416 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1354 | pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) } | 1417 | pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) } |
1355 | pub fn fat_arrow_token(&self) -> Option<FatArrow> { support::token(&self.syntax) } | 1418 | pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) } |
1356 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1419 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1357 | } | 1420 | } |
1421 | |||
1358 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1422 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1359 | pub struct MatchGuard { | 1423 | pub struct MatchGuard { |
1360 | pub(crate) syntax: SyntaxNode, | 1424 | pub(crate) syntax: SyntaxNode, |
@@ -1371,9 +1435,10 @@ impl AstNode for MatchGuard { | |||
1371 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1435 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1372 | } | 1436 | } |
1373 | impl MatchGuard { | 1437 | impl MatchGuard { |
1374 | pub fn if_kw_token(&self) -> Option<IfKw> { support::token(&self.syntax) } | 1438 | pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } |
1375 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1439 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1376 | } | 1440 | } |
1441 | |||
1377 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1442 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1378 | pub struct RecordLit { | 1443 | pub struct RecordLit { |
1379 | pub(crate) syntax: SyntaxNode, | 1444 | pub(crate) syntax: SyntaxNode, |
@@ -1393,6 +1458,7 @@ impl RecordLit { | |||
1393 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1458 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1394 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } | 1459 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } |
1395 | } | 1460 | } |
1461 | |||
1396 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1462 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1397 | pub struct RecordFieldList { | 1463 | pub struct RecordFieldList { |
1398 | pub(crate) syntax: SyntaxNode, | 1464 | pub(crate) syntax: SyntaxNode, |
@@ -1409,12 +1475,13 @@ impl AstNode for RecordFieldList { | |||
1409 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1475 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1410 | } | 1476 | } |
1411 | impl RecordFieldList { | 1477 | impl RecordFieldList { |
1412 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 1478 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
1413 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } | 1479 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } |
1414 | pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) } | 1480 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
1415 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } | 1481 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } |
1416 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 1482 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1417 | } | 1483 | } |
1484 | |||
1418 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1485 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1419 | pub struct RecordField { | 1486 | pub struct RecordField { |
1420 | pub(crate) syntax: SyntaxNode, | 1487 | pub(crate) syntax: SyntaxNode, |
@@ -1433,9 +1500,10 @@ impl AstNode for RecordField { | |||
1433 | impl ast::AttrsOwner for RecordField {} | 1500 | impl ast::AttrsOwner for RecordField {} |
1434 | impl RecordField { | 1501 | impl RecordField { |
1435 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1502 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1436 | pub fn colon_token(&self) -> Option<Colon> { support::token(&self.syntax) } | 1503 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
1437 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1504 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1438 | } | 1505 | } |
1506 | |||
1439 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1507 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1440 | pub struct OrPat { | 1508 | pub struct OrPat { |
1441 | pub(crate) syntax: SyntaxNode, | 1509 | pub(crate) syntax: SyntaxNode, |
@@ -1454,6 +1522,7 @@ impl AstNode for OrPat { | |||
1454 | impl OrPat { | 1522 | impl OrPat { |
1455 | pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1523 | pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1456 | } | 1524 | } |
1525 | |||
1457 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1526 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1458 | pub struct ParenPat { | 1527 | pub struct ParenPat { |
1459 | pub(crate) syntax: SyntaxNode, | 1528 | pub(crate) syntax: SyntaxNode, |
@@ -1470,10 +1539,11 @@ impl AstNode for ParenPat { | |||
1470 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1539 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1471 | } | 1540 | } |
1472 | impl ParenPat { | 1541 | impl ParenPat { |
1473 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1542 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
1474 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1543 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1475 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1544 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1476 | } | 1545 | } |
1546 | |||
1477 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1547 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1478 | pub struct RefPat { | 1548 | pub struct RefPat { |
1479 | pub(crate) syntax: SyntaxNode, | 1549 | pub(crate) syntax: SyntaxNode, |
@@ -1490,10 +1560,11 @@ impl AstNode for RefPat { | |||
1490 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1560 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1491 | } | 1561 | } |
1492 | impl RefPat { | 1562 | impl RefPat { |
1493 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 1563 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
1494 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 1564 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1495 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1565 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1496 | } | 1566 | } |
1567 | |||
1497 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1568 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1498 | pub struct BoxPat { | 1569 | pub struct BoxPat { |
1499 | pub(crate) syntax: SyntaxNode, | 1570 | pub(crate) syntax: SyntaxNode, |
@@ -1510,9 +1581,10 @@ impl AstNode for BoxPat { | |||
1510 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1581 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1511 | } | 1582 | } |
1512 | impl BoxPat { | 1583 | impl BoxPat { |
1513 | pub fn box_kw_token(&self) -> Option<BoxKw> { support::token(&self.syntax) } | 1584 | pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } |
1514 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1585 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1515 | } | 1586 | } |
1587 | |||
1516 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1588 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1517 | pub struct BindPat { | 1589 | pub struct BindPat { |
1518 | pub(crate) syntax: SyntaxNode, | 1590 | pub(crate) syntax: SyntaxNode, |
@@ -1531,11 +1603,12 @@ impl AstNode for BindPat { | |||
1531 | impl ast::AttrsOwner for BindPat {} | 1603 | impl ast::AttrsOwner for BindPat {} |
1532 | impl ast::NameOwner for BindPat {} | 1604 | impl ast::NameOwner for BindPat {} |
1533 | impl BindPat { | 1605 | impl BindPat { |
1534 | pub fn ref_kw_token(&self) -> Option<RefKw> { support::token(&self.syntax) } | 1606 | pub fn ref_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ref]) } |
1535 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 1607 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1536 | pub fn at_token(&self) -> Option<At> { support::token(&self.syntax) } | 1608 | pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![@]) } |
1537 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1609 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1538 | } | 1610 | } |
1611 | |||
1539 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1612 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1540 | pub struct PlaceholderPat { | 1613 | pub struct PlaceholderPat { |
1541 | pub(crate) syntax: SyntaxNode, | 1614 | pub(crate) syntax: SyntaxNode, |
@@ -1552,8 +1625,9 @@ impl AstNode for PlaceholderPat { | |||
1552 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1625 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1553 | } | 1626 | } |
1554 | impl PlaceholderPat { | 1627 | impl PlaceholderPat { |
1555 | pub fn underscore_token(&self) -> Option<Underscore> { support::token(&self.syntax) } | 1628 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } |
1556 | } | 1629 | } |
1630 | |||
1557 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1631 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1558 | pub struct DotDotPat { | 1632 | pub struct DotDotPat { |
1559 | pub(crate) syntax: SyntaxNode, | 1633 | pub(crate) syntax: SyntaxNode, |
@@ -1570,8 +1644,9 @@ impl AstNode for DotDotPat { | |||
1570 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1644 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1571 | } | 1645 | } |
1572 | impl DotDotPat { | 1646 | impl DotDotPat { |
1573 | pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) } | 1647 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
1574 | } | 1648 | } |
1649 | |||
1575 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1650 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1576 | pub struct PathPat { | 1651 | pub struct PathPat { |
1577 | pub(crate) syntax: SyntaxNode, | 1652 | pub(crate) syntax: SyntaxNode, |
@@ -1590,6 +1665,7 @@ impl AstNode for PathPat { | |||
1590 | impl PathPat { | 1665 | impl PathPat { |
1591 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1666 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1592 | } | 1667 | } |
1668 | |||
1593 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1669 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1594 | pub struct SlicePat { | 1670 | pub struct SlicePat { |
1595 | pub(crate) syntax: SyntaxNode, | 1671 | pub(crate) syntax: SyntaxNode, |
@@ -1606,10 +1682,11 @@ impl AstNode for SlicePat { | |||
1606 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1682 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1607 | } | 1683 | } |
1608 | impl SlicePat { | 1684 | impl SlicePat { |
1609 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1685 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
1610 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1686 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1611 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1687 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
1612 | } | 1688 | } |
1689 | |||
1613 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1690 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1614 | pub struct RangePat { | 1691 | pub struct RangePat { |
1615 | pub(crate) syntax: SyntaxNode, | 1692 | pub(crate) syntax: SyntaxNode, |
@@ -1625,9 +1702,8 @@ impl AstNode for RangePat { | |||
1625 | } | 1702 | } |
1626 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1703 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1627 | } | 1704 | } |
1628 | impl RangePat { | 1705 | impl RangePat {} |
1629 | pub fn range_separator_token(&self) -> Option<RangeSeparator> { support::token(&self.syntax) } | 1706 | |
1630 | } | ||
1631 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1707 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1632 | pub struct LiteralPat { | 1708 | pub struct LiteralPat { |
1633 | pub(crate) syntax: SyntaxNode, | 1709 | pub(crate) syntax: SyntaxNode, |
@@ -1646,6 +1722,7 @@ impl AstNode for LiteralPat { | |||
1646 | impl LiteralPat { | 1722 | impl LiteralPat { |
1647 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } | 1723 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } |
1648 | } | 1724 | } |
1725 | |||
1649 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1726 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1650 | pub struct MacroPat { | 1727 | pub struct MacroPat { |
1651 | pub(crate) syntax: SyntaxNode, | 1728 | pub(crate) syntax: SyntaxNode, |
@@ -1664,6 +1741,7 @@ impl AstNode for MacroPat { | |||
1664 | impl MacroPat { | 1741 | impl MacroPat { |
1665 | pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) } | 1742 | pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) } |
1666 | } | 1743 | } |
1744 | |||
1667 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1745 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1668 | pub struct RecordPat { | 1746 | pub struct RecordPat { |
1669 | pub(crate) syntax: SyntaxNode, | 1747 | pub(crate) syntax: SyntaxNode, |
@@ -1685,6 +1763,7 @@ impl RecordPat { | |||
1685 | } | 1763 | } |
1686 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1764 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1687 | } | 1765 | } |
1766 | |||
1688 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1767 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1689 | pub struct RecordFieldPatList { | 1768 | pub struct RecordFieldPatList { |
1690 | pub(crate) syntax: SyntaxNode, | 1769 | pub(crate) syntax: SyntaxNode, |
@@ -1701,15 +1780,16 @@ impl AstNode for RecordFieldPatList { | |||
1701 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1780 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1702 | } | 1781 | } |
1703 | impl RecordFieldPatList { | 1782 | impl RecordFieldPatList { |
1704 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 1783 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
1705 | pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) } | 1784 | pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) } |
1706 | pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> { | 1785 | pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> { |
1707 | support::children(&self.syntax) | 1786 | support::children(&self.syntax) |
1708 | } | 1787 | } |
1709 | pub fn bind_pats(&self) -> AstChildren<BindPat> { support::children(&self.syntax) } | 1788 | pub fn bind_pats(&self) -> AstChildren<BindPat> { support::children(&self.syntax) } |
1710 | pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) } | 1789 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
1711 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 1790 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1712 | } | 1791 | } |
1792 | |||
1713 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1793 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1714 | pub struct RecordFieldPat { | 1794 | pub struct RecordFieldPat { |
1715 | pub(crate) syntax: SyntaxNode, | 1795 | pub(crate) syntax: SyntaxNode, |
@@ -1728,9 +1808,10 @@ impl AstNode for RecordFieldPat { | |||
1728 | impl ast::AttrsOwner for RecordFieldPat {} | 1808 | impl ast::AttrsOwner for RecordFieldPat {} |
1729 | impl ast::NameOwner for RecordFieldPat {} | 1809 | impl ast::NameOwner for RecordFieldPat {} |
1730 | impl RecordFieldPat { | 1810 | impl RecordFieldPat { |
1731 | pub fn colon_token(&self) -> Option<Colon> { support::token(&self.syntax) } | 1811 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
1732 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1812 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1733 | } | 1813 | } |
1814 | |||
1734 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1815 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1735 | pub struct TupleStructPat { | 1816 | pub struct TupleStructPat { |
1736 | pub(crate) syntax: SyntaxNode, | 1817 | pub(crate) syntax: SyntaxNode, |
@@ -1748,10 +1829,11 @@ impl AstNode for TupleStructPat { | |||
1748 | } | 1829 | } |
1749 | impl TupleStructPat { | 1830 | impl TupleStructPat { |
1750 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1831 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1751 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1832 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
1752 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1833 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1753 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1834 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1754 | } | 1835 | } |
1836 | |||
1755 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1837 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1756 | pub struct TuplePat { | 1838 | pub struct TuplePat { |
1757 | pub(crate) syntax: SyntaxNode, | 1839 | pub(crate) syntax: SyntaxNode, |
@@ -1768,10 +1850,11 @@ impl AstNode for TuplePat { | |||
1768 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1850 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1769 | } | 1851 | } |
1770 | impl TuplePat { | 1852 | impl TuplePat { |
1771 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1853 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
1772 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1854 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1773 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1855 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1774 | } | 1856 | } |
1857 | |||
1775 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1858 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1776 | pub struct Visibility { | 1859 | pub struct Visibility { |
1777 | pub(crate) syntax: SyntaxNode, | 1860 | pub(crate) syntax: SyntaxNode, |
@@ -1788,11 +1871,12 @@ impl AstNode for Visibility { | |||
1788 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1871 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1789 | } | 1872 | } |
1790 | impl Visibility { | 1873 | impl Visibility { |
1791 | pub fn pub_kw_token(&self) -> Option<PubKw> { support::token(&self.syntax) } | 1874 | pub fn pub_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pub]) } |
1792 | pub fn super_kw_token(&self) -> Option<SuperKw> { support::token(&self.syntax) } | 1875 | pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) } |
1793 | pub fn self_kw_token(&self) -> Option<SelfKw> { support::token(&self.syntax) } | 1876 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } |
1794 | pub fn crate_kw_token(&self) -> Option<CrateKw> { support::token(&self.syntax) } | 1877 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } |
1795 | } | 1878 | } |
1879 | |||
1796 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1880 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1797 | pub struct Name { | 1881 | pub struct Name { |
1798 | pub(crate) syntax: SyntaxNode, | 1882 | pub(crate) syntax: SyntaxNode, |
@@ -1809,8 +1893,9 @@ impl AstNode for Name { | |||
1809 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1893 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1810 | } | 1894 | } |
1811 | impl Name { | 1895 | impl Name { |
1812 | pub fn ident_token(&self) -> Option<Ident> { support::token(&self.syntax) } | 1896 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } |
1813 | } | 1897 | } |
1898 | |||
1814 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1899 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1815 | pub struct NameRef { | 1900 | pub struct NameRef { |
1816 | pub(crate) syntax: SyntaxNode, | 1901 | pub(crate) syntax: SyntaxNode, |
@@ -1826,9 +1911,8 @@ impl AstNode for NameRef { | |||
1826 | } | 1911 | } |
1827 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1912 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1828 | } | 1913 | } |
1829 | impl NameRef { | 1914 | impl NameRef {} |
1830 | pub fn name_ref_token_token(&self) -> Option<NameRefToken> { support::token(&self.syntax) } | 1915 | |
1831 | } | ||
1832 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1916 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1833 | pub struct MacroCall { | 1917 | pub struct MacroCall { |
1834 | pub(crate) syntax: SyntaxNode, | 1918 | pub(crate) syntax: SyntaxNode, |
@@ -1849,10 +1933,11 @@ impl ast::AttrsOwner for MacroCall {} | |||
1849 | impl ast::DocCommentsOwner for MacroCall {} | 1933 | impl ast::DocCommentsOwner for MacroCall {} |
1850 | impl MacroCall { | 1934 | impl MacroCall { |
1851 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1935 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1852 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 1936 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
1853 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } | 1937 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } |
1854 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 1938 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
1855 | } | 1939 | } |
1940 | |||
1856 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1941 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1857 | pub struct Attr { | 1942 | pub struct Attr { |
1858 | pub(crate) syntax: SyntaxNode, | 1943 | pub(crate) syntax: SyntaxNode, |
@@ -1869,14 +1954,15 @@ impl AstNode for Attr { | |||
1869 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1954 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1870 | } | 1955 | } |
1871 | impl Attr { | 1956 | impl Attr { |
1872 | pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) } | 1957 | pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) } |
1873 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 1958 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
1874 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1959 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
1875 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1960 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1876 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 1961 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1877 | pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } | 1962 | pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } |
1878 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1963 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
1879 | } | 1964 | } |
1965 | |||
1880 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1966 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1881 | pub struct TokenTree { | 1967 | pub struct TokenTree { |
1882 | pub(crate) syntax: SyntaxNode, | 1968 | pub(crate) syntax: SyntaxNode, |
@@ -1893,6 +1979,7 @@ impl AstNode for TokenTree { | |||
1893 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1979 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1894 | } | 1980 | } |
1895 | impl TokenTree {} | 1981 | impl TokenTree {} |
1982 | |||
1896 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1983 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1897 | pub struct TypeParamList { | 1984 | pub struct TypeParamList { |
1898 | pub(crate) syntax: SyntaxNode, | 1985 | pub(crate) syntax: SyntaxNode, |
@@ -1909,13 +1996,14 @@ impl AstNode for TypeParamList { | |||
1909 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1996 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1910 | } | 1997 | } |
1911 | impl TypeParamList { | 1998 | impl TypeParamList { |
1912 | pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) } | 1999 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
1913 | pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) } | 2000 | pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) } |
1914 | pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } | 2001 | pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } |
1915 | pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } | 2002 | pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } |
1916 | pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) } | 2003 | pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) } |
1917 | pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) } | 2004 | pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } |
1918 | } | 2005 | } |
2006 | |||
1919 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2007 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1920 | pub struct TypeParam { | 2008 | pub struct TypeParam { |
1921 | pub(crate) syntax: SyntaxNode, | 2009 | pub(crate) syntax: SyntaxNode, |
@@ -1935,9 +2023,10 @@ impl ast::NameOwner for TypeParam {} | |||
1935 | impl ast::AttrsOwner for TypeParam {} | 2023 | impl ast::AttrsOwner for TypeParam {} |
1936 | impl ast::TypeBoundsOwner for TypeParam {} | 2024 | impl ast::TypeBoundsOwner for TypeParam {} |
1937 | impl TypeParam { | 2025 | impl TypeParam { |
1938 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2026 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1939 | pub fn default_type(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2027 | pub fn default_type(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
1940 | } | 2028 | } |
2029 | |||
1941 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2030 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1942 | pub struct ConstParam { | 2031 | pub struct ConstParam { |
1943 | pub(crate) syntax: SyntaxNode, | 2032 | pub(crate) syntax: SyntaxNode, |
@@ -1957,9 +2046,10 @@ impl ast::NameOwner for ConstParam {} | |||
1957 | impl ast::AttrsOwner for ConstParam {} | 2046 | impl ast::AttrsOwner for ConstParam {} |
1958 | impl ast::TypeAscriptionOwner for ConstParam {} | 2047 | impl ast::TypeAscriptionOwner for ConstParam {} |
1959 | impl ConstParam { | 2048 | impl ConstParam { |
1960 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2049 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1961 | pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) } | 2050 | pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) } |
1962 | } | 2051 | } |
2052 | |||
1963 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2053 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1964 | pub struct LifetimeParam { | 2054 | pub struct LifetimeParam { |
1965 | pub(crate) syntax: SyntaxNode, | 2055 | pub(crate) syntax: SyntaxNode, |
@@ -1977,8 +2067,11 @@ impl AstNode for LifetimeParam { | |||
1977 | } | 2067 | } |
1978 | impl ast::AttrsOwner for LifetimeParam {} | 2068 | impl ast::AttrsOwner for LifetimeParam {} |
1979 | impl LifetimeParam { | 2069 | impl LifetimeParam { |
1980 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2070 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2071 | support::token(&self.syntax, T![lifetime]) | ||
2072 | } | ||
1981 | } | 2073 | } |
2074 | |||
1982 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2075 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1983 | pub struct TypeBound { | 2076 | pub struct TypeBound { |
1984 | pub(crate) syntax: SyntaxNode, | 2077 | pub(crate) syntax: SyntaxNode, |
@@ -1995,10 +2088,13 @@ impl AstNode for TypeBound { | |||
1995 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2088 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1996 | } | 2089 | } |
1997 | impl TypeBound { | 2090 | impl TypeBound { |
1998 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2091 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1999 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 2092 | support::token(&self.syntax, T![lifetime]) |
2093 | } | ||
2094 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
2000 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2095 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2001 | } | 2096 | } |
2097 | |||
2002 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2098 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2003 | pub struct TypeBoundList { | 2099 | pub struct TypeBoundList { |
2004 | pub(crate) syntax: SyntaxNode, | 2100 | pub(crate) syntax: SyntaxNode, |
@@ -2017,6 +2113,7 @@ impl AstNode for TypeBoundList { | |||
2017 | impl TypeBoundList { | 2113 | impl TypeBoundList { |
2018 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | 2114 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } |
2019 | } | 2115 | } |
2116 | |||
2020 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2117 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2021 | pub struct WherePred { | 2118 | pub struct WherePred { |
2022 | pub(crate) syntax: SyntaxNode, | 2119 | pub(crate) syntax: SyntaxNode, |
@@ -2034,9 +2131,12 @@ impl AstNode for WherePred { | |||
2034 | } | 2131 | } |
2035 | impl ast::TypeBoundsOwner for WherePred {} | 2132 | impl ast::TypeBoundsOwner for WherePred {} |
2036 | impl WherePred { | 2133 | impl WherePred { |
2037 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2134 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2135 | support::token(&self.syntax, T![lifetime]) | ||
2136 | } | ||
2038 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2137 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2039 | } | 2138 | } |
2139 | |||
2040 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2140 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2041 | pub struct WhereClause { | 2141 | pub struct WhereClause { |
2042 | pub(crate) syntax: SyntaxNode, | 2142 | pub(crate) syntax: SyntaxNode, |
@@ -2053,9 +2153,10 @@ impl AstNode for WhereClause { | |||
2053 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2153 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2054 | } | 2154 | } |
2055 | impl WhereClause { | 2155 | impl WhereClause { |
2056 | pub fn where_kw_token(&self) -> Option<WhereKw> { support::token(&self.syntax) } | 2156 | pub fn where_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![where]) } |
2057 | pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) } | 2157 | pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) } |
2058 | } | 2158 | } |
2159 | |||
2059 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2160 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2060 | pub struct Abi { | 2161 | pub struct Abi { |
2061 | pub(crate) syntax: SyntaxNode, | 2162 | pub(crate) syntax: SyntaxNode, |
@@ -2071,9 +2172,8 @@ impl AstNode for Abi { | |||
2071 | } | 2172 | } |
2072 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2173 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2073 | } | 2174 | } |
2074 | impl Abi { | 2175 | impl Abi {} |
2075 | pub fn string_token(&self) -> Option<String> { support::token(&self.syntax) } | 2176 | |
2076 | } | ||
2077 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2177 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2078 | pub struct ExprStmt { | 2178 | pub struct ExprStmt { |
2079 | pub(crate) syntax: SyntaxNode, | 2179 | pub(crate) syntax: SyntaxNode, |
@@ -2092,8 +2192,9 @@ impl AstNode for ExprStmt { | |||
2092 | impl ast::AttrsOwner for ExprStmt {} | 2192 | impl ast::AttrsOwner for ExprStmt {} |
2093 | impl ExprStmt { | 2193 | impl ExprStmt { |
2094 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2194 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2095 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 2195 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
2096 | } | 2196 | } |
2197 | |||
2097 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2198 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2098 | pub struct LetStmt { | 2199 | pub struct LetStmt { |
2099 | pub(crate) syntax: SyntaxNode, | 2200 | pub(crate) syntax: SyntaxNode, |
@@ -2112,12 +2213,13 @@ impl AstNode for LetStmt { | |||
2112 | impl ast::AttrsOwner for LetStmt {} | 2213 | impl ast::AttrsOwner for LetStmt {} |
2113 | impl ast::TypeAscriptionOwner for LetStmt {} | 2214 | impl ast::TypeAscriptionOwner for LetStmt {} |
2114 | impl LetStmt { | 2215 | impl LetStmt { |
2115 | pub fn let_kw_token(&self) -> Option<LetKw> { support::token(&self.syntax) } | 2216 | pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } |
2116 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 2217 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
2117 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2218 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2118 | pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } | 2219 | pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } |
2119 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 2220 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
2120 | } | 2221 | } |
2222 | |||
2121 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2223 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2122 | pub struct Condition { | 2224 | pub struct Condition { |
2123 | pub(crate) syntax: SyntaxNode, | 2225 | pub(crate) syntax: SyntaxNode, |
@@ -2134,11 +2236,12 @@ impl AstNode for Condition { | |||
2134 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2236 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2135 | } | 2237 | } |
2136 | impl Condition { | 2238 | impl Condition { |
2137 | pub fn let_kw_token(&self) -> Option<LetKw> { support::token(&self.syntax) } | 2239 | pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } |
2138 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 2240 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
2139 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2241 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2140 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2242 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2141 | } | 2243 | } |
2244 | |||
2142 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2245 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2143 | pub struct Block { | 2246 | pub struct Block { |
2144 | pub(crate) syntax: SyntaxNode, | 2247 | pub(crate) syntax: SyntaxNode, |
@@ -2157,11 +2260,12 @@ impl AstNode for Block { | |||
2157 | impl ast::AttrsOwner for Block {} | 2260 | impl ast::AttrsOwner for Block {} |
2158 | impl ast::ModuleItemOwner for Block {} | 2261 | impl ast::ModuleItemOwner for Block {} |
2159 | impl Block { | 2262 | impl Block { |
2160 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 2263 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
2161 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } | 2264 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } |
2162 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2265 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2163 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 2266 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
2164 | } | 2267 | } |
2268 | |||
2165 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2269 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2166 | pub struct ParamList { | 2270 | pub struct ParamList { |
2167 | pub(crate) syntax: SyntaxNode, | 2271 | pub(crate) syntax: SyntaxNode, |
@@ -2178,11 +2282,12 @@ impl AstNode for ParamList { | |||
2178 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2282 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2179 | } | 2283 | } |
2180 | impl ParamList { | 2284 | impl ParamList { |
2181 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 2285 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
2182 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | 2286 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } |
2183 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } | 2287 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } |
2184 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 2288 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
2185 | } | 2289 | } |
2290 | |||
2186 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2291 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2187 | pub struct SelfParam { | 2292 | pub struct SelfParam { |
2188 | pub(crate) syntax: SyntaxNode, | 2293 | pub(crate) syntax: SyntaxNode, |
@@ -2201,10 +2306,14 @@ impl AstNode for SelfParam { | |||
2201 | impl ast::TypeAscriptionOwner for SelfParam {} | 2306 | impl ast::TypeAscriptionOwner for SelfParam {} |
2202 | impl ast::AttrsOwner for SelfParam {} | 2307 | impl ast::AttrsOwner for SelfParam {} |
2203 | impl SelfParam { | 2308 | impl SelfParam { |
2204 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 2309 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
2205 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2310 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
2206 | pub fn self_kw_token(&self) -> Option<SelfKw> { support::token(&self.syntax) } | 2311 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2312 | support::token(&self.syntax, T![lifetime]) | ||
2313 | } | ||
2314 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
2207 | } | 2315 | } |
2316 | |||
2208 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2317 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2209 | pub struct Param { | 2318 | pub struct Param { |
2210 | pub(crate) syntax: SyntaxNode, | 2319 | pub(crate) syntax: SyntaxNode, |
@@ -2224,8 +2333,9 @@ impl ast::TypeAscriptionOwner for Param {} | |||
2224 | impl ast::AttrsOwner for Param {} | 2333 | impl ast::AttrsOwner for Param {} |
2225 | impl Param { | 2334 | impl Param { |
2226 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 2335 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
2227 | pub fn dotdotdot_token(&self) -> Option<Dotdotdot> { support::token(&self.syntax) } | 2336 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } |
2228 | } | 2337 | } |
2338 | |||
2229 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2339 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2230 | pub struct UseItem { | 2340 | pub struct UseItem { |
2231 | pub(crate) syntax: SyntaxNode, | 2341 | pub(crate) syntax: SyntaxNode, |
@@ -2244,9 +2354,10 @@ impl AstNode for UseItem { | |||
2244 | impl ast::AttrsOwner for UseItem {} | 2354 | impl ast::AttrsOwner for UseItem {} |
2245 | impl ast::VisibilityOwner for UseItem {} | 2355 | impl ast::VisibilityOwner for UseItem {} |
2246 | impl UseItem { | 2356 | impl UseItem { |
2247 | pub fn use_kw_token(&self) -> Option<UseKw> { support::token(&self.syntax) } | 2357 | pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) } |
2248 | pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) } | 2358 | pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) } |
2249 | } | 2359 | } |
2360 | |||
2250 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2361 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2251 | pub struct UseTree { | 2362 | pub struct UseTree { |
2252 | pub(crate) syntax: SyntaxNode, | 2363 | pub(crate) syntax: SyntaxNode, |
@@ -2264,10 +2375,11 @@ impl AstNode for UseTree { | |||
2264 | } | 2375 | } |
2265 | impl UseTree { | 2376 | impl UseTree { |
2266 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 2377 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
2267 | pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) } | 2378 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } |
2268 | pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) } | 2379 | pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) } |
2269 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } | 2380 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } |
2270 | } | 2381 | } |
2382 | |||
2271 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2383 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2272 | pub struct Alias { | 2384 | pub struct Alias { |
2273 | pub(crate) syntax: SyntaxNode, | 2385 | pub(crate) syntax: SyntaxNode, |
@@ -2285,8 +2397,9 @@ impl AstNode for Alias { | |||
2285 | } | 2397 | } |
2286 | impl ast::NameOwner for Alias {} | 2398 | impl ast::NameOwner for Alias {} |
2287 | impl Alias { | 2399 | impl Alias { |
2288 | pub fn as_kw_token(&self) -> Option<AsKw> { support::token(&self.syntax) } | 2400 | pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) } |
2289 | } | 2401 | } |
2402 | |||
2290 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2403 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2291 | pub struct UseTreeList { | 2404 | pub struct UseTreeList { |
2292 | pub(crate) syntax: SyntaxNode, | 2405 | pub(crate) syntax: SyntaxNode, |
@@ -2303,10 +2416,11 @@ impl AstNode for UseTreeList { | |||
2303 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2416 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2304 | } | 2417 | } |
2305 | impl UseTreeList { | 2418 | impl UseTreeList { |
2306 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 2419 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
2307 | pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) } | 2420 | pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) } |
2308 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 2421 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
2309 | } | 2422 | } |
2423 | |||
2310 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2424 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2311 | pub struct ExternCrateItem { | 2425 | pub struct ExternCrateItem { |
2312 | pub(crate) syntax: SyntaxNode, | 2426 | pub(crate) syntax: SyntaxNode, |
@@ -2325,11 +2439,12 @@ impl AstNode for ExternCrateItem { | |||
2325 | impl ast::AttrsOwner for ExternCrateItem {} | 2439 | impl ast::AttrsOwner for ExternCrateItem {} |
2326 | impl ast::VisibilityOwner for ExternCrateItem {} | 2440 | impl ast::VisibilityOwner for ExternCrateItem {} |
2327 | impl ExternCrateItem { | 2441 | impl ExternCrateItem { |
2328 | pub fn extern_kw_token(&self) -> Option<ExternKw> { support::token(&self.syntax) } | 2442 | pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) } |
2329 | pub fn crate_kw_token(&self) -> Option<CrateKw> { support::token(&self.syntax) } | 2443 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } |
2330 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 2444 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
2331 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } | 2445 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } |
2332 | } | 2446 | } |
2447 | |||
2333 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2448 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2334 | pub struct ArgList { | 2449 | pub struct ArgList { |
2335 | pub(crate) syntax: SyntaxNode, | 2450 | pub(crate) syntax: SyntaxNode, |
@@ -2346,10 +2461,11 @@ impl AstNode for ArgList { | |||
2346 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2461 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2347 | } | 2462 | } |
2348 | impl ArgList { | 2463 | impl ArgList { |
2349 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 2464 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
2350 | pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 2465 | pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
2351 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 2466 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
2352 | } | 2467 | } |
2468 | |||
2353 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2469 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2354 | pub struct Path { | 2470 | pub struct Path { |
2355 | pub(crate) syntax: SyntaxNode, | 2471 | pub(crate) syntax: SyntaxNode, |
@@ -2369,6 +2485,7 @@ impl Path { | |||
2369 | pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) } | 2485 | pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) } |
2370 | pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) } | 2486 | pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) } |
2371 | } | 2487 | } |
2488 | |||
2372 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2489 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2373 | pub struct PathSegment { | 2490 | pub struct PathSegment { |
2374 | pub(crate) syntax: SyntaxNode, | 2491 | pub(crate) syntax: SyntaxNode, |
@@ -2385,15 +2502,16 @@ impl AstNode for PathSegment { | |||
2385 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2502 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2386 | } | 2503 | } |
2387 | impl PathSegment { | 2504 | impl PathSegment { |
2388 | pub fn coloncolon_token(&self) -> Option<Coloncolon> { support::token(&self.syntax) } | 2505 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
2389 | pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) } | 2506 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
2390 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 2507 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
2391 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } | 2508 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } |
2392 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 2509 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
2393 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 2510 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
2394 | pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) } | 2511 | pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) } |
2395 | pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) } | 2512 | pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } |
2396 | } | 2513 | } |
2514 | |||
2397 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2515 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2398 | pub struct TypeArgList { | 2516 | pub struct TypeArgList { |
2399 | pub(crate) syntax: SyntaxNode, | 2517 | pub(crate) syntax: SyntaxNode, |
@@ -2410,15 +2528,16 @@ impl AstNode for TypeArgList { | |||
2410 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2528 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2411 | } | 2529 | } |
2412 | impl TypeArgList { | 2530 | impl TypeArgList { |
2413 | pub fn coloncolon_token(&self) -> Option<Coloncolon> { support::token(&self.syntax) } | 2531 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
2414 | pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) } | 2532 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
2415 | pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) } | 2533 | pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) } |
2416 | pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) } | 2534 | pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) } |
2417 | pub fn lifetime_args(&self) -> AstChildren<LifetimeArg> { support::children(&self.syntax) } | 2535 | pub fn lifetime_args(&self) -> AstChildren<LifetimeArg> { support::children(&self.syntax) } |
2418 | pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { support::children(&self.syntax) } | 2536 | pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { support::children(&self.syntax) } |
2419 | pub fn const_args(&self) -> AstChildren<ConstArg> { support::children(&self.syntax) } | 2537 | pub fn const_args(&self) -> AstChildren<ConstArg> { support::children(&self.syntax) } |
2420 | pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) } | 2538 | pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } |
2421 | } | 2539 | } |
2540 | |||
2422 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2541 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2423 | pub struct TypeArg { | 2542 | pub struct TypeArg { |
2424 | pub(crate) syntax: SyntaxNode, | 2543 | pub(crate) syntax: SyntaxNode, |
@@ -2437,6 +2556,7 @@ impl AstNode for TypeArg { | |||
2437 | impl TypeArg { | 2556 | impl TypeArg { |
2438 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2557 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2439 | } | 2558 | } |
2559 | |||
2440 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2560 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2441 | pub struct AssocTypeArg { | 2561 | pub struct AssocTypeArg { |
2442 | pub(crate) syntax: SyntaxNode, | 2562 | pub(crate) syntax: SyntaxNode, |
@@ -2455,9 +2575,10 @@ impl AstNode for AssocTypeArg { | |||
2455 | impl ast::TypeBoundsOwner for AssocTypeArg {} | 2575 | impl ast::TypeBoundsOwner for AssocTypeArg {} |
2456 | impl AssocTypeArg { | 2576 | impl AssocTypeArg { |
2457 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 2577 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
2458 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2578 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2459 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2579 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2460 | } | 2580 | } |
2581 | |||
2461 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2582 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2462 | pub struct LifetimeArg { | 2583 | pub struct LifetimeArg { |
2463 | pub(crate) syntax: SyntaxNode, | 2584 | pub(crate) syntax: SyntaxNode, |
@@ -2474,8 +2595,11 @@ impl AstNode for LifetimeArg { | |||
2474 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2595 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2475 | } | 2596 | } |
2476 | impl LifetimeArg { | 2597 | impl LifetimeArg { |
2477 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2598 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2599 | support::token(&self.syntax, T![lifetime]) | ||
2600 | } | ||
2478 | } | 2601 | } |
2602 | |||
2479 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2603 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2480 | pub struct ConstArg { | 2604 | pub struct ConstArg { |
2481 | pub(crate) syntax: SyntaxNode, | 2605 | pub(crate) syntax: SyntaxNode, |
@@ -2493,9 +2617,10 @@ impl AstNode for ConstArg { | |||
2493 | } | 2617 | } |
2494 | impl ConstArg { | 2618 | impl ConstArg { |
2495 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } | 2619 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } |
2496 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2620 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2497 | pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | 2621 | pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) } |
2498 | } | 2622 | } |
2623 | |||
2499 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2624 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2500 | pub struct MacroItems { | 2625 | pub struct MacroItems { |
2501 | pub(crate) syntax: SyntaxNode, | 2626 | pub(crate) syntax: SyntaxNode, |
@@ -2512,8 +2637,8 @@ impl AstNode for MacroItems { | |||
2512 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2637 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2513 | } | 2638 | } |
2514 | impl ast::ModuleItemOwner for MacroItems {} | 2639 | impl ast::ModuleItemOwner for MacroItems {} |
2515 | impl ast::FnDefOwner for MacroItems {} | ||
2516 | impl MacroItems {} | 2640 | impl MacroItems {} |
2641 | |||
2517 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2642 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2518 | pub struct MacroStmts { | 2643 | pub struct MacroStmts { |
2519 | pub(crate) syntax: SyntaxNode, | 2644 | pub(crate) syntax: SyntaxNode, |
@@ -2533,6 +2658,7 @@ impl MacroStmts { | |||
2533 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } | 2658 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } |
2534 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2659 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2535 | } | 2660 | } |
2661 | |||
2536 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2662 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2537 | pub struct ExternItemList { | 2663 | pub struct ExternItemList { |
2538 | pub(crate) syntax: SyntaxNode, | 2664 | pub(crate) syntax: SyntaxNode, |
@@ -2548,13 +2674,13 @@ impl AstNode for ExternItemList { | |||
2548 | } | 2674 | } |
2549 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2675 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2550 | } | 2676 | } |
2551 | impl ast::FnDefOwner for ExternItemList {} | ||
2552 | impl ast::ModuleItemOwner for ExternItemList {} | 2677 | impl ast::ModuleItemOwner for ExternItemList {} |
2553 | impl ExternItemList { | 2678 | impl ExternItemList { |
2554 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 2679 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
2555 | pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) } | 2680 | pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) } |
2556 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 2681 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
2557 | } | 2682 | } |
2683 | |||
2558 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2684 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2559 | pub struct ExternBlock { | 2685 | pub struct ExternBlock { |
2560 | pub(crate) syntax: SyntaxNode, | 2686 | pub(crate) syntax: SyntaxNode, |
@@ -2574,6 +2700,7 @@ impl ExternBlock { | |||
2574 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | 2700 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } |
2575 | pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) } | 2701 | pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) } |
2576 | } | 2702 | } |
2703 | |||
2577 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2704 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2578 | pub struct MetaItem { | 2705 | pub struct MetaItem { |
2579 | pub(crate) syntax: SyntaxNode, | 2706 | pub(crate) syntax: SyntaxNode, |
@@ -2591,10 +2718,11 @@ impl AstNode for MetaItem { | |||
2591 | } | 2718 | } |
2592 | impl MetaItem { | 2719 | impl MetaItem { |
2593 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 2720 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
2594 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2721 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2595 | pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) } | 2722 | pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) } |
2596 | pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) } | 2723 | pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) } |
2597 | } | 2724 | } |
2725 | |||
2598 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2726 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2599 | pub struct MacroDef { | 2727 | pub struct MacroDef { |
2600 | pub(crate) syntax: SyntaxNode, | 2728 | pub(crate) syntax: SyntaxNode, |
@@ -2614,6 +2742,7 @@ impl MacroDef { | |||
2614 | pub fn name(&self) -> Option<Name> { support::child(&self.syntax) } | 2742 | pub fn name(&self) -> Option<Name> { support::child(&self.syntax) } |
2615 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } | 2743 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } |
2616 | } | 2744 | } |
2745 | |||
2617 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2746 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2618 | pub enum NominalDef { | 2747 | pub enum NominalDef { |
2619 | StructDef(StructDef), | 2748 | StructDef(StructDef), |
@@ -2656,6 +2785,7 @@ impl AstNode for NominalDef { | |||
2656 | impl ast::NameOwner for NominalDef {} | 2785 | impl ast::NameOwner for NominalDef {} |
2657 | impl ast::TypeParamsOwner for NominalDef {} | 2786 | impl ast::TypeParamsOwner for NominalDef {} |
2658 | impl ast::AttrsOwner for NominalDef {} | 2787 | impl ast::AttrsOwner for NominalDef {} |
2788 | |||
2659 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2789 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2660 | pub enum GenericParam { | 2790 | pub enum GenericParam { |
2661 | LifetimeParam(LifetimeParam), | 2791 | LifetimeParam(LifetimeParam), |
@@ -2695,6 +2825,7 @@ impl AstNode for GenericParam { | |||
2695 | } | 2825 | } |
2696 | } | 2826 | } |
2697 | } | 2827 | } |
2828 | |||
2698 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2829 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2699 | pub enum GenericArg { | 2830 | pub enum GenericArg { |
2700 | LifetimeArg(LifetimeArg), | 2831 | LifetimeArg(LifetimeArg), |
@@ -2740,6 +2871,7 @@ impl AstNode for GenericArg { | |||
2740 | } | 2871 | } |
2741 | } | 2872 | } |
2742 | } | 2873 | } |
2874 | |||
2743 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2875 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2744 | pub enum TypeRef { | 2876 | pub enum TypeRef { |
2745 | ParenType(ParenType), | 2877 | ParenType(ParenType), |
@@ -2841,6 +2973,7 @@ impl AstNode for TypeRef { | |||
2841 | } | 2973 | } |
2842 | } | 2974 | } |
2843 | } | 2975 | } |
2976 | |||
2844 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2977 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2845 | pub enum ModuleItem { | 2978 | pub enum ModuleItem { |
2846 | StructDef(StructDef), | 2979 | StructDef(StructDef), |
@@ -2951,6 +3084,7 @@ impl AstNode for ModuleItem { | |||
2951 | impl ast::NameOwner for ModuleItem {} | 3084 | impl ast::NameOwner for ModuleItem {} |
2952 | impl ast::AttrsOwner for ModuleItem {} | 3085 | impl ast::AttrsOwner for ModuleItem {} |
2953 | impl ast::VisibilityOwner for ModuleItem {} | 3086 | impl ast::VisibilityOwner for ModuleItem {} |
3087 | |||
2954 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3088 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2955 | pub enum ImplItem { | 3089 | pub enum ImplItem { |
2956 | FnDef(FnDef), | 3090 | FnDef(FnDef), |
@@ -2992,6 +3126,7 @@ impl AstNode for ImplItem { | |||
2992 | } | 3126 | } |
2993 | impl ast::NameOwner for ImplItem {} | 3127 | impl ast::NameOwner for ImplItem {} |
2994 | impl ast::AttrsOwner for ImplItem {} | 3128 | impl ast::AttrsOwner for ImplItem {} |
3129 | |||
2995 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3130 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2996 | pub enum ExternItem { | 3131 | pub enum ExternItem { |
2997 | FnDef(FnDef), | 3132 | FnDef(FnDef), |
@@ -3028,6 +3163,7 @@ impl AstNode for ExternItem { | |||
3028 | impl ast::NameOwner for ExternItem {} | 3163 | impl ast::NameOwner for ExternItem {} |
3029 | impl ast::AttrsOwner for ExternItem {} | 3164 | impl ast::AttrsOwner for ExternItem {} |
3030 | impl ast::VisibilityOwner for ExternItem {} | 3165 | impl ast::VisibilityOwner for ExternItem {} |
3166 | |||
3031 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3167 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3032 | pub enum Expr { | 3168 | pub enum Expr { |
3033 | TupleExpr(TupleExpr), | 3169 | TupleExpr(TupleExpr), |
@@ -3241,6 +3377,7 @@ impl AstNode for Expr { | |||
3241 | } | 3377 | } |
3242 | } | 3378 | } |
3243 | impl ast::AttrsOwner for Expr {} | 3379 | impl ast::AttrsOwner for Expr {} |
3380 | |||
3244 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3381 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3245 | pub enum Pat { | 3382 | pub enum Pat { |
3246 | OrPat(OrPat), | 3383 | OrPat(OrPat), |
@@ -3354,6 +3491,7 @@ impl AstNode for Pat { | |||
3354 | } | 3491 | } |
3355 | } | 3492 | } |
3356 | } | 3493 | } |
3494 | |||
3357 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3495 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3358 | pub enum RecordInnerPat { | 3496 | pub enum RecordInnerPat { |
3359 | RecordFieldPat(RecordFieldPat), | 3497 | RecordFieldPat(RecordFieldPat), |
@@ -3387,6 +3525,7 @@ impl AstNode for RecordInnerPat { | |||
3387 | } | 3525 | } |
3388 | } | 3526 | } |
3389 | } | 3527 | } |
3528 | |||
3390 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3529 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3391 | pub enum AttrInput { | 3530 | pub enum AttrInput { |
3392 | Literal(Literal), | 3531 | Literal(Literal), |
@@ -3420,6 +3559,7 @@ impl AstNode for AttrInput { | |||
3420 | } | 3559 | } |
3421 | } | 3560 | } |
3422 | } | 3561 | } |
3562 | |||
3423 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3563 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3424 | pub enum Stmt { | 3564 | pub enum Stmt { |
3425 | LetStmt(LetStmt), | 3565 | LetStmt(LetStmt), |
@@ -3453,6 +3593,7 @@ impl AstNode for Stmt { | |||
3453 | } | 3593 | } |
3454 | } | 3594 | } |
3455 | } | 3595 | } |
3596 | |||
3456 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3597 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3457 | pub enum FieldDefList { | 3598 | pub enum FieldDefList { |
3458 | RecordFieldDefList(RecordFieldDefList), | 3599 | RecordFieldDefList(RecordFieldDefList), |
diff --git a/crates/ra_syntax/src/ast/generated/tokens.rs b/crates/ra_syntax/src/ast/generated/tokens.rs index e64b8bce6..f91befaac 100644 --- a/crates/ra_syntax/src/ast/generated/tokens.rs +++ b/crates/ra_syntax/src/ast/generated/tokens.rs | |||
@@ -5,2146 +5,7 @@ use crate::{ | |||
5 | SyntaxKind::{self, *}, | 5 | SyntaxKind::{self, *}, |
6 | SyntaxToken, | 6 | SyntaxToken, |
7 | }; | 7 | }; |
8 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 8 | |
9 | pub struct Semi { | ||
10 | pub(crate) syntax: SyntaxToken, | ||
11 | } | ||
12 | impl std::fmt::Display for Semi { | ||
13 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
14 | std::fmt::Display::fmt(&self.syntax, f) | ||
15 | } | ||
16 | } | ||
17 | impl AstToken for Semi { | ||
18 | fn can_cast(kind: SyntaxKind) -> bool { kind == SEMI } | ||
19 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
20 | if Self::can_cast(syntax.kind()) { | ||
21 | Some(Self { syntax }) | ||
22 | } else { | ||
23 | None | ||
24 | } | ||
25 | } | ||
26 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
27 | } | ||
28 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
29 | pub struct Comma { | ||
30 | pub(crate) syntax: SyntaxToken, | ||
31 | } | ||
32 | impl std::fmt::Display for Comma { | ||
33 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
34 | std::fmt::Display::fmt(&self.syntax, f) | ||
35 | } | ||
36 | } | ||
37 | impl AstToken for Comma { | ||
38 | fn can_cast(kind: SyntaxKind) -> bool { kind == COMMA } | ||
39 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
40 | if Self::can_cast(syntax.kind()) { | ||
41 | Some(Self { syntax }) | ||
42 | } else { | ||
43 | None | ||
44 | } | ||
45 | } | ||
46 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
47 | } | ||
48 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
49 | pub struct LParen { | ||
50 | pub(crate) syntax: SyntaxToken, | ||
51 | } | ||
52 | impl std::fmt::Display for LParen { | ||
53 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
54 | std::fmt::Display::fmt(&self.syntax, f) | ||
55 | } | ||
56 | } | ||
57 | impl AstToken for LParen { | ||
58 | fn can_cast(kind: SyntaxKind) -> bool { kind == L_PAREN } | ||
59 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
60 | if Self::can_cast(syntax.kind()) { | ||
61 | Some(Self { syntax }) | ||
62 | } else { | ||
63 | None | ||
64 | } | ||
65 | } | ||
66 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
67 | } | ||
68 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
69 | pub struct RParen { | ||
70 | pub(crate) syntax: SyntaxToken, | ||
71 | } | ||
72 | impl std::fmt::Display for RParen { | ||
73 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
74 | std::fmt::Display::fmt(&self.syntax, f) | ||
75 | } | ||
76 | } | ||
77 | impl AstToken for RParen { | ||
78 | fn can_cast(kind: SyntaxKind) -> bool { kind == R_PAREN } | ||
79 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
80 | if Self::can_cast(syntax.kind()) { | ||
81 | Some(Self { syntax }) | ||
82 | } else { | ||
83 | None | ||
84 | } | ||
85 | } | ||
86 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
87 | } | ||
88 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
89 | pub struct LCurly { | ||
90 | pub(crate) syntax: SyntaxToken, | ||
91 | } | ||
92 | impl std::fmt::Display for LCurly { | ||
93 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
94 | std::fmt::Display::fmt(&self.syntax, f) | ||
95 | } | ||
96 | } | ||
97 | impl AstToken for LCurly { | ||
98 | fn can_cast(kind: SyntaxKind) -> bool { kind == L_CURLY } | ||
99 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
100 | if Self::can_cast(syntax.kind()) { | ||
101 | Some(Self { syntax }) | ||
102 | } else { | ||
103 | None | ||
104 | } | ||
105 | } | ||
106 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
107 | } | ||
108 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
109 | pub struct RCurly { | ||
110 | pub(crate) syntax: SyntaxToken, | ||
111 | } | ||
112 | impl std::fmt::Display for RCurly { | ||
113 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
114 | std::fmt::Display::fmt(&self.syntax, f) | ||
115 | } | ||
116 | } | ||
117 | impl AstToken for RCurly { | ||
118 | fn can_cast(kind: SyntaxKind) -> bool { kind == R_CURLY } | ||
119 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
120 | if Self::can_cast(syntax.kind()) { | ||
121 | Some(Self { syntax }) | ||
122 | } else { | ||
123 | None | ||
124 | } | ||
125 | } | ||
126 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
127 | } | ||
128 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
129 | pub struct LBrack { | ||
130 | pub(crate) syntax: SyntaxToken, | ||
131 | } | ||
132 | impl std::fmt::Display for LBrack { | ||
133 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
134 | std::fmt::Display::fmt(&self.syntax, f) | ||
135 | } | ||
136 | } | ||
137 | impl AstToken for LBrack { | ||
138 | fn can_cast(kind: SyntaxKind) -> bool { kind == L_BRACK } | ||
139 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
140 | if Self::can_cast(syntax.kind()) { | ||
141 | Some(Self { syntax }) | ||
142 | } else { | ||
143 | None | ||
144 | } | ||
145 | } | ||
146 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
147 | } | ||
148 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
149 | pub struct RBrack { | ||
150 | pub(crate) syntax: SyntaxToken, | ||
151 | } | ||
152 | impl std::fmt::Display for RBrack { | ||
153 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
154 | std::fmt::Display::fmt(&self.syntax, f) | ||
155 | } | ||
156 | } | ||
157 | impl AstToken for RBrack { | ||
158 | fn can_cast(kind: SyntaxKind) -> bool { kind == R_BRACK } | ||
159 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
160 | if Self::can_cast(syntax.kind()) { | ||
161 | Some(Self { syntax }) | ||
162 | } else { | ||
163 | None | ||
164 | } | ||
165 | } | ||
166 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
167 | } | ||
168 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
169 | pub struct LAngle { | ||
170 | pub(crate) syntax: SyntaxToken, | ||
171 | } | ||
172 | impl std::fmt::Display for LAngle { | ||
173 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
174 | std::fmt::Display::fmt(&self.syntax, f) | ||
175 | } | ||
176 | } | ||
177 | impl AstToken for LAngle { | ||
178 | fn can_cast(kind: SyntaxKind) -> bool { kind == L_ANGLE } | ||
179 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
180 | if Self::can_cast(syntax.kind()) { | ||
181 | Some(Self { syntax }) | ||
182 | } else { | ||
183 | None | ||
184 | } | ||
185 | } | ||
186 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
187 | } | ||
188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
189 | pub struct RAngle { | ||
190 | pub(crate) syntax: SyntaxToken, | ||
191 | } | ||
192 | impl std::fmt::Display for RAngle { | ||
193 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
194 | std::fmt::Display::fmt(&self.syntax, f) | ||
195 | } | ||
196 | } | ||
197 | impl AstToken for RAngle { | ||
198 | fn can_cast(kind: SyntaxKind) -> bool { kind == R_ANGLE } | ||
199 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
200 | if Self::can_cast(syntax.kind()) { | ||
201 | Some(Self { syntax }) | ||
202 | } else { | ||
203 | None | ||
204 | } | ||
205 | } | ||
206 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
207 | } | ||
208 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
209 | pub struct At { | ||
210 | pub(crate) syntax: SyntaxToken, | ||
211 | } | ||
212 | impl std::fmt::Display for At { | ||
213 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
214 | std::fmt::Display::fmt(&self.syntax, f) | ||
215 | } | ||
216 | } | ||
217 | impl AstToken for At { | ||
218 | fn can_cast(kind: SyntaxKind) -> bool { kind == AT } | ||
219 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
220 | if Self::can_cast(syntax.kind()) { | ||
221 | Some(Self { syntax }) | ||
222 | } else { | ||
223 | None | ||
224 | } | ||
225 | } | ||
226 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
227 | } | ||
228 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
229 | pub struct Pound { | ||
230 | pub(crate) syntax: SyntaxToken, | ||
231 | } | ||
232 | impl std::fmt::Display for Pound { | ||
233 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
234 | std::fmt::Display::fmt(&self.syntax, f) | ||
235 | } | ||
236 | } | ||
237 | impl AstToken for Pound { | ||
238 | fn can_cast(kind: SyntaxKind) -> bool { kind == POUND } | ||
239 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
240 | if Self::can_cast(syntax.kind()) { | ||
241 | Some(Self { syntax }) | ||
242 | } else { | ||
243 | None | ||
244 | } | ||
245 | } | ||
246 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
247 | } | ||
248 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
249 | pub struct Tilde { | ||
250 | pub(crate) syntax: SyntaxToken, | ||
251 | } | ||
252 | impl std::fmt::Display for Tilde { | ||
253 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
254 | std::fmt::Display::fmt(&self.syntax, f) | ||
255 | } | ||
256 | } | ||
257 | impl AstToken for Tilde { | ||
258 | fn can_cast(kind: SyntaxKind) -> bool { kind == TILDE } | ||
259 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
260 | if Self::can_cast(syntax.kind()) { | ||
261 | Some(Self { syntax }) | ||
262 | } else { | ||
263 | None | ||
264 | } | ||
265 | } | ||
266 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
267 | } | ||
268 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
269 | pub struct Question { | ||
270 | pub(crate) syntax: SyntaxToken, | ||
271 | } | ||
272 | impl std::fmt::Display for Question { | ||
273 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
274 | std::fmt::Display::fmt(&self.syntax, f) | ||
275 | } | ||
276 | } | ||
277 | impl AstToken for Question { | ||
278 | fn can_cast(kind: SyntaxKind) -> bool { kind == QUESTION } | ||
279 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
280 | if Self::can_cast(syntax.kind()) { | ||
281 | Some(Self { syntax }) | ||
282 | } else { | ||
283 | None | ||
284 | } | ||
285 | } | ||
286 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
287 | } | ||
288 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
289 | pub struct Dollar { | ||
290 | pub(crate) syntax: SyntaxToken, | ||
291 | } | ||
292 | impl std::fmt::Display for Dollar { | ||
293 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
294 | std::fmt::Display::fmt(&self.syntax, f) | ||
295 | } | ||
296 | } | ||
297 | impl AstToken for Dollar { | ||
298 | fn can_cast(kind: SyntaxKind) -> bool { kind == DOLLAR } | ||
299 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
300 | if Self::can_cast(syntax.kind()) { | ||
301 | Some(Self { syntax }) | ||
302 | } else { | ||
303 | None | ||
304 | } | ||
305 | } | ||
306 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
307 | } | ||
308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
309 | pub struct Amp { | ||
310 | pub(crate) syntax: SyntaxToken, | ||
311 | } | ||
312 | impl std::fmt::Display for Amp { | ||
313 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
314 | std::fmt::Display::fmt(&self.syntax, f) | ||
315 | } | ||
316 | } | ||
317 | impl AstToken for Amp { | ||
318 | fn can_cast(kind: SyntaxKind) -> bool { kind == AMP } | ||
319 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
320 | if Self::can_cast(syntax.kind()) { | ||
321 | Some(Self { syntax }) | ||
322 | } else { | ||
323 | None | ||
324 | } | ||
325 | } | ||
326 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
327 | } | ||
328 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
329 | pub struct Pipe { | ||
330 | pub(crate) syntax: SyntaxToken, | ||
331 | } | ||
332 | impl std::fmt::Display for Pipe { | ||
333 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
334 | std::fmt::Display::fmt(&self.syntax, f) | ||
335 | } | ||
336 | } | ||
337 | impl AstToken for Pipe { | ||
338 | fn can_cast(kind: SyntaxKind) -> bool { kind == PIPE } | ||
339 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
340 | if Self::can_cast(syntax.kind()) { | ||
341 | Some(Self { syntax }) | ||
342 | } else { | ||
343 | None | ||
344 | } | ||
345 | } | ||
346 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
347 | } | ||
348 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
349 | pub struct Plus { | ||
350 | pub(crate) syntax: SyntaxToken, | ||
351 | } | ||
352 | impl std::fmt::Display for Plus { | ||
353 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
354 | std::fmt::Display::fmt(&self.syntax, f) | ||
355 | } | ||
356 | } | ||
357 | impl AstToken for Plus { | ||
358 | fn can_cast(kind: SyntaxKind) -> bool { kind == PLUS } | ||
359 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
360 | if Self::can_cast(syntax.kind()) { | ||
361 | Some(Self { syntax }) | ||
362 | } else { | ||
363 | None | ||
364 | } | ||
365 | } | ||
366 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
367 | } | ||
368 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
369 | pub struct Star { | ||
370 | pub(crate) syntax: SyntaxToken, | ||
371 | } | ||
372 | impl std::fmt::Display for Star { | ||
373 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
374 | std::fmt::Display::fmt(&self.syntax, f) | ||
375 | } | ||
376 | } | ||
377 | impl AstToken for Star { | ||
378 | fn can_cast(kind: SyntaxKind) -> bool { kind == STAR } | ||
379 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
380 | if Self::can_cast(syntax.kind()) { | ||
381 | Some(Self { syntax }) | ||
382 | } else { | ||
383 | None | ||
384 | } | ||
385 | } | ||
386 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
387 | } | ||
388 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
389 | pub struct Slash { | ||
390 | pub(crate) syntax: SyntaxToken, | ||
391 | } | ||
392 | impl std::fmt::Display for Slash { | ||
393 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
394 | std::fmt::Display::fmt(&self.syntax, f) | ||
395 | } | ||
396 | } | ||
397 | impl AstToken for Slash { | ||
398 | fn can_cast(kind: SyntaxKind) -> bool { kind == SLASH } | ||
399 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
400 | if Self::can_cast(syntax.kind()) { | ||
401 | Some(Self { syntax }) | ||
402 | } else { | ||
403 | None | ||
404 | } | ||
405 | } | ||
406 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
407 | } | ||
408 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
409 | pub struct Caret { | ||
410 | pub(crate) syntax: SyntaxToken, | ||
411 | } | ||
412 | impl std::fmt::Display for Caret { | ||
413 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
414 | std::fmt::Display::fmt(&self.syntax, f) | ||
415 | } | ||
416 | } | ||
417 | impl AstToken for Caret { | ||
418 | fn can_cast(kind: SyntaxKind) -> bool { kind == CARET } | ||
419 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
420 | if Self::can_cast(syntax.kind()) { | ||
421 | Some(Self { syntax }) | ||
422 | } else { | ||
423 | None | ||
424 | } | ||
425 | } | ||
426 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
427 | } | ||
428 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
429 | pub struct Percent { | ||
430 | pub(crate) syntax: SyntaxToken, | ||
431 | } | ||
432 | impl std::fmt::Display for Percent { | ||
433 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
434 | std::fmt::Display::fmt(&self.syntax, f) | ||
435 | } | ||
436 | } | ||
437 | impl AstToken for Percent { | ||
438 | fn can_cast(kind: SyntaxKind) -> bool { kind == PERCENT } | ||
439 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
440 | if Self::can_cast(syntax.kind()) { | ||
441 | Some(Self { syntax }) | ||
442 | } else { | ||
443 | None | ||
444 | } | ||
445 | } | ||
446 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
447 | } | ||
448 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
449 | pub struct Underscore { | ||
450 | pub(crate) syntax: SyntaxToken, | ||
451 | } | ||
452 | impl std::fmt::Display for Underscore { | ||
453 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
454 | std::fmt::Display::fmt(&self.syntax, f) | ||
455 | } | ||
456 | } | ||
457 | impl AstToken for Underscore { | ||
458 | fn can_cast(kind: SyntaxKind) -> bool { kind == UNDERSCORE } | ||
459 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
460 | if Self::can_cast(syntax.kind()) { | ||
461 | Some(Self { syntax }) | ||
462 | } else { | ||
463 | None | ||
464 | } | ||
465 | } | ||
466 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
467 | } | ||
468 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
469 | pub struct Dot { | ||
470 | pub(crate) syntax: SyntaxToken, | ||
471 | } | ||
472 | impl std::fmt::Display for Dot { | ||
473 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
474 | std::fmt::Display::fmt(&self.syntax, f) | ||
475 | } | ||
476 | } | ||
477 | impl AstToken for Dot { | ||
478 | fn can_cast(kind: SyntaxKind) -> bool { kind == DOT } | ||
479 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
480 | if Self::can_cast(syntax.kind()) { | ||
481 | Some(Self { syntax }) | ||
482 | } else { | ||
483 | None | ||
484 | } | ||
485 | } | ||
486 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
487 | } | ||
488 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
489 | pub struct Dotdot { | ||
490 | pub(crate) syntax: SyntaxToken, | ||
491 | } | ||
492 | impl std::fmt::Display for Dotdot { | ||
493 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
494 | std::fmt::Display::fmt(&self.syntax, f) | ||
495 | } | ||
496 | } | ||
497 | impl AstToken for Dotdot { | ||
498 | fn can_cast(kind: SyntaxKind) -> bool { kind == DOTDOT } | ||
499 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
500 | if Self::can_cast(syntax.kind()) { | ||
501 | Some(Self { syntax }) | ||
502 | } else { | ||
503 | None | ||
504 | } | ||
505 | } | ||
506 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
507 | } | ||
508 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
509 | pub struct Dotdotdot { | ||
510 | pub(crate) syntax: SyntaxToken, | ||
511 | } | ||
512 | impl std::fmt::Display for Dotdotdot { | ||
513 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
514 | std::fmt::Display::fmt(&self.syntax, f) | ||
515 | } | ||
516 | } | ||
517 | impl AstToken for Dotdotdot { | ||
518 | fn can_cast(kind: SyntaxKind) -> bool { kind == DOTDOTDOT } | ||
519 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
520 | if Self::can_cast(syntax.kind()) { | ||
521 | Some(Self { syntax }) | ||
522 | } else { | ||
523 | None | ||
524 | } | ||
525 | } | ||
526 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
527 | } | ||
528 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
529 | pub struct Dotdoteq { | ||
530 | pub(crate) syntax: SyntaxToken, | ||
531 | } | ||
532 | impl std::fmt::Display for Dotdoteq { | ||
533 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
534 | std::fmt::Display::fmt(&self.syntax, f) | ||
535 | } | ||
536 | } | ||
537 | impl AstToken for Dotdoteq { | ||
538 | fn can_cast(kind: SyntaxKind) -> bool { kind == DOTDOTEQ } | ||
539 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
540 | if Self::can_cast(syntax.kind()) { | ||
541 | Some(Self { syntax }) | ||
542 | } else { | ||
543 | None | ||
544 | } | ||
545 | } | ||
546 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
547 | } | ||
548 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
549 | pub struct Colon { | ||
550 | pub(crate) syntax: SyntaxToken, | ||
551 | } | ||
552 | impl std::fmt::Display for Colon { | ||
553 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
554 | std::fmt::Display::fmt(&self.syntax, f) | ||
555 | } | ||
556 | } | ||
557 | impl AstToken for Colon { | ||
558 | fn can_cast(kind: SyntaxKind) -> bool { kind == COLON } | ||
559 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
560 | if Self::can_cast(syntax.kind()) { | ||
561 | Some(Self { syntax }) | ||
562 | } else { | ||
563 | None | ||
564 | } | ||
565 | } | ||
566 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
567 | } | ||
568 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
569 | pub struct Coloncolon { | ||
570 | pub(crate) syntax: SyntaxToken, | ||
571 | } | ||
572 | impl std::fmt::Display for Coloncolon { | ||
573 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
574 | std::fmt::Display::fmt(&self.syntax, f) | ||
575 | } | ||
576 | } | ||
577 | impl AstToken for Coloncolon { | ||
578 | fn can_cast(kind: SyntaxKind) -> bool { kind == COLONCOLON } | ||
579 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
580 | if Self::can_cast(syntax.kind()) { | ||
581 | Some(Self { syntax }) | ||
582 | } else { | ||
583 | None | ||
584 | } | ||
585 | } | ||
586 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
587 | } | ||
588 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
589 | pub struct Eq { | ||
590 | pub(crate) syntax: SyntaxToken, | ||
591 | } | ||
592 | impl std::fmt::Display for Eq { | ||
593 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
594 | std::fmt::Display::fmt(&self.syntax, f) | ||
595 | } | ||
596 | } | ||
597 | impl AstToken for Eq { | ||
598 | fn can_cast(kind: SyntaxKind) -> bool { kind == EQ } | ||
599 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
600 | if Self::can_cast(syntax.kind()) { | ||
601 | Some(Self { syntax }) | ||
602 | } else { | ||
603 | None | ||
604 | } | ||
605 | } | ||
606 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
607 | } | ||
608 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
609 | pub struct Eqeq { | ||
610 | pub(crate) syntax: SyntaxToken, | ||
611 | } | ||
612 | impl std::fmt::Display for Eqeq { | ||
613 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
614 | std::fmt::Display::fmt(&self.syntax, f) | ||
615 | } | ||
616 | } | ||
617 | impl AstToken for Eqeq { | ||
618 | fn can_cast(kind: SyntaxKind) -> bool { kind == EQEQ } | ||
619 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
620 | if Self::can_cast(syntax.kind()) { | ||
621 | Some(Self { syntax }) | ||
622 | } else { | ||
623 | None | ||
624 | } | ||
625 | } | ||
626 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
627 | } | ||
628 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
629 | pub struct FatArrow { | ||
630 | pub(crate) syntax: SyntaxToken, | ||
631 | } | ||
632 | impl std::fmt::Display for FatArrow { | ||
633 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
634 | std::fmt::Display::fmt(&self.syntax, f) | ||
635 | } | ||
636 | } | ||
637 | impl AstToken for FatArrow { | ||
638 | fn can_cast(kind: SyntaxKind) -> bool { kind == FAT_ARROW } | ||
639 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
640 | if Self::can_cast(syntax.kind()) { | ||
641 | Some(Self { syntax }) | ||
642 | } else { | ||
643 | None | ||
644 | } | ||
645 | } | ||
646 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
647 | } | ||
648 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
649 | pub struct Excl { | ||
650 | pub(crate) syntax: SyntaxToken, | ||
651 | } | ||
652 | impl std::fmt::Display for Excl { | ||
653 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
654 | std::fmt::Display::fmt(&self.syntax, f) | ||
655 | } | ||
656 | } | ||
657 | impl AstToken for Excl { | ||
658 | fn can_cast(kind: SyntaxKind) -> bool { kind == EXCL } | ||
659 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
660 | if Self::can_cast(syntax.kind()) { | ||
661 | Some(Self { syntax }) | ||
662 | } else { | ||
663 | None | ||
664 | } | ||
665 | } | ||
666 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
667 | } | ||
668 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
669 | pub struct Neq { | ||
670 | pub(crate) syntax: SyntaxToken, | ||
671 | } | ||
672 | impl std::fmt::Display for Neq { | ||
673 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
674 | std::fmt::Display::fmt(&self.syntax, f) | ||
675 | } | ||
676 | } | ||
677 | impl AstToken for Neq { | ||
678 | fn can_cast(kind: SyntaxKind) -> bool { kind == NEQ } | ||
679 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
680 | if Self::can_cast(syntax.kind()) { | ||
681 | Some(Self { syntax }) | ||
682 | } else { | ||
683 | None | ||
684 | } | ||
685 | } | ||
686 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
687 | } | ||
688 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
689 | pub struct Minus { | ||
690 | pub(crate) syntax: SyntaxToken, | ||
691 | } | ||
692 | impl std::fmt::Display for Minus { | ||
693 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
694 | std::fmt::Display::fmt(&self.syntax, f) | ||
695 | } | ||
696 | } | ||
697 | impl AstToken for Minus { | ||
698 | fn can_cast(kind: SyntaxKind) -> bool { kind == MINUS } | ||
699 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
700 | if Self::can_cast(syntax.kind()) { | ||
701 | Some(Self { syntax }) | ||
702 | } else { | ||
703 | None | ||
704 | } | ||
705 | } | ||
706 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
707 | } | ||
708 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
709 | pub struct ThinArrow { | ||
710 | pub(crate) syntax: SyntaxToken, | ||
711 | } | ||
712 | impl std::fmt::Display for ThinArrow { | ||
713 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
714 | std::fmt::Display::fmt(&self.syntax, f) | ||
715 | } | ||
716 | } | ||
717 | impl AstToken for ThinArrow { | ||
718 | fn can_cast(kind: SyntaxKind) -> bool { kind == THIN_ARROW } | ||
719 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
720 | if Self::can_cast(syntax.kind()) { | ||
721 | Some(Self { syntax }) | ||
722 | } else { | ||
723 | None | ||
724 | } | ||
725 | } | ||
726 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
727 | } | ||
728 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
729 | pub struct Lteq { | ||
730 | pub(crate) syntax: SyntaxToken, | ||
731 | } | ||
732 | impl std::fmt::Display for Lteq { | ||
733 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
734 | std::fmt::Display::fmt(&self.syntax, f) | ||
735 | } | ||
736 | } | ||
737 | impl AstToken for Lteq { | ||
738 | fn can_cast(kind: SyntaxKind) -> bool { kind == LTEQ } | ||
739 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
740 | if Self::can_cast(syntax.kind()) { | ||
741 | Some(Self { syntax }) | ||
742 | } else { | ||
743 | None | ||
744 | } | ||
745 | } | ||
746 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
747 | } | ||
748 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
749 | pub struct Gteq { | ||
750 | pub(crate) syntax: SyntaxToken, | ||
751 | } | ||
752 | impl std::fmt::Display for Gteq { | ||
753 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
754 | std::fmt::Display::fmt(&self.syntax, f) | ||
755 | } | ||
756 | } | ||
757 | impl AstToken for Gteq { | ||
758 | fn can_cast(kind: SyntaxKind) -> bool { kind == GTEQ } | ||
759 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
760 | if Self::can_cast(syntax.kind()) { | ||
761 | Some(Self { syntax }) | ||
762 | } else { | ||
763 | None | ||
764 | } | ||
765 | } | ||
766 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
767 | } | ||
768 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
769 | pub struct Pluseq { | ||
770 | pub(crate) syntax: SyntaxToken, | ||
771 | } | ||
772 | impl std::fmt::Display for Pluseq { | ||
773 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
774 | std::fmt::Display::fmt(&self.syntax, f) | ||
775 | } | ||
776 | } | ||
777 | impl AstToken for Pluseq { | ||
778 | fn can_cast(kind: SyntaxKind) -> bool { kind == PLUSEQ } | ||
779 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
780 | if Self::can_cast(syntax.kind()) { | ||
781 | Some(Self { syntax }) | ||
782 | } else { | ||
783 | None | ||
784 | } | ||
785 | } | ||
786 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
787 | } | ||
788 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
789 | pub struct Minuseq { | ||
790 | pub(crate) syntax: SyntaxToken, | ||
791 | } | ||
792 | impl std::fmt::Display for Minuseq { | ||
793 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
794 | std::fmt::Display::fmt(&self.syntax, f) | ||
795 | } | ||
796 | } | ||
797 | impl AstToken for Minuseq { | ||
798 | fn can_cast(kind: SyntaxKind) -> bool { kind == MINUSEQ } | ||
799 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
800 | if Self::can_cast(syntax.kind()) { | ||
801 | Some(Self { syntax }) | ||
802 | } else { | ||
803 | None | ||
804 | } | ||
805 | } | ||
806 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
807 | } | ||
808 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
809 | pub struct Pipeeq { | ||
810 | pub(crate) syntax: SyntaxToken, | ||
811 | } | ||
812 | impl std::fmt::Display for Pipeeq { | ||
813 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
814 | std::fmt::Display::fmt(&self.syntax, f) | ||
815 | } | ||
816 | } | ||
817 | impl AstToken for Pipeeq { | ||
818 | fn can_cast(kind: SyntaxKind) -> bool { kind == PIPEEQ } | ||
819 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
820 | if Self::can_cast(syntax.kind()) { | ||
821 | Some(Self { syntax }) | ||
822 | } else { | ||
823 | None | ||
824 | } | ||
825 | } | ||
826 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
827 | } | ||
828 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
829 | pub struct Ampeq { | ||
830 | pub(crate) syntax: SyntaxToken, | ||
831 | } | ||
832 | impl std::fmt::Display for Ampeq { | ||
833 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
834 | std::fmt::Display::fmt(&self.syntax, f) | ||
835 | } | ||
836 | } | ||
837 | impl AstToken for Ampeq { | ||
838 | fn can_cast(kind: SyntaxKind) -> bool { kind == AMPEQ } | ||
839 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
840 | if Self::can_cast(syntax.kind()) { | ||
841 | Some(Self { syntax }) | ||
842 | } else { | ||
843 | None | ||
844 | } | ||
845 | } | ||
846 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
847 | } | ||
848 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
849 | pub struct Careteq { | ||
850 | pub(crate) syntax: SyntaxToken, | ||
851 | } | ||
852 | impl std::fmt::Display for Careteq { | ||
853 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
854 | std::fmt::Display::fmt(&self.syntax, f) | ||
855 | } | ||
856 | } | ||
857 | impl AstToken for Careteq { | ||
858 | fn can_cast(kind: SyntaxKind) -> bool { kind == CARETEQ } | ||
859 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
860 | if Self::can_cast(syntax.kind()) { | ||
861 | Some(Self { syntax }) | ||
862 | } else { | ||
863 | None | ||
864 | } | ||
865 | } | ||
866 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
867 | } | ||
868 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
869 | pub struct Slasheq { | ||
870 | pub(crate) syntax: SyntaxToken, | ||
871 | } | ||
872 | impl std::fmt::Display for Slasheq { | ||
873 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
874 | std::fmt::Display::fmt(&self.syntax, f) | ||
875 | } | ||
876 | } | ||
877 | impl AstToken for Slasheq { | ||
878 | fn can_cast(kind: SyntaxKind) -> bool { kind == SLASHEQ } | ||
879 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
880 | if Self::can_cast(syntax.kind()) { | ||
881 | Some(Self { syntax }) | ||
882 | } else { | ||
883 | None | ||
884 | } | ||
885 | } | ||
886 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
887 | } | ||
888 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
889 | pub struct Stareq { | ||
890 | pub(crate) syntax: SyntaxToken, | ||
891 | } | ||
892 | impl std::fmt::Display for Stareq { | ||
893 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
894 | std::fmt::Display::fmt(&self.syntax, f) | ||
895 | } | ||
896 | } | ||
897 | impl AstToken for Stareq { | ||
898 | fn can_cast(kind: SyntaxKind) -> bool { kind == STAREQ } | ||
899 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
900 | if Self::can_cast(syntax.kind()) { | ||
901 | Some(Self { syntax }) | ||
902 | } else { | ||
903 | None | ||
904 | } | ||
905 | } | ||
906 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
907 | } | ||
908 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
909 | pub struct Percenteq { | ||
910 | pub(crate) syntax: SyntaxToken, | ||
911 | } | ||
912 | impl std::fmt::Display for Percenteq { | ||
913 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
914 | std::fmt::Display::fmt(&self.syntax, f) | ||
915 | } | ||
916 | } | ||
917 | impl AstToken for Percenteq { | ||
918 | fn can_cast(kind: SyntaxKind) -> bool { kind == PERCENTEQ } | ||
919 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
920 | if Self::can_cast(syntax.kind()) { | ||
921 | Some(Self { syntax }) | ||
922 | } else { | ||
923 | None | ||
924 | } | ||
925 | } | ||
926 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
927 | } | ||
928 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
929 | pub struct Ampamp { | ||
930 | pub(crate) syntax: SyntaxToken, | ||
931 | } | ||
932 | impl std::fmt::Display for Ampamp { | ||
933 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
934 | std::fmt::Display::fmt(&self.syntax, f) | ||
935 | } | ||
936 | } | ||
937 | impl AstToken for Ampamp { | ||
938 | fn can_cast(kind: SyntaxKind) -> bool { kind == AMPAMP } | ||
939 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
940 | if Self::can_cast(syntax.kind()) { | ||
941 | Some(Self { syntax }) | ||
942 | } else { | ||
943 | None | ||
944 | } | ||
945 | } | ||
946 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
947 | } | ||
948 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
949 | pub struct Pipepipe { | ||
950 | pub(crate) syntax: SyntaxToken, | ||
951 | } | ||
952 | impl std::fmt::Display for Pipepipe { | ||
953 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
954 | std::fmt::Display::fmt(&self.syntax, f) | ||
955 | } | ||
956 | } | ||
957 | impl AstToken for Pipepipe { | ||
958 | fn can_cast(kind: SyntaxKind) -> bool { kind == PIPEPIPE } | ||
959 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
960 | if Self::can_cast(syntax.kind()) { | ||
961 | Some(Self { syntax }) | ||
962 | } else { | ||
963 | None | ||
964 | } | ||
965 | } | ||
966 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
967 | } | ||
968 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
969 | pub struct Shl { | ||
970 | pub(crate) syntax: SyntaxToken, | ||
971 | } | ||
972 | impl std::fmt::Display for Shl { | ||
973 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
974 | std::fmt::Display::fmt(&self.syntax, f) | ||
975 | } | ||
976 | } | ||
977 | impl AstToken for Shl { | ||
978 | fn can_cast(kind: SyntaxKind) -> bool { kind == SHL } | ||
979 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
980 | if Self::can_cast(syntax.kind()) { | ||
981 | Some(Self { syntax }) | ||
982 | } else { | ||
983 | None | ||
984 | } | ||
985 | } | ||
986 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
987 | } | ||
988 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
989 | pub struct Shr { | ||
990 | pub(crate) syntax: SyntaxToken, | ||
991 | } | ||
992 | impl std::fmt::Display for Shr { | ||
993 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
994 | std::fmt::Display::fmt(&self.syntax, f) | ||
995 | } | ||
996 | } | ||
997 | impl AstToken for Shr { | ||
998 | fn can_cast(kind: SyntaxKind) -> bool { kind == SHR } | ||
999 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1000 | if Self::can_cast(syntax.kind()) { | ||
1001 | Some(Self { syntax }) | ||
1002 | } else { | ||
1003 | None | ||
1004 | } | ||
1005 | } | ||
1006 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1007 | } | ||
1008 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1009 | pub struct Shleq { | ||
1010 | pub(crate) syntax: SyntaxToken, | ||
1011 | } | ||
1012 | impl std::fmt::Display for Shleq { | ||
1013 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1014 | std::fmt::Display::fmt(&self.syntax, f) | ||
1015 | } | ||
1016 | } | ||
1017 | impl AstToken for Shleq { | ||
1018 | fn can_cast(kind: SyntaxKind) -> bool { kind == SHLEQ } | ||
1019 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1020 | if Self::can_cast(syntax.kind()) { | ||
1021 | Some(Self { syntax }) | ||
1022 | } else { | ||
1023 | None | ||
1024 | } | ||
1025 | } | ||
1026 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1027 | } | ||
1028 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1029 | pub struct Shreq { | ||
1030 | pub(crate) syntax: SyntaxToken, | ||
1031 | } | ||
1032 | impl std::fmt::Display for Shreq { | ||
1033 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1034 | std::fmt::Display::fmt(&self.syntax, f) | ||
1035 | } | ||
1036 | } | ||
1037 | impl AstToken for Shreq { | ||
1038 | fn can_cast(kind: SyntaxKind) -> bool { kind == SHREQ } | ||
1039 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1040 | if Self::can_cast(syntax.kind()) { | ||
1041 | Some(Self { syntax }) | ||
1042 | } else { | ||
1043 | None | ||
1044 | } | ||
1045 | } | ||
1046 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1047 | } | ||
1048 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1049 | pub struct AsKw { | ||
1050 | pub(crate) syntax: SyntaxToken, | ||
1051 | } | ||
1052 | impl std::fmt::Display for AsKw { | ||
1053 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1054 | std::fmt::Display::fmt(&self.syntax, f) | ||
1055 | } | ||
1056 | } | ||
1057 | impl AstToken for AsKw { | ||
1058 | fn can_cast(kind: SyntaxKind) -> bool { kind == AS_KW } | ||
1059 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1060 | if Self::can_cast(syntax.kind()) { | ||
1061 | Some(Self { syntax }) | ||
1062 | } else { | ||
1063 | None | ||
1064 | } | ||
1065 | } | ||
1066 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1067 | } | ||
1068 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1069 | pub struct AsyncKw { | ||
1070 | pub(crate) syntax: SyntaxToken, | ||
1071 | } | ||
1072 | impl std::fmt::Display for AsyncKw { | ||
1073 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1074 | std::fmt::Display::fmt(&self.syntax, f) | ||
1075 | } | ||
1076 | } | ||
1077 | impl AstToken for AsyncKw { | ||
1078 | fn can_cast(kind: SyntaxKind) -> bool { kind == ASYNC_KW } | ||
1079 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1080 | if Self::can_cast(syntax.kind()) { | ||
1081 | Some(Self { syntax }) | ||
1082 | } else { | ||
1083 | None | ||
1084 | } | ||
1085 | } | ||
1086 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1087 | } | ||
1088 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1089 | pub struct AwaitKw { | ||
1090 | pub(crate) syntax: SyntaxToken, | ||
1091 | } | ||
1092 | impl std::fmt::Display for AwaitKw { | ||
1093 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1094 | std::fmt::Display::fmt(&self.syntax, f) | ||
1095 | } | ||
1096 | } | ||
1097 | impl AstToken for AwaitKw { | ||
1098 | fn can_cast(kind: SyntaxKind) -> bool { kind == AWAIT_KW } | ||
1099 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1100 | if Self::can_cast(syntax.kind()) { | ||
1101 | Some(Self { syntax }) | ||
1102 | } else { | ||
1103 | None | ||
1104 | } | ||
1105 | } | ||
1106 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1107 | } | ||
1108 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1109 | pub struct BoxKw { | ||
1110 | pub(crate) syntax: SyntaxToken, | ||
1111 | } | ||
1112 | impl std::fmt::Display for BoxKw { | ||
1113 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1114 | std::fmt::Display::fmt(&self.syntax, f) | ||
1115 | } | ||
1116 | } | ||
1117 | impl AstToken for BoxKw { | ||
1118 | fn can_cast(kind: SyntaxKind) -> bool { kind == BOX_KW } | ||
1119 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1120 | if Self::can_cast(syntax.kind()) { | ||
1121 | Some(Self { syntax }) | ||
1122 | } else { | ||
1123 | None | ||
1124 | } | ||
1125 | } | ||
1126 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1127 | } | ||
1128 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1129 | pub struct BreakKw { | ||
1130 | pub(crate) syntax: SyntaxToken, | ||
1131 | } | ||
1132 | impl std::fmt::Display for BreakKw { | ||
1133 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1134 | std::fmt::Display::fmt(&self.syntax, f) | ||
1135 | } | ||
1136 | } | ||
1137 | impl AstToken for BreakKw { | ||
1138 | fn can_cast(kind: SyntaxKind) -> bool { kind == BREAK_KW } | ||
1139 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1140 | if Self::can_cast(syntax.kind()) { | ||
1141 | Some(Self { syntax }) | ||
1142 | } else { | ||
1143 | None | ||
1144 | } | ||
1145 | } | ||
1146 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1147 | } | ||
1148 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1149 | pub struct ConstKw { | ||
1150 | pub(crate) syntax: SyntaxToken, | ||
1151 | } | ||
1152 | impl std::fmt::Display for ConstKw { | ||
1153 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1154 | std::fmt::Display::fmt(&self.syntax, f) | ||
1155 | } | ||
1156 | } | ||
1157 | impl AstToken for ConstKw { | ||
1158 | fn can_cast(kind: SyntaxKind) -> bool { kind == CONST_KW } | ||
1159 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1160 | if Self::can_cast(syntax.kind()) { | ||
1161 | Some(Self { syntax }) | ||
1162 | } else { | ||
1163 | None | ||
1164 | } | ||
1165 | } | ||
1166 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1167 | } | ||
1168 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1169 | pub struct ContinueKw { | ||
1170 | pub(crate) syntax: SyntaxToken, | ||
1171 | } | ||
1172 | impl std::fmt::Display for ContinueKw { | ||
1173 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1174 | std::fmt::Display::fmt(&self.syntax, f) | ||
1175 | } | ||
1176 | } | ||
1177 | impl AstToken for ContinueKw { | ||
1178 | fn can_cast(kind: SyntaxKind) -> bool { kind == CONTINUE_KW } | ||
1179 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1180 | if Self::can_cast(syntax.kind()) { | ||
1181 | Some(Self { syntax }) | ||
1182 | } else { | ||
1183 | None | ||
1184 | } | ||
1185 | } | ||
1186 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1187 | } | ||
1188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1189 | pub struct CrateKw { | ||
1190 | pub(crate) syntax: SyntaxToken, | ||
1191 | } | ||
1192 | impl std::fmt::Display for CrateKw { | ||
1193 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1194 | std::fmt::Display::fmt(&self.syntax, f) | ||
1195 | } | ||
1196 | } | ||
1197 | impl AstToken for CrateKw { | ||
1198 | fn can_cast(kind: SyntaxKind) -> bool { kind == CRATE_KW } | ||
1199 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1200 | if Self::can_cast(syntax.kind()) { | ||
1201 | Some(Self { syntax }) | ||
1202 | } else { | ||
1203 | None | ||
1204 | } | ||
1205 | } | ||
1206 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1207 | } | ||
1208 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1209 | pub struct DynKw { | ||
1210 | pub(crate) syntax: SyntaxToken, | ||
1211 | } | ||
1212 | impl std::fmt::Display for DynKw { | ||
1213 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1214 | std::fmt::Display::fmt(&self.syntax, f) | ||
1215 | } | ||
1216 | } | ||
1217 | impl AstToken for DynKw { | ||
1218 | fn can_cast(kind: SyntaxKind) -> bool { kind == DYN_KW } | ||
1219 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1220 | if Self::can_cast(syntax.kind()) { | ||
1221 | Some(Self { syntax }) | ||
1222 | } else { | ||
1223 | None | ||
1224 | } | ||
1225 | } | ||
1226 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1227 | } | ||
1228 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1229 | pub struct ElseKw { | ||
1230 | pub(crate) syntax: SyntaxToken, | ||
1231 | } | ||
1232 | impl std::fmt::Display for ElseKw { | ||
1233 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1234 | std::fmt::Display::fmt(&self.syntax, f) | ||
1235 | } | ||
1236 | } | ||
1237 | impl AstToken for ElseKw { | ||
1238 | fn can_cast(kind: SyntaxKind) -> bool { kind == ELSE_KW } | ||
1239 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1240 | if Self::can_cast(syntax.kind()) { | ||
1241 | Some(Self { syntax }) | ||
1242 | } else { | ||
1243 | None | ||
1244 | } | ||
1245 | } | ||
1246 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1247 | } | ||
1248 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1249 | pub struct EnumKw { | ||
1250 | pub(crate) syntax: SyntaxToken, | ||
1251 | } | ||
1252 | impl std::fmt::Display for EnumKw { | ||
1253 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1254 | std::fmt::Display::fmt(&self.syntax, f) | ||
1255 | } | ||
1256 | } | ||
1257 | impl AstToken for EnumKw { | ||
1258 | fn can_cast(kind: SyntaxKind) -> bool { kind == ENUM_KW } | ||
1259 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1260 | if Self::can_cast(syntax.kind()) { | ||
1261 | Some(Self { syntax }) | ||
1262 | } else { | ||
1263 | None | ||
1264 | } | ||
1265 | } | ||
1266 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1267 | } | ||
1268 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1269 | pub struct ExternKw { | ||
1270 | pub(crate) syntax: SyntaxToken, | ||
1271 | } | ||
1272 | impl std::fmt::Display for ExternKw { | ||
1273 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1274 | std::fmt::Display::fmt(&self.syntax, f) | ||
1275 | } | ||
1276 | } | ||
1277 | impl AstToken for ExternKw { | ||
1278 | fn can_cast(kind: SyntaxKind) -> bool { kind == EXTERN_KW } | ||
1279 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1280 | if Self::can_cast(syntax.kind()) { | ||
1281 | Some(Self { syntax }) | ||
1282 | } else { | ||
1283 | None | ||
1284 | } | ||
1285 | } | ||
1286 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1287 | } | ||
1288 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1289 | pub struct FalseKw { | ||
1290 | pub(crate) syntax: SyntaxToken, | ||
1291 | } | ||
1292 | impl std::fmt::Display for FalseKw { | ||
1293 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1294 | std::fmt::Display::fmt(&self.syntax, f) | ||
1295 | } | ||
1296 | } | ||
1297 | impl AstToken for FalseKw { | ||
1298 | fn can_cast(kind: SyntaxKind) -> bool { kind == FALSE_KW } | ||
1299 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1300 | if Self::can_cast(syntax.kind()) { | ||
1301 | Some(Self { syntax }) | ||
1302 | } else { | ||
1303 | None | ||
1304 | } | ||
1305 | } | ||
1306 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1307 | } | ||
1308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1309 | pub struct FnKw { | ||
1310 | pub(crate) syntax: SyntaxToken, | ||
1311 | } | ||
1312 | impl std::fmt::Display for FnKw { | ||
1313 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1314 | std::fmt::Display::fmt(&self.syntax, f) | ||
1315 | } | ||
1316 | } | ||
1317 | impl AstToken for FnKw { | ||
1318 | fn can_cast(kind: SyntaxKind) -> bool { kind == FN_KW } | ||
1319 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1320 | if Self::can_cast(syntax.kind()) { | ||
1321 | Some(Self { syntax }) | ||
1322 | } else { | ||
1323 | None | ||
1324 | } | ||
1325 | } | ||
1326 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1327 | } | ||
1328 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1329 | pub struct ForKw { | ||
1330 | pub(crate) syntax: SyntaxToken, | ||
1331 | } | ||
1332 | impl std::fmt::Display for ForKw { | ||
1333 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1334 | std::fmt::Display::fmt(&self.syntax, f) | ||
1335 | } | ||
1336 | } | ||
1337 | impl AstToken for ForKw { | ||
1338 | fn can_cast(kind: SyntaxKind) -> bool { kind == FOR_KW } | ||
1339 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1340 | if Self::can_cast(syntax.kind()) { | ||
1341 | Some(Self { syntax }) | ||
1342 | } else { | ||
1343 | None | ||
1344 | } | ||
1345 | } | ||
1346 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1347 | } | ||
1348 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1349 | pub struct IfKw { | ||
1350 | pub(crate) syntax: SyntaxToken, | ||
1351 | } | ||
1352 | impl std::fmt::Display for IfKw { | ||
1353 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1354 | std::fmt::Display::fmt(&self.syntax, f) | ||
1355 | } | ||
1356 | } | ||
1357 | impl AstToken for IfKw { | ||
1358 | fn can_cast(kind: SyntaxKind) -> bool { kind == IF_KW } | ||
1359 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1360 | if Self::can_cast(syntax.kind()) { | ||
1361 | Some(Self { syntax }) | ||
1362 | } else { | ||
1363 | None | ||
1364 | } | ||
1365 | } | ||
1366 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1367 | } | ||
1368 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1369 | pub struct ImplKw { | ||
1370 | pub(crate) syntax: SyntaxToken, | ||
1371 | } | ||
1372 | impl std::fmt::Display for ImplKw { | ||
1373 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1374 | std::fmt::Display::fmt(&self.syntax, f) | ||
1375 | } | ||
1376 | } | ||
1377 | impl AstToken for ImplKw { | ||
1378 | fn can_cast(kind: SyntaxKind) -> bool { kind == IMPL_KW } | ||
1379 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1380 | if Self::can_cast(syntax.kind()) { | ||
1381 | Some(Self { syntax }) | ||
1382 | } else { | ||
1383 | None | ||
1384 | } | ||
1385 | } | ||
1386 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1387 | } | ||
1388 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1389 | pub struct InKw { | ||
1390 | pub(crate) syntax: SyntaxToken, | ||
1391 | } | ||
1392 | impl std::fmt::Display for InKw { | ||
1393 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1394 | std::fmt::Display::fmt(&self.syntax, f) | ||
1395 | } | ||
1396 | } | ||
1397 | impl AstToken for InKw { | ||
1398 | fn can_cast(kind: SyntaxKind) -> bool { kind == IN_KW } | ||
1399 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1400 | if Self::can_cast(syntax.kind()) { | ||
1401 | Some(Self { syntax }) | ||
1402 | } else { | ||
1403 | None | ||
1404 | } | ||
1405 | } | ||
1406 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1407 | } | ||
1408 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1409 | pub struct LetKw { | ||
1410 | pub(crate) syntax: SyntaxToken, | ||
1411 | } | ||
1412 | impl std::fmt::Display for LetKw { | ||
1413 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1414 | std::fmt::Display::fmt(&self.syntax, f) | ||
1415 | } | ||
1416 | } | ||
1417 | impl AstToken for LetKw { | ||
1418 | fn can_cast(kind: SyntaxKind) -> bool { kind == LET_KW } | ||
1419 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1420 | if Self::can_cast(syntax.kind()) { | ||
1421 | Some(Self { syntax }) | ||
1422 | } else { | ||
1423 | None | ||
1424 | } | ||
1425 | } | ||
1426 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1427 | } | ||
1428 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1429 | pub struct LoopKw { | ||
1430 | pub(crate) syntax: SyntaxToken, | ||
1431 | } | ||
1432 | impl std::fmt::Display for LoopKw { | ||
1433 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1434 | std::fmt::Display::fmt(&self.syntax, f) | ||
1435 | } | ||
1436 | } | ||
1437 | impl AstToken for LoopKw { | ||
1438 | fn can_cast(kind: SyntaxKind) -> bool { kind == LOOP_KW } | ||
1439 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1440 | if Self::can_cast(syntax.kind()) { | ||
1441 | Some(Self { syntax }) | ||
1442 | } else { | ||
1443 | None | ||
1444 | } | ||
1445 | } | ||
1446 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1447 | } | ||
1448 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1449 | pub struct MacroKw { | ||
1450 | pub(crate) syntax: SyntaxToken, | ||
1451 | } | ||
1452 | impl std::fmt::Display for MacroKw { | ||
1453 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1454 | std::fmt::Display::fmt(&self.syntax, f) | ||
1455 | } | ||
1456 | } | ||
1457 | impl AstToken for MacroKw { | ||
1458 | fn can_cast(kind: SyntaxKind) -> bool { kind == MACRO_KW } | ||
1459 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1460 | if Self::can_cast(syntax.kind()) { | ||
1461 | Some(Self { syntax }) | ||
1462 | } else { | ||
1463 | None | ||
1464 | } | ||
1465 | } | ||
1466 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1467 | } | ||
1468 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1469 | pub struct MatchKw { | ||
1470 | pub(crate) syntax: SyntaxToken, | ||
1471 | } | ||
1472 | impl std::fmt::Display for MatchKw { | ||
1473 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1474 | std::fmt::Display::fmt(&self.syntax, f) | ||
1475 | } | ||
1476 | } | ||
1477 | impl AstToken for MatchKw { | ||
1478 | fn can_cast(kind: SyntaxKind) -> bool { kind == MATCH_KW } | ||
1479 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1480 | if Self::can_cast(syntax.kind()) { | ||
1481 | Some(Self { syntax }) | ||
1482 | } else { | ||
1483 | None | ||
1484 | } | ||
1485 | } | ||
1486 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1487 | } | ||
1488 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1489 | pub struct ModKw { | ||
1490 | pub(crate) syntax: SyntaxToken, | ||
1491 | } | ||
1492 | impl std::fmt::Display for ModKw { | ||
1493 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1494 | std::fmt::Display::fmt(&self.syntax, f) | ||
1495 | } | ||
1496 | } | ||
1497 | impl AstToken for ModKw { | ||
1498 | fn can_cast(kind: SyntaxKind) -> bool { kind == MOD_KW } | ||
1499 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1500 | if Self::can_cast(syntax.kind()) { | ||
1501 | Some(Self { syntax }) | ||
1502 | } else { | ||
1503 | None | ||
1504 | } | ||
1505 | } | ||
1506 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1507 | } | ||
1508 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1509 | pub struct MoveKw { | ||
1510 | pub(crate) syntax: SyntaxToken, | ||
1511 | } | ||
1512 | impl std::fmt::Display for MoveKw { | ||
1513 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1514 | std::fmt::Display::fmt(&self.syntax, f) | ||
1515 | } | ||
1516 | } | ||
1517 | impl AstToken for MoveKw { | ||
1518 | fn can_cast(kind: SyntaxKind) -> bool { kind == MOVE_KW } | ||
1519 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1520 | if Self::can_cast(syntax.kind()) { | ||
1521 | Some(Self { syntax }) | ||
1522 | } else { | ||
1523 | None | ||
1524 | } | ||
1525 | } | ||
1526 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1527 | } | ||
1528 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1529 | pub struct MutKw { | ||
1530 | pub(crate) syntax: SyntaxToken, | ||
1531 | } | ||
1532 | impl std::fmt::Display for MutKw { | ||
1533 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1534 | std::fmt::Display::fmt(&self.syntax, f) | ||
1535 | } | ||
1536 | } | ||
1537 | impl AstToken for MutKw { | ||
1538 | fn can_cast(kind: SyntaxKind) -> bool { kind == MUT_KW } | ||
1539 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1540 | if Self::can_cast(syntax.kind()) { | ||
1541 | Some(Self { syntax }) | ||
1542 | } else { | ||
1543 | None | ||
1544 | } | ||
1545 | } | ||
1546 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1547 | } | ||
1548 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1549 | pub struct PubKw { | ||
1550 | pub(crate) syntax: SyntaxToken, | ||
1551 | } | ||
1552 | impl std::fmt::Display for PubKw { | ||
1553 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1554 | std::fmt::Display::fmt(&self.syntax, f) | ||
1555 | } | ||
1556 | } | ||
1557 | impl AstToken for PubKw { | ||
1558 | fn can_cast(kind: SyntaxKind) -> bool { kind == PUB_KW } | ||
1559 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1560 | if Self::can_cast(syntax.kind()) { | ||
1561 | Some(Self { syntax }) | ||
1562 | } else { | ||
1563 | None | ||
1564 | } | ||
1565 | } | ||
1566 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1567 | } | ||
1568 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1569 | pub struct RefKw { | ||
1570 | pub(crate) syntax: SyntaxToken, | ||
1571 | } | ||
1572 | impl std::fmt::Display for RefKw { | ||
1573 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1574 | std::fmt::Display::fmt(&self.syntax, f) | ||
1575 | } | ||
1576 | } | ||
1577 | impl AstToken for RefKw { | ||
1578 | fn can_cast(kind: SyntaxKind) -> bool { kind == REF_KW } | ||
1579 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1580 | if Self::can_cast(syntax.kind()) { | ||
1581 | Some(Self { syntax }) | ||
1582 | } else { | ||
1583 | None | ||
1584 | } | ||
1585 | } | ||
1586 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1587 | } | ||
1588 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1589 | pub struct ReturnKw { | ||
1590 | pub(crate) syntax: SyntaxToken, | ||
1591 | } | ||
1592 | impl std::fmt::Display for ReturnKw { | ||
1593 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1594 | std::fmt::Display::fmt(&self.syntax, f) | ||
1595 | } | ||
1596 | } | ||
1597 | impl AstToken for ReturnKw { | ||
1598 | fn can_cast(kind: SyntaxKind) -> bool { kind == RETURN_KW } | ||
1599 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1600 | if Self::can_cast(syntax.kind()) { | ||
1601 | Some(Self { syntax }) | ||
1602 | } else { | ||
1603 | None | ||
1604 | } | ||
1605 | } | ||
1606 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1607 | } | ||
1608 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1609 | pub struct SelfKw { | ||
1610 | pub(crate) syntax: SyntaxToken, | ||
1611 | } | ||
1612 | impl std::fmt::Display for SelfKw { | ||
1613 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1614 | std::fmt::Display::fmt(&self.syntax, f) | ||
1615 | } | ||
1616 | } | ||
1617 | impl AstToken for SelfKw { | ||
1618 | fn can_cast(kind: SyntaxKind) -> bool { kind == SELF_KW } | ||
1619 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1620 | if Self::can_cast(syntax.kind()) { | ||
1621 | Some(Self { syntax }) | ||
1622 | } else { | ||
1623 | None | ||
1624 | } | ||
1625 | } | ||
1626 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1627 | } | ||
1628 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1629 | pub struct StaticKw { | ||
1630 | pub(crate) syntax: SyntaxToken, | ||
1631 | } | ||
1632 | impl std::fmt::Display for StaticKw { | ||
1633 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1634 | std::fmt::Display::fmt(&self.syntax, f) | ||
1635 | } | ||
1636 | } | ||
1637 | impl AstToken for StaticKw { | ||
1638 | fn can_cast(kind: SyntaxKind) -> bool { kind == STATIC_KW } | ||
1639 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1640 | if Self::can_cast(syntax.kind()) { | ||
1641 | Some(Self { syntax }) | ||
1642 | } else { | ||
1643 | None | ||
1644 | } | ||
1645 | } | ||
1646 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1647 | } | ||
1648 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1649 | pub struct StructKw { | ||
1650 | pub(crate) syntax: SyntaxToken, | ||
1651 | } | ||
1652 | impl std::fmt::Display for StructKw { | ||
1653 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1654 | std::fmt::Display::fmt(&self.syntax, f) | ||
1655 | } | ||
1656 | } | ||
1657 | impl AstToken for StructKw { | ||
1658 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRUCT_KW } | ||
1659 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1660 | if Self::can_cast(syntax.kind()) { | ||
1661 | Some(Self { syntax }) | ||
1662 | } else { | ||
1663 | None | ||
1664 | } | ||
1665 | } | ||
1666 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1667 | } | ||
1668 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1669 | pub struct SuperKw { | ||
1670 | pub(crate) syntax: SyntaxToken, | ||
1671 | } | ||
1672 | impl std::fmt::Display for SuperKw { | ||
1673 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1674 | std::fmt::Display::fmt(&self.syntax, f) | ||
1675 | } | ||
1676 | } | ||
1677 | impl AstToken for SuperKw { | ||
1678 | fn can_cast(kind: SyntaxKind) -> bool { kind == SUPER_KW } | ||
1679 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1680 | if Self::can_cast(syntax.kind()) { | ||
1681 | Some(Self { syntax }) | ||
1682 | } else { | ||
1683 | None | ||
1684 | } | ||
1685 | } | ||
1686 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1687 | } | ||
1688 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1689 | pub struct TraitKw { | ||
1690 | pub(crate) syntax: SyntaxToken, | ||
1691 | } | ||
1692 | impl std::fmt::Display for TraitKw { | ||
1693 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1694 | std::fmt::Display::fmt(&self.syntax, f) | ||
1695 | } | ||
1696 | } | ||
1697 | impl AstToken for TraitKw { | ||
1698 | fn can_cast(kind: SyntaxKind) -> bool { kind == TRAIT_KW } | ||
1699 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1700 | if Self::can_cast(syntax.kind()) { | ||
1701 | Some(Self { syntax }) | ||
1702 | } else { | ||
1703 | None | ||
1704 | } | ||
1705 | } | ||
1706 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1707 | } | ||
1708 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1709 | pub struct TrueKw { | ||
1710 | pub(crate) syntax: SyntaxToken, | ||
1711 | } | ||
1712 | impl std::fmt::Display for TrueKw { | ||
1713 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1714 | std::fmt::Display::fmt(&self.syntax, f) | ||
1715 | } | ||
1716 | } | ||
1717 | impl AstToken for TrueKw { | ||
1718 | fn can_cast(kind: SyntaxKind) -> bool { kind == TRUE_KW } | ||
1719 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1720 | if Self::can_cast(syntax.kind()) { | ||
1721 | Some(Self { syntax }) | ||
1722 | } else { | ||
1723 | None | ||
1724 | } | ||
1725 | } | ||
1726 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1727 | } | ||
1728 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1729 | pub struct TryKw { | ||
1730 | pub(crate) syntax: SyntaxToken, | ||
1731 | } | ||
1732 | impl std::fmt::Display for TryKw { | ||
1733 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1734 | std::fmt::Display::fmt(&self.syntax, f) | ||
1735 | } | ||
1736 | } | ||
1737 | impl AstToken for TryKw { | ||
1738 | fn can_cast(kind: SyntaxKind) -> bool { kind == TRY_KW } | ||
1739 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1740 | if Self::can_cast(syntax.kind()) { | ||
1741 | Some(Self { syntax }) | ||
1742 | } else { | ||
1743 | None | ||
1744 | } | ||
1745 | } | ||
1746 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1747 | } | ||
1748 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1749 | pub struct TypeKw { | ||
1750 | pub(crate) syntax: SyntaxToken, | ||
1751 | } | ||
1752 | impl std::fmt::Display for TypeKw { | ||
1753 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1754 | std::fmt::Display::fmt(&self.syntax, f) | ||
1755 | } | ||
1756 | } | ||
1757 | impl AstToken for TypeKw { | ||
1758 | fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_KW } | ||
1759 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1760 | if Self::can_cast(syntax.kind()) { | ||
1761 | Some(Self { syntax }) | ||
1762 | } else { | ||
1763 | None | ||
1764 | } | ||
1765 | } | ||
1766 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1767 | } | ||
1768 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1769 | pub struct UnsafeKw { | ||
1770 | pub(crate) syntax: SyntaxToken, | ||
1771 | } | ||
1772 | impl std::fmt::Display for UnsafeKw { | ||
1773 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1774 | std::fmt::Display::fmt(&self.syntax, f) | ||
1775 | } | ||
1776 | } | ||
1777 | impl AstToken for UnsafeKw { | ||
1778 | fn can_cast(kind: SyntaxKind) -> bool { kind == UNSAFE_KW } | ||
1779 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1780 | if Self::can_cast(syntax.kind()) { | ||
1781 | Some(Self { syntax }) | ||
1782 | } else { | ||
1783 | None | ||
1784 | } | ||
1785 | } | ||
1786 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1787 | } | ||
1788 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1789 | pub struct UseKw { | ||
1790 | pub(crate) syntax: SyntaxToken, | ||
1791 | } | ||
1792 | impl std::fmt::Display for UseKw { | ||
1793 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1794 | std::fmt::Display::fmt(&self.syntax, f) | ||
1795 | } | ||
1796 | } | ||
1797 | impl AstToken for UseKw { | ||
1798 | fn can_cast(kind: SyntaxKind) -> bool { kind == USE_KW } | ||
1799 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1800 | if Self::can_cast(syntax.kind()) { | ||
1801 | Some(Self { syntax }) | ||
1802 | } else { | ||
1803 | None | ||
1804 | } | ||
1805 | } | ||
1806 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1807 | } | ||
1808 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1809 | pub struct WhereKw { | ||
1810 | pub(crate) syntax: SyntaxToken, | ||
1811 | } | ||
1812 | impl std::fmt::Display for WhereKw { | ||
1813 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1814 | std::fmt::Display::fmt(&self.syntax, f) | ||
1815 | } | ||
1816 | } | ||
1817 | impl AstToken for WhereKw { | ||
1818 | fn can_cast(kind: SyntaxKind) -> bool { kind == WHERE_KW } | ||
1819 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1820 | if Self::can_cast(syntax.kind()) { | ||
1821 | Some(Self { syntax }) | ||
1822 | } else { | ||
1823 | None | ||
1824 | } | ||
1825 | } | ||
1826 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1827 | } | ||
1828 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1829 | pub struct WhileKw { | ||
1830 | pub(crate) syntax: SyntaxToken, | ||
1831 | } | ||
1832 | impl std::fmt::Display for WhileKw { | ||
1833 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1834 | std::fmt::Display::fmt(&self.syntax, f) | ||
1835 | } | ||
1836 | } | ||
1837 | impl AstToken for WhileKw { | ||
1838 | fn can_cast(kind: SyntaxKind) -> bool { kind == WHILE_KW } | ||
1839 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1840 | if Self::can_cast(syntax.kind()) { | ||
1841 | Some(Self { syntax }) | ||
1842 | } else { | ||
1843 | None | ||
1844 | } | ||
1845 | } | ||
1846 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1847 | } | ||
1848 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1849 | pub struct AutoKw { | ||
1850 | pub(crate) syntax: SyntaxToken, | ||
1851 | } | ||
1852 | impl std::fmt::Display for AutoKw { | ||
1853 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1854 | std::fmt::Display::fmt(&self.syntax, f) | ||
1855 | } | ||
1856 | } | ||
1857 | impl AstToken for AutoKw { | ||
1858 | fn can_cast(kind: SyntaxKind) -> bool { kind == AUTO_KW } | ||
1859 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1860 | if Self::can_cast(syntax.kind()) { | ||
1861 | Some(Self { syntax }) | ||
1862 | } else { | ||
1863 | None | ||
1864 | } | ||
1865 | } | ||
1866 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1867 | } | ||
1868 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1869 | pub struct DefaultKw { | ||
1870 | pub(crate) syntax: SyntaxToken, | ||
1871 | } | ||
1872 | impl std::fmt::Display for DefaultKw { | ||
1873 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1874 | std::fmt::Display::fmt(&self.syntax, f) | ||
1875 | } | ||
1876 | } | ||
1877 | impl AstToken for DefaultKw { | ||
1878 | fn can_cast(kind: SyntaxKind) -> bool { kind == DEFAULT_KW } | ||
1879 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1880 | if Self::can_cast(syntax.kind()) { | ||
1881 | Some(Self { syntax }) | ||
1882 | } else { | ||
1883 | None | ||
1884 | } | ||
1885 | } | ||
1886 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1887 | } | ||
1888 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1889 | pub struct ExistentialKw { | ||
1890 | pub(crate) syntax: SyntaxToken, | ||
1891 | } | ||
1892 | impl std::fmt::Display for ExistentialKw { | ||
1893 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1894 | std::fmt::Display::fmt(&self.syntax, f) | ||
1895 | } | ||
1896 | } | ||
1897 | impl AstToken for ExistentialKw { | ||
1898 | fn can_cast(kind: SyntaxKind) -> bool { kind == EXISTENTIAL_KW } | ||
1899 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1900 | if Self::can_cast(syntax.kind()) { | ||
1901 | Some(Self { syntax }) | ||
1902 | } else { | ||
1903 | None | ||
1904 | } | ||
1905 | } | ||
1906 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1907 | } | ||
1908 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1909 | pub struct UnionKw { | ||
1910 | pub(crate) syntax: SyntaxToken, | ||
1911 | } | ||
1912 | impl std::fmt::Display for UnionKw { | ||
1913 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1914 | std::fmt::Display::fmt(&self.syntax, f) | ||
1915 | } | ||
1916 | } | ||
1917 | impl AstToken for UnionKw { | ||
1918 | fn can_cast(kind: SyntaxKind) -> bool { kind == UNION_KW } | ||
1919 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1920 | if Self::can_cast(syntax.kind()) { | ||
1921 | Some(Self { syntax }) | ||
1922 | } else { | ||
1923 | None | ||
1924 | } | ||
1925 | } | ||
1926 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1927 | } | ||
1928 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1929 | pub struct RawKw { | ||
1930 | pub(crate) syntax: SyntaxToken, | ||
1931 | } | ||
1932 | impl std::fmt::Display for RawKw { | ||
1933 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1934 | std::fmt::Display::fmt(&self.syntax, f) | ||
1935 | } | ||
1936 | } | ||
1937 | impl AstToken for RawKw { | ||
1938 | fn can_cast(kind: SyntaxKind) -> bool { kind == RAW_KW } | ||
1939 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1940 | if Self::can_cast(syntax.kind()) { | ||
1941 | Some(Self { syntax }) | ||
1942 | } else { | ||
1943 | None | ||
1944 | } | ||
1945 | } | ||
1946 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1947 | } | ||
1948 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1949 | pub struct IntNumber { | ||
1950 | pub(crate) syntax: SyntaxToken, | ||
1951 | } | ||
1952 | impl std::fmt::Display for IntNumber { | ||
1953 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1954 | std::fmt::Display::fmt(&self.syntax, f) | ||
1955 | } | ||
1956 | } | ||
1957 | impl AstToken for IntNumber { | ||
1958 | fn can_cast(kind: SyntaxKind) -> bool { kind == INT_NUMBER } | ||
1959 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1960 | if Self::can_cast(syntax.kind()) { | ||
1961 | Some(Self { syntax }) | ||
1962 | } else { | ||
1963 | None | ||
1964 | } | ||
1965 | } | ||
1966 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1967 | } | ||
1968 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1969 | pub struct FloatNumber { | ||
1970 | pub(crate) syntax: SyntaxToken, | ||
1971 | } | ||
1972 | impl std::fmt::Display for FloatNumber { | ||
1973 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1974 | std::fmt::Display::fmt(&self.syntax, f) | ||
1975 | } | ||
1976 | } | ||
1977 | impl AstToken for FloatNumber { | ||
1978 | fn can_cast(kind: SyntaxKind) -> bool { kind == FLOAT_NUMBER } | ||
1979 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
1980 | if Self::can_cast(syntax.kind()) { | ||
1981 | Some(Self { syntax }) | ||
1982 | } else { | ||
1983 | None | ||
1984 | } | ||
1985 | } | ||
1986 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
1987 | } | ||
1988 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
1989 | pub struct Char { | ||
1990 | pub(crate) syntax: SyntaxToken, | ||
1991 | } | ||
1992 | impl std::fmt::Display for Char { | ||
1993 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
1994 | std::fmt::Display::fmt(&self.syntax, f) | ||
1995 | } | ||
1996 | } | ||
1997 | impl AstToken for Char { | ||
1998 | fn can_cast(kind: SyntaxKind) -> bool { kind == CHAR } | ||
1999 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2000 | if Self::can_cast(syntax.kind()) { | ||
2001 | Some(Self { syntax }) | ||
2002 | } else { | ||
2003 | None | ||
2004 | } | ||
2005 | } | ||
2006 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2007 | } | ||
2008 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2009 | pub struct Byte { | ||
2010 | pub(crate) syntax: SyntaxToken, | ||
2011 | } | ||
2012 | impl std::fmt::Display for Byte { | ||
2013 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2014 | std::fmt::Display::fmt(&self.syntax, f) | ||
2015 | } | ||
2016 | } | ||
2017 | impl AstToken for Byte { | ||
2018 | fn can_cast(kind: SyntaxKind) -> bool { kind == BYTE } | ||
2019 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2020 | if Self::can_cast(syntax.kind()) { | ||
2021 | Some(Self { syntax }) | ||
2022 | } else { | ||
2023 | None | ||
2024 | } | ||
2025 | } | ||
2026 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2027 | } | ||
2028 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2029 | pub struct String { | ||
2030 | pub(crate) syntax: SyntaxToken, | ||
2031 | } | ||
2032 | impl std::fmt::Display for String { | ||
2033 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2034 | std::fmt::Display::fmt(&self.syntax, f) | ||
2035 | } | ||
2036 | } | ||
2037 | impl AstToken for String { | ||
2038 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRING } | ||
2039 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2040 | if Self::can_cast(syntax.kind()) { | ||
2041 | Some(Self { syntax }) | ||
2042 | } else { | ||
2043 | None | ||
2044 | } | ||
2045 | } | ||
2046 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2047 | } | ||
2048 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2049 | pub struct RawString { | ||
2050 | pub(crate) syntax: SyntaxToken, | ||
2051 | } | ||
2052 | impl std::fmt::Display for RawString { | ||
2053 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2054 | std::fmt::Display::fmt(&self.syntax, f) | ||
2055 | } | ||
2056 | } | ||
2057 | impl AstToken for RawString { | ||
2058 | fn can_cast(kind: SyntaxKind) -> bool { kind == RAW_STRING } | ||
2059 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2060 | if Self::can_cast(syntax.kind()) { | ||
2061 | Some(Self { syntax }) | ||
2062 | } else { | ||
2063 | None | ||
2064 | } | ||
2065 | } | ||
2066 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2067 | } | ||
2068 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2069 | pub struct ByteString { | ||
2070 | pub(crate) syntax: SyntaxToken, | ||
2071 | } | ||
2072 | impl std::fmt::Display for ByteString { | ||
2073 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2074 | std::fmt::Display::fmt(&self.syntax, f) | ||
2075 | } | ||
2076 | } | ||
2077 | impl AstToken for ByteString { | ||
2078 | fn can_cast(kind: SyntaxKind) -> bool { kind == BYTE_STRING } | ||
2079 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2080 | if Self::can_cast(syntax.kind()) { | ||
2081 | Some(Self { syntax }) | ||
2082 | } else { | ||
2083 | None | ||
2084 | } | ||
2085 | } | ||
2086 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2087 | } | ||
2088 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2089 | pub struct RawByteString { | ||
2090 | pub(crate) syntax: SyntaxToken, | ||
2091 | } | ||
2092 | impl std::fmt::Display for RawByteString { | ||
2093 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2094 | std::fmt::Display::fmt(&self.syntax, f) | ||
2095 | } | ||
2096 | } | ||
2097 | impl AstToken for RawByteString { | ||
2098 | fn can_cast(kind: SyntaxKind) -> bool { kind == RAW_BYTE_STRING } | ||
2099 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2100 | if Self::can_cast(syntax.kind()) { | ||
2101 | Some(Self { syntax }) | ||
2102 | } else { | ||
2103 | None | ||
2104 | } | ||
2105 | } | ||
2106 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2107 | } | ||
2108 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2109 | pub struct Error { | ||
2110 | pub(crate) syntax: SyntaxToken, | ||
2111 | } | ||
2112 | impl std::fmt::Display for Error { | ||
2113 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2114 | std::fmt::Display::fmt(&self.syntax, f) | ||
2115 | } | ||
2116 | } | ||
2117 | impl AstToken for Error { | ||
2118 | fn can_cast(kind: SyntaxKind) -> bool { kind == ERROR } | ||
2119 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2120 | if Self::can_cast(syntax.kind()) { | ||
2121 | Some(Self { syntax }) | ||
2122 | } else { | ||
2123 | None | ||
2124 | } | ||
2125 | } | ||
2126 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2127 | } | ||
2128 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2129 | pub struct Ident { | ||
2130 | pub(crate) syntax: SyntaxToken, | ||
2131 | } | ||
2132 | impl std::fmt::Display for Ident { | ||
2133 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2134 | std::fmt::Display::fmt(&self.syntax, f) | ||
2135 | } | ||
2136 | } | ||
2137 | impl AstToken for Ident { | ||
2138 | fn can_cast(kind: SyntaxKind) -> bool { kind == IDENT } | ||
2139 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2140 | if Self::can_cast(syntax.kind()) { | ||
2141 | Some(Self { syntax }) | ||
2142 | } else { | ||
2143 | None | ||
2144 | } | ||
2145 | } | ||
2146 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2147 | } | ||
2148 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 9 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2149 | pub struct Whitespace { | 10 | pub struct Whitespace { |
2150 | pub(crate) syntax: SyntaxToken, | 11 | pub(crate) syntax: SyntaxToken, |
@@ -2165,26 +26,7 @@ impl AstToken for Whitespace { | |||
2165 | } | 26 | } |
2166 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | 27 | fn syntax(&self) -> &SyntaxToken { &self.syntax } |
2167 | } | 28 | } |
2168 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 29 | |
2169 | pub struct Lifetime { | ||
2170 | pub(crate) syntax: SyntaxToken, | ||
2171 | } | ||
2172 | impl std::fmt::Display for Lifetime { | ||
2173 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2174 | std::fmt::Display::fmt(&self.syntax, f) | ||
2175 | } | ||
2176 | } | ||
2177 | impl AstToken for Lifetime { | ||
2178 | fn can_cast(kind: SyntaxKind) -> bool { kind == LIFETIME } | ||
2179 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2180 | if Self::can_cast(syntax.kind()) { | ||
2181 | Some(Self { syntax }) | ||
2182 | } else { | ||
2183 | None | ||
2184 | } | ||
2185 | } | ||
2186 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2187 | } | ||
2188 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2189 | pub struct Comment { | 31 | pub struct Comment { |
2190 | pub(crate) syntax: SyntaxToken, | 32 | pub(crate) syntax: SyntaxToken, |
@@ -2205,37 +47,18 @@ impl AstToken for Comment { | |||
2205 | } | 47 | } |
2206 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | 48 | fn syntax(&self) -> &SyntaxToken { &self.syntax } |
2207 | } | 49 | } |
50 | |||
2208 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 51 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2209 | pub struct Shebang { | 52 | pub struct String { |
2210 | pub(crate) syntax: SyntaxToken, | ||
2211 | } | ||
2212 | impl std::fmt::Display for Shebang { | ||
2213 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2214 | std::fmt::Display::fmt(&self.syntax, f) | ||
2215 | } | ||
2216 | } | ||
2217 | impl AstToken for Shebang { | ||
2218 | fn can_cast(kind: SyntaxKind) -> bool { kind == SHEBANG } | ||
2219 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2220 | if Self::can_cast(syntax.kind()) { | ||
2221 | Some(Self { syntax }) | ||
2222 | } else { | ||
2223 | None | ||
2224 | } | ||
2225 | } | ||
2226 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | ||
2227 | } | ||
2228 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2229 | pub struct LDollar { | ||
2230 | pub(crate) syntax: SyntaxToken, | 53 | pub(crate) syntax: SyntaxToken, |
2231 | } | 54 | } |
2232 | impl std::fmt::Display for LDollar { | 55 | impl std::fmt::Display for String { |
2233 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 56 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |
2234 | std::fmt::Display::fmt(&self.syntax, f) | 57 | std::fmt::Display::fmt(&self.syntax, f) |
2235 | } | 58 | } |
2236 | } | 59 | } |
2237 | impl AstToken for LDollar { | 60 | impl AstToken for String { |
2238 | fn can_cast(kind: SyntaxKind) -> bool { kind == L_DOLLAR } | 61 | fn can_cast(kind: SyntaxKind) -> bool { kind == STRING } |
2239 | fn cast(syntax: SyntaxToken) -> Option<Self> { | 62 | fn cast(syntax: SyntaxToken) -> Option<Self> { |
2240 | if Self::can_cast(syntax.kind()) { | 63 | if Self::can_cast(syntax.kind()) { |
2241 | Some(Self { syntax }) | 64 | Some(Self { syntax }) |
@@ -2245,17 +68,18 @@ impl AstToken for LDollar { | |||
2245 | } | 68 | } |
2246 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | 69 | fn syntax(&self) -> &SyntaxToken { &self.syntax } |
2247 | } | 70 | } |
71 | |||
2248 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 72 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2249 | pub struct RDollar { | 73 | pub struct RawString { |
2250 | pub(crate) syntax: SyntaxToken, | 74 | pub(crate) syntax: SyntaxToken, |
2251 | } | 75 | } |
2252 | impl std::fmt::Display for RDollar { | 76 | impl std::fmt::Display for RawString { |
2253 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 77 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |
2254 | std::fmt::Display::fmt(&self.syntax, f) | 78 | std::fmt::Display::fmt(&self.syntax, f) |
2255 | } | 79 | } |
2256 | } | 80 | } |
2257 | impl AstToken for RDollar { | 81 | impl AstToken for RawString { |
2258 | fn can_cast(kind: SyntaxKind) -> bool { kind == R_DOLLAR } | 82 | fn can_cast(kind: SyntaxKind) -> bool { kind == RAW_STRING } |
2259 | fn cast(syntax: SyntaxToken) -> Option<Self> { | 83 | fn cast(syntax: SyntaxToken) -> Option<Self> { |
2260 | if Self::can_cast(syntax.kind()) { | 84 | if Self::can_cast(syntax.kind()) { |
2261 | Some(Self { syntax }) | 85 | Some(Self { syntax }) |
@@ -2265,544 +89,3 @@ impl AstToken for RDollar { | |||
2265 | } | 89 | } |
2266 | fn syntax(&self) -> &SyntaxToken { &self.syntax } | 90 | fn syntax(&self) -> &SyntaxToken { &self.syntax } |
2267 | } | 91 | } |
2268 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2269 | pub enum LeftDelimiter { | ||
2270 | LParen(LParen), | ||
2271 | LBrack(LBrack), | ||
2272 | LCurly(LCurly), | ||
2273 | } | ||
2274 | impl From<LParen> for LeftDelimiter { | ||
2275 | fn from(node: LParen) -> LeftDelimiter { LeftDelimiter::LParen(node) } | ||
2276 | } | ||
2277 | impl From<LBrack> for LeftDelimiter { | ||
2278 | fn from(node: LBrack) -> LeftDelimiter { LeftDelimiter::LBrack(node) } | ||
2279 | } | ||
2280 | impl From<LCurly> for LeftDelimiter { | ||
2281 | fn from(node: LCurly) -> LeftDelimiter { LeftDelimiter::LCurly(node) } | ||
2282 | } | ||
2283 | impl std::fmt::Display for LeftDelimiter { | ||
2284 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2285 | std::fmt::Display::fmt(self.syntax(), f) | ||
2286 | } | ||
2287 | } | ||
2288 | impl AstToken for LeftDelimiter { | ||
2289 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2290 | match kind { | ||
2291 | L_PAREN | L_BRACK | L_CURLY => true, | ||
2292 | _ => false, | ||
2293 | } | ||
2294 | } | ||
2295 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2296 | let res = match syntax.kind() { | ||
2297 | L_PAREN => LeftDelimiter::LParen(LParen { syntax }), | ||
2298 | L_BRACK => LeftDelimiter::LBrack(LBrack { syntax }), | ||
2299 | L_CURLY => LeftDelimiter::LCurly(LCurly { syntax }), | ||
2300 | _ => return None, | ||
2301 | }; | ||
2302 | Some(res) | ||
2303 | } | ||
2304 | fn syntax(&self) -> &SyntaxToken { | ||
2305 | match self { | ||
2306 | LeftDelimiter::LParen(it) => &it.syntax, | ||
2307 | LeftDelimiter::LBrack(it) => &it.syntax, | ||
2308 | LeftDelimiter::LCurly(it) => &it.syntax, | ||
2309 | } | ||
2310 | } | ||
2311 | } | ||
2312 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2313 | pub enum RightDelimiter { | ||
2314 | RParen(RParen), | ||
2315 | RBrack(RBrack), | ||
2316 | RCurly(RCurly), | ||
2317 | } | ||
2318 | impl From<RParen> for RightDelimiter { | ||
2319 | fn from(node: RParen) -> RightDelimiter { RightDelimiter::RParen(node) } | ||
2320 | } | ||
2321 | impl From<RBrack> for RightDelimiter { | ||
2322 | fn from(node: RBrack) -> RightDelimiter { RightDelimiter::RBrack(node) } | ||
2323 | } | ||
2324 | impl From<RCurly> for RightDelimiter { | ||
2325 | fn from(node: RCurly) -> RightDelimiter { RightDelimiter::RCurly(node) } | ||
2326 | } | ||
2327 | impl std::fmt::Display for RightDelimiter { | ||
2328 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2329 | std::fmt::Display::fmt(self.syntax(), f) | ||
2330 | } | ||
2331 | } | ||
2332 | impl AstToken for RightDelimiter { | ||
2333 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2334 | match kind { | ||
2335 | R_PAREN | R_BRACK | R_CURLY => true, | ||
2336 | _ => false, | ||
2337 | } | ||
2338 | } | ||
2339 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2340 | let res = match syntax.kind() { | ||
2341 | R_PAREN => RightDelimiter::RParen(RParen { syntax }), | ||
2342 | R_BRACK => RightDelimiter::RBrack(RBrack { syntax }), | ||
2343 | R_CURLY => RightDelimiter::RCurly(RCurly { syntax }), | ||
2344 | _ => return None, | ||
2345 | }; | ||
2346 | Some(res) | ||
2347 | } | ||
2348 | fn syntax(&self) -> &SyntaxToken { | ||
2349 | match self { | ||
2350 | RightDelimiter::RParen(it) => &it.syntax, | ||
2351 | RightDelimiter::RBrack(it) => &it.syntax, | ||
2352 | RightDelimiter::RCurly(it) => &it.syntax, | ||
2353 | } | ||
2354 | } | ||
2355 | } | ||
2356 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2357 | pub enum RangeSeparator { | ||
2358 | Dotdot(Dotdot), | ||
2359 | Dotdotdot(Dotdotdot), | ||
2360 | Dotdoteq(Dotdoteq), | ||
2361 | } | ||
2362 | impl From<Dotdot> for RangeSeparator { | ||
2363 | fn from(node: Dotdot) -> RangeSeparator { RangeSeparator::Dotdot(node) } | ||
2364 | } | ||
2365 | impl From<Dotdotdot> for RangeSeparator { | ||
2366 | fn from(node: Dotdotdot) -> RangeSeparator { RangeSeparator::Dotdotdot(node) } | ||
2367 | } | ||
2368 | impl From<Dotdoteq> for RangeSeparator { | ||
2369 | fn from(node: Dotdoteq) -> RangeSeparator { RangeSeparator::Dotdoteq(node) } | ||
2370 | } | ||
2371 | impl std::fmt::Display for RangeSeparator { | ||
2372 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2373 | std::fmt::Display::fmt(self.syntax(), f) | ||
2374 | } | ||
2375 | } | ||
2376 | impl AstToken for RangeSeparator { | ||
2377 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2378 | match kind { | ||
2379 | DOTDOT | DOTDOTDOT | DOTDOTEQ => true, | ||
2380 | _ => false, | ||
2381 | } | ||
2382 | } | ||
2383 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2384 | let res = match syntax.kind() { | ||
2385 | DOTDOT => RangeSeparator::Dotdot(Dotdot { syntax }), | ||
2386 | DOTDOTDOT => RangeSeparator::Dotdotdot(Dotdotdot { syntax }), | ||
2387 | DOTDOTEQ => RangeSeparator::Dotdoteq(Dotdoteq { syntax }), | ||
2388 | _ => return None, | ||
2389 | }; | ||
2390 | Some(res) | ||
2391 | } | ||
2392 | fn syntax(&self) -> &SyntaxToken { | ||
2393 | match self { | ||
2394 | RangeSeparator::Dotdot(it) => &it.syntax, | ||
2395 | RangeSeparator::Dotdotdot(it) => &it.syntax, | ||
2396 | RangeSeparator::Dotdoteq(it) => &it.syntax, | ||
2397 | } | ||
2398 | } | ||
2399 | } | ||
2400 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2401 | pub enum BinOp { | ||
2402 | Pipepipe(Pipepipe), | ||
2403 | Ampamp(Ampamp), | ||
2404 | Eqeq(Eqeq), | ||
2405 | Neq(Neq), | ||
2406 | Lteq(Lteq), | ||
2407 | Gteq(Gteq), | ||
2408 | LAngle(LAngle), | ||
2409 | RAngle(RAngle), | ||
2410 | Plus(Plus), | ||
2411 | Star(Star), | ||
2412 | Minus(Minus), | ||
2413 | Slash(Slash), | ||
2414 | Percent(Percent), | ||
2415 | Shl(Shl), | ||
2416 | Shr(Shr), | ||
2417 | Caret(Caret), | ||
2418 | Pipe(Pipe), | ||
2419 | Amp(Amp), | ||
2420 | Eq(Eq), | ||
2421 | Pluseq(Pluseq), | ||
2422 | Slasheq(Slasheq), | ||
2423 | Stareq(Stareq), | ||
2424 | Percenteq(Percenteq), | ||
2425 | Shreq(Shreq), | ||
2426 | Shleq(Shleq), | ||
2427 | Minuseq(Minuseq), | ||
2428 | Pipeeq(Pipeeq), | ||
2429 | Ampeq(Ampeq), | ||
2430 | Careteq(Careteq), | ||
2431 | } | ||
2432 | impl From<Pipepipe> for BinOp { | ||
2433 | fn from(node: Pipepipe) -> BinOp { BinOp::Pipepipe(node) } | ||
2434 | } | ||
2435 | impl From<Ampamp> for BinOp { | ||
2436 | fn from(node: Ampamp) -> BinOp { BinOp::Ampamp(node) } | ||
2437 | } | ||
2438 | impl From<Eqeq> for BinOp { | ||
2439 | fn from(node: Eqeq) -> BinOp { BinOp::Eqeq(node) } | ||
2440 | } | ||
2441 | impl From<Neq> for BinOp { | ||
2442 | fn from(node: Neq) -> BinOp { BinOp::Neq(node) } | ||
2443 | } | ||
2444 | impl From<Lteq> for BinOp { | ||
2445 | fn from(node: Lteq) -> BinOp { BinOp::Lteq(node) } | ||
2446 | } | ||
2447 | impl From<Gteq> for BinOp { | ||
2448 | fn from(node: Gteq) -> BinOp { BinOp::Gteq(node) } | ||
2449 | } | ||
2450 | impl From<LAngle> for BinOp { | ||
2451 | fn from(node: LAngle) -> BinOp { BinOp::LAngle(node) } | ||
2452 | } | ||
2453 | impl From<RAngle> for BinOp { | ||
2454 | fn from(node: RAngle) -> BinOp { BinOp::RAngle(node) } | ||
2455 | } | ||
2456 | impl From<Plus> for BinOp { | ||
2457 | fn from(node: Plus) -> BinOp { BinOp::Plus(node) } | ||
2458 | } | ||
2459 | impl From<Star> for BinOp { | ||
2460 | fn from(node: Star) -> BinOp { BinOp::Star(node) } | ||
2461 | } | ||
2462 | impl From<Minus> for BinOp { | ||
2463 | fn from(node: Minus) -> BinOp { BinOp::Minus(node) } | ||
2464 | } | ||
2465 | impl From<Slash> for BinOp { | ||
2466 | fn from(node: Slash) -> BinOp { BinOp::Slash(node) } | ||
2467 | } | ||
2468 | impl From<Percent> for BinOp { | ||
2469 | fn from(node: Percent) -> BinOp { BinOp::Percent(node) } | ||
2470 | } | ||
2471 | impl From<Shl> for BinOp { | ||
2472 | fn from(node: Shl) -> BinOp { BinOp::Shl(node) } | ||
2473 | } | ||
2474 | impl From<Shr> for BinOp { | ||
2475 | fn from(node: Shr) -> BinOp { BinOp::Shr(node) } | ||
2476 | } | ||
2477 | impl From<Caret> for BinOp { | ||
2478 | fn from(node: Caret) -> BinOp { BinOp::Caret(node) } | ||
2479 | } | ||
2480 | impl From<Pipe> for BinOp { | ||
2481 | fn from(node: Pipe) -> BinOp { BinOp::Pipe(node) } | ||
2482 | } | ||
2483 | impl From<Amp> for BinOp { | ||
2484 | fn from(node: Amp) -> BinOp { BinOp::Amp(node) } | ||
2485 | } | ||
2486 | impl From<Eq> for BinOp { | ||
2487 | fn from(node: Eq) -> BinOp { BinOp::Eq(node) } | ||
2488 | } | ||
2489 | impl From<Pluseq> for BinOp { | ||
2490 | fn from(node: Pluseq) -> BinOp { BinOp::Pluseq(node) } | ||
2491 | } | ||
2492 | impl From<Slasheq> for BinOp { | ||
2493 | fn from(node: Slasheq) -> BinOp { BinOp::Slasheq(node) } | ||
2494 | } | ||
2495 | impl From<Stareq> for BinOp { | ||
2496 | fn from(node: Stareq) -> BinOp { BinOp::Stareq(node) } | ||
2497 | } | ||
2498 | impl From<Percenteq> for BinOp { | ||
2499 | fn from(node: Percenteq) -> BinOp { BinOp::Percenteq(node) } | ||
2500 | } | ||
2501 | impl From<Shreq> for BinOp { | ||
2502 | fn from(node: Shreq) -> BinOp { BinOp::Shreq(node) } | ||
2503 | } | ||
2504 | impl From<Shleq> for BinOp { | ||
2505 | fn from(node: Shleq) -> BinOp { BinOp::Shleq(node) } | ||
2506 | } | ||
2507 | impl From<Minuseq> for BinOp { | ||
2508 | fn from(node: Minuseq) -> BinOp { BinOp::Minuseq(node) } | ||
2509 | } | ||
2510 | impl From<Pipeeq> for BinOp { | ||
2511 | fn from(node: Pipeeq) -> BinOp { BinOp::Pipeeq(node) } | ||
2512 | } | ||
2513 | impl From<Ampeq> for BinOp { | ||
2514 | fn from(node: Ampeq) -> BinOp { BinOp::Ampeq(node) } | ||
2515 | } | ||
2516 | impl From<Careteq> for BinOp { | ||
2517 | fn from(node: Careteq) -> BinOp { BinOp::Careteq(node) } | ||
2518 | } | ||
2519 | impl std::fmt::Display for BinOp { | ||
2520 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2521 | std::fmt::Display::fmt(self.syntax(), f) | ||
2522 | } | ||
2523 | } | ||
2524 | impl AstToken for BinOp { | ||
2525 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2526 | match kind { | ||
2527 | PIPEPIPE | AMPAMP | EQEQ | NEQ | LTEQ | GTEQ | L_ANGLE | R_ANGLE | PLUS | STAR | ||
2528 | | MINUS | SLASH | PERCENT | SHL | SHR | CARET | PIPE | AMP | EQ | PLUSEQ | SLASHEQ | ||
2529 | | STAREQ | PERCENTEQ | SHREQ | SHLEQ | MINUSEQ | PIPEEQ | AMPEQ | CARETEQ => true, | ||
2530 | _ => false, | ||
2531 | } | ||
2532 | } | ||
2533 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2534 | let res = match syntax.kind() { | ||
2535 | PIPEPIPE => BinOp::Pipepipe(Pipepipe { syntax }), | ||
2536 | AMPAMP => BinOp::Ampamp(Ampamp { syntax }), | ||
2537 | EQEQ => BinOp::Eqeq(Eqeq { syntax }), | ||
2538 | NEQ => BinOp::Neq(Neq { syntax }), | ||
2539 | LTEQ => BinOp::Lteq(Lteq { syntax }), | ||
2540 | GTEQ => BinOp::Gteq(Gteq { syntax }), | ||
2541 | L_ANGLE => BinOp::LAngle(LAngle { syntax }), | ||
2542 | R_ANGLE => BinOp::RAngle(RAngle { syntax }), | ||
2543 | PLUS => BinOp::Plus(Plus { syntax }), | ||
2544 | STAR => BinOp::Star(Star { syntax }), | ||
2545 | MINUS => BinOp::Minus(Minus { syntax }), | ||
2546 | SLASH => BinOp::Slash(Slash { syntax }), | ||
2547 | PERCENT => BinOp::Percent(Percent { syntax }), | ||
2548 | SHL => BinOp::Shl(Shl { syntax }), | ||
2549 | SHR => BinOp::Shr(Shr { syntax }), | ||
2550 | CARET => BinOp::Caret(Caret { syntax }), | ||
2551 | PIPE => BinOp::Pipe(Pipe { syntax }), | ||
2552 | AMP => BinOp::Amp(Amp { syntax }), | ||
2553 | EQ => BinOp::Eq(Eq { syntax }), | ||
2554 | PLUSEQ => BinOp::Pluseq(Pluseq { syntax }), | ||
2555 | SLASHEQ => BinOp::Slasheq(Slasheq { syntax }), | ||
2556 | STAREQ => BinOp::Stareq(Stareq { syntax }), | ||
2557 | PERCENTEQ => BinOp::Percenteq(Percenteq { syntax }), | ||
2558 | SHREQ => BinOp::Shreq(Shreq { syntax }), | ||
2559 | SHLEQ => BinOp::Shleq(Shleq { syntax }), | ||
2560 | MINUSEQ => BinOp::Minuseq(Minuseq { syntax }), | ||
2561 | PIPEEQ => BinOp::Pipeeq(Pipeeq { syntax }), | ||
2562 | AMPEQ => BinOp::Ampeq(Ampeq { syntax }), | ||
2563 | CARETEQ => BinOp::Careteq(Careteq { syntax }), | ||
2564 | _ => return None, | ||
2565 | }; | ||
2566 | Some(res) | ||
2567 | } | ||
2568 | fn syntax(&self) -> &SyntaxToken { | ||
2569 | match self { | ||
2570 | BinOp::Pipepipe(it) => &it.syntax, | ||
2571 | BinOp::Ampamp(it) => &it.syntax, | ||
2572 | BinOp::Eqeq(it) => &it.syntax, | ||
2573 | BinOp::Neq(it) => &it.syntax, | ||
2574 | BinOp::Lteq(it) => &it.syntax, | ||
2575 | BinOp::Gteq(it) => &it.syntax, | ||
2576 | BinOp::LAngle(it) => &it.syntax, | ||
2577 | BinOp::RAngle(it) => &it.syntax, | ||
2578 | BinOp::Plus(it) => &it.syntax, | ||
2579 | BinOp::Star(it) => &it.syntax, | ||
2580 | BinOp::Minus(it) => &it.syntax, | ||
2581 | BinOp::Slash(it) => &it.syntax, | ||
2582 | BinOp::Percent(it) => &it.syntax, | ||
2583 | BinOp::Shl(it) => &it.syntax, | ||
2584 | BinOp::Shr(it) => &it.syntax, | ||
2585 | BinOp::Caret(it) => &it.syntax, | ||
2586 | BinOp::Pipe(it) => &it.syntax, | ||
2587 | BinOp::Amp(it) => &it.syntax, | ||
2588 | BinOp::Eq(it) => &it.syntax, | ||
2589 | BinOp::Pluseq(it) => &it.syntax, | ||
2590 | BinOp::Slasheq(it) => &it.syntax, | ||
2591 | BinOp::Stareq(it) => &it.syntax, | ||
2592 | BinOp::Percenteq(it) => &it.syntax, | ||
2593 | BinOp::Shreq(it) => &it.syntax, | ||
2594 | BinOp::Shleq(it) => &it.syntax, | ||
2595 | BinOp::Minuseq(it) => &it.syntax, | ||
2596 | BinOp::Pipeeq(it) => &it.syntax, | ||
2597 | BinOp::Ampeq(it) => &it.syntax, | ||
2598 | BinOp::Careteq(it) => &it.syntax, | ||
2599 | } | ||
2600 | } | ||
2601 | } | ||
2602 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2603 | pub enum PrefixOp { | ||
2604 | Minus(Minus), | ||
2605 | Excl(Excl), | ||
2606 | Star(Star), | ||
2607 | } | ||
2608 | impl From<Minus> for PrefixOp { | ||
2609 | fn from(node: Minus) -> PrefixOp { PrefixOp::Minus(node) } | ||
2610 | } | ||
2611 | impl From<Excl> for PrefixOp { | ||
2612 | fn from(node: Excl) -> PrefixOp { PrefixOp::Excl(node) } | ||
2613 | } | ||
2614 | impl From<Star> for PrefixOp { | ||
2615 | fn from(node: Star) -> PrefixOp { PrefixOp::Star(node) } | ||
2616 | } | ||
2617 | impl std::fmt::Display for PrefixOp { | ||
2618 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2619 | std::fmt::Display::fmt(self.syntax(), f) | ||
2620 | } | ||
2621 | } | ||
2622 | impl AstToken for PrefixOp { | ||
2623 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2624 | match kind { | ||
2625 | MINUS | EXCL | STAR => true, | ||
2626 | _ => false, | ||
2627 | } | ||
2628 | } | ||
2629 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2630 | let res = match syntax.kind() { | ||
2631 | MINUS => PrefixOp::Minus(Minus { syntax }), | ||
2632 | EXCL => PrefixOp::Excl(Excl { syntax }), | ||
2633 | STAR => PrefixOp::Star(Star { syntax }), | ||
2634 | _ => return None, | ||
2635 | }; | ||
2636 | Some(res) | ||
2637 | } | ||
2638 | fn syntax(&self) -> &SyntaxToken { | ||
2639 | match self { | ||
2640 | PrefixOp::Minus(it) => &it.syntax, | ||
2641 | PrefixOp::Excl(it) => &it.syntax, | ||
2642 | PrefixOp::Star(it) => &it.syntax, | ||
2643 | } | ||
2644 | } | ||
2645 | } | ||
2646 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2647 | pub enum RangeOp { | ||
2648 | Dotdot(Dotdot), | ||
2649 | Dotdoteq(Dotdoteq), | ||
2650 | } | ||
2651 | impl From<Dotdot> for RangeOp { | ||
2652 | fn from(node: Dotdot) -> RangeOp { RangeOp::Dotdot(node) } | ||
2653 | } | ||
2654 | impl From<Dotdoteq> for RangeOp { | ||
2655 | fn from(node: Dotdoteq) -> RangeOp { RangeOp::Dotdoteq(node) } | ||
2656 | } | ||
2657 | impl std::fmt::Display for RangeOp { | ||
2658 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2659 | std::fmt::Display::fmt(self.syntax(), f) | ||
2660 | } | ||
2661 | } | ||
2662 | impl AstToken for RangeOp { | ||
2663 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2664 | match kind { | ||
2665 | DOTDOT | DOTDOTEQ => true, | ||
2666 | _ => false, | ||
2667 | } | ||
2668 | } | ||
2669 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2670 | let res = match syntax.kind() { | ||
2671 | DOTDOT => RangeOp::Dotdot(Dotdot { syntax }), | ||
2672 | DOTDOTEQ => RangeOp::Dotdoteq(Dotdoteq { syntax }), | ||
2673 | _ => return None, | ||
2674 | }; | ||
2675 | Some(res) | ||
2676 | } | ||
2677 | fn syntax(&self) -> &SyntaxToken { | ||
2678 | match self { | ||
2679 | RangeOp::Dotdot(it) => &it.syntax, | ||
2680 | RangeOp::Dotdoteq(it) => &it.syntax, | ||
2681 | } | ||
2682 | } | ||
2683 | } | ||
2684 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2685 | pub enum LiteralToken { | ||
2686 | IntNumber(IntNumber), | ||
2687 | FloatNumber(FloatNumber), | ||
2688 | String(String), | ||
2689 | RawString(RawString), | ||
2690 | TrueKw(TrueKw), | ||
2691 | FalseKw(FalseKw), | ||
2692 | ByteString(ByteString), | ||
2693 | RawByteString(RawByteString), | ||
2694 | Char(Char), | ||
2695 | Byte(Byte), | ||
2696 | } | ||
2697 | impl From<IntNumber> for LiteralToken { | ||
2698 | fn from(node: IntNumber) -> LiteralToken { LiteralToken::IntNumber(node) } | ||
2699 | } | ||
2700 | impl From<FloatNumber> for LiteralToken { | ||
2701 | fn from(node: FloatNumber) -> LiteralToken { LiteralToken::FloatNumber(node) } | ||
2702 | } | ||
2703 | impl From<String> for LiteralToken { | ||
2704 | fn from(node: String) -> LiteralToken { LiteralToken::String(node) } | ||
2705 | } | ||
2706 | impl From<RawString> for LiteralToken { | ||
2707 | fn from(node: RawString) -> LiteralToken { LiteralToken::RawString(node) } | ||
2708 | } | ||
2709 | impl From<TrueKw> for LiteralToken { | ||
2710 | fn from(node: TrueKw) -> LiteralToken { LiteralToken::TrueKw(node) } | ||
2711 | } | ||
2712 | impl From<FalseKw> for LiteralToken { | ||
2713 | fn from(node: FalseKw) -> LiteralToken { LiteralToken::FalseKw(node) } | ||
2714 | } | ||
2715 | impl From<ByteString> for LiteralToken { | ||
2716 | fn from(node: ByteString) -> LiteralToken { LiteralToken::ByteString(node) } | ||
2717 | } | ||
2718 | impl From<RawByteString> for LiteralToken { | ||
2719 | fn from(node: RawByteString) -> LiteralToken { LiteralToken::RawByteString(node) } | ||
2720 | } | ||
2721 | impl From<Char> for LiteralToken { | ||
2722 | fn from(node: Char) -> LiteralToken { LiteralToken::Char(node) } | ||
2723 | } | ||
2724 | impl From<Byte> for LiteralToken { | ||
2725 | fn from(node: Byte) -> LiteralToken { LiteralToken::Byte(node) } | ||
2726 | } | ||
2727 | impl std::fmt::Display for LiteralToken { | ||
2728 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2729 | std::fmt::Display::fmt(self.syntax(), f) | ||
2730 | } | ||
2731 | } | ||
2732 | impl AstToken for LiteralToken { | ||
2733 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2734 | match kind { | ||
2735 | INT_NUMBER | FLOAT_NUMBER | STRING | RAW_STRING | TRUE_KW | FALSE_KW | BYTE_STRING | ||
2736 | | RAW_BYTE_STRING | CHAR | BYTE => true, | ||
2737 | _ => false, | ||
2738 | } | ||
2739 | } | ||
2740 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2741 | let res = match syntax.kind() { | ||
2742 | INT_NUMBER => LiteralToken::IntNumber(IntNumber { syntax }), | ||
2743 | FLOAT_NUMBER => LiteralToken::FloatNumber(FloatNumber { syntax }), | ||
2744 | STRING => LiteralToken::String(String { syntax }), | ||
2745 | RAW_STRING => LiteralToken::RawString(RawString { syntax }), | ||
2746 | TRUE_KW => LiteralToken::TrueKw(TrueKw { syntax }), | ||
2747 | FALSE_KW => LiteralToken::FalseKw(FalseKw { syntax }), | ||
2748 | BYTE_STRING => LiteralToken::ByteString(ByteString { syntax }), | ||
2749 | RAW_BYTE_STRING => LiteralToken::RawByteString(RawByteString { syntax }), | ||
2750 | CHAR => LiteralToken::Char(Char { syntax }), | ||
2751 | BYTE => LiteralToken::Byte(Byte { syntax }), | ||
2752 | _ => return None, | ||
2753 | }; | ||
2754 | Some(res) | ||
2755 | } | ||
2756 | fn syntax(&self) -> &SyntaxToken { | ||
2757 | match self { | ||
2758 | LiteralToken::IntNumber(it) => &it.syntax, | ||
2759 | LiteralToken::FloatNumber(it) => &it.syntax, | ||
2760 | LiteralToken::String(it) => &it.syntax, | ||
2761 | LiteralToken::RawString(it) => &it.syntax, | ||
2762 | LiteralToken::TrueKw(it) => &it.syntax, | ||
2763 | LiteralToken::FalseKw(it) => &it.syntax, | ||
2764 | LiteralToken::ByteString(it) => &it.syntax, | ||
2765 | LiteralToken::RawByteString(it) => &it.syntax, | ||
2766 | LiteralToken::Char(it) => &it.syntax, | ||
2767 | LiteralToken::Byte(it) => &it.syntax, | ||
2768 | } | ||
2769 | } | ||
2770 | } | ||
2771 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
2772 | pub enum NameRefToken { | ||
2773 | Ident(Ident), | ||
2774 | IntNumber(IntNumber), | ||
2775 | } | ||
2776 | impl From<Ident> for NameRefToken { | ||
2777 | fn from(node: Ident) -> NameRefToken { NameRefToken::Ident(node) } | ||
2778 | } | ||
2779 | impl From<IntNumber> for NameRefToken { | ||
2780 | fn from(node: IntNumber) -> NameRefToken { NameRefToken::IntNumber(node) } | ||
2781 | } | ||
2782 | impl std::fmt::Display for NameRefToken { | ||
2783 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
2784 | std::fmt::Display::fmt(self.syntax(), f) | ||
2785 | } | ||
2786 | } | ||
2787 | impl AstToken for NameRefToken { | ||
2788 | fn can_cast(kind: SyntaxKind) -> bool { | ||
2789 | match kind { | ||
2790 | IDENT | INT_NUMBER => true, | ||
2791 | _ => false, | ||
2792 | } | ||
2793 | } | ||
2794 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
2795 | let res = match syntax.kind() { | ||
2796 | IDENT => NameRefToken::Ident(Ident { syntax }), | ||
2797 | INT_NUMBER => NameRefToken::IntNumber(IntNumber { syntax }), | ||
2798 | _ => return None, | ||
2799 | }; | ||
2800 | Some(res) | ||
2801 | } | ||
2802 | fn syntax(&self) -> &SyntaxToken { | ||
2803 | match self { | ||
2804 | NameRefToken::Ident(it) => &it.syntax, | ||
2805 | NameRefToken::IntNumber(it) => &it.syntax, | ||
2806 | } | ||
2807 | } | ||
2808 | } | ||
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs index 870e83804..bfc05e08b 100644 --- a/crates/ra_syntax/src/ast/traits.rs +++ b/crates/ra_syntax/src/ast/traits.rs | |||
@@ -1,83 +1,77 @@ | |||
1 | //! Various traits that are implemented by ast nodes. | 1 | //! Various traits that are implemented by ast nodes. |
2 | //! | 2 | //! |
3 | //! The implementations are usually trivial, and live in generated.rs | 3 | //! The implementations are usually trivial, and live in generated.rs |
4 | 4 | use stdx::SepBy; | |
5 | use itertools::Itertools; | ||
6 | 5 | ||
7 | use crate::{ | 6 | use crate::{ |
8 | ast::{self, child_opt, children, support, AstChildren, AstNode, AstToken}, | 7 | ast::{self, support, AstChildren, AstNode, AstToken}, |
9 | syntax_node::SyntaxElementChildren, | 8 | syntax_node::SyntaxElementChildren, |
9 | SyntaxToken, T, | ||
10 | }; | 10 | }; |
11 | 11 | ||
12 | pub trait TypeAscriptionOwner: AstNode { | 12 | pub trait TypeAscriptionOwner: AstNode { |
13 | fn ascribed_type(&self) -> Option<ast::TypeRef> { | 13 | fn ascribed_type(&self) -> Option<ast::TypeRef> { |
14 | child_opt(self) | 14 | support::child(self.syntax()) |
15 | } | 15 | } |
16 | } | 16 | } |
17 | 17 | ||
18 | pub trait NameOwner: AstNode { | 18 | pub trait NameOwner: AstNode { |
19 | fn name(&self) -> Option<ast::Name> { | 19 | fn name(&self) -> Option<ast::Name> { |
20 | child_opt(self) | 20 | support::child(self.syntax()) |
21 | } | 21 | } |
22 | } | 22 | } |
23 | 23 | ||
24 | pub trait VisibilityOwner: AstNode { | 24 | pub trait VisibilityOwner: AstNode { |
25 | fn visibility(&self) -> Option<ast::Visibility> { | 25 | fn visibility(&self) -> Option<ast::Visibility> { |
26 | child_opt(self) | 26 | support::child(self.syntax()) |
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||
30 | pub trait LoopBodyOwner: AstNode { | 30 | pub trait LoopBodyOwner: AstNode { |
31 | fn loop_body(&self) -> Option<ast::BlockExpr> { | 31 | fn loop_body(&self) -> Option<ast::BlockExpr> { |
32 | child_opt(self) | 32 | support::child(self.syntax()) |
33 | } | 33 | } |
34 | 34 | ||
35 | fn label(&self) -> Option<ast::Label> { | 35 | fn label(&self) -> Option<ast::Label> { |
36 | child_opt(self) | 36 | support::child(self.syntax()) |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | pub trait ArgListOwner: AstNode { | 40 | pub trait ArgListOwner: AstNode { |
41 | fn arg_list(&self) -> Option<ast::ArgList> { | 41 | fn arg_list(&self) -> Option<ast::ArgList> { |
42 | child_opt(self) | 42 | support::child(self.syntax()) |
43 | } | ||
44 | } | ||
45 | |||
46 | pub trait FnDefOwner: AstNode { | ||
47 | fn functions(&self) -> AstChildren<ast::FnDef> { | ||
48 | children(self) | ||
49 | } | 43 | } |
50 | } | 44 | } |
51 | 45 | ||
52 | pub trait ModuleItemOwner: AstNode { | 46 | pub trait ModuleItemOwner: AstNode { |
53 | fn items(&self) -> AstChildren<ast::ModuleItem> { | 47 | fn items(&self) -> AstChildren<ast::ModuleItem> { |
54 | children(self) | 48 | support::children(self.syntax()) |
55 | } | 49 | } |
56 | } | 50 | } |
57 | 51 | ||
58 | pub trait TypeParamsOwner: AstNode { | 52 | pub trait TypeParamsOwner: AstNode { |
59 | fn type_param_list(&self) -> Option<ast::TypeParamList> { | 53 | fn type_param_list(&self) -> Option<ast::TypeParamList> { |
60 | child_opt(self) | 54 | support::child(self.syntax()) |
61 | } | 55 | } |
62 | 56 | ||
63 | fn where_clause(&self) -> Option<ast::WhereClause> { | 57 | fn where_clause(&self) -> Option<ast::WhereClause> { |
64 | child_opt(self) | 58 | support::child(self.syntax()) |
65 | } | 59 | } |
66 | } | 60 | } |
67 | 61 | ||
68 | pub trait TypeBoundsOwner: AstNode { | 62 | pub trait TypeBoundsOwner: AstNode { |
69 | fn type_bound_list(&self) -> Option<ast::TypeBoundList> { | 63 | fn type_bound_list(&self) -> Option<ast::TypeBoundList> { |
70 | child_opt(self) | 64 | support::child(self.syntax()) |
71 | } | 65 | } |
72 | 66 | ||
73 | fn colon(&self) -> Option<ast::Colon> { | 67 | fn colon_token(&self) -> Option<SyntaxToken> { |
74 | support::token(self.syntax()) | 68 | support::token(self.syntax(), T![:]) |
75 | } | 69 | } |
76 | } | 70 | } |
77 | 71 | ||
78 | pub trait AttrsOwner: AstNode { | 72 | pub trait AttrsOwner: AstNode { |
79 | fn attrs(&self) -> AstChildren<ast::Attr> { | 73 | fn attrs(&self) -> AstChildren<ast::Attr> { |
80 | children(self) | 74 | support::children(self.syntax()) |
81 | } | 75 | } |
82 | fn has_atom_attr(&self, atom: &str) -> bool { | 76 | fn has_atom_attr(&self, atom: &str) -> bool { |
83 | self.attrs().filter_map(|x| x.as_simple_atom()).any(|x| x == atom) | 77 | self.attrs().filter_map(|x| x.as_simple_atom()).any(|x| x == atom) |
@@ -122,7 +116,8 @@ pub trait DocCommentsOwner: AstNode { | |||
122 | // of a line in markdown. | 116 | // of a line in markdown. |
123 | line[pos..end].to_owned() | 117 | line[pos..end].to_owned() |
124 | }) | 118 | }) |
125 | .join("\n"); | 119 | .sep_by("\n") |
120 | .to_string(); | ||
126 | 121 | ||
127 | if has_comments { | 122 | if has_comments { |
128 | Some(docs) | 123 | Some(docs) |
diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index d1baaa607..67c1f1b48 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs | |||
@@ -4,7 +4,7 @@ | |||
4 | use crate::{ | 4 | use crate::{ |
5 | SyntaxError, | 5 | SyntaxError, |
6 | SyntaxKind::{self, *}, | 6 | SyntaxKind::{self, *}, |
7 | TextRange, TextUnit, | 7 | TextRange, TextUnit, T, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | /// A token of Rust source. | 10 | /// A token of Rust source. |
@@ -115,21 +115,20 @@ fn rustc_token_kind_to_syntax_kind( | |||
115 | // being `u16` that come from `rowan::SyntaxKind`. | 115 | // being `u16` that come from `rowan::SyntaxKind`. |
116 | 116 | ||
117 | let syntax_kind = { | 117 | let syntax_kind = { |
118 | use rustc_lexer::TokenKind as TK; | ||
119 | match rustc_token_kind { | 118 | match rustc_token_kind { |
120 | TK::LineComment => COMMENT, | 119 | rustc_lexer::TokenKind::LineComment => COMMENT, |
121 | 120 | ||
122 | TK::BlockComment { terminated: true } => COMMENT, | 121 | rustc_lexer::TokenKind::BlockComment { terminated: true } => COMMENT, |
123 | TK::BlockComment { terminated: false } => { | 122 | rustc_lexer::TokenKind::BlockComment { terminated: false } => { |
124 | return ( | 123 | return ( |
125 | COMMENT, | 124 | COMMENT, |
126 | Some("Missing trailing `*/` symbols to terminate the block comment"), | 125 | Some("Missing trailing `*/` symbols to terminate the block comment"), |
127 | ); | 126 | ); |
128 | } | 127 | } |
129 | 128 | ||
130 | TK::Whitespace => WHITESPACE, | 129 | rustc_lexer::TokenKind::Whitespace => WHITESPACE, |
131 | 130 | ||
132 | TK::Ident => { | 131 | rustc_lexer::TokenKind::Ident => { |
133 | if token_text == "_" { | 132 | if token_text == "_" { |
134 | UNDERSCORE | 133 | UNDERSCORE |
135 | } else { | 134 | } else { |
@@ -137,42 +136,42 @@ fn rustc_token_kind_to_syntax_kind( | |||
137 | } | 136 | } |
138 | } | 137 | } |
139 | 138 | ||
140 | TK::RawIdent => IDENT, | 139 | rustc_lexer::TokenKind::RawIdent => IDENT, |
141 | TK::Literal { kind, .. } => return match_literal_kind(&kind), | 140 | rustc_lexer::TokenKind::Literal { kind, .. } => return match_literal_kind(&kind), |
142 | 141 | ||
143 | TK::Lifetime { starts_with_number: false } => LIFETIME, | 142 | rustc_lexer::TokenKind::Lifetime { starts_with_number: false } => LIFETIME, |
144 | TK::Lifetime { starts_with_number: true } => { | 143 | rustc_lexer::TokenKind::Lifetime { starts_with_number: true } => { |
145 | return (LIFETIME, Some("Lifetime name cannot start with a number")) | 144 | return (LIFETIME, Some("Lifetime name cannot start with a number")) |
146 | } | 145 | } |
147 | 146 | ||
148 | TK::Semi => SEMI, | 147 | rustc_lexer::TokenKind::Semi => T![;], |
149 | TK::Comma => COMMA, | 148 | rustc_lexer::TokenKind::Comma => T![,], |
150 | TK::Dot => DOT, | 149 | rustc_lexer::TokenKind::Dot => T![.], |
151 | TK::OpenParen => L_PAREN, | 150 | rustc_lexer::TokenKind::OpenParen => T!['('], |
152 | TK::CloseParen => R_PAREN, | 151 | rustc_lexer::TokenKind::CloseParen => T![')'], |
153 | TK::OpenBrace => L_CURLY, | 152 | rustc_lexer::TokenKind::OpenBrace => T!['{'], |
154 | TK::CloseBrace => R_CURLY, | 153 | rustc_lexer::TokenKind::CloseBrace => T!['}'], |
155 | TK::OpenBracket => L_BRACK, | 154 | rustc_lexer::TokenKind::OpenBracket => T!['['], |
156 | TK::CloseBracket => R_BRACK, | 155 | rustc_lexer::TokenKind::CloseBracket => T![']'], |
157 | TK::At => AT, | 156 | rustc_lexer::TokenKind::At => T![@], |
158 | TK::Pound => POUND, | 157 | rustc_lexer::TokenKind::Pound => T![#], |
159 | TK::Tilde => TILDE, | 158 | rustc_lexer::TokenKind::Tilde => T![~], |
160 | TK::Question => QUESTION, | 159 | rustc_lexer::TokenKind::Question => T![?], |
161 | TK::Colon => COLON, | 160 | rustc_lexer::TokenKind::Colon => T![:], |
162 | TK::Dollar => DOLLAR, | 161 | rustc_lexer::TokenKind::Dollar => T![$], |
163 | TK::Eq => EQ, | 162 | rustc_lexer::TokenKind::Eq => T![=], |
164 | TK::Not => EXCL, | 163 | rustc_lexer::TokenKind::Not => T![!], |
165 | TK::Lt => L_ANGLE, | 164 | rustc_lexer::TokenKind::Lt => T![<], |
166 | TK::Gt => R_ANGLE, | 165 | rustc_lexer::TokenKind::Gt => T![>], |
167 | TK::Minus => MINUS, | 166 | rustc_lexer::TokenKind::Minus => T![-], |
168 | TK::And => AMP, | 167 | rustc_lexer::TokenKind::And => T![&], |
169 | TK::Or => PIPE, | 168 | rustc_lexer::TokenKind::Or => T![|], |
170 | TK::Plus => PLUS, | 169 | rustc_lexer::TokenKind::Plus => T![+], |
171 | TK::Star => STAR, | 170 | rustc_lexer::TokenKind::Star => T![*], |
172 | TK::Slash => SLASH, | 171 | rustc_lexer::TokenKind::Slash => T![/], |
173 | TK::Caret => CARET, | 172 | rustc_lexer::TokenKind::Caret => T![^], |
174 | TK::Percent => PERCENT, | 173 | rustc_lexer::TokenKind::Percent => T![%], |
175 | TK::Unknown => ERROR, | 174 | rustc_lexer::TokenKind::Unknown => ERROR, |
176 | } | 175 | } |
177 | }; | 176 | }; |
178 | 177 | ||
diff --git a/crates/ra_syntax/src/ptr.rs b/crates/ra_syntax/src/ptr.rs index db6230aab..bc48a2e71 100644 --- a/crates/ra_syntax/src/ptr.rs +++ b/crates/ra_syntax/src/ptr.rs | |||
@@ -10,7 +10,7 @@ use crate::{AstNode, SyntaxKind, SyntaxNode, TextRange}; | |||
10 | 10 | ||
11 | /// A pointer to a syntax node inside a file. It can be used to remember a | 11 | /// A pointer to a syntax node inside a file. It can be used to remember a |
12 | /// specific node across reparses of the same file. | 12 | /// specific node across reparses of the same file. |
13 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 13 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
14 | pub struct SyntaxNodePtr { | 14 | pub struct SyntaxNodePtr { |
15 | pub(crate) range: TextRange, | 15 | pub(crate) range: TextRange, |
16 | kind: SyntaxKind, | 16 | kind: SyntaxKind, |
@@ -21,7 +21,7 @@ impl SyntaxNodePtr { | |||
21 | SyntaxNodePtr { range: node.text_range(), kind: node.kind() } | 21 | SyntaxNodePtr { range: node.text_range(), kind: node.kind() } |
22 | } | 22 | } |
23 | 23 | ||
24 | pub fn to_node(self, root: &SyntaxNode) -> SyntaxNode { | 24 | pub fn to_node(&self, root: &SyntaxNode) -> SyntaxNode { |
25 | assert!(root.parent().is_none()); | 25 | assert!(root.parent().is_none()); |
26 | successors(Some(root.clone()), |node| { | 26 | successors(Some(root.clone()), |node| { |
27 | node.children().find(|it| self.range.is_subrange(&it.text_range())) | 27 | node.children().find(|it| self.range.is_subrange(&it.text_range())) |
@@ -30,11 +30,11 @@ impl SyntaxNodePtr { | |||
30 | .unwrap_or_else(|| panic!("can't resolve local ptr to SyntaxNode: {:?}", self)) | 30 | .unwrap_or_else(|| panic!("can't resolve local ptr to SyntaxNode: {:?}", self)) |
31 | } | 31 | } |
32 | 32 | ||
33 | pub fn range(self) -> TextRange { | 33 | pub fn range(&self) -> TextRange { |
34 | self.range | 34 | self.range |
35 | } | 35 | } |
36 | 36 | ||
37 | pub fn kind(self) -> SyntaxKind { | 37 | pub fn kind(&self) -> SyntaxKind { |
38 | self.kind | 38 | self.kind |
39 | } | 39 | } |
40 | 40 | ||
@@ -53,10 +53,9 @@ pub struct AstPtr<N: AstNode> { | |||
53 | _ty: PhantomData<fn() -> N>, | 53 | _ty: PhantomData<fn() -> N>, |
54 | } | 54 | } |
55 | 55 | ||
56 | impl<N: AstNode> Copy for AstPtr<N> {} | ||
57 | impl<N: AstNode> Clone for AstPtr<N> { | 56 | impl<N: AstNode> Clone for AstPtr<N> { |
58 | fn clone(&self) -> AstPtr<N> { | 57 | fn clone(&self) -> AstPtr<N> { |
59 | *self | 58 | AstPtr { raw: self.raw.clone(), _ty: PhantomData } |
60 | } | 59 | } |
61 | } | 60 | } |
62 | 61 | ||
@@ -79,13 +78,13 @@ impl<N: AstNode> AstPtr<N> { | |||
79 | AstPtr { raw: SyntaxNodePtr::new(node.syntax()), _ty: PhantomData } | 78 | AstPtr { raw: SyntaxNodePtr::new(node.syntax()), _ty: PhantomData } |
80 | } | 79 | } |
81 | 80 | ||
82 | pub fn to_node(self, root: &SyntaxNode) -> N { | 81 | pub fn to_node(&self, root: &SyntaxNode) -> N { |
83 | let syntax_node = self.raw.to_node(root); | 82 | let syntax_node = self.raw.to_node(root); |
84 | N::cast(syntax_node).unwrap() | 83 | N::cast(syntax_node).unwrap() |
85 | } | 84 | } |
86 | 85 | ||
87 | pub fn syntax_node_ptr(self) -> SyntaxNodePtr { | 86 | pub fn syntax_node_ptr(&self) -> SyntaxNodePtr { |
88 | self.raw | 87 | self.raw.clone() |
89 | } | 88 | } |
90 | 89 | ||
91 | pub fn cast<U: AstNode>(self) -> Option<AstPtr<U>> { | 90 | pub fn cast<U: AstNode>(self) -> Option<AstPtr<U>> { |
diff --git a/crates/ra_syntax/test_data/lexer/err/0049_unstarted_raw_string_with_ascii.txt b/crates/ra_syntax/test_data/lexer/err/0049_unstarted_raw_string_with_ascii.txt index 782dfd974..290e0bd7c 100644 --- a/crates/ra_syntax/test_data/lexer/err/0049_unstarted_raw_string_with_ascii.txt +++ b/crates/ra_syntax/test_data/lexer/err/0049_unstarted_raw_string_with_ascii.txt | |||
@@ -6,5 +6,5 @@ WHITESPACE 1 " " | |||
6 | IDENT 1 "a" | 6 | IDENT 1 "a" |
7 | WHITESPACE 1 " " | 7 | WHITESPACE 1 " " |
8 | IDENT 5 "quote" | 8 | IDENT 5 "quote" |
9 | EXCL 1 "!" | 9 | BANG 1 "!" |
10 | > error[0; 4) token("r## ") msg(Missing `"` symbol after `#` symbols to begin the raw string literal) | 10 | > error[0; 4) token("r## ") msg(Missing `"` symbol after `#` symbols to begin the raw string literal) |
diff --git a/crates/ra_syntax/test_data/lexer/err/0050_unstarted_raw_byte_string_with_ascii.txt b/crates/ra_syntax/test_data/lexer/err/0050_unstarted_raw_byte_string_with_ascii.txt index 59c40cd65..5c492906d 100644 --- a/crates/ra_syntax/test_data/lexer/err/0050_unstarted_raw_byte_string_with_ascii.txt +++ b/crates/ra_syntax/test_data/lexer/err/0050_unstarted_raw_byte_string_with_ascii.txt | |||
@@ -6,5 +6,5 @@ WHITESPACE 1 " " | |||
6 | IDENT 1 "a" | 6 | IDENT 1 "a" |
7 | WHITESPACE 1 " " | 7 | WHITESPACE 1 " " |
8 | IDENT 5 "quote" | 8 | IDENT 5 "quote" |
9 | EXCL 1 "!" | 9 | BANG 1 "!" |
10 | > error[0; 5) token("br## ") msg(Missing `"` symbol after `#` symbols to begin the raw byte string literal) | 10 | > error[0; 5) token("br## ") msg(Missing `"` symbol after `#` symbols to begin the raw byte string literal) |
diff --git a/crates/ra_syntax/test_data/lexer/ok/0005_symbols.txt b/crates/ra_syntax/test_data/lexer/ok/0005_symbols.txt index 469a90e42..2049c2f1d 100644 --- a/crates/ra_syntax/test_data/lexer/ok/0005_symbols.txt +++ b/crates/ra_syntax/test_data/lexer/ok/0005_symbols.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | SEMI 1 ";" | 1 | SEMICOLON 1 ";" |
2 | WHITESPACE 1 " " | 2 | WHITESPACE 1 " " |
3 | COMMA 1 "," | 3 | COMMA 1 "," |
4 | WHITESPACE 1 " " | 4 | WHITESPACE 1 " " |
@@ -65,9 +65,9 @@ WHITESPACE 1 " " | |||
65 | EQ 1 "=" | 65 | EQ 1 "=" |
66 | R_ANGLE 1 ">" | 66 | R_ANGLE 1 ">" |
67 | WHITESPACE 1 "\n" | 67 | WHITESPACE 1 "\n" |
68 | EXCL 1 "!" | 68 | BANG 1 "!" |
69 | WHITESPACE 1 " " | 69 | WHITESPACE 1 " " |
70 | EXCL 1 "!" | 70 | BANG 1 "!" |
71 | EQ 1 "=" | 71 | EQ 1 "=" |
72 | WHITESPACE 1 "\n" | 72 | WHITESPACE 1 "\n" |
73 | MINUS 1 "-" | 73 | MINUS 1 "-" |
diff --git a/crates/ra_syntax/test_data/parser/err/0002_duplicate_shebang.rast b/crates/ra_syntax/test_data/parser/err/0002_duplicate_shebang.rast index 002680583..831bbf83f 100644 --- a/crates/ra_syntax/test_data/parser/err/0002_duplicate_shebang.rast +++ b/crates/ra_syntax/test_data/parser/err/0002_duplicate_shebang.rast | |||
@@ -3,7 +3,7 @@ SOURCE_FILE@[0; 42) | |||
3 | WHITESPACE@[20; 21) "\n" | 3 | WHITESPACE@[20; 21) "\n" |
4 | ATTR@[21; 23) | 4 | ATTR@[21; 23) |
5 | POUND@[21; 22) "#" | 5 | POUND@[21; 22) "#" |
6 | EXCL@[22; 23) "!" | 6 | BANG@[22; 23) "!" |
7 | ERROR@[23; 24) | 7 | ERROR@[23; 24) |
8 | SLASH@[23; 24) "/" | 8 | SLASH@[23; 24) "/" |
9 | USE_ITEM@[24; 28) | 9 | USE_ITEM@[24; 28) |
@@ -29,11 +29,11 @@ SOURCE_FILE@[0; 42) | |||
29 | error [23; 23): expected `[` | 29 | error [23; 23): expected `[` |
30 | error [23; 23): expected an item | 30 | error [23; 23): expected an item |
31 | error [27; 27): expected one of `*`, `::`, `{`, `self`, `super` or an identifier | 31 | error [27; 27): expected one of `*`, `::`, `{`, `self`, `super` or an identifier |
32 | error [28; 28): expected SEMI | 32 | error [28; 28): expected SEMICOLON |
33 | error [31; 31): expected EXCL | 33 | error [31; 31): expected BANG |
34 | error [31; 31): expected `{`, `[`, `(` | 34 | error [31; 31): expected `{`, `[`, `(` |
35 | error [31; 31): expected SEMI | 35 | error [31; 31): expected SEMICOLON |
36 | error [31; 31): expected an item | 36 | error [31; 31): expected an item |
37 | error [35; 35): expected EXCL | 37 | error [35; 35): expected BANG |
38 | error [41; 41): expected `{`, `[`, `(` | 38 | error [41; 41): expected `{`, `[`, `(` |
39 | error [41; 41): expected SEMI | 39 | error [41; 41): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast b/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast index 8039a8913..6b89e7572 100644 --- a/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast +++ b/crates/ra_syntax/test_data/parser/err/0003_C++_semicolon.rast | |||
@@ -34,6 +34,6 @@ SOURCE_FILE@[0; 40) | |||
34 | WHITESPACE@[37; 38) "\n" | 34 | WHITESPACE@[37; 38) "\n" |
35 | R_CURLY@[38; 39) "}" | 35 | R_CURLY@[38; 39) "}" |
36 | ERROR@[39; 40) | 36 | ERROR@[39; 40) |
37 | SEMI@[39; 40) ";" | 37 | SEMICOLON@[39; 40) ";" |
38 | error [39; 39): expected item, found `;` | 38 | error [39; 39): expected item, found `;` |
39 | consider removing this semicolon | 39 | consider removing this semicolon |
diff --git a/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast b/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast index 5f6e10986..1d27d4cd6 100644 --- a/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast +++ b/crates/ra_syntax/test_data/parser/err/0004_use_path_bad_segment.rast | |||
@@ -8,9 +8,9 @@ SOURCE_FILE@[0; 12) | |||
8 | PATH_SEGMENT@[4; 7) | 8 | PATH_SEGMENT@[4; 7) |
9 | NAME_REF@[4; 7) | 9 | NAME_REF@[4; 7) |
10 | IDENT@[4; 7) "foo" | 10 | IDENT@[4; 7) "foo" |
11 | COLONCOLON@[7; 9) "::" | 11 | COLON2@[7; 9) "::" |
12 | PATH_SEGMENT@[9; 11) | 12 | PATH_SEGMENT@[9; 11) |
13 | ERROR@[9; 11) | 13 | ERROR@[9; 11) |
14 | INT_NUMBER@[9; 11) "92" | 14 | INT_NUMBER@[9; 11) "92" |
15 | SEMI@[11; 12) ";" | 15 | SEMICOLON@[11; 12) ";" |
16 | error [9; 9): expected identifier | 16 | error [9; 9): expected identifier |
diff --git a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast index 1978f30fa..c24e478f3 100644 --- a/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast +++ b/crates/ra_syntax/test_data/parser/err/0007_stray_curly_in_file.rast | |||
@@ -7,7 +7,7 @@ SOURCE_FILE@[0; 31) | |||
7 | WHITESPACE@[9; 10) " " | 7 | WHITESPACE@[9; 10) " " |
8 | NAME@[10; 11) | 8 | NAME@[10; 11) |
9 | IDENT@[10; 11) "S" | 9 | IDENT@[10; 11) "S" |
10 | SEMI@[11; 12) ";" | 10 | SEMICOLON@[11; 12) ";" |
11 | WHITESPACE@[12; 14) "\n\n" | 11 | WHITESPACE@[12; 14) "\n\n" |
12 | ERROR@[14; 15) | 12 | ERROR@[14; 15) |
13 | R_CURLY@[14; 15) "}" | 13 | R_CURLY@[14; 15) "}" |
diff --git a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast index 98248227d..9f5041ae4 100644 --- a/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0008_item_block_recovery.rast | |||
@@ -76,6 +76,6 @@ SOURCE_FILE@[0; 95) | |||
76 | WHITESPACE@[92; 93) "\n" | 76 | WHITESPACE@[92; 93) "\n" |
77 | R_CURLY@[93; 94) "}" | 77 | R_CURLY@[93; 94) "}" |
78 | WHITESPACE@[94; 95) "\n" | 78 | WHITESPACE@[94; 95) "\n" |
79 | error [17; 17): expected EXCL | 79 | error [17; 17): expected BANG |
80 | error [19; 19): expected SEMI | 80 | error [19; 19): expected SEMICOLON |
81 | error [20; 20): expected an item | 81 | error [20; 20): expected an item |
diff --git a/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast b/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast index ca508ac7c..7ed80477d 100644 --- a/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast +++ b/crates/ra_syntax/test_data/parser/err/0009_broken_struct_type_parameter.rast | |||
@@ -43,7 +43,7 @@ SOURCE_FILE@[0; 43) | |||
43 | WHITESPACE@[39; 40) " " | 43 | WHITESPACE@[39; 40) " " |
44 | NAME@[40; 41) | 44 | NAME@[40; 41) |
45 | IDENT@[40; 41) "T" | 45 | IDENT@[40; 41) "T" |
46 | SEMI@[41; 42) ";" | 46 | SEMICOLON@[41; 42) ";" |
47 | WHITESPACE@[42; 43) "\n" | 47 | WHITESPACE@[42; 43) "\n" |
48 | error [9; 9): expected type parameter | 48 | error [9; 9): expected type parameter |
49 | error [11; 11): expected COMMA | 49 | error [11; 11): expected COMMA |
@@ -53,6 +53,6 @@ error [12; 12): expected an item | |||
53 | error [14; 14): expected an item | 53 | error [14; 14): expected an item |
54 | error [15; 15): expected an item | 54 | error [15; 15): expected an item |
55 | error [17; 17): expected an item | 55 | error [17; 17): expected an item |
56 | error [24; 24): expected SEMI | 56 | error [24; 24): expected SEMICOLON |
57 | error [24; 24): expected expression | 57 | error [24; 24): expected expression |
58 | error [25; 25): expected SEMI | 58 | error [25; 25): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast index 0ffbd25aa..5559c3297 100644 --- a/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast +++ b/crates/ra_syntax/test_data/parser/err/0010_unsafe_lambda_block.rast | |||
@@ -37,9 +37,9 @@ SOURCE_FILE@[0; 42) | |||
37 | R_PAREN@[35; 36) ")" | 37 | R_PAREN@[35; 36) ")" |
38 | WHITESPACE@[36; 37) " " | 38 | WHITESPACE@[36; 37) " " |
39 | R_CURLY@[37; 38) "}" | 39 | R_CURLY@[37; 38) "}" |
40 | SEMI@[38; 39) ";" | 40 | SEMICOLON@[38; 39) ";" |
41 | WHITESPACE@[39; 40) "\n" | 41 | WHITESPACE@[39; 40) "\n" |
42 | R_CURLY@[40; 41) "}" | 42 | R_CURLY@[40; 41) "}" |
43 | WHITESPACE@[41; 42) "\n" | 43 | WHITESPACE@[41; 42) "\n" |
44 | error [24; 24): expected `{` | 44 | error [24; 24): expected `{` |
45 | error [24; 24): expected SEMI | 45 | error [24; 24): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast b/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast index 900894dcf..99c212fd6 100644 --- a/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast +++ b/crates/ra_syntax/test_data/parser/err/0011_extern_struct.rast | |||
@@ -8,6 +8,6 @@ SOURCE_FILE@[0; 19) | |||
8 | WHITESPACE@[13; 14) " " | 8 | WHITESPACE@[13; 14) " " |
9 | NAME@[14; 17) | 9 | NAME@[14; 17) |
10 | IDENT@[14; 17) "Foo" | 10 | IDENT@[14; 17) "Foo" |
11 | SEMI@[17; 18) ";" | 11 | SEMICOLON@[17; 18) ";" |
12 | WHITESPACE@[18; 19) "\n" | 12 | WHITESPACE@[18; 19) "\n" |
13 | error [6; 6): expected existential, fn, trait or impl | 13 | error [6; 6): expected existential, fn, trait or impl |
diff --git a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast index 12ebc2a3a..0a3c0313d 100644 --- a/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast +++ b/crates/ra_syntax/test_data/parser/err/0012_broken_lambda.rast | |||
@@ -106,7 +106,7 @@ SOURCE_FILE@[0; 389) | |||
106 | WHITESPACE@[122; 123) | 106 | WHITESPACE@[122; 123) |
107 | LITERAL@[123; 124) | 107 | LITERAL@[123; 124) |
108 | INT_NUMBER@[123; 124) "0" | 108 | INT_NUMBER@[123; 124) "0" |
109 | SEMI@[124; 125) | 109 | SEMICOLON@[124; 125) |
110 | WHITESPACE@[125; 130) | 110 | WHITESPACE@[125; 130) |
111 | LET_STMT@[130; 389) | 111 | LET_STMT@[130; 389) |
112 | LET_KW@[130; 133) | 112 | LET_KW@[130; 133) |
@@ -226,7 +226,7 @@ SOURCE_FILE@[0; 389) | |||
226 | err: `expected pattern` | 226 | err: `expected pattern` |
227 | PARAM@[236; 237) | 227 | PARAM@[236; 237) |
228 | ERROR@[236; 237) | 228 | ERROR@[236; 237) |
229 | EXCL@[236; 237) | 229 | BANG@[236; 237) |
230 | err: `expected COMMA` | 230 | err: `expected COMMA` |
231 | PARAM@[237; 242) | 231 | PARAM@[237; 242) |
232 | BIND_PAT@[237; 242) | 232 | BIND_PAT@[237; 242) |
@@ -272,7 +272,7 @@ SOURCE_FILE@[0; 389) | |||
272 | err: `expected pattern` | 272 | err: `expected pattern` |
273 | PARAM@[283; 284) | 273 | PARAM@[283; 284) |
274 | ERROR@[283; 284) | 274 | ERROR@[283; 284) |
275 | SEMI@[283; 284) | 275 | SEMICOLON@[283; 284) |
276 | err: `expected COMMA` | 276 | err: `expected COMMA` |
277 | WHITESPACE@[284; 297) | 277 | WHITESPACE@[284; 297) |
278 | err: `expected pattern` | 278 | err: `expected pattern` |
@@ -327,7 +327,7 @@ SOURCE_FILE@[0; 389) | |||
327 | err: `expected pattern` | 327 | err: `expected pattern` |
328 | PARAM@[346; 347) | 328 | PARAM@[346; 347) |
329 | ERROR@[346; 347) | 329 | ERROR@[346; 347) |
330 | SEMI@[346; 347) | 330 | SEMICOLON@[346; 347) |
331 | err: `expected COMMA` | 331 | err: `expected COMMA` |
332 | WHITESPACE@[347; 360) | 332 | WHITESPACE@[347; 360) |
333 | err: `expected pattern` | 333 | err: `expected pattern` |
@@ -371,7 +371,7 @@ SOURCE_FILE@[0; 389) | |||
371 | err: `expected pattern` | 371 | err: `expected pattern` |
372 | PARAM@[385; 386) | 372 | PARAM@[385; 386) |
373 | ERROR@[385; 386) | 373 | ERROR@[385; 386) |
374 | SEMI@[385; 386) | 374 | SEMICOLON@[385; 386) |
375 | err: `expected COMMA` | 375 | err: `expected COMMA` |
376 | WHITESPACE@[386; 387) | 376 | WHITESPACE@[386; 387) |
377 | err: `expected pattern` | 377 | err: `expected pattern` |
diff --git a/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast b/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast index 7a934cf66..cb570dc1c 100644 --- a/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast +++ b/crates/ra_syntax/test_data/parser/err/0013_invalid_type.rast | |||
@@ -67,7 +67,7 @@ SOURCE_FILE@[0; 86) | |||
67 | ERROR@[82; 83) | 67 | ERROR@[82; 83) |
68 | R_PAREN@[82; 83) ")" | 68 | R_PAREN@[82; 83) ")" |
69 | ERROR@[83; 84) | 69 | ERROR@[83; 84) |
70 | SEMI@[83; 84) ";" | 70 | SEMICOLON@[83; 84) ";" |
71 | WHITESPACE@[84; 86) "\n\n" | 71 | WHITESPACE@[84; 86) "\n\n" |
72 | error [67; 67): expected type | 72 | error [67; 67): expected type |
73 | error [68; 68): expected COMMA | 73 | error [68; 68): expected COMMA |
@@ -80,7 +80,7 @@ error [68; 68): expected COMMA | |||
80 | error [72; 72): expected COMMA | 80 | error [72; 72): expected COMMA |
81 | error [72; 72): expected a type | 81 | error [72; 72): expected a type |
82 | error [72; 72): expected R_PAREN | 82 | error [72; 72): expected R_PAREN |
83 | error [72; 72): expected SEMI | 83 | error [72; 72): expected SEMICOLON |
84 | error [72; 72): expected an item | 84 | error [72; 72): expected an item |
85 | error [73; 73): expected an item | 85 | error [73; 73): expected an item |
86 | error [79; 79): expected an item | 86 | error [79; 79): expected an item |
diff --git a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast index 6343580e0..aca5a3ada 100644 --- a/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast +++ b/crates/ra_syntax/test_data/parser/err/0016_missing_semi.rast | |||
@@ -37,8 +37,8 @@ SOURCE_FILE@[0; 56) | |||
37 | WHITESPACE@[49; 50) " " | 37 | WHITESPACE@[49; 50) " " |
38 | LITERAL@[50; 52) | 38 | LITERAL@[50; 52) |
39 | INT_NUMBER@[50; 52) "92" | 39 | INT_NUMBER@[50; 52) "92" |
40 | SEMI@[52; 53) ";" | 40 | SEMICOLON@[52; 53) ";" |
41 | WHITESPACE@[53; 54) "\n" | 41 | WHITESPACE@[53; 54) "\n" |
42 | R_CURLY@[54; 55) "}" | 42 | R_CURLY@[54; 55) "}" |
43 | WHITESPACE@[55; 56) "\n" | 43 | WHITESPACE@[55; 56) "\n" |
44 | error [38; 38): expected SEMI | 44 | error [38; 38): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast index 59480e999..f9f4b9bc2 100644 --- a/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast +++ b/crates/ra_syntax/test_data/parser/err/0017_incomplete_binexpr.rast | |||
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 47) | |||
34 | WHITESPACE@[32; 33) " " | 34 | WHITESPACE@[32; 33) " " |
35 | LITERAL@[33; 35) | 35 | LITERAL@[33; 35) |
36 | INT_NUMBER@[33; 35) "92" | 36 | INT_NUMBER@[33; 35) "92" |
37 | SEMI@[35; 36) ";" | 37 | SEMICOLON@[35; 36) ";" |
38 | WHITESPACE@[36; 41) "\n " | 38 | WHITESPACE@[36; 41) "\n " |
39 | BIN_EXPR@[41; 44) | 39 | BIN_EXPR@[41; 44) |
40 | LITERAL@[41; 42) | 40 | LITERAL@[41; 42) |
diff --git a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast index 4b13a7236..9a8f76673 100644 --- a/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast +++ b/crates/ra_syntax/test_data/parser/err/0018_incomplete_fn.rast | |||
@@ -60,7 +60,7 @@ SOURCE_FILE@[0; 183) | |||
60 | ARG_LIST@[82; 84) | 60 | ARG_LIST@[82; 84) |
61 | L_PAREN@[82; 83) "(" | 61 | L_PAREN@[82; 83) "(" |
62 | R_PAREN@[83; 84) ")" | 62 | R_PAREN@[83; 84) ")" |
63 | SEMI@[84; 85) ";" | 63 | SEMICOLON@[84; 85) ";" |
64 | WHITESPACE@[85; 94) "\n " | 64 | WHITESPACE@[85; 94) "\n " |
65 | METHOD_CALL_EXPR@[94; 155) | 65 | METHOD_CALL_EXPR@[94; 155) |
66 | FIELD_EXPR@[94; 105) | 66 | FIELD_EXPR@[94; 105) |
@@ -107,7 +107,7 @@ SOURCE_FILE@[0; 183) | |||
107 | PATH_SEGMENT@[146; 149) | 107 | PATH_SEGMENT@[146; 149) |
108 | NAME_REF@[146; 149) | 108 | NAME_REF@[146; 149) |
109 | IDENT@[146; 149) "vec" | 109 | IDENT@[146; 149) "vec" |
110 | EXCL@[149; 150) "!" | 110 | BANG@[149; 150) "!" |
111 | TOKEN_TREE@[150; 152) | 111 | TOKEN_TREE@[150; 152) |
112 | L_BRACK@[150; 151) "[" | 112 | L_BRACK@[150; 151) "[" |
113 | R_BRACK@[151; 152) "]" | 113 | R_BRACK@[151; 152) "]" |
diff --git a/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast b/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast index 97e91a94f..e283091e1 100644 --- a/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0019_let_recover.rast | |||
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 139) | |||
32 | WHITESPACE@[38; 39) " " | 32 | WHITESPACE@[38; 39) " " |
33 | LITERAL@[39; 40) | 33 | LITERAL@[39; 40) |
34 | INT_NUMBER@[39; 40) "1" | 34 | INT_NUMBER@[39; 40) "1" |
35 | SEMI@[40; 41) ";" | 35 | SEMICOLON@[40; 41) ";" |
36 | WHITESPACE@[41; 46) "\n " | 36 | WHITESPACE@[41; 46) "\n " |
37 | LET_STMT@[46; 49) | 37 | LET_STMT@[46; 49) |
38 | LET_KW@[46; 49) "let" | 38 | LET_KW@[46; 49) "let" |
@@ -48,7 +48,7 @@ SOURCE_FILE@[0; 139) | |||
48 | WHITESPACE@[63; 64) " " | 48 | WHITESPACE@[63; 64) " " |
49 | LITERAL@[64; 66) | 49 | LITERAL@[64; 66) |
50 | INT_NUMBER@[64; 66) "92" | 50 | INT_NUMBER@[64; 66) "92" |
51 | SEMI@[66; 67) ";" | 51 | SEMICOLON@[66; 67) ";" |
52 | WHITESPACE@[67; 72) "\n " | 52 | WHITESPACE@[67; 72) "\n " |
53 | LET_STMT@[72; 75) | 53 | LET_STMT@[72; 75) |
54 | LET_KW@[72; 75) "let" | 54 | LET_KW@[72; 75) "let" |
@@ -96,12 +96,12 @@ SOURCE_FILE@[0; 139) | |||
96 | R_CURLY@[137; 138) "}" | 96 | R_CURLY@[137; 138) "}" |
97 | WHITESPACE@[138; 139) "\n" | 97 | WHITESPACE@[138; 139) "\n" |
98 | error [24; 24): expected expression | 98 | error [24; 24): expected expression |
99 | error [24; 24): expected SEMI | 99 | error [24; 24): expected SEMICOLON |
100 | error [49; 49): expected pattern | 100 | error [49; 49): expected pattern |
101 | error [49; 49): expected SEMI | 101 | error [49; 49): expected SEMICOLON |
102 | error [75; 75): expected pattern | 102 | error [75; 75): expected pattern |
103 | error [75; 75): expected SEMI | 103 | error [75; 75): expected SEMICOLON |
104 | error [98; 98): expected pattern | 104 | error [98; 98): expected pattern |
105 | error [98; 98): expected SEMI | 105 | error [98; 98): expected SEMICOLON |
106 | error [124; 124): expected pattern | 106 | error [124; 124): expected pattern |
107 | error [124; 124): expected SEMI | 107 | error [124; 124): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast index 9f50c85e5..465749f95 100644 --- a/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast +++ b/crates/ra_syntax/test_data/parser/err/0022_bad_exprs.rast | |||
@@ -150,34 +150,34 @@ SOURCE_FILE@[0; 112) | |||
150 | WHITESPACE@[111; 112) "\n" | 150 | WHITESPACE@[111; 112) "\n" |
151 | error [16; 16): expected expression | 151 | error [16; 16): expected expression |
152 | error [17; 17): expected R_BRACK | 152 | error [17; 17): expected R_BRACK |
153 | error [17; 17): expected SEMI | 153 | error [17; 17): expected SEMICOLON |
154 | error [17; 17): expected expression | 154 | error [17; 17): expected expression |
155 | error [18; 18): expected SEMI | 155 | error [18; 18): expected SEMICOLON |
156 | error [25; 25): expected a name | 156 | error [25; 25): expected a name |
157 | error [26; 26): expected `;`, `{`, or `(` | 157 | error [26; 26): expected `;`, `{`, or `(` |
158 | error [30; 30): expected pattern | 158 | error [30; 30): expected pattern |
159 | error [31; 31): expected SEMI | 159 | error [31; 31): expected SEMICOLON |
160 | error [53; 53): expected expression | 160 | error [53; 53): expected expression |
161 | error [54; 54): expected SEMI | 161 | error [54; 54): expected SEMICOLON |
162 | error [54; 54): expected expression | 162 | error [54; 54): expected expression |
163 | error [55; 55): expected SEMI | 163 | error [55; 55): expected SEMICOLON |
164 | error [60; 60): expected type | 164 | error [60; 60): expected type |
165 | error [60; 60): expected `{` | 165 | error [60; 60): expected `{` |
166 | error [60; 60): expected expression | 166 | error [60; 60): expected expression |
167 | error [61; 61): expected SEMI | 167 | error [61; 61): expected SEMICOLON |
168 | error [65; 65): expected pattern | 168 | error [65; 65): expected pattern |
169 | error [65; 65): expected SEMI | 169 | error [65; 65): expected SEMICOLON |
170 | error [65; 65): expected expression | 170 | error [65; 65): expected expression |
171 | error [92; 92): expected expression | 171 | error [92; 92): expected expression |
172 | error [93; 93): expected SEMI | 172 | error [93; 93): expected SEMICOLON |
173 | error [93; 93): expected expression | 173 | error [93; 93): expected expression |
174 | error [94; 94): expected SEMI | 174 | error [94; 94): expected SEMICOLON |
175 | error [95; 95): expected expression | 175 | error [95; 95): expected expression |
176 | error [96; 96): expected SEMI | 176 | error [96; 96): expected SEMICOLON |
177 | error [96; 96): expected expression | 177 | error [96; 96): expected expression |
178 | error [97; 97): expected SEMI | 178 | error [97; 97): expected SEMICOLON |
179 | error [103; 103): expected a name | 179 | error [103; 103): expected a name |
180 | error [104; 104): expected `{` | 180 | error [104; 104): expected `{` |
181 | error [108; 108): expected pattern | 181 | error [108; 108): expected pattern |
182 | error [108; 108): expected SEMI | 182 | error [108; 108): expected SEMICOLON |
183 | error [108; 108): expected expression | 183 | error [108; 108): expected expression |
diff --git a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast index 775e4b0da..97abe9510 100644 --- a/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast +++ b/crates/ra_syntax/test_data/parser/err/0023_mismatched_paren.rast | |||
@@ -17,7 +17,7 @@ SOURCE_FILE@[0; 94) | |||
17 | PATH_SEGMENT@[16; 19) | 17 | PATH_SEGMENT@[16; 19) |
18 | NAME_REF@[16; 19) | 18 | NAME_REF@[16; 19) |
19 | IDENT@[16; 19) "foo" | 19 | IDENT@[16; 19) "foo" |
20 | EXCL@[19; 20) "!" | 20 | BANG@[19; 20) "!" |
21 | WHITESPACE@[20; 21) " " | 21 | WHITESPACE@[20; 21) " " |
22 | TOKEN_TREE@[21; 49) | 22 | TOKEN_TREE@[21; 49) |
23 | L_PAREN@[21; 22) "(" | 23 | L_PAREN@[21; 22) "(" |
diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast index c5c8a29ba..a3cf3e60a 100644 --- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast +++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast | |||
@@ -144,7 +144,7 @@ SOURCE_FILE@[0; 240) | |||
144 | EXPR_STMT@[121; 123) | 144 | EXPR_STMT@[121; 123) |
145 | ERROR@[121; 122) | 145 | ERROR@[121; 122) |
146 | R_ANGLE@[121; 122) ">" | 146 | R_ANGLE@[121; 122) ">" |
147 | SEMI@[122; 123) ";" | 147 | SEMICOLON@[122; 123) ";" |
148 | WHITESPACE@[123; 128) "\n " | 148 | WHITESPACE@[123; 128) "\n " |
149 | LET_STMT@[128; 141) | 149 | LET_STMT@[128; 141) |
150 | LET_KW@[128; 131) "let" | 150 | LET_KW@[128; 131) "let" |
@@ -219,7 +219,7 @@ SOURCE_FILE@[0; 240) | |||
219 | R_PAREN@[177; 178) ")" | 219 | R_PAREN@[177; 178) ")" |
220 | R_ANGLE@[178; 179) ">" | 220 | R_ANGLE@[178; 179) ">" |
221 | ERROR@[179; 180) | 221 | ERROR@[179; 180) |
222 | SEMI@[179; 180) ";" | 222 | SEMICOLON@[179; 180) ";" |
223 | WHITESPACE@[180; 185) "\n " | 223 | WHITESPACE@[180; 185) "\n " |
224 | LET_STMT@[185; 235) | 224 | LET_STMT@[185; 235) |
225 | LET_KW@[185; 188) "let" | 225 | LET_KW@[185; 188) "let" |
@@ -286,24 +286,24 @@ SOURCE_FILE@[0; 240) | |||
286 | EXPR_STMT@[235; 237) | 286 | EXPR_STMT@[235; 237) |
287 | ERROR@[235; 236) | 287 | ERROR@[235; 236) |
288 | R_ANGLE@[235; 236) ">" | 288 | R_ANGLE@[235; 236) ">" |
289 | SEMI@[236; 237) ";" | 289 | SEMICOLON@[236; 237) ";" |
290 | WHITESPACE@[237; 238) "\n" | 290 | WHITESPACE@[237; 238) "\n" |
291 | R_CURLY@[238; 239) "}" | 291 | R_CURLY@[238; 239) "}" |
292 | WHITESPACE@[239; 240) "\n" | 292 | WHITESPACE@[239; 240) "\n" |
293 | error [88; 88): expected COMMA | 293 | error [88; 88): expected COMMA |
294 | error [88; 88): expected R_ANGLE | 294 | error [88; 88): expected R_ANGLE |
295 | error [121; 121): expected SEMI | 295 | error [121; 121): expected SEMICOLON |
296 | error [121; 121): expected expression | 296 | error [121; 121): expected expression |
297 | error [140; 140): expected type | 297 | error [140; 140): expected type |
298 | error [141; 141): expected R_PAREN | 298 | error [141; 141): expected R_PAREN |
299 | error [141; 141): expected COMMA | 299 | error [141; 141): expected COMMA |
300 | error [141; 141): expected R_ANGLE | 300 | error [141; 141): expected R_ANGLE |
301 | error [141; 141): expected SEMI | 301 | error [141; 141): expected SEMICOLON |
302 | error [146; 146): expected SEMI | 302 | error [146; 146): expected SEMICOLON |
303 | error [146; 146): expected expression | 303 | error [146; 146): expected expression |
304 | error [147; 147): expected SEMI | 304 | error [147; 147): expected SEMICOLON |
305 | error [148; 148): expected expression | 305 | error [148; 148): expected expression |
306 | error [149; 149): expected SEMI | 306 | error [149; 149): expected SEMICOLON |
307 | error [154; 154): expected pattern | 307 | error [154; 154): expected pattern |
308 | error [155; 155): expected IN_KW | 308 | error [155; 155): expected IN_KW |
309 | error [155; 155): expected expression | 309 | error [155; 155): expected expression |
@@ -314,8 +314,8 @@ error [179; 179): expected expression | |||
314 | error [180; 180): expected COMMA | 314 | error [180; 180): expected COMMA |
315 | error [180; 180): expected expression | 315 | error [180; 180): expected expression |
316 | error [180; 180): expected R_PAREN | 316 | error [180; 180): expected R_PAREN |
317 | error [180; 180): expected SEMI | 317 | error [180; 180): expected SEMICOLON |
318 | error [215; 215): expected COMMA | 318 | error [215; 215): expected COMMA |
319 | error [215; 215): expected R_ANGLE | 319 | error [215; 215): expected R_ANGLE |
320 | error [235; 235): expected SEMI | 320 | error [235; 235): expected SEMICOLON |
321 | error [235; 235): expected expression | 321 | error [235; 235): expected expression |
diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.rast b/crates/ra_syntax/test_data/parser/err/0025_nope.rast index ca7f2d255..2b37ce94d 100644 --- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast | |||
@@ -78,7 +78,7 @@ SOURCE_FILE@[0; 575) | |||
78 | WHITESPACE@[183; 184) " " | 78 | WHITESPACE@[183; 184) " " |
79 | LITERAL@[184; 185) | 79 | LITERAL@[184; 185) |
80 | INT_NUMBER@[184; 185) "1" | 80 | INT_NUMBER@[184; 185) "1" |
81 | SEMI@[185; 186) ";" | 81 | SEMICOLON@[185; 186) ";" |
82 | WHITESPACE@[186; 191) "\n " | 82 | WHITESPACE@[186; 191) "\n " |
83 | ENUM_DEF@[191; 223) | 83 | ENUM_DEF@[191; 223) |
84 | ENUM_KW@[191; 195) "enum" | 84 | ENUM_KW@[191; 195) "enum" |
@@ -185,7 +185,7 @@ SOURCE_FILE@[0; 575) | |||
185 | WHITESPACE@[507; 508) " " | 185 | WHITESPACE@[507; 508) " " |
186 | ERROR@[508; 509) | 186 | ERROR@[508; 509) |
187 | UNDERSCORE@[508; 509) "_" | 187 | UNDERSCORE@[508; 509) "_" |
188 | SEMI@[509; 510) ";" | 188 | SEMICOLON@[509; 510) ";" |
189 | WHITESPACE@[510; 511) " " | 189 | WHITESPACE@[510; 511) " " |
190 | COMMENT@[511; 572) "//~ ERROR: expected e ..." | 190 | COMMENT@[511; 572) "//~ ERROR: expected e ..." |
191 | WHITESPACE@[572; 573) "\n" | 191 | WHITESPACE@[572; 573) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast index 522a0d0e0..00d9fd511 100644 --- a/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0031_block_inner_attrs.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 350) | |||
27 | WHITESPACE@[30; 39) "\n " | 27 | WHITESPACE@[30; 39) "\n " |
28 | ATTR@[39; 83) | 28 | ATTR@[39; 83) |
29 | POUND@[39; 40) "#" | 29 | POUND@[39; 40) "#" |
30 | EXCL@[40; 41) "!" | 30 | BANG@[40; 41) "!" |
31 | L_BRACK@[41; 42) "[" | 31 | L_BRACK@[41; 42) "[" |
32 | PATH@[42; 45) | 32 | PATH@[42; 45) |
33 | PATH_SEGMENT@[42; 45) | 33 | PATH_SEGMENT@[42; 45) |
@@ -42,7 +42,7 @@ SOURCE_FILE@[0; 350) | |||
42 | COMMENT@[92; 122) "//! Nor are ModuleDoc ..." | 42 | COMMENT@[92; 122) "//! Nor are ModuleDoc ..." |
43 | WHITESPACE@[122; 127) "\n " | 43 | WHITESPACE@[122; 127) "\n " |
44 | R_CURLY@[127; 128) "}" | 44 | R_CURLY@[127; 128) "}" |
45 | SEMI@[128; 129) ";" | 45 | SEMICOLON@[128; 129) ";" |
46 | WHITESPACE@[129; 134) "\n " | 46 | WHITESPACE@[129; 134) "\n " |
47 | EXPR_STMT@[134; 257) | 47 | EXPR_STMT@[134; 257) |
48 | IF_EXPR@[134; 257) | 48 | IF_EXPR@[134; 257) |
@@ -58,7 +58,7 @@ SOURCE_FILE@[0; 350) | |||
58 | WHITESPACE@[143; 152) "\n " | 58 | WHITESPACE@[143; 152) "\n " |
59 | ATTR@[152; 171) | 59 | ATTR@[152; 171) |
60 | POUND@[152; 153) "#" | 60 | POUND@[152; 153) "#" |
61 | EXCL@[153; 154) "!" | 61 | BANG@[153; 154) "!" |
62 | L_BRACK@[154; 155) "[" | 62 | L_BRACK@[154; 155) "[" |
63 | PATH@[155; 158) | 63 | PATH@[155; 158) |
64 | PATH_SEGMENT@[155; 158) | 64 | PATH_SEGMENT@[155; 158) |
@@ -72,7 +72,7 @@ SOURCE_FILE@[0; 350) | |||
72 | WHITESPACE@[171; 180) "\n " | 72 | WHITESPACE@[171; 180) "\n " |
73 | ATTR@[180; 212) | 73 | ATTR@[180; 212) |
74 | POUND@[180; 181) "#" | 74 | POUND@[180; 181) "#" |
75 | EXCL@[181; 182) "!" | 75 | BANG@[181; 182) "!" |
76 | L_BRACK@[182; 183) "[" | 76 | L_BRACK@[182; 183) "[" |
77 | PATH@[183; 186) | 77 | PATH@[183; 186) |
78 | PATH_SEGMENT@[183; 186) | 78 | PATH_SEGMENT@[183; 186) |
@@ -101,7 +101,7 @@ SOURCE_FILE@[0; 350) | |||
101 | WHITESPACE@[274; 283) "\n " | 101 | WHITESPACE@[274; 283) "\n " |
102 | ATTR@[283; 302) | 102 | ATTR@[283; 302) |
103 | POUND@[283; 284) "#" | 103 | POUND@[283; 284) "#" |
104 | EXCL@[284; 285) "!" | 104 | BANG@[284; 285) "!" |
105 | L_BRACK@[285; 286) "[" | 105 | L_BRACK@[285; 286) "[" |
106 | PATH@[286; 289) | 106 | PATH@[286; 289) |
107 | PATH_SEGMENT@[286; 289) | 107 | PATH_SEGMENT@[286; 289) |
diff --git a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast index c36e2f770..b80101e60 100644 --- a/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0032_match_arms_inner_attrs.rast | |||
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 293) | |||
38 | ATTR@[51; 52) | 38 | ATTR@[51; 52) |
39 | POUND@[51; 52) "#" | 39 | POUND@[51; 52) "#" |
40 | ERROR@[52; 53) | 40 | ERROR@[52; 53) |
41 | EXCL@[52; 53) "!" | 41 | BANG@[52; 53) "!" |
42 | ARRAY_EXPR@[53; 78) | 42 | ARRAY_EXPR@[53; 78) |
43 | L_BRACK@[53; 54) "[" | 43 | L_BRACK@[53; 54) "[" |
44 | CALL_EXPR@[54; 77) | 44 | CALL_EXPR@[54; 77) |
@@ -104,7 +104,7 @@ SOURCE_FILE@[0; 293) | |||
104 | ATTR@[160; 161) | 104 | ATTR@[160; 161) |
105 | POUND@[160; 161) "#" | 105 | POUND@[160; 161) "#" |
106 | ERROR@[161; 162) | 106 | ERROR@[161; 162) |
107 | EXCL@[161; 162) "!" | 107 | BANG@[161; 162) "!" |
108 | ARRAY_EXPR@[162; 179) | 108 | ARRAY_EXPR@[162; 179) |
109 | L_BRACK@[162; 163) "[" | 109 | L_BRACK@[162; 163) "[" |
110 | CALL_EXPR@[163; 178) | 110 | CALL_EXPR@[163; 178) |
@@ -149,7 +149,7 @@ SOURCE_FILE@[0; 293) | |||
149 | ATTR@[231; 232) | 149 | ATTR@[231; 232) |
150 | POUND@[231; 232) "#" | 150 | POUND@[231; 232) "#" |
151 | ERROR@[232; 233) | 151 | ERROR@[232; 233) |
152 | EXCL@[232; 233) "!" | 152 | BANG@[232; 233) "!" |
153 | ARRAY_EXPR@[233; 250) | 153 | ARRAY_EXPR@[233; 250) |
154 | L_BRACK@[233; 234) "[" | 154 | L_BRACK@[233; 234) "[" |
155 | CALL_EXPR@[234; 249) | 155 | CALL_EXPR@[234; 249) |
diff --git a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast index 2c91b6841..2ab9ee56f 100644 --- a/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast +++ b/crates/ra_syntax/test_data/parser/err/0034_bad_box_pattern.rast | |||
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 91) | |||
34 | TUPLE_EXPR@[32; 34) | 34 | TUPLE_EXPR@[32; 34) |
35 | L_PAREN@[32; 33) "(" | 35 | L_PAREN@[32; 33) "(" |
36 | R_PAREN@[33; 34) ")" | 36 | R_PAREN@[33; 34) ")" |
37 | SEMI@[34; 35) ";" | 37 | SEMICOLON@[34; 35) ";" |
38 | WHITESPACE@[35; 40) "\n " | 38 | WHITESPACE@[35; 40) "\n " |
39 | LET_STMT@[40; 51) | 39 | LET_STMT@[40; 51) |
40 | LET_KW@[40; 43) "let" | 40 | LET_KW@[40; 43) "let" |
@@ -58,7 +58,7 @@ SOURCE_FILE@[0; 91) | |||
58 | TUPLE_EXPR@[56; 58) | 58 | TUPLE_EXPR@[56; 58) |
59 | L_PAREN@[56; 57) "(" | 59 | L_PAREN@[56; 57) "(" |
60 | R_PAREN@[57; 58) ")" | 60 | R_PAREN@[57; 58) ")" |
61 | SEMI@[58; 59) ";" | 61 | SEMICOLON@[58; 59) ";" |
62 | WHITESPACE@[59; 64) "\n " | 62 | WHITESPACE@[59; 64) "\n " |
63 | LET_STMT@[64; 79) | 63 | LET_STMT@[64; 79) |
64 | LET_KW@[64; 67) "let" | 64 | LET_KW@[64; 67) "let" |
@@ -84,13 +84,13 @@ SOURCE_FILE@[0; 91) | |||
84 | TUPLE_EXPR@[84; 86) | 84 | TUPLE_EXPR@[84; 86) |
85 | L_PAREN@[84; 85) "(" | 85 | L_PAREN@[84; 85) "(" |
86 | R_PAREN@[85; 86) ")" | 86 | R_PAREN@[85; 86) ")" |
87 | SEMI@[86; 87) ";" | 87 | SEMICOLON@[86; 87) ";" |
88 | WHITESPACE@[87; 88) "\n" | 88 | WHITESPACE@[87; 88) "\n" |
89 | R_CURLY@[88; 89) "}" | 89 | R_CURLY@[88; 89) "}" |
90 | WHITESPACE@[89; 91) "\n\n" | 90 | WHITESPACE@[89; 91) "\n\n" |
91 | error [24; 24): expected a name | 91 | error [24; 24): expected a name |
92 | error [27; 27): expected SEMI | 92 | error [27; 27): expected SEMICOLON |
93 | error [48; 48): expected a name | 93 | error [48; 48): expected a name |
94 | error [51; 51): expected SEMI | 94 | error [51; 51): expected SEMICOLON |
95 | error [76; 76): expected a name | 95 | error [76; 76): expected a name |
96 | error [79; 79): expected SEMI | 96 | error [79; 79): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast b/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast index 8cb4ea796..f255b0a6b 100644 --- a/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0035_use_recover.rast | |||
@@ -8,11 +8,11 @@ SOURCE_FILE@[0; 48) | |||
8 | PATH_SEGMENT@[4; 7) | 8 | PATH_SEGMENT@[4; 7) |
9 | NAME_REF@[4; 7) | 9 | NAME_REF@[4; 7) |
10 | IDENT@[4; 7) "foo" | 10 | IDENT@[4; 7) "foo" |
11 | COLONCOLON@[7; 9) "::" | 11 | COLON2@[7; 9) "::" |
12 | PATH_SEGMENT@[9; 12) | 12 | PATH_SEGMENT@[9; 12) |
13 | NAME_REF@[9; 12) | 13 | NAME_REF@[9; 12) |
14 | IDENT@[9; 12) "bar" | 14 | IDENT@[9; 12) "bar" |
15 | SEMI@[12; 13) ";" | 15 | SEMICOLON@[12; 13) ";" |
16 | WHITESPACE@[13; 14) "\n" | 16 | WHITESPACE@[13; 14) "\n" |
17 | USE_ITEM@[14; 17) | 17 | USE_ITEM@[14; 17) |
18 | USE_KW@[14; 17) "use" | 18 | USE_KW@[14; 17) "use" |
@@ -25,11 +25,11 @@ SOURCE_FILE@[0; 48) | |||
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 | CRATE_KW@[22; 27) "crate" |
28 | COLONCOLON@[27; 29) "::" | 28 | COLON2@[27; 29) "::" |
29 | PATH_SEGMENT@[29; 32) | 29 | PATH_SEGMENT@[29; 32) |
30 | NAME_REF@[29; 32) | 30 | NAME_REF@[29; 32) |
31 | IDENT@[29; 32) "baz" | 31 | IDENT@[29; 32) "baz" |
32 | SEMI@[32; 33) ";" | 32 | SEMICOLON@[32; 33) ";" |
33 | WHITESPACE@[33; 34) "\n" | 33 | WHITESPACE@[33; 34) "\n" |
34 | USE_ITEM@[34; 37) | 34 | USE_ITEM@[34; 37) |
35 | USE_KW@[34; 37) "use" | 35 | USE_KW@[34; 37) "use" |
@@ -49,6 +49,6 @@ SOURCE_FILE@[0; 48) | |||
49 | R_CURLY@[46; 47) "}" | 49 | R_CURLY@[46; 47) "}" |
50 | WHITESPACE@[47; 48) "\n" | 50 | WHITESPACE@[47; 48) "\n" |
51 | error [17; 17): expected one of `*`, `::`, `{`, `self`, `super` or an identifier | 51 | error [17; 17): expected one of `*`, `::`, `{`, `self`, `super` or an identifier |
52 | error [17; 17): expected SEMI | 52 | error [17; 17): expected SEMICOLON |
53 | error [37; 37): expected one of `*`, `::`, `{`, `self`, `super` or an identifier | 53 | error [37; 37): expected one of `*`, `::`, `{`, `self`, `super` or an identifier |
54 | error [37; 37): expected SEMI | 54 | error [37; 37): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0036_partial_use.rast b/crates/ra_syntax/test_data/parser/err/0036_partial_use.rast index f5490fbe8..1f2b4f6d9 100644 --- a/crates/ra_syntax/test_data/parser/err/0036_partial_use.rast +++ b/crates/ra_syntax/test_data/parser/err/0036_partial_use.rast | |||
@@ -7,7 +7,7 @@ SOURCE_FILE@[0; 37) | |||
7 | PATH_SEGMENT@[4; 7) | 7 | PATH_SEGMENT@[4; 7) |
8 | NAME_REF@[4; 7) | 8 | NAME_REF@[4; 7) |
9 | IDENT@[4; 7) "std" | 9 | IDENT@[4; 7) "std" |
10 | COLONCOLON@[7; 9) "::" | 10 | COLON2@[7; 9) "::" |
11 | USE_TREE_LIST@[9; 36) | 11 | USE_TREE_LIST@[9; 36) |
12 | L_CURLY@[9; 10) "{" | 12 | L_CURLY@[9; 10) "{" |
13 | USE_TREE@[10; 22) | 13 | USE_TREE@[10; 22) |
@@ -16,12 +16,12 @@ SOURCE_FILE@[0; 37) | |||
16 | PATH_SEGMENT@[10; 15) | 16 | PATH_SEGMENT@[10; 15) |
17 | NAME_REF@[10; 15) | 17 | NAME_REF@[10; 15) |
18 | IDENT@[10; 15) "error" | 18 | IDENT@[10; 15) "error" |
19 | COLONCOLON@[15; 17) "::" | 19 | COLON2@[15; 17) "::" |
20 | PATH_SEGMENT@[17; 22) | 20 | PATH_SEGMENT@[17; 22) |
21 | NAME_REF@[17; 22) | 21 | NAME_REF@[17; 22) |
22 | IDENT@[17; 22) "Error" | 22 | IDENT@[17; 22) "Error" |
23 | ERROR@[22; 23) | 23 | ERROR@[22; 23) |
24 | SEMI@[22; 23) ";" | 24 | SEMICOLON@[22; 23) ";" |
25 | WHITESPACE@[23; 24) "\n" | 25 | WHITESPACE@[23; 24) "\n" |
26 | ERROR@[24; 27) | 26 | ERROR@[24; 27) |
27 | USE_KW@[24; 27) "use" | 27 | USE_KW@[24; 27) "use" |
@@ -32,12 +32,12 @@ SOURCE_FILE@[0; 37) | |||
32 | PATH_SEGMENT@[28; 31) | 32 | PATH_SEGMENT@[28; 31) |
33 | NAME_REF@[28; 31) | 33 | NAME_REF@[28; 31) |
34 | IDENT@[28; 31) "std" | 34 | IDENT@[28; 31) "std" |
35 | COLONCOLON@[31; 33) "::" | 35 | COLON2@[31; 33) "::" |
36 | PATH_SEGMENT@[33; 35) | 36 | PATH_SEGMENT@[33; 35) |
37 | NAME_REF@[33; 35) | 37 | NAME_REF@[33; 35) |
38 | IDENT@[33; 35) "io" | 38 | IDENT@[33; 35) "io" |
39 | ERROR@[35; 36) | 39 | ERROR@[35; 36) |
40 | SEMI@[35; 36) ";" | 40 | SEMICOLON@[35; 36) ";" |
41 | WHITESPACE@[36; 37) "\n" | 41 | WHITESPACE@[36; 37) "\n" |
42 | error [22; 22): expected COMMA | 42 | error [22; 22): expected COMMA |
43 | error [22; 22): expected one of `*`, `::`, `{`, `self`, `super` or an identifier | 43 | error [22; 22): expected one of `*`, `::`, `{`, `self`, `super` or an identifier |
@@ -48,4 +48,4 @@ error [35; 35): expected COMMA | |||
48 | error [35; 35): expected one of `*`, `::`, `{`, `self`, `super` or an identifier | 48 | error [35; 35): expected one of `*`, `::`, `{`, `self`, `super` or an identifier |
49 | error [36; 36): expected COMMA | 49 | error [36; 36): expected COMMA |
50 | error [36; 36): expected R_CURLY | 50 | error [36; 36): expected R_CURLY |
51 | error [36; 36): expected SEMI | 51 | error [36; 36): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast index d8622d45f..5319bf936 100644 --- a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast +++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rast | |||
@@ -65,7 +65,7 @@ SOURCE_FILE@[0; 118) | |||
65 | TUPLE_TYPE@[78; 80) | 65 | TUPLE_TYPE@[78; 80) |
66 | L_PAREN@[78; 79) "(" | 66 | L_PAREN@[78; 79) "(" |
67 | R_PAREN@[79; 80) ")" | 67 | R_PAREN@[79; 80) ")" |
68 | SEMI@[80; 81) ";" | 68 | SEMICOLON@[80; 81) ";" |
69 | WHITESPACE@[81; 86) "\n " | 69 | WHITESPACE@[81; 86) "\n " |
70 | CONST_DEF@[86; 115) | 70 | CONST_DEF@[86; 115) |
71 | VISIBILITY@[86; 96) | 71 | VISIBILITY@[86; 96) |
@@ -90,7 +90,7 @@ SOURCE_FILE@[0; 118) | |||
90 | WHITESPACE@[111; 112) " " | 90 | WHITESPACE@[111; 112) " " |
91 | LITERAL@[112; 114) | 91 | LITERAL@[112; 114) |
92 | INT_NUMBER@[112; 114) "92" | 92 | INT_NUMBER@[112; 114) "92" |
93 | SEMI@[114; 115) ";" | 93 | SEMICOLON@[114; 115) ";" |
94 | WHITESPACE@[115; 116) "\n" | 94 | WHITESPACE@[115; 116) "\n" |
95 | R_CURLY@[116; 117) "}" | 95 | R_CURLY@[116; 117) "}" |
96 | WHITESPACE@[117; 118) "\n" | 96 | WHITESPACE@[117; 118) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast b/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast index 3810b9680..9efdf7ef4 100644 --- a/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast +++ b/crates/ra_syntax/test_data/parser/err/0038_endless_inclusive_range.rast | |||
@@ -16,13 +16,13 @@ SOURCE_FILE@[0; 33) | |||
16 | RANGE_EXPR@[16; 20) | 16 | RANGE_EXPR@[16; 20) |
17 | LITERAL@[16; 17) | 17 | LITERAL@[16; 17) |
18 | INT_NUMBER@[16; 17) "0" | 18 | INT_NUMBER@[16; 17) "0" |
19 | DOTDOTEQ@[17; 20) "..=" | 19 | DOT2EQ@[17; 20) "..=" |
20 | SEMI@[20; 21) ";" | 20 | SEMICOLON@[20; 21) ";" |
21 | WHITESPACE@[21; 26) "\n " | 21 | WHITESPACE@[21; 26) "\n " |
22 | EXPR_STMT@[26; 30) | 22 | EXPR_STMT@[26; 30) |
23 | RANGE_EXPR@[26; 29) | 23 | RANGE_EXPR@[26; 29) |
24 | DOTDOTEQ@[26; 29) "..=" | 24 | DOT2EQ@[26; 29) "..=" |
25 | SEMI@[29; 30) ";" | 25 | SEMICOLON@[29; 30) ";" |
26 | WHITESPACE@[30; 31) "\n" | 26 | WHITESPACE@[30; 31) "\n" |
27 | R_CURLY@[31; 32) "}" | 27 | R_CURLY@[31; 32) "}" |
28 | WHITESPACE@[32; 33) "\n" | 28 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast index 4a2f0a696..edf9c3247 100644 --- a/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0039_lambda_recovery.rast | |||
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 83) | |||
64 | NAME_REF@[67; 70) | 64 | NAME_REF@[67; 70) |
65 | IDENT@[67; 70) "max" | 65 | IDENT@[67; 70) "max" |
66 | TYPE_ARG_LIST@[70; 77) | 66 | TYPE_ARG_LIST@[70; 77) |
67 | COLONCOLON@[70; 72) "::" | 67 | COLON2@[70; 72) "::" |
68 | L_ANGLE@[72; 73) "<" | 68 | L_ANGLE@[72; 73) "<" |
69 | TYPE_ARG@[73; 76) | 69 | TYPE_ARG@[73; 76) |
70 | PATH_TYPE@[73; 76) | 70 | PATH_TYPE@[73; 76) |
@@ -76,7 +76,7 @@ SOURCE_FILE@[0; 83) | |||
76 | ARG_LIST@[77; 79) | 76 | ARG_LIST@[77; 79) |
77 | L_PAREN@[77; 78) "(" | 77 | L_PAREN@[77; 78) "(" |
78 | R_PAREN@[78; 79) ")" | 78 | R_PAREN@[78; 79) ")" |
79 | SEMI@[79; 80) ";" | 79 | SEMICOLON@[79; 80) ";" |
80 | WHITESPACE@[80; 81) "\n" | 80 | WHITESPACE@[80; 81) "\n" |
81 | R_CURLY@[81; 82) "}" | 81 | R_CURLY@[81; 82) "}" |
82 | WHITESPACE@[82; 83) "\n" | 82 | WHITESPACE@[82; 83) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast index 530533b71..9d807c84f 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0001_array_type_missing_semi.rast | |||
@@ -18,10 +18,10 @@ SOURCE_FILE@[0; 18) | |||
18 | ERROR@[15; 16) | 18 | ERROR@[15; 16) |
19 | R_BRACK@[15; 16) "]" | 19 | R_BRACK@[15; 16) "]" |
20 | ERROR@[16; 17) | 20 | ERROR@[16; 17) |
21 | SEMI@[16; 17) ";" | 21 | SEMICOLON@[16; 17) ";" |
22 | WHITESPACE@[17; 18) "\n" | 22 | WHITESPACE@[17; 18) "\n" |
23 | error [12; 12): expected `;` or `]` | 23 | error [12; 12): expected `;` or `]` |
24 | error [12; 12): expected SEMI | 24 | error [12; 12): expected SEMICOLON |
25 | error [13; 13): expected an item | 25 | error [13; 13): expected an item |
26 | error [15; 15): expected an item | 26 | error [15; 15): expected an item |
27 | error [16; 16): expected an item | 27 | error [16; 16): expected an item |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast index 01a853d63..a85855f8c 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0002_misplaced_label_err.rast | |||
@@ -24,6 +24,6 @@ SOURCE_FILE@[0; 30) | |||
24 | R_CURLY@[28; 29) "}" | 24 | R_CURLY@[28; 29) "}" |
25 | WHITESPACE@[29; 30) "\n" | 25 | WHITESPACE@[29; 30) "\n" |
26 | error [22; 22): expected a loop | 26 | error [22; 22): expected a loop |
27 | error [22; 22): expected SEMI | 27 | error [22; 22): expected SEMICOLON |
28 | error [27; 27): expected type | 28 | error [27; 27): expected type |
29 | error [27; 27): expected `{` | 29 | error [27; 27): expected `{` |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast index 2ab29eecc..e9efad674 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0003_pointer_type_no_mutability.rast | |||
@@ -12,6 +12,6 @@ SOURCE_FILE@[0; 14) | |||
12 | TUPLE_TYPE@[10; 12) | 12 | TUPLE_TYPE@[10; 12) |
13 | L_PAREN@[10; 11) "(" | 13 | L_PAREN@[10; 11) "(" |
14 | R_PAREN@[11; 12) ")" | 14 | R_PAREN@[11; 12) ")" |
15 | SEMI@[12; 13) ";" | 15 | SEMICOLON@[12; 13) ";" |
16 | WHITESPACE@[13; 14) "\n" | 16 | WHITESPACE@[13; 14) "\n" |
17 | error [10; 10): expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) | 17 | error [10; 10): expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast index 9e9186ad4..b8a494085 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0005_fn_pointer_type_missing_fn.rast | |||
@@ -14,10 +14,10 @@ SOURCE_FILE@[0; 20) | |||
14 | ERROR@[17; 18) | 14 | ERROR@[17; 18) |
15 | R_PAREN@[17; 18) ")" | 15 | R_PAREN@[17; 18) ")" |
16 | ERROR@[18; 19) | 16 | ERROR@[18; 19) |
17 | SEMI@[18; 19) ";" | 17 | SEMICOLON@[18; 19) ";" |
18 | WHITESPACE@[19; 20) "\n" | 18 | WHITESPACE@[19; 20) "\n" |
19 | error [15; 15): expected `fn` | 19 | error [15; 15): expected `fn` |
20 | error [15; 15): expected SEMI | 20 | error [15; 15): expected SEMICOLON |
21 | error [16; 16): expected an item | 21 | error [16; 16): expected an item |
22 | error [17; 17): expected an item | 22 | error [17; 17): expected an item |
23 | error [18; 18): expected an item | 23 | error [18; 18): expected an item |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast index a4002a998..c3f7eb477 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0007_async_without_semicolon.rast | |||
@@ -29,4 +29,4 @@ SOURCE_FILE@[0; 30) | |||
29 | WHITESPACE@[27; 28) " " | 29 | WHITESPACE@[27; 28) " " |
30 | R_CURLY@[28; 29) "}" | 30 | R_CURLY@[28; 29) "}" |
31 | WHITESPACE@[29; 30) "\n" | 31 | WHITESPACE@[29; 30) "\n" |
32 | error [27; 27): expected SEMI | 32 | error [27; 27): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast index 6f45a4fa6..a345f8488 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0008_pub_expr.rast | |||
@@ -19,7 +19,7 @@ SOURCE_FILE@[0; 21) | |||
19 | EXPR_STMT@[15; 18) | 19 | EXPR_STMT@[15; 18) |
20 | LITERAL@[15; 17) | 20 | LITERAL@[15; 17) |
21 | INT_NUMBER@[15; 17) "92" | 21 | INT_NUMBER@[15; 17) "92" |
22 | SEMI@[17; 18) ";" | 22 | SEMICOLON@[17; 18) ";" |
23 | WHITESPACE@[18; 19) " " | 23 | WHITESPACE@[18; 19) " " |
24 | R_CURLY@[19; 20) "}" | 24 | R_CURLY@[19; 20) "}" |
25 | WHITESPACE@[20; 21) "\n" | 25 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast index e6d3a5c95..c3a70147a 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0009_attr_on_expr_not_allowed.rast | |||
@@ -30,7 +30,7 @@ SOURCE_FILE@[0; 48) | |||
30 | WHITESPACE@[22; 23) " " | 30 | WHITESPACE@[22; 23) " " |
31 | LITERAL@[23; 24) | 31 | LITERAL@[23; 24) |
32 | INT_NUMBER@[23; 24) "2" | 32 | INT_NUMBER@[23; 24) "2" |
33 | SEMI@[24; 25) ";" | 33 | SEMICOLON@[24; 25) ";" |
34 | WHITESPACE@[25; 29) "\n " | 34 | WHITESPACE@[25; 29) "\n " |
35 | EXPR_STMT@[29; 45) | 35 | EXPR_STMT@[29; 45) |
36 | ATTR@[29; 33) | 36 | ATTR@[29; 33) |
@@ -53,7 +53,7 @@ SOURCE_FILE@[0; 48) | |||
53 | BLOCK@[42; 44) | 53 | BLOCK@[42; 44) |
54 | L_CURLY@[42; 43) "{" | 54 | L_CURLY@[42; 43) "{" |
55 | R_CURLY@[43; 44) "}" | 55 | R_CURLY@[43; 44) "}" |
56 | SEMI@[44; 45) ";" | 56 | SEMICOLON@[44; 45) ";" |
57 | WHITESPACE@[45; 46) "\n" | 57 | WHITESPACE@[45; 46) "\n" |
58 | R_CURLY@[46; 47) "}" | 58 | R_CURLY@[46; 47) "}" |
59 | WHITESPACE@[47; 48) "\n" | 59 | WHITESPACE@[47; 48) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast index 8ad2a588f..61d737abe 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_bad_tuple_index_expr.rast | |||
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 47) | |||
21 | IDENT@[15; 16) "x" | 21 | IDENT@[15; 16) "x" |
22 | DOT@[16; 17) "." | 22 | DOT@[16; 17) "." |
23 | FLOAT_NUMBER@[17; 19) "0." | 23 | FLOAT_NUMBER@[17; 19) "0." |
24 | SEMI@[19; 20) ";" | 24 | SEMICOLON@[19; 20) ";" |
25 | WHITESPACE@[20; 25) "\n " | 25 | WHITESPACE@[20; 25) "\n " |
26 | EXPR_STMT@[25; 32) | 26 | EXPR_STMT@[25; 32) |
27 | FIELD_EXPR@[25; 31) | 27 | FIELD_EXPR@[25; 31) |
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 47) | |||
33 | DOT@[26; 27) "." | 33 | DOT@[26; 27) "." |
34 | NAME_REF@[27; 31) | 34 | NAME_REF@[27; 31) |
35 | INT_NUMBER@[27; 31) "1i32" | 35 | INT_NUMBER@[27; 31) "1i32" |
36 | SEMI@[31; 32) ";" | 36 | SEMICOLON@[31; 32) ";" |
37 | WHITESPACE@[32; 37) "\n " | 37 | WHITESPACE@[32; 37) "\n " |
38 | EXPR_STMT@[37; 44) | 38 | EXPR_STMT@[37; 44) |
39 | FIELD_EXPR@[37; 43) | 39 | FIELD_EXPR@[37; 43) |
@@ -45,7 +45,7 @@ SOURCE_FILE@[0; 47) | |||
45 | DOT@[38; 39) "." | 45 | DOT@[38; 39) "." |
46 | NAME_REF@[39; 43) | 46 | NAME_REF@[39; 43) |
47 | INT_NUMBER@[39; 43) "0x01" | 47 | INT_NUMBER@[39; 43) "0x01" |
48 | SEMI@[43; 44) ";" | 48 | SEMICOLON@[43; 44) ";" |
49 | WHITESPACE@[44; 45) "\n" | 49 | WHITESPACE@[44; 45) "\n" |
50 | R_CURLY@[45; 46) "}" | 50 | R_CURLY@[45; 46) "}" |
51 | WHITESPACE@[46; 47) "\n" | 51 | WHITESPACE@[46; 47) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast index 5b3dc5af2..62fca0a39 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0013_static_underscore.rast | |||
@@ -16,6 +16,6 @@ SOURCE_FILE@[0; 19) | |||
16 | WHITESPACE@[15; 16) " " | 16 | WHITESPACE@[15; 16) " " |
17 | LITERAL@[16; 17) | 17 | LITERAL@[16; 17) |
18 | INT_NUMBER@[16; 17) "5" | 18 | INT_NUMBER@[16; 17) "5" |
19 | SEMI@[17; 18) ";" | 19 | SEMICOLON@[17; 18) ";" |
20 | WHITESPACE@[18; 19) "\n" | 20 | WHITESPACE@[18; 19) "\n" |
21 | error [7; 7): expected a name | 21 | error [7; 7): expected a name |
diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast index 25d80be1d..aa960d3ef 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_default_fn_type.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 62) | |||
27 | PATH_SEGMENT@[31; 34) | 27 | PATH_SEGMENT@[31; 34) |
28 | NAME_REF@[31; 34) | 28 | NAME_REF@[31; 34) |
29 | IDENT@[31; 34) "Bar" | 29 | IDENT@[31; 34) "Bar" |
30 | SEMI@[34; 35) ";" | 30 | SEMICOLON@[34; 35) ";" |
31 | WHITESPACE@[35; 40) "\n " | 31 | WHITESPACE@[35; 40) "\n " |
32 | MACRO_CALL@[40; 47) | 32 | MACRO_CALL@[40; 47) |
33 | PATH@[40; 47) | 33 | PATH@[40; 47) |
@@ -51,9 +51,9 @@ SOURCE_FILE@[0; 62) | |||
51 | WHITESPACE@[59; 60) "\n" | 51 | WHITESPACE@[59; 60) "\n" |
52 | R_CURLY@[60; 61) "}" | 52 | R_CURLY@[60; 61) "}" |
53 | WHITESPACE@[61; 62) "\n" | 53 | WHITESPACE@[61; 62) "\n" |
54 | error [21; 21): expected EXCL | 54 | error [21; 21): expected BANG |
55 | error [21; 21): expected `{`, `[`, `(` | 55 | error [21; 21): expected `{`, `[`, `(` |
56 | error [21; 21): expected SEMI | 56 | error [21; 21): expected SEMICOLON |
57 | error [47; 47): expected EXCL | 57 | error [47; 47): expected BANG |
58 | error [47; 47): expected `{`, `[`, `(` | 58 | error [47; 47): expected `{`, `[`, `(` |
59 | error [47; 47): expected SEMI | 59 | error [47; 47): expected SEMICOLON |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast index ad9f0965e..25c6ef7e3 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0001_trait_item_list.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 83) | |||
25 | PATH_SEGMENT@[21; 26) | 25 | PATH_SEGMENT@[21; 26) |
26 | NAME_REF@[21; 26) | 26 | NAME_REF@[21; 26) |
27 | IDENT@[21; 26) "Clone" | 27 | IDENT@[21; 26) "Clone" |
28 | SEMI@[26; 27) ";" | 28 | SEMICOLON@[26; 27) ";" |
29 | WHITESPACE@[27; 32) "\n " | 29 | WHITESPACE@[27; 32) "\n " |
30 | CONST_DEF@[32; 45) | 30 | CONST_DEF@[32; 45) |
31 | CONST_KW@[32; 37) "const" | 31 | CONST_KW@[32; 37) "const" |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 83) | |||
39 | PATH_SEGMENT@[41; 44) | 39 | PATH_SEGMENT@[41; 44) |
40 | NAME_REF@[41; 44) | 40 | NAME_REF@[41; 44) |
41 | IDENT@[41; 44) "i32" | 41 | IDENT@[41; 44) "i32" |
42 | SEMI@[44; 45) ";" | 42 | SEMICOLON@[44; 45) ";" |
43 | WHITESPACE@[45; 50) "\n " | 43 | WHITESPACE@[45; 50) "\n " |
44 | FN_DEF@[50; 61) | 44 | FN_DEF@[50; 61) |
45 | FN_KW@[50; 52) "fn" | 45 | FN_KW@[50; 52) "fn" |
@@ -66,7 +66,7 @@ SOURCE_FILE@[0; 83) | |||
66 | AMP@[73; 74) "&" | 66 | AMP@[73; 74) "&" |
67 | SELF_KW@[74; 78) "self" | 67 | SELF_KW@[74; 78) "self" |
68 | R_PAREN@[78; 79) ")" | 68 | R_PAREN@[78; 79) ")" |
69 | SEMI@[79; 80) ";" | 69 | SEMICOLON@[79; 80) ";" |
70 | WHITESPACE@[80; 81) "\n" | 70 | WHITESPACE@[80; 81) "\n" |
71 | R_CURLY@[81; 82) "}" | 71 | R_CURLY@[81; 82) "}" |
72 | WHITESPACE@[82; 83) "\n" | 72 | WHITESPACE@[82; 83) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rast index 1b318dfb9..69c459daf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0002_use_tree_list.rast | |||
@@ -12,15 +12,15 @@ SOURCE_FILE@[0; 250) | |||
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 | CRATE_KW@[5; 10) "crate" |
15 | COLONCOLON@[10; 12) "::" | 15 | COLON2@[10; 12) "::" |
16 | PATH_SEGMENT@[12; 16) | 16 | PATH_SEGMENT@[12; 16) |
17 | NAME_REF@[12; 16) | 17 | NAME_REF@[12; 16) |
18 | IDENT@[12; 16) "path" | 18 | IDENT@[12; 16) "path" |
19 | COLONCOLON@[16; 18) "::" | 19 | COLON2@[16; 18) "::" |
20 | PATH_SEGMENT@[18; 22) | 20 | PATH_SEGMENT@[18; 22) |
21 | NAME_REF@[18; 22) | 21 | NAME_REF@[18; 22) |
22 | IDENT@[18; 22) "from" | 22 | IDENT@[18; 22) "from" |
23 | COLONCOLON@[22; 24) "::" | 23 | COLON2@[22; 24) "::" |
24 | PATH_SEGMENT@[24; 28) | 24 | PATH_SEGMENT@[24; 28) |
25 | NAME_REF@[24; 28) | 25 | NAME_REF@[24; 28) |
26 | IDENT@[24; 28) "root" | 26 | IDENT@[24; 28) "root" |
@@ -34,20 +34,20 @@ SOURCE_FILE@[0; 250) | |||
34 | PATH_SEGMENT@[30; 32) | 34 | PATH_SEGMENT@[30; 32) |
35 | NAME_REF@[30; 32) | 35 | NAME_REF@[30; 32) |
36 | IDENT@[30; 32) "or" | 36 | IDENT@[30; 32) "or" |
37 | COLONCOLON@[32; 34) "::" | 37 | COLON2@[32; 34) "::" |
38 | PATH_SEGMENT@[34; 38) | 38 | PATH_SEGMENT@[34; 38) |
39 | NAME_REF@[34; 38) | 39 | NAME_REF@[34; 38) |
40 | IDENT@[34; 38) "path" | 40 | IDENT@[34; 38) "path" |
41 | COLONCOLON@[38; 40) "::" | 41 | COLON2@[38; 40) "::" |
42 | PATH_SEGMENT@[40; 44) | 42 | PATH_SEGMENT@[40; 44) |
43 | NAME_REF@[40; 44) | 43 | NAME_REF@[40; 44) |
44 | IDENT@[40; 44) "from" | 44 | IDENT@[40; 44) "from" |
45 | COLONCOLON@[44; 46) "::" | 45 | COLON2@[44; 46) "::" |
46 | PATH_SEGMENT@[46; 56) | 46 | PATH_SEGMENT@[46; 56) |
47 | NAME_REF@[46; 56) | 47 | NAME_REF@[46; 56) |
48 | IDENT@[46; 56) "crate_name" | 48 | IDENT@[46; 56) "crate_name" |
49 | R_CURLY@[56; 57) "}" | 49 | R_CURLY@[56; 57) "}" |
50 | SEMI@[57; 58) ";" | 50 | SEMICOLON@[57; 58) ";" |
51 | WHITESPACE@[58; 59) " " | 51 | WHITESPACE@[58; 59) " " |
52 | COMMENT@[59; 97) "// Rust 2018 (with a ..." | 52 | COMMENT@[59; 97) "// Rust 2018 (with a ..." |
53 | WHITESPACE@[97; 98) "\n" | 53 | WHITESPACE@[97; 98) "\n" |
@@ -64,16 +64,16 @@ SOURCE_FILE@[0; 250) | |||
64 | PATH_SEGMENT@[103; 107) | 64 | PATH_SEGMENT@[103; 107) |
65 | NAME_REF@[103; 107) | 65 | NAME_REF@[103; 107) |
66 | IDENT@[103; 107) "path" | 66 | IDENT@[103; 107) "path" |
67 | COLONCOLON@[107; 109) "::" | 67 | COLON2@[107; 109) "::" |
68 | PATH_SEGMENT@[109; 113) | 68 | PATH_SEGMENT@[109; 113) |
69 | NAME_REF@[109; 113) | 69 | NAME_REF@[109; 113) |
70 | IDENT@[109; 113) "from" | 70 | IDENT@[109; 113) "from" |
71 | COLONCOLON@[113; 115) "::" | 71 | COLON2@[113; 115) "::" |
72 | PATH_SEGMENT@[115; 119) | 72 | PATH_SEGMENT@[115; 119) |
73 | NAME_REF@[115; 119) | 73 | NAME_REF@[115; 119) |
74 | IDENT@[115; 119) "root" | 74 | IDENT@[115; 119) "root" |
75 | R_CURLY@[119; 120) "}" | 75 | R_CURLY@[119; 120) "}" |
76 | SEMI@[120; 121) ";" | 76 | SEMICOLON@[120; 121) ";" |
77 | WHITESPACE@[121; 122) " " | 77 | WHITESPACE@[121; 122) " " |
78 | COMMENT@[122; 134) "// Rust 2015" | 78 | COMMENT@[122; 134) "// Rust 2015" |
79 | WHITESPACE@[134; 135) "\n" | 79 | WHITESPACE@[134; 135) "\n" |
@@ -81,7 +81,7 @@ SOURCE_FILE@[0; 250) | |||
81 | USE_KW@[135; 138) "use" | 81 | USE_KW@[135; 138) "use" |
82 | WHITESPACE@[138; 139) " " | 82 | WHITESPACE@[138; 139) " " |
83 | USE_TREE@[139; 165) | 83 | USE_TREE@[139; 165) |
84 | COLONCOLON@[139; 141) "::" | 84 | COLON2@[139; 141) "::" |
85 | USE_TREE_LIST@[141; 165) | 85 | USE_TREE_LIST@[141; 165) |
86 | L_CURLY@[141; 142) "{" | 86 | L_CURLY@[141; 142) "{" |
87 | USE_TREE@[142; 164) | 87 | USE_TREE@[142; 164) |
@@ -91,16 +91,16 @@ SOURCE_FILE@[0; 250) | |||
91 | PATH_SEGMENT@[142; 146) | 91 | PATH_SEGMENT@[142; 146) |
92 | NAME_REF@[142; 146) | 92 | NAME_REF@[142; 146) |
93 | IDENT@[142; 146) "some" | 93 | IDENT@[142; 146) "some" |
94 | COLONCOLON@[146; 148) "::" | 94 | COLON2@[146; 148) "::" |
95 | PATH_SEGMENT@[148; 158) | 95 | PATH_SEGMENT@[148; 158) |
96 | NAME_REF@[148; 158) | 96 | NAME_REF@[148; 158) |
97 | IDENT@[148; 158) "arbritrary" | 97 | IDENT@[148; 158) "arbritrary" |
98 | COLONCOLON@[158; 160) "::" | 98 | COLON2@[158; 160) "::" |
99 | PATH_SEGMENT@[160; 164) | 99 | PATH_SEGMENT@[160; 164) |
100 | NAME_REF@[160; 164) | 100 | NAME_REF@[160; 164) |
101 | IDENT@[160; 164) "path" | 101 | IDENT@[160; 164) "path" |
102 | R_CURLY@[164; 165) "}" | 102 | R_CURLY@[164; 165) "}" |
103 | SEMI@[165; 166) ";" | 103 | SEMICOLON@[165; 166) ";" |
104 | WHITESPACE@[166; 167) " " | 104 | WHITESPACE@[166; 167) " " |
105 | COMMENT@[167; 179) "// Rust 2015" | 105 | COMMENT@[167; 179) "// Rust 2015" |
106 | WHITESPACE@[179; 180) "\n" | 106 | WHITESPACE@[179; 180) "\n" |
@@ -108,7 +108,7 @@ SOURCE_FILE@[0; 250) | |||
108 | USE_KW@[180; 183) "use" | 108 | USE_KW@[180; 183) "use" |
109 | WHITESPACE@[183; 184) " " | 109 | WHITESPACE@[183; 184) " " |
110 | USE_TREE@[184; 205) | 110 | USE_TREE@[184; 205) |
111 | COLONCOLON@[184; 186) "::" | 111 | COLON2@[184; 186) "::" |
112 | USE_TREE_LIST@[186; 205) | 112 | USE_TREE_LIST@[186; 205) |
113 | L_CURLY@[186; 187) "{" | 113 | L_CURLY@[186; 187) "{" |
114 | USE_TREE@[187; 204) | 114 | USE_TREE@[187; 204) |
@@ -122,14 +122,14 @@ SOURCE_FILE@[0; 250) | |||
122 | PATH@[189; 194) | 122 | PATH@[189; 194) |
123 | PATH_SEGMENT@[189; 194) | 123 | PATH_SEGMENT@[189; 194) |
124 | CRATE_KW@[189; 194) "crate" | 124 | CRATE_KW@[189; 194) "crate" |
125 | COLONCOLON@[194; 196) "::" | 125 | COLON2@[194; 196) "::" |
126 | PATH_SEGMENT@[196; 202) | 126 | PATH_SEGMENT@[196; 202) |
127 | NAME_REF@[196; 202) | 127 | NAME_REF@[196; 202) |
128 | IDENT@[196; 202) "export" | 128 | IDENT@[196; 202) "export" |
129 | R_CURLY@[202; 203) "}" | 129 | R_CURLY@[202; 203) "}" |
130 | R_CURLY@[203; 204) "}" | 130 | R_CURLY@[203; 204) "}" |
131 | R_CURLY@[204; 205) "}" | 131 | R_CURLY@[204; 205) "}" |
132 | SEMI@[205; 206) ";" | 132 | SEMICOLON@[205; 206) ";" |
133 | WHITESPACE@[206; 207) " " | 133 | WHITESPACE@[206; 207) " " |
134 | COMMENT@[207; 249) "// Nonsensical but pe ..." | 134 | COMMENT@[207; 249) "// Nonsensical but pe ..." |
135 | WHITESPACE@[249; 250) "\n" | 135 | WHITESPACE@[249; 250) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast index 9241f6fb2..a0cf1e4f6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0004_value_parameters_no_patterns.rast | |||
@@ -56,5 +56,5 @@ SOURCE_FILE@[0; 39) | |||
56 | R_PAREN@[34; 35) ")" | 56 | R_PAREN@[34; 35) ")" |
57 | R_PAREN@[35; 36) ")" | 57 | R_PAREN@[35; 36) ")" |
58 | R_ANGLE@[36; 37) ">" | 58 | R_ANGLE@[36; 37) ">" |
59 | SEMI@[37; 38) ";" | 59 | SEMICOLON@[37; 38) ";" |
60 | WHITESPACE@[38; 39) "\n" | 60 | WHITESPACE@[38; 39) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast index a7186c7a8..027abf179 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0007_type_param_bounds.rast | |||
@@ -36,5 +36,5 @@ SOURCE_FILE@[0; 35) | |||
36 | IDENT@[27; 31) "Copy" | 36 | IDENT@[27; 31) "Copy" |
37 | R_PAREN@[31; 32) ")" | 37 | R_PAREN@[31; 32) ")" |
38 | R_ANGLE@[32; 33) ">" | 38 | R_ANGLE@[32; 33) ">" |
39 | SEMI@[33; 34) ";" | 39 | SEMICOLON@[33; 34) ";" |
40 | WHITESPACE@[34; 35) "\n" | 40 | WHITESPACE@[34; 35) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast index 3812adc9e..f4697fed6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0008_path_part.rast | |||
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 103) | |||
21 | PATH_SEGMENT@[19; 22) | 21 | PATH_SEGMENT@[19; 22) |
22 | NAME_REF@[19; 22) | 22 | NAME_REF@[19; 22) |
23 | IDENT@[19; 22) "foo" | 23 | IDENT@[19; 22) "foo" |
24 | COLONCOLON@[22; 24) "::" | 24 | COLON2@[22; 24) "::" |
25 | PATH_SEGMENT@[24; 27) | 25 | PATH_SEGMENT@[24; 27) |
26 | NAME_REF@[24; 27) | 26 | NAME_REF@[24; 27) |
27 | IDENT@[24; 27) "Bar" | 27 | IDENT@[24; 27) "Bar" |
@@ -31,7 +31,7 @@ SOURCE_FILE@[0; 103) | |||
31 | TUPLE_EXPR@[30; 32) | 31 | TUPLE_EXPR@[30; 32) |
32 | L_PAREN@[30; 31) "(" | 32 | L_PAREN@[30; 31) "(" |
33 | R_PAREN@[31; 32) ")" | 33 | R_PAREN@[31; 32) ")" |
34 | SEMI@[32; 33) ";" | 34 | SEMICOLON@[32; 33) ";" |
35 | WHITESPACE@[33; 38) "\n " | 35 | WHITESPACE@[33; 38) "\n " |
36 | LET_STMT@[38; 53) | 36 | LET_STMT@[38; 53) |
37 | LET_KW@[38; 41) "let" | 37 | LET_KW@[38; 41) "let" |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 103) | |||
39 | PATH_PAT@[42; 47) | 39 | PATH_PAT@[42; 47) |
40 | PATH@[42; 47) | 40 | PATH@[42; 47) |
41 | PATH_SEGMENT@[42; 47) | 41 | PATH_SEGMENT@[42; 47) |
42 | COLONCOLON@[42; 44) "::" | 42 | COLON2@[42; 44) "::" |
43 | NAME_REF@[44; 47) | 43 | NAME_REF@[44; 47) |
44 | IDENT@[44; 47) "Bar" | 44 | IDENT@[44; 47) "Bar" |
45 | WHITESPACE@[47; 48) " " | 45 | WHITESPACE@[47; 48) " " |
@@ -48,7 +48,7 @@ SOURCE_FILE@[0; 103) | |||
48 | TUPLE_EXPR@[50; 52) | 48 | TUPLE_EXPR@[50; 52) |
49 | L_PAREN@[50; 51) "(" | 49 | L_PAREN@[50; 51) "(" |
50 | R_PAREN@[51; 52) ")" | 50 | R_PAREN@[51; 52) ")" |
51 | SEMI@[52; 53) ";" | 51 | SEMICOLON@[52; 53) ";" |
52 | WHITESPACE@[53; 58) "\n " | 52 | WHITESPACE@[53; 58) "\n " |
53 | LET_STMT@[58; 78) | 53 | LET_STMT@[58; 78) |
54 | LET_KW@[58; 61) "let" | 54 | LET_KW@[58; 61) "let" |
@@ -62,7 +62,7 @@ SOURCE_FILE@[0; 103) | |||
62 | RECORD_FIELD_PAT_LIST@[66; 72) | 62 | RECORD_FIELD_PAT_LIST@[66; 72) |
63 | L_CURLY@[66; 67) "{" | 63 | L_CURLY@[66; 67) "{" |
64 | WHITESPACE@[67; 68) " " | 64 | WHITESPACE@[67; 68) " " |
65 | DOTDOT@[68; 70) ".." | 65 | DOT2@[68; 70) ".." |
66 | WHITESPACE@[70; 71) " " | 66 | WHITESPACE@[70; 71) " " |
67 | R_CURLY@[71; 72) "}" | 67 | R_CURLY@[71; 72) "}" |
68 | WHITESPACE@[72; 73) " " | 68 | WHITESPACE@[72; 73) " " |
@@ -71,7 +71,7 @@ SOURCE_FILE@[0; 103) | |||
71 | TUPLE_EXPR@[75; 77) | 71 | TUPLE_EXPR@[75; 77) |
72 | L_PAREN@[75; 76) "(" | 72 | L_PAREN@[75; 76) "(" |
73 | R_PAREN@[76; 77) ")" | 73 | R_PAREN@[76; 77) ")" |
74 | SEMI@[77; 78) ";" | 74 | SEMICOLON@[77; 78) ";" |
75 | WHITESPACE@[78; 83) "\n " | 75 | WHITESPACE@[78; 83) "\n " |
76 | LET_STMT@[83; 100) | 76 | LET_STMT@[83; 100) |
77 | LET_KW@[83; 86) "let" | 77 | LET_KW@[83; 86) "let" |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 103) | |||
83 | IDENT@[87; 90) "Bar" | 83 | IDENT@[87; 90) "Bar" |
84 | L_PAREN@[90; 91) "(" | 84 | L_PAREN@[90; 91) "(" |
85 | DOT_DOT_PAT@[91; 93) | 85 | DOT_DOT_PAT@[91; 93) |
86 | DOTDOT@[91; 93) ".." | 86 | DOT2@[91; 93) ".." |
87 | R_PAREN@[93; 94) ")" | 87 | R_PAREN@[93; 94) ")" |
88 | WHITESPACE@[94; 95) " " | 88 | WHITESPACE@[94; 95) " " |
89 | EQ@[95; 96) "=" | 89 | EQ@[95; 96) "=" |
@@ -91,7 +91,7 @@ SOURCE_FILE@[0; 103) | |||
91 | TUPLE_EXPR@[97; 99) | 91 | TUPLE_EXPR@[97; 99) |
92 | L_PAREN@[97; 98) "(" | 92 | L_PAREN@[97; 98) "(" |
93 | R_PAREN@[98; 99) ")" | 93 | R_PAREN@[98; 99) ")" |
94 | SEMI@[99; 100) ";" | 94 | SEMICOLON@[99; 100) ";" |
95 | WHITESPACE@[100; 101) "\n" | 95 | WHITESPACE@[100; 101) "\n" |
96 | R_CURLY@[101; 102) "}" | 96 | R_CURLY@[101; 102) "}" |
97 | WHITESPACE@[102; 103) "\n" | 97 | WHITESPACE@[102; 103) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast index 2d8872022..cc759310a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0009_loop_expr.rast | |||
@@ -20,7 +20,7 @@ SOURCE_FILE@[0; 26) | |||
20 | BLOCK@[20; 22) | 20 | BLOCK@[20; 22) |
21 | L_CURLY@[20; 21) "{" | 21 | L_CURLY@[20; 21) "{" |
22 | R_CURLY@[21; 22) "}" | 22 | R_CURLY@[21; 22) "}" |
23 | SEMI@[22; 23) ";" | 23 | SEMICOLON@[22; 23) ";" |
24 | WHITESPACE@[23; 24) "\n" | 24 | WHITESPACE@[23; 24) "\n" |
25 | R_CURLY@[24; 25) "}" | 25 | R_CURLY@[24; 25) "}" |
26 | WHITESPACE@[25; 26) "\n" | 26 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast index 29b268b55..c2fafe472 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0011_field_expr.rast | |||
@@ -22,7 +22,7 @@ SOURCE_FILE@[0; 48) | |||
22 | DOT@[16; 17) "." | 22 | DOT@[16; 17) "." |
23 | NAME_REF@[17; 20) | 23 | NAME_REF@[17; 20) |
24 | IDENT@[17; 20) "foo" | 24 | IDENT@[17; 20) "foo" |
25 | SEMI@[20; 21) ";" | 25 | SEMICOLON@[20; 21) ";" |
26 | WHITESPACE@[21; 26) "\n " | 26 | WHITESPACE@[21; 26) "\n " |
27 | EXPR_STMT@[26; 34) | 27 | EXPR_STMT@[26; 34) |
28 | FIELD_EXPR@[26; 33) | 28 | FIELD_EXPR@[26; 33) |
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 48) | |||
38 | DOT@[29; 30) "." | 38 | DOT@[29; 30) "." |
39 | NAME_REF@[30; 33) | 39 | NAME_REF@[30; 33) |
40 | IDENT@[30; 33) "bar" | 40 | IDENT@[30; 33) "bar" |
41 | SEMI@[33; 34) ";" | 41 | SEMICOLON@[33; 34) ";" |
42 | WHITESPACE@[34; 39) "\n " | 42 | WHITESPACE@[34; 39) "\n " |
43 | EXPR_STMT@[39; 45) | 43 | EXPR_STMT@[39; 45) |
44 | CALL_EXPR@[39; 44) | 44 | CALL_EXPR@[39; 44) |
@@ -54,7 +54,7 @@ SOURCE_FILE@[0; 48) | |||
54 | ARG_LIST@[42; 44) | 54 | ARG_LIST@[42; 44) |
55 | L_PAREN@[42; 43) "(" | 55 | L_PAREN@[42; 43) "(" |
56 | R_PAREN@[43; 44) ")" | 56 | R_PAREN@[43; 44) ")" |
57 | SEMI@[44; 45) ";" | 57 | SEMICOLON@[44; 45) ";" |
58 | WHITESPACE@[45; 46) "\n" | 58 | WHITESPACE@[45; 46) "\n" |
59 | R_CURLY@[46; 47) "}" | 59 | R_CURLY@[46; 47) "}" |
60 | WHITESPACE@[47; 48) "\n" | 60 | WHITESPACE@[47; 48) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast index da04dac5c..15d8c736d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0012_type_item_where_clause.rast | |||
@@ -29,5 +29,5 @@ SOURCE_FILE@[0; 31) | |||
29 | TUPLE_TYPE@[27; 29) | 29 | TUPLE_TYPE@[27; 29) |
30 | L_PAREN@[27; 28) "(" | 30 | L_PAREN@[27; 28) "(" |
31 | R_PAREN@[28; 29) ")" | 31 | R_PAREN@[28; 29) ")" |
32 | SEMI@[29; 30) ";" | 32 | SEMICOLON@[29; 30) ";" |
33 | WHITESPACE@[30; 31) "\n" | 33 | WHITESPACE@[30; 31) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast index c05f873d6..a72d56495 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0013_pointer_type_mut.rast | |||
@@ -14,7 +14,7 @@ SOURCE_FILE@[0; 36) | |||
14 | TUPLE_TYPE@[14; 16) | 14 | TUPLE_TYPE@[14; 16) |
15 | L_PAREN@[14; 15) "(" | 15 | L_PAREN@[14; 15) "(" |
16 | R_PAREN@[15; 16) ")" | 16 | R_PAREN@[15; 16) ")" |
17 | SEMI@[16; 17) ";" | 17 | SEMICOLON@[16; 17) ";" |
18 | WHITESPACE@[17; 18) "\n" | 18 | WHITESPACE@[17; 18) "\n" |
19 | TYPE_ALIAS_DEF@[18; 35) | 19 | TYPE_ALIAS_DEF@[18; 35) |
20 | TYPE_KW@[18; 22) "type" | 20 | TYPE_KW@[18; 22) "type" |
@@ -31,5 +31,5 @@ SOURCE_FILE@[0; 36) | |||
31 | TUPLE_TYPE@[32; 34) | 31 | TUPLE_TYPE@[32; 34) |
32 | L_PAREN@[32; 33) "(" | 32 | L_PAREN@[32; 33) "(" |
33 | R_PAREN@[33; 34) ")" | 33 | R_PAREN@[33; 34) ")" |
34 | SEMI@[34; 35) ";" | 34 | SEMICOLON@[34; 35) ";" |
35 | WHITESPACE@[35; 36) "\n" | 35 | WHITESPACE@[35; 36) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast index ac53e4fd3..3c98467c7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0014_never_type.rast | |||
@@ -8,6 +8,6 @@ SOURCE_FILE@[0; 16) | |||
8 | EQ@[11; 12) "=" | 8 | EQ@[11; 12) "=" |
9 | WHITESPACE@[12; 13) " " | 9 | WHITESPACE@[12; 13) " " |
10 | NEVER_TYPE@[13; 14) | 10 | NEVER_TYPE@[13; 14) |
11 | EXCL@[13; 14) "!" | 11 | BANG@[13; 14) "!" |
12 | SEMI@[14; 15) ";" | 12 | SEMICOLON@[14; 15) ";" |
13 | WHITESPACE@[15; 16) "\n" | 13 | WHITESPACE@[15; 16) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast index c051c1c86..adaece119 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0015_continue_expr.rast | |||
@@ -22,14 +22,14 @@ SOURCE_FILE@[0; 69) | |||
22 | EXPR_STMT@[30; 39) | 22 | EXPR_STMT@[30; 39) |
23 | CONTINUE_EXPR@[30; 38) | 23 | CONTINUE_EXPR@[30; 38) |
24 | CONTINUE_KW@[30; 38) "continue" | 24 | CONTINUE_KW@[30; 38) "continue" |
25 | SEMI@[38; 39) ";" | 25 | SEMICOLON@[38; 39) ";" |
26 | WHITESPACE@[39; 48) "\n " | 26 | WHITESPACE@[39; 48) "\n " |
27 | EXPR_STMT@[48; 60) | 27 | EXPR_STMT@[48; 60) |
28 | CONTINUE_EXPR@[48; 59) | 28 | CONTINUE_EXPR@[48; 59) |
29 | CONTINUE_KW@[48; 56) "continue" | 29 | CONTINUE_KW@[48; 56) "continue" |
30 | WHITESPACE@[56; 57) " " | 30 | WHITESPACE@[56; 57) " " |
31 | LIFETIME@[57; 59) "\'l" | 31 | LIFETIME@[57; 59) "\'l" |
32 | SEMI@[59; 60) ";" | 32 | SEMICOLON@[59; 60) ";" |
33 | WHITESPACE@[60; 65) "\n " | 33 | WHITESPACE@[60; 65) "\n " |
34 | R_CURLY@[65; 66) "}" | 34 | R_CURLY@[65; 66) "}" |
35 | WHITESPACE@[66; 67) "\n" | 35 | WHITESPACE@[66; 67) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast index b4055c9f0..f4c86a05f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0017_array_type.rast | |||
@@ -12,10 +12,10 @@ SOURCE_FILE@[0; 19) | |||
12 | TUPLE_TYPE@[10; 12) | 12 | TUPLE_TYPE@[10; 12) |
13 | L_PAREN@[10; 11) "(" | 13 | L_PAREN@[10; 11) "(" |
14 | R_PAREN@[11; 12) ")" | 14 | R_PAREN@[11; 12) ")" |
15 | SEMI@[12; 13) ";" | 15 | SEMICOLON@[12; 13) ";" |
16 | WHITESPACE@[13; 14) " " | 16 | WHITESPACE@[13; 14) " " |
17 | LITERAL@[14; 16) | 17 | LITERAL@[14; 16) |
18 | INT_NUMBER@[14; 16) "92" | 18 | INT_NUMBER@[14; 16) "92" |
19 | R_BRACK@[16; 17) "]" | 19 | R_BRACK@[16; 17) "]" |
20 | SEMI@[17; 18) ";" | 20 | SEMICOLON@[17; 18) ";" |
21 | WHITESPACE@[18; 19) "\n" | 21 | WHITESPACE@[18; 19) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast index 2d71efd86..5a42f360c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0019_unary_expr.rast | |||
@@ -21,16 +21,16 @@ SOURCE_FILE@[0; 44) | |||
21 | AMP@[17; 18) "&" | 21 | AMP@[17; 18) "&" |
22 | LITERAL@[18; 19) | 22 | LITERAL@[18; 19) |
23 | INT_NUMBER@[18; 19) "1" | 23 | INT_NUMBER@[18; 19) "1" |
24 | SEMI@[19; 20) ";" | 24 | SEMICOLON@[19; 20) ";" |
25 | WHITESPACE@[20; 25) "\n " | 25 | WHITESPACE@[20; 25) "\n " |
26 | EXPR_STMT@[25; 32) | 26 | EXPR_STMT@[25; 32) |
27 | PREFIX_EXPR@[25; 31) | 27 | PREFIX_EXPR@[25; 31) |
28 | EXCL@[25; 26) "!" | 28 | BANG@[25; 26) "!" |
29 | PREFIX_EXPR@[26; 31) | 29 | PREFIX_EXPR@[26; 31) |
30 | EXCL@[26; 27) "!" | 30 | BANG@[26; 27) "!" |
31 | LITERAL@[27; 31) | 31 | LITERAL@[27; 31) |
32 | TRUE_KW@[27; 31) "true" | 32 | TRUE_KW@[27; 31) "true" |
33 | SEMI@[31; 32) ";" | 33 | SEMICOLON@[31; 32) ";" |
34 | WHITESPACE@[32; 37) "\n " | 34 | WHITESPACE@[32; 37) "\n " |
35 | EXPR_STMT@[37; 41) | 35 | EXPR_STMT@[37; 41) |
36 | PREFIX_EXPR@[37; 40) | 36 | PREFIX_EXPR@[37; 40) |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 44) | |||
39 | MINUS@[38; 39) "-" | 39 | MINUS@[38; 39) "-" |
40 | LITERAL@[39; 40) | 40 | LITERAL@[39; 40) |
41 | INT_NUMBER@[39; 40) "1" | 41 | INT_NUMBER@[39; 40) "1" |
42 | SEMI@[40; 41) ";" | 42 | SEMICOLON@[40; 41) ";" |
43 | WHITESPACE@[41; 42) "\n" | 43 | WHITESPACE@[41; 42) "\n" |
44 | R_CURLY@[42; 43) "}" | 44 | R_CURLY@[42; 43) "}" |
45 | WHITESPACE@[43; 44) "\n" | 45 | WHITESPACE@[43; 44) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rast b/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rast index dd2095d90..c1bedb37c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0020_use_star.rast | |||
@@ -4,15 +4,15 @@ SOURCE_FILE@[0; 60) | |||
4 | WHITESPACE@[3; 4) " " | 4 | WHITESPACE@[3; 4) " " |
5 | USE_TREE@[4; 5) | 5 | USE_TREE@[4; 5) |
6 | STAR@[4; 5) "*" | 6 | STAR@[4; 5) "*" |
7 | SEMI@[5; 6) ";" | 7 | SEMICOLON@[5; 6) ";" |
8 | WHITESPACE@[6; 7) "\n" | 8 | WHITESPACE@[6; 7) "\n" |
9 | USE_ITEM@[7; 15) | 9 | USE_ITEM@[7; 15) |
10 | USE_KW@[7; 10) "use" | 10 | USE_KW@[7; 10) "use" |
11 | WHITESPACE@[10; 11) " " | 11 | WHITESPACE@[10; 11) " " |
12 | USE_TREE@[11; 14) | 12 | USE_TREE@[11; 14) |
13 | COLONCOLON@[11; 13) "::" | 13 | COLON2@[11; 13) "::" |
14 | STAR@[13; 14) "*" | 14 | STAR@[13; 14) "*" |
15 | SEMI@[14; 15) ";" | 15 | SEMICOLON@[14; 15) ";" |
16 | WHITESPACE@[15; 16) "\n" | 16 | WHITESPACE@[15; 16) "\n" |
17 | USE_ITEM@[16; 36) | 17 | USE_ITEM@[16; 36) |
18 | USE_KW@[16; 19) "use" | 18 | USE_KW@[16; 19) "use" |
@@ -23,17 +23,17 @@ SOURCE_FILE@[0; 60) | |||
23 | PATH_SEGMENT@[20; 24) | 23 | PATH_SEGMENT@[20; 24) |
24 | NAME_REF@[20; 24) | 24 | NAME_REF@[20; 24) |
25 | IDENT@[20; 24) "some" | 25 | IDENT@[20; 24) "some" |
26 | COLONCOLON@[24; 26) "::" | 26 | COLON2@[24; 26) "::" |
27 | PATH_SEGMENT@[26; 30) | 27 | PATH_SEGMENT@[26; 30) |
28 | NAME_REF@[26; 30) | 28 | NAME_REF@[26; 30) |
29 | IDENT@[26; 30) "path" | 29 | IDENT@[26; 30) "path" |
30 | COLONCOLON@[30; 32) "::" | 30 | COLON2@[30; 32) "::" |
31 | USE_TREE_LIST@[32; 35) | 31 | USE_TREE_LIST@[32; 35) |
32 | L_CURLY@[32; 33) "{" | 32 | L_CURLY@[32; 33) "{" |
33 | USE_TREE@[33; 34) | 33 | USE_TREE@[33; 34) |
34 | STAR@[33; 34) "*" | 34 | STAR@[33; 34) "*" |
35 | R_CURLY@[34; 35) "}" | 35 | R_CURLY@[34; 35) "}" |
36 | SEMI@[35; 36) ";" | 36 | SEMICOLON@[35; 36) ";" |
37 | WHITESPACE@[36; 37) "\n" | 37 | WHITESPACE@[36; 37) "\n" |
38 | USE_ITEM@[37; 59) | 38 | USE_ITEM@[37; 59) |
39 | USE_KW@[37; 40) "use" | 39 | USE_KW@[37; 40) "use" |
@@ -44,16 +44,16 @@ SOURCE_FILE@[0; 60) | |||
44 | PATH_SEGMENT@[41; 45) | 44 | PATH_SEGMENT@[41; 45) |
45 | NAME_REF@[41; 45) | 45 | NAME_REF@[41; 45) |
46 | IDENT@[41; 45) "some" | 46 | IDENT@[41; 45) "some" |
47 | COLONCOLON@[45; 47) "::" | 47 | COLON2@[45; 47) "::" |
48 | PATH_SEGMENT@[47; 51) | 48 | PATH_SEGMENT@[47; 51) |
49 | NAME_REF@[47; 51) | 49 | NAME_REF@[47; 51) |
50 | IDENT@[47; 51) "path" | 50 | IDENT@[47; 51) "path" |
51 | COLONCOLON@[51; 53) "::" | 51 | COLON2@[51; 53) "::" |
52 | USE_TREE_LIST@[53; 58) | 52 | USE_TREE_LIST@[53; 58) |
53 | L_CURLY@[53; 54) "{" | 53 | L_CURLY@[53; 54) "{" |
54 | USE_TREE@[54; 57) | 54 | USE_TREE@[54; 57) |
55 | COLONCOLON@[54; 56) "::" | 55 | COLON2@[54; 56) "::" |
56 | STAR@[56; 57) "*" | 56 | STAR@[56; 57) "*" |
57 | R_CURLY@[57; 58) "}" | 57 | R_CURLY@[57; 58) "}" |
58 | SEMI@[58; 59) ";" | 58 | SEMICOLON@[58; 59) ";" |
59 | WHITESPACE@[59; 60) "\n" | 59 | WHITESPACE@[59; 60) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast index b1af67976..767a49ce6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0021_impl_item_list.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 89) | |||
24 | PATH_SEGMENT@[22; 25) | 24 | PATH_SEGMENT@[22; 25) |
25 | NAME_REF@[22; 25) | 25 | NAME_REF@[22; 25) |
26 | IDENT@[22; 25) "i32" | 26 | IDENT@[22; 25) "i32" |
27 | SEMI@[25; 26) ";" | 27 | SEMICOLON@[25; 26) ";" |
28 | WHITESPACE@[26; 31) "\n " | 28 | WHITESPACE@[26; 31) "\n " |
29 | CONST_DEF@[31; 49) | 29 | CONST_DEF@[31; 49) |
30 | CONST_KW@[31; 36) "const" | 30 | CONST_KW@[31; 36) "const" |
@@ -43,7 +43,7 @@ SOURCE_FILE@[0; 89) | |||
43 | WHITESPACE@[45; 46) " " | 43 | WHITESPACE@[45; 46) " " |
44 | LITERAL@[46; 48) | 44 | LITERAL@[46; 48) |
45 | INT_NUMBER@[46; 48) "92" | 45 | INT_NUMBER@[46; 48) "92" |
46 | SEMI@[48; 49) ";" | 46 | SEMICOLON@[48; 49) ";" |
47 | WHITESPACE@[49; 54) "\n " | 47 | WHITESPACE@[49; 54) "\n " |
48 | FN_DEF@[54; 65) | 48 | FN_DEF@[54; 65) |
49 | FN_KW@[54; 56) "fn" | 49 | FN_KW@[54; 56) "fn" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast index 891943f6e..e0fc96d33 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0022_crate_visibility.rast | |||
@@ -10,7 +10,7 @@ SOURCE_FILE@[0; 81) | |||
10 | WHITESPACE@[17; 18) " " | 10 | WHITESPACE@[17; 18) " " |
11 | NAME@[18; 19) | 11 | NAME@[18; 19) |
12 | IDENT@[18; 19) "S" | 12 | IDENT@[18; 19) "S" |
13 | SEMI@[19; 20) ";" | 13 | SEMICOLON@[19; 20) ";" |
14 | WHITESPACE@[20; 21) "\n" | 14 | WHITESPACE@[20; 21) "\n" |
15 | STRUCT_DEF@[21; 40) | 15 | STRUCT_DEF@[21; 40) |
16 | VISIBILITY@[21; 30) | 16 | VISIBILITY@[21; 30) |
@@ -23,7 +23,7 @@ SOURCE_FILE@[0; 81) | |||
23 | WHITESPACE@[37; 38) " " | 23 | WHITESPACE@[37; 38) " " |
24 | NAME@[38; 39) | 24 | NAME@[38; 39) |
25 | IDENT@[38; 39) "S" | 25 | IDENT@[38; 39) "S" |
26 | SEMI@[39; 40) ";" | 26 | SEMICOLON@[39; 40) ";" |
27 | WHITESPACE@[40; 41) "\n" | 27 | WHITESPACE@[40; 41) "\n" |
28 | STRUCT_DEF@[41; 60) | 28 | STRUCT_DEF@[41; 60) |
29 | VISIBILITY@[41; 50) | 29 | VISIBILITY@[41; 50) |
@@ -36,7 +36,7 @@ SOURCE_FILE@[0; 81) | |||
36 | WHITESPACE@[57; 58) " " | 36 | WHITESPACE@[57; 58) " " |
37 | NAME@[58; 59) | 37 | NAME@[58; 59) |
38 | IDENT@[58; 59) "S" | 38 | IDENT@[58; 59) "S" |
39 | SEMI@[59; 60) ";" | 39 | SEMICOLON@[59; 60) ";" |
40 | WHITESPACE@[60; 61) "\n" | 40 | WHITESPACE@[60; 61) "\n" |
41 | STRUCT_DEF@[61; 80) | 41 | STRUCT_DEF@[61; 80) |
42 | VISIBILITY@[61; 70) | 42 | VISIBILITY@[61; 70) |
@@ -49,5 +49,5 @@ SOURCE_FILE@[0; 81) | |||
49 | WHITESPACE@[77; 78) " " | 49 | WHITESPACE@[77; 78) " " |
50 | NAME@[78; 79) | 50 | NAME@[78; 79) |
51 | IDENT@[78; 79) "S" | 51 | IDENT@[78; 79) "S" |
52 | SEMI@[79; 80) ";" | 52 | SEMICOLON@[79; 80) ";" |
53 | WHITESPACE@[80; 81) "\n" | 53 | WHITESPACE@[80; 81) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast index 0f32aec9e..b7acc3f07 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast | |||
@@ -9,5 +9,5 @@ SOURCE_FILE@[0; 22) | |||
9 | WHITESPACE@[18; 19) " " | 9 | WHITESPACE@[18; 19) " " |
10 | PLACEHOLDER_TYPE@[19; 20) | 10 | PLACEHOLDER_TYPE@[19; 20) |
11 | UNDERSCORE@[19; 20) "_" | 11 | UNDERSCORE@[19; 20) "_" |
12 | SEMI@[20; 21) ";" | 12 | SEMICOLON@[20; 21) ";" |
13 | WHITESPACE@[21; 22) "\n" | 13 | WHITESPACE@[21; 22) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast index 48aaeaf07..430e4a999 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0024_slice_pat.rast | |||
@@ -28,7 +28,7 @@ SOURCE_FILE@[0; 39) | |||
28 | COMMA@[25; 26) "," | 28 | COMMA@[25; 26) "," |
29 | WHITESPACE@[26; 27) " " | 29 | WHITESPACE@[26; 27) " " |
30 | DOT_DOT_PAT@[27; 29) | 30 | DOT_DOT_PAT@[27; 29) |
31 | DOTDOT@[27; 29) ".." | 31 | DOT2@[27; 29) ".." |
32 | R_BRACK@[29; 30) "]" | 32 | R_BRACK@[29; 30) "]" |
33 | WHITESPACE@[30; 31) " " | 33 | WHITESPACE@[30; 31) " " |
34 | EQ@[31; 32) "=" | 34 | EQ@[31; 32) "=" |
@@ -36,7 +36,7 @@ SOURCE_FILE@[0; 39) | |||
36 | ARRAY_EXPR@[33; 35) | 36 | ARRAY_EXPR@[33; 35) |
37 | L_BRACK@[33; 34) "[" | 37 | L_BRACK@[33; 34) "[" |
38 | R_BRACK@[34; 35) "]" | 38 | R_BRACK@[34; 35) "]" |
39 | SEMI@[35; 36) ";" | 39 | SEMICOLON@[35; 36) ";" |
40 | WHITESPACE@[36; 37) "\n" | 40 | WHITESPACE@[36; 37) "\n" |
41 | R_CURLY@[37; 38) "}" | 41 | R_CURLY@[37; 38) "}" |
42 | WHITESPACE@[38; 39) "\n" | 42 | WHITESPACE@[38; 39) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast index b3a24281e..4eee1e7f1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0025_slice_type.rast | |||
@@ -13,5 +13,5 @@ SOURCE_FILE@[0; 15) | |||
13 | L_PAREN@[10; 11) "(" | 13 | L_PAREN@[10; 11) "(" |
14 | R_PAREN@[11; 12) ")" | 14 | R_PAREN@[11; 12) ")" |
15 | R_BRACK@[12; 13) "]" | 15 | R_BRACK@[12; 13) "]" |
16 | SEMI@[13; 14) ";" | 16 | SEMICOLON@[13; 14) ";" |
17 | WHITESPACE@[14; 15) "\n" | 17 | WHITESPACE@[14; 15) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast index 666386d31..d8d82dacc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0026_tuple_pat_fields.rast | |||
@@ -28,7 +28,7 @@ SOURCE_FILE@[0; 97) | |||
28 | TUPLE_EXPR@[25; 27) | 28 | TUPLE_EXPR@[25; 27) |
29 | L_PAREN@[25; 26) "(" | 29 | L_PAREN@[25; 26) "(" |
30 | R_PAREN@[26; 27) ")" | 30 | R_PAREN@[26; 27) ")" |
31 | SEMI@[27; 28) ";" | 31 | SEMICOLON@[27; 28) ";" |
32 | WHITESPACE@[28; 33) "\n " | 32 | WHITESPACE@[28; 33) "\n " |
33 | LET_STMT@[33; 47) | 33 | LET_STMT@[33; 47) |
34 | LET_KW@[33; 36) "let" | 34 | LET_KW@[33; 36) "let" |
@@ -48,7 +48,7 @@ SOURCE_FILE@[0; 97) | |||
48 | TUPLE_EXPR@[44; 46) | 48 | TUPLE_EXPR@[44; 46) |
49 | L_PAREN@[44; 45) "(" | 49 | L_PAREN@[44; 45) "(" |
50 | R_PAREN@[45; 46) ")" | 50 | R_PAREN@[45; 46) ")" |
51 | SEMI@[46; 47) ";" | 51 | SEMICOLON@[46; 47) ";" |
52 | WHITESPACE@[47; 52) "\n " | 52 | WHITESPACE@[47; 52) "\n " |
53 | LET_STMT@[52; 67) | 53 | LET_STMT@[52; 67) |
54 | LET_KW@[52; 55) "let" | 54 | LET_KW@[52; 55) "let" |
@@ -69,7 +69,7 @@ SOURCE_FILE@[0; 97) | |||
69 | TUPLE_EXPR@[64; 66) | 69 | TUPLE_EXPR@[64; 66) |
70 | L_PAREN@[64; 65) "(" | 70 | L_PAREN@[64; 65) "(" |
71 | R_PAREN@[65; 66) ")" | 71 | R_PAREN@[65; 66) ")" |
72 | SEMI@[66; 67) ";" | 72 | SEMICOLON@[66; 67) ";" |
73 | WHITESPACE@[67; 72) "\n " | 73 | WHITESPACE@[67; 72) "\n " |
74 | LET_STMT@[72; 94) | 74 | LET_STMT@[72; 94) |
75 | LET_KW@[72; 75) "let" | 75 | LET_KW@[72; 75) "let" |
@@ -85,7 +85,7 @@ SOURCE_FILE@[0; 97) | |||
85 | COMMA@[79; 80) "," | 85 | COMMA@[79; 80) "," |
86 | WHITESPACE@[80; 81) " " | 86 | WHITESPACE@[80; 81) " " |
87 | DOT_DOT_PAT@[81; 83) | 87 | DOT_DOT_PAT@[81; 83) |
88 | DOTDOT@[81; 83) ".." | 88 | DOT2@[81; 83) ".." |
89 | WHITESPACE@[83; 84) " " | 89 | WHITESPACE@[83; 84) " " |
90 | COMMA@[84; 85) "," | 90 | COMMA@[84; 85) "," |
91 | WHITESPACE@[85; 86) " " | 91 | WHITESPACE@[85; 86) " " |
@@ -99,7 +99,7 @@ SOURCE_FILE@[0; 97) | |||
99 | TUPLE_EXPR@[91; 93) | 99 | TUPLE_EXPR@[91; 93) |
100 | L_PAREN@[91; 92) "(" | 100 | L_PAREN@[91; 92) "(" |
101 | R_PAREN@[92; 93) ")" | 101 | R_PAREN@[92; 93) ")" |
102 | SEMI@[93; 94) ";" | 102 | SEMICOLON@[93; 94) ";" |
103 | WHITESPACE@[94; 95) "\n" | 103 | WHITESPACE@[94; 95) "\n" |
104 | R_CURLY@[95; 96) "}" | 104 | R_CURLY@[95; 96) "}" |
105 | WHITESPACE@[96; 97) "\n" | 105 | WHITESPACE@[96; 97) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast index 0f1a367f7..ac6ab31f2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0027_ref_pat.rast | |||
@@ -26,7 +26,7 @@ SOURCE_FILE@[0; 52) | |||
26 | TUPLE_EXPR@[25; 27) | 26 | TUPLE_EXPR@[25; 27) |
27 | L_PAREN@[25; 26) "(" | 27 | L_PAREN@[25; 26) "(" |
28 | R_PAREN@[26; 27) ")" | 28 | R_PAREN@[26; 27) ")" |
29 | SEMI@[27; 28) ";" | 29 | SEMICOLON@[27; 28) ";" |
30 | WHITESPACE@[28; 33) "\n " | 30 | WHITESPACE@[28; 33) "\n " |
31 | LET_STMT@[33; 49) | 31 | LET_STMT@[33; 49) |
32 | LET_KW@[33; 36) "let" | 32 | LET_KW@[33; 36) "let" |
@@ -44,7 +44,7 @@ SOURCE_FILE@[0; 52) | |||
44 | TUPLE_EXPR@[46; 48) | 44 | TUPLE_EXPR@[46; 48) |
45 | L_PAREN@[46; 47) "(" | 45 | L_PAREN@[46; 47) "(" |
46 | R_PAREN@[47; 48) ")" | 46 | R_PAREN@[47; 48) ")" |
47 | SEMI@[48; 49) ";" | 47 | SEMICOLON@[48; 49) ";" |
48 | WHITESPACE@[49; 50) "\n" | 48 | WHITESPACE@[49; 50) "\n" |
49 | R_CURLY@[50; 51) "}" | 49 | R_CURLY@[50; 51) "}" |
50 | WHITESPACE@[51; 52) "\n" | 50 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast index f07027fa7..3371cab82 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0028_impl_trait_type.rast | |||
@@ -39,5 +39,5 @@ SOURCE_FILE@[0; 43) | |||
39 | WHITESPACE@[38; 39) " " | 39 | WHITESPACE@[38; 39) " " |
40 | TYPE_BOUND@[39; 41) | 40 | TYPE_BOUND@[39; 41) |
41 | LIFETIME@[39; 41) "\'a" | 41 | LIFETIME@[39; 41) "\'a" |
42 | SEMI@[41; 42) ";" | 42 | SEMICOLON@[41; 42) ";" |
43 | WHITESPACE@[42; 43) "\n" | 43 | WHITESPACE@[42; 43) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast index b17a2c257..e9ca214bb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0029_cast_expr.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 89) | |||
24 | PATH_SEGMENT@[21; 24) | 24 | PATH_SEGMENT@[21; 24) |
25 | NAME_REF@[21; 24) | 25 | NAME_REF@[21; 24) |
26 | IDENT@[21; 24) "i32" | 26 | IDENT@[21; 24) "i32" |
27 | SEMI@[24; 25) ";" | 27 | SEMICOLON@[24; 25) ";" |
28 | WHITESPACE@[25; 30) "\n " | 28 | WHITESPACE@[25; 30) "\n " |
29 | EXPR_STMT@[30; 43) | 29 | EXPR_STMT@[30; 43) |
30 | BIN_EXPR@[30; 42) | 30 | BIN_EXPR@[30; 42) |
@@ -44,7 +44,7 @@ SOURCE_FILE@[0; 89) | |||
44 | WHITESPACE@[40; 41) " " | 44 | WHITESPACE@[40; 41) " " |
45 | LITERAL@[41; 42) | 45 | LITERAL@[41; 42) |
46 | INT_NUMBER@[41; 42) "1" | 46 | INT_NUMBER@[41; 42) "1" |
47 | SEMI@[42; 43) ";" | 47 | SEMICOLON@[42; 43) ";" |
48 | WHITESPACE@[43; 48) "\n " | 48 | WHITESPACE@[43; 48) "\n " |
49 | EXPR_STMT@[48; 62) | 49 | EXPR_STMT@[48; 62) |
50 | BIN_EXPR@[48; 61) | 50 | BIN_EXPR@[48; 61) |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 89) | |||
64 | WHITESPACE@[59; 60) " " | 64 | WHITESPACE@[59; 60) " " |
65 | LITERAL@[60; 61) | 65 | LITERAL@[60; 61) |
66 | INT_NUMBER@[60; 61) "1" | 66 | INT_NUMBER@[60; 61) "1" |
67 | SEMI@[61; 62) ";" | 67 | SEMICOLON@[61; 62) ";" |
68 | WHITESPACE@[62; 67) "\n " | 68 | WHITESPACE@[62; 67) "\n " |
69 | EXPR_STMT@[67; 86) | 69 | EXPR_STMT@[67; 86) |
70 | BIN_EXPR@[67; 85) | 70 | BIN_EXPR@[67; 85) |
@@ -84,7 +84,7 @@ SOURCE_FILE@[0; 89) | |||
84 | WHITESPACE@[80; 81) " " | 84 | WHITESPACE@[80; 81) " " |
85 | LITERAL@[81; 85) | 85 | LITERAL@[81; 85) |
86 | INT_NUMBER@[81; 85) "0x37" | 86 | INT_NUMBER@[81; 85) "0x37" |
87 | SEMI@[85; 86) ";" | 87 | SEMICOLON@[85; 86) ";" |
88 | WHITESPACE@[86; 87) "\n" | 88 | WHITESPACE@[86; 87) "\n" |
89 | R_CURLY@[87; 88) "}" | 89 | R_CURLY@[87; 88) "}" |
90 | WHITESPACE@[88; 89) "\n" | 90 | WHITESPACE@[88; 89) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast index a6e14a114..aaef408cc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0031_while_expr.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 93) | |||
24 | BLOCK@[26; 28) | 24 | BLOCK@[26; 28) |
25 | L_CURLY@[26; 27) "{" | 25 | L_CURLY@[26; 27) "{" |
26 | R_CURLY@[27; 28) "}" | 26 | R_CURLY@[27; 28) "}" |
27 | SEMI@[28; 29) ";" | 27 | SEMICOLON@[28; 29) ";" |
28 | WHITESPACE@[29; 34) "\n " | 28 | WHITESPACE@[29; 34) "\n " |
29 | EXPR_STMT@[34; 67) | 29 | EXPR_STMT@[34; 67) |
30 | WHILE_EXPR@[34; 66) | 30 | WHILE_EXPR@[34; 66) |
@@ -63,7 +63,7 @@ SOURCE_FILE@[0; 93) | |||
63 | BLOCK@[64; 66) | 63 | BLOCK@[64; 66) |
64 | L_CURLY@[64; 65) "{" | 64 | L_CURLY@[64; 65) "{" |
65 | R_CURLY@[65; 66) "}" | 65 | R_CURLY@[65; 66) "}" |
66 | SEMI@[66; 67) ";" | 66 | SEMICOLON@[66; 67) ";" |
67 | WHITESPACE@[67; 72) "\n " | 67 | WHITESPACE@[67; 72) "\n " |
68 | EXPR_STMT@[72; 90) | 68 | EXPR_STMT@[72; 90) |
69 | WHILE_EXPR@[72; 89) | 69 | WHILE_EXPR@[72; 89) |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 93) | |||
83 | BLOCK@[87; 89) | 83 | BLOCK@[87; 89) |
84 | L_CURLY@[87; 88) "{" | 84 | L_CURLY@[87; 88) "{" |
85 | R_CURLY@[88; 89) "}" | 85 | R_CURLY@[88; 89) "}" |
86 | SEMI@[89; 90) ";" | 86 | SEMICOLON@[89; 90) ";" |
87 | WHITESPACE@[90; 91) "\n" | 87 | WHITESPACE@[90; 91) "\n" |
88 | R_CURLY@[91; 92) "}" | 88 | R_CURLY@[91; 92) "}" |
89 | WHITESPACE@[92; 93) "\n" | 89 | WHITESPACE@[92; 93) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast index 4c17f0db8..bad769850 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0032_fn_pointer_type.rast | |||
@@ -12,7 +12,7 @@ SOURCE_FILE@[0; 113) | |||
12 | PARAM_LIST@[11; 13) | 12 | PARAM_LIST@[11; 13) |
13 | L_PAREN@[11; 12) "(" | 13 | L_PAREN@[11; 12) "(" |
14 | R_PAREN@[12; 13) ")" | 14 | R_PAREN@[12; 13) ")" |
15 | SEMI@[13; 14) ";" | 15 | SEMICOLON@[13; 14) ";" |
16 | WHITESPACE@[14; 15) "\n" | 16 | WHITESPACE@[14; 15) "\n" |
17 | TYPE_ALIAS_DEF@[15; 36) | 17 | TYPE_ALIAS_DEF@[15; 36) |
18 | TYPE_KW@[15; 19) "type" | 18 | TYPE_KW@[15; 19) "type" |
@@ -29,7 +29,7 @@ SOURCE_FILE@[0; 113) | |||
29 | PARAM_LIST@[33; 35) | 29 | PARAM_LIST@[33; 35) |
30 | L_PAREN@[33; 34) "(" | 30 | L_PAREN@[33; 34) "(" |
31 | R_PAREN@[34; 35) ")" | 31 | R_PAREN@[34; 35) ")" |
32 | SEMI@[35; 36) ";" | 32 | SEMICOLON@[35; 36) ";" |
33 | WHITESPACE@[36; 37) "\n" | 33 | WHITESPACE@[36; 37) "\n" |
34 | TYPE_ALIAS_DEF@[37; 69) | 34 | TYPE_ALIAS_DEF@[37; 69) |
35 | TYPE_KW@[37; 41) "type" | 35 | TYPE_KW@[37; 41) "type" |
@@ -51,7 +51,7 @@ SOURCE_FILE@[0; 113) | |||
51 | PARAM_LIST@[66; 68) | 51 | PARAM_LIST@[66; 68) |
52 | L_PAREN@[66; 67) "(" | 52 | L_PAREN@[66; 67) "(" |
53 | R_PAREN@[67; 68) ")" | 53 | R_PAREN@[67; 68) ")" |
54 | SEMI@[68; 69) ";" | 54 | SEMICOLON@[68; 69) ";" |
55 | WHITESPACE@[69; 70) "\n" | 55 | WHITESPACE@[69; 70) "\n" |
56 | TYPE_ALIAS_DEF@[70; 112) | 56 | TYPE_ALIAS_DEF@[70; 112) |
57 | TYPE_KW@[70; 74) "type" | 57 | TYPE_KW@[70; 74) "type" |
@@ -82,7 +82,7 @@ SOURCE_FILE@[0; 113) | |||
82 | COMMA@[98; 99) "," | 82 | COMMA@[98; 99) "," |
83 | WHITESPACE@[99; 100) " " | 83 | WHITESPACE@[99; 100) " " |
84 | PARAM@[100; 103) | 84 | PARAM@[100; 103) |
85 | DOTDOTDOT@[100; 103) "..." | 85 | DOT3@[100; 103) "..." |
86 | WHITESPACE@[103; 104) " " | 86 | WHITESPACE@[103; 104) " " |
87 | R_PAREN@[104; 105) ")" | 87 | R_PAREN@[104; 105) ")" |
88 | WHITESPACE@[105; 106) " " | 88 | WHITESPACE@[105; 106) " " |
@@ -94,5 +94,5 @@ SOURCE_FILE@[0; 113) | |||
94 | PATH_SEGMENT@[109; 111) | 94 | PATH_SEGMENT@[109; 111) |
95 | NAME_REF@[109; 111) | 95 | NAME_REF@[109; 111) |
96 | IDENT@[109; 111) "u8" | 96 | IDENT@[109; 111) "u8" |
97 | SEMI@[111; 112) ";" | 97 | SEMICOLON@[111; 112) ";" |
98 | WHITESPACE@[112; 113) "\n" | 98 | WHITESPACE@[112; 113) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast index 7642ea659..e6ee20b9a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0033_reference_type;.rast | |||
@@ -12,7 +12,7 @@ SOURCE_FILE@[0; 54) | |||
12 | TUPLE_TYPE@[10; 12) | 12 | TUPLE_TYPE@[10; 12) |
13 | L_PAREN@[10; 11) "(" | 13 | L_PAREN@[10; 11) "(" |
14 | R_PAREN@[11; 12) ")" | 14 | R_PAREN@[11; 12) ")" |
15 | SEMI@[12; 13) ";" | 15 | SEMICOLON@[12; 13) ";" |
16 | WHITESPACE@[13; 14) "\n" | 16 | WHITESPACE@[13; 14) "\n" |
17 | TYPE_ALIAS_DEF@[14; 35) | 17 | TYPE_ALIAS_DEF@[14; 35) |
18 | TYPE_KW@[14; 18) "type" | 18 | TYPE_KW@[14; 18) "type" |
@@ -29,7 +29,7 @@ SOURCE_FILE@[0; 54) | |||
29 | TUPLE_TYPE@[32; 34) | 29 | TUPLE_TYPE@[32; 34) |
30 | L_PAREN@[32; 33) "(" | 30 | L_PAREN@[32; 33) "(" |
31 | R_PAREN@[33; 34) ")" | 31 | R_PAREN@[33; 34) ")" |
32 | SEMI@[34; 35) ";" | 32 | SEMICOLON@[34; 35) ";" |
33 | WHITESPACE@[35; 36) "\n" | 33 | WHITESPACE@[35; 36) "\n" |
34 | TYPE_ALIAS_DEF@[36; 53) | 34 | TYPE_ALIAS_DEF@[36; 53) |
35 | TYPE_KW@[36; 40) "type" | 35 | TYPE_KW@[36; 40) "type" |
@@ -46,5 +46,5 @@ SOURCE_FILE@[0; 54) | |||
46 | TUPLE_TYPE@[50; 52) | 46 | TUPLE_TYPE@[50; 52) |
47 | L_PAREN@[50; 51) "(" | 47 | L_PAREN@[50; 51) "(" |
48 | R_PAREN@[51; 52) ")" | 48 | R_PAREN@[51; 52) ")" |
49 | SEMI@[52; 53) ";" | 49 | SEMICOLON@[52; 53) ";" |
50 | WHITESPACE@[53; 54) "\n" | 50 | WHITESPACE@[53; 54) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast index 67ffdfd67..4bb95314f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0034_break_expr.rast | |||
@@ -22,14 +22,14 @@ SOURCE_FILE@[0; 102) | |||
22 | EXPR_STMT@[30; 36) | 22 | EXPR_STMT@[30; 36) |
23 | BREAK_EXPR@[30; 35) | 23 | BREAK_EXPR@[30; 35) |
24 | BREAK_KW@[30; 35) "break" | 24 | BREAK_KW@[30; 35) "break" |
25 | SEMI@[35; 36) ";" | 25 | SEMICOLON@[35; 36) ";" |
26 | WHITESPACE@[36; 45) "\n " | 26 | WHITESPACE@[36; 45) "\n " |
27 | EXPR_STMT@[45; 54) | 27 | EXPR_STMT@[45; 54) |
28 | BREAK_EXPR@[45; 53) | 28 | BREAK_EXPR@[45; 53) |
29 | BREAK_KW@[45; 50) "break" | 29 | BREAK_KW@[45; 50) "break" |
30 | WHITESPACE@[50; 51) " " | 30 | WHITESPACE@[50; 51) " " |
31 | LIFETIME@[51; 53) "\'l" | 31 | LIFETIME@[51; 53) "\'l" |
32 | SEMI@[53; 54) ";" | 32 | SEMICOLON@[53; 54) ";" |
33 | WHITESPACE@[54; 63) "\n " | 33 | WHITESPACE@[54; 63) "\n " |
34 | EXPR_STMT@[63; 72) | 34 | EXPR_STMT@[63; 72) |
35 | BREAK_EXPR@[63; 71) | 35 | BREAK_EXPR@[63; 71) |
@@ -37,7 +37,7 @@ SOURCE_FILE@[0; 102) | |||
37 | WHITESPACE@[68; 69) " " | 37 | WHITESPACE@[68; 69) " " |
38 | LITERAL@[69; 71) | 38 | LITERAL@[69; 71) |
39 | INT_NUMBER@[69; 71) "92" | 39 | INT_NUMBER@[69; 71) "92" |
40 | SEMI@[71; 72) ";" | 40 | SEMICOLON@[71; 72) ";" |
41 | WHITESPACE@[72; 81) "\n " | 41 | WHITESPACE@[72; 81) "\n " |
42 | EXPR_STMT@[81; 93) | 42 | EXPR_STMT@[81; 93) |
43 | BREAK_EXPR@[81; 92) | 43 | BREAK_EXPR@[81; 92) |
@@ -47,7 +47,7 @@ SOURCE_FILE@[0; 102) | |||
47 | WHITESPACE@[89; 90) " " | 47 | WHITESPACE@[89; 90) " " |
48 | LITERAL@[90; 92) | 48 | LITERAL@[90; 92) |
49 | INT_NUMBER@[90; 92) "92" | 49 | INT_NUMBER@[90; 92) "92" |
50 | SEMI@[92; 93) ";" | 50 | SEMICOLON@[92; 93) ";" |
51 | WHITESPACE@[93; 98) "\n " | 51 | WHITESPACE@[93; 98) "\n " |
52 | R_CURLY@[98; 99) "}" | 52 | R_CURLY@[98; 99) "}" |
53 | WHITESPACE@[99; 100) "\n" | 53 | WHITESPACE@[99; 100) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast index 6e226de4b..1cd7a443f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0037_qual_paths.rast | |||
@@ -26,11 +26,11 @@ SOURCE_FILE@[0; 71) | |||
26 | NAME_REF@[15; 16) | 26 | NAME_REF@[15; 16) |
27 | IDENT@[15; 16) "B" | 27 | IDENT@[15; 16) "B" |
28 | R_ANGLE@[16; 17) ">" | 28 | R_ANGLE@[16; 17) ">" |
29 | COLONCOLON@[17; 19) "::" | 29 | COLON2@[17; 19) "::" |
30 | PATH_SEGMENT@[19; 25) | 30 | PATH_SEGMENT@[19; 25) |
31 | NAME_REF@[19; 25) | 31 | NAME_REF@[19; 25) |
32 | IDENT@[19; 25) "Output" | 32 | IDENT@[19; 25) "Output" |
33 | SEMI@[25; 26) ";" | 33 | SEMICOLON@[25; 26) ";" |
34 | WHITESPACE@[26; 27) "\n" | 34 | WHITESPACE@[26; 27) "\n" |
35 | FN_DEF@[27; 70) | 35 | FN_DEF@[27; 70) |
36 | FN_KW@[27; 29) "fn" | 36 | FN_KW@[27; 29) "fn" |
@@ -66,14 +66,14 @@ SOURCE_FILE@[0; 71) | |||
66 | NAME_REF@[48; 55) | 66 | NAME_REF@[48; 55) |
67 | IDENT@[48; 55) "Default" | 67 | IDENT@[48; 55) "Default" |
68 | R_ANGLE@[55; 56) ">" | 68 | R_ANGLE@[55; 56) ">" |
69 | COLONCOLON@[56; 58) "::" | 69 | COLON2@[56; 58) "::" |
70 | PATH_SEGMENT@[58; 65) | 70 | PATH_SEGMENT@[58; 65) |
71 | NAME_REF@[58; 65) | 71 | NAME_REF@[58; 65) |
72 | IDENT@[58; 65) "default" | 72 | IDENT@[58; 65) "default" |
73 | ARG_LIST@[65; 67) | 73 | ARG_LIST@[65; 67) |
74 | L_PAREN@[65; 66) "(" | 74 | L_PAREN@[65; 66) "(" |
75 | R_PAREN@[66; 67) ")" | 75 | R_PAREN@[66; 67) ")" |
76 | SEMI@[67; 68) ";" | 76 | SEMICOLON@[67; 68) ";" |
77 | WHITESPACE@[68; 69) " " | 77 | WHITESPACE@[68; 69) " " |
78 | R_CURLY@[69; 70) "}" | 78 | R_CURLY@[69; 70) "}" |
79 | WHITESPACE@[70; 71) "\n" | 79 | WHITESPACE@[70; 71) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast index 042cee879..f5db5a9e6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0038_full_range_expr.rast | |||
@@ -21,9 +21,9 @@ SOURCE_FILE@[0; 21) | |||
21 | IDENT@[11; 13) "xs" | 21 | IDENT@[11; 13) "xs" |
22 | L_BRACK@[13; 14) "[" | 22 | L_BRACK@[13; 14) "[" |
23 | RANGE_EXPR@[14; 16) | 23 | RANGE_EXPR@[14; 16) |
24 | DOTDOT@[14; 16) ".." | 24 | DOT2@[14; 16) ".." |
25 | R_BRACK@[16; 17) "]" | 25 | R_BRACK@[16; 17) "]" |
26 | SEMI@[17; 18) ";" | 26 | SEMICOLON@[17; 18) ";" |
27 | WHITESPACE@[18; 19) " " | 27 | WHITESPACE@[18; 19) " " |
28 | R_CURLY@[19; 20) "}" | 28 | R_CURLY@[19; 20) "}" |
29 | WHITESPACE@[20; 21) "\n" | 29 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast index 025faf5ca..2d9db61b3 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0039_type_arg.rast | |||
@@ -51,5 +51,5 @@ SOURCE_FILE@[0; 46) | |||
51 | NAME_REF@[40; 43) | 51 | NAME_REF@[40; 43) |
52 | IDENT@[40; 43) "u64" | 52 | IDENT@[40; 43) "u64" |
53 | R_ANGLE@[43; 44) ">" | 53 | R_ANGLE@[43; 44) ">" |
54 | SEMI@[44; 45) ";" | 54 | SEMICOLON@[44; 45) ";" |
55 | WHITESPACE@[45; 46) "\n" | 55 | WHITESPACE@[45; 46) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast index d180fcf20..4c175e210 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0040_crate_keyword_vis.rast | |||
@@ -59,5 +59,5 @@ SOURCE_FILE@[0; 71) | |||
59 | NAME_REF@[65; 68) | 59 | NAME_REF@[65; 68) |
60 | IDENT@[65; 68) "u32" | 60 | IDENT@[65; 68) "u32" |
61 | R_PAREN@[68; 69) ")" | 61 | R_PAREN@[68; 69) ")" |
62 | SEMI@[69; 70) ";" | 62 | SEMICOLON@[69; 70) ";" |
63 | WHITESPACE@[70; 71) "\n" | 63 | WHITESPACE@[70; 71) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast index e8003bf91..f9e677a03 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0042_call_expr.rast | |||
@@ -29,7 +29,7 @@ SOURCE_FILE@[0; 118) | |||
29 | ARG_LIST@[24; 26) | 29 | ARG_LIST@[24; 26) |
30 | L_PAREN@[24; 25) "(" | 30 | L_PAREN@[24; 25) "(" |
31 | R_PAREN@[25; 26) ")" | 31 | R_PAREN@[25; 26) ")" |
32 | SEMI@[26; 27) ";" | 32 | SEMICOLON@[26; 27) ";" |
33 | WHITESPACE@[27; 32) "\n " | 33 | WHITESPACE@[27; 32) "\n " |
34 | LET_STMT@[32; 54) | 34 | LET_STMT@[32; 54) |
35 | LET_KW@[32; 35) "let" | 35 | LET_KW@[32; 35) "let" |
@@ -65,7 +65,7 @@ SOURCE_FILE@[0; 118) | |||
65 | INT_NUMBER@[50; 51) "2" | 65 | INT_NUMBER@[50; 51) "2" |
66 | COMMA@[51; 52) "," | 66 | COMMA@[51; 52) "," |
67 | R_PAREN@[52; 53) ")" | 67 | R_PAREN@[52; 53) ")" |
68 | SEMI@[53; 54) ";" | 68 | SEMICOLON@[53; 54) ";" |
69 | WHITESPACE@[54; 59) "\n " | 69 | WHITESPACE@[54; 59) "\n " |
70 | LET_STMT@[59; 84) | 70 | LET_STMT@[59; 84) |
71 | LET_KW@[59; 62) "let" | 71 | LET_KW@[59; 62) "let" |
@@ -95,7 +95,7 @@ SOURCE_FILE@[0; 118) | |||
95 | NAME_REF@[70; 73) | 95 | NAME_REF@[70; 73) |
96 | IDENT@[70; 73) "Foo" | 96 | IDENT@[70; 73) "Foo" |
97 | R_ANGLE@[73; 74) ">" | 97 | R_ANGLE@[73; 74) ">" |
98 | COLONCOLON@[74; 76) "::" | 98 | COLON2@[74; 76) "::" |
99 | PATH_SEGMENT@[76; 80) | 99 | PATH_SEGMENT@[76; 80) |
100 | NAME_REF@[76; 80) | 100 | NAME_REF@[76; 80) |
101 | IDENT@[76; 80) "func" | 101 | IDENT@[76; 80) "func" |
@@ -103,7 +103,7 @@ SOURCE_FILE@[0; 118) | |||
103 | L_PAREN@[80; 81) "(" | 103 | L_PAREN@[80; 81) "(" |
104 | R_PAREN@[81; 82) ")" | 104 | R_PAREN@[81; 82) ")" |
105 | R_PAREN@[82; 83) ")" | 105 | R_PAREN@[82; 83) ")" |
106 | SEMI@[83; 84) ";" | 106 | SEMICOLON@[83; 84) ";" |
107 | WHITESPACE@[84; 89) "\n " | 107 | WHITESPACE@[84; 89) "\n " |
108 | EXPR_STMT@[89; 115) | 108 | EXPR_STMT@[89; 115) |
109 | CALL_EXPR@[89; 114) | 109 | CALL_EXPR@[89; 114) |
@@ -134,7 +134,7 @@ SOURCE_FILE@[0; 118) | |||
134 | NAME_REF@[99; 104) | 134 | NAME_REF@[99; 104) |
135 | IDENT@[99; 104) "Trait" | 135 | IDENT@[99; 104) "Trait" |
136 | R_ANGLE@[104; 105) ">" | 136 | R_ANGLE@[104; 105) ">" |
137 | COLONCOLON@[105; 107) "::" | 137 | COLON2@[105; 107) "::" |
138 | PATH_SEGMENT@[107; 111) | 138 | PATH_SEGMENT@[107; 111) |
139 | NAME_REF@[107; 111) | 139 | NAME_REF@[107; 111) |
140 | IDENT@[107; 111) "func" | 140 | IDENT@[107; 111) "func" |
@@ -142,7 +142,7 @@ SOURCE_FILE@[0; 118) | |||
142 | L_PAREN@[111; 112) "(" | 142 | L_PAREN@[111; 112) "(" |
143 | R_PAREN@[112; 113) ")" | 143 | R_PAREN@[112; 113) ")" |
144 | R_PAREN@[113; 114) ")" | 144 | R_PAREN@[113; 114) ")" |
145 | SEMI@[114; 115) ";" | 145 | SEMICOLON@[114; 115) ";" |
146 | WHITESPACE@[115; 116) "\n" | 146 | WHITESPACE@[115; 116) "\n" |
147 | R_CURLY@[116; 117) "}" | 147 | R_CURLY@[116; 117) "}" |
148 | WHITESPACE@[117; 118) "\n" | 148 | WHITESPACE@[117; 118) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast index 18d8a151f..580f29cfb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0043_use_alias.rast | |||
@@ -8,7 +8,7 @@ SOURCE_FILE@[0; 198) | |||
8 | PATH_SEGMENT@[4; 8) | 8 | PATH_SEGMENT@[4; 8) |
9 | NAME_REF@[4; 8) | 9 | NAME_REF@[4; 8) |
10 | IDENT@[4; 8) "some" | 10 | IDENT@[4; 8) "some" |
11 | COLONCOLON@[8; 10) "::" | 11 | COLON2@[8; 10) "::" |
12 | PATH_SEGMENT@[10; 14) | 12 | PATH_SEGMENT@[10; 14) |
13 | NAME_REF@[10; 14) | 13 | NAME_REF@[10; 14) |
14 | IDENT@[10; 14) "path" | 14 | IDENT@[10; 14) "path" |
@@ -18,7 +18,7 @@ SOURCE_FILE@[0; 198) | |||
18 | WHITESPACE@[17; 18) " " | 18 | WHITESPACE@[17; 18) " " |
19 | NAME@[18; 27) | 19 | NAME@[18; 27) |
20 | IDENT@[18; 27) "some_name" | 20 | IDENT@[18; 27) "some_name" |
21 | SEMI@[27; 28) ";" | 21 | SEMICOLON@[27; 28) ";" |
22 | WHITESPACE@[28; 29) "\n" | 22 | WHITESPACE@[28; 29) "\n" |
23 | USE_ITEM@[29; 181) | 23 | USE_ITEM@[29; 181) |
24 | USE_KW@[29; 32) "use" | 24 | USE_KW@[29; 32) "use" |
@@ -28,7 +28,7 @@ SOURCE_FILE@[0; 198) | |||
28 | PATH_SEGMENT@[33; 37) | 28 | PATH_SEGMENT@[33; 37) |
29 | NAME_REF@[33; 37) | 29 | NAME_REF@[33; 37) |
30 | IDENT@[33; 37) "some" | 30 | IDENT@[33; 37) "some" |
31 | COLONCOLON@[37; 39) "::" | 31 | COLON2@[37; 39) "::" |
32 | USE_TREE_LIST@[39; 180) | 32 | USE_TREE_LIST@[39; 180) |
33 | L_CURLY@[39; 40) "{" | 33 | L_CURLY@[39; 40) "{" |
34 | WHITESPACE@[40; 42) "\n " | 34 | WHITESPACE@[40; 42) "\n " |
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 198) | |||
38 | PATH_SEGMENT@[42; 47) | 38 | PATH_SEGMENT@[42; 47) |
39 | NAME_REF@[42; 47) | 39 | NAME_REF@[42; 47) |
40 | IDENT@[42; 47) "other" | 40 | IDENT@[42; 47) "other" |
41 | COLONCOLON@[47; 49) "::" | 41 | COLON2@[47; 49) "::" |
42 | PATH_SEGMENT@[49; 53) | 42 | PATH_SEGMENT@[49; 53) |
43 | NAME_REF@[49; 53) | 43 | NAME_REF@[49; 53) |
44 | IDENT@[49; 53) "path" | 44 | IDENT@[49; 53) "path" |
@@ -56,7 +56,7 @@ SOURCE_FILE@[0; 198) | |||
56 | PATH_SEGMENT@[75; 84) | 56 | PATH_SEGMENT@[75; 84) |
57 | NAME_REF@[75; 84) | 57 | NAME_REF@[75; 84) |
58 | IDENT@[75; 84) "different" | 58 | IDENT@[75; 84) "different" |
59 | COLONCOLON@[84; 86) "::" | 59 | COLON2@[84; 86) "::" |
60 | PATH_SEGMENT@[86; 90) | 60 | PATH_SEGMENT@[86; 90) |
61 | NAME_REF@[86; 90) | 61 | NAME_REF@[86; 90) |
62 | IDENT@[86; 90) "path" | 62 | IDENT@[86; 90) "path" |
@@ -75,11 +75,11 @@ SOURCE_FILE@[0; 198) | |||
75 | PATH_SEGMENT@[111; 114) | 75 | PATH_SEGMENT@[111; 114) |
76 | NAME_REF@[111; 114) | 76 | NAME_REF@[111; 114) |
77 | IDENT@[111; 114) "yet" | 77 | IDENT@[111; 114) "yet" |
78 | COLONCOLON@[114; 116) "::" | 78 | COLON2@[114; 116) "::" |
79 | PATH_SEGMENT@[116; 123) | 79 | PATH_SEGMENT@[116; 123) |
80 | NAME_REF@[116; 123) | 80 | NAME_REF@[116; 123) |
81 | IDENT@[116; 123) "another" | 81 | IDENT@[116; 123) "another" |
82 | COLONCOLON@[123; 125) "::" | 82 | COLON2@[123; 125) "::" |
83 | PATH_SEGMENT@[125; 129) | 83 | PATH_SEGMENT@[125; 129) |
84 | NAME_REF@[125; 129) | 84 | NAME_REF@[125; 129) |
85 | IDENT@[125; 129) "path" | 85 | IDENT@[125; 129) "path" |
@@ -95,31 +95,31 @@ SOURCE_FILE@[0; 198) | |||
95 | PATH_SEGMENT@[132; 139) | 95 | PATH_SEGMENT@[132; 139) |
96 | NAME_REF@[132; 139) | 96 | NAME_REF@[132; 139) |
97 | IDENT@[132; 139) "running" | 97 | IDENT@[132; 139) "running" |
98 | COLONCOLON@[139; 141) "::" | 98 | COLON2@[139; 141) "::" |
99 | PATH_SEGMENT@[141; 144) | 99 | PATH_SEGMENT@[141; 144) |
100 | NAME_REF@[141; 144) | 100 | NAME_REF@[141; 144) |
101 | IDENT@[141; 144) "out" | 101 | IDENT@[141; 144) "out" |
102 | COLONCOLON@[144; 146) "::" | 102 | COLON2@[144; 146) "::" |
103 | PATH_SEGMENT@[146; 148) | 103 | PATH_SEGMENT@[146; 148) |
104 | NAME_REF@[146; 148) | 104 | NAME_REF@[146; 148) |
105 | IDENT@[146; 148) "of" | 105 | IDENT@[146; 148) "of" |
106 | COLONCOLON@[148; 150) "::" | 106 | COLON2@[148; 150) "::" |
107 | PATH_SEGMENT@[150; 158) | 107 | PATH_SEGMENT@[150; 158) |
108 | NAME_REF@[150; 158) | 108 | NAME_REF@[150; 158) |
109 | IDENT@[150; 158) "synonyms" | 109 | IDENT@[150; 158) "synonyms" |
110 | COLONCOLON@[158; 160) "::" | 110 | COLON2@[158; 160) "::" |
111 | PATH_SEGMENT@[160; 164) | 111 | PATH_SEGMENT@[160; 164) |
112 | NAME_REF@[160; 164) | 112 | NAME_REF@[160; 164) |
113 | IDENT@[160; 164) "for_" | 113 | IDENT@[160; 164) "for_" |
114 | COLONCOLON@[164; 166) "::" | 114 | COLON2@[164; 166) "::" |
115 | PATH_SEGMENT@[166; 175) | 115 | PATH_SEGMENT@[166; 175) |
116 | NAME_REF@[166; 175) | 116 | NAME_REF@[166; 175) |
117 | IDENT@[166; 175) "different" | 117 | IDENT@[166; 175) "different" |
118 | COLONCOLON@[175; 177) "::" | 118 | COLON2@[175; 177) "::" |
119 | STAR@[177; 178) "*" | 119 | STAR@[177; 178) "*" |
120 | WHITESPACE@[178; 179) "\n" | 120 | WHITESPACE@[178; 179) "\n" |
121 | R_CURLY@[179; 180) "}" | 121 | R_CURLY@[179; 180) "}" |
122 | SEMI@[180; 181) ";" | 122 | SEMICOLON@[180; 181) ";" |
123 | WHITESPACE@[181; 182) "\n" | 123 | WHITESPACE@[181; 182) "\n" |
124 | USE_ITEM@[182; 197) | 124 | USE_ITEM@[182; 197) |
125 | USE_KW@[182; 185) "use" | 125 | USE_KW@[182; 185) "use" |
@@ -134,5 +134,5 @@ SOURCE_FILE@[0; 198) | |||
134 | AS_KW@[192; 194) "as" | 134 | AS_KW@[192; 194) "as" |
135 | WHITESPACE@[194; 195) " " | 135 | WHITESPACE@[194; 195) " " |
136 | UNDERSCORE@[195; 196) "_" | 136 | UNDERSCORE@[195; 196) "_" |
137 | SEMI@[196; 197) ";" | 137 | SEMICOLON@[196; 197) ";" |
138 | WHITESPACE@[197; 198) "\n" | 138 | WHITESPACE@[197; 198) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast index c7b4e614d..988b58d82 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0046_singleton_tuple_type.rast | |||
@@ -16,5 +16,5 @@ SOURCE_FILE@[0; 17) | |||
16 | IDENT@[10; 13) "i32" | 16 | IDENT@[10; 13) "i32" |
17 | COMMA@[13; 14) "," | 17 | COMMA@[13; 14) "," |
18 | R_PAREN@[14; 15) ")" | 18 | R_PAREN@[14; 15) ")" |
19 | SEMI@[15; 16) ";" | 19 | SEMICOLON@[15; 16) ";" |
20 | WHITESPACE@[16; 17) "\n" | 20 | WHITESPACE@[16; 17) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast index 19f961e29..036035f6c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0050_fn_decl.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@[0; 22) | |||
16 | PARAM_LIST@[16; 18) | 16 | PARAM_LIST@[16; 18) |
17 | L_PAREN@[16; 17) "(" | 17 | L_PAREN@[16; 17) "(" |
18 | R_PAREN@[17; 18) ")" | 18 | R_PAREN@[17; 18) ")" |
19 | SEMI@[18; 19) ";" | 19 | SEMICOLON@[18; 19) ";" |
20 | WHITESPACE@[19; 20) " " | 20 | WHITESPACE@[19; 20) " " |
21 | R_CURLY@[20; 21) "}" | 21 | R_CURLY@[20; 21) "}" |
22 | WHITESPACE@[21; 22) "\n" | 22 | WHITESPACE@[21; 22) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast index 6a469f8aa..d9fc5eb8a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0051_unit_type.rast | |||
@@ -10,5 +10,5 @@ SOURCE_FILE@[0; 13) | |||
10 | TUPLE_TYPE@[9; 11) | 10 | TUPLE_TYPE@[9; 11) |
11 | L_PAREN@[9; 10) "(" | 11 | L_PAREN@[9; 10) "(" |
12 | R_PAREN@[10; 11) ")" | 12 | R_PAREN@[10; 11) ")" |
13 | SEMI@[11; 12) ";" | 13 | SEMICOLON@[11; 12) ";" |
14 | WHITESPACE@[12; 13) "\n" | 14 | WHITESPACE@[12; 13) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast index ee55ee219..8647c23bf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0052_path_type.rast | |||
@@ -12,7 +12,7 @@ SOURCE_FILE@[0; 71) | |||
12 | PATH_SEGMENT@[9; 12) | 12 | PATH_SEGMENT@[9; 12) |
13 | NAME_REF@[9; 12) | 13 | NAME_REF@[9; 12) |
14 | IDENT@[9; 12) "Foo" | 14 | IDENT@[9; 12) "Foo" |
15 | SEMI@[12; 13) ";" | 15 | SEMICOLON@[12; 13) ";" |
16 | WHITESPACE@[13; 14) "\n" | 16 | WHITESPACE@[13; 14) "\n" |
17 | TYPE_ALIAS_DEF@[14; 29) | 17 | TYPE_ALIAS_DEF@[14; 29) |
18 | TYPE_KW@[14; 18) "type" | 18 | TYPE_KW@[14; 18) "type" |
@@ -25,10 +25,10 @@ SOURCE_FILE@[0; 71) | |||
25 | PATH_TYPE@[23; 28) | 25 | PATH_TYPE@[23; 28) |
26 | PATH@[23; 28) | 26 | PATH@[23; 28) |
27 | PATH_SEGMENT@[23; 28) | 27 | PATH_SEGMENT@[23; 28) |
28 | COLONCOLON@[23; 25) "::" | 28 | COLON2@[23; 25) "::" |
29 | NAME_REF@[25; 28) | 29 | NAME_REF@[25; 28) |
30 | IDENT@[25; 28) "Foo" | 30 | IDENT@[25; 28) "Foo" |
31 | SEMI@[28; 29) ";" | 31 | SEMICOLON@[28; 29) ";" |
32 | WHITESPACE@[29; 30) "\n" | 32 | WHITESPACE@[29; 30) "\n" |
33 | TYPE_ALIAS_DEF@[30; 49) | 33 | TYPE_ALIAS_DEF@[30; 49) |
34 | TYPE_KW@[30; 34) "type" | 34 | TYPE_KW@[30; 34) "type" |
@@ -43,11 +43,11 @@ SOURCE_FILE@[0; 71) | |||
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 | SELF_KW@[39; 43) "self" |
46 | COLONCOLON@[43; 45) "::" | 46 | COLON2@[43; 45) "::" |
47 | PATH_SEGMENT@[45; 48) | 47 | PATH_SEGMENT@[45; 48) |
48 | NAME_REF@[45; 48) | 48 | NAME_REF@[45; 48) |
49 | IDENT@[45; 48) "Foo" | 49 | IDENT@[45; 48) "Foo" |
50 | SEMI@[48; 49) ";" | 50 | SEMICOLON@[48; 49) ";" |
51 | WHITESPACE@[49; 50) "\n" | 51 | WHITESPACE@[49; 50) "\n" |
52 | TYPE_ALIAS_DEF@[50; 70) | 52 | TYPE_ALIAS_DEF@[50; 70) |
53 | TYPE_KW@[50; 54) "type" | 53 | TYPE_KW@[50; 54) "type" |
@@ -62,9 +62,9 @@ SOURCE_FILE@[0; 71) | |||
62 | PATH@[59; 64) | 62 | PATH@[59; 64) |
63 | PATH_SEGMENT@[59; 64) | 63 | PATH_SEGMENT@[59; 64) |
64 | SUPER_KW@[59; 64) "super" | 64 | SUPER_KW@[59; 64) "super" |
65 | COLONCOLON@[64; 66) "::" | 65 | COLON2@[64; 66) "::" |
66 | PATH_SEGMENT@[66; 69) | 66 | PATH_SEGMENT@[66; 69) |
67 | NAME_REF@[66; 69) | 67 | NAME_REF@[66; 69) |
68 | IDENT@[66; 69) "Foo" | 68 | IDENT@[66; 69) "Foo" |
69 | SEMI@[69; 70) ";" | 69 | SEMICOLON@[69; 70) ";" |
70 | WHITESPACE@[70; 71) "\n" | 70 | WHITESPACE@[70; 71) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast index f1018fcab..690d8504e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0053_path_expr.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 91) | |||
25 | PATH_SEGMENT@[23; 24) | 25 | PATH_SEGMENT@[23; 24) |
26 | NAME_REF@[23; 24) | 26 | NAME_REF@[23; 24) |
27 | IDENT@[23; 24) "a" | 27 | IDENT@[23; 24) "a" |
28 | SEMI@[24; 25) ";" | 28 | SEMICOLON@[24; 25) ";" |
29 | WHITESPACE@[25; 30) "\n " | 29 | WHITESPACE@[25; 30) "\n " |
30 | LET_STMT@[30; 43) | 30 | LET_STMT@[30; 43) |
31 | LET_KW@[30; 33) "let" | 31 | LET_KW@[30; 33) "let" |
@@ -41,11 +41,11 @@ SOURCE_FILE@[0; 91) | |||
41 | PATH_SEGMENT@[38; 39) | 41 | PATH_SEGMENT@[38; 39) |
42 | NAME_REF@[38; 39) | 42 | NAME_REF@[38; 39) |
43 | IDENT@[38; 39) "a" | 43 | IDENT@[38; 39) "a" |
44 | COLONCOLON@[39; 41) "::" | 44 | COLON2@[39; 41) "::" |
45 | PATH_SEGMENT@[41; 42) | 45 | PATH_SEGMENT@[41; 42) |
46 | NAME_REF@[41; 42) | 46 | NAME_REF@[41; 42) |
47 | IDENT@[41; 42) "b" | 47 | IDENT@[41; 42) "b" |
48 | SEMI@[42; 43) ";" | 48 | SEMICOLON@[42; 43) ";" |
49 | WHITESPACE@[43; 48) "\n " | 49 | WHITESPACE@[43; 48) "\n " |
50 | LET_STMT@[48; 65) | 50 | LET_STMT@[48; 65) |
51 | LET_KW@[48; 51) "let" | 51 | LET_KW@[48; 51) "let" |
@@ -58,11 +58,11 @@ SOURCE_FILE@[0; 91) | |||
58 | PATH_EXPR@[56; 64) | 58 | PATH_EXPR@[56; 64) |
59 | PATH@[56; 64) | 59 | PATH@[56; 64) |
60 | PATH_SEGMENT@[56; 64) | 60 | PATH_SEGMENT@[56; 64) |
61 | COLONCOLON@[56; 58) "::" | 61 | COLON2@[56; 58) "::" |
62 | NAME_REF@[58; 59) | 62 | NAME_REF@[58; 59) |
63 | IDENT@[58; 59) "a" | 63 | IDENT@[58; 59) "a" |
64 | TYPE_ARG_LIST@[59; 64) | 64 | TYPE_ARG_LIST@[59; 64) |
65 | COLONCOLON@[59; 61) "::" | 65 | COLON2@[59; 61) "::" |
66 | L_ANGLE@[61; 62) "<" | 66 | L_ANGLE@[61; 62) "<" |
67 | TYPE_ARG@[62; 63) | 67 | TYPE_ARG@[62; 63) |
68 | PATH_TYPE@[62; 63) | 68 | PATH_TYPE@[62; 63) |
@@ -71,7 +71,7 @@ SOURCE_FILE@[0; 91) | |||
71 | NAME_REF@[62; 63) | 71 | NAME_REF@[62; 63) |
72 | IDENT@[62; 63) "b" | 72 | IDENT@[62; 63) "b" |
73 | R_ANGLE@[63; 64) ">" | 73 | R_ANGLE@[63; 64) ">" |
74 | SEMI@[64; 65) ";" | 74 | SEMICOLON@[64; 65) ";" |
75 | WHITESPACE@[65; 70) "\n " | 75 | WHITESPACE@[65; 70) "\n " |
76 | LET_STMT@[70; 88) | 76 | LET_STMT@[70; 88) |
77 | LET_KW@[70; 73) "let" | 77 | LET_KW@[70; 73) "let" |
@@ -86,11 +86,11 @@ SOURCE_FILE@[0; 91) | |||
86 | PATH_SEGMENT@[78; 84) | 86 | PATH_SEGMENT@[78; 84) |
87 | NAME_REF@[78; 84) | 87 | NAME_REF@[78; 84) |
88 | IDENT@[78; 84) "format" | 88 | IDENT@[78; 84) "format" |
89 | EXCL@[84; 85) "!" | 89 | BANG@[84; 85) "!" |
90 | TOKEN_TREE@[85; 87) | 90 | TOKEN_TREE@[85; 87) |
91 | L_PAREN@[85; 86) "(" | 91 | L_PAREN@[85; 86) "(" |
92 | R_PAREN@[86; 87) ")" | 92 | R_PAREN@[86; 87) ")" |
93 | SEMI@[87; 88) ";" | 93 | SEMICOLON@[87; 88) ";" |
94 | WHITESPACE@[88; 89) "\n" | 94 | WHITESPACE@[88; 89) "\n" |
95 | R_CURLY@[89; 90) "}" | 95 | R_CURLY@[89; 90) "}" |
96 | WHITESPACE@[90; 91) "\n" | 96 | WHITESPACE@[90; 91) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast index 9a9a13370..c6082791a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0056_where_clause.rast | |||
@@ -63,7 +63,7 @@ SOURCE_FILE@[0; 116) | |||
63 | PATH_SEGMENT@[64; 72) | 63 | PATH_SEGMENT@[64; 72) |
64 | NAME_REF@[64; 72) | 64 | NAME_REF@[64; 72) |
65 | IDENT@[64; 72) "Iterator" | 65 | IDENT@[64; 72) "Iterator" |
66 | COLONCOLON@[72; 74) "::" | 66 | COLON2@[72; 74) "::" |
67 | PATH_SEGMENT@[74; 78) | 67 | PATH_SEGMENT@[74; 78) |
68 | NAME_REF@[74; 78) | 68 | NAME_REF@[74; 78) |
69 | IDENT@[74; 78) "Item" | 69 | IDENT@[74; 78) "Item" |
@@ -94,7 +94,7 @@ SOURCE_FILE@[0; 116) | |||
94 | NAME_REF@[93; 101) | 94 | NAME_REF@[93; 101) |
95 | IDENT@[93; 101) "Iterator" | 95 | IDENT@[93; 101) "Iterator" |
96 | R_ANGLE@[101; 102) ">" | 96 | R_ANGLE@[101; 102) ">" |
97 | COLONCOLON@[102; 104) "::" | 97 | COLON2@[102; 104) "::" |
98 | PATH_SEGMENT@[104; 108) | 98 | PATH_SEGMENT@[104; 108) |
99 | NAME_REF@[104; 108) | 99 | NAME_REF@[104; 108) |
100 | IDENT@[104; 108) "Item" | 100 | IDENT@[104; 108) "Item" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast index 3d659ce10..8d7083e97 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0058_range_pat.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 112) | |||
27 | LITERAL@[35; 36) | 27 | LITERAL@[35; 36) |
28 | INT_NUMBER@[35; 36) "0" | 28 | INT_NUMBER@[35; 36) "0" |
29 | WHITESPACE@[36; 37) " " | 29 | WHITESPACE@[36; 37) " " |
30 | DOTDOTDOT@[37; 40) "..." | 30 | DOT3@[37; 40) "..." |
31 | WHITESPACE@[40; 41) " " | 31 | WHITESPACE@[40; 41) " " |
32 | LITERAL_PAT@[41; 44) | 32 | LITERAL_PAT@[41; 44) |
33 | LITERAL@[41; 44) | 33 | LITERAL@[41; 44) |
@@ -46,7 +46,7 @@ SOURCE_FILE@[0; 112) | |||
46 | LITERAL@[60; 63) | 46 | LITERAL@[60; 63) |
47 | INT_NUMBER@[60; 63) "101" | 47 | INT_NUMBER@[60; 63) "101" |
48 | WHITESPACE@[63; 64) " " | 48 | WHITESPACE@[63; 64) " " |
49 | DOTDOTEQ@[64; 67) "..=" | 49 | DOT2EQ@[64; 67) "..=" |
50 | WHITESPACE@[67; 68) " " | 50 | WHITESPACE@[67; 68) " " |
51 | LITERAL_PAT@[68; 71) | 51 | LITERAL_PAT@[68; 71) |
52 | LITERAL@[68; 71) | 52 | LITERAL@[68; 71) |
@@ -65,7 +65,7 @@ SOURCE_FILE@[0; 112) | |||
65 | LITERAL@[87; 90) | 65 | LITERAL@[87; 90) |
66 | INT_NUMBER@[87; 90) "200" | 66 | INT_NUMBER@[87; 90) "200" |
67 | WHITESPACE@[90; 91) " " | 67 | WHITESPACE@[90; 91) " " |
68 | DOTDOT@[91; 93) ".." | 68 | DOT2@[91; 93) ".." |
69 | WHITESPACE@[93; 94) " " | 69 | WHITESPACE@[93; 94) " " |
70 | LITERAL_PAT@[94; 97) | 70 | LITERAL_PAT@[94; 97) |
71 | LITERAL@[94; 97) | 71 | LITERAL@[94; 97) |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rast b/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rast index 7667201ba..c6e4ee532 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0060_extern_crate.rast | |||
@@ -6,5 +6,5 @@ SOURCE_FILE@[0; 18) | |||
6 | WHITESPACE@[12; 13) " " | 6 | WHITESPACE@[12; 13) " " |
7 | NAME_REF@[13; 16) | 7 | NAME_REF@[13; 16) |
8 | IDENT@[13; 16) "foo" | 8 | IDENT@[13; 16) "foo" |
9 | SEMI@[16; 17) ";" | 9 | SEMICOLON@[16; 17) ";" |
10 | WHITESPACE@[17; 18) "\n" | 10 | WHITESPACE@[17; 18) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast b/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast index dcf527639..f4206858b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0061_record_lit.rast | |||
@@ -22,7 +22,7 @@ SOURCE_FILE@[0; 112) | |||
22 | RECORD_FIELD_LIST@[17; 19) | 22 | RECORD_FIELD_LIST@[17; 19) |
23 | L_CURLY@[17; 18) "{" | 23 | L_CURLY@[17; 18) "{" |
24 | R_CURLY@[18; 19) "}" | 24 | R_CURLY@[18; 19) "}" |
25 | SEMI@[19; 20) ";" | 25 | SEMICOLON@[19; 20) ";" |
26 | WHITESPACE@[20; 25) "\n " | 26 | WHITESPACE@[20; 25) "\n " |
27 | EXPR_STMT@[25; 41) | 27 | EXPR_STMT@[25; 41) |
28 | RECORD_LIT@[25; 40) | 28 | RECORD_LIT@[25; 40) |
@@ -49,7 +49,7 @@ SOURCE_FILE@[0; 112) | |||
49 | COMMA@[37; 38) "," | 49 | COMMA@[37; 38) "," |
50 | WHITESPACE@[38; 39) " " | 50 | WHITESPACE@[38; 39) " " |
51 | R_CURLY@[39; 40) "}" | 51 | R_CURLY@[39; 40) "}" |
52 | SEMI@[40; 41) ";" | 52 | SEMICOLON@[40; 41) ";" |
53 | WHITESPACE@[41; 46) "\n " | 53 | WHITESPACE@[41; 46) "\n " |
54 | EXPR_STMT@[46; 83) | 54 | EXPR_STMT@[46; 83) |
55 | RECORD_LIT@[46; 82) | 55 | RECORD_LIT@[46; 82) |
@@ -75,7 +75,7 @@ SOURCE_FILE@[0; 112) | |||
75 | INT_NUMBER@[56; 58) "32" | 75 | INT_NUMBER@[56; 58) "32" |
76 | COMMA@[58; 59) "," | 76 | COMMA@[58; 59) "," |
77 | WHITESPACE@[59; 60) " " | 77 | WHITESPACE@[59; 60) " " |
78 | DOTDOT@[60; 62) ".." | 78 | DOT2@[60; 62) ".." |
79 | CALL_EXPR@[62; 80) | 79 | CALL_EXPR@[62; 80) |
80 | PATH_EXPR@[62; 78) | 80 | PATH_EXPR@[62; 78) |
81 | PATH@[62; 78) | 81 | PATH@[62; 78) |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 112) | |||
83 | PATH_SEGMENT@[62; 69) | 83 | PATH_SEGMENT@[62; 69) |
84 | NAME_REF@[62; 69) | 84 | NAME_REF@[62; 69) |
85 | IDENT@[62; 69) "Default" | 85 | IDENT@[62; 69) "Default" |
86 | COLONCOLON@[69; 71) "::" | 86 | COLON2@[69; 71) "::" |
87 | PATH_SEGMENT@[71; 78) | 87 | PATH_SEGMENT@[71; 78) |
88 | NAME_REF@[71; 78) | 88 | NAME_REF@[71; 78) |
89 | IDENT@[71; 78) "default" | 89 | IDENT@[71; 78) "default" |
@@ -92,7 +92,7 @@ SOURCE_FILE@[0; 112) | |||
92 | R_PAREN@[79; 80) ")" | 92 | R_PAREN@[79; 80) ")" |
93 | WHITESPACE@[80; 81) " " | 93 | WHITESPACE@[80; 81) " " |
94 | R_CURLY@[81; 82) "}" | 94 | R_CURLY@[81; 82) "}" |
95 | SEMI@[82; 83) ";" | 95 | SEMICOLON@[82; 83) ";" |
96 | WHITESPACE@[83; 88) "\n " | 96 | WHITESPACE@[83; 88) "\n " |
97 | EXPR_STMT@[88; 109) | 97 | EXPR_STMT@[88; 109) |
98 | RECORD_LIT@[88; 108) | 98 | RECORD_LIT@[88; 108) |
@@ -113,7 +113,7 @@ SOURCE_FILE@[0; 112) | |||
113 | INT_NUMBER@[105; 106) "1" | 113 | INT_NUMBER@[105; 106) "1" |
114 | WHITESPACE@[106; 107) " " | 114 | WHITESPACE@[106; 107) " " |
115 | R_CURLY@[107; 108) "}" | 115 | R_CURLY@[107; 108) "}" |
116 | SEMI@[108; 109) ";" | 116 | SEMICOLON@[108; 109) ";" |
117 | WHITESPACE@[109; 110) "\n" | 117 | WHITESPACE@[109; 110) "\n" |
118 | R_CURLY@[110; 111) "}" | 118 | R_CURLY@[110; 111) "}" |
119 | WHITESPACE@[111; 112) "\n" | 119 | WHITESPACE@[111; 112) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast index 6b528c252..99e0a0bec 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0062_mod_contents.rast | |||
@@ -18,7 +18,7 @@ SOURCE_FILE@[0; 70) | |||
18 | PATH_SEGMENT@[12; 23) | 18 | PATH_SEGMENT@[12; 23) |
19 | NAME_REF@[12; 23) | 19 | NAME_REF@[12; 23) |
20 | IDENT@[12; 23) "macro_rules" | 20 | IDENT@[12; 23) "macro_rules" |
21 | EXCL@[23; 24) "!" | 21 | BANG@[23; 24) "!" |
22 | WHITESPACE@[24; 25) " " | 22 | WHITESPACE@[24; 25) " " |
23 | NAME@[25; 28) | 23 | NAME@[25; 28) |
24 | IDENT@[25; 28) "foo" | 24 | IDENT@[25; 28) "foo" |
@@ -33,26 +33,26 @@ SOURCE_FILE@[0; 70) | |||
33 | PATH_SEGMENT@[32; 35) | 33 | PATH_SEGMENT@[32; 35) |
34 | NAME_REF@[32; 35) | 34 | NAME_REF@[32; 35) |
35 | IDENT@[32; 35) "foo" | 35 | IDENT@[32; 35) "foo" |
36 | COLONCOLON@[35; 37) "::" | 36 | COLON2@[35; 37) "::" |
37 | PATH_SEGMENT@[37; 40) | 37 | PATH_SEGMENT@[37; 40) |
38 | NAME_REF@[37; 40) | 38 | NAME_REF@[37; 40) |
39 | IDENT@[37; 40) "bar" | 39 | IDENT@[37; 40) "bar" |
40 | EXCL@[40; 41) "!" | 40 | BANG@[40; 41) "!" |
41 | TOKEN_TREE@[41; 43) | 41 | TOKEN_TREE@[41; 43) |
42 | L_PAREN@[41; 42) "(" | 42 | L_PAREN@[41; 42) "(" |
43 | R_PAREN@[42; 43) ")" | 43 | R_PAREN@[42; 43) ")" |
44 | SEMI@[43; 44) ";" | 44 | SEMICOLON@[43; 44) ";" |
45 | WHITESPACE@[44; 45) "\n" | 45 | WHITESPACE@[44; 45) "\n" |
46 | MACRO_CALL@[45; 59) | 46 | MACRO_CALL@[45; 59) |
47 | PATH@[45; 55) | 47 | PATH@[45; 55) |
48 | PATH@[45; 50) | 48 | PATH@[45; 50) |
49 | PATH_SEGMENT@[45; 50) | 49 | PATH_SEGMENT@[45; 50) |
50 | SUPER_KW@[45; 50) "super" | 50 | SUPER_KW@[45; 50) "super" |
51 | COLONCOLON@[50; 52) "::" | 51 | COLON2@[50; 52) "::" |
52 | PATH_SEGMENT@[52; 55) | 52 | PATH_SEGMENT@[52; 55) |
53 | NAME_REF@[52; 55) | 53 | NAME_REF@[52; 55) |
54 | IDENT@[52; 55) "baz" | 54 | IDENT@[52; 55) "baz" |
55 | EXCL@[55; 56) "!" | 55 | BANG@[55; 56) "!" |
56 | WHITESPACE@[56; 57) " " | 56 | WHITESPACE@[56; 57) " " |
57 | TOKEN_TREE@[57; 59) | 57 | TOKEN_TREE@[57; 59) |
58 | L_CURLY@[57; 58) "{" | 58 | L_CURLY@[57; 58) "{" |
@@ -63,5 +63,5 @@ SOURCE_FILE@[0; 70) | |||
63 | WHITESPACE@[66; 67) " " | 63 | WHITESPACE@[66; 67) " " |
64 | NAME@[67; 68) | 64 | NAME@[67; 68) |
65 | IDENT@[67; 68) "S" | 65 | IDENT@[67; 68) "S" |
66 | SEMI@[68; 69) ";" | 66 | SEMICOLON@[68; 69) ";" |
67 | WHITESPACE@[69; 70) "\n" | 67 | WHITESPACE@[69; 70) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast index 0cc3ac085..278549a46 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0063_impl_def_neg.rast | |||
@@ -2,7 +2,7 @@ SOURCE_FILE@[0; 20) | |||
2 | IMPL_DEF@[0; 19) | 2 | IMPL_DEF@[0; 19) |
3 | IMPL_KW@[0; 4) "impl" | 3 | IMPL_KW@[0; 4) "impl" |
4 | WHITESPACE@[4; 5) " " | 4 | WHITESPACE@[4; 5) " " |
5 | EXCL@[5; 6) "!" | 5 | BANG@[5; 6) "!" |
6 | PATH_TYPE@[6; 10) | 6 | PATH_TYPE@[6; 10) |
7 | PATH@[6; 10) | 7 | PATH@[6; 10) |
8 | PATH_SEGMENT@[6; 10) | 8 | PATH_SEGMENT@[6; 10) |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast index 2ace3c8ee..df24ae189 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0064_if_expr.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 137) | |||
24 | BLOCK@[23; 25) | 24 | BLOCK@[23; 25) |
25 | L_CURLY@[23; 24) "{" | 25 | L_CURLY@[23; 24) "{" |
26 | R_CURLY@[24; 25) "}" | 26 | R_CURLY@[24; 25) "}" |
27 | SEMI@[25; 26) ";" | 27 | SEMICOLON@[25; 26) ";" |
28 | WHITESPACE@[26; 31) "\n " | 28 | WHITESPACE@[26; 31) "\n " |
29 | EXPR_STMT@[31; 50) | 29 | EXPR_STMT@[31; 50) |
30 | IF_EXPR@[31; 49) | 30 | IF_EXPR@[31; 49) |
@@ -45,7 +45,7 @@ SOURCE_FILE@[0; 137) | |||
45 | BLOCK@[47; 49) | 45 | BLOCK@[47; 49) |
46 | L_CURLY@[47; 48) "{" | 46 | L_CURLY@[47; 48) "{" |
47 | R_CURLY@[48; 49) "}" | 47 | R_CURLY@[48; 49) "}" |
48 | SEMI@[49; 50) ";" | 48 | SEMICOLON@[49; 50) ";" |
49 | WHITESPACE@[50; 55) "\n " | 49 | WHITESPACE@[50; 55) "\n " |
50 | EXPR_STMT@[55; 91) | 50 | EXPR_STMT@[55; 91) |
51 | IF_EXPR@[55; 90) | 51 | IF_EXPR@[55; 90) |
@@ -80,7 +80,7 @@ SOURCE_FILE@[0; 137) | |||
80 | BLOCK@[88; 90) | 80 | BLOCK@[88; 90) |
81 | L_CURLY@[88; 89) "{" | 81 | L_CURLY@[88; 89) "{" |
82 | R_CURLY@[89; 90) "}" | 82 | R_CURLY@[89; 90) "}" |
83 | SEMI@[90; 91) ";" | 83 | SEMICOLON@[90; 91) ";" |
84 | WHITESPACE@[91; 96) "\n " | 84 | WHITESPACE@[91; 96) "\n " |
85 | EXPR_STMT@[96; 104) | 85 | EXPR_STMT@[96; 104) |
86 | IF_EXPR@[96; 103) | 86 | IF_EXPR@[96; 103) |
@@ -97,7 +97,7 @@ SOURCE_FILE@[0; 137) | |||
97 | BLOCK@[101; 103) | 97 | BLOCK@[101; 103) |
98 | L_CURLY@[101; 102) "{" | 98 | L_CURLY@[101; 102) "{" |
99 | R_CURLY@[102; 103) "}" | 99 | R_CURLY@[102; 103) "}" |
100 | SEMI@[103; 104) ";" | 100 | SEMICOLON@[103; 104) ";" |
101 | WHITESPACE@[104; 109) "\n " | 101 | WHITESPACE@[104; 109) "\n " |
102 | EXPR_STMT@[109; 134) | 102 | EXPR_STMT@[109; 134) |
103 | IF_EXPR@[109; 133) | 103 | IF_EXPR@[109; 133) |
@@ -126,7 +126,7 @@ SOURCE_FILE@[0; 137) | |||
126 | L_CURLY@[130; 131) "{" | 126 | L_CURLY@[130; 131) "{" |
127 | WHITESPACE@[131; 132) " " | 127 | WHITESPACE@[131; 132) " " |
128 | R_CURLY@[132; 133) "}" | 128 | R_CURLY@[132; 133) "}" |
129 | SEMI@[133; 134) ";" | 129 | SEMICOLON@[133; 134) ";" |
130 | WHITESPACE@[134; 135) "\n" | 130 | WHITESPACE@[134; 135) "\n" |
131 | R_CURLY@[135; 136) "}" | 131 | R_CURLY@[135; 136) "}" |
132 | WHITESPACE@[136; 137) "\n" | 132 | WHITESPACE@[136; 137) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast index 2ee0dc199..bbf347580 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0065_dyn_trait_type.rast | |||
@@ -39,5 +39,5 @@ SOURCE_FILE@[0; 42) | |||
39 | WHITESPACE@[37; 38) " " | 39 | WHITESPACE@[37; 38) " " |
40 | TYPE_BOUND@[38; 40) | 40 | TYPE_BOUND@[38; 40) |
41 | LIFETIME@[38; 40) "\'a" | 41 | LIFETIME@[38; 40) "\'a" |
42 | SEMI@[40; 41) ";" | 42 | SEMICOLON@[40; 41) ";" |
43 | WHITESPACE@[41; 42) "\n" | 43 | WHITESPACE@[41; 42) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast index 2f07af4e1..85edd0845 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0066_match_arm.rast | |||
@@ -146,7 +146,7 @@ SOURCE_FILE@[0; 167) | |||
146 | COMMA@[156; 157) "," | 146 | COMMA@[156; 157) "," |
147 | WHITESPACE@[157; 162) "\n " | 147 | WHITESPACE@[157; 162) "\n " |
148 | R_CURLY@[162; 163) "}" | 148 | R_CURLY@[162; 163) "}" |
149 | SEMI@[163; 164) ";" | 149 | SEMICOLON@[163; 164) ";" |
150 | WHITESPACE@[164; 165) "\n" | 150 | WHITESPACE@[164; 165) "\n" |
151 | R_CURLY@[165; 166) "}" | 151 | R_CURLY@[165; 166) "}" |
152 | WHITESPACE@[166; 167) "\n" | 152 | WHITESPACE@[166; 167) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rast index f2ba4e909..35994e3fd 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0067_crate_path.rast | |||
@@ -7,9 +7,9 @@ SOURCE_FILE@[0; 16) | |||
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 | CRATE_KW@[4; 9) "crate" |
10 | COLONCOLON@[9; 11) "::" | 10 | COLON2@[9; 11) "::" |
11 | PATH_SEGMENT@[11; 14) | 11 | PATH_SEGMENT@[11; 14) |
12 | NAME_REF@[11; 14) | 12 | NAME_REF@[11; 14) |
13 | IDENT@[11; 14) "foo" | 13 | IDENT@[11; 14) "foo" |
14 | SEMI@[14; 15) ";" | 14 | SEMICOLON@[14; 15) ";" |
15 | WHITESPACE@[15; 16) "\n" | 15 | WHITESPACE@[15; 16) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast index 86afc9362..e24247890 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0069_use_tree_list_after_path.rast | |||
@@ -6,7 +6,7 @@ SOURCE_FILE@[0; 37) | |||
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 | CRATE_KW@[4; 9) "crate" |
9 | COLONCOLON@[9; 11) "::" | 9 | COLON2@[9; 11) "::" |
10 | USE_TREE_LIST@[11; 17) | 10 | USE_TREE_LIST@[11; 17) |
11 | L_CURLY@[11; 12) "{" | 11 | L_CURLY@[11; 12) "{" |
12 | USE_TREE@[12; 16) | 12 | USE_TREE@[12; 16) |
@@ -15,7 +15,7 @@ SOURCE_FILE@[0; 37) | |||
15 | NAME_REF@[12; 16) | 15 | NAME_REF@[12; 16) |
16 | IDENT@[12; 16) "Item" | 16 | IDENT@[12; 16) "Item" |
17 | R_CURLY@[16; 17) "}" | 17 | R_CURLY@[16; 17) "}" |
18 | SEMI@[17; 18) ";" | 18 | SEMICOLON@[17; 18) ";" |
19 | WHITESPACE@[18; 19) "\n" | 19 | WHITESPACE@[18; 19) "\n" |
20 | USE_ITEM@[19; 36) | 20 | USE_ITEM@[19; 36) |
21 | USE_KW@[19; 22) "use" | 21 | USE_KW@[19; 22) "use" |
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 37) | |||
24 | PATH@[23; 27) | 24 | PATH@[23; 27) |
25 | PATH_SEGMENT@[23; 27) | 25 | PATH_SEGMENT@[23; 27) |
26 | SELF_KW@[23; 27) "self" | 26 | SELF_KW@[23; 27) "self" |
27 | COLONCOLON@[27; 29) "::" | 27 | COLON2@[27; 29) "::" |
28 | USE_TREE_LIST@[29; 35) | 28 | USE_TREE_LIST@[29; 35) |
29 | L_CURLY@[29; 30) "{" | 29 | L_CURLY@[29; 30) "{" |
30 | USE_TREE@[30; 34) | 30 | USE_TREE@[30; 34) |
@@ -33,5 +33,5 @@ SOURCE_FILE@[0; 37) | |||
33 | NAME_REF@[30; 34) | 33 | NAME_REF@[30; 34) |
34 | IDENT@[30; 34) "Item" | 34 | IDENT@[30; 34) "Item" |
35 | R_CURLY@[34; 35) "}" | 35 | R_CURLY@[34; 35) "}" |
36 | SEMI@[35; 36) ";" | 36 | SEMICOLON@[35; 36) ";" |
37 | WHITESPACE@[36; 37) "\n" | 37 | WHITESPACE@[36; 37) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast index cd63d10f7..4b075569a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0070_stmt_bin_expr_ambiguity.rast | |||
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 46) | |||
32 | WHITESPACE@[28; 29) " " | 32 | WHITESPACE@[28; 29) " " |
33 | LITERAL@[29; 30) | 33 | LITERAL@[29; 30) |
34 | INT_NUMBER@[29; 30) "2" | 34 | INT_NUMBER@[29; 30) "2" |
35 | SEMI@[30; 31) ";" | 35 | SEMICOLON@[30; 31) ";" |
36 | WHITESPACE@[31; 36) "\n " | 36 | WHITESPACE@[31; 36) "\n " |
37 | EXPR_STMT@[36; 39) | 37 | EXPR_STMT@[36; 39) |
38 | BLOCK_EXPR@[36; 39) | 38 | BLOCK_EXPR@[36; 39) |
@@ -47,7 +47,7 @@ SOURCE_FILE@[0; 46) | |||
47 | AMP@[40; 41) "&" | 47 | AMP@[40; 41) "&" |
48 | LITERAL@[41; 42) | 48 | LITERAL@[41; 42) |
49 | INT_NUMBER@[41; 42) "2" | 49 | INT_NUMBER@[41; 42) "2" |
50 | SEMI@[42; 43) ";" | 50 | SEMICOLON@[42; 43) ";" |
51 | WHITESPACE@[43; 44) "\n" | 51 | WHITESPACE@[43; 44) "\n" |
52 | R_CURLY@[44; 45) "}" | 52 | R_CURLY@[44; 45) "}" |
53 | WHITESPACE@[45; 46) "\n" | 53 | WHITESPACE@[45; 46) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast index 0af668056..559ffb578 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0071_match_expr.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 97) | |||
24 | L_CURLY@[24; 25) "{" | 24 | L_CURLY@[24; 25) "{" |
25 | WHITESPACE@[25; 26) " " | 25 | WHITESPACE@[25; 26) " " |
26 | R_CURLY@[26; 27) "}" | 26 | R_CURLY@[26; 27) "}" |
27 | SEMI@[27; 28) ";" | 27 | SEMICOLON@[27; 28) ";" |
28 | WHITESPACE@[28; 33) "\n " | 28 | WHITESPACE@[28; 33) "\n " |
29 | EXPR_STMT@[33; 44) | 29 | EXPR_STMT@[33; 44) |
30 | MATCH_EXPR@[33; 43) | 30 | MATCH_EXPR@[33; 43) |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 97) | |||
39 | MATCH_ARM_LIST@[41; 43) | 39 | MATCH_ARM_LIST@[41; 43) |
40 | L_CURLY@[41; 42) "{" | 40 | L_CURLY@[41; 42) "{" |
41 | R_CURLY@[42; 43) "}" | 41 | R_CURLY@[42; 43) "}" |
42 | SEMI@[43; 44) ";" | 42 | SEMICOLON@[43; 44) ";" |
43 | WHITESPACE@[44; 49) "\n " | 43 | WHITESPACE@[44; 49) "\n " |
44 | EXPR_STMT@[49; 71) | 44 | EXPR_STMT@[49; 71) |
45 | MATCH_EXPR@[49; 70) | 45 | MATCH_EXPR@[49; 70) |
@@ -65,7 +65,7 @@ SOURCE_FILE@[0; 97) | |||
65 | R_PAREN@[67; 68) ")" | 65 | R_PAREN@[67; 68) ")" |
66 | WHITESPACE@[68; 69) " " | 66 | WHITESPACE@[68; 69) " " |
67 | R_CURLY@[69; 70) "}" | 67 | R_CURLY@[69; 70) "}" |
68 | SEMI@[70; 71) ";" | 68 | SEMICOLON@[70; 71) ";" |
69 | WHITESPACE@[71; 76) "\n " | 69 | WHITESPACE@[71; 76) "\n " |
70 | EXPR_STMT@[76; 94) | 70 | EXPR_STMT@[76; 94) |
71 | MATCH_EXPR@[76; 93) | 71 | MATCH_EXPR@[76; 93) |
@@ -90,7 +90,7 @@ SOURCE_FILE@[0; 97) | |||
90 | MATCH_ARM_LIST@[91; 93) | 90 | MATCH_ARM_LIST@[91; 93) |
91 | L_CURLY@[91; 92) "{" | 91 | L_CURLY@[91; 92) "{" |
92 | R_CURLY@[92; 93) "}" | 92 | R_CURLY@[92; 93) "}" |
93 | SEMI@[93; 94) ";" | 93 | SEMICOLON@[93; 94) ";" |
94 | WHITESPACE@[94; 95) "\n" | 94 | WHITESPACE@[94; 95) "\n" |
95 | R_CURLY@[95; 96) "}" | 95 | R_CURLY@[95; 96) "}" |
96 | WHITESPACE@[96; 97) "\n" | 96 | WHITESPACE@[96; 97) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast index 4a83a7200..084efaee2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0072_return_expr.rast | |||
@@ -15,7 +15,7 @@ SOURCE_FILE@[0; 40) | |||
15 | EXPR_STMT@[15; 22) | 15 | EXPR_STMT@[15; 22) |
16 | RETURN_EXPR@[15; 21) | 16 | RETURN_EXPR@[15; 21) |
17 | RETURN_KW@[15; 21) "return" | 17 | RETURN_KW@[15; 21) "return" |
18 | SEMI@[21; 22) ";" | 18 | SEMICOLON@[21; 22) ";" |
19 | WHITESPACE@[22; 27) "\n " | 19 | WHITESPACE@[22; 27) "\n " |
20 | EXPR_STMT@[27; 37) | 20 | EXPR_STMT@[27; 37) |
21 | RETURN_EXPR@[27; 36) | 21 | RETURN_EXPR@[27; 36) |
@@ -23,7 +23,7 @@ SOURCE_FILE@[0; 40) | |||
23 | WHITESPACE@[33; 34) " " | 23 | WHITESPACE@[33; 34) " " |
24 | LITERAL@[34; 36) | 24 | LITERAL@[34; 36) |
25 | INT_NUMBER@[34; 36) "92" | 25 | INT_NUMBER@[34; 36) "92" |
26 | SEMI@[36; 37) ";" | 26 | SEMICOLON@[36; 37) ";" |
27 | WHITESPACE@[37; 38) "\n" | 27 | WHITESPACE@[37; 38) "\n" |
28 | R_CURLY@[38; 39) "}" | 28 | R_CURLY@[38; 39) "}" |
29 | WHITESPACE@[39; 40) "\n" | 29 | WHITESPACE@[39; 40) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast index 2dd6db28f..64150b774 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0073_type_item_type_params.rast | |||
@@ -16,5 +16,5 @@ SOURCE_FILE@[0; 21) | |||
16 | TUPLE_TYPE@[17; 19) | 16 | TUPLE_TYPE@[17; 19) |
17 | L_PAREN@[17; 18) "(" | 17 | L_PAREN@[17; 18) "(" |
18 | R_PAREN@[18; 19) ")" | 18 | R_PAREN@[18; 19) ")" |
19 | SEMI@[19; 20) ";" | 19 | SEMICOLON@[19; 20) ";" |
20 | WHITESPACE@[20; 21) "\n" | 20 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast index 28d1bad97..5c7cb4a88 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0075_block.rast | |||
@@ -36,7 +36,7 @@ SOURCE_FILE@[0; 65) | |||
36 | WHITESPACE@[26; 27) " " | 36 | WHITESPACE@[26; 27) " " |
37 | LITERAL@[27; 28) | 37 | LITERAL@[27; 28) |
38 | INT_NUMBER@[27; 28) "1" | 38 | INT_NUMBER@[27; 28) "1" |
39 | SEMI@[28; 29) ";" | 39 | SEMICOLON@[28; 29) ";" |
40 | WHITESPACE@[29; 30) " " | 40 | WHITESPACE@[29; 30) " " |
41 | R_CURLY@[30; 31) "}" | 41 | R_CURLY@[30; 31) "}" |
42 | WHITESPACE@[31; 32) "\n" | 42 | WHITESPACE@[31; 32) "\n" |
@@ -56,12 +56,12 @@ SOURCE_FILE@[0; 65) | |||
56 | EXPR_STMT@[41; 43) | 56 | EXPR_STMT@[41; 43) |
57 | LITERAL@[41; 42) | 57 | LITERAL@[41; 42) |
58 | INT_NUMBER@[41; 42) "1" | 58 | INT_NUMBER@[41; 42) "1" |
59 | SEMI@[42; 43) ";" | 59 | SEMICOLON@[42; 43) ";" |
60 | WHITESPACE@[43; 44) " " | 60 | WHITESPACE@[43; 44) " " |
61 | EXPR_STMT@[44; 46) | 61 | EXPR_STMT@[44; 46) |
62 | LITERAL@[44; 45) | 62 | LITERAL@[44; 45) |
63 | INT_NUMBER@[44; 45) "2" | 63 | INT_NUMBER@[44; 45) "2" |
64 | SEMI@[45; 46) ";" | 64 | SEMICOLON@[45; 46) ";" |
65 | WHITESPACE@[46; 47) " " | 65 | WHITESPACE@[46; 47) " " |
66 | R_CURLY@[47; 48) "}" | 66 | R_CURLY@[47; 48) "}" |
67 | WHITESPACE@[48; 49) "\n" | 67 | WHITESPACE@[48; 49) "\n" |
@@ -81,7 +81,7 @@ SOURCE_FILE@[0; 65) | |||
81 | EXPR_STMT@[58; 60) | 81 | EXPR_STMT@[58; 60) |
82 | LITERAL@[58; 59) | 82 | LITERAL@[58; 59) |
83 | INT_NUMBER@[58; 59) "1" | 83 | INT_NUMBER@[58; 59) "1" |
84 | SEMI@[59; 60) ";" | 84 | SEMICOLON@[59; 60) ";" |
85 | WHITESPACE@[60; 61) " " | 85 | WHITESPACE@[60; 61) " " |
86 | LITERAL@[61; 62) | 86 | LITERAL@[61; 62) |
87 | INT_NUMBER@[61; 62) "2" | 87 | INT_NUMBER@[61; 62) "2" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast index 18ccfe9ef..bb9f674e1 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0077_try_expr.rast | |||
@@ -20,7 +20,7 @@ SOURCE_FILE@[0; 21) | |||
20 | NAME_REF@[15; 16) | 20 | NAME_REF@[15; 16) |
21 | IDENT@[15; 16) "x" | 21 | IDENT@[15; 16) "x" |
22 | QUESTION@[16; 17) "?" | 22 | QUESTION@[16; 17) "?" |
23 | SEMI@[17; 18) ";" | 23 | SEMICOLON@[17; 18) ";" |
24 | WHITESPACE@[18; 19) "\n" | 24 | WHITESPACE@[18; 19) "\n" |
25 | R_CURLY@[19; 20) "}" | 25 | R_CURLY@[19; 20) "}" |
26 | WHITESPACE@[20; 21) "\n" | 26 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast index 4bc0b1858..9a38192d9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0078_type_item.rast | |||
@@ -12,5 +12,5 @@ SOURCE_FILE@[0; 16) | |||
12 | PATH_SEGMENT@[11; 14) | 12 | PATH_SEGMENT@[11; 14) |
13 | NAME_REF@[11; 14) | 13 | NAME_REF@[11; 14) |
14 | IDENT@[11; 14) "Bar" | 14 | IDENT@[11; 14) "Bar" |
15 | SEMI@[14; 15) ";" | 15 | SEMICOLON@[14; 15) ";" |
16 | WHITESPACE@[15; 16) "\n" | 16 | WHITESPACE@[15; 16) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast index 9f8a6b0f6..b8bafc220 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0080_postfix_range.rast | |||
@@ -24,8 +24,8 @@ SOURCE_FILE@[0; 89) | |||
24 | RANGE_EXPR@[23; 26) | 24 | RANGE_EXPR@[23; 26) |
25 | LITERAL@[23; 24) | 25 | LITERAL@[23; 24) |
26 | INT_NUMBER@[23; 24) "1" | 26 | INT_NUMBER@[23; 24) "1" |
27 | DOTDOT@[24; 26) ".." | 27 | DOT2@[24; 26) ".." |
28 | SEMI@[26; 27) ";" | 28 | SEMICOLON@[26; 27) ";" |
29 | WHITESPACE@[27; 32) "\n " | 29 | WHITESPACE@[27; 32) "\n " |
30 | EXPR_STMT@[32; 54) | 30 | EXPR_STMT@[32; 54) |
31 | MATCH_EXPR@[32; 53) | 31 | MATCH_EXPR@[32; 53) |
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 89) | |||
34 | RANGE_EXPR@[38; 41) | 34 | RANGE_EXPR@[38; 41) |
35 | LITERAL@[38; 39) | 35 | LITERAL@[38; 39) |
36 | INT_NUMBER@[38; 39) "1" | 36 | INT_NUMBER@[38; 39) "1" |
37 | DOTDOT@[39; 41) ".." | 37 | DOT2@[39; 41) ".." |
38 | WHITESPACE@[41; 42) " " | 38 | WHITESPACE@[41; 42) " " |
39 | MATCH_ARM_LIST@[42; 53) | 39 | MATCH_ARM_LIST@[42; 53) |
40 | L_CURLY@[42; 43) "{" | 40 | L_CURLY@[42; 43) "{" |
@@ -50,7 +50,7 @@ SOURCE_FILE@[0; 89) | |||
50 | R_PAREN@[50; 51) ")" | 50 | R_PAREN@[50; 51) ")" |
51 | WHITESPACE@[51; 52) " " | 51 | WHITESPACE@[51; 52) " " |
52 | R_CURLY@[52; 53) "}" | 52 | R_CURLY@[52; 53) "}" |
53 | SEMI@[53; 54) ";" | 53 | SEMICOLON@[53; 54) ";" |
54 | WHITESPACE@[54; 59) "\n " | 54 | WHITESPACE@[54; 59) "\n " |
55 | EXPR_STMT@[59; 86) | 55 | EXPR_STMT@[59; 86) |
56 | MATCH_EXPR@[59; 85) | 56 | MATCH_EXPR@[59; 85) |
@@ -69,7 +69,7 @@ SOURCE_FILE@[0; 89) | |||
69 | ARG_LIST@[68; 70) | 69 | ARG_LIST@[68; 70) |
70 | L_PAREN@[68; 69) "(" | 70 | L_PAREN@[68; 69) "(" |
71 | R_PAREN@[69; 70) ")" | 71 | R_PAREN@[69; 70) ")" |
72 | DOTDOT@[70; 72) ".." | 72 | DOT2@[70; 72) ".." |
73 | PATH_EXPR@[72; 73) | 73 | PATH_EXPR@[72; 73) |
74 | PATH@[72; 73) | 74 | PATH@[72; 73) |
75 | PATH_SEGMENT@[72; 73) | 75 | PATH_SEGMENT@[72; 73) |
@@ -90,7 +90,7 @@ SOURCE_FILE@[0; 89) | |||
90 | R_PAREN@[82; 83) ")" | 90 | R_PAREN@[82; 83) ")" |
91 | WHITESPACE@[83; 84) " " | 91 | WHITESPACE@[83; 84) " " |
92 | R_CURLY@[84; 85) "}" | 92 | R_CURLY@[84; 85) "}" |
93 | SEMI@[85; 86) ";" | 93 | SEMICOLON@[85; 86) ";" |
94 | WHITESPACE@[86; 87) "\n" | 94 | WHITESPACE@[86; 87) "\n" |
95 | R_CURLY@[87; 88) "}" | 95 | R_CURLY@[87; 88) "}" |
96 | WHITESPACE@[88; 89) "\n" | 96 | WHITESPACE@[88; 89) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast index b1353c2c6..00c4e4220 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0081_for_type.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 200) | |||
27 | TUPLE_TYPE@[25; 27) | 27 | TUPLE_TYPE@[25; 27) |
28 | L_PAREN@[25; 26) "(" | 28 | L_PAREN@[25; 26) "(" |
29 | R_PAREN@[26; 27) ")" | 29 | R_PAREN@[26; 27) ")" |
30 | SEMI@[27; 28) ";" | 30 | SEMICOLON@[27; 28) ";" |
31 | WHITESPACE@[28; 29) "\n" | 31 | WHITESPACE@[28; 29) "\n" |
32 | FN_DEF@[29; 79) | 32 | FN_DEF@[29; 79) |
33 | FN_KW@[29; 31) "fn" | 33 | FN_KW@[29; 31) "fn" |
@@ -222,7 +222,7 @@ SOURCE_FILE@[0; 200) | |||
222 | NAME_REF@[177; 180) | 222 | NAME_REF@[177; 180) |
223 | IDENT@[177; 180) "Baz" | 223 | IDENT@[177; 180) "Baz" |
224 | R_ANGLE@[180; 181) ">" | 224 | R_ANGLE@[180; 181) ">" |
225 | COLONCOLON@[181; 183) "::" | 225 | COLON2@[181; 183) "::" |
226 | PATH_SEGMENT@[183; 186) | 226 | PATH_SEGMENT@[183; 186) |
227 | NAME_REF@[183; 186) | 227 | NAME_REF@[183; 186) |
228 | IDENT@[183; 186) "Foo" | 228 | IDENT@[183; 186) "Foo" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast index 8f34afe76..2999977fc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0082_ref_expr.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 52) | |||
24 | AMP@[23; 24) "&" | 24 | AMP@[23; 24) "&" |
25 | LITERAL@[24; 25) | 25 | LITERAL@[24; 25) |
26 | INT_NUMBER@[24; 25) "1" | 26 | INT_NUMBER@[24; 25) "1" |
27 | SEMI@[25; 26) ";" | 27 | SEMICOLON@[25; 26) ";" |
28 | WHITESPACE@[26; 31) "\n " | 28 | WHITESPACE@[26; 31) "\n " |
29 | LET_STMT@[31; 49) | 29 | LET_STMT@[31; 49) |
30 | LET_KW@[31; 34) "let" | 30 | LET_KW@[31; 34) "let" |
@@ -49,7 +49,7 @@ SOURCE_FILE@[0; 52) | |||
49 | ARG_LIST@[46; 48) | 49 | ARG_LIST@[46; 48) |
50 | L_PAREN@[46; 47) "(" | 50 | L_PAREN@[46; 47) "(" |
51 | R_PAREN@[47; 48) ")" | 51 | R_PAREN@[47; 48) ")" |
52 | SEMI@[48; 49) ";" | 52 | SEMICOLON@[48; 49) ";" |
53 | WHITESPACE@[49; 50) "\n" | 53 | WHITESPACE@[49; 50) "\n" |
54 | R_CURLY@[50; 51) "}" | 54 | R_CURLY@[50; 51) "}" |
55 | WHITESPACE@[51; 52) "\n" | 55 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast index e909f2b78..13393e4b8 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0083_struct_items.rast | |||
@@ -4,7 +4,7 @@ SOURCE_FILE@[0; 106) | |||
4 | WHITESPACE@[6; 7) " " | 4 | WHITESPACE@[6; 7) " " |
5 | NAME@[7; 10) | 5 | NAME@[7; 10) |
6 | IDENT@[7; 10) "Foo" | 6 | IDENT@[7; 10) "Foo" |
7 | SEMI@[10; 11) ";" | 7 | SEMICOLON@[10; 11) ";" |
8 | WHITESPACE@[11; 12) "\n" | 8 | WHITESPACE@[11; 12) "\n" |
9 | STRUCT_DEF@[12; 25) | 9 | STRUCT_DEF@[12; 25) |
10 | STRUCT_KW@[12; 18) "struct" | 10 | STRUCT_KW@[12; 18) "struct" |
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 106) | |||
24 | TUPLE_FIELD_DEF_LIST@[36; 38) | 24 | TUPLE_FIELD_DEF_LIST@[36; 38) |
25 | L_PAREN@[36; 37) "(" | 25 | L_PAREN@[36; 37) "(" |
26 | R_PAREN@[37; 38) ")" | 26 | R_PAREN@[37; 38) ")" |
27 | SEMI@[38; 39) ";" | 27 | SEMICOLON@[38; 39) ";" |
28 | WHITESPACE@[39; 40) "\n" | 28 | WHITESPACE@[39; 40) "\n" |
29 | STRUCT_DEF@[40; 66) | 29 | STRUCT_DEF@[40; 66) |
30 | STRUCT_KW@[40; 46) "struct" | 30 | STRUCT_KW@[40; 46) "struct" |
@@ -48,7 +48,7 @@ SOURCE_FILE@[0; 106) | |||
48 | NAME_REF@[59; 64) | 48 | NAME_REF@[59; 64) |
49 | IDENT@[59; 64) "usize" | 49 | IDENT@[59; 64) "usize" |
50 | R_PAREN@[64; 65) ")" | 50 | R_PAREN@[64; 65) ")" |
51 | SEMI@[65; 66) ";" | 51 | SEMICOLON@[65; 66) ";" |
52 | WHITESPACE@[66; 67) "\n" | 52 | WHITESPACE@[66; 67) "\n" |
53 | STRUCT_DEF@[67; 105) | 53 | STRUCT_DEF@[67; 105) |
54 | STRUCT_KW@[67; 73) "struct" | 54 | STRUCT_KW@[67; 73) "struct" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast index c0cf48af5..79d193616 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0084_paren_type.rast | |||
@@ -15,5 +15,5 @@ SOURCE_FILE@[0; 16) | |||
15 | NAME_REF@[10; 13) | 15 | NAME_REF@[10; 13) |
16 | IDENT@[10; 13) "i32" | 16 | IDENT@[10; 13) "i32" |
17 | R_PAREN@[13; 14) ")" | 17 | R_PAREN@[13; 14) ")" |
18 | SEMI@[14; 15) ";" | 18 | SEMICOLON@[14; 15) ";" |
19 | WHITESPACE@[15; 16) "\n" | 19 | WHITESPACE@[15; 16) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast index 2903c6f9a..c2cec89b4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0085_expr_literals.rast | |||
@@ -22,7 +22,7 @@ SOURCE_FILE@[0; 189) | |||
22 | WHITESPACE@[22; 23) " " | 22 | WHITESPACE@[22; 23) " " |
23 | LITERAL@[23; 27) | 23 | LITERAL@[23; 27) |
24 | TRUE_KW@[23; 27) "true" | 24 | TRUE_KW@[23; 27) "true" |
25 | SEMI@[27; 28) ";" | 25 | SEMICOLON@[27; 28) ";" |
26 | WHITESPACE@[28; 33) "\n " | 26 | WHITESPACE@[28; 33) "\n " |
27 | LET_STMT@[33; 47) | 27 | LET_STMT@[33; 47) |
28 | LET_KW@[33; 36) "let" | 28 | LET_KW@[33; 36) "let" |
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 189) | |||
34 | WHITESPACE@[40; 41) " " | 34 | WHITESPACE@[40; 41) " " |
35 | LITERAL@[41; 46) | 35 | LITERAL@[41; 46) |
36 | FALSE_KW@[41; 46) "false" | 36 | FALSE_KW@[41; 46) "false" |
37 | SEMI@[46; 47) ";" | 37 | SEMICOLON@[46; 47) ";" |
38 | WHITESPACE@[47; 52) "\n " | 38 | WHITESPACE@[47; 52) "\n " |
39 | LET_STMT@[52; 62) | 39 | LET_STMT@[52; 62) |
40 | LET_KW@[52; 55) "let" | 40 | LET_KW@[52; 55) "let" |
@@ -46,7 +46,7 @@ SOURCE_FILE@[0; 189) | |||
46 | WHITESPACE@[59; 60) " " | 46 | WHITESPACE@[59; 60) " " |
47 | LITERAL@[60; 61) | 47 | LITERAL@[60; 61) |
48 | INT_NUMBER@[60; 61) "1" | 48 | INT_NUMBER@[60; 61) "1" |
49 | SEMI@[61; 62) ";" | 49 | SEMICOLON@[61; 62) ";" |
50 | WHITESPACE@[62; 67) "\n " | 50 | WHITESPACE@[62; 67) "\n " |
51 | LET_STMT@[67; 79) | 51 | LET_STMT@[67; 79) |
52 | LET_KW@[67; 70) "let" | 52 | LET_KW@[67; 70) "let" |
@@ -58,7 +58,7 @@ SOURCE_FILE@[0; 189) | |||
58 | WHITESPACE@[74; 75) " " | 58 | WHITESPACE@[74; 75) " " |
59 | LITERAL@[75; 78) | 59 | LITERAL@[75; 78) |
60 | FLOAT_NUMBER@[75; 78) "2.0" | 60 | FLOAT_NUMBER@[75; 78) "2.0" |
61 | SEMI@[78; 79) ";" | 61 | SEMICOLON@[78; 79) ";" |
62 | WHITESPACE@[79; 84) "\n " | 62 | WHITESPACE@[79; 84) "\n " |
63 | LET_STMT@[84; 97) | 63 | LET_STMT@[84; 97) |
64 | LET_KW@[84; 87) "let" | 64 | LET_KW@[84; 87) "let" |
@@ -70,7 +70,7 @@ SOURCE_FILE@[0; 189) | |||
70 | WHITESPACE@[91; 92) " " | 70 | WHITESPACE@[91; 92) " " |
71 | LITERAL@[92; 96) | 71 | LITERAL@[92; 96) |
72 | BYTE@[92; 96) "b\'a\'" | 72 | BYTE@[92; 96) "b\'a\'" |
73 | SEMI@[96; 97) ";" | 73 | SEMICOLON@[96; 97) ";" |
74 | WHITESPACE@[97; 102) "\n " | 74 | WHITESPACE@[97; 102) "\n " |
75 | LET_STMT@[102; 114) | 75 | LET_STMT@[102; 114) |
76 | LET_KW@[102; 105) "let" | 76 | LET_KW@[102; 105) "let" |
@@ -82,7 +82,7 @@ SOURCE_FILE@[0; 189) | |||
82 | WHITESPACE@[109; 110) " " | 82 | WHITESPACE@[109; 110) " " |
83 | LITERAL@[110; 113) | 83 | LITERAL@[110; 113) |
84 | CHAR@[110; 113) "\'b\'" | 84 | CHAR@[110; 113) "\'b\'" |
85 | SEMI@[113; 114) ";" | 85 | SEMICOLON@[113; 114) ";" |
86 | WHITESPACE@[114; 119) "\n " | 86 | WHITESPACE@[114; 119) "\n " |
87 | LET_STMT@[119; 131) | 87 | LET_STMT@[119; 131) |
88 | LET_KW@[119; 122) "let" | 88 | LET_KW@[119; 122) "let" |
@@ -94,7 +94,7 @@ SOURCE_FILE@[0; 189) | |||
94 | WHITESPACE@[126; 127) " " | 94 | WHITESPACE@[126; 127) " " |
95 | LITERAL@[127; 130) | 95 | LITERAL@[127; 130) |
96 | STRING@[127; 130) "\"c\"" | 96 | STRING@[127; 130) "\"c\"" |
97 | SEMI@[130; 131) ";" | 97 | SEMICOLON@[130; 131) ";" |
98 | WHITESPACE@[131; 136) "\n " | 98 | WHITESPACE@[131; 136) "\n " |
99 | LET_STMT@[136; 149) | 99 | LET_STMT@[136; 149) |
100 | LET_KW@[136; 139) "let" | 100 | LET_KW@[136; 139) "let" |
@@ -106,7 +106,7 @@ SOURCE_FILE@[0; 189) | |||
106 | WHITESPACE@[143; 144) " " | 106 | WHITESPACE@[143; 144) " " |
107 | LITERAL@[144; 148) | 107 | LITERAL@[144; 148) |
108 | RAW_STRING@[144; 148) "r\"d\"" | 108 | RAW_STRING@[144; 148) "r\"d\"" |
109 | SEMI@[148; 149) ";" | 109 | SEMICOLON@[148; 149) ";" |
110 | WHITESPACE@[149; 154) "\n " | 110 | WHITESPACE@[149; 154) "\n " |
111 | LET_STMT@[154; 167) | 111 | LET_STMT@[154; 167) |
112 | LET_KW@[154; 157) "let" | 112 | LET_KW@[154; 157) "let" |
@@ -118,7 +118,7 @@ SOURCE_FILE@[0; 189) | |||
118 | WHITESPACE@[161; 162) " " | 118 | WHITESPACE@[161; 162) " " |
119 | LITERAL@[162; 166) | 119 | LITERAL@[162; 166) |
120 | BYTE_STRING@[162; 166) "b\"e\"" | 120 | BYTE_STRING@[162; 166) "b\"e\"" |
121 | SEMI@[166; 167) ";" | 121 | SEMICOLON@[166; 167) ";" |
122 | WHITESPACE@[167; 172) "\n " | 122 | WHITESPACE@[167; 172) "\n " |
123 | LET_STMT@[172; 186) | 123 | LET_STMT@[172; 186) |
124 | LET_KW@[172; 175) "let" | 124 | LET_KW@[172; 175) "let" |
@@ -130,7 +130,7 @@ SOURCE_FILE@[0; 189) | |||
130 | WHITESPACE@[179; 180) " " | 130 | WHITESPACE@[179; 180) " " |
131 | LITERAL@[180; 185) | 131 | LITERAL@[180; 185) |
132 | RAW_BYTE_STRING@[180; 185) "br\"f\"" | 132 | RAW_BYTE_STRING@[180; 185) "br\"f\"" |
133 | SEMI@[185; 186) ";" | 133 | SEMICOLON@[185; 186) ";" |
134 | WHITESPACE@[186; 187) "\n" | 134 | WHITESPACE@[186; 187) "\n" |
135 | R_CURLY@[187; 188) "}" | 135 | R_CURLY@[187; 188) "}" |
136 | WHITESPACE@[188; 189) "\n" | 136 | WHITESPACE@[188; 189) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast index 8d2579cd6..1d7796449 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0090_type_param_default.rast | |||
@@ -18,5 +18,5 @@ SOURCE_FILE@[0; 19) | |||
18 | NAME_REF@[13; 16) | 18 | NAME_REF@[13; 16) |
19 | IDENT@[13; 16) "i32" | 19 | IDENT@[13; 16) "i32" |
20 | R_ANGLE@[16; 17) ">" | 20 | R_ANGLE@[16; 17) ">" |
21 | SEMI@[17; 18) ";" | 21 | SEMICOLON@[17; 18) ";" |
22 | WHITESPACE@[18; 19) "\n" | 22 | WHITESPACE@[18; 19) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast index fae822367..db6013c6f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0092_fn_pointer_type_with_ret.rast | |||
@@ -19,5 +19,5 @@ SOURCE_FILE@[0; 21) | |||
19 | TUPLE_TYPE@[17; 19) | 19 | TUPLE_TYPE@[17; 19) |
20 | L_PAREN@[17; 18) "(" | 20 | L_PAREN@[17; 18) "(" |
21 | R_PAREN@[18; 19) ")" | 21 | R_PAREN@[18; 19) ")" |
22 | SEMI@[19; 20) ";" | 22 | SEMICOLON@[19; 20) ";" |
23 | WHITESPACE@[20; 21) "\n" | 23 | WHITESPACE@[20; 21) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast index 1a979e597..118cfc096 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0093_index_expr.rast | |||
@@ -28,7 +28,7 @@ SOURCE_FILE@[0; 26) | |||
28 | LITERAL@[20; 21) | 28 | LITERAL@[20; 21) |
29 | INT_NUMBER@[20; 21) "2" | 29 | INT_NUMBER@[20; 21) "2" |
30 | R_BRACK@[21; 22) "]" | 30 | R_BRACK@[21; 22) "]" |
31 | SEMI@[22; 23) ";" | 31 | SEMICOLON@[22; 23) ";" |
32 | WHITESPACE@[23; 24) "\n" | 32 | WHITESPACE@[23; 24) "\n" |
33 | R_CURLY@[24; 25) "}" | 33 | R_CURLY@[24; 25) "}" |
34 | WHITESPACE@[25; 26) "\n" | 34 | WHITESPACE@[25; 26) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast index fe86894a9..ebe7816a4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0095_placeholder_pat.rast | |||
@@ -23,7 +23,7 @@ SOURCE_FILE@[0; 26) | |||
23 | TUPLE_EXPR@[20; 22) | 23 | TUPLE_EXPR@[20; 22) |
24 | L_PAREN@[20; 21) "(" | 24 | L_PAREN@[20; 21) "(" |
25 | R_PAREN@[21; 22) ")" | 25 | R_PAREN@[21; 22) ")" |
26 | SEMI@[22; 23) ";" | 26 | SEMICOLON@[22; 23) ";" |
27 | WHITESPACE@[23; 24) " " | 27 | WHITESPACE@[23; 24) " " |
28 | R_CURLY@[24; 25) "}" | 28 | R_CURLY@[24; 25) "}" |
29 | 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.rast b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast index 157aa29f5..6bd6f5a6b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0096_no_semi_after_block.rast | |||
@@ -95,7 +95,7 @@ SOURCE_FILE@[0; 167) | |||
95 | PATH_SEGMENT@[109; 120) | 95 | PATH_SEGMENT@[109; 120) |
96 | NAME_REF@[109; 120) | 96 | NAME_REF@[109; 120) |
97 | IDENT@[109; 120) "macro_rules" | 97 | IDENT@[109; 120) "macro_rules" |
98 | EXCL@[120; 121) "!" | 98 | BANG@[120; 121) "!" |
99 | WHITESPACE@[121; 122) " " | 99 | WHITESPACE@[121; 122) " " |
100 | NAME@[122; 126) | 100 | NAME@[122; 126) |
101 | IDENT@[122; 126) "test" | 101 | IDENT@[122; 126) "test" |
@@ -121,7 +121,7 @@ SOURCE_FILE@[0; 167) | |||
121 | PATH_SEGMENT@[157; 161) | 121 | PATH_SEGMENT@[157; 161) |
122 | NAME_REF@[157; 161) | 122 | NAME_REF@[157; 161) |
123 | IDENT@[157; 161) "test" | 123 | IDENT@[157; 161) "test" |
124 | EXCL@[161; 162) "!" | 124 | BANG@[161; 162) "!" |
125 | TOKEN_TREE@[162; 164) | 125 | TOKEN_TREE@[162; 164) |
126 | L_CURLY@[162; 163) "{" | 126 | L_CURLY@[162; 163) "{" |
127 | R_CURLY@[163; 164) "}" | 127 | R_CURLY@[163; 164) "}" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast index 83c58d25f..d25f087a5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0100_for_expr.rast | |||
@@ -30,7 +30,7 @@ SOURCE_FILE@[0; 33) | |||
30 | BLOCK@[27; 29) | 30 | BLOCK@[27; 29) |
31 | L_CURLY@[27; 28) "{" | 31 | L_CURLY@[27; 28) "{" |
32 | R_CURLY@[28; 29) "}" | 32 | R_CURLY@[28; 29) "}" |
33 | SEMI@[29; 30) ";" | 33 | SEMICOLON@[29; 30) ";" |
34 | WHITESPACE@[30; 31) "\n" | 34 | WHITESPACE@[30; 31) "\n" |
35 | R_CURLY@[31; 32) "}" | 35 | R_CURLY@[31; 32) "}" |
36 | WHITESPACE@[32; 33) "\n" | 36 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast index d8e04bd90..c2614543c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0102_record_field_pat_list.rast | |||
@@ -30,7 +30,7 @@ SOURCE_FILE@[0; 119) | |||
30 | TUPLE_EXPR@[26; 28) | 30 | TUPLE_EXPR@[26; 28) |
31 | L_PAREN@[26; 27) "(" | 31 | L_PAREN@[26; 27) "(" |
32 | R_PAREN@[27; 28) ")" | 32 | R_PAREN@[27; 28) ")" |
33 | SEMI@[28; 29) ";" | 33 | SEMICOLON@[28; 29) ";" |
34 | WHITESPACE@[29; 34) "\n " | 34 | WHITESPACE@[29; 34) "\n " |
35 | LET_STMT@[34; 62) | 35 | LET_STMT@[34; 62) |
36 | LET_KW@[34; 37) "let" | 36 | LET_KW@[34; 37) "let" |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 119) | |||
64 | TUPLE_EXPR@[59; 61) | 64 | TUPLE_EXPR@[59; 61) |
65 | L_PAREN@[59; 60) "(" | 65 | L_PAREN@[59; 60) "(" |
66 | R_PAREN@[60; 61) ")" | 66 | R_PAREN@[60; 61) ")" |
67 | SEMI@[61; 62) ";" | 67 | SEMICOLON@[61; 62) ";" |
68 | WHITESPACE@[62; 67) "\n " | 68 | WHITESPACE@[62; 67) "\n " |
69 | LET_STMT@[67; 90) | 69 | LET_STMT@[67; 90) |
70 | LET_KW@[67; 70) "let" | 70 | LET_KW@[67; 70) "let" |
@@ -87,7 +87,7 @@ SOURCE_FILE@[0; 119) | |||
87 | UNDERSCORE@[78; 79) "_" | 87 | UNDERSCORE@[78; 79) "_" |
88 | COMMA@[79; 80) "," | 88 | COMMA@[79; 80) "," |
89 | WHITESPACE@[80; 81) " " | 89 | WHITESPACE@[80; 81) " " |
90 | DOTDOT@[81; 83) ".." | 90 | DOT2@[81; 83) ".." |
91 | R_CURLY@[83; 84) "}" | 91 | R_CURLY@[83; 84) "}" |
92 | WHITESPACE@[84; 85) " " | 92 | WHITESPACE@[84; 85) " " |
93 | EQ@[85; 86) "=" | 93 | EQ@[85; 86) "=" |
@@ -95,7 +95,7 @@ SOURCE_FILE@[0; 119) | |||
95 | TUPLE_EXPR@[87; 89) | 95 | TUPLE_EXPR@[87; 89) |
96 | L_PAREN@[87; 88) "(" | 96 | L_PAREN@[87; 88) "(" |
97 | R_PAREN@[88; 89) ")" | 97 | R_PAREN@[88; 89) ")" |
98 | SEMI@[89; 90) ";" | 98 | SEMICOLON@[89; 90) ";" |
99 | WHITESPACE@[90; 95) "\n " | 99 | WHITESPACE@[90; 95) "\n " |
100 | LET_STMT@[95; 116) | 100 | LET_STMT@[95; 116) |
101 | LET_KW@[95; 98) "let" | 101 | LET_KW@[95; 98) "let" |
@@ -125,7 +125,7 @@ SOURCE_FILE@[0; 119) | |||
125 | TUPLE_EXPR@[113; 115) | 125 | TUPLE_EXPR@[113; 115) |
126 | L_PAREN@[113; 114) "(" | 126 | L_PAREN@[113; 114) "(" |
127 | R_PAREN@[114; 115) ")" | 127 | R_PAREN@[114; 115) ")" |
128 | SEMI@[115; 116) ";" | 128 | SEMICOLON@[115; 116) ";" |
129 | WHITESPACE@[116; 117) "\n" | 129 | WHITESPACE@[116; 117) "\n" |
130 | R_CURLY@[117; 118) "}" | 130 | R_CURLY@[117; 118) "}" |
131 | WHITESPACE@[118; 119) "\n" | 131 | WHITESPACE@[118; 119) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast index 0db62a1f5..60fbf2771 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0103_array_expr.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@[0; 55) | |||
16 | ARRAY_EXPR@[15; 17) | 16 | ARRAY_EXPR@[15; 17) |
17 | L_BRACK@[15; 16) "[" | 17 | L_BRACK@[15; 16) "[" |
18 | R_BRACK@[16; 17) "]" | 18 | R_BRACK@[16; 17) "]" |
19 | SEMI@[17; 18) ";" | 19 | SEMICOLON@[17; 18) ";" |
20 | WHITESPACE@[18; 23) "\n " | 20 | WHITESPACE@[18; 23) "\n " |
21 | EXPR_STMT@[23; 27) | 21 | EXPR_STMT@[23; 27) |
22 | ARRAY_EXPR@[23; 26) | 22 | ARRAY_EXPR@[23; 26) |
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 55) | |||
24 | LITERAL@[24; 25) | 24 | LITERAL@[24; 25) |
25 | INT_NUMBER@[24; 25) "1" | 25 | INT_NUMBER@[24; 25) "1" |
26 | R_BRACK@[25; 26) "]" | 26 | R_BRACK@[25; 26) "]" |
27 | SEMI@[26; 27) ";" | 27 | SEMICOLON@[26; 27) ";" |
28 | WHITESPACE@[27; 32) "\n " | 28 | WHITESPACE@[27; 32) "\n " |
29 | EXPR_STMT@[32; 40) | 29 | EXPR_STMT@[32; 40) |
30 | ARRAY_EXPR@[32; 39) | 30 | ARRAY_EXPR@[32; 39) |
@@ -37,19 +37,19 @@ SOURCE_FILE@[0; 55) | |||
37 | INT_NUMBER@[36; 37) "2" | 37 | INT_NUMBER@[36; 37) "2" |
38 | COMMA@[37; 38) "," | 38 | COMMA@[37; 38) "," |
39 | R_BRACK@[38; 39) "]" | 39 | R_BRACK@[38; 39) "]" |
40 | SEMI@[39; 40) ";" | 40 | SEMICOLON@[39; 40) ";" |
41 | WHITESPACE@[40; 45) "\n " | 41 | WHITESPACE@[40; 45) "\n " |
42 | EXPR_STMT@[45; 52) | 42 | EXPR_STMT@[45; 52) |
43 | ARRAY_EXPR@[45; 51) | 43 | ARRAY_EXPR@[45; 51) |
44 | L_BRACK@[45; 46) "[" | 44 | L_BRACK@[45; 46) "[" |
45 | LITERAL@[46; 47) | 45 | LITERAL@[46; 47) |
46 | INT_NUMBER@[46; 47) "1" | 46 | INT_NUMBER@[46; 47) "1" |
47 | SEMI@[47; 48) ";" | 47 | SEMICOLON@[47; 48) ";" |
48 | WHITESPACE@[48; 49) " " | 48 | WHITESPACE@[48; 49) " " |
49 | LITERAL@[49; 50) | 49 | LITERAL@[49; 50) |
50 | INT_NUMBER@[49; 50) "2" | 50 | INT_NUMBER@[49; 50) "2" |
51 | R_BRACK@[50; 51) "]" | 51 | R_BRACK@[50; 51) "]" |
52 | SEMI@[51; 52) ";" | 52 | SEMICOLON@[51; 52) ";" |
53 | WHITESPACE@[52; 53) "\n" | 53 | WHITESPACE@[52; 53) "\n" |
54 | R_CURLY@[53; 54) "}" | 54 | R_CURLY@[53; 54) "}" |
55 | WHITESPACE@[54; 55) "\n" | 55 | WHITESPACE@[54; 55) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast index a983d5954..d65c75c65 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0104_path_fn_trait_args.rast | |||
@@ -37,5 +37,5 @@ SOURCE_FILE@[0; 29) | |||
37 | L_PAREN@[24; 25) "(" | 37 | L_PAREN@[24; 25) "(" |
38 | R_PAREN@[25; 26) ")" | 38 | R_PAREN@[25; 26) ")" |
39 | R_ANGLE@[26; 27) ">" | 39 | R_ANGLE@[26; 27) ">" |
40 | SEMI@[27; 28) ";" | 40 | SEMICOLON@[27; 28) ";" |
41 | WHITESPACE@[28; 29) "\n" | 41 | WHITESPACE@[28; 29) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rast index 6bce37a4f..5635cba9b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0105_block_expr.rast | |||
@@ -17,7 +17,7 @@ SOURCE_FILE@[0; 52) | |||
17 | BLOCK@[15; 17) | 17 | BLOCK@[15; 17) |
18 | L_CURLY@[15; 16) "{" | 18 | L_CURLY@[15; 16) "{" |
19 | R_CURLY@[16; 17) "}" | 19 | R_CURLY@[16; 17) "}" |
20 | SEMI@[17; 18) ";" | 20 | SEMICOLON@[17; 18) ";" |
21 | WHITESPACE@[18; 23) "\n " | 21 | WHITESPACE@[18; 23) "\n " |
22 | EXPR_STMT@[23; 33) | 22 | EXPR_STMT@[23; 33) |
23 | BLOCK_EXPR@[23; 32) | 23 | BLOCK_EXPR@[23; 32) |
@@ -26,7 +26,7 @@ SOURCE_FILE@[0; 52) | |||
26 | BLOCK@[30; 32) | 26 | BLOCK@[30; 32) |
27 | L_CURLY@[30; 31) "{" | 27 | L_CURLY@[30; 31) "{" |
28 | R_CURLY@[31; 32) "}" | 28 | R_CURLY@[31; 32) "}" |
29 | SEMI@[32; 33) ";" | 29 | SEMICOLON@[32; 33) ";" |
30 | WHITESPACE@[33; 38) "\n " | 30 | WHITESPACE@[33; 38) "\n " |
31 | EXPR_STMT@[38; 49) | 31 | EXPR_STMT@[38; 49) |
32 | BLOCK_EXPR@[38; 48) | 32 | BLOCK_EXPR@[38; 48) |
@@ -37,7 +37,7 @@ SOURCE_FILE@[0; 52) | |||
37 | BLOCK@[46; 48) | 37 | BLOCK@[46; 48) |
38 | L_CURLY@[46; 47) "{" | 38 | L_CURLY@[46; 47) "{" |
39 | R_CURLY@[47; 48) "}" | 39 | R_CURLY@[47; 48) "}" |
40 | SEMI@[48; 49) ";" | 40 | SEMICOLON@[48; 49) ";" |
41 | WHITESPACE@[49; 50) "\n" | 41 | WHITESPACE@[49; 50) "\n" |
42 | R_CURLY@[50; 51) "}" | 42 | R_CURLY@[50; 51) "}" |
43 | WHITESPACE@[51; 52) "\n" | 43 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast index 0216123f0..157dfcdb8 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0106_lambda_expr.rast | |||
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 134) | |||
21 | TUPLE_EXPR@[18; 20) | 21 | TUPLE_EXPR@[18; 20) |
22 | L_PAREN@[18; 19) "(" | 22 | L_PAREN@[18; 19) "(" |
23 | R_PAREN@[19; 20) ")" | 23 | R_PAREN@[19; 20) ")" |
24 | SEMI@[20; 21) ";" | 24 | SEMICOLON@[20; 21) ";" |
25 | WHITESPACE@[21; 26) "\n " | 25 | WHITESPACE@[21; 26) "\n " |
26 | EXPR_STMT@[26; 43) | 26 | EXPR_STMT@[26; 43) |
27 | LAMBDA_EXPR@[26; 42) | 27 | LAMBDA_EXPR@[26; 42) |
@@ -46,7 +46,7 @@ SOURCE_FILE@[0; 134) | |||
46 | INT_NUMBER@[38; 40) "92" | 46 | INT_NUMBER@[38; 40) "92" |
47 | WHITESPACE@[40; 41) " " | 47 | WHITESPACE@[40; 41) " " |
48 | R_CURLY@[41; 42) "}" | 48 | R_CURLY@[41; 42) "}" |
49 | SEMI@[42; 43) ";" | 49 | SEMICOLON@[42; 43) ";" |
50 | WHITESPACE@[43; 48) "\n " | 50 | WHITESPACE@[43; 48) "\n " |
51 | EXPR_STMT@[48; 54) | 51 | EXPR_STMT@[48; 54) |
52 | LAMBDA_EXPR@[48; 53) | 52 | LAMBDA_EXPR@[48; 53) |
@@ -63,7 +63,7 @@ SOURCE_FILE@[0; 134) | |||
63 | PATH_SEGMENT@[52; 53) | 63 | PATH_SEGMENT@[52; 53) |
64 | NAME_REF@[52; 53) | 64 | NAME_REF@[52; 53) |
65 | IDENT@[52; 53) "x" | 65 | IDENT@[52; 53) "x" |
66 | SEMI@[53; 54) ";" | 66 | SEMICOLON@[53; 54) ";" |
67 | WHITESPACE@[54; 59) "\n " | 67 | WHITESPACE@[54; 59) "\n " |
68 | EXPR_STMT@[59; 76) | 68 | EXPR_STMT@[59; 76) |
69 | LAMBDA_EXPR@[59; 75) | 69 | LAMBDA_EXPR@[59; 75) |
@@ -90,7 +90,7 @@ SOURCE_FILE@[0; 134) | |||
90 | PATH_SEGMENT@[74; 75) | 90 | PATH_SEGMENT@[74; 75) |
91 | NAME_REF@[74; 75) | 91 | NAME_REF@[74; 75) |
92 | IDENT@[74; 75) "x" | 92 | IDENT@[74; 75) "x" |
93 | SEMI@[75; 76) ";" | 93 | SEMICOLON@[75; 76) ";" |
94 | WHITESPACE@[76; 81) "\n " | 94 | WHITESPACE@[76; 81) "\n " |
95 | EXPR_STMT@[81; 93) | 95 | EXPR_STMT@[81; 93) |
96 | LAMBDA_EXPR@[81; 92) | 96 | LAMBDA_EXPR@[81; 92) |
@@ -104,7 +104,7 @@ SOURCE_FILE@[0; 134) | |||
104 | BLOCK@[90; 92) | 104 | BLOCK@[90; 92) |
105 | L_CURLY@[90; 91) "{" | 105 | L_CURLY@[90; 91) "{" |
106 | R_CURLY@[91; 92) "}" | 106 | R_CURLY@[91; 92) "}" |
107 | SEMI@[92; 93) ";" | 107 | SEMICOLON@[92; 93) ";" |
108 | WHITESPACE@[93; 98) "\n " | 108 | WHITESPACE@[93; 98) "\n " |
109 | EXPR_STMT@[98; 109) | 109 | EXPR_STMT@[98; 109) |
110 | LAMBDA_EXPR@[98; 108) | 110 | LAMBDA_EXPR@[98; 108) |
@@ -118,7 +118,7 @@ SOURCE_FILE@[0; 134) | |||
118 | BLOCK@[106; 108) | 118 | BLOCK@[106; 108) |
119 | L_CURLY@[106; 107) "{" | 119 | L_CURLY@[106; 107) "{" |
120 | R_CURLY@[107; 108) "}" | 120 | R_CURLY@[107; 108) "}" |
121 | SEMI@[108; 109) ";" | 121 | SEMICOLON@[108; 109) ";" |
122 | WHITESPACE@[109; 114) "\n " | 122 | WHITESPACE@[109; 114) "\n " |
123 | EXPR_STMT@[114; 131) | 123 | EXPR_STMT@[114; 131) |
124 | LAMBDA_EXPR@[114; 130) | 124 | LAMBDA_EXPR@[114; 130) |
@@ -134,7 +134,7 @@ SOURCE_FILE@[0; 134) | |||
134 | BLOCK@[128; 130) | 134 | BLOCK@[128; 130) |
135 | L_CURLY@[128; 129) "{" | 135 | L_CURLY@[128; 129) "{" |
136 | R_CURLY@[129; 130) "}" | 136 | R_CURLY@[129; 130) "}" |
137 | SEMI@[130; 131) ";" | 137 | SEMICOLON@[130; 131) ";" |
138 | WHITESPACE@[131; 132) "\n" | 138 | WHITESPACE@[131; 132) "\n" |
139 | R_CURLY@[132; 133) "}" | 139 | R_CURLY@[132; 133) "}" |
140 | WHITESPACE@[133; 134) "\n" | 140 | WHITESPACE@[133; 134) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast index ba478528c..cc813038c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0107_method_call_expr.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 49) | |||
25 | ARG_LIST@[20; 22) | 25 | ARG_LIST@[20; 22) |
26 | L_PAREN@[20; 21) "(" | 26 | L_PAREN@[20; 21) "(" |
27 | R_PAREN@[21; 22) ")" | 27 | R_PAREN@[21; 22) ")" |
28 | SEMI@[22; 23) ";" | 28 | SEMICOLON@[22; 23) ";" |
29 | WHITESPACE@[23; 28) "\n " | 29 | WHITESPACE@[23; 28) "\n " |
30 | EXPR_STMT@[28; 46) | 30 | EXPR_STMT@[28; 46) |
31 | METHOD_CALL_EXPR@[28; 45) | 31 | METHOD_CALL_EXPR@[28; 45) |
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 49) | |||
38 | NAME_REF@[30; 33) | 38 | NAME_REF@[30; 33) |
39 | IDENT@[30; 33) "bar" | 39 | IDENT@[30; 33) "bar" |
40 | TYPE_ARG_LIST@[33; 38) | 40 | TYPE_ARG_LIST@[33; 38) |
41 | COLONCOLON@[33; 35) "::" | 41 | COLON2@[33; 35) "::" |
42 | L_ANGLE@[35; 36) "<" | 42 | L_ANGLE@[35; 36) "<" |
43 | TYPE_ARG@[36; 37) | 43 | TYPE_ARG@[36; 37) |
44 | PATH_TYPE@[36; 37) | 44 | PATH_TYPE@[36; 37) |
@@ -57,7 +57,7 @@ SOURCE_FILE@[0; 49) | |||
57 | INT_NUMBER@[42; 43) "2" | 57 | INT_NUMBER@[42; 43) "2" |
58 | COMMA@[43; 44) "," | 58 | COMMA@[43; 44) "," |
59 | R_PAREN@[44; 45) ")" | 59 | R_PAREN@[44; 45) ")" |
60 | SEMI@[45; 46) ";" | 60 | SEMICOLON@[45; 46) ";" |
61 | WHITESPACE@[46; 47) "\n" | 61 | WHITESPACE@[46; 47) "\n" |
62 | R_CURLY@[47; 48) "}" | 62 | R_CURLY@[47; 48) "}" |
63 | WHITESPACE@[48; 49) "\n" | 63 | WHITESPACE@[48; 49) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast index 6f685ca8d..27c3f398e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0108_tuple_expr.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@[0; 40) | |||
16 | TUPLE_EXPR@[15; 17) | 16 | TUPLE_EXPR@[15; 17) |
17 | L_PAREN@[15; 16) "(" | 17 | L_PAREN@[15; 16) "(" |
18 | R_PAREN@[16; 17) ")" | 18 | R_PAREN@[16; 17) ")" |
19 | SEMI@[17; 18) ";" | 19 | SEMICOLON@[17; 18) ";" |
20 | WHITESPACE@[18; 23) "\n " | 20 | WHITESPACE@[18; 23) "\n " |
21 | EXPR_STMT@[23; 27) | 21 | EXPR_STMT@[23; 27) |
22 | PAREN_EXPR@[23; 26) | 22 | PAREN_EXPR@[23; 26) |
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 40) | |||
24 | LITERAL@[24; 25) | 24 | LITERAL@[24; 25) |
25 | INT_NUMBER@[24; 25) "1" | 25 | INT_NUMBER@[24; 25) "1" |
26 | R_PAREN@[25; 26) ")" | 26 | R_PAREN@[25; 26) ")" |
27 | SEMI@[26; 27) ";" | 27 | SEMICOLON@[26; 27) ";" |
28 | WHITESPACE@[27; 32) "\n " | 28 | WHITESPACE@[27; 32) "\n " |
29 | EXPR_STMT@[32; 37) | 29 | EXPR_STMT@[32; 37) |
30 | TUPLE_EXPR@[32; 36) | 30 | TUPLE_EXPR@[32; 36) |
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 40) | |||
33 | INT_NUMBER@[33; 34) "1" | 33 | INT_NUMBER@[33; 34) "1" |
34 | COMMA@[34; 35) "," | 34 | COMMA@[34; 35) "," |
35 | R_PAREN@[35; 36) ")" | 35 | R_PAREN@[35; 36) ")" |
36 | SEMI@[36; 37) ";" | 36 | SEMICOLON@[36; 37) ";" |
37 | WHITESPACE@[37; 38) "\n" | 37 | WHITESPACE@[37; 38) "\n" |
38 | R_CURLY@[38; 39) "}" | 38 | R_CURLY@[38; 39) "}" |
39 | WHITESPACE@[39; 40) "\n" | 39 | WHITESPACE@[39; 40) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rast index 7dbcd3927..d4f5737d5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0110_use_path.rast | |||
@@ -5,10 +5,10 @@ SOURCE_FILE@[0; 154) | |||
5 | USE_TREE@[4; 16) | 5 | USE_TREE@[4; 16) |
6 | PATH@[4; 16) | 6 | PATH@[4; 16) |
7 | PATH_SEGMENT@[4; 16) | 7 | PATH_SEGMENT@[4; 16) |
8 | COLONCOLON@[4; 6) "::" | 8 | COLON2@[4; 6) "::" |
9 | NAME_REF@[6; 16) | 9 | NAME_REF@[6; 16) |
10 | IDENT@[6; 16) "crate_name" | 10 | IDENT@[6; 16) "crate_name" |
11 | SEMI@[16; 17) ";" | 11 | SEMICOLON@[16; 17) ";" |
12 | WHITESPACE@[17; 18) " " | 12 | WHITESPACE@[17; 18) " " |
13 | COMMENT@[18; 45) "// Rust 2018 - All fl ..." | 13 | COMMENT@[18; 45) "// Rust 2018 - All fl ..." |
14 | WHITESPACE@[45; 46) "\n" | 14 | WHITESPACE@[45; 46) "\n" |
@@ -20,7 +20,7 @@ SOURCE_FILE@[0; 154) | |||
20 | PATH_SEGMENT@[50; 60) | 20 | PATH_SEGMENT@[50; 60) |
21 | NAME_REF@[50; 60) | 21 | NAME_REF@[50; 60) |
22 | IDENT@[50; 60) "crate_name" | 22 | IDENT@[50; 60) "crate_name" |
23 | SEMI@[60; 61) ";" | 23 | SEMICOLON@[60; 61) ";" |
24 | WHITESPACE@[61; 62) " " | 24 | WHITESPACE@[61; 62) " " |
25 | COMMENT@[62; 91) "// Rust 2018 - Anchor ..." | 25 | COMMENT@[62; 91) "// Rust 2018 - Anchor ..." |
26 | WHITESPACE@[91; 92) "\n" | 26 | WHITESPACE@[91; 92) "\n" |
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 154) | |||
32 | PATH_SEGMENT@[96; 123) | 32 | PATH_SEGMENT@[96; 123) |
33 | NAME_REF@[96; 123) | 33 | NAME_REF@[96; 123) |
34 | IDENT@[96; 123) "item_in_scope_or_crat ..." | 34 | IDENT@[96; 123) "item_in_scope_or_crat ..." |
35 | SEMI@[123; 124) ";" | 35 | SEMICOLON@[123; 124) ";" |
36 | WHITESPACE@[124; 125) " " | 36 | WHITESPACE@[124; 125) " " |
37 | COMMENT@[125; 153) "// Rust 2018 - Unifor ..." | 37 | COMMENT@[125; 153) "// Rust 2018 - Unifor ..." |
38 | WHITESPACE@[153; 154) "\n" | 38 | WHITESPACE@[153; 154) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast index 4680c267e..88e72d057 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0111_tuple_pat.rast | |||
@@ -28,7 +28,7 @@ SOURCE_FILE@[0; 94) | |||
28 | COMMA@[25; 26) "," | 28 | COMMA@[25; 26) "," |
29 | WHITESPACE@[26; 27) " " | 29 | WHITESPACE@[26; 27) " " |
30 | DOT_DOT_PAT@[27; 29) | 30 | DOT_DOT_PAT@[27; 29) |
31 | DOTDOT@[27; 29) ".." | 31 | DOT2@[27; 29) ".." |
32 | R_PAREN@[29; 30) ")" | 32 | R_PAREN@[29; 30) ")" |
33 | WHITESPACE@[30; 31) " " | 33 | WHITESPACE@[30; 31) " " |
34 | EQ@[31; 32) "=" | 34 | EQ@[31; 32) "=" |
@@ -36,7 +36,7 @@ SOURCE_FILE@[0; 94) | |||
36 | TUPLE_EXPR@[33; 35) | 36 | TUPLE_EXPR@[33; 35) |
37 | L_PAREN@[33; 34) "(" | 37 | L_PAREN@[33; 34) "(" |
38 | R_PAREN@[34; 35) ")" | 38 | R_PAREN@[34; 35) ")" |
39 | SEMI@[35; 36) ";" | 39 | SEMICOLON@[35; 36) ";" |
40 | WHITESPACE@[36; 41) "\n " | 40 | WHITESPACE@[36; 41) "\n " |
41 | LET_STMT@[41; 55) | 41 | LET_STMT@[41; 55) |
42 | LET_KW@[41; 44) "let" | 42 | LET_KW@[41; 44) "let" |
@@ -54,7 +54,7 @@ SOURCE_FILE@[0; 94) | |||
54 | TUPLE_EXPR@[52; 54) | 54 | TUPLE_EXPR@[52; 54) |
55 | L_PAREN@[52; 53) "(" | 55 | L_PAREN@[52; 53) "(" |
56 | R_PAREN@[53; 54) ")" | 56 | R_PAREN@[53; 54) ")" |
57 | SEMI@[54; 55) ";" | 57 | SEMICOLON@[54; 55) ";" |
58 | WHITESPACE@[55; 60) "\n " | 58 | WHITESPACE@[55; 60) "\n " |
59 | LET_STMT@[60; 74) | 59 | LET_STMT@[60; 74) |
60 | LET_KW@[60; 63) "let" | 60 | LET_KW@[60; 63) "let" |
@@ -62,7 +62,7 @@ SOURCE_FILE@[0; 94) | |||
62 | TUPLE_PAT@[64; 68) | 62 | TUPLE_PAT@[64; 68) |
63 | L_PAREN@[64; 65) "(" | 63 | L_PAREN@[64; 65) "(" |
64 | DOT_DOT_PAT@[65; 67) | 64 | DOT_DOT_PAT@[65; 67) |
65 | DOTDOT@[65; 67) ".." | 65 | DOT2@[65; 67) ".." |
66 | R_PAREN@[67; 68) ")" | 66 | R_PAREN@[67; 68) ")" |
67 | WHITESPACE@[68; 69) " " | 67 | WHITESPACE@[68; 69) " " |
68 | EQ@[69; 70) "=" | 68 | EQ@[69; 70) "=" |
@@ -70,7 +70,7 @@ SOURCE_FILE@[0; 94) | |||
70 | TUPLE_EXPR@[71; 73) | 70 | TUPLE_EXPR@[71; 73) |
71 | L_PAREN@[71; 72) "(" | 71 | L_PAREN@[71; 72) "(" |
72 | R_PAREN@[72; 73) ")" | 72 | R_PAREN@[72; 73) ")" |
73 | SEMI@[73; 74) ";" | 73 | SEMICOLON@[73; 74) ";" |
74 | WHITESPACE@[74; 79) "\n " | 74 | WHITESPACE@[74; 79) "\n " |
75 | LET_STMT@[79; 91) | 75 | LET_STMT@[79; 91) |
76 | LET_KW@[79; 82) "let" | 76 | LET_KW@[79; 82) "let" |
@@ -84,7 +84,7 @@ SOURCE_FILE@[0; 94) | |||
84 | TUPLE_EXPR@[88; 90) | 84 | TUPLE_EXPR@[88; 90) |
85 | L_PAREN@[88; 89) "(" | 85 | L_PAREN@[88; 89) "(" |
86 | R_PAREN@[89; 90) ")" | 86 | R_PAREN@[89; 90) ")" |
87 | SEMI@[90; 91) ";" | 87 | SEMICOLON@[90; 91) ";" |
88 | WHITESPACE@[91; 92) "\n" | 88 | WHITESPACE@[91; 92) "\n" |
89 | R_CURLY@[92; 93) "}" | 89 | R_CURLY@[92; 93) "}" |
90 | WHITESPACE@[93; 94) "\n" | 90 | WHITESPACE@[93; 94) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast index ad1d47b0e..5e8f625dc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0112_bind_pat.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 146) | |||
24 | TUPLE_EXPR@[24; 26) | 24 | TUPLE_EXPR@[24; 26) |
25 | L_PAREN@[24; 25) "(" | 25 | L_PAREN@[24; 25) "(" |
26 | R_PAREN@[25; 26) ")" | 26 | R_PAREN@[25; 26) ")" |
27 | SEMI@[26; 27) ";" | 27 | SEMICOLON@[26; 27) ";" |
28 | WHITESPACE@[27; 32) "\n " | 28 | WHITESPACE@[27; 32) "\n " |
29 | LET_STMT@[32; 47) | 29 | LET_STMT@[32; 47) |
30 | LET_KW@[32; 35) "let" | 30 | LET_KW@[32; 35) "let" |
@@ -40,7 +40,7 @@ SOURCE_FILE@[0; 146) | |||
40 | TUPLE_EXPR@[44; 46) | 40 | TUPLE_EXPR@[44; 46) |
41 | L_PAREN@[44; 45) "(" | 41 | L_PAREN@[44; 45) "(" |
42 | R_PAREN@[45; 46) ")" | 42 | R_PAREN@[45; 46) ")" |
43 | SEMI@[46; 47) ";" | 43 | SEMICOLON@[46; 47) ";" |
44 | WHITESPACE@[47; 52) "\n " | 44 | WHITESPACE@[47; 52) "\n " |
45 | LET_STMT@[52; 67) | 45 | LET_STMT@[52; 67) |
46 | LET_KW@[52; 55) "let" | 46 | LET_KW@[52; 55) "let" |
@@ -56,7 +56,7 @@ SOURCE_FILE@[0; 146) | |||
56 | TUPLE_EXPR@[64; 66) | 56 | TUPLE_EXPR@[64; 66) |
57 | L_PAREN@[64; 65) "(" | 57 | L_PAREN@[64; 65) "(" |
58 | R_PAREN@[65; 66) ")" | 58 | R_PAREN@[65; 66) ")" |
59 | SEMI@[66; 67) ";" | 59 | SEMICOLON@[66; 67) ";" |
60 | WHITESPACE@[67; 72) "\n " | 60 | WHITESPACE@[67; 72) "\n " |
61 | LET_STMT@[72; 91) | 61 | LET_STMT@[72; 91) |
62 | LET_KW@[72; 75) "let" | 62 | LET_KW@[72; 75) "let" |
@@ -74,7 +74,7 @@ SOURCE_FILE@[0; 146) | |||
74 | TUPLE_EXPR@[88; 90) | 74 | TUPLE_EXPR@[88; 90) |
75 | L_PAREN@[88; 89) "(" | 75 | L_PAREN@[88; 89) "(" |
76 | R_PAREN@[89; 90) ")" | 76 | R_PAREN@[89; 90) ")" |
77 | SEMI@[90; 91) ";" | 77 | SEMICOLON@[90; 91) ";" |
78 | WHITESPACE@[91; 96) "\n " | 78 | WHITESPACE@[91; 96) "\n " |
79 | LET_STMT@[96; 111) | 79 | LET_STMT@[96; 111) |
80 | LET_KW@[96; 99) "let" | 80 | LET_KW@[96; 99) "let" |
@@ -93,7 +93,7 @@ SOURCE_FILE@[0; 146) | |||
93 | TUPLE_EXPR@[108; 110) | 93 | TUPLE_EXPR@[108; 110) |
94 | L_PAREN@[108; 109) "(" | 94 | L_PAREN@[108; 109) "(" |
95 | R_PAREN@[109; 110) ")" | 95 | R_PAREN@[109; 110) ")" |
96 | SEMI@[110; 111) ";" | 96 | SEMICOLON@[110; 111) ";" |
97 | WHITESPACE@[111; 116) "\n " | 97 | WHITESPACE@[111; 116) "\n " |
98 | LET_STMT@[116; 143) | 98 | LET_STMT@[116; 143) |
99 | LET_KW@[116; 119) "let" | 99 | LET_KW@[116; 119) "let" |
@@ -122,7 +122,7 @@ SOURCE_FILE@[0; 146) | |||
122 | TUPLE_EXPR@[140; 142) | 122 | TUPLE_EXPR@[140; 142) |
123 | L_PAREN@[140; 141) "(" | 123 | L_PAREN@[140; 141) "(" |
124 | R_PAREN@[141; 142) ")" | 124 | R_PAREN@[141; 142) ")" |
125 | SEMI@[142; 143) ";" | 125 | SEMICOLON@[142; 143) ";" |
126 | WHITESPACE@[143; 144) "\n" | 126 | WHITESPACE@[143; 144) "\n" |
127 | R_CURLY@[144; 145) "}" | 127 | R_CURLY@[144; 145) "}" |
128 | WHITESPACE@[145; 146) "\n" | 128 | WHITESPACE@[145; 146) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast index 5db1ff2af..f2f649410 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0113_nocontentexpr.rast | |||
@@ -11,9 +11,9 @@ SOURCE_FILE@[0; 50) | |||
11 | BLOCK@[8; 49) | 11 | BLOCK@[8; 49) |
12 | L_CURLY@[8; 9) "{" | 12 | L_CURLY@[8; 9) "{" |
13 | WHITESPACE@[9; 14) "\n " | 13 | WHITESPACE@[9; 14) "\n " |
14 | SEMI@[14; 15) ";" | 14 | SEMICOLON@[14; 15) ";" |
15 | SEMI@[15; 16) ";" | 15 | SEMICOLON@[15; 16) ";" |
16 | SEMI@[16; 17) ";" | 16 | SEMICOLON@[16; 17) ";" |
17 | EXPR_STMT@[17; 29) | 17 | EXPR_STMT@[17; 29) |
18 | CALL_EXPR@[17; 28) | 18 | CALL_EXPR@[17; 28) |
19 | PATH_EXPR@[17; 26) | 19 | PATH_EXPR@[17; 26) |
@@ -24,22 +24,22 @@ SOURCE_FILE@[0; 50) | |||
24 | ARG_LIST@[26; 28) | 24 | ARG_LIST@[26; 28) |
25 | L_PAREN@[26; 27) "(" | 25 | L_PAREN@[26; 27) "(" |
26 | R_PAREN@[27; 28) ")" | 26 | R_PAREN@[27; 28) ")" |
27 | SEMI@[28; 29) ";" | 27 | SEMICOLON@[28; 29) ";" |
28 | SEMI@[29; 30) ";" | 28 | SEMICOLON@[29; 30) ";" |
29 | SEMI@[30; 31) ";" | 29 | SEMICOLON@[30; 31) ";" |
30 | SEMI@[31; 32) ";" | 30 | SEMICOLON@[31; 32) ";" |
31 | EXPR_STMT@[32; 38) | 31 | EXPR_STMT@[32; 38) |
32 | BLOCK_EXPR@[32; 37) | 32 | BLOCK_EXPR@[32; 37) |
33 | BLOCK@[32; 37) | 33 | BLOCK@[32; 37) |
34 | L_CURLY@[32; 33) "{" | 34 | L_CURLY@[32; 33) "{" |
35 | SEMI@[33; 34) ";" | 35 | SEMICOLON@[33; 34) ";" |
36 | SEMI@[34; 35) ";" | 36 | SEMICOLON@[34; 35) ";" |
37 | SEMI@[35; 36) ";" | 37 | SEMICOLON@[35; 36) ";" |
38 | R_CURLY@[36; 37) "}" | 38 | R_CURLY@[36; 37) "}" |
39 | SEMI@[37; 38) ";" | 39 | SEMICOLON@[37; 38) ";" |
40 | SEMI@[38; 39) ";" | 40 | SEMICOLON@[38; 39) ";" |
41 | SEMI@[39; 40) ";" | 41 | SEMICOLON@[39; 40) ";" |
42 | SEMI@[40; 41) ";" | 42 | SEMICOLON@[40; 41) ";" |
43 | CALL_EXPR@[41; 47) | 43 | CALL_EXPR@[41; 47) |
44 | PATH_EXPR@[41; 43) | 44 | PATH_EXPR@[41; 43) |
45 | PATH@[41; 43) | 45 | PATH@[41; 43) |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast index f5de01405..457c82e74 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0114_tuple_struct_where.rast | |||
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 53) | |||
38 | PATH_SEGMENT@[27; 32) | 38 | PATH_SEGMENT@[27; 32) |
39 | NAME_REF@[27; 32) | 39 | NAME_REF@[27; 32) |
40 | IDENT@[27; 32) "Clone" | 40 | IDENT@[27; 32) "Clone" |
41 | SEMI@[32; 33) ";" | 41 | SEMICOLON@[32; 33) ";" |
42 | WHITESPACE@[33; 34) "\n" | 42 | WHITESPACE@[33; 34) "\n" |
43 | STRUCT_DEF@[34; 52) | 43 | STRUCT_DEF@[34; 52) |
44 | STRUCT_KW@[34; 40) "struct" | 44 | STRUCT_KW@[34; 40) "struct" |
@@ -60,5 +60,5 @@ SOURCE_FILE@[0; 53) | |||
60 | NAME_REF@[49; 50) | 60 | NAME_REF@[49; 50) |
61 | IDENT@[49; 50) "T" | 61 | IDENT@[49; 50) "T" |
62 | R_PAREN@[50; 51) ")" | 62 | R_PAREN@[50; 51) ")" |
63 | SEMI@[51; 52) ";" | 63 | SEMICOLON@[51; 52) ";" |
64 | WHITESPACE@[52; 53) "\n" | 64 | WHITESPACE@[52; 53) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast index 8fe15d8e2..0b1552a9d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0115_tuple_field_attrs.rast | |||
@@ -37,5 +37,5 @@ SOURCE_FILE@[0; 60) | |||
37 | COMMA@[55; 56) "," | 37 | COMMA@[55; 56) "," |
38 | WHITESPACE@[56; 57) "\n" | 38 | WHITESPACE@[56; 57) "\n" |
39 | R_PAREN@[57; 58) ")" | 39 | R_PAREN@[57; 58) ")" |
40 | SEMI@[58; 59) ";" | 40 | SEMICOLON@[58; 59) ";" |
41 | WHITESPACE@[59; 60) "\n" | 41 | WHITESPACE@[59; 60) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast index 892dc813a..4f9e80e2e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0117_macro_call_type.rast | |||
@@ -12,11 +12,11 @@ SOURCE_FILE@[0; 41) | |||
12 | PATH_SEGMENT@[9; 12) | 12 | PATH_SEGMENT@[9; 12) |
13 | NAME_REF@[9; 12) | 13 | NAME_REF@[9; 12) |
14 | IDENT@[9; 12) "foo" | 14 | IDENT@[9; 12) "foo" |
15 | EXCL@[12; 13) "!" | 15 | BANG@[12; 13) "!" |
16 | TOKEN_TREE@[13; 15) | 16 | TOKEN_TREE@[13; 15) |
17 | L_PAREN@[13; 14) "(" | 17 | L_PAREN@[13; 14) "(" |
18 | R_PAREN@[14; 15) ")" | 18 | R_PAREN@[14; 15) ")" |
19 | SEMI@[15; 16) ";" | 19 | SEMICOLON@[15; 16) ";" |
20 | WHITESPACE@[16; 17) "\n" | 20 | WHITESPACE@[16; 17) "\n" |
21 | TYPE_ALIAS_DEF@[17; 40) | 21 | TYPE_ALIAS_DEF@[17; 40) |
22 | TYPE_KW@[17; 21) "type" | 22 | TYPE_KW@[17; 21) "type" |
@@ -31,13 +31,13 @@ SOURCE_FILE@[0; 41) | |||
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 | CRATE_KW@[26; 31) "crate" |
34 | COLONCOLON@[31; 33) "::" | 34 | COLON2@[31; 33) "::" |
35 | PATH_SEGMENT@[33; 36) | 35 | PATH_SEGMENT@[33; 36) |
36 | NAME_REF@[33; 36) | 36 | NAME_REF@[33; 36) |
37 | IDENT@[33; 36) "foo" | 37 | IDENT@[33; 36) "foo" |
38 | EXCL@[36; 37) "!" | 38 | BANG@[36; 37) "!" |
39 | TOKEN_TREE@[37; 39) | 39 | TOKEN_TREE@[37; 39) |
40 | L_PAREN@[37; 38) "(" | 40 | L_PAREN@[37; 38) "(" |
41 | R_PAREN@[38; 39) ")" | 41 | R_PAREN@[38; 39) ")" |
42 | SEMI@[39; 40) ";" | 42 | SEMICOLON@[39; 40) ";" |
43 | WHITESPACE@[40; 41) "\n" | 43 | WHITESPACE@[40; 41) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast index 5053ebde7..f9a4bc81b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_impl_inner_attributes.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 94) | |||
24 | WHITESPACE@[48; 54) "\n " | 24 | WHITESPACE@[48; 54) "\n " |
25 | ATTR@[54; 91) | 25 | ATTR@[54; 91) |
26 | POUND@[54; 55) "#" | 26 | POUND@[54; 55) "#" |
27 | EXCL@[55; 56) "!" | 27 | BANG@[55; 56) "!" |
28 | L_BRACK@[56; 57) "[" | 28 | L_BRACK@[56; 57) "[" |
29 | PATH@[57; 60) | 29 | PATH@[57; 60) |
30 | PATH_SEGMENT@[57; 60) | 30 | PATH_SEGMENT@[57; 60) |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast index 640e0640f..7eec92e1b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0120_match_arms_inner_attribute.rast | |||
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 139) | |||
24 | WHITESPACE@[25; 34) "\n " | 24 | WHITESPACE@[25; 34) "\n " |
25 | ATTR@[34; 60) | 25 | ATTR@[34; 60) |
26 | POUND@[34; 35) "#" | 26 | POUND@[34; 35) "#" |
27 | EXCL@[35; 36) "!" | 27 | BANG@[35; 36) "!" |
28 | L_BRACK@[36; 37) "[" | 28 | L_BRACK@[36; 37) "[" |
29 | PATH@[37; 40) | 29 | PATH@[37; 40) |
30 | PATH_SEGMENT@[37; 40) | 30 | PATH_SEGMENT@[37; 40) |
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 139) | |||
38 | WHITESPACE@[60; 69) "\n " | 38 | WHITESPACE@[60; 69) "\n " |
39 | ATTR@[69; 86) | 39 | ATTR@[69; 86) |
40 | POUND@[69; 70) "#" | 40 | POUND@[69; 70) "#" |
41 | EXCL@[70; 71) "!" | 41 | BANG@[70; 71) "!" |
42 | L_BRACK@[71; 72) "[" | 42 | L_BRACK@[71; 72) "[" |
43 | PATH@[72; 75) | 43 | PATH@[72; 75) |
44 | PATH_SEGMENT@[72; 75) | 44 | PATH_SEGMENT@[72; 75) |
@@ -52,7 +52,7 @@ SOURCE_FILE@[0; 139) | |||
52 | WHITESPACE@[86; 95) "\n " | 52 | WHITESPACE@[86; 95) "\n " |
53 | ATTR@[95; 113) | 53 | ATTR@[95; 113) |
54 | POUND@[95; 96) "#" | 54 | POUND@[95; 96) "#" |
55 | EXCL@[96; 97) "!" | 55 | BANG@[96; 97) "!" |
56 | L_BRACK@[97; 98) "[" | 56 | L_BRACK@[97; 98) "[" |
57 | PATH@[98; 101) | 57 | PATH@[98; 101) |
58 | PATH_SEGMENT@[98; 101) | 58 | PATH_SEGMENT@[98; 101) |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast index 6c3b17868..af8067b12 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0123_param_list_vararg.rast | |||
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 57) | |||
33 | COMMA@[40; 41) "," | 33 | COMMA@[40; 41) "," |
34 | WHITESPACE@[41; 42) " " | 34 | WHITESPACE@[41; 42) " " |
35 | PARAM@[42; 45) | 35 | PARAM@[42; 45) |
36 | DOTDOTDOT@[42; 45) "..." | 36 | DOT3@[42; 45) "..." |
37 | R_PAREN@[45; 46) ")" | 37 | R_PAREN@[45; 46) ")" |
38 | WHITESPACE@[46; 47) " " | 38 | WHITESPACE@[46; 47) " " |
39 | RET_TYPE@[47; 53) | 39 | RET_TYPE@[47; 53) |
@@ -44,7 +44,7 @@ SOURCE_FILE@[0; 57) | |||
44 | PATH_SEGMENT@[50; 53) | 44 | PATH_SEGMENT@[50; 53) |
45 | NAME_REF@[50; 53) | 45 | NAME_REF@[50; 53) |
46 | IDENT@[50; 53) "i32" | 46 | IDENT@[50; 53) "i32" |
47 | SEMI@[53; 54) ";" | 47 | SEMICOLON@[53; 54) ";" |
48 | WHITESPACE@[54; 55) " " | 48 | WHITESPACE@[54; 55) " " |
49 | R_CURLY@[55; 56) "}" | 49 | R_CURLY@[55; 56) "}" |
50 | WHITESPACE@[56; 57) "\n" | 50 | WHITESPACE@[56; 57) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast index 6a9f3bf72..f1f4de976 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_crate_keyword_path.rast | |||
@@ -19,14 +19,14 @@ SOURCE_FILE@[0; 27) | |||
19 | PATH@[11; 16) | 19 | PATH@[11; 16) |
20 | PATH_SEGMENT@[11; 16) | 20 | PATH_SEGMENT@[11; 16) |
21 | CRATE_KW@[11; 16) "crate" | 21 | CRATE_KW@[11; 16) "crate" |
22 | COLONCOLON@[16; 18) "::" | 22 | COLON2@[16; 18) "::" |
23 | PATH_SEGMENT@[18; 21) | 23 | PATH_SEGMENT@[18; 21) |
24 | NAME_REF@[18; 21) | 24 | NAME_REF@[18; 21) |
25 | IDENT@[18; 21) "foo" | 25 | IDENT@[18; 21) "foo" |
26 | ARG_LIST@[21; 23) | 26 | ARG_LIST@[21; 23) |
27 | L_PAREN@[21; 22) "(" | 27 | L_PAREN@[21; 22) "(" |
28 | R_PAREN@[22; 23) ")" | 28 | R_PAREN@[22; 23) ")" |
29 | SEMI@[23; 24) ";" | 29 | SEMICOLON@[23; 24) ";" |
30 | WHITESPACE@[24; 25) " " | 30 | WHITESPACE@[24; 25) " " |
31 | R_CURLY@[25; 26) "}" | 31 | R_CURLY@[25; 26) "}" |
32 | WHITESPACE@[26; 27) "\n" | 32 | WHITESPACE@[26; 27) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast index 5c311d18a..3b462871a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0126_attr_on_expr_stmt.rast | |||
@@ -31,7 +31,7 @@ SOURCE_FILE@[0; 82) | |||
31 | ARG_LIST@[23; 25) | 31 | ARG_LIST@[23; 25) |
32 | L_PAREN@[23; 24) "(" | 32 | L_PAREN@[23; 24) "(" |
33 | R_PAREN@[24; 25) ")" | 33 | R_PAREN@[24; 25) ")" |
34 | SEMI@[25; 26) ";" | 34 | SEMICOLON@[25; 26) ";" |
35 | WHITESPACE@[26; 31) "\n " | 35 | WHITESPACE@[26; 31) "\n " |
36 | EXPR_STMT@[31; 42) | 36 | EXPR_STMT@[31; 42) |
37 | ATTR@[31; 35) | 37 | ATTR@[31; 35) |
@@ -48,7 +48,7 @@ SOURCE_FILE@[0; 82) | |||
48 | PATH_SEGMENT@[36; 39) | 48 | PATH_SEGMENT@[36; 39) |
49 | NAME_REF@[36; 39) | 49 | NAME_REF@[36; 39) |
50 | IDENT@[36; 39) "bar" | 50 | IDENT@[36; 39) "bar" |
51 | EXCL@[39; 40) "!" | 51 | BANG@[39; 40) "!" |
52 | TOKEN_TREE@[40; 42) | 52 | TOKEN_TREE@[40; 42) |
53 | L_CURLY@[40; 41) "{" | 53 | L_CURLY@[40; 41) "{" |
54 | R_CURLY@[41; 42) "}" | 54 | R_CURLY@[41; 42) "}" |
@@ -93,7 +93,7 @@ SOURCE_FILE@[0; 82) | |||
93 | TUPLE_EXPR@[76; 78) | 93 | TUPLE_EXPR@[76; 78) |
94 | L_PAREN@[76; 77) "(" | 94 | L_PAREN@[76; 77) "(" |
95 | R_PAREN@[77; 78) ")" | 95 | R_PAREN@[77; 78) ")" |
96 | SEMI@[78; 79) ";" | 96 | SEMICOLON@[78; 79) ";" |
97 | WHITESPACE@[79; 80) "\n" | 97 | WHITESPACE@[79; 80) "\n" |
98 | R_CURLY@[80; 81) "}" | 98 | R_CURLY@[80; 81) "}" |
99 | WHITESPACE@[81; 82) "\n" | 99 | WHITESPACE@[81; 82) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast index 21f49690a..9bc6be62d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0127_attr_on_last_expr_in_block.rast | |||
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 47) | |||
32 | PATH_SEGMENT@[22; 25) | 32 | PATH_SEGMENT@[22; 25) |
33 | NAME_REF@[22; 25) | 33 | NAME_REF@[22; 25) |
34 | IDENT@[22; 25) "bar" | 34 | IDENT@[22; 25) "bar" |
35 | EXCL@[25; 26) "!" | 35 | BANG@[25; 26) "!" |
36 | TOKEN_TREE@[26; 28) | 36 | TOKEN_TREE@[26; 28) |
37 | L_PAREN@[26; 27) "(" | 37 | L_PAREN@[26; 27) "(" |
38 | R_PAREN@[27; 28) ")" | 38 | R_PAREN@[27; 28) ")" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast index 36d8f4a5f..31481d2f9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.rast | |||
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 33) | |||
21 | PATH_SEGMENT@[20; 21) | 21 | PATH_SEGMENT@[20; 21) |
22 | NAME_REF@[20; 21) | 22 | NAME_REF@[20; 21) |
23 | IDENT@[20; 21) "m" | 23 | IDENT@[20; 21) "m" |
24 | EXCL@[21; 22) "!" | 24 | BANG@[21; 22) "!" |
25 | TOKEN_TREE@[22; 25) | 25 | TOKEN_TREE@[22; 25) |
26 | L_PAREN@[22; 23) "(" | 26 | L_PAREN@[22; 23) "(" |
27 | IDENT@[23; 24) "x" | 27 | IDENT@[23; 24) "x" |
@@ -31,7 +31,7 @@ SOURCE_FILE@[0; 33) | |||
31 | WHITESPACE@[27; 28) " " | 31 | WHITESPACE@[27; 28) " " |
32 | LITERAL@[28; 29) | 32 | LITERAL@[28; 29) |
33 | INT_NUMBER@[28; 29) "0" | 33 | INT_NUMBER@[28; 29) "0" |
34 | SEMI@[29; 30) ";" | 34 | SEMICOLON@[29; 30) ";" |
35 | WHITESPACE@[30; 31) "\n" | 35 | WHITESPACE@[30; 31) "\n" |
36 | R_CURLY@[31; 32) "}" | 36 | R_CURLY@[31; 32) "}" |
37 | WHITESPACE@[32; 33) "\n" | 37 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast index 17739dfbd..1f2690c00 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_let_stmt.rast | |||
@@ -18,7 +18,7 @@ SOURCE_FILE@[0; 135) | |||
18 | BIND_PAT@[19; 20) | 18 | BIND_PAT@[19; 20) |
19 | NAME@[19; 20) | 19 | NAME@[19; 20) |
20 | IDENT@[19; 20) "a" | 20 | IDENT@[19; 20) "a" |
21 | SEMI@[20; 21) ";" | 21 | SEMICOLON@[20; 21) ";" |
22 | WHITESPACE@[21; 26) "\n " | 22 | WHITESPACE@[21; 26) "\n " |
23 | LET_STMT@[26; 37) | 23 | LET_STMT@[26; 37) |
24 | LET_KW@[26; 29) "let" | 24 | LET_KW@[26; 29) "let" |
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 135) | |||
33 | PATH_SEGMENT@[33; 36) | 33 | PATH_SEGMENT@[33; 36) |
34 | NAME_REF@[33; 36) | 34 | NAME_REF@[33; 36) |
35 | IDENT@[33; 36) "i32" | 35 | IDENT@[33; 36) "i32" |
36 | SEMI@[36; 37) ";" | 36 | SEMICOLON@[36; 37) ";" |
37 | WHITESPACE@[37; 42) "\n " | 37 | WHITESPACE@[37; 42) "\n " |
38 | LET_STMT@[42; 53) | 38 | LET_STMT@[42; 53) |
39 | LET_KW@[42; 45) "let" | 39 | LET_KW@[42; 45) "let" |
@@ -46,7 +46,7 @@ SOURCE_FILE@[0; 135) | |||
46 | WHITESPACE@[49; 50) " " | 46 | WHITESPACE@[49; 50) " " |
47 | LITERAL@[50; 52) | 47 | LITERAL@[50; 52) |
48 | INT_NUMBER@[50; 52) "92" | 48 | INT_NUMBER@[50; 52) "92" |
49 | SEMI@[52; 53) ";" | 49 | SEMICOLON@[52; 53) ";" |
50 | WHITESPACE@[53; 58) "\n " | 50 | WHITESPACE@[53; 58) "\n " |
51 | LET_STMT@[58; 74) | 51 | LET_STMT@[58; 74) |
52 | LET_KW@[58; 61) "let" | 52 | LET_KW@[58; 61) "let" |
@@ -66,7 +66,7 @@ SOURCE_FILE@[0; 135) | |||
66 | WHITESPACE@[70; 71) " " | 66 | WHITESPACE@[70; 71) " " |
67 | LITERAL@[71; 73) | 67 | LITERAL@[71; 73) |
68 | INT_NUMBER@[71; 73) "92" | 68 | INT_NUMBER@[71; 73) "92" |
69 | SEMI@[73; 74) ";" | 69 | SEMICOLON@[73; 74) ";" |
70 | WHITESPACE@[74; 79) "\n " | 70 | WHITESPACE@[74; 79) "\n " |
71 | LET_STMT@[79; 88) | 71 | LET_STMT@[79; 88) |
72 | LET_KW@[79; 82) "let" | 72 | LET_KW@[79; 82) "let" |
@@ -77,8 +77,8 @@ SOURCE_FILE@[0; 135) | |||
77 | COLON@[84; 85) ":" | 77 | COLON@[84; 85) ":" |
78 | WHITESPACE@[85; 86) " " | 78 | WHITESPACE@[85; 86) " " |
79 | NEVER_TYPE@[86; 87) | 79 | NEVER_TYPE@[86; 87) |
80 | EXCL@[86; 87) "!" | 80 | BANG@[86; 87) "!" |
81 | SEMI@[87; 88) ";" | 81 | SEMICOLON@[87; 88) ";" |
82 | WHITESPACE@[88; 93) "\n " | 82 | WHITESPACE@[88; 93) "\n " |
83 | LET_STMT@[93; 107) | 83 | LET_STMT@[93; 107) |
84 | LET_KW@[93; 96) "let" | 84 | LET_KW@[93; 96) "let" |
@@ -88,7 +88,7 @@ SOURCE_FILE@[0; 135) | |||
88 | COLON@[98; 99) ":" | 88 | COLON@[98; 99) ":" |
89 | WHITESPACE@[99; 100) " " | 89 | WHITESPACE@[99; 100) " " |
90 | NEVER_TYPE@[100; 101) | 90 | NEVER_TYPE@[100; 101) |
91 | EXCL@[100; 101) "!" | 91 | BANG@[100; 101) "!" |
92 | WHITESPACE@[101; 102) " " | 92 | WHITESPACE@[101; 102) " " |
93 | EQ@[102; 103) "=" | 93 | EQ@[102; 103) "=" |
94 | WHITESPACE@[103; 104) " " | 94 | WHITESPACE@[103; 104) " " |
@@ -96,7 +96,7 @@ SOURCE_FILE@[0; 135) | |||
96 | BLOCK@[104; 106) | 96 | BLOCK@[104; 106) |
97 | L_CURLY@[104; 105) "{" | 97 | L_CURLY@[104; 105) "{" |
98 | R_CURLY@[105; 106) "}" | 98 | R_CURLY@[105; 106) "}" |
99 | SEMI@[106; 107) ";" | 99 | SEMICOLON@[106; 107) ";" |
100 | WHITESPACE@[107; 112) "\n " | 100 | WHITESPACE@[107; 112) "\n " |
101 | LET_STMT@[112; 132) | 101 | LET_STMT@[112; 132) |
102 | LET_KW@[112; 115) "let" | 102 | LET_KW@[112; 115) "let" |
@@ -123,7 +123,7 @@ SOURCE_FILE@[0; 135) | |||
123 | BLOCK@[129; 131) | 123 | BLOCK@[129; 131) |
124 | L_CURLY@[129; 130) "{" | 124 | L_CURLY@[129; 130) "{" |
125 | R_CURLY@[130; 131) "}" | 125 | R_CURLY@[130; 131) "}" |
126 | SEMI@[131; 132) ";" | 126 | SEMICOLON@[131; 132) ";" |
127 | WHITESPACE@[132; 133) "\n" | 127 | WHITESPACE@[132; 133) "\n" |
128 | R_CURLY@[133; 134) "}" | 128 | R_CURLY@[133; 134) "}" |
129 | WHITESPACE@[134; 135) "\n" | 129 | WHITESPACE@[134; 135) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast index d6df1aba2..b96991035 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0130_try_block_expr.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 33) | |||
27 | BLOCK@[27; 29) | 27 | BLOCK@[27; 29) |
28 | L_CURLY@[27; 28) "{" | 28 | L_CURLY@[27; 28) "{" |
29 | R_CURLY@[28; 29) "}" | 29 | R_CURLY@[28; 29) "}" |
30 | SEMI@[29; 30) ";" | 30 | SEMICOLON@[29; 30) ";" |
31 | WHITESPACE@[30; 31) "\n" | 31 | WHITESPACE@[30; 31) "\n" |
32 | R_CURLY@[31; 32) "}" | 32 | R_CURLY@[31; 32) "}" |
33 | WHITESPACE@[32; 33) "\n" | 33 | WHITESPACE@[32; 33) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast index 6bfac985a..ed3d8fb0b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0131_existential_type.rast | |||
@@ -27,5 +27,5 @@ SOURCE_FILE@[0; 37) | |||
27 | PATH_SEGMENT@[30; 35) | 27 | PATH_SEGMENT@[30; 35) |
28 | NAME_REF@[30; 35) | 28 | NAME_REF@[30; 35) |
29 | IDENT@[30; 35) "usize" | 29 | IDENT@[30; 35) "usize" |
30 | SEMI@[35; 36) ";" | 30 | SEMICOLON@[35; 36) ";" |
31 | WHITESPACE@[36; 37) "\n" | 31 | WHITESPACE@[36; 37) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast index 12294210e..c392a7d84 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_box_expr.rast | |||
@@ -26,7 +26,7 @@ SOURCE_FILE@[0; 106) | |||
26 | WHITESPACE@[26; 27) " " | 26 | WHITESPACE@[26; 27) " " |
27 | LITERAL@[27; 31) | 27 | LITERAL@[27; 31) |
28 | INT_NUMBER@[27; 31) "1i32" | 28 | INT_NUMBER@[27; 31) "1i32" |
29 | SEMI@[31; 32) ";" | 29 | SEMICOLON@[31; 32) ";" |
30 | WHITESPACE@[32; 37) "\n " | 30 | WHITESPACE@[32; 37) "\n " |
31 | LET_STMT@[37; 66) | 31 | LET_STMT@[37; 66) |
32 | LET_KW@[37; 40) "let" | 32 | LET_KW@[37; 40) "let" |
@@ -52,7 +52,7 @@ SOURCE_FILE@[0; 106) | |||
52 | LITERAL@[60; 64) | 52 | LITERAL@[60; 64) |
53 | INT_NUMBER@[60; 64) "2i32" | 53 | INT_NUMBER@[60; 64) "2i32" |
54 | R_PAREN@[64; 65) ")" | 54 | R_PAREN@[64; 65) ")" |
55 | SEMI@[65; 66) ";" | 55 | SEMICOLON@[65; 66) ";" |
56 | WHITESPACE@[66; 71) "\n " | 56 | WHITESPACE@[66; 71) "\n " |
57 | LET_STMT@[71; 103) | 57 | LET_STMT@[71; 103) |
58 | LET_KW@[71; 74) "let" | 58 | LET_KW@[71; 74) "let" |
@@ -84,7 +84,7 @@ SOURCE_FILE@[0; 106) | |||
84 | LITERAL@[97; 101) | 84 | LITERAL@[97; 101) |
85 | INT_NUMBER@[97; 101) "2i32" | 85 | INT_NUMBER@[97; 101) "2i32" |
86 | R_PAREN@[101; 102) ")" | 86 | R_PAREN@[101; 102) ")" |
87 | SEMI@[102; 103) ";" | 87 | SEMICOLON@[102; 103) ";" |
88 | WHITESPACE@[103; 104) "\n" | 88 | WHITESPACE@[103; 104) "\n" |
89 | R_CURLY@[104; 105) "}" | 89 | R_CURLY@[104; 105) "}" |
90 | WHITESPACE@[105; 106) "\n" | 90 | WHITESPACE@[105; 106) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast index e1734224b..cff03fcf3 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0132_default_fn_type.rast | |||
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 69) | |||
34 | PATH_SEGMENT@[38; 41) | 34 | PATH_SEGMENT@[38; 41) |
35 | NAME_REF@[38; 41) | 35 | NAME_REF@[38; 41) |
36 | IDENT@[38; 41) "Bar" | 36 | IDENT@[38; 41) "Bar" |
37 | SEMI@[41; 42) ";" | 37 | SEMICOLON@[41; 42) ";" |
38 | WHITESPACE@[42; 47) "\n " | 38 | WHITESPACE@[42; 47) "\n " |
39 | FN_DEF@[47; 66) | 39 | FN_DEF@[47; 66) |
40 | DEFAULT_KW@[47; 54) "default" | 40 | DEFAULT_KW@[47; 54) "default" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast index 14655d332..f66f32370 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0134_nocontentexpr_after_item.rast | |||
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 111) | |||
32 | COMMA@[68; 69) "," | 32 | COMMA@[68; 69) "," |
33 | WHITESPACE@[69; 74) "\n " | 33 | WHITESPACE@[69; 74) "\n " |
34 | R_CURLY@[74; 75) "}" | 34 | R_CURLY@[74; 75) "}" |
35 | SEMI@[75; 76) ";" | 35 | SEMICOLON@[75; 76) ";" |
36 | WHITESPACE@[76; 81) "\n " | 36 | WHITESPACE@[76; 81) "\n " |
37 | FN_DEF@[81; 90) | 37 | FN_DEF@[81; 90) |
38 | FN_KW@[81; 83) "fn" | 38 | FN_KW@[81; 83) "fn" |
@@ -47,7 +47,7 @@ SOURCE_FILE@[0; 111) | |||
47 | BLOCK@[88; 90) | 47 | BLOCK@[88; 90) |
48 | L_CURLY@[88; 89) "{" | 48 | L_CURLY@[88; 89) "{" |
49 | R_CURLY@[89; 90) "}" | 49 | R_CURLY@[89; 90) "}" |
50 | SEMI@[90; 91) ";" | 50 | SEMICOLON@[90; 91) ";" |
51 | WHITESPACE@[91; 96) "\n " | 51 | WHITESPACE@[91; 96) "\n " |
52 | STRUCT_DEF@[96; 107) | 52 | STRUCT_DEF@[96; 107) |
53 | STRUCT_KW@[96; 102) "struct" | 53 | STRUCT_KW@[96; 102) "struct" |
@@ -58,7 +58,7 @@ SOURCE_FILE@[0; 111) | |||
58 | RECORD_FIELD_DEF_LIST@[105; 107) | 58 | RECORD_FIELD_DEF_LIST@[105; 107) |
59 | L_CURLY@[105; 106) "{" | 59 | L_CURLY@[105; 106) "{" |
60 | R_CURLY@[106; 107) "}" | 60 | R_CURLY@[106; 107) "}" |
61 | SEMI@[107; 108) ";" | 61 | SEMICOLON@[107; 108) ";" |
62 | WHITESPACE@[108; 109) "\n" | 62 | WHITESPACE@[108; 109) "\n" |
63 | R_CURLY@[109; 110) "}" | 63 | R_CURLY@[109; 110) "}" |
64 | WHITESPACE@[110; 111) "\n" | 64 | WHITESPACE@[110; 111) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast index a6ac0dbd8..4946e6325 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0137_await_expr.rast | |||
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 67) | |||
21 | IDENT@[15; 16) "x" | 21 | IDENT@[15; 16) "x" |
22 | DOT@[16; 17) "." | 22 | DOT@[16; 17) "." |
23 | AWAIT_KW@[17; 22) "await" | 23 | AWAIT_KW@[17; 22) "await" |
24 | SEMI@[22; 23) ";" | 24 | SEMICOLON@[22; 23) ";" |
25 | WHITESPACE@[23; 28) "\n " | 25 | WHITESPACE@[23; 28) "\n " |
26 | EXPR_STMT@[28; 38) | 26 | EXPR_STMT@[28; 38) |
27 | AWAIT_EXPR@[28; 37) | 27 | AWAIT_EXPR@[28; 37) |
@@ -36,7 +36,7 @@ SOURCE_FILE@[0; 67) | |||
36 | INT_NUMBER@[30; 31) "0" | 36 | INT_NUMBER@[30; 31) "0" |
37 | DOT@[31; 32) "." | 37 | DOT@[31; 32) "." |
38 | AWAIT_KW@[32; 37) "await" | 38 | AWAIT_KW@[32; 37) "await" |
39 | SEMI@[37; 38) ";" | 39 | SEMICOLON@[37; 38) ";" |
40 | WHITESPACE@[38; 43) "\n " | 40 | WHITESPACE@[38; 43) "\n " |
41 | EXPR_STMT@[43; 64) | 41 | EXPR_STMT@[43; 64) |
42 | METHOD_CALL_EXPR@[43; 63) | 42 | METHOD_CALL_EXPR@[43; 63) |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 67) | |||
64 | ARG_LIST@[61; 63) | 64 | ARG_LIST@[61; 63) |
65 | L_PAREN@[61; 62) "(" | 65 | L_PAREN@[61; 62) "(" |
66 | R_PAREN@[62; 63) ")" | 66 | R_PAREN@[62; 63) ")" |
67 | SEMI@[63; 64) ";" | 67 | SEMICOLON@[63; 64) ";" |
68 | WHITESPACE@[64; 65) "\n" | 68 | WHITESPACE@[64; 65) "\n" |
69 | R_CURLY@[65; 66) "}" | 69 | R_CURLY@[65; 66) "}" |
70 | WHITESPACE@[66; 67) "\n" | 70 | WHITESPACE@[66; 67) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast index df4c04149..ca1d69f64 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_expression_after_block.rast | |||
@@ -38,7 +38,7 @@ SOURCE_FILE@[0; 52) | |||
38 | LITERAL@[31; 32) | 38 | LITERAL@[31; 32) |
39 | INT_NUMBER@[31; 32) "5" | 39 | INT_NUMBER@[31; 32) "5" |
40 | R_CURLY@[32; 33) "}" | 40 | R_CURLY@[32; 33) "}" |
41 | SEMI@[33; 34) ";" | 41 | SEMICOLON@[33; 34) ";" |
42 | WHITESPACE@[34; 38) "\n " | 42 | WHITESPACE@[34; 38) "\n " |
43 | EXPR_STMT@[38; 49) | 43 | EXPR_STMT@[38; 49) |
44 | BIN_EXPR@[38; 48) | 44 | BIN_EXPR@[38; 48) |
@@ -60,7 +60,7 @@ SOURCE_FILE@[0; 52) | |||
60 | WHITESPACE@[45; 46) " " | 60 | WHITESPACE@[45; 46) " " |
61 | LITERAL@[46; 48) | 61 | LITERAL@[46; 48) |
62 | INT_NUMBER@[46; 48) "10" | 62 | INT_NUMBER@[46; 48) "10" |
63 | SEMI@[48; 49) ";" | 63 | SEMICOLON@[48; 49) ";" |
64 | WHITESPACE@[49; 50) "\n" | 64 | WHITESPACE@[49; 50) "\n" |
65 | R_CURLY@[50; 51) "}" | 65 | R_CURLY@[50; 51) "}" |
66 | WHITESPACE@[51; 52) "\n" | 66 | WHITESPACE@[51; 52) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast b/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast index eec1cba1e..6d01140d2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0142_for_range_from.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 51) | |||
25 | LITERAL@[23; 24) | 25 | LITERAL@[23; 24) |
26 | INT_NUMBER@[23; 24) "0" | 26 | INT_NUMBER@[23; 24) "0" |
27 | WHITESPACE@[24; 25) " " | 27 | WHITESPACE@[24; 25) " " |
28 | DOTDOT@[25; 27) ".." | 28 | DOT2@[25; 27) ".." |
29 | WHITESPACE@[27; 28) " " | 29 | WHITESPACE@[27; 28) " " |
30 | BLOCK_EXPR@[28; 48) | 30 | BLOCK_EXPR@[28; 48) |
31 | BLOCK@[28; 48) | 31 | BLOCK@[28; 48) |
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 51) | |||
34 | EXPR_STMT@[37; 43) | 34 | EXPR_STMT@[37; 43) |
35 | BREAK_EXPR@[37; 42) | 35 | BREAK_EXPR@[37; 42) |
36 | BREAK_KW@[37; 42) "break" | 36 | BREAK_KW@[37; 42) "break" |
37 | SEMI@[42; 43) ";" | 37 | SEMICOLON@[42; 43) ";" |
38 | WHITESPACE@[43; 47) "\n " | 38 | WHITESPACE@[43; 47) "\n " |
39 | R_CURLY@[47; 48) "}" | 39 | R_CURLY@[47; 48) "}" |
40 | WHITESPACE@[48; 49) "\n" | 40 | WHITESPACE@[48; 49) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast index 4d2048711..f75673070 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0143_box_pat.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 118) | |||
27 | TUPLE_EXPR@[28; 30) | 27 | TUPLE_EXPR@[28; 30) |
28 | L_PAREN@[28; 29) "(" | 28 | L_PAREN@[28; 29) "(" |
29 | R_PAREN@[29; 30) ")" | 29 | R_PAREN@[29; 30) ")" |
30 | SEMI@[30; 31) ";" | 30 | SEMICOLON@[30; 31) ";" |
31 | WHITESPACE@[31; 36) "\n " | 31 | WHITESPACE@[31; 36) "\n " |
32 | LET_STMT@[36; 87) | 32 | LET_STMT@[36; 87) |
33 | LET_KW@[36; 39) "let" | 33 | LET_KW@[36; 39) "let" |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 118) | |||
83 | TUPLE_EXPR@[84; 86) | 83 | TUPLE_EXPR@[84; 86) |
84 | L_PAREN@[84; 85) "(" | 84 | L_PAREN@[84; 85) "(" |
85 | R_PAREN@[85; 86) ")" | 85 | R_PAREN@[85; 86) ")" |
86 | SEMI@[86; 87) ";" | 86 | SEMICOLON@[86; 87) ";" |
87 | WHITESPACE@[87; 92) "\n " | 87 | WHITESPACE@[87; 92) "\n " |
88 | LET_STMT@[92; 115) | 88 | LET_STMT@[92; 115) |
89 | LET_KW@[92; 95) "let" | 89 | LET_KW@[92; 95) "let" |
@@ -104,7 +104,7 @@ SOURCE_FILE@[0; 118) | |||
104 | TUPLE_EXPR@[112; 114) | 104 | TUPLE_EXPR@[112; 114) |
105 | L_PAREN@[112; 113) "(" | 105 | L_PAREN@[112; 113) "(" |
106 | R_PAREN@[113; 114) ")" | 106 | R_PAREN@[113; 114) ")" |
107 | SEMI@[114; 115) ";" | 107 | SEMICOLON@[114; 115) ";" |
108 | WHITESPACE@[115; 116) "\n" | 108 | WHITESPACE@[115; 116) "\n" |
109 | R_CURLY@[116; 117) "}" | 109 | R_CURLY@[116; 117) "}" |
110 | WHITESPACE@[117; 118) "\n" | 110 | WHITESPACE@[117; 118) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast index 325b1bd08..60186a992 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0144_dot_dot_pat.rast | |||
@@ -16,14 +16,14 @@ SOURCE_FILE@[0; 555) | |||
16 | LET_KW@[16; 19) "let" | 16 | LET_KW@[16; 19) "let" |
17 | WHITESPACE@[19; 20) " " | 17 | WHITESPACE@[19; 20) " " |
18 | DOT_DOT_PAT@[20; 22) | 18 | DOT_DOT_PAT@[20; 22) |
19 | DOTDOT@[20; 22) ".." | 19 | DOT2@[20; 22) ".." |
20 | WHITESPACE@[22; 23) " " | 20 | WHITESPACE@[22; 23) " " |
21 | EQ@[23; 24) "=" | 21 | EQ@[23; 24) "=" |
22 | WHITESPACE@[24; 25) " " | 22 | WHITESPACE@[24; 25) " " |
23 | TUPLE_EXPR@[25; 27) | 23 | TUPLE_EXPR@[25; 27) |
24 | L_PAREN@[25; 26) "(" | 24 | L_PAREN@[25; 26) "(" |
25 | R_PAREN@[26; 27) ")" | 25 | R_PAREN@[26; 27) ")" |
26 | SEMI@[27; 28) ";" | 26 | SEMICOLON@[27; 28) ";" |
27 | WHITESPACE@[28; 33) "\n " | 27 | WHITESPACE@[28; 33) "\n " |
28 | COMMENT@[33; 35) "//" | 28 | COMMENT@[33; 35) "//" |
29 | WHITESPACE@[35; 40) "\n " | 29 | WHITESPACE@[35; 40) "\n " |
@@ -42,7 +42,7 @@ SOURCE_FILE@[0; 555) | |||
42 | COMMA@[67; 68) "," | 42 | COMMA@[67; 68) "," |
43 | WHITESPACE@[68; 69) " " | 43 | WHITESPACE@[68; 69) " " |
44 | DOT_DOT_PAT@[69; 71) | 44 | DOT_DOT_PAT@[69; 71) |
45 | DOTDOT@[69; 71) ".." | 45 | DOT2@[69; 71) ".." |
46 | R_PAREN@[71; 72) ")" | 46 | R_PAREN@[71; 72) ")" |
47 | WHITESPACE@[72; 73) " " | 47 | WHITESPACE@[72; 73) " " |
48 | EQ@[73; 74) "=" | 48 | EQ@[73; 74) "=" |
@@ -50,7 +50,7 @@ SOURCE_FILE@[0; 555) | |||
50 | TUPLE_EXPR@[75; 77) | 50 | TUPLE_EXPR@[75; 77) |
51 | L_PAREN@[75; 76) "(" | 51 | L_PAREN@[75; 76) "(" |
52 | R_PAREN@[76; 77) ")" | 52 | R_PAREN@[76; 77) ")" |
53 | SEMI@[77; 78) ";" | 53 | SEMICOLON@[77; 78) ";" |
54 | WHITESPACE@[78; 83) "\n " | 54 | WHITESPACE@[78; 83) "\n " |
55 | LET_STMT@[83; 101) | 55 | LET_STMT@[83; 101) |
56 | LET_KW@[83; 86) "let" | 56 | LET_KW@[83; 86) "let" |
@@ -63,7 +63,7 @@ SOURCE_FILE@[0; 555) | |||
63 | COMMA@[89; 90) "," | 63 | COMMA@[89; 90) "," |
64 | WHITESPACE@[90; 91) " " | 64 | WHITESPACE@[90; 91) " " |
65 | DOT_DOT_PAT@[91; 93) | 65 | DOT_DOT_PAT@[91; 93) |
66 | DOTDOT@[91; 93) ".." | 66 | DOT2@[91; 93) ".." |
67 | COMMA@[93; 94) "," | 67 | COMMA@[93; 94) "," |
68 | R_PAREN@[94; 95) ")" | 68 | R_PAREN@[94; 95) ")" |
69 | WHITESPACE@[95; 96) " " | 69 | WHITESPACE@[95; 96) " " |
@@ -72,7 +72,7 @@ SOURCE_FILE@[0; 555) | |||
72 | TUPLE_EXPR@[98; 100) | 72 | TUPLE_EXPR@[98; 100) |
73 | L_PAREN@[98; 99) "(" | 73 | L_PAREN@[98; 99) "(" |
74 | R_PAREN@[99; 100) ")" | 74 | R_PAREN@[99; 100) ")" |
75 | SEMI@[100; 101) ";" | 75 | SEMICOLON@[100; 101) ";" |
76 | WHITESPACE@[101; 106) "\n " | 76 | WHITESPACE@[101; 106) "\n " |
77 | LET_STMT@[106; 128) | 77 | LET_STMT@[106; 128) |
78 | LET_KW@[106; 109) "let" | 78 | LET_KW@[106; 109) "let" |
@@ -89,7 +89,7 @@ SOURCE_FILE@[0; 555) | |||
89 | COMMA@[117; 118) "," | 89 | COMMA@[117; 118) "," |
90 | WHITESPACE@[118; 119) " " | 90 | WHITESPACE@[118; 119) " " |
91 | DOT_DOT_PAT@[119; 121) | 91 | DOT_DOT_PAT@[119; 121) |
92 | DOTDOT@[119; 121) ".." | 92 | DOT2@[119; 121) ".." |
93 | R_PAREN@[121; 122) ")" | 93 | R_PAREN@[121; 122) ")" |
94 | WHITESPACE@[122; 123) " " | 94 | WHITESPACE@[122; 123) " " |
95 | EQ@[123; 124) "=" | 95 | EQ@[123; 124) "=" |
@@ -97,7 +97,7 @@ SOURCE_FILE@[0; 555) | |||
97 | TUPLE_EXPR@[125; 127) | 97 | TUPLE_EXPR@[125; 127) |
98 | L_PAREN@[125; 126) "(" | 98 | L_PAREN@[125; 126) "(" |
99 | R_PAREN@[126; 127) ")" | 99 | R_PAREN@[126; 127) ")" |
100 | SEMI@[127; 128) ";" | 100 | SEMICOLON@[127; 128) ";" |
101 | WHITESPACE@[128; 133) "\n " | 101 | WHITESPACE@[128; 133) "\n " |
102 | LET_STMT@[133; 156) | 102 | LET_STMT@[133; 156) |
103 | LET_KW@[133; 136) "let" | 103 | LET_KW@[133; 136) "let" |
@@ -114,7 +114,7 @@ SOURCE_FILE@[0; 555) | |||
114 | COMMA@[144; 145) "," | 114 | COMMA@[144; 145) "," |
115 | WHITESPACE@[145; 146) " " | 115 | WHITESPACE@[145; 146) " " |
116 | DOT_DOT_PAT@[146; 148) | 116 | DOT_DOT_PAT@[146; 148) |
117 | DOTDOT@[146; 148) ".." | 117 | DOT2@[146; 148) ".." |
118 | COMMA@[148; 149) "," | 118 | COMMA@[148; 149) "," |
119 | R_PAREN@[149; 150) ")" | 119 | R_PAREN@[149; 150) ")" |
120 | WHITESPACE@[150; 151) " " | 120 | WHITESPACE@[150; 151) " " |
@@ -123,7 +123,7 @@ SOURCE_FILE@[0; 555) | |||
123 | TUPLE_EXPR@[153; 155) | 123 | TUPLE_EXPR@[153; 155) |
124 | L_PAREN@[153; 154) "(" | 124 | L_PAREN@[153; 154) "(" |
125 | R_PAREN@[154; 155) ")" | 125 | R_PAREN@[154; 155) ")" |
126 | SEMI@[155; 156) ";" | 126 | SEMICOLON@[155; 156) ";" |
127 | WHITESPACE@[156; 161) "\n " | 127 | WHITESPACE@[156; 161) "\n " |
128 | LET_STMT@[161; 179) | 128 | LET_STMT@[161; 179) |
129 | LET_KW@[161; 164) "let" | 129 | LET_KW@[161; 164) "let" |
@@ -131,11 +131,11 @@ SOURCE_FILE@[0; 555) | |||
131 | TUPLE_PAT@[165; 173) | 131 | TUPLE_PAT@[165; 173) |
132 | L_PAREN@[165; 166) "(" | 132 | L_PAREN@[165; 166) "(" |
133 | DOT_DOT_PAT@[166; 168) | 133 | DOT_DOT_PAT@[166; 168) |
134 | DOTDOT@[166; 168) ".." | 134 | DOT2@[166; 168) ".." |
135 | COMMA@[168; 169) "," | 135 | COMMA@[168; 169) "," |
136 | WHITESPACE@[169; 170) " " | 136 | WHITESPACE@[169; 170) " " |
137 | DOT_DOT_PAT@[170; 172) | 137 | DOT_DOT_PAT@[170; 172) |
138 | DOTDOT@[170; 172) ".." | 138 | DOT2@[170; 172) ".." |
139 | R_PAREN@[172; 173) ")" | 139 | R_PAREN@[172; 173) ")" |
140 | WHITESPACE@[173; 174) " " | 140 | WHITESPACE@[173; 174) " " |
141 | EQ@[174; 175) "=" | 141 | EQ@[174; 175) "=" |
@@ -143,7 +143,7 @@ SOURCE_FILE@[0; 555) | |||
143 | TUPLE_EXPR@[176; 178) | 143 | TUPLE_EXPR@[176; 178) |
144 | L_PAREN@[176; 177) "(" | 144 | L_PAREN@[176; 177) "(" |
145 | R_PAREN@[177; 178) ")" | 145 | R_PAREN@[177; 178) ")" |
146 | SEMI@[178; 179) ";" | 146 | SEMICOLON@[178; 179) ";" |
147 | WHITESPACE@[179; 184) "\n " | 147 | WHITESPACE@[179; 184) "\n " |
148 | LET_STMT@[184; 207) | 148 | LET_STMT@[184; 207) |
149 | LET_KW@[184; 187) "let" | 149 | LET_KW@[184; 187) "let" |
@@ -155,11 +155,11 @@ SOURCE_FILE@[0; 555) | |||
155 | IDENT@[188; 193) "Tuple" | 155 | IDENT@[188; 193) "Tuple" |
156 | L_PAREN@[193; 194) "(" | 156 | L_PAREN@[193; 194) "(" |
157 | DOT_DOT_PAT@[194; 196) | 157 | DOT_DOT_PAT@[194; 196) |
158 | DOTDOT@[194; 196) ".." | 158 | DOT2@[194; 196) ".." |
159 | COMMA@[196; 197) "," | 159 | COMMA@[196; 197) "," |
160 | WHITESPACE@[197; 198) " " | 160 | WHITESPACE@[197; 198) " " |
161 | DOT_DOT_PAT@[198; 200) | 161 | DOT_DOT_PAT@[198; 200) |
162 | DOTDOT@[198; 200) ".." | 162 | DOT2@[198; 200) ".." |
163 | R_PAREN@[200; 201) ")" | 163 | R_PAREN@[200; 201) ")" |
164 | WHITESPACE@[201; 202) " " | 164 | WHITESPACE@[201; 202) " " |
165 | EQ@[202; 203) "=" | 165 | EQ@[202; 203) "=" |
@@ -167,7 +167,7 @@ SOURCE_FILE@[0; 555) | |||
167 | TUPLE_EXPR@[204; 206) | 167 | TUPLE_EXPR@[204; 206) |
168 | L_PAREN@[204; 205) "(" | 168 | L_PAREN@[204; 205) "(" |
169 | R_PAREN@[205; 206) ")" | 169 | R_PAREN@[205; 206) ")" |
170 | SEMI@[206; 207) ";" | 170 | SEMICOLON@[206; 207) ";" |
171 | WHITESPACE@[207; 212) "\n " | 171 | WHITESPACE@[207; 212) "\n " |
172 | LET_STMT@[212; 233) | 172 | LET_STMT@[212; 233) |
173 | LET_KW@[212; 215) "let" | 173 | LET_KW@[212; 215) "let" |
@@ -175,7 +175,7 @@ SOURCE_FILE@[0; 555) | |||
175 | TUPLE_PAT@[216; 227) | 175 | TUPLE_PAT@[216; 227) |
176 | L_PAREN@[216; 217) "(" | 176 | L_PAREN@[216; 217) "(" |
177 | DOT_DOT_PAT@[217; 219) | 177 | DOT_DOT_PAT@[217; 219) |
178 | DOTDOT@[217; 219) ".." | 178 | DOT2@[217; 219) ".." |
179 | COMMA@[219; 220) "," | 179 | COMMA@[219; 220) "," |
180 | WHITESPACE@[220; 221) " " | 180 | WHITESPACE@[220; 221) " " |
181 | BIND_PAT@[221; 222) | 181 | BIND_PAT@[221; 222) |
@@ -184,7 +184,7 @@ SOURCE_FILE@[0; 555) | |||
184 | COMMA@[222; 223) "," | 184 | COMMA@[222; 223) "," |
185 | WHITESPACE@[223; 224) " " | 185 | WHITESPACE@[223; 224) " " |
186 | DOT_DOT_PAT@[224; 226) | 186 | DOT_DOT_PAT@[224; 226) |
187 | DOTDOT@[224; 226) ".." | 187 | DOT2@[224; 226) ".." |
188 | R_PAREN@[226; 227) ")" | 188 | R_PAREN@[226; 227) ")" |
189 | WHITESPACE@[227; 228) " " | 189 | WHITESPACE@[227; 228) " " |
190 | EQ@[228; 229) "=" | 190 | EQ@[228; 229) "=" |
@@ -192,7 +192,7 @@ SOURCE_FILE@[0; 555) | |||
192 | TUPLE_EXPR@[230; 232) | 192 | TUPLE_EXPR@[230; 232) |
193 | L_PAREN@[230; 231) "(" | 193 | L_PAREN@[230; 231) "(" |
194 | R_PAREN@[231; 232) ")" | 194 | R_PAREN@[231; 232) ")" |
195 | SEMI@[232; 233) ";" | 195 | SEMICOLON@[232; 233) ";" |
196 | WHITESPACE@[233; 238) "\n " | 196 | WHITESPACE@[233; 238) "\n " |
197 | LET_STMT@[238; 264) | 197 | LET_STMT@[238; 264) |
198 | LET_KW@[238; 241) "let" | 198 | LET_KW@[238; 241) "let" |
@@ -204,7 +204,7 @@ SOURCE_FILE@[0; 555) | |||
204 | IDENT@[242; 247) "Tuple" | 204 | IDENT@[242; 247) "Tuple" |
205 | L_PAREN@[247; 248) "(" | 205 | L_PAREN@[247; 248) "(" |
206 | DOT_DOT_PAT@[248; 250) | 206 | DOT_DOT_PAT@[248; 250) |
207 | DOTDOT@[248; 250) ".." | 207 | DOT2@[248; 250) ".." |
208 | COMMA@[250; 251) "," | 208 | COMMA@[250; 251) "," |
209 | WHITESPACE@[251; 252) " " | 209 | WHITESPACE@[251; 252) " " |
210 | BIND_PAT@[252; 253) | 210 | BIND_PAT@[252; 253) |
@@ -213,7 +213,7 @@ SOURCE_FILE@[0; 555) | |||
213 | COMMA@[253; 254) "," | 213 | COMMA@[253; 254) "," |
214 | WHITESPACE@[254; 255) " " | 214 | WHITESPACE@[254; 255) " " |
215 | DOT_DOT_PAT@[255; 257) | 215 | DOT_DOT_PAT@[255; 257) |
216 | DOTDOT@[255; 257) ".." | 216 | DOT2@[255; 257) ".." |
217 | R_PAREN@[257; 258) ")" | 217 | R_PAREN@[257; 258) ")" |
218 | WHITESPACE@[258; 259) " " | 218 | WHITESPACE@[258; 259) " " |
219 | EQ@[259; 260) "=" | 219 | EQ@[259; 260) "=" |
@@ -221,7 +221,7 @@ SOURCE_FILE@[0; 555) | |||
221 | TUPLE_EXPR@[261; 263) | 221 | TUPLE_EXPR@[261; 263) |
222 | L_PAREN@[261; 262) "(" | 222 | L_PAREN@[261; 262) "(" |
223 | R_PAREN@[262; 263) ")" | 223 | R_PAREN@[262; 263) ")" |
224 | SEMI@[263; 264) ";" | 224 | SEMICOLON@[263; 264) ";" |
225 | WHITESPACE@[264; 269) "\n " | 225 | WHITESPACE@[264; 269) "\n " |
226 | COMMENT@[269; 271) "//" | 226 | COMMENT@[269; 271) "//" |
227 | WHITESPACE@[271; 276) "\n " | 227 | WHITESPACE@[271; 276) "\n " |
@@ -235,7 +235,7 @@ SOURCE_FILE@[0; 555) | |||
235 | SLICE_PAT@[301; 305) | 235 | SLICE_PAT@[301; 305) |
236 | L_BRACK@[301; 302) "[" | 236 | L_BRACK@[301; 302) "[" |
237 | DOT_DOT_PAT@[302; 304) | 237 | DOT_DOT_PAT@[302; 304) |
238 | DOTDOT@[302; 304) ".." | 238 | DOT2@[302; 304) ".." |
239 | R_BRACK@[304; 305) "]" | 239 | R_BRACK@[304; 305) "]" |
240 | WHITESPACE@[305; 306) " " | 240 | WHITESPACE@[305; 306) " " |
241 | EQ@[306; 307) "=" | 241 | EQ@[306; 307) "=" |
@@ -243,7 +243,7 @@ SOURCE_FILE@[0; 555) | |||
243 | TUPLE_EXPR@[308; 310) | 243 | TUPLE_EXPR@[308; 310) |
244 | L_PAREN@[308; 309) "(" | 244 | L_PAREN@[308; 309) "(" |
245 | R_PAREN@[309; 310) ")" | 245 | R_PAREN@[309; 310) ")" |
246 | SEMI@[310; 311) ";" | 246 | SEMICOLON@[310; 311) ";" |
247 | WHITESPACE@[311; 316) "\n " | 247 | WHITESPACE@[311; 316) "\n " |
248 | LET_STMT@[316; 336) | 248 | LET_STMT@[316; 336) |
249 | LET_KW@[316; 319) "let" | 249 | LET_KW@[316; 319) "let" |
@@ -256,7 +256,7 @@ SOURCE_FILE@[0; 555) | |||
256 | COMMA@[325; 326) "," | 256 | COMMA@[325; 326) "," |
257 | WHITESPACE@[326; 327) " " | 257 | WHITESPACE@[326; 327) " " |
258 | DOT_DOT_PAT@[327; 329) | 258 | DOT_DOT_PAT@[327; 329) |
259 | DOTDOT@[327; 329) ".." | 259 | DOT2@[327; 329) ".." |
260 | R_BRACK@[329; 330) "]" | 260 | R_BRACK@[329; 330) "]" |
261 | WHITESPACE@[330; 331) " " | 261 | WHITESPACE@[330; 331) " " |
262 | EQ@[331; 332) "=" | 262 | EQ@[331; 332) "=" |
@@ -264,7 +264,7 @@ SOURCE_FILE@[0; 555) | |||
264 | TUPLE_EXPR@[333; 335) | 264 | TUPLE_EXPR@[333; 335) |
265 | L_PAREN@[333; 334) "(" | 265 | L_PAREN@[333; 334) "(" |
266 | R_PAREN@[334; 335) ")" | 266 | R_PAREN@[334; 335) ")" |
267 | SEMI@[335; 336) ";" | 267 | SEMICOLON@[335; 336) ";" |
268 | WHITESPACE@[336; 341) "\n " | 268 | WHITESPACE@[336; 341) "\n " |
269 | LET_STMT@[341; 368) | 269 | LET_STMT@[341; 368) |
270 | LET_KW@[341; 344) "let" | 270 | LET_KW@[341; 344) "let" |
@@ -283,7 +283,7 @@ SOURCE_FILE@[0; 555) | |||
283 | AT@[357; 358) "@" | 283 | AT@[357; 358) "@" |
284 | WHITESPACE@[358; 359) " " | 284 | WHITESPACE@[358; 359) " " |
285 | DOT_DOT_PAT@[359; 361) | 285 | DOT_DOT_PAT@[359; 361) |
286 | DOTDOT@[359; 361) ".." | 286 | DOT2@[359; 361) ".." |
287 | R_BRACK@[361; 362) "]" | 287 | R_BRACK@[361; 362) "]" |
288 | WHITESPACE@[362; 363) " " | 288 | WHITESPACE@[362; 363) " " |
289 | EQ@[363; 364) "=" | 289 | EQ@[363; 364) "=" |
@@ -291,7 +291,7 @@ SOURCE_FILE@[0; 555) | |||
291 | TUPLE_EXPR@[365; 367) | 291 | TUPLE_EXPR@[365; 367) |
292 | L_PAREN@[365; 366) "(" | 292 | L_PAREN@[365; 366) "(" |
293 | R_PAREN@[366; 367) ")" | 293 | R_PAREN@[366; 367) ")" |
294 | SEMI@[367; 368) ";" | 294 | SEMICOLON@[367; 368) ";" |
295 | WHITESPACE@[368; 373) "\n " | 295 | WHITESPACE@[368; 373) "\n " |
296 | LET_STMT@[373; 399) | 296 | LET_STMT@[373; 399) |
297 | LET_KW@[373; 376) "let" | 297 | LET_KW@[373; 376) "let" |
@@ -304,7 +304,7 @@ SOURCE_FILE@[0; 555) | |||
304 | COMMA@[382; 383) "," | 304 | COMMA@[382; 383) "," |
305 | WHITESPACE@[383; 384) " " | 305 | WHITESPACE@[383; 384) " " |
306 | DOT_DOT_PAT@[384; 386) | 306 | DOT_DOT_PAT@[384; 386) |
307 | DOTDOT@[384; 386) ".." | 307 | DOT2@[384; 386) ".." |
308 | COMMA@[386; 387) "," | 308 | COMMA@[386; 387) "," |
309 | WHITESPACE@[387; 388) " " | 309 | WHITESPACE@[387; 388) " " |
310 | BIND_PAT@[388; 392) | 310 | BIND_PAT@[388; 392) |
@@ -317,7 +317,7 @@ SOURCE_FILE@[0; 555) | |||
317 | TUPLE_EXPR@[396; 398) | 317 | TUPLE_EXPR@[396; 398) |
318 | L_PAREN@[396; 397) "(" | 318 | L_PAREN@[396; 397) "(" |
319 | R_PAREN@[397; 398) ")" | 319 | R_PAREN@[397; 398) ")" |
320 | SEMI@[398; 399) ";" | 320 | SEMICOLON@[398; 399) ";" |
321 | WHITESPACE@[399; 404) "\n " | 321 | WHITESPACE@[399; 404) "\n " |
322 | LET_STMT@[404; 436) | 322 | LET_STMT@[404; 436) |
323 | LET_KW@[404; 407) "let" | 323 | LET_KW@[404; 407) "let" |
@@ -336,7 +336,7 @@ SOURCE_FILE@[0; 555) | |||
336 | AT@[419; 420) "@" | 336 | AT@[419; 420) "@" |
337 | WHITESPACE@[420; 421) " " | 337 | WHITESPACE@[420; 421) " " |
338 | DOT_DOT_PAT@[421; 423) | 338 | DOT_DOT_PAT@[421; 423) |
339 | DOTDOT@[421; 423) ".." | 339 | DOT2@[421; 423) ".." |
340 | COMMA@[423; 424) "," | 340 | COMMA@[423; 424) "," |
341 | WHITESPACE@[424; 425) " " | 341 | WHITESPACE@[424; 425) " " |
342 | BIND_PAT@[425; 429) | 342 | BIND_PAT@[425; 429) |
@@ -349,7 +349,7 @@ SOURCE_FILE@[0; 555) | |||
349 | TUPLE_EXPR@[433; 435) | 349 | TUPLE_EXPR@[433; 435) |
350 | L_PAREN@[433; 434) "(" | 350 | L_PAREN@[433; 434) "(" |
351 | R_PAREN@[434; 435) ")" | 351 | R_PAREN@[434; 435) ")" |
352 | SEMI@[435; 436) ";" | 352 | SEMICOLON@[435; 436) ";" |
353 | WHITESPACE@[436; 441) "\n " | 353 | WHITESPACE@[436; 441) "\n " |
354 | LET_STMT@[441; 471) | 354 | LET_STMT@[441; 471) |
355 | LET_KW@[441; 444) "let" | 355 | LET_KW@[441; 444) "let" |
@@ -362,11 +362,11 @@ SOURCE_FILE@[0; 555) | |||
362 | COMMA@[450; 451) "," | 362 | COMMA@[450; 451) "," |
363 | WHITESPACE@[451; 452) " " | 363 | WHITESPACE@[451; 452) " " |
364 | DOT_DOT_PAT@[452; 454) | 364 | DOT_DOT_PAT@[452; 454) |
365 | DOTDOT@[452; 454) ".." | 365 | DOT2@[452; 454) ".." |
366 | COMMA@[454; 455) "," | 366 | COMMA@[454; 455) "," |
367 | WHITESPACE@[455; 456) " " | 367 | WHITESPACE@[455; 456) " " |
368 | DOT_DOT_PAT@[456; 458) | 368 | DOT_DOT_PAT@[456; 458) |
369 | DOTDOT@[456; 458) ".." | 369 | DOT2@[456; 458) ".." |
370 | COMMA@[458; 459) "," | 370 | COMMA@[458; 459) "," |
371 | WHITESPACE@[459; 460) " " | 371 | WHITESPACE@[459; 460) " " |
372 | BIND_PAT@[460; 464) | 372 | BIND_PAT@[460; 464) |
@@ -379,7 +379,7 @@ SOURCE_FILE@[0; 555) | |||
379 | TUPLE_EXPR@[468; 470) | 379 | TUPLE_EXPR@[468; 470) |
380 | L_PAREN@[468; 469) "(" | 380 | L_PAREN@[468; 469) "(" |
381 | R_PAREN@[469; 470) ")" | 381 | R_PAREN@[469; 470) ")" |
382 | SEMI@[470; 471) ";" | 382 | SEMICOLON@[470; 471) ";" |
383 | WHITESPACE@[471; 476) "\n " | 383 | WHITESPACE@[471; 476) "\n " |
384 | LET_STMT@[476; 512) | 384 | LET_STMT@[476; 512) |
385 | LET_KW@[476; 479) "let" | 385 | LET_KW@[476; 479) "let" |
@@ -392,7 +392,7 @@ SOURCE_FILE@[0; 555) | |||
392 | COMMA@[485; 486) "," | 392 | COMMA@[485; 486) "," |
393 | WHITESPACE@[486; 487) " " | 393 | WHITESPACE@[486; 487) " " |
394 | DOT_DOT_PAT@[487; 489) | 394 | DOT_DOT_PAT@[487; 489) |
395 | DOTDOT@[487; 489) ".." | 395 | DOT2@[487; 489) ".." |
396 | COMMA@[489; 490) "," | 396 | COMMA@[489; 490) "," |
397 | WHITESPACE@[490; 491) " " | 397 | WHITESPACE@[490; 491) " " |
398 | BIND_PAT@[491; 494) | 398 | BIND_PAT@[491; 494) |
@@ -407,7 +407,7 @@ SOURCE_FILE@[0; 555) | |||
407 | AT@[501; 502) "@" | 407 | AT@[501; 502) "@" |
408 | WHITESPACE@[502; 503) " " | 408 | WHITESPACE@[502; 503) " " |
409 | DOT_DOT_PAT@[503; 505) | 409 | DOT_DOT_PAT@[503; 505) |
410 | DOTDOT@[503; 505) ".." | 410 | DOT2@[503; 505) ".." |
411 | R_BRACK@[505; 506) "]" | 411 | R_BRACK@[505; 506) "]" |
412 | WHITESPACE@[506; 507) " " | 412 | WHITESPACE@[506; 507) " " |
413 | EQ@[507; 508) "=" | 413 | EQ@[507; 508) "=" |
@@ -415,7 +415,7 @@ SOURCE_FILE@[0; 555) | |||
415 | TUPLE_EXPR@[509; 511) | 415 | TUPLE_EXPR@[509; 511) |
416 | L_PAREN@[509; 510) "(" | 416 | L_PAREN@[509; 510) "(" |
417 | R_PAREN@[510; 511) ")" | 417 | R_PAREN@[510; 511) ")" |
418 | SEMI@[511; 512) ";" | 418 | SEMICOLON@[511; 512) ";" |
419 | WHITESPACE@[512; 517) "\n " | 419 | WHITESPACE@[512; 517) "\n " |
420 | LET_STMT@[517; 552) | 420 | LET_STMT@[517; 552) |
421 | LET_KW@[517; 520) "let" | 421 | LET_KW@[517; 520) "let" |
@@ -428,7 +428,7 @@ SOURCE_FILE@[0; 555) | |||
428 | COMMA@[526; 527) "," | 428 | COMMA@[526; 527) "," |
429 | WHITESPACE@[527; 528) " " | 429 | WHITESPACE@[527; 528) " " |
430 | DOT_DOT_PAT@[528; 530) | 430 | DOT_DOT_PAT@[528; 530) |
431 | DOTDOT@[528; 530) ".." | 431 | DOT2@[528; 530) ".." |
432 | COMMA@[530; 531) "," | 432 | COMMA@[530; 531) "," |
433 | WHITESPACE@[531; 532) " " | 433 | WHITESPACE@[531; 532) " " |
434 | BIND_PAT@[532; 535) | 434 | BIND_PAT@[532; 535) |
@@ -437,7 +437,7 @@ SOURCE_FILE@[0; 555) | |||
437 | COMMA@[535; 536) "," | 437 | COMMA@[535; 536) "," |
438 | WHITESPACE@[536; 537) " " | 438 | WHITESPACE@[536; 537) " " |
439 | DOT_DOT_PAT@[537; 539) | 439 | DOT_DOT_PAT@[537; 539) |
440 | DOTDOT@[537; 539) ".." | 440 | DOT2@[537; 539) ".." |
441 | COMMA@[539; 540) "," | 441 | COMMA@[539; 540) "," |
442 | WHITESPACE@[540; 541) " " | 442 | WHITESPACE@[540; 541) " " |
443 | BIND_PAT@[541; 545) | 443 | BIND_PAT@[541; 545) |
@@ -450,7 +450,7 @@ SOURCE_FILE@[0; 555) | |||
450 | TUPLE_EXPR@[549; 551) | 450 | TUPLE_EXPR@[549; 551) |
451 | L_PAREN@[549; 550) "(" | 451 | L_PAREN@[549; 550) "(" |
452 | R_PAREN@[550; 551) ")" | 452 | R_PAREN@[550; 551) ")" |
453 | SEMI@[551; 552) ";" | 453 | SEMICOLON@[551; 552) ";" |
454 | WHITESPACE@[552; 553) "\n" | 454 | WHITESPACE@[552; 553) "\n" |
455 | R_CURLY@[553; 554) "}" | 455 | R_CURLY@[553; 554) "}" |
456 | WHITESPACE@[554; 555) "\n" | 456 | WHITESPACE@[554; 555) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast index 06fbdfabf..0d786f597 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0145_record_field_pat.rast | |||
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 63) | |||
39 | TUPLE_EXPR@[32; 34) | 39 | TUPLE_EXPR@[32; 34) |
40 | L_PAREN@[32; 33) "(" | 40 | L_PAREN@[32; 33) "(" |
41 | R_PAREN@[33; 34) ")" | 41 | R_PAREN@[33; 34) ")" |
42 | SEMI@[34; 35) ";" | 42 | SEMICOLON@[34; 35) ";" |
43 | WHITESPACE@[35; 40) "\n " | 43 | WHITESPACE@[35; 40) "\n " |
44 | LET_STMT@[40; 60) | 44 | LET_STMT@[40; 60) |
45 | LET_KW@[40; 43) "let" | 45 | LET_KW@[40; 43) "let" |
@@ -69,7 +69,7 @@ SOURCE_FILE@[0; 63) | |||
69 | TUPLE_EXPR@[57; 59) | 69 | TUPLE_EXPR@[57; 59) |
70 | L_PAREN@[57; 58) "(" | 70 | L_PAREN@[57; 58) "(" |
71 | R_PAREN@[58; 59) ")" | 71 | R_PAREN@[58; 59) ")" |
72 | SEMI@[59; 60) ";" | 72 | SEMICOLON@[59; 60) ";" |
73 | WHITESPACE@[60; 61) "\n" | 73 | WHITESPACE@[60; 61) "\n" |
74 | R_CURLY@[61; 62) "}" | 74 | R_CURLY@[61; 62) "}" |
75 | WHITESPACE@[62; 63) "\n" | 75 | WHITESPACE@[62; 63) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast index 9e3767fb7..d2f6d8fde 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0146_as_precedence.rast | |||
@@ -37,7 +37,7 @@ SOURCE_FILE@[0; 43) | |||
37 | PATH_SEGMENT@[36; 39) | 37 | PATH_SEGMENT@[36; 39) |
38 | NAME_REF@[36; 39) | 38 | NAME_REF@[36; 39) |
39 | IDENT@[36; 39) "i32" | 39 | IDENT@[36; 39) "i32" |
40 | SEMI@[39; 40) ";" | 40 | SEMICOLON@[39; 40) ";" |
41 | WHITESPACE@[40; 41) "\n" | 41 | WHITESPACE@[40; 41) "\n" |
42 | R_CURLY@[41; 42) "}" | 42 | R_CURLY@[41; 42) "}" |
43 | WHITESPACE@[42; 43) "\n" | 43 | WHITESPACE@[42; 43) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast index f81de7bac..21161f7bf 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rast | |||
@@ -19,5 +19,5 @@ SOURCE_FILE@[0; 24) | |||
19 | NAME_REF@[18; 21) | 19 | NAME_REF@[18; 21) |
20 | IDENT@[18; 21) "u32" | 20 | IDENT@[18; 21) "u32" |
21 | R_ANGLE@[21; 22) ">" | 21 | R_ANGLE@[21; 22) ">" |
22 | SEMI@[22; 23) ";" | 22 | SEMICOLON@[22; 23) ";" |
23 | WHITESPACE@[23; 24) "\n" | 23 | WHITESPACE@[23; 24) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast index 78e296f88..1f297e479 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rast | |||
@@ -43,5 +43,5 @@ SOURCE_FILE@[0; 40) | |||
43 | WHITESPACE@[35; 36) " " | 43 | WHITESPACE@[35; 36) " " |
44 | INT_NUMBER@[36; 37) "2" | 44 | INT_NUMBER@[36; 37) "2" |
45 | R_BRACK@[37; 38) "]" | 45 | R_BRACK@[37; 38) "]" |
46 | SEMI@[38; 39) ";" | 46 | SEMICOLON@[38; 39) ";" |
47 | WHITESPACE@[39; 40) "\n" | 47 | WHITESPACE@[39; 40) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast b/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast index de1536ef0..167c0fffa 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0151_trait_alias.rast | |||
@@ -29,7 +29,7 @@ SOURCE_FILE@[0; 83) | |||
29 | NAME_REF@[15; 16) | 29 | NAME_REF@[15; 16) |
30 | IDENT@[15; 16) "U" | 30 | IDENT@[15; 16) "U" |
31 | R_ANGLE@[16; 17) ">" | 31 | R_ANGLE@[16; 17) ">" |
32 | SEMI@[17; 18) ";" | 32 | SEMICOLON@[17; 18) ";" |
33 | WHITESPACE@[18; 19) "\n" | 33 | WHITESPACE@[18; 19) "\n" |
34 | TRAIT_DEF@[19; 51) | 34 | TRAIT_DEF@[19; 51) |
35 | TRAIT_KW@[19; 24) "trait" | 35 | TRAIT_KW@[19; 24) "trait" |
@@ -80,7 +80,7 @@ SOURCE_FILE@[0; 83) | |||
80 | PATH_SEGMENT@[46; 50) | 80 | PATH_SEGMENT@[46; 50) |
81 | NAME_REF@[46; 50) | 81 | NAME_REF@[46; 50) |
82 | IDENT@[46; 50) "Copy" | 82 | IDENT@[46; 50) "Copy" |
83 | SEMI@[50; 51) ";" | 83 | SEMICOLON@[50; 51) ";" |
84 | WHITESPACE@[51; 52) "\n" | 84 | WHITESPACE@[51; 52) "\n" |
85 | TRAIT_DEF@[52; 82) | 85 | TRAIT_DEF@[52; 82) |
86 | TRAIT_KW@[52; 57) "trait" | 86 | TRAIT_KW@[52; 57) "trait" |
@@ -124,5 +124,5 @@ SOURCE_FILE@[0; 83) | |||
124 | NAME_REF@[79; 80) | 124 | NAME_REF@[79; 80) |
125 | IDENT@[79; 80) "U" | 125 | IDENT@[79; 80) "U" |
126 | R_ANGLE@[80; 81) ">" | 126 | R_ANGLE@[80; 81) ">" |
127 | SEMI@[81; 82) ";" | 127 | SEMICOLON@[81; 82) ";" |
128 | WHITESPACE@[82; 83) "\n" | 128 | WHITESPACE@[82; 83) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast b/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast index cb686854a..ee1bd361d 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0154_fn_pointer_param_ident_path.rast | |||
@@ -18,12 +18,12 @@ SOURCE_FILE@[0; 55) | |||
18 | PATH_SEGMENT@[14; 17) | 18 | PATH_SEGMENT@[14; 17) |
19 | NAME_REF@[14; 17) | 19 | NAME_REF@[14; 17) |
20 | IDENT@[14; 17) "Bar" | 20 | IDENT@[14; 17) "Bar" |
21 | COLONCOLON@[17; 19) "::" | 21 | COLON2@[17; 19) "::" |
22 | PATH_SEGMENT@[19; 22) | 22 | PATH_SEGMENT@[19; 22) |
23 | NAME_REF@[19; 22) | 23 | NAME_REF@[19; 22) |
24 | IDENT@[19; 22) "Baz" | 24 | IDENT@[19; 22) "Baz" |
25 | R_PAREN@[22; 23) ")" | 25 | R_PAREN@[22; 23) ")" |
26 | SEMI@[23; 24) ";" | 26 | SEMICOLON@[23; 24) ";" |
27 | WHITESPACE@[24; 25) "\n" | 27 | WHITESPACE@[24; 25) "\n" |
28 | TYPE_ALIAS_DEF@[25; 54) | 28 | TYPE_ALIAS_DEF@[25; 54) |
29 | TYPE_KW@[25; 29) "type" | 29 | TYPE_KW@[25; 29) "type" |
@@ -49,10 +49,10 @@ SOURCE_FILE@[0; 55) | |||
49 | PATH_SEGMENT@[44; 47) | 49 | PATH_SEGMENT@[44; 47) |
50 | NAME_REF@[44; 47) | 50 | NAME_REF@[44; 47) |
51 | IDENT@[44; 47) "Bar" | 51 | IDENT@[44; 47) "Bar" |
52 | COLONCOLON@[47; 49) "::" | 52 | COLON2@[47; 49) "::" |
53 | PATH_SEGMENT@[49; 52) | 53 | PATH_SEGMENT@[49; 52) |
54 | NAME_REF@[49; 52) | 54 | NAME_REF@[49; 52) |
55 | IDENT@[49; 52) "Baz" | 55 | IDENT@[49; 52) "Baz" |
56 | R_PAREN@[52; 53) ")" | 56 | R_PAREN@[52; 53) ")" |
57 | SEMI@[53; 54) ";" | 57 | SEMICOLON@[53; 54) ";" |
58 | WHITESPACE@[54; 55) "\n" | 58 | WHITESPACE@[54; 55) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast index 98727ae98..a5f8b6480 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0155_closure_params.rast | |||
@@ -55,7 +55,7 @@ SOURCE_FILE@[0; 63) | |||
55 | PATH_SEGMENT@[46; 49) | 55 | PATH_SEGMENT@[46; 49) |
56 | NAME_REF@[46; 49) | 56 | NAME_REF@[46; 49) |
57 | IDENT@[46; 49) "Qux" | 57 | IDENT@[46; 49) "Qux" |
58 | COLONCOLON@[49; 51) "::" | 58 | COLON2@[49; 51) "::" |
59 | PATH_SEGMENT@[51; 55) | 59 | PATH_SEGMENT@[51; 55) |
60 | NAME_REF@[51; 55) | 60 | NAME_REF@[51; 55) |
61 | IDENT@[51; 55) "Quux" | 61 | IDENT@[51; 55) "Quux" |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 63) | |||
64 | TUPLE_EXPR@[57; 59) | 64 | TUPLE_EXPR@[57; 59) |
65 | L_PAREN@[57; 58) "(" | 65 | L_PAREN@[57; 58) "(" |
66 | R_PAREN@[58; 59) ")" | 66 | R_PAREN@[58; 59) ")" |
67 | SEMI@[59; 60) ";" | 67 | SEMICOLON@[59; 60) ";" |
68 | WHITESPACE@[60; 61) "\n" | 68 | WHITESPACE@[60; 61) "\n" |
69 | R_CURLY@[61; 62) "}" | 69 | R_CURLY@[61; 62) "}" |
70 | WHITESPACE@[62; 63) "\n" | 70 | WHITESPACE@[62; 63) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast index 52d8f21a4..e0081a9f2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_fn_pointer_unnamed_arg.rast | |||
@@ -22,5 +22,5 @@ SOURCE_FILE@[0; 23) | |||
22 | NAME_REF@[17; 20) | 22 | NAME_REF@[17; 20) |
23 | IDENT@[17; 20) "bar" | 23 | IDENT@[17; 20) "bar" |
24 | R_PAREN@[20; 21) ")" | 24 | R_PAREN@[20; 21) ")" |
25 | SEMI@[21; 22) ";" | 25 | SEMICOLON@[21; 22) ";" |
26 | WHITESPACE@[22; 23) "\n" | 26 | WHITESPACE@[22; 23) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast b/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast index d568a1d45..548be2698 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0158_binop_resets_statementness.rast | |||
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 28) | |||
32 | AMP@[22; 23) "&" | 32 | AMP@[22; 23) "&" |
33 | LITERAL@[23; 24) | 33 | LITERAL@[23; 24) |
34 | INT_NUMBER@[23; 24) "2" | 34 | INT_NUMBER@[23; 24) "2" |
35 | SEMI@[24; 25) ";" | 35 | SEMICOLON@[24; 25) ";" |
36 | WHITESPACE@[25; 26) "\n" | 36 | WHITESPACE@[25; 26) "\n" |
37 | R_CURLY@[26; 27) "}" | 37 | R_CURLY@[26; 27) "}" |
38 | WHITESPACE@[27; 28) "\n" | 38 | WHITESPACE@[27; 28) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast index ba8779094..a7a547fce 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0158_lambda_ret_block.rast | |||
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 34) | |||
39 | ARG_LIST@[28; 30) | 39 | ARG_LIST@[28; 30) |
40 | L_PAREN@[28; 29) "(" | 40 | L_PAREN@[28; 29) "(" |
41 | R_PAREN@[29; 30) ")" | 41 | R_PAREN@[29; 30) ")" |
42 | SEMI@[30; 31) ";" | 42 | SEMICOLON@[30; 31) ";" |
43 | WHITESPACE@[31; 32) " " | 43 | WHITESPACE@[31; 32) " " |
44 | R_CURLY@[32; 33) "}" | 44 | R_CURLY@[32; 33) "}" |
45 | WHITESPACE@[33; 34) "\n" | 45 | WHITESPACE@[33; 34) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0006_inner_attributes.rast b/crates/ra_syntax/test_data/parser/ok/0006_inner_attributes.rast index d72b72561..308b5680f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0006_inner_attributes.rast +++ b/crates/ra_syntax/test_data/parser/ok/0006_inner_attributes.rast | |||
@@ -1,7 +1,7 @@ | |||
1 | SOURCE_FILE@[0; 236) | 1 | SOURCE_FILE@[0; 236) |
2 | ATTR@[0; 8) | 2 | ATTR@[0; 8) |
3 | POUND@[0; 1) "#" | 3 | POUND@[0; 1) "#" |
4 | EXCL@[1; 2) "!" | 4 | BANG@[1; 2) "!" |
5 | L_BRACK@[2; 3) "[" | 5 | L_BRACK@[2; 3) "[" |
6 | PATH@[3; 7) | 6 | PATH@[3; 7) |
7 | PATH_SEGMENT@[3; 7) | 7 | PATH_SEGMENT@[3; 7) |
@@ -11,7 +11,7 @@ SOURCE_FILE@[0; 236) | |||
11 | WHITESPACE@[8; 9) "\n" | 11 | WHITESPACE@[8; 9) "\n" |
12 | ATTR@[9; 23) | 12 | ATTR@[9; 23) |
13 | POUND@[9; 10) "#" | 13 | POUND@[9; 10) "#" |
14 | EXCL@[10; 11) "!" | 14 | BANG@[10; 11) "!" |
15 | L_BRACK@[11; 12) "[" | 15 | L_BRACK@[11; 12) "[" |
16 | PATH@[12; 16) | 16 | PATH@[12; 16) |
17 | PATH_SEGMENT@[12; 16) | 17 | PATH_SEGMENT@[12; 16) |
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 236) | |||
25 | WHITESPACE@[23; 24) "\n" | 25 | WHITESPACE@[23; 24) "\n" |
26 | ATTR@[24; 39) | 26 | ATTR@[24; 39) |
27 | POUND@[24; 25) "#" | 27 | POUND@[24; 25) "#" |
28 | EXCL@[25; 26) "!" | 28 | BANG@[25; 26) "!" |
29 | L_BRACK@[26; 27) "[" | 29 | L_BRACK@[26; 27) "[" |
30 | PATH@[27; 31) | 30 | PATH@[27; 31) |
31 | PATH_SEGMENT@[27; 31) | 31 | PATH_SEGMENT@[27; 31) |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 236) | |||
39 | WHITESPACE@[39; 40) "\n" | 39 | WHITESPACE@[39; 40) "\n" |
40 | ATTR@[40; 116) | 40 | ATTR@[40; 116) |
41 | POUND@[40; 41) "#" | 41 | POUND@[40; 41) "#" |
42 | EXCL@[41; 42) "!" | 42 | BANG@[41; 42) "!" |
43 | L_BRACK@[42; 43) "[" | 43 | L_BRACK@[42; 43) "[" |
44 | PATH@[43; 47) | 44 | PATH@[43; 47) |
45 | PATH_SEGMENT@[43; 47) | 45 | PATH_SEGMENT@[43; 47) |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 236) | |||
83 | WHITESPACE@[116; 117) "\n" | 83 | WHITESPACE@[116; 117) "\n" |
84 | ATTR@[117; 130) | 84 | ATTR@[117; 130) |
85 | POUND@[117; 118) "#" | 85 | POUND@[117; 118) "#" |
86 | EXCL@[118; 119) "!" | 86 | BANG@[118; 119) "!" |
87 | L_BRACK@[119; 120) "[" | 87 | L_BRACK@[119; 120) "[" |
88 | PATH@[120; 124) | 88 | PATH@[120; 124) |
89 | PATH_SEGMENT@[120; 124) | 89 | PATH_SEGMENT@[120; 124) |
@@ -97,7 +97,7 @@ SOURCE_FILE@[0; 236) | |||
97 | WHITESPACE@[130; 131) "\n" | 97 | WHITESPACE@[130; 131) "\n" |
98 | ATTR@[131; 155) | 98 | ATTR@[131; 155) |
99 | POUND@[131; 132) "#" | 99 | POUND@[131; 132) "#" |
100 | EXCL@[132; 133) "!" | 100 | BANG@[132; 133) "!" |
101 | L_BRACK@[133; 134) "[" | 101 | L_BRACK@[133; 134) "[" |
102 | PATH@[134; 138) | 102 | PATH@[134; 138) |
103 | PATH_SEGMENT@[134; 138) | 103 | PATH_SEGMENT@[134; 138) |
@@ -115,7 +115,7 @@ SOURCE_FILE@[0; 236) | |||
115 | WHITESPACE@[155; 156) "\n" | 115 | WHITESPACE@[155; 156) "\n" |
116 | ATTR@[156; 173) | 116 | ATTR@[156; 173) |
117 | POUND@[156; 157) "#" | 117 | POUND@[156; 157) "#" |
118 | EXCL@[157; 158) "!" | 118 | BANG@[157; 158) "!" |
119 | L_BRACK@[158; 159) "[" | 119 | L_BRACK@[158; 159) "[" |
120 | PATH@[159; 166) | 120 | PATH@[159; 166) |
121 | PATH_SEGMENT@[159; 166) | 121 | PATH_SEGMENT@[159; 166) |
@@ -129,7 +129,7 @@ SOURCE_FILE@[0; 236) | |||
129 | WHITESPACE@[173; 174) "\n" | 129 | WHITESPACE@[173; 174) "\n" |
130 | ATTR@[174; 191) | 130 | ATTR@[174; 191) |
131 | POUND@[174; 175) "#" | 131 | POUND@[174; 175) "#" |
132 | EXCL@[175; 176) "!" | 132 | BANG@[175; 176) "!" |
133 | L_BRACK@[176; 177) "[" | 133 | L_BRACK@[176; 177) "[" |
134 | PATH@[177; 181) | 134 | PATH@[177; 181) |
135 | PATH_SEGMENT@[177; 181) | 135 | PATH_SEGMENT@[177; 181) |
@@ -143,7 +143,7 @@ SOURCE_FILE@[0; 236) | |||
143 | WHITESPACE@[191; 192) "\n" | 143 | WHITESPACE@[191; 192) "\n" |
144 | ATTR@[192; 214) | 144 | ATTR@[192; 214) |
145 | POUND@[192; 193) "#" | 145 | POUND@[192; 193) "#" |
146 | EXCL@[193; 194) "!" | 146 | BANG@[193; 194) "!" |
147 | L_BRACK@[194; 195) "[" | 147 | L_BRACK@[194; 195) "[" |
148 | PATH@[195; 199) | 148 | PATH@[195; 199) |
149 | PATH_SEGMENT@[195; 199) | 149 | PATH_SEGMENT@[195; 199) |
@@ -164,7 +164,7 @@ SOURCE_FILE@[0; 236) | |||
164 | WHITESPACE@[214; 215) "\n" | 164 | WHITESPACE@[214; 215) "\n" |
165 | ATTR@[215; 236) | 165 | ATTR@[215; 236) |
166 | POUND@[215; 216) "#" | 166 | POUND@[215; 216) "#" |
167 | EXCL@[216; 217) "!" | 167 | BANG@[216; 217) "!" |
168 | L_BRACK@[217; 218) "[" | 168 | L_BRACK@[217; 218) "[" |
169 | PATH@[218; 222) | 169 | PATH@[218; 222) |
170 | PATH_SEGMENT@[218; 222) | 170 | PATH_SEGMENT@[218; 222) |
diff --git a/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast b/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast index 1ffa36c7e..4856b4f81 100644 --- a/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast +++ b/crates/ra_syntax/test_data/parser/ok/0007_extern_crate.rast | |||
@@ -6,7 +6,7 @@ SOURCE_FILE@[0; 69) | |||
6 | WHITESPACE@[12; 13) " " | 6 | WHITESPACE@[12; 13) " " |
7 | NAME_REF@[13; 16) | 7 | NAME_REF@[13; 16) |
8 | IDENT@[13; 16) "foo" | 8 | IDENT@[13; 16) "foo" |
9 | SEMI@[16; 17) ";" | 9 | SEMICOLON@[16; 17) ";" |
10 | WHITESPACE@[17; 18) "\n" | 10 | WHITESPACE@[17; 18) "\n" |
11 | EXTERN_CRATE_ITEM@[18; 42) | 11 | EXTERN_CRATE_ITEM@[18; 42) |
12 | EXTERN_KW@[18; 24) "extern" | 12 | EXTERN_KW@[18; 24) "extern" |
@@ -21,7 +21,7 @@ SOURCE_FILE@[0; 69) | |||
21 | WHITESPACE@[37; 38) " " | 21 | WHITESPACE@[37; 38) " " |
22 | NAME@[38; 41) | 22 | NAME@[38; 41) |
23 | IDENT@[38; 41) "bar" | 23 | IDENT@[38; 41) "bar" |
24 | SEMI@[41; 42) ";" | 24 | SEMICOLON@[41; 42) ";" |
25 | WHITESPACE@[42; 43) "\n" | 25 | WHITESPACE@[42; 43) "\n" |
26 | EXTERN_CRATE_ITEM@[43; 68) | 26 | EXTERN_CRATE_ITEM@[43; 68) |
27 | EXTERN_KW@[43; 49) "extern" | 27 | EXTERN_KW@[43; 49) "extern" |
@@ -36,5 +36,5 @@ SOURCE_FILE@[0; 69) | |||
36 | WHITESPACE@[63; 64) " " | 36 | WHITESPACE@[63; 64) " " |
37 | NAME@[64; 67) | 37 | NAME@[64; 67) |
38 | IDENT@[64; 67) "baz" | 38 | IDENT@[64; 67) "baz" |
39 | SEMI@[67; 68) ";" | 39 | SEMICOLON@[67; 68) ";" |
40 | WHITESPACE@[68; 69) "\n" | 40 | WHITESPACE@[68; 69) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast index 061019a73..1c18edd4e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0008_mod_item.rast | |||
@@ -4,7 +4,7 @@ SOURCE_FILE@[0; 118) | |||
4 | WHITESPACE@[3; 4) " " | 4 | WHITESPACE@[3; 4) " " |
5 | NAME@[4; 5) | 5 | NAME@[4; 5) |
6 | IDENT@[4; 5) "a" | 6 | IDENT@[4; 5) "a" |
7 | SEMI@[5; 6) ";" | 7 | SEMICOLON@[5; 6) ";" |
8 | WHITESPACE@[6; 8) "\n\n" | 8 | WHITESPACE@[6; 8) "\n\n" |
9 | MODULE@[8; 17) | 9 | MODULE@[8; 17) |
10 | MOD_KW@[8; 11) "mod" | 10 | MOD_KW@[8; 11) "mod" |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 118) | |||
64 | WHITESPACE@[74; 79) "\n " | 64 | WHITESPACE@[74; 79) "\n " |
65 | ATTR@[79; 87) | 65 | ATTR@[79; 87) |
66 | POUND@[79; 80) "#" | 66 | POUND@[79; 80) "#" |
67 | EXCL@[80; 81) "!" | 67 | BANG@[80; 81) "!" |
68 | L_BRACK@[81; 82) "[" | 68 | L_BRACK@[81; 82) "[" |
69 | PATH@[82; 86) | 69 | PATH@[82; 86) |
70 | PATH_SEGMENT@[82; 86) | 70 | PATH_SEGMENT@[82; 86) |
@@ -77,7 +77,7 @@ SOURCE_FILE@[0; 118) | |||
77 | WHITESPACE@[95; 96) " " | 77 | WHITESPACE@[95; 96) " " |
78 | NAME@[96; 97) | 78 | NAME@[96; 97) |
79 | IDENT@[96; 97) "e" | 79 | IDENT@[96; 97) "e" |
80 | SEMI@[97; 98) ";" | 80 | SEMICOLON@[97; 98) ";" |
81 | WHITESPACE@[98; 103) "\n " | 81 | WHITESPACE@[98; 103) "\n " |
82 | MODULE@[103; 116) | 82 | MODULE@[103; 116) |
83 | MOD_KW@[103; 106) "mod" | 83 | MOD_KW@[103; 106) "mod" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0009_use_item.rast b/crates/ra_syntax/test_data/parser/ok/0009_use_item.rast index 41db9dbb7..62a8ae433 100644 --- a/crates/ra_syntax/test_data/parser/ok/0009_use_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0009_use_item.rast | |||
@@ -7,7 +7,7 @@ SOURCE_FILE@[0; 19) | |||
7 | PATH_SEGMENT@[4; 7) | 7 | PATH_SEGMENT@[4; 7) |
8 | NAME_REF@[4; 7) | 8 | NAME_REF@[4; 7) |
9 | IDENT@[4; 7) "foo" | 9 | IDENT@[4; 7) "foo" |
10 | SEMI@[7; 8) ";" | 10 | SEMICOLON@[7; 8) ";" |
11 | WHITESPACE@[8; 9) "\n" | 11 | WHITESPACE@[8; 9) "\n" |
12 | USE_ITEM@[9; 19) | 12 | USE_ITEM@[9; 19) |
13 | USE_KW@[9; 12) "use" | 13 | USE_KW@[9; 12) "use" |
@@ -15,7 +15,7 @@ SOURCE_FILE@[0; 19) | |||
15 | USE_TREE@[13; 18) | 15 | USE_TREE@[13; 18) |
16 | PATH@[13; 18) | 16 | PATH@[13; 18) |
17 | PATH_SEGMENT@[13; 18) | 17 | PATH_SEGMENT@[13; 18) |
18 | COLONCOLON@[13; 15) "::" | 18 | COLON2@[13; 15) "::" |
19 | NAME_REF@[15; 18) | 19 | NAME_REF@[15; 18) |
20 | IDENT@[15; 18) "bar" | 20 | IDENT@[15; 18) "bar" |
21 | SEMI@[18; 19) ";" | 21 | SEMICOLON@[18; 19) ";" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0010_use_path_segments.rast b/crates/ra_syntax/test_data/parser/ok/0010_use_path_segments.rast index 09871b84d..f2689e1ed 100644 --- a/crates/ra_syntax/test_data/parser/ok/0010_use_path_segments.rast +++ b/crates/ra_syntax/test_data/parser/ok/0010_use_path_segments.rast | |||
@@ -7,18 +7,18 @@ SOURCE_FILE@[0; 40) | |||
7 | PATH@[4; 14) | 7 | PATH@[4; 14) |
8 | PATH@[4; 9) | 8 | PATH@[4; 9) |
9 | PATH_SEGMENT@[4; 9) | 9 | PATH_SEGMENT@[4; 9) |
10 | COLONCOLON@[4; 6) "::" | 10 | COLON2@[4; 6) "::" |
11 | NAME_REF@[6; 9) | 11 | NAME_REF@[6; 9) |
12 | IDENT@[6; 9) "foo" | 12 | IDENT@[6; 9) "foo" |
13 | COLONCOLON@[9; 11) "::" | 13 | COLON2@[9; 11) "::" |
14 | PATH_SEGMENT@[11; 14) | 14 | PATH_SEGMENT@[11; 14) |
15 | NAME_REF@[11; 14) | 15 | NAME_REF@[11; 14) |
16 | IDENT@[11; 14) "bar" | 16 | IDENT@[11; 14) "bar" |
17 | COLONCOLON@[14; 16) "::" | 17 | COLON2@[14; 16) "::" |
18 | PATH_SEGMENT@[16; 19) | 18 | PATH_SEGMENT@[16; 19) |
19 | NAME_REF@[16; 19) | 19 | NAME_REF@[16; 19) |
20 | IDENT@[16; 19) "baz" | 20 | IDENT@[16; 19) "baz" |
21 | SEMI@[19; 20) ";" | 21 | SEMICOLON@[19; 20) ";" |
22 | WHITESPACE@[20; 21) "\n" | 22 | WHITESPACE@[20; 21) "\n" |
23 | USE_ITEM@[21; 39) | 23 | USE_ITEM@[21; 39) |
24 | USE_KW@[21; 24) "use" | 24 | USE_KW@[21; 24) "use" |
@@ -30,13 +30,13 @@ SOURCE_FILE@[0; 40) | |||
30 | PATH_SEGMENT@[25; 28) | 30 | PATH_SEGMENT@[25; 28) |
31 | NAME_REF@[25; 28) | 31 | NAME_REF@[25; 28) |
32 | IDENT@[25; 28) "foo" | 32 | IDENT@[25; 28) "foo" |
33 | COLONCOLON@[28; 30) "::" | 33 | COLON2@[28; 30) "::" |
34 | PATH_SEGMENT@[30; 33) | 34 | PATH_SEGMENT@[30; 33) |
35 | NAME_REF@[30; 33) | 35 | NAME_REF@[30; 33) |
36 | IDENT@[30; 33) "bar" | 36 | IDENT@[30; 33) "bar" |
37 | COLONCOLON@[33; 35) "::" | 37 | COLON2@[33; 35) "::" |
38 | PATH_SEGMENT@[35; 38) | 38 | PATH_SEGMENT@[35; 38) |
39 | NAME_REF@[35; 38) | 39 | NAME_REF@[35; 38) |
40 | IDENT@[35; 38) "baz" | 40 | IDENT@[35; 38) "baz" |
41 | SEMI@[38; 39) ";" | 41 | SEMICOLON@[38; 39) ";" |
42 | WHITESPACE@[39; 40) "\n" | 42 | WHITESPACE@[39; 40) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast b/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast index f7aa8afe4..4426d586a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast +++ b/crates/ra_syntax/test_data/parser/ok/0011_outer_attribute.rast | |||
@@ -54,5 +54,5 @@ SOURCE_FILE@[0; 60) | |||
54 | WHITESPACE@[56; 57) " " | 54 | WHITESPACE@[56; 57) " " |
55 | NAME@[57; 58) | 55 | NAME@[57; 58) |
56 | IDENT@[57; 58) "b" | 56 | IDENT@[57; 58) "b" |
57 | SEMI@[58; 59) ";" | 57 | SEMICOLON@[58; 59) ";" |
58 | WHITESPACE@[59; 60) "\n" | 58 | WHITESPACE@[59; 60) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast b/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast index 68e692fd0..c76cf9fe9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast +++ b/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast | |||
@@ -82,11 +82,11 @@ SOURCE_FILE@[0; 98) | |||
82 | PATH_SEGMENT@[73; 76) | 82 | PATH_SEGMENT@[73; 76) |
83 | NAME_REF@[73; 76) | 83 | NAME_REF@[73; 76) |
84 | IDENT@[73; 76) "foo" | 84 | IDENT@[73; 76) "foo" |
85 | COLONCOLON@[76; 78) "::" | 85 | COLON2@[76; 78) "::" |
86 | PATH_SEGMENT@[78; 81) | 86 | PATH_SEGMENT@[78; 81) |
87 | NAME_REF@[78; 81) | 87 | NAME_REF@[78; 81) |
88 | IDENT@[78; 81) "bar" | 88 | IDENT@[78; 81) "bar" |
89 | COLONCOLON@[81; 83) "::" | 89 | COLON2@[81; 83) "::" |
90 | PATH_SEGMENT@[83; 86) | 90 | PATH_SEGMENT@[83; 86) |
91 | NAME_REF@[83; 86) | 91 | NAME_REF@[83; 86) |
92 | IDENT@[83; 86) "baz" | 92 | IDENT@[83; 86) "baz" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0013_use_path_self_super.rast b/crates/ra_syntax/test_data/parser/ok/0013_use_path_self_super.rast index 50730e958..552cb3daf 100644 --- a/crates/ra_syntax/test_data/parser/ok/0013_use_path_self_super.rast +++ b/crates/ra_syntax/test_data/parser/ok/0013_use_path_self_super.rast | |||
@@ -7,11 +7,11 @@ SOURCE_FILE@[0; 65) | |||
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 | SELF_KW@[4; 8) "self" |
10 | COLONCOLON@[8; 10) "::" | 10 | COLON2@[8; 10) "::" |
11 | PATH_SEGMENT@[10; 13) | 11 | PATH_SEGMENT@[10; 13) |
12 | NAME_REF@[10; 13) | 12 | NAME_REF@[10; 13) |
13 | IDENT@[10; 13) "foo" | 13 | IDENT@[10; 13) "foo" |
14 | SEMI@[13; 14) ";" | 14 | SEMICOLON@[13; 14) ";" |
15 | WHITESPACE@[14; 15) "\n" | 15 | WHITESPACE@[14; 15) "\n" |
16 | USE_ITEM@[15; 37) | 16 | USE_ITEM@[15; 37) |
17 | USE_KW@[15; 18) "use" | 17 | USE_KW@[15; 18) "use" |
@@ -22,14 +22,14 @@ SOURCE_FILE@[0; 65) | |||
22 | PATH@[19; 24) | 22 | PATH@[19; 24) |
23 | PATH_SEGMENT@[19; 24) | 23 | PATH_SEGMENT@[19; 24) |
24 | SUPER_KW@[19; 24) "super" | 24 | SUPER_KW@[19; 24) "super" |
25 | COLONCOLON@[24; 26) "::" | 25 | COLON2@[24; 26) "::" |
26 | PATH_SEGMENT@[26; 31) | 26 | PATH_SEGMENT@[26; 31) |
27 | SUPER_KW@[26; 31) "super" | 27 | SUPER_KW@[26; 31) "super" |
28 | COLONCOLON@[31; 33) "::" | 28 | COLON2@[31; 33) "::" |
29 | PATH_SEGMENT@[33; 36) | 29 | PATH_SEGMENT@[33; 36) |
30 | NAME_REF@[33; 36) | 30 | NAME_REF@[33; 36) |
31 | IDENT@[33; 36) "bar" | 31 | IDENT@[33; 36) "bar" |
32 | SEMI@[36; 37) ";" | 32 | SEMICOLON@[36; 37) ";" |
33 | WHITESPACE@[37; 38) "\n" | 33 | WHITESPACE@[37; 38) "\n" |
34 | USE_ITEM@[38; 64) | 34 | USE_ITEM@[38; 64) |
35 | USE_KW@[38; 41) "use" | 35 | USE_KW@[38; 41) "use" |
@@ -40,18 +40,18 @@ SOURCE_FILE@[0; 65) | |||
40 | PATH@[42; 51) | 40 | PATH@[42; 51) |
41 | PATH@[42; 48) | 41 | PATH@[42; 48) |
42 | PATH_SEGMENT@[42; 48) | 42 | PATH_SEGMENT@[42; 48) |
43 | COLONCOLON@[42; 44) "::" | 43 | COLON2@[42; 44) "::" |
44 | SELF_KW@[44; 48) "self" | 44 | SELF_KW@[44; 48) "self" |
45 | COLONCOLON@[48; 50) "::" | 45 | COLON2@[48; 50) "::" |
46 | PATH_SEGMENT@[50; 51) | 46 | PATH_SEGMENT@[50; 51) |
47 | NAME_REF@[50; 51) | 47 | NAME_REF@[50; 51) |
48 | IDENT@[50; 51) "a" | 48 | IDENT@[50; 51) "a" |
49 | COLONCOLON@[51; 53) "::" | 49 | COLON2@[51; 53) "::" |
50 | PATH_SEGMENT@[53; 58) | 50 | PATH_SEGMENT@[53; 58) |
51 | SUPER_KW@[53; 58) "super" | 51 | SUPER_KW@[53; 58) "super" |
52 | COLONCOLON@[58; 60) "::" | 52 | COLON2@[58; 60) "::" |
53 | PATH_SEGMENT@[60; 63) | 53 | PATH_SEGMENT@[60; 63) |
54 | NAME_REF@[60; 63) | 54 | NAME_REF@[60; 63) |
55 | IDENT@[60; 63) "bar" | 55 | IDENT@[60; 63) "bar" |
56 | SEMI@[63; 64) ";" | 56 | SEMICOLON@[63; 64) ";" |
57 | WHITESPACE@[64; 65) "\n" | 57 | WHITESPACE@[64; 65) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0014_use_tree.rast b/crates/ra_syntax/test_data/parser/ok/0014_use_tree.rast index 3fe34d001..49a68e881 100644 --- a/crates/ra_syntax/test_data/parser/ok/0014_use_tree.rast +++ b/crates/ra_syntax/test_data/parser/ok/0014_use_tree.rast | |||
@@ -4,25 +4,25 @@ SOURCE_FILE@[0; 81) | |||
4 | WHITESPACE@[3; 4) " " | 4 | WHITESPACE@[3; 4) " " |
5 | USE_TREE@[4; 5) | 5 | USE_TREE@[4; 5) |
6 | STAR@[4; 5) "*" | 6 | STAR@[4; 5) "*" |
7 | SEMI@[5; 6) ";" | 7 | SEMICOLON@[5; 6) ";" |
8 | WHITESPACE@[6; 7) "\n" | 8 | WHITESPACE@[6; 7) "\n" |
9 | USE_ITEM@[7; 15) | 9 | USE_ITEM@[7; 15) |
10 | USE_KW@[7; 10) "use" | 10 | USE_KW@[7; 10) "use" |
11 | WHITESPACE@[10; 11) " " | 11 | WHITESPACE@[10; 11) " " |
12 | USE_TREE@[11; 14) | 12 | USE_TREE@[11; 14) |
13 | COLONCOLON@[11; 13) "::" | 13 | COLON2@[11; 13) "::" |
14 | STAR@[13; 14) "*" | 14 | STAR@[13; 14) "*" |
15 | SEMI@[14; 15) ";" | 15 | SEMICOLON@[14; 15) ";" |
16 | WHITESPACE@[15; 16) "\n" | 16 | WHITESPACE@[15; 16) "\n" |
17 | USE_ITEM@[16; 25) | 17 | USE_ITEM@[16; 25) |
18 | USE_KW@[16; 19) "use" | 18 | USE_KW@[16; 19) "use" |
19 | WHITESPACE@[19; 20) " " | 19 | WHITESPACE@[19; 20) " " |
20 | USE_TREE@[20; 24) | 20 | USE_TREE@[20; 24) |
21 | COLONCOLON@[20; 22) "::" | 21 | COLON2@[20; 22) "::" |
22 | USE_TREE_LIST@[22; 24) | 22 | USE_TREE_LIST@[22; 24) |
23 | L_CURLY@[22; 23) "{" | 23 | L_CURLY@[22; 23) "{" |
24 | R_CURLY@[23; 24) "}" | 24 | R_CURLY@[23; 24) "}" |
25 | SEMI@[24; 25) ";" | 25 | SEMICOLON@[24; 25) ";" |
26 | WHITESPACE@[25; 26) "\n" | 26 | WHITESPACE@[25; 26) "\n" |
27 | USE_ITEM@[26; 33) | 27 | USE_ITEM@[26; 33) |
28 | USE_KW@[26; 29) "use" | 28 | USE_KW@[26; 29) "use" |
@@ -31,7 +31,7 @@ SOURCE_FILE@[0; 81) | |||
31 | USE_TREE_LIST@[30; 32) | 31 | USE_TREE_LIST@[30; 32) |
32 | L_CURLY@[30; 31) "{" | 32 | L_CURLY@[30; 31) "{" |
33 | R_CURLY@[31; 32) "}" | 33 | R_CURLY@[31; 32) "}" |
34 | SEMI@[32; 33) ";" | 34 | SEMICOLON@[32; 33) ";" |
35 | WHITESPACE@[33; 34) "\n" | 35 | WHITESPACE@[33; 34) "\n" |
36 | USE_ITEM@[34; 45) | 36 | USE_ITEM@[34; 45) |
37 | USE_KW@[34; 37) "use" | 37 | USE_KW@[34; 37) "use" |
@@ -41,9 +41,9 @@ SOURCE_FILE@[0; 81) | |||
41 | PATH_SEGMENT@[38; 41) | 41 | PATH_SEGMENT@[38; 41) |
42 | NAME_REF@[38; 41) | 42 | NAME_REF@[38; 41) |
43 | IDENT@[38; 41) "foo" | 43 | IDENT@[38; 41) "foo" |
44 | COLONCOLON@[41; 43) "::" | 44 | COLON2@[41; 43) "::" |
45 | STAR@[43; 44) "*" | 45 | STAR@[43; 44) "*" |
46 | SEMI@[44; 45) ";" | 46 | SEMICOLON@[44; 45) ";" |
47 | WHITESPACE@[45; 46) "\n" | 47 | WHITESPACE@[45; 46) "\n" |
48 | USE_ITEM@[46; 58) | 48 | USE_ITEM@[46; 58) |
49 | USE_KW@[46; 49) "use" | 49 | USE_KW@[46; 49) "use" |
@@ -53,11 +53,11 @@ SOURCE_FILE@[0; 81) | |||
53 | PATH_SEGMENT@[50; 53) | 53 | PATH_SEGMENT@[50; 53) |
54 | NAME_REF@[50; 53) | 54 | NAME_REF@[50; 53) |
55 | IDENT@[50; 53) "foo" | 55 | IDENT@[50; 53) "foo" |
56 | COLONCOLON@[53; 55) "::" | 56 | COLON2@[53; 55) "::" |
57 | USE_TREE_LIST@[55; 57) | 57 | USE_TREE_LIST@[55; 57) |
58 | L_CURLY@[55; 56) "{" | 58 | L_CURLY@[55; 56) "{" |
59 | R_CURLY@[56; 57) "}" | 59 | R_CURLY@[56; 57) "}" |
60 | SEMI@[57; 58) ";" | 60 | SEMICOLON@[57; 58) ";" |
61 | WHITESPACE@[58; 59) "\n" | 61 | WHITESPACE@[58; 59) "\n" |
62 | USE_ITEM@[59; 80) | 62 | USE_ITEM@[59; 80) |
63 | USE_KW@[59; 62) "use" | 63 | USE_KW@[59; 62) "use" |
@@ -65,10 +65,10 @@ SOURCE_FILE@[0; 81) | |||
65 | USE_TREE@[63; 79) | 65 | USE_TREE@[63; 79) |
66 | PATH@[63; 68) | 66 | PATH@[63; 68) |
67 | PATH_SEGMENT@[63; 68) | 67 | PATH_SEGMENT@[63; 68) |
68 | COLONCOLON@[63; 65) "::" | 68 | COLON2@[63; 65) "::" |
69 | NAME_REF@[65; 68) | 69 | NAME_REF@[65; 68) |
70 | IDENT@[65; 68) "foo" | 70 | IDENT@[65; 68) "foo" |
71 | COLONCOLON@[68; 70) "::" | 71 | COLON2@[68; 70) "::" |
72 | USE_TREE_LIST@[70; 79) | 72 | USE_TREE_LIST@[70; 79) |
73 | L_CURLY@[70; 71) "{" | 73 | L_CURLY@[70; 71) "{" |
74 | USE_TREE@[71; 72) | 74 | USE_TREE@[71; 72) |
@@ -91,5 +91,5 @@ SOURCE_FILE@[0; 81) | |||
91 | NAME_REF@[77; 78) | 91 | NAME_REF@[77; 78) |
92 | IDENT@[77; 78) "c" | 92 | IDENT@[77; 78) "c" |
93 | R_CURLY@[78; 79) "}" | 93 | R_CURLY@[78; 79) "}" |
94 | SEMI@[79; 80) ";" | 94 | SEMICOLON@[79; 80) ";" |
95 | WHITESPACE@[80; 81) "\n" | 95 | WHITESPACE@[80; 81) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast b/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast index e63f14253..719ac98ef 100644 --- a/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast +++ b/crates/ra_syntax/test_data/parser/ok/0015_use_tree.rast | |||
@@ -13,7 +13,7 @@ SOURCE_FILE@[0; 55) | |||
13 | WHITESPACE@[10; 11) " " | 13 | WHITESPACE@[10; 11) " " |
14 | NAME@[11; 14) | 14 | NAME@[11; 14) |
15 | IDENT@[11; 14) "bar" | 15 | IDENT@[11; 14) "bar" |
16 | SEMI@[14; 15) ";" | 16 | SEMICOLON@[14; 15) ";" |
17 | WHITESPACE@[15; 16) "\n" | 17 | WHITESPACE@[15; 16) "\n" |
18 | USE_ITEM@[16; 54) | 18 | USE_ITEM@[16; 54) |
19 | USE_KW@[16; 19) "use" | 19 | USE_KW@[16; 19) "use" |
@@ -23,7 +23,7 @@ SOURCE_FILE@[0; 55) | |||
23 | PATH_SEGMENT@[20; 23) | 23 | PATH_SEGMENT@[20; 23) |
24 | NAME_REF@[20; 23) | 24 | NAME_REF@[20; 23) |
25 | IDENT@[20; 23) "foo" | 25 | IDENT@[20; 23) "foo" |
26 | COLONCOLON@[23; 25) "::" | 26 | COLON2@[23; 25) "::" |
27 | USE_TREE_LIST@[25; 53) | 27 | USE_TREE_LIST@[25; 53) |
28 | L_CURLY@[25; 26) "{" | 28 | L_CURLY@[25; 26) "{" |
29 | USE_TREE@[26; 32) | 29 | USE_TREE@[26; 32) |
@@ -44,14 +44,14 @@ SOURCE_FILE@[0; 55) | |||
44 | COMMA@[35; 36) "," | 44 | COMMA@[35; 36) "," |
45 | WHITESPACE@[36; 37) " " | 45 | WHITESPACE@[36; 37) " " |
46 | USE_TREE@[37; 40) | 46 | USE_TREE@[37; 40) |
47 | COLONCOLON@[37; 39) "::" | 47 | COLON2@[37; 39) "::" |
48 | STAR@[39; 40) "*" | 48 | STAR@[39; 40) "*" |
49 | COMMA@[40; 41) "," | 49 | COMMA@[40; 41) "," |
50 | WHITESPACE@[41; 42) " " | 50 | WHITESPACE@[41; 42) " " |
51 | USE_TREE@[42; 52) | 51 | USE_TREE@[42; 52) |
52 | PATH@[42; 47) | 52 | PATH@[42; 47) |
53 | PATH_SEGMENT@[42; 47) | 53 | PATH_SEGMENT@[42; 47) |
54 | COLONCOLON@[42; 44) "::" | 54 | COLON2@[42; 44) "::" |
55 | NAME_REF@[44; 47) | 55 | NAME_REF@[44; 47) |
56 | IDENT@[44; 47) "foo" | 56 | IDENT@[44; 47) "foo" |
57 | WHITESPACE@[47; 48) " " | 57 | WHITESPACE@[47; 48) " " |
@@ -61,5 +61,5 @@ SOURCE_FILE@[0; 55) | |||
61 | NAME@[51; 52) | 61 | NAME@[51; 52) |
62 | IDENT@[51; 52) "x" | 62 | IDENT@[51; 52) "x" |
63 | R_CURLY@[52; 53) "}" | 63 | R_CURLY@[52; 53) "}" |
64 | SEMI@[53; 54) ";" | 64 | SEMICOLON@[53; 54) ";" |
65 | WHITESPACE@[54; 55) "\n" | 65 | WHITESPACE@[54; 55) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast b/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast index 3fbd14d7b..f4739451e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast +++ b/crates/ra_syntax/test_data/parser/ok/0016_struct_flavors.rast | |||
@@ -4,7 +4,7 @@ SOURCE_FILE@[0; 97) | |||
4 | WHITESPACE@[6; 7) " " | 4 | WHITESPACE@[6; 7) " " |
5 | NAME@[7; 8) | 5 | NAME@[7; 8) |
6 | IDENT@[7; 8) "A" | 6 | IDENT@[7; 8) "A" |
7 | SEMI@[8; 9) ";" | 7 | SEMICOLON@[8; 9) ";" |
8 | WHITESPACE@[9; 10) "\n" | 8 | WHITESPACE@[9; 10) "\n" |
9 | STRUCT_DEF@[10; 21) | 9 | STRUCT_DEF@[10; 21) |
10 | STRUCT_KW@[10; 16) "struct" | 10 | STRUCT_KW@[10; 16) "struct" |
@@ -24,7 +24,7 @@ SOURCE_FILE@[0; 97) | |||
24 | TUPLE_FIELD_DEF_LIST@[30; 32) | 24 | TUPLE_FIELD_DEF_LIST@[30; 32) |
25 | L_PAREN@[30; 31) "(" | 25 | L_PAREN@[30; 31) "(" |
26 | R_PAREN@[31; 32) ")" | 26 | R_PAREN@[31; 32) ")" |
27 | SEMI@[32; 33) ";" | 27 | SEMICOLON@[32; 33) ";" |
28 | WHITESPACE@[33; 35) "\n\n" | 28 | WHITESPACE@[33; 35) "\n\n" |
29 | STRUCT_DEF@[35; 74) | 29 | STRUCT_DEF@[35; 74) |
30 | STRUCT_KW@[35; 41) "struct" | 30 | STRUCT_KW@[35; 41) "struct" |
@@ -89,5 +89,5 @@ SOURCE_FILE@[0; 97) | |||
89 | IDENT@[92; 93) "y" | 89 | IDENT@[92; 93) "y" |
90 | COMMA@[93; 94) "," | 90 | COMMA@[93; 94) "," |
91 | R_PAREN@[94; 95) ")" | 91 | R_PAREN@[94; 95) ")" |
92 | SEMI@[95; 96) ";" | 92 | SEMICOLON@[95; 96) ";" |
93 | WHITESPACE@[96; 97) "\n" | 93 | WHITESPACE@[96; 97) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast b/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast index 1e4e58dd3..5e859ef29 100644 --- a/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast +++ b/crates/ra_syntax/test_data/parser/ok/0018_struct_type_params.rast | |||
@@ -10,7 +10,7 @@ SOURCE_FILE@[0; 290) | |||
10 | NAME@[10; 11) | 10 | NAME@[10; 11) |
11 | IDENT@[10; 11) "T" | 11 | IDENT@[10; 11) "T" |
12 | R_ANGLE@[11; 12) ">" | 12 | R_ANGLE@[11; 12) ">" |
13 | SEMI@[12; 13) ";" | 13 | SEMICOLON@[12; 13) ";" |
14 | WHITESPACE@[13; 14) "\n" | 14 | WHITESPACE@[13; 14) "\n" |
15 | STRUCT_DEF@[14; 32) | 15 | STRUCT_DEF@[14; 32) |
16 | STRUCT_KW@[14; 20) "struct" | 16 | STRUCT_KW@[14; 20) "struct" |
@@ -32,7 +32,7 @@ SOURCE_FILE@[0; 290) | |||
32 | NAME_REF@[27; 30) | 32 | NAME_REF@[27; 30) |
33 | IDENT@[27; 30) "u32" | 33 | IDENT@[27; 30) "u32" |
34 | R_PAREN@[30; 31) ")" | 34 | R_PAREN@[30; 31) ")" |
35 | SEMI@[31; 32) ";" | 35 | SEMICOLON@[31; 32) ";" |
36 | WHITESPACE@[32; 33) "\n" | 36 | WHITESPACE@[32; 33) "\n" |
37 | STRUCT_DEF@[33; 56) | 37 | STRUCT_DEF@[33; 56) |
38 | STRUCT_KW@[33; 39) "struct" | 38 | STRUCT_KW@[33; 39) "struct" |
@@ -70,7 +70,7 @@ SOURCE_FILE@[0; 290) | |||
70 | TYPE_PARAM_LIST@[67; 69) | 70 | TYPE_PARAM_LIST@[67; 69) |
71 | L_ANGLE@[67; 68) "<" | 71 | L_ANGLE@[67; 68) "<" |
72 | R_ANGLE@[68; 69) ">" | 72 | R_ANGLE@[68; 69) ">" |
73 | SEMI@[69; 70) ";" | 73 | SEMICOLON@[69; 70) ";" |
74 | WHITESPACE@[70; 71) "\n" | 74 | WHITESPACE@[70; 71) "\n" |
75 | STRUCT_DEF@[71; 85) | 75 | STRUCT_DEF@[71; 85) |
76 | STRUCT_KW@[71; 77) "struct" | 76 | STRUCT_KW@[71; 77) "struct" |
@@ -82,7 +82,7 @@ SOURCE_FILE@[0; 290) | |||
82 | LIFETIME_PARAM@[81; 83) | 82 | LIFETIME_PARAM@[81; 83) |
83 | LIFETIME@[81; 83) "\'a" | 83 | LIFETIME@[81; 83) "\'a" |
84 | R_ANGLE@[83; 84) ">" | 84 | R_ANGLE@[83; 84) ">" |
85 | SEMI@[84; 85) ";" | 85 | SEMICOLON@[84; 85) ";" |
86 | WHITESPACE@[85; 86) "\n" | 86 | WHITESPACE@[85; 86) "\n" |
87 | STRUCT_DEF@[86; 101) | 87 | STRUCT_DEF@[86; 101) |
88 | STRUCT_KW@[86; 92) "struct" | 88 | STRUCT_KW@[86; 92) "struct" |
@@ -95,7 +95,7 @@ SOURCE_FILE@[0; 290) | |||
95 | LIFETIME@[96; 98) "\'a" | 95 | LIFETIME@[96; 98) "\'a" |
96 | COLON@[98; 99) ":" | 96 | COLON@[98; 99) ":" |
97 | R_ANGLE@[99; 100) ">" | 97 | R_ANGLE@[99; 100) ">" |
98 | SEMI@[100; 101) ";" | 98 | SEMICOLON@[100; 101) ";" |
99 | WHITESPACE@[101; 102) "\n" | 99 | WHITESPACE@[101; 102) "\n" |
100 | STRUCT_DEF@[102; 120) | 100 | STRUCT_DEF@[102; 120) |
101 | STRUCT_KW@[102; 108) "struct" | 101 | STRUCT_KW@[102; 108) "struct" |
@@ -110,7 +110,7 @@ SOURCE_FILE@[0; 290) | |||
110 | WHITESPACE@[115; 116) " " | 110 | WHITESPACE@[115; 116) " " |
111 | LIFETIME@[116; 118) "\'b" | 111 | LIFETIME@[116; 118) "\'b" |
112 | R_ANGLE@[118; 119) ">" | 112 | R_ANGLE@[118; 119) ">" |
113 | SEMI@[119; 120) ";" | 113 | SEMICOLON@[119; 120) ";" |
114 | WHITESPACE@[120; 121) "\n" | 114 | WHITESPACE@[120; 121) "\n" |
115 | STRUCT_DEF@[121; 142) | 115 | STRUCT_DEF@[121; 142) |
116 | STRUCT_KW@[121; 127) "struct" | 116 | STRUCT_KW@[121; 127) "struct" |
@@ -128,7 +128,7 @@ SOURCE_FILE@[0; 290) | |||
128 | PLUS@[138; 139) "+" | 128 | PLUS@[138; 139) "+" |
129 | WHITESPACE@[139; 140) " " | 129 | WHITESPACE@[139; 140) " " |
130 | R_ANGLE@[140; 141) ">" | 130 | R_ANGLE@[140; 141) ">" |
131 | SEMI@[141; 142) ";" | 131 | SEMICOLON@[141; 142) ";" |
132 | WHITESPACE@[142; 143) "\n" | 132 | WHITESPACE@[142; 143) "\n" |
133 | STRUCT_DEF@[143; 166) | 133 | STRUCT_DEF@[143; 166) |
134 | STRUCT_KW@[143; 149) "struct" | 134 | STRUCT_KW@[143; 149) "struct" |
@@ -147,7 +147,7 @@ SOURCE_FILE@[0; 290) | |||
147 | WHITESPACE@[161; 162) " " | 147 | WHITESPACE@[161; 162) " " |
148 | LIFETIME@[162; 164) "\'c" | 148 | LIFETIME@[162; 164) "\'c" |
149 | R_ANGLE@[164; 165) ">" | 149 | R_ANGLE@[164; 165) ">" |
150 | SEMI@[165; 166) ";" | 150 | SEMICOLON@[165; 166) ";" |
151 | WHITESPACE@[166; 167) "\n" | 151 | WHITESPACE@[166; 167) "\n" |
152 | STRUCT_DEF@[167; 183) | 152 | STRUCT_DEF@[167; 183) |
153 | STRUCT_KW@[167; 173) "struct" | 153 | STRUCT_KW@[167; 173) "struct" |
@@ -160,7 +160,7 @@ SOURCE_FILE@[0; 290) | |||
160 | LIFETIME@[178; 180) "\'a" | 160 | LIFETIME@[178; 180) "\'a" |
161 | COMMA@[180; 181) "," | 161 | COMMA@[180; 181) "," |
162 | R_ANGLE@[181; 182) ">" | 162 | R_ANGLE@[181; 182) ">" |
163 | SEMI@[182; 183) ";" | 163 | SEMICOLON@[182; 183) ";" |
164 | WHITESPACE@[183; 184) "\n" | 164 | WHITESPACE@[183; 184) "\n" |
165 | STRUCT_DEF@[184; 203) | 165 | STRUCT_DEF@[184; 203) |
166 | STRUCT_KW@[184; 190) "struct" | 166 | STRUCT_KW@[184; 190) "struct" |
@@ -176,7 +176,7 @@ SOURCE_FILE@[0; 290) | |||
176 | LIFETIME_PARAM@[199; 201) | 176 | LIFETIME_PARAM@[199; 201) |
177 | LIFETIME@[199; 201) "\'b" | 177 | LIFETIME@[199; 201) "\'b" |
178 | R_ANGLE@[201; 202) ">" | 178 | R_ANGLE@[201; 202) ">" |
179 | SEMI@[202; 203) ";" | 179 | SEMICOLON@[202; 203) ";" |
180 | WHITESPACE@[203; 204) "\n" | 180 | WHITESPACE@[203; 204) "\n" |
181 | STRUCT_DEF@[204; 233) | 181 | STRUCT_DEF@[204; 233) |
182 | STRUCT_KW@[204; 210) "struct" | 182 | STRUCT_KW@[204; 210) "struct" |
@@ -200,7 +200,7 @@ SOURCE_FILE@[0; 290) | |||
200 | LIFETIME@[228; 230) "\'c" | 200 | LIFETIME@[228; 230) "\'c" |
201 | COMMA@[230; 231) "," | 201 | COMMA@[230; 231) "," |
202 | R_ANGLE@[231; 232) ">" | 202 | R_ANGLE@[231; 232) ">" |
203 | SEMI@[232; 233) ";" | 203 | SEMICOLON@[232; 233) ";" |
204 | WHITESPACE@[233; 235) "\n\n" | 204 | WHITESPACE@[233; 235) "\n\n" |
205 | STRUCT_DEF@[235; 249) | 205 | STRUCT_DEF@[235; 249) |
206 | STRUCT_KW@[235; 241) "struct" | 206 | STRUCT_KW@[235; 241) "struct" |
@@ -213,7 +213,7 @@ SOURCE_FILE@[0; 290) | |||
213 | NAME@[246; 247) | 213 | NAME@[246; 247) |
214 | IDENT@[246; 247) "T" | 214 | IDENT@[246; 247) "T" |
215 | R_ANGLE@[247; 248) ">" | 215 | R_ANGLE@[247; 248) ">" |
216 | SEMI@[248; 249) ";" | 216 | SEMICOLON@[248; 249) ";" |
217 | WHITESPACE@[249; 250) "\n" | 217 | WHITESPACE@[249; 250) "\n" |
218 | STRUCT_DEF@[250; 267) | 218 | STRUCT_DEF@[250; 267) |
219 | STRUCT_KW@[250; 256) "struct" | 219 | STRUCT_KW@[250; 256) "struct" |
@@ -231,7 +231,7 @@ SOURCE_FILE@[0; 290) | |||
231 | NAME@[264; 265) | 231 | NAME@[264; 265) |
232 | IDENT@[264; 265) "U" | 232 | IDENT@[264; 265) "U" |
233 | R_ANGLE@[265; 266) ">" | 233 | R_ANGLE@[265; 266) ">" |
234 | SEMI@[266; 267) ";" | 234 | SEMICOLON@[266; 267) ";" |
235 | WHITESPACE@[267; 268) "\n" | 235 | WHITESPACE@[267; 268) "\n" |
236 | STRUCT_DEF@[268; 289) | 236 | STRUCT_DEF@[268; 289) |
237 | STRUCT_KW@[268; 274) "struct" | 237 | STRUCT_KW@[268; 274) "struct" |
@@ -253,5 +253,5 @@ SOURCE_FILE@[0; 290) | |||
253 | NAME@[286; 287) | 253 | NAME@[286; 287) |
254 | IDENT@[286; 287) "U" | 254 | IDENT@[286; 287) "U" |
255 | R_ANGLE@[287; 288) ">" | 255 | R_ANGLE@[287; 288) ">" |
256 | SEMI@[288; 289) ";" | 256 | SEMICOLON@[288; 289) ";" |
257 | WHITESPACE@[289; 290) "\n" | 257 | WHITESPACE@[289; 290) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast b/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast index 18a5fd784..edacc4bd9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast +++ b/crates/ra_syntax/test_data/parser/ok/0020_type_param_bounds.rast | |||
@@ -10,7 +10,7 @@ SOURCE_FILE@[0; 250) | |||
10 | NAME@[9; 10) | 10 | NAME@[9; 10) |
11 | IDENT@[9; 10) "T" | 11 | IDENT@[9; 10) "T" |
12 | R_ANGLE@[10; 11) ">" | 12 | R_ANGLE@[10; 11) ">" |
13 | SEMI@[11; 12) ";" | 13 | SEMICOLON@[11; 12) ";" |
14 | WHITESPACE@[12; 13) "\n" | 14 | WHITESPACE@[12; 13) "\n" |
15 | STRUCT_DEF@[13; 26) | 15 | STRUCT_DEF@[13; 26) |
16 | STRUCT_KW@[13; 19) "struct" | 16 | STRUCT_KW@[13; 19) "struct" |
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 250) | |||
25 | COLON@[23; 24) ":" | 25 | COLON@[23; 24) ":" |
26 | TYPE_BOUND_LIST@[24; 24) | 26 | TYPE_BOUND_LIST@[24; 24) |
27 | R_ANGLE@[24; 25) ">" | 27 | R_ANGLE@[24; 25) ">" |
28 | SEMI@[25; 26) ";" | 28 | SEMICOLON@[25; 26) ";" |
29 | WHITESPACE@[26; 27) "\n" | 29 | WHITESPACE@[26; 27) "\n" |
30 | STRUCT_DEF@[27; 43) | 30 | STRUCT_DEF@[27; 43) |
31 | STRUCT_KW@[27; 33) "struct" | 31 | STRUCT_KW@[27; 33) "struct" |
@@ -43,7 +43,7 @@ SOURCE_FILE@[0; 250) | |||
43 | TYPE_BOUND@[39; 41) | 43 | TYPE_BOUND@[39; 41) |
44 | LIFETIME@[39; 41) "\'a" | 44 | LIFETIME@[39; 41) "\'a" |
45 | R_ANGLE@[41; 42) ">" | 45 | R_ANGLE@[41; 42) ">" |
46 | SEMI@[42; 43) ";" | 46 | SEMICOLON@[42; 43) ";" |
47 | WHITESPACE@[43; 44) "\n" | 47 | WHITESPACE@[43; 44) "\n" |
48 | STRUCT_DEF@[44; 63) | 48 | STRUCT_DEF@[44; 63) |
49 | STRUCT_KW@[44; 50) "struct" | 49 | STRUCT_KW@[44; 50) "struct" |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 250) | |||
64 | PLUS@[59; 60) "+" | 64 | PLUS@[59; 60) "+" |
65 | WHITESPACE@[60; 61) " " | 65 | WHITESPACE@[60; 61) " " |
66 | R_ANGLE@[61; 62) ">" | 66 | R_ANGLE@[61; 62) ">" |
67 | SEMI@[62; 63) ";" | 67 | SEMICOLON@[62; 63) ";" |
68 | WHITESPACE@[63; 64) "\n" | 68 | WHITESPACE@[63; 64) "\n" |
69 | STRUCT_DEF@[64; 86) | 69 | STRUCT_DEF@[64; 86) |
70 | STRUCT_KW@[64; 70) "struct" | 70 | STRUCT_KW@[64; 70) "struct" |
@@ -88,7 +88,7 @@ SOURCE_FILE@[0; 250) | |||
88 | LIFETIME@[81; 83) "\'d" | 88 | LIFETIME@[81; 83) "\'d" |
89 | WHITESPACE@[83; 84) " " | 89 | WHITESPACE@[83; 84) " " |
90 | R_ANGLE@[84; 85) ">" | 90 | R_ANGLE@[84; 85) ">" |
91 | SEMI@[85; 86) ";" | 91 | SEMICOLON@[85; 86) ";" |
92 | WHITESPACE@[86; 87) "\n" | 92 | WHITESPACE@[86; 87) "\n" |
93 | STRUCT_DEF@[87; 116) | 93 | STRUCT_DEF@[87; 116) |
94 | STRUCT_KW@[87; 93) "struct" | 94 | STRUCT_KW@[87; 93) "struct" |
@@ -120,7 +120,7 @@ SOURCE_FILE@[0; 250) | |||
120 | NAME_REF@[109; 114) | 120 | NAME_REF@[109; 114) |
121 | IDENT@[109; 114) "Clone" | 121 | IDENT@[109; 114) "Clone" |
122 | R_ANGLE@[114; 115) ">" | 122 | R_ANGLE@[114; 115) ">" |
123 | SEMI@[115; 116) ";" | 123 | SEMICOLON@[115; 116) ";" |
124 | WHITESPACE@[116; 117) "\n" | 124 | WHITESPACE@[116; 117) "\n" |
125 | STRUCT_DEF@[117; 143) | 125 | STRUCT_DEF@[117; 143) |
126 | STRUCT_KW@[117; 123) "struct" | 126 | STRUCT_KW@[117; 123) "struct" |
@@ -151,7 +151,7 @@ SOURCE_FILE@[0; 250) | |||
151 | NAME_REF@[137; 141) | 151 | NAME_REF@[137; 141) |
152 | IDENT@[137; 141) "Copy" | 152 | IDENT@[137; 141) "Copy" |
153 | R_ANGLE@[141; 142) ">" | 153 | R_ANGLE@[141; 142) ">" |
154 | SEMI@[142; 143) ";" | 154 | SEMICOLON@[142; 143) ";" |
155 | WHITESPACE@[143; 144) "\n" | 155 | WHITESPACE@[143; 144) "\n" |
156 | STRUCT_DEF@[144; 180) | 156 | STRUCT_DEF@[144; 180) |
157 | STRUCT_KW@[144; 150) "struct" | 157 | STRUCT_KW@[144; 150) "struct" |
@@ -170,7 +170,7 @@ SOURCE_FILE@[0; 250) | |||
170 | PATH_TYPE@[156; 161) | 170 | PATH_TYPE@[156; 161) |
171 | PATH@[156; 161) | 171 | PATH@[156; 161) |
172 | PATH_SEGMENT@[156; 161) | 172 | PATH_SEGMENT@[156; 161) |
173 | COLONCOLON@[156; 158) "::" | 173 | COLON2@[156; 158) "::" |
174 | NAME_REF@[158; 161) | 174 | NAME_REF@[158; 161) |
175 | IDENT@[158; 161) "Foo" | 175 | IDENT@[158; 161) "Foo" |
176 | WHITESPACE@[161; 162) " " | 176 | WHITESPACE@[161; 162) " " |
@@ -182,7 +182,7 @@ SOURCE_FILE@[0; 250) | |||
182 | PATH@[164; 168) | 182 | PATH@[164; 168) |
183 | PATH_SEGMENT@[164; 168) | 183 | PATH_SEGMENT@[164; 168) |
184 | SELF_KW@[164; 168) "self" | 184 | SELF_KW@[164; 168) "self" |
185 | COLONCOLON@[168; 170) "::" | 185 | COLON2@[168; 170) "::" |
186 | PATH_SEGMENT@[170; 173) | 186 | PATH_SEGMENT@[170; 173) |
187 | NAME_REF@[170; 173) | 187 | NAME_REF@[170; 173) |
188 | IDENT@[170; 173) "Bar" | 188 | IDENT@[170; 173) "Bar" |
@@ -192,7 +192,7 @@ SOURCE_FILE@[0; 250) | |||
192 | TYPE_BOUND@[176; 178) | 192 | TYPE_BOUND@[176; 178) |
193 | LIFETIME@[176; 178) "\'a" | 193 | LIFETIME@[176; 178) "\'a" |
194 | R_ANGLE@[178; 179) ">" | 194 | R_ANGLE@[178; 179) ">" |
195 | SEMI@[179; 180) ";" | 195 | SEMICOLON@[179; 180) ";" |
196 | WHITESPACE@[180; 181) "\n" | 196 | WHITESPACE@[180; 181) "\n" |
197 | STRUCT_DEF@[181; 199) | 197 | STRUCT_DEF@[181; 199) |
198 | STRUCT_KW@[181; 187) "struct" | 198 | STRUCT_KW@[181; 187) "struct" |
@@ -215,7 +215,7 @@ SOURCE_FILE@[0; 250) | |||
215 | TYPE_BOUND_LIST@[196; 196) | 215 | TYPE_BOUND_LIST@[196; 196) |
216 | COMMA@[196; 197) "," | 216 | COMMA@[196; 197) "," |
217 | R_ANGLE@[197; 198) ">" | 217 | R_ANGLE@[197; 198) ">" |
218 | SEMI@[198; 199) ";" | 218 | SEMICOLON@[198; 199) ";" |
219 | WHITESPACE@[199; 200) "\n" | 219 | WHITESPACE@[199; 200) "\n" |
220 | STRUCT_DEF@[200; 250) | 220 | STRUCT_DEF@[200; 250) |
221 | STRUCT_KW@[200; 206) "struct" | 221 | STRUCT_KW@[200; 206) "struct" |
@@ -265,4 +265,4 @@ SOURCE_FILE@[0; 250) | |||
265 | NAME_REF@[243; 248) | 265 | NAME_REF@[243; 248) |
266 | IDENT@[243; 248) "Clone" | 266 | IDENT@[243; 248) "Clone" |
267 | R_ANGLE@[248; 249) ">" | 267 | R_ANGLE@[248; 249) ">" |
268 | SEMI@[249; 250) ";" | 268 | SEMICOLON@[249; 250) ";" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast b/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast index 5591f95eb..dadf24fa6 100644 --- a/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast +++ b/crates/ra_syntax/test_data/parser/ok/0023_static_items.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@[0; 47) | |||
16 | WHITESPACE@[17; 18) " " | 16 | WHITESPACE@[17; 18) " " |
17 | LITERAL@[18; 19) | 17 | LITERAL@[18; 19) |
18 | INT_NUMBER@[18; 19) "1" | 18 | INT_NUMBER@[18; 19) "1" |
19 | SEMI@[19; 20) ";" | 19 | SEMICOLON@[19; 20) ";" |
20 | WHITESPACE@[20; 21) "\n" | 20 | WHITESPACE@[20; 21) "\n" |
21 | STATIC_DEF@[21; 46) | 21 | STATIC_DEF@[21; 46) |
22 | STATIC_KW@[21; 27) "static" | 22 | STATIC_KW@[21; 27) "static" |
@@ -37,5 +37,5 @@ SOURCE_FILE@[0; 47) | |||
37 | WHITESPACE@[42; 43) " " | 37 | WHITESPACE@[42; 43) " " |
38 | LITERAL@[43; 45) | 38 | LITERAL@[43; 45) |
39 | INT_NUMBER@[43; 45) "92" | 39 | INT_NUMBER@[43; 45) "92" |
40 | SEMI@[45; 46) ";" | 40 | SEMICOLON@[45; 46) ";" |
41 | WHITESPACE@[46; 47) "\n" | 41 | WHITESPACE@[46; 47) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast b/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast index abe9f851b..262e31f7f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0024_const_item.rast | |||
@@ -15,7 +15,7 @@ SOURCE_FILE@[0; 64) | |||
15 | WHITESPACE@[14; 15) " " | 15 | WHITESPACE@[14; 15) " " |
16 | LITERAL@[15; 16) | 16 | LITERAL@[15; 16) |
17 | INT_NUMBER@[15; 16) "0" | 17 | INT_NUMBER@[15; 16) "0" |
18 | SEMI@[16; 17) ";" | 18 | SEMICOLON@[16; 17) ";" |
19 | WHITESPACE@[17; 18) "\n" | 19 | WHITESPACE@[17; 18) "\n" |
20 | CONST_DEF@[18; 38) | 20 | CONST_DEF@[18; 38) |
21 | CONST_KW@[18; 23) "const" | 21 | CONST_KW@[18; 23) "const" |
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 64) | |||
34 | WHITESPACE@[34; 35) " " | 34 | WHITESPACE@[34; 35) " " |
35 | LITERAL@[35; 37) | 35 | LITERAL@[35; 37) |
36 | INT_NUMBER@[35; 37) "92" | 36 | INT_NUMBER@[35; 37) "92" |
37 | SEMI@[37; 38) ";" | 37 | SEMICOLON@[37; 38) ";" |
38 | WHITESPACE@[38; 39) "\n" | 38 | WHITESPACE@[38; 39) "\n" |
39 | CONST_DEF@[39; 63) | 39 | CONST_DEF@[39; 63) |
40 | CONST_KW@[39; 44) "const" | 40 | CONST_KW@[39; 44) "const" |
@@ -55,5 +55,5 @@ SOURCE_FILE@[0; 64) | |||
55 | WHITESPACE@[59; 60) " " | 55 | WHITESPACE@[59; 60) " " |
56 | LITERAL@[60; 62) | 56 | LITERAL@[60; 62) |
57 | INT_NUMBER@[60; 62) "62" | 57 | INT_NUMBER@[60; 62) "62" |
58 | SEMI@[62; 63) ";" | 58 | SEMICOLON@[62; 63) ";" |
59 | WHITESPACE@[63; 64) "\n" | 59 | WHITESPACE@[63; 64) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast b/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast index afca1fba2..5542f7701 100644 --- a/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast +++ b/crates/ra_syntax/test_data/parser/ok/0028_operator_binding_power.rast | |||
@@ -53,7 +53,7 @@ SOURCE_FILE@[0; 248) | |||
53 | WHITESPACE@[52; 53) " " | 53 | WHITESPACE@[52; 53) " " |
54 | LITERAL@[53; 54) | 54 | LITERAL@[53; 54) |
55 | INT_NUMBER@[53; 54) "6" | 55 | INT_NUMBER@[53; 54) "6" |
56 | SEMI@[54; 55) ";" | 56 | SEMICOLON@[54; 55) ";" |
57 | WHITESPACE@[55; 60) "\n " | 57 | WHITESPACE@[55; 60) "\n " |
58 | EXPR_STMT@[60; 70) | 58 | EXPR_STMT@[60; 70) |
59 | BIN_EXPR@[60; 69) | 59 | BIN_EXPR@[60; 69) |
@@ -70,7 +70,7 @@ SOURCE_FILE@[0; 248) | |||
70 | WHITESPACE@[67; 68) " " | 70 | WHITESPACE@[67; 68) " " |
71 | LITERAL@[68; 69) | 71 | LITERAL@[68; 69) |
72 | INT_NUMBER@[68; 69) "3" | 72 | INT_NUMBER@[68; 69) "3" |
73 | SEMI@[69; 70) ";" | 73 | SEMICOLON@[69; 70) ";" |
74 | WHITESPACE@[70; 75) "\n " | 74 | WHITESPACE@[70; 75) "\n " |
75 | EXPR_STMT@[75; 86) | 75 | EXPR_STMT@[75; 86) |
76 | BIN_EXPR@[75; 85) | 76 | BIN_EXPR@[75; 85) |
@@ -87,7 +87,7 @@ SOURCE_FILE@[0; 248) | |||
87 | WHITESPACE@[83; 84) " " | 87 | WHITESPACE@[83; 84) " " |
88 | LITERAL@[84; 85) | 88 | LITERAL@[84; 85) |
89 | INT_NUMBER@[84; 85) "3" | 89 | INT_NUMBER@[84; 85) "3" |
90 | SEMI@[85; 86) ";" | 90 | SEMICOLON@[85; 86) ";" |
91 | WHITESPACE@[86; 91) "\n " | 91 | WHITESPACE@[86; 91) "\n " |
92 | EXPR_STMT@[91; 102) | 92 | EXPR_STMT@[91; 102) |
93 | BIN_EXPR@[91; 101) | 93 | BIN_EXPR@[91; 101) |
@@ -104,7 +104,7 @@ SOURCE_FILE@[0; 248) | |||
104 | WHITESPACE@[99; 100) " " | 104 | WHITESPACE@[99; 100) " " |
105 | LITERAL@[100; 101) | 105 | LITERAL@[100; 101) |
106 | INT_NUMBER@[100; 101) "3" | 106 | INT_NUMBER@[100; 101) "3" |
107 | SEMI@[101; 102) ";" | 107 | SEMICOLON@[101; 102) ";" |
108 | WHITESPACE@[102; 107) "\n " | 108 | WHITESPACE@[102; 107) "\n " |
109 | EXPR_STMT@[107; 117) | 109 | EXPR_STMT@[107; 117) |
110 | BIN_EXPR@[107; 116) | 110 | BIN_EXPR@[107; 116) |
@@ -121,7 +121,7 @@ SOURCE_FILE@[0; 248) | |||
121 | WHITESPACE@[114; 115) " " | 121 | WHITESPACE@[114; 115) " " |
122 | LITERAL@[115; 116) | 122 | LITERAL@[115; 116) |
123 | INT_NUMBER@[115; 116) "3" | 123 | INT_NUMBER@[115; 116) "3" |
124 | SEMI@[116; 117) ";" | 124 | SEMICOLON@[116; 117) ";" |
125 | WHITESPACE@[117; 122) "\n " | 125 | WHITESPACE@[117; 122) "\n " |
126 | EXPR_STMT@[122; 132) | 126 | EXPR_STMT@[122; 132) |
127 | BIN_EXPR@[122; 131) | 127 | BIN_EXPR@[122; 131) |
@@ -138,14 +138,14 @@ SOURCE_FILE@[0; 248) | |||
138 | WHITESPACE@[129; 130) " " | 138 | WHITESPACE@[129; 130) " " |
139 | LITERAL@[130; 131) | 139 | LITERAL@[130; 131) |
140 | INT_NUMBER@[130; 131) "3" | 140 | INT_NUMBER@[130; 131) "3" |
141 | SEMI@[131; 132) ";" | 141 | SEMICOLON@[131; 132) ";" |
142 | WHITESPACE@[132; 137) "\n " | 142 | WHITESPACE@[132; 137) "\n " |
143 | EXPR_STMT@[137; 148) | 143 | EXPR_STMT@[137; 148) |
144 | BIN_EXPR@[137; 147) | 144 | BIN_EXPR@[137; 147) |
145 | LITERAL@[137; 138) | 145 | LITERAL@[137; 138) |
146 | INT_NUMBER@[137; 138) "1" | 146 | INT_NUMBER@[137; 138) "1" |
147 | WHITESPACE@[138; 139) " " | 147 | WHITESPACE@[138; 139) " " |
148 | EQEQ@[139; 141) "==" | 148 | EQ2@[139; 141) "==" |
149 | WHITESPACE@[141; 142) " " | 149 | WHITESPACE@[141; 142) " " |
150 | BIN_EXPR@[142; 147) | 150 | BIN_EXPR@[142; 147) |
151 | LITERAL@[142; 143) | 151 | LITERAL@[142; 143) |
@@ -155,24 +155,24 @@ SOURCE_FILE@[0; 248) | |||
155 | WHITESPACE@[145; 146) " " | 155 | WHITESPACE@[145; 146) " " |
156 | LITERAL@[146; 147) | 156 | LITERAL@[146; 147) |
157 | INT_NUMBER@[146; 147) "3" | 157 | INT_NUMBER@[146; 147) "3" |
158 | SEMI@[147; 148) ";" | 158 | SEMICOLON@[147; 148) ";" |
159 | WHITESPACE@[148; 153) "\n " | 159 | WHITESPACE@[148; 153) "\n " |
160 | EXPR_STMT@[153; 165) | 160 | EXPR_STMT@[153; 165) |
161 | BIN_EXPR@[153; 164) | 161 | BIN_EXPR@[153; 164) |
162 | LITERAL@[153; 154) | 162 | LITERAL@[153; 154) |
163 | INT_NUMBER@[153; 154) "1" | 163 | INT_NUMBER@[153; 154) "1" |
164 | WHITESPACE@[154; 155) " " | 164 | WHITESPACE@[154; 155) " " |
165 | AMPAMP@[155; 157) "&&" | 165 | AMP2@[155; 157) "&&" |
166 | WHITESPACE@[157; 158) " " | 166 | WHITESPACE@[157; 158) " " |
167 | BIN_EXPR@[158; 164) | 167 | BIN_EXPR@[158; 164) |
168 | LITERAL@[158; 159) | 168 | LITERAL@[158; 159) |
169 | INT_NUMBER@[158; 159) "2" | 169 | INT_NUMBER@[158; 159) "2" |
170 | WHITESPACE@[159; 160) " " | 170 | WHITESPACE@[159; 160) " " |
171 | EQEQ@[160; 162) "==" | 171 | EQ2@[160; 162) "==" |
172 | WHITESPACE@[162; 163) " " | 172 | WHITESPACE@[162; 163) " " |
173 | LITERAL@[163; 164) | 173 | LITERAL@[163; 164) |
174 | INT_NUMBER@[163; 164) "3" | 174 | INT_NUMBER@[163; 164) "3" |
175 | SEMI@[164; 165) ";" | 175 | SEMICOLON@[164; 165) ";" |
176 | WHITESPACE@[165; 170) "\n " | 176 | WHITESPACE@[165; 170) "\n " |
177 | COMMENT@[170; 184) "//1 || 2 && 2;" | 177 | COMMENT@[170; 184) "//1 || 2 && 2;" |
178 | WHITESPACE@[184; 189) "\n " | 178 | WHITESPACE@[184; 189) "\n " |
diff --git a/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast b/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast index 95dae4870..78056aa95 100644 --- a/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast +++ b/crates/ra_syntax/test_data/parser/ok/0029_range_forms.rast | |||
@@ -14,7 +14,7 @@ SOURCE_FILE@[0; 153) | |||
14 | WHITESPACE@[10; 15) "\n " | 14 | WHITESPACE@[10; 15) "\n " |
15 | EXPR_STMT@[15; 23) | 15 | EXPR_STMT@[15; 23) |
16 | RANGE_EXPR@[15; 22) | 16 | RANGE_EXPR@[15; 22) |
17 | DOTDOT@[15; 17) ".." | 17 | DOT2@[15; 17) ".." |
18 | BIN_EXPR@[17; 22) | 18 | BIN_EXPR@[17; 22) |
19 | LITERAL@[17; 18) | 19 | LITERAL@[17; 18) |
20 | INT_NUMBER@[17; 18) "1" | 20 | INT_NUMBER@[17; 18) "1" |
@@ -23,12 +23,12 @@ SOURCE_FILE@[0; 153) | |||
23 | WHITESPACE@[20; 21) " " | 23 | WHITESPACE@[20; 21) " " |
24 | LITERAL@[21; 22) | 24 | LITERAL@[21; 22) |
25 | INT_NUMBER@[21; 22) "1" | 25 | INT_NUMBER@[21; 22) "1" |
26 | SEMI@[22; 23) ";" | 26 | SEMICOLON@[22; 23) ";" |
27 | WHITESPACE@[23; 28) "\n " | 27 | WHITESPACE@[23; 28) "\n " |
28 | EXPR_STMT@[28; 36) | 28 | EXPR_STMT@[28; 36) |
29 | BIN_EXPR@[28; 35) | 29 | BIN_EXPR@[28; 35) |
30 | RANGE_EXPR@[28; 31) | 30 | RANGE_EXPR@[28; 31) |
31 | DOTDOT@[28; 30) ".." | 31 | DOT2@[28; 30) ".." |
32 | PATH_EXPR@[30; 31) | 32 | PATH_EXPR@[30; 31) |
33 | PATH@[30; 31) | 33 | PATH@[30; 31) |
34 | PATH_SEGMENT@[30; 31) | 34 | PATH_SEGMENT@[30; 31) |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 153) | |||
39 | WHITESPACE@[33; 34) " " | 39 | WHITESPACE@[33; 34) " " |
40 | LITERAL@[34; 35) | 40 | LITERAL@[34; 35) |
41 | INT_NUMBER@[34; 35) "2" | 41 | INT_NUMBER@[34; 35) "2" |
42 | SEMI@[35; 36) ";" | 42 | SEMICOLON@[35; 36) ";" |
43 | WHITESPACE@[36; 41) "\n " | 43 | WHITESPACE@[36; 41) "\n " |
44 | EXPR_STMT@[41; 59) | 44 | EXPR_STMT@[41; 59) |
45 | BIN_EXPR@[41; 58) | 45 | BIN_EXPR@[41; 58) |
@@ -54,16 +54,16 @@ SOURCE_FILE@[0; 153) | |||
54 | RANGE_EXPR@[45; 58) | 54 | RANGE_EXPR@[45; 58) |
55 | LITERAL@[45; 50) | 55 | LITERAL@[45; 50) |
56 | FALSE_KW@[45; 50) "false" | 56 | FALSE_KW@[45; 50) "false" |
57 | DOTDOT@[50; 52) ".." | 57 | DOT2@[50; 52) ".." |
58 | BIN_EXPR@[52; 58) | 58 | BIN_EXPR@[52; 58) |
59 | LITERAL@[52; 53) | 59 | LITERAL@[52; 53) |
60 | INT_NUMBER@[52; 53) "1" | 60 | INT_NUMBER@[52; 53) "1" |
61 | WHITESPACE@[53; 54) " " | 61 | WHITESPACE@[53; 54) " " |
62 | EQEQ@[54; 56) "==" | 62 | EQ2@[54; 56) "==" |
63 | WHITESPACE@[56; 57) " " | 63 | WHITESPACE@[56; 57) " " |
64 | LITERAL@[57; 58) | 64 | LITERAL@[57; 58) |
65 | INT_NUMBER@[57; 58) "1" | 65 | INT_NUMBER@[57; 58) "1" |
66 | SEMI@[58; 59) ";" | 66 | SEMICOLON@[58; 59) ";" |
67 | WHITESPACE@[59; 64) "\n " | 67 | WHITESPACE@[59; 64) "\n " |
68 | LET_STMT@[64; 76) | 68 | LET_STMT@[64; 76) |
69 | LET_KW@[64; 67) "let" | 69 | LET_KW@[64; 67) "let" |
@@ -77,12 +77,12 @@ SOURCE_FILE@[0; 153) | |||
77 | RANGE_EXPR@[72; 75) | 77 | RANGE_EXPR@[72; 75) |
78 | LITERAL@[72; 73) | 78 | LITERAL@[72; 73) |
79 | INT_NUMBER@[72; 73) "1" | 79 | INT_NUMBER@[72; 73) "1" |
80 | DOTDOT@[73; 75) ".." | 80 | DOT2@[73; 75) ".." |
81 | SEMI@[75; 76) ";" | 81 | SEMICOLON@[75; 76) ";" |
82 | WHITESPACE@[76; 86) "\n \n " | 82 | WHITESPACE@[76; 86) "\n \n " |
83 | EXPR_STMT@[86; 95) | 83 | EXPR_STMT@[86; 95) |
84 | RANGE_EXPR@[86; 94) | 84 | RANGE_EXPR@[86; 94) |
85 | DOTDOTEQ@[86; 89) "..=" | 85 | DOT2EQ@[86; 89) "..=" |
86 | BIN_EXPR@[89; 94) | 86 | BIN_EXPR@[89; 94) |
87 | LITERAL@[89; 90) | 87 | LITERAL@[89; 90) |
88 | INT_NUMBER@[89; 90) "1" | 88 | INT_NUMBER@[89; 90) "1" |
@@ -91,12 +91,12 @@ SOURCE_FILE@[0; 153) | |||
91 | WHITESPACE@[92; 93) " " | 91 | WHITESPACE@[92; 93) " " |
92 | LITERAL@[93; 94) | 92 | LITERAL@[93; 94) |
93 | INT_NUMBER@[93; 94) "1" | 93 | INT_NUMBER@[93; 94) "1" |
94 | SEMI@[94; 95) ";" | 94 | SEMICOLON@[94; 95) ";" |
95 | WHITESPACE@[95; 100) "\n " | 95 | WHITESPACE@[95; 100) "\n " |
96 | EXPR_STMT@[100; 109) | 96 | EXPR_STMT@[100; 109) |
97 | BIN_EXPR@[100; 108) | 97 | BIN_EXPR@[100; 108) |
98 | RANGE_EXPR@[100; 104) | 98 | RANGE_EXPR@[100; 104) |
99 | DOTDOTEQ@[100; 103) "..=" | 99 | DOT2EQ@[100; 103) "..=" |
100 | PATH_EXPR@[103; 104) | 100 | PATH_EXPR@[103; 104) |
101 | PATH@[103; 104) | 101 | PATH@[103; 104) |
102 | PATH_SEGMENT@[103; 104) | 102 | PATH_SEGMENT@[103; 104) |
@@ -107,7 +107,7 @@ SOURCE_FILE@[0; 153) | |||
107 | WHITESPACE@[106; 107) " " | 107 | WHITESPACE@[106; 107) " " |
108 | LITERAL@[107; 108) | 108 | LITERAL@[107; 108) |
109 | INT_NUMBER@[107; 108) "2" | 109 | INT_NUMBER@[107; 108) "2" |
110 | SEMI@[108; 109) ";" | 110 | SEMICOLON@[108; 109) ";" |
111 | WHITESPACE@[109; 114) "\n " | 111 | WHITESPACE@[109; 114) "\n " |
112 | EXPR_STMT@[114; 133) | 112 | EXPR_STMT@[114; 133) |
113 | BIN_EXPR@[114; 132) | 113 | BIN_EXPR@[114; 132) |
@@ -122,16 +122,16 @@ SOURCE_FILE@[0; 153) | |||
122 | RANGE_EXPR@[118; 132) | 122 | RANGE_EXPR@[118; 132) |
123 | LITERAL@[118; 123) | 123 | LITERAL@[118; 123) |
124 | FALSE_KW@[118; 123) "false" | 124 | FALSE_KW@[118; 123) "false" |
125 | DOTDOTEQ@[123; 126) "..=" | 125 | DOT2EQ@[123; 126) "..=" |
126 | BIN_EXPR@[126; 132) | 126 | BIN_EXPR@[126; 132) |
127 | LITERAL@[126; 127) | 127 | LITERAL@[126; 127) |
128 | INT_NUMBER@[126; 127) "1" | 128 | INT_NUMBER@[126; 127) "1" |
129 | WHITESPACE@[127; 128) " " | 129 | WHITESPACE@[127; 128) " " |
130 | EQEQ@[128; 130) "==" | 130 | EQ2@[128; 130) "==" |
131 | WHITESPACE@[130; 131) " " | 131 | WHITESPACE@[130; 131) " " |
132 | LITERAL@[131; 132) | 132 | LITERAL@[131; 132) |
133 | INT_NUMBER@[131; 132) "1" | 133 | INT_NUMBER@[131; 132) "1" |
134 | SEMI@[132; 133) ";" | 134 | SEMICOLON@[132; 133) ";" |
135 | WHITESPACE@[133; 138) "\n " | 135 | WHITESPACE@[133; 138) "\n " |
136 | LET_STMT@[138; 150) | 136 | LET_STMT@[138; 150) |
137 | LET_KW@[138; 141) "let" | 137 | LET_KW@[138; 141) "let" |
@@ -145,8 +145,8 @@ SOURCE_FILE@[0; 153) | |||
145 | RANGE_EXPR@[146; 149) | 145 | RANGE_EXPR@[146; 149) |
146 | LITERAL@[146; 147) | 146 | LITERAL@[146; 147) |
147 | INT_NUMBER@[146; 147) "1" | 147 | INT_NUMBER@[146; 147) "1" |
148 | DOTDOT@[147; 149) ".." | 148 | DOT2@[147; 149) ".." |
149 | SEMI@[149; 150) ";" | 149 | SEMICOLON@[149; 150) ";" |
150 | WHITESPACE@[150; 151) "\n" | 150 | WHITESPACE@[150; 151) "\n" |
151 | R_CURLY@[151; 152) "}" | 151 | R_CURLY@[151; 152) "}" |
152 | WHITESPACE@[152; 153) "\n" | 152 | WHITESPACE@[152; 153) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast index cdc9f05ae..4e583c6e8 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_string_suffixes.rast | |||
@@ -22,7 +22,7 @@ SOURCE_FILE@[0; 112) | |||
22 | WHITESPACE@[23; 24) " " | 22 | WHITESPACE@[23; 24) " " |
23 | LITERAL@[24; 30) | 23 | LITERAL@[24; 30) |
24 | CHAR@[24; 30) "\'c\'u32" | 24 | CHAR@[24; 30) "\'c\'u32" |
25 | SEMI@[30; 31) ";" | 25 | SEMICOLON@[30; 31) ";" |
26 | WHITESPACE@[31; 36) "\n " | 26 | WHITESPACE@[31; 36) "\n " |
27 | LET_STMT@[36; 60) | 27 | LET_STMT@[36; 60) |
28 | LET_KW@[36; 39) "let" | 28 | LET_KW@[36; 39) "let" |
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 112) | |||
34 | WHITESPACE@[43; 44) " " | 34 | WHITESPACE@[43; 44) " " |
35 | LITERAL@[44; 59) | 35 | LITERAL@[44; 59) |
36 | STRING@[44; 59) "\"string\"invalid" | 36 | STRING@[44; 59) "\"string\"invalid" |
37 | SEMI@[59; 60) ";" | 37 | SEMICOLON@[59; 60) ";" |
38 | WHITESPACE@[60; 65) "\n " | 38 | WHITESPACE@[60; 65) "\n " |
39 | LET_STMT@[65; 83) | 39 | LET_STMT@[65; 83) |
40 | LET_KW@[65; 68) "let" | 40 | LET_KW@[65; 68) "let" |
@@ -46,7 +46,7 @@ SOURCE_FILE@[0; 112) | |||
46 | WHITESPACE@[72; 73) " " | 46 | WHITESPACE@[72; 73) " " |
47 | LITERAL@[73; 82) | 47 | LITERAL@[73; 82) |
48 | BYTE@[73; 82) "b\'b\'_suff" | 48 | BYTE@[73; 82) "b\'b\'_suff" |
49 | SEMI@[82; 83) ";" | 49 | SEMICOLON@[82; 83) ";" |
50 | WHITESPACE@[83; 88) "\n " | 50 | WHITESPACE@[83; 88) "\n " |
51 | LET_STMT@[88; 109) | 51 | LET_STMT@[88; 109) |
52 | LET_KW@[88; 91) "let" | 52 | LET_KW@[88; 91) "let" |
@@ -58,7 +58,7 @@ SOURCE_FILE@[0; 112) | |||
58 | WHITESPACE@[95; 96) " " | 58 | WHITESPACE@[95; 96) " " |
59 | LITERAL@[96; 108) | 59 | LITERAL@[96; 108) |
60 | BYTE_STRING@[96; 108) "b\"bs\"invalid" | 60 | BYTE_STRING@[96; 108) "b\"bs\"invalid" |
61 | SEMI@[108; 109) ";" | 61 | SEMICOLON@[108; 109) ";" |
62 | WHITESPACE@[109; 110) "\n" | 62 | WHITESPACE@[109; 110) "\n" |
63 | R_CURLY@[110; 111) "}" | 63 | R_CURLY@[110; 111) "}" |
64 | WHITESPACE@[111; 112) "\n" | 64 | WHITESPACE@[111; 112) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast index ac314ae50..4131cd81a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@[0; 96) | |||
16 | PARAM_LIST@[31; 33) | 16 | PARAM_LIST@[31; 33) |
17 | L_PAREN@[31; 32) "(" | 17 | L_PAREN@[31; 32) "(" |
18 | R_PAREN@[32; 33) ")" | 18 | R_PAREN@[32; 33) ")" |
19 | SEMI@[33; 34) ";" | 19 | SEMICOLON@[33; 34) ";" |
20 | WHITESPACE@[34; 35) "\n" | 20 | WHITESPACE@[34; 35) "\n" |
21 | R_CURLY@[35; 36) "}" | 21 | R_CURLY@[35; 36) "}" |
22 | WHITESPACE@[36; 38) "\n\n" | 22 | WHITESPACE@[36; 38) "\n\n" |
@@ -49,13 +49,13 @@ SOURCE_FILE@[0; 96) | |||
49 | PATH_SEGMENT@[84; 87) | 49 | PATH_SEGMENT@[84; 87) |
50 | NAME_REF@[84; 87) | 50 | NAME_REF@[84; 87) |
51 | IDENT@[84; 87) "i32" | 51 | IDENT@[84; 87) "i32" |
52 | SEMI@[87; 88) ";" | 52 | SEMICOLON@[87; 88) ";" |
53 | WHITESPACE@[88; 89) " " | 53 | WHITESPACE@[88; 89) " " |
54 | LITERAL@[89; 90) | 54 | LITERAL@[89; 90) |
55 | INT_NUMBER@[89; 90) "1" | 55 | INT_NUMBER@[89; 90) "1" |
56 | R_BRACK@[90; 91) "]" | 56 | R_BRACK@[90; 91) "]" |
57 | R_PAREN@[91; 92) ")" | 57 | R_PAREN@[91; 92) ")" |
58 | SEMI@[92; 93) ";" | 58 | SEMICOLON@[92; 93) ";" |
59 | WHITESPACE@[93; 94) "\n" | 59 | WHITESPACE@[93; 94) "\n" |
60 | R_CURLY@[94; 95) "}" | 60 | R_CURLY@[94; 95) "}" |
61 | WHITESPACE@[95; 96) "\n" | 61 | WHITESPACE@[95; 96) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0031_extern.rast b/crates/ra_syntax/test_data/parser/ok/0031_extern.rast index badbf76c5..23757df52 100644 --- a/crates/ra_syntax/test_data/parser/ok/0031_extern.rast +++ b/crates/ra_syntax/test_data/parser/ok/0031_extern.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 1598) | |||
25 | PATH_TYPE@[35; 42) | 25 | PATH_TYPE@[35; 42) |
26 | PATH@[35; 42) | 26 | PATH@[35; 42) |
27 | PATH_SEGMENT@[35; 42) | 27 | PATH_SEGMENT@[35; 42) |
28 | COLONCOLON@[35; 37) "::" | 28 | COLON2@[35; 37) "::" |
29 | NAME_REF@[37; 42) | 29 | NAME_REF@[37; 42) |
30 | IDENT@[37; 42) "c_int" | 30 | IDENT@[37; 42) "c_int" |
31 | COMMA@[42; 43) "," | 31 | COMMA@[42; 43) "," |
@@ -39,7 +39,7 @@ SOURCE_FILE@[0; 1598) | |||
39 | PATH_TYPE@[48; 55) | 39 | PATH_TYPE@[48; 55) |
40 | PATH@[48; 55) | 40 | PATH@[48; 55) |
41 | PATH_SEGMENT@[48; 55) | 41 | PATH_SEGMENT@[48; 55) |
42 | COLONCOLON@[48; 50) "::" | 42 | COLON2@[48; 50) "::" |
43 | NAME_REF@[50; 55) | 43 | NAME_REF@[50; 55) |
44 | IDENT@[50; 55) "c_int" | 44 | IDENT@[50; 55) "c_int" |
45 | COMMA@[55; 56) "," | 45 | COMMA@[55; 56) "," |
@@ -53,7 +53,7 @@ SOURCE_FILE@[0; 1598) | |||
53 | PATH_TYPE@[67; 74) | 53 | PATH_TYPE@[67; 74) |
54 | PATH@[67; 74) | 54 | PATH@[67; 74) |
55 | PATH_SEGMENT@[67; 74) | 55 | PATH_SEGMENT@[67; 74) |
56 | COLONCOLON@[67; 69) "::" | 56 | COLON2@[67; 69) "::" |
57 | NAME_REF@[69; 74) | 57 | NAME_REF@[69; 74) |
58 | IDENT@[69; 74) "c_int" | 58 | IDENT@[69; 74) "c_int" |
59 | R_PAREN@[74; 75) ")" | 59 | R_PAREN@[74; 75) ")" |
@@ -64,10 +64,10 @@ SOURCE_FILE@[0; 1598) | |||
64 | PATH_TYPE@[79; 86) | 64 | PATH_TYPE@[79; 86) |
65 | PATH@[79; 86) | 65 | PATH@[79; 86) |
66 | PATH_SEGMENT@[79; 86) | 66 | PATH_SEGMENT@[79; 86) |
67 | COLONCOLON@[79; 81) "::" | 67 | COLON2@[79; 81) "::" |
68 | NAME_REF@[81; 86) | 68 | NAME_REF@[81; 86) |
69 | IDENT@[81; 86) "c_int" | 69 | IDENT@[81; 86) "c_int" |
70 | SEMI@[86; 87) ";" | 70 | SEMICOLON@[86; 87) ";" |
71 | WHITESPACE@[87; 92) "\n " | 71 | WHITESPACE@[87; 92) "\n " |
72 | FN_DEF@[92; 167) | 72 | FN_DEF@[92; 167) |
73 | VISIBILITY@[92; 95) | 73 | VISIBILITY@[92; 95) |
@@ -88,7 +88,7 @@ SOURCE_FILE@[0; 1598) | |||
88 | PATH_TYPE@[108; 115) | 88 | PATH_TYPE@[108; 115) |
89 | PATH@[108; 115) | 89 | PATH@[108; 115) |
90 | PATH_SEGMENT@[108; 115) | 90 | PATH_SEGMENT@[108; 115) |
91 | COLONCOLON@[108; 110) "::" | 91 | COLON2@[108; 110) "::" |
92 | NAME_REF@[110; 115) | 92 | NAME_REF@[110; 115) |
93 | IDENT@[110; 115) "c_int" | 93 | IDENT@[110; 115) "c_int" |
94 | COMMA@[115; 116) "," | 94 | COMMA@[115; 116) "," |
@@ -129,10 +129,10 @@ SOURCE_FILE@[0; 1598) | |||
129 | PATH_TYPE@[159; 166) | 129 | PATH_TYPE@[159; 166) |
130 | PATH@[159; 166) | 130 | PATH@[159; 166) |
131 | PATH_SEGMENT@[159; 166) | 131 | PATH_SEGMENT@[159; 166) |
132 | COLONCOLON@[159; 161) "::" | 132 | COLON2@[159; 161) "::" |
133 | NAME_REF@[161; 166) | 133 | NAME_REF@[161; 166) |
134 | IDENT@[161; 166) "c_int" | 134 | IDENT@[161; 166) "c_int" |
135 | SEMI@[166; 167) ";" | 135 | SEMICOLON@[166; 167) ";" |
136 | WHITESPACE@[167; 172) "\n " | 136 | WHITESPACE@[167; 172) "\n " |
137 | FN_DEF@[172; 276) | 137 | FN_DEF@[172; 276) |
138 | VISIBILITY@[172; 175) | 138 | VISIBILITY@[172; 175) |
@@ -153,7 +153,7 @@ SOURCE_FILE@[0; 1598) | |||
153 | PATH_TYPE@[195; 202) | 153 | PATH_TYPE@[195; 202) |
154 | PATH@[195; 202) | 154 | PATH@[195; 202) |
155 | PATH_SEGMENT@[195; 202) | 155 | PATH_SEGMENT@[195; 202) |
156 | COLONCOLON@[195; 197) "::" | 156 | COLON2@[195; 197) "::" |
157 | NAME_REF@[197; 202) | 157 | NAME_REF@[197; 202) |
158 | IDENT@[197; 202) "c_int" | 158 | IDENT@[197; 202) "c_int" |
159 | COMMA@[202; 203) "," | 159 | COMMA@[202; 203) "," |
@@ -194,10 +194,10 @@ SOURCE_FILE@[0; 1598) | |||
194 | PATH_TYPE@[268; 275) | 194 | PATH_TYPE@[268; 275) |
195 | PATH@[268; 275) | 195 | PATH@[268; 275) |
196 | PATH_SEGMENT@[268; 275) | 196 | PATH_SEGMENT@[268; 275) |
197 | COLONCOLON@[268; 270) "::" | 197 | COLON2@[268; 270) "::" |
198 | NAME_REF@[270; 275) | 198 | NAME_REF@[270; 275) |
199 | IDENT@[270; 275) "c_int" | 199 | IDENT@[270; 275) "c_int" |
200 | SEMI@[275; 276) ";" | 200 | SEMICOLON@[275; 276) ";" |
201 | WHITESPACE@[276; 281) "\n " | 201 | WHITESPACE@[276; 281) "\n " |
202 | FN_DEF@[281; 341) | 202 | FN_DEF@[281; 341) |
203 | VISIBILITY@[281; 284) | 203 | VISIBILITY@[281; 284) |
@@ -218,7 +218,7 @@ SOURCE_FILE@[0; 1598) | |||
218 | PATH_TYPE@[303; 310) | 218 | PATH_TYPE@[303; 310) |
219 | PATH@[303; 310) | 219 | PATH@[303; 310) |
220 | PATH_SEGMENT@[303; 310) | 220 | PATH_SEGMENT@[303; 310) |
221 | COLONCOLON@[303; 305) "::" | 221 | COLON2@[303; 305) "::" |
222 | NAME_REF@[305; 310) | 222 | NAME_REF@[305; 310) |
223 | IDENT@[305; 310) "c_int" | 223 | IDENT@[305; 310) "c_int" |
224 | COMMA@[310; 311) "," | 224 | COMMA@[310; 311) "," |
@@ -232,7 +232,7 @@ SOURCE_FILE@[0; 1598) | |||
232 | PATH_TYPE@[321; 328) | 232 | PATH_TYPE@[321; 328) |
233 | PATH@[321; 328) | 233 | PATH@[321; 328) |
234 | PATH_SEGMENT@[321; 328) | 234 | PATH_SEGMENT@[321; 328) |
235 | COLONCOLON@[321; 323) "::" | 235 | COLON2@[321; 323) "::" |
236 | NAME_REF@[323; 328) | 236 | NAME_REF@[323; 328) |
237 | IDENT@[323; 328) "c_int" | 237 | IDENT@[323; 328) "c_int" |
238 | R_PAREN@[328; 329) ")" | 238 | R_PAREN@[328; 329) ")" |
@@ -243,10 +243,10 @@ SOURCE_FILE@[0; 1598) | |||
243 | PATH_TYPE@[333; 340) | 243 | PATH_TYPE@[333; 340) |
244 | PATH@[333; 340) | 244 | PATH@[333; 340) |
245 | PATH_SEGMENT@[333; 340) | 245 | PATH_SEGMENT@[333; 340) |
246 | COLONCOLON@[333; 335) "::" | 246 | COLON2@[333; 335) "::" |
247 | NAME_REF@[335; 340) | 247 | NAME_REF@[335; 340) |
248 | IDENT@[335; 340) "c_int" | 248 | IDENT@[335; 340) "c_int" |
249 | SEMI@[340; 341) ";" | 249 | SEMICOLON@[340; 341) ";" |
250 | WHITESPACE@[341; 346) "\n " | 250 | WHITESPACE@[341; 346) "\n " |
251 | FN_DEF@[346; 469) | 251 | FN_DEF@[346; 469) |
252 | VISIBILITY@[346; 349) | 252 | VISIBILITY@[346; 349) |
@@ -267,7 +267,7 @@ SOURCE_FILE@[0; 1598) | |||
267 | PATH_TYPE@[373; 380) | 267 | PATH_TYPE@[373; 380) |
268 | PATH@[373; 380) | 268 | PATH@[373; 380) |
269 | PATH_SEGMENT@[373; 380) | 269 | PATH_SEGMENT@[373; 380) |
270 | COLONCOLON@[373; 375) "::" | 270 | COLON2@[373; 375) "::" |
271 | NAME_REF@[375; 380) | 271 | NAME_REF@[375; 380) |
272 | IDENT@[375; 380) "c_int" | 272 | IDENT@[375; 380) "c_int" |
273 | COMMA@[380; 381) "," | 273 | COMMA@[380; 381) "," |
@@ -312,10 +312,10 @@ SOURCE_FILE@[0; 1598) | |||
312 | PATH_TYPE@[461; 468) | 312 | PATH_TYPE@[461; 468) |
313 | PATH@[461; 468) | 313 | PATH@[461; 468) |
314 | PATH_SEGMENT@[461; 468) | 314 | PATH_SEGMENT@[461; 468) |
315 | COLONCOLON@[461; 463) "::" | 315 | COLON2@[461; 463) "::" |
316 | NAME_REF@[463; 468) | 316 | NAME_REF@[463; 468) |
317 | IDENT@[463; 468) "c_int" | 317 | IDENT@[463; 468) "c_int" |
318 | SEMI@[468; 469) ";" | 318 | SEMICOLON@[468; 469) ";" |
319 | WHITESPACE@[469; 474) "\n " | 319 | WHITESPACE@[469; 474) "\n " |
320 | FN_DEF@[474; 691) | 320 | FN_DEF@[474; 691) |
321 | VISIBILITY@[474; 477) | 321 | VISIBILITY@[474; 477) |
@@ -336,7 +336,7 @@ SOURCE_FILE@[0; 1598) | |||
336 | PATH_TYPE@[500; 507) | 336 | PATH_TYPE@[500; 507) |
337 | PATH@[500; 507) | 337 | PATH@[500; 507) |
338 | PATH_SEGMENT@[500; 507) | 338 | PATH_SEGMENT@[500; 507) |
339 | COLONCOLON@[500; 502) "::" | 339 | COLON2@[500; 502) "::" |
340 | NAME_REF@[502; 507) | 340 | NAME_REF@[502; 507) |
341 | IDENT@[502; 507) "c_int" | 341 | IDENT@[502; 507) "c_int" |
342 | COMMA@[507; 508) "," | 342 | COMMA@[507; 508) "," |
@@ -350,7 +350,7 @@ SOURCE_FILE@[0; 1598) | |||
350 | PATH_TYPE@[538; 545) | 350 | PATH_TYPE@[538; 545) |
351 | PATH@[538; 545) | 351 | PATH@[538; 545) |
352 | PATH_SEGMENT@[538; 545) | 352 | PATH_SEGMENT@[538; 545) |
353 | COLONCOLON@[538; 540) "::" | 353 | COLON2@[538; 540) "::" |
354 | NAME_REF@[540; 545) | 354 | NAME_REF@[540; 545) |
355 | IDENT@[540; 545) "c_int" | 355 | IDENT@[540; 545) "c_int" |
356 | COMMA@[545; 546) "," | 356 | COMMA@[545; 546) "," |
@@ -364,7 +364,7 @@ SOURCE_FILE@[0; 1598) | |||
364 | PATH_TYPE@[578; 585) | 364 | PATH_TYPE@[578; 585) |
365 | PATH@[578; 585) | 365 | PATH@[578; 585) |
366 | PATH_SEGMENT@[578; 585) | 366 | PATH_SEGMENT@[578; 585) |
367 | COLONCOLON@[578; 580) "::" | 367 | COLON2@[578; 580) "::" |
368 | NAME_REF@[580; 585) | 368 | NAME_REF@[580; 585) |
369 | IDENT@[580; 585) "c_int" | 369 | IDENT@[580; 585) "c_int" |
370 | COMMA@[585; 586) "," | 370 | COMMA@[585; 586) "," |
@@ -382,7 +382,7 @@ SOURCE_FILE@[0; 1598) | |||
382 | PATH_TYPE@[622; 630) | 382 | PATH_TYPE@[622; 630) |
383 | PATH@[622; 630) | 383 | PATH@[622; 630) |
384 | PATH_SEGMENT@[622; 630) | 384 | PATH_SEGMENT@[622; 630) |
385 | COLONCOLON@[622; 624) "::" | 385 | COLON2@[622; 624) "::" |
386 | NAME_REF@[624; 630) | 386 | NAME_REF@[624; 630) |
387 | IDENT@[624; 630) "c_void" | 387 | IDENT@[624; 630) "c_void" |
388 | COMMA@[630; 631) "," | 388 | COMMA@[630; 631) "," |
@@ -400,7 +400,7 @@ SOURCE_FILE@[0; 1598) | |||
400 | PATH_TYPE@[667; 678) | 400 | PATH_TYPE@[667; 678) |
401 | PATH@[667; 678) | 401 | PATH@[667; 678) |
402 | PATH_SEGMENT@[667; 678) | 402 | PATH_SEGMENT@[667; 678) |
403 | COLONCOLON@[667; 669) "::" | 403 | COLON2@[667; 669) "::" |
404 | NAME_REF@[669; 678) | 404 | NAME_REF@[669; 678) |
405 | IDENT@[669; 678) "socklen_t" | 405 | IDENT@[669; 678) "socklen_t" |
406 | R_PAREN@[678; 679) ")" | 406 | R_PAREN@[678; 679) ")" |
@@ -411,10 +411,10 @@ SOURCE_FILE@[0; 1598) | |||
411 | PATH_TYPE@[683; 690) | 411 | PATH_TYPE@[683; 690) |
412 | PATH@[683; 690) | 412 | PATH@[683; 690) |
413 | PATH_SEGMENT@[683; 690) | 413 | PATH_SEGMENT@[683; 690) |
414 | COLONCOLON@[683; 685) "::" | 414 | COLON2@[683; 685) "::" |
415 | NAME_REF@[685; 690) | 415 | NAME_REF@[685; 690) |
416 | IDENT@[685; 690) "c_int" | 416 | IDENT@[685; 690) "c_int" |
417 | SEMI@[690; 691) ";" | 417 | SEMICOLON@[690; 691) ";" |
418 | WHITESPACE@[691; 696) "\n " | 418 | WHITESPACE@[691; 696) "\n " |
419 | FN_DEF@[696; 864) | 419 | FN_DEF@[696; 864) |
420 | VISIBILITY@[696; 699) | 420 | VISIBILITY@[696; 699) |
@@ -435,7 +435,7 @@ SOURCE_FILE@[0; 1598) | |||
435 | PATH_TYPE@[722; 729) | 435 | PATH_TYPE@[722; 729) |
436 | PATH@[722; 729) | 436 | PATH@[722; 729) |
437 | PATH_SEGMENT@[722; 729) | 437 | PATH_SEGMENT@[722; 729) |
438 | COLONCOLON@[722; 724) "::" | 438 | COLON2@[722; 724) "::" |
439 | NAME_REF@[724; 729) | 439 | NAME_REF@[724; 729) |
440 | IDENT@[724; 729) "c_int" | 440 | IDENT@[724; 729) "c_int" |
441 | COMMA@[729; 730) "," | 441 | COMMA@[729; 730) "," |
@@ -449,7 +449,7 @@ SOURCE_FILE@[0; 1598) | |||
449 | PATH_TYPE@[738; 745) | 449 | PATH_TYPE@[738; 745) |
450 | PATH@[738; 745) | 450 | PATH@[738; 745) |
451 | PATH_SEGMENT@[738; 745) | 451 | PATH_SEGMENT@[738; 745) |
452 | COLONCOLON@[738; 740) "::" | 452 | COLON2@[738; 740) "::" |
453 | NAME_REF@[740; 745) | 453 | NAME_REF@[740; 745) |
454 | IDENT@[740; 745) "c_int" | 454 | IDENT@[740; 745) "c_int" |
455 | COMMA@[745; 746) "," | 455 | COMMA@[745; 746) "," |
@@ -463,7 +463,7 @@ SOURCE_FILE@[0; 1598) | |||
463 | PATH_TYPE@[753; 760) | 463 | PATH_TYPE@[753; 760) |
464 | PATH@[753; 760) | 464 | PATH@[753; 760) |
465 | PATH_SEGMENT@[753; 760) | 465 | PATH_SEGMENT@[753; 760) |
466 | COLONCOLON@[753; 755) "::" | 466 | COLON2@[753; 755) "::" |
467 | NAME_REF@[755; 760) | 467 | NAME_REF@[755; 760) |
468 | IDENT@[755; 760) "c_int" | 468 | IDENT@[755; 760) "c_int" |
469 | COMMA@[760; 761) "," | 469 | COMMA@[760; 761) "," |
@@ -481,7 +481,7 @@ SOURCE_FILE@[0; 1598) | |||
481 | PATH_TYPE@[798; 806) | 481 | PATH_TYPE@[798; 806) |
482 | PATH@[798; 806) | 482 | PATH@[798; 806) |
483 | PATH_SEGMENT@[798; 806) | 483 | PATH_SEGMENT@[798; 806) |
484 | COLONCOLON@[798; 800) "::" | 484 | COLON2@[798; 800) "::" |
485 | NAME_REF@[800; 806) | 485 | NAME_REF@[800; 806) |
486 | IDENT@[800; 806) "c_void" | 486 | IDENT@[800; 806) "c_void" |
487 | COMMA@[806; 807) "," | 487 | COMMA@[806; 807) "," |
@@ -505,10 +505,10 @@ SOURCE_FILE@[0; 1598) | |||
505 | PATH_TYPE@[856; 863) | 505 | PATH_TYPE@[856; 863) |
506 | PATH@[856; 863) | 506 | PATH@[856; 863) |
507 | PATH_SEGMENT@[856; 863) | 507 | PATH_SEGMENT@[856; 863) |
508 | COLONCOLON@[856; 858) "::" | 508 | COLON2@[856; 858) "::" |
509 | NAME_REF@[858; 863) | 509 | NAME_REF@[858; 863) |
510 | IDENT@[858; 863) "c_int" | 510 | IDENT@[858; 863) "c_int" |
511 | SEMI@[863; 864) ";" | 511 | SEMICOLON@[863; 864) ";" |
512 | WHITESPACE@[864; 869) "\n " | 512 | WHITESPACE@[864; 869) "\n " |
513 | FN_DEF@[869; 992) | 513 | FN_DEF@[869; 992) |
514 | VISIBILITY@[869; 872) | 514 | VISIBILITY@[869; 872) |
@@ -529,7 +529,7 @@ SOURCE_FILE@[0; 1598) | |||
529 | PATH_TYPE@[896; 903) | 529 | PATH_TYPE@[896; 903) |
530 | PATH@[896; 903) | 530 | PATH@[896; 903) |
531 | PATH_SEGMENT@[896; 903) | 531 | PATH_SEGMENT@[896; 903) |
532 | COLONCOLON@[896; 898) "::" | 532 | COLON2@[896; 898) "::" |
533 | NAME_REF@[898; 903) | 533 | NAME_REF@[898; 903) |
534 | IDENT@[898; 903) "c_int" | 534 | IDENT@[898; 903) "c_int" |
535 | COMMA@[903; 904) "," | 535 | COMMA@[903; 904) "," |
@@ -574,10 +574,10 @@ SOURCE_FILE@[0; 1598) | |||
574 | PATH_TYPE@[984; 991) | 574 | PATH_TYPE@[984; 991) |
575 | PATH@[984; 991) | 575 | PATH@[984; 991) |
576 | PATH_SEGMENT@[984; 991) | 576 | PATH_SEGMENT@[984; 991) |
577 | COLONCOLON@[984; 986) "::" | 577 | COLON2@[984; 986) "::" |
578 | NAME_REF@[986; 991) | 578 | NAME_REF@[986; 991) |
579 | IDENT@[986; 991) "c_int" | 579 | IDENT@[986; 991) "c_int" |
580 | SEMI@[991; 992) ";" | 580 | SEMICOLON@[991; 992) ";" |
581 | WHITESPACE@[992; 997) "\n " | 581 | WHITESPACE@[992; 997) "\n " |
582 | FN_DEF@[997; 1173) | 582 | FN_DEF@[997; 1173) |
583 | VISIBILITY@[997; 1000) | 583 | VISIBILITY@[997; 1000) |
@@ -598,7 +598,7 @@ SOURCE_FILE@[0; 1598) | |||
598 | PATH_TYPE@[1019; 1026) | 598 | PATH_TYPE@[1019; 1026) |
599 | PATH@[1019; 1026) | 599 | PATH@[1019; 1026) |
600 | PATH_SEGMENT@[1019; 1026) | 600 | PATH_SEGMENT@[1019; 1026) |
601 | COLONCOLON@[1019; 1021) "::" | 601 | COLON2@[1019; 1021) "::" |
602 | NAME_REF@[1021; 1026) | 602 | NAME_REF@[1021; 1026) |
603 | IDENT@[1021; 1026) "c_int" | 603 | IDENT@[1021; 1026) "c_int" |
604 | COMMA@[1026; 1027) "," | 604 | COMMA@[1026; 1027) "," |
@@ -616,7 +616,7 @@ SOURCE_FILE@[0; 1598) | |||
616 | PATH_TYPE@[1040; 1048) | 616 | PATH_TYPE@[1040; 1048) |
617 | PATH@[1040; 1048) | 617 | PATH@[1040; 1048) |
618 | PATH_SEGMENT@[1040; 1048) | 618 | PATH_SEGMENT@[1040; 1048) |
619 | COLONCOLON@[1040; 1042) "::" | 619 | COLON2@[1040; 1042) "::" |
620 | NAME_REF@[1042; 1048) | 620 | NAME_REF@[1042; 1048) |
621 | IDENT@[1042; 1048) "c_void" | 621 | IDENT@[1042; 1048) "c_void" |
622 | COMMA@[1048; 1049) "," | 622 | COMMA@[1048; 1049) "," |
@@ -630,7 +630,7 @@ SOURCE_FILE@[0; 1598) | |||
630 | PATH_TYPE@[1055; 1063) | 630 | PATH_TYPE@[1055; 1063) |
631 | PATH@[1055; 1063) | 631 | PATH@[1055; 1063) |
632 | PATH_SEGMENT@[1055; 1063) | 632 | PATH_SEGMENT@[1055; 1063) |
633 | COLONCOLON@[1055; 1057) "::" | 633 | COLON2@[1055; 1057) "::" |
634 | NAME_REF@[1057; 1063) | 634 | NAME_REF@[1057; 1063) |
635 | IDENT@[1057; 1063) "size_t" | 635 | IDENT@[1057; 1063) "size_t" |
636 | COMMA@[1063; 1064) "," | 636 | COMMA@[1063; 1064) "," |
@@ -644,7 +644,7 @@ SOURCE_FILE@[0; 1598) | |||
644 | PATH_TYPE@[1090; 1097) | 644 | PATH_TYPE@[1090; 1097) |
645 | PATH@[1090; 1097) | 645 | PATH@[1090; 1097) |
646 | PATH_SEGMENT@[1090; 1097) | 646 | PATH_SEGMENT@[1090; 1097) |
647 | COLONCOLON@[1090; 1092) "::" | 647 | COLON2@[1090; 1092) "::" |
648 | NAME_REF@[1092; 1097) | 648 | NAME_REF@[1092; 1097) |
649 | IDENT@[1092; 1097) "c_int" | 649 | IDENT@[1092; 1097) "c_int" |
650 | COMMA@[1097; 1098) "," | 650 | COMMA@[1097; 1098) "," |
@@ -685,10 +685,10 @@ SOURCE_FILE@[0; 1598) | |||
685 | PATH_TYPE@[1163; 1172) | 685 | PATH_TYPE@[1163; 1172) |
686 | PATH@[1163; 1172) | 686 | PATH@[1163; 1172) |
687 | PATH_SEGMENT@[1163; 1172) | 687 | PATH_SEGMENT@[1163; 1172) |
688 | COLONCOLON@[1163; 1165) "::" | 688 | COLON2@[1163; 1165) "::" |
689 | NAME_REF@[1165; 1172) | 689 | NAME_REF@[1165; 1172) |
690 | IDENT@[1165; 1172) "ssize_t" | 690 | IDENT@[1165; 1172) "ssize_t" |
691 | SEMI@[1172; 1173) ";" | 691 | SEMICOLON@[1172; 1173) ";" |
692 | WHITESPACE@[1173; 1178) "\n " | 692 | WHITESPACE@[1173; 1178) "\n " |
693 | FN_DEF@[1178; 1289) | 693 | FN_DEF@[1178; 1289) |
694 | VISIBILITY@[1178; 1181) | 694 | VISIBILITY@[1178; 1181) |
@@ -709,7 +709,7 @@ SOURCE_FILE@[0; 1598) | |||
709 | PATH_TYPE@[1198; 1205) | 709 | PATH_TYPE@[1198; 1205) |
710 | PATH@[1198; 1205) | 710 | PATH@[1198; 1205) |
711 | PATH_SEGMENT@[1198; 1205) | 711 | PATH_SEGMENT@[1198; 1205) |
712 | COLONCOLON@[1198; 1200) "::" | 712 | COLON2@[1198; 1200) "::" |
713 | NAME_REF@[1200; 1205) | 713 | NAME_REF@[1200; 1205) |
714 | IDENT@[1200; 1205) "c_int" | 714 | IDENT@[1200; 1205) "c_int" |
715 | COMMA@[1205; 1206) "," | 715 | COMMA@[1205; 1206) "," |
@@ -727,7 +727,7 @@ SOURCE_FILE@[0; 1598) | |||
727 | PATH_TYPE@[1219; 1227) | 727 | PATH_TYPE@[1219; 1227) |
728 | PATH@[1219; 1227) | 728 | PATH@[1219; 1227) |
729 | PATH_SEGMENT@[1219; 1227) | 729 | PATH_SEGMENT@[1219; 1227) |
730 | COLONCOLON@[1219; 1221) "::" | 730 | COLON2@[1219; 1221) "::" |
731 | NAME_REF@[1221; 1227) | 731 | NAME_REF@[1221; 1227) |
732 | IDENT@[1221; 1227) "c_void" | 732 | IDENT@[1221; 1227) "c_void" |
733 | COMMA@[1227; 1228) "," | 733 | COMMA@[1227; 1228) "," |
@@ -741,7 +741,7 @@ SOURCE_FILE@[0; 1598) | |||
741 | PATH_TYPE@[1234; 1242) | 741 | PATH_TYPE@[1234; 1242) |
742 | PATH@[1234; 1242) | 742 | PATH@[1234; 1242) |
743 | PATH_SEGMENT@[1234; 1242) | 743 | PATH_SEGMENT@[1234; 1242) |
744 | COLONCOLON@[1234; 1236) "::" | 744 | COLON2@[1234; 1236) "::" |
745 | NAME_REF@[1236; 1242) | 745 | NAME_REF@[1236; 1242) |
746 | IDENT@[1236; 1242) "size_t" | 746 | IDENT@[1236; 1242) "size_t" |
747 | COMMA@[1242; 1243) "," | 747 | COMMA@[1242; 1243) "," |
@@ -755,7 +755,7 @@ SOURCE_FILE@[0; 1598) | |||
755 | PATH_TYPE@[1267; 1274) | 755 | PATH_TYPE@[1267; 1274) |
756 | PATH@[1267; 1274) | 756 | PATH@[1267; 1274) |
757 | PATH_SEGMENT@[1267; 1274) | 757 | PATH_SEGMENT@[1267; 1274) |
758 | COLONCOLON@[1267; 1269) "::" | 758 | COLON2@[1267; 1269) "::" |
759 | NAME_REF@[1269; 1274) | 759 | NAME_REF@[1269; 1274) |
760 | IDENT@[1269; 1274) "c_int" | 760 | IDENT@[1269; 1274) "c_int" |
761 | R_PAREN@[1274; 1275) ")" | 761 | R_PAREN@[1274; 1275) ")" |
@@ -766,10 +766,10 @@ SOURCE_FILE@[0; 1598) | |||
766 | PATH_TYPE@[1279; 1288) | 766 | PATH_TYPE@[1279; 1288) |
767 | PATH@[1279; 1288) | 767 | PATH@[1279; 1288) |
768 | PATH_SEGMENT@[1279; 1288) | 768 | PATH_SEGMENT@[1279; 1288) |
769 | COLONCOLON@[1279; 1281) "::" | 769 | COLON2@[1279; 1281) "::" |
770 | NAME_REF@[1281; 1288) | 770 | NAME_REF@[1281; 1288) |
771 | IDENT@[1281; 1288) "ssize_t" | 771 | IDENT@[1281; 1288) "ssize_t" |
772 | SEMI@[1288; 1289) ";" | 772 | SEMICOLON@[1288; 1289) ";" |
773 | WHITESPACE@[1289; 1294) "\n " | 773 | WHITESPACE@[1289; 1294) "\n " |
774 | FN_DEF@[1294; 1481) | 774 | FN_DEF@[1294; 1481) |
775 | VISIBILITY@[1294; 1297) | 775 | VISIBILITY@[1294; 1297) |
@@ -790,7 +790,7 @@ SOURCE_FILE@[0; 1598) | |||
790 | PATH_TYPE@[1318; 1325) | 790 | PATH_TYPE@[1318; 1325) |
791 | PATH@[1318; 1325) | 791 | PATH@[1318; 1325) |
792 | PATH_SEGMENT@[1318; 1325) | 792 | PATH_SEGMENT@[1318; 1325) |
793 | COLONCOLON@[1318; 1320) "::" | 793 | COLON2@[1318; 1320) "::" |
794 | NAME_REF@[1320; 1325) | 794 | NAME_REF@[1320; 1325) |
795 | IDENT@[1320; 1325) "c_int" | 795 | IDENT@[1320; 1325) "c_int" |
796 | COMMA@[1325; 1326) "," | 796 | COMMA@[1325; 1326) "," |
@@ -808,7 +808,7 @@ SOURCE_FILE@[0; 1598) | |||
808 | PATH_TYPE@[1337; 1345) | 808 | PATH_TYPE@[1337; 1345) |
809 | PATH@[1337; 1345) | 809 | PATH@[1337; 1345) |
810 | PATH_SEGMENT@[1337; 1345) | 810 | PATH_SEGMENT@[1337; 1345) |
811 | COLONCOLON@[1337; 1339) "::" | 811 | COLON2@[1337; 1339) "::" |
812 | NAME_REF@[1339; 1345) | 812 | NAME_REF@[1339; 1345) |
813 | IDENT@[1339; 1345) "c_void" | 813 | IDENT@[1339; 1345) "c_void" |
814 | COMMA@[1345; 1346) "," | 814 | COMMA@[1345; 1346) "," |
@@ -822,7 +822,7 @@ SOURCE_FILE@[0; 1598) | |||
822 | PATH_TYPE@[1352; 1360) | 822 | PATH_TYPE@[1352; 1360) |
823 | PATH@[1352; 1360) | 823 | PATH@[1352; 1360) |
824 | PATH_SEGMENT@[1352; 1360) | 824 | PATH_SEGMENT@[1352; 1360) |
825 | COLONCOLON@[1352; 1354) "::" | 825 | COLON2@[1352; 1354) "::" |
826 | NAME_REF@[1354; 1360) | 826 | NAME_REF@[1354; 1360) |
827 | IDENT@[1354; 1360) "size_t" | 827 | IDENT@[1354; 1360) "size_t" |
828 | COMMA@[1360; 1361) "," | 828 | COMMA@[1360; 1361) "," |
@@ -836,7 +836,7 @@ SOURCE_FILE@[0; 1598) | |||
836 | PATH_TYPE@[1389; 1396) | 836 | PATH_TYPE@[1389; 1396) |
837 | PATH@[1389; 1396) | 837 | PATH@[1389; 1396) |
838 | PATH_SEGMENT@[1389; 1396) | 838 | PATH_SEGMENT@[1389; 1396) |
839 | COLONCOLON@[1389; 1391) "::" | 839 | COLON2@[1389; 1391) "::" |
840 | NAME_REF@[1391; 1396) | 840 | NAME_REF@[1391; 1396) |
841 | IDENT@[1391; 1396) "c_int" | 841 | IDENT@[1391; 1396) "c_int" |
842 | COMMA@[1396; 1397) "," | 842 | COMMA@[1396; 1397) "," |
@@ -854,7 +854,7 @@ SOURCE_FILE@[0; 1598) | |||
854 | PATH_TYPE@[1409; 1419) | 854 | PATH_TYPE@[1409; 1419) |
855 | PATH@[1409; 1419) | 855 | PATH@[1409; 1419) |
856 | PATH_SEGMENT@[1409; 1419) | 856 | PATH_SEGMENT@[1409; 1419) |
857 | COLONCOLON@[1409; 1411) "::" | 857 | COLON2@[1409; 1411) "::" |
858 | NAME_REF@[1411; 1419) | 858 | NAME_REF@[1411; 1419) |
859 | IDENT@[1411; 1419) "sockaddr" | 859 | IDENT@[1411; 1419) "sockaddr" |
860 | COMMA@[1419; 1420) "," | 860 | COMMA@[1419; 1420) "," |
@@ -872,7 +872,7 @@ SOURCE_FILE@[0; 1598) | |||
872 | PATH_TYPE@[1455; 1466) | 872 | PATH_TYPE@[1455; 1466) |
873 | PATH@[1455; 1466) | 873 | PATH@[1455; 1466) |
874 | PATH_SEGMENT@[1455; 1466) | 874 | PATH_SEGMENT@[1455; 1466) |
875 | COLONCOLON@[1455; 1457) "::" | 875 | COLON2@[1455; 1457) "::" |
876 | NAME_REF@[1457; 1466) | 876 | NAME_REF@[1457; 1466) |
877 | IDENT@[1457; 1466) "socklen_t" | 877 | IDENT@[1457; 1466) "socklen_t" |
878 | R_PAREN@[1466; 1467) ")" | 878 | R_PAREN@[1466; 1467) ")" |
@@ -883,10 +883,10 @@ SOURCE_FILE@[0; 1598) | |||
883 | PATH_TYPE@[1471; 1480) | 883 | PATH_TYPE@[1471; 1480) |
884 | PATH@[1471; 1480) | 884 | PATH@[1471; 1480) |
885 | PATH_SEGMENT@[1471; 1480) | 885 | PATH_SEGMENT@[1471; 1480) |
886 | COLONCOLON@[1471; 1473) "::" | 886 | COLON2@[1471; 1473) "::" |
887 | NAME_REF@[1473; 1480) | 887 | NAME_REF@[1473; 1480) |
888 | IDENT@[1473; 1480) "ssize_t" | 888 | IDENT@[1473; 1480) "ssize_t" |
889 | SEMI@[1480; 1481) ";" | 889 | SEMICOLON@[1480; 1481) ";" |
890 | WHITESPACE@[1481; 1486) "\n " | 890 | WHITESPACE@[1481; 1486) "\n " |
891 | FN_DEF@[1486; 1595) | 891 | FN_DEF@[1486; 1595) |
892 | VISIBILITY@[1486; 1489) | 892 | VISIBILITY@[1486; 1489) |
@@ -907,7 +907,7 @@ SOURCE_FILE@[0; 1598) | |||
907 | PATH_TYPE@[1506; 1513) | 907 | PATH_TYPE@[1506; 1513) |
908 | PATH@[1506; 1513) | 908 | PATH@[1506; 1513) |
909 | PATH_SEGMENT@[1506; 1513) | 909 | PATH_SEGMENT@[1506; 1513) |
910 | COLONCOLON@[1506; 1508) "::" | 910 | COLON2@[1506; 1508) "::" |
911 | NAME_REF@[1508; 1513) | 911 | NAME_REF@[1508; 1513) |
912 | IDENT@[1508; 1513) "c_int" | 912 | IDENT@[1508; 1513) "c_int" |
913 | COMMA@[1513; 1514) "," | 913 | COMMA@[1513; 1514) "," |
@@ -925,7 +925,7 @@ SOURCE_FILE@[0; 1598) | |||
925 | PATH_TYPE@[1525; 1533) | 925 | PATH_TYPE@[1525; 1533) |
926 | PATH@[1525; 1533) | 926 | PATH@[1525; 1533) |
927 | PATH_SEGMENT@[1525; 1533) | 927 | PATH_SEGMENT@[1525; 1533) |
928 | COLONCOLON@[1525; 1527) "::" | 928 | COLON2@[1525; 1527) "::" |
929 | NAME_REF@[1527; 1533) | 929 | NAME_REF@[1527; 1533) |
930 | IDENT@[1527; 1533) "c_void" | 930 | IDENT@[1527; 1533) "c_void" |
931 | COMMA@[1533; 1534) "," | 931 | COMMA@[1533; 1534) "," |
@@ -939,7 +939,7 @@ SOURCE_FILE@[0; 1598) | |||
939 | PATH_TYPE@[1540; 1548) | 939 | PATH_TYPE@[1540; 1548) |
940 | PATH@[1540; 1548) | 940 | PATH@[1540; 1548) |
941 | PATH_SEGMENT@[1540; 1548) | 941 | PATH_SEGMENT@[1540; 1548) |
942 | COLONCOLON@[1540; 1542) "::" | 942 | COLON2@[1540; 1542) "::" |
943 | NAME_REF@[1542; 1548) | 943 | NAME_REF@[1542; 1548) |
944 | IDENT@[1542; 1548) "size_t" | 944 | IDENT@[1542; 1548) "size_t" |
945 | COMMA@[1548; 1549) "," | 945 | COMMA@[1548; 1549) "," |
@@ -953,7 +953,7 @@ SOURCE_FILE@[0; 1598) | |||
953 | PATH_TYPE@[1573; 1580) | 953 | PATH_TYPE@[1573; 1580) |
954 | PATH@[1573; 1580) | 954 | PATH@[1573; 1580) |
955 | PATH_SEGMENT@[1573; 1580) | 955 | PATH_SEGMENT@[1573; 1580) |
956 | COLONCOLON@[1573; 1575) "::" | 956 | COLON2@[1573; 1575) "::" |
957 | NAME_REF@[1575; 1580) | 957 | NAME_REF@[1575; 1580) |
958 | IDENT@[1575; 1580) "c_int" | 958 | IDENT@[1575; 1580) "c_int" |
959 | R_PAREN@[1580; 1581) ")" | 959 | R_PAREN@[1580; 1581) ")" |
@@ -964,10 +964,10 @@ SOURCE_FILE@[0; 1598) | |||
964 | PATH_TYPE@[1585; 1594) | 964 | PATH_TYPE@[1585; 1594) |
965 | PATH@[1585; 1594) | 965 | PATH@[1585; 1594) |
966 | PATH_SEGMENT@[1585; 1594) | 966 | PATH_SEGMENT@[1585; 1594) |
967 | COLONCOLON@[1585; 1587) "::" | 967 | COLON2@[1585; 1587) "::" |
968 | NAME_REF@[1587; 1594) | 968 | NAME_REF@[1587; 1594) |
969 | IDENT@[1587; 1594) "ssize_t" | 969 | IDENT@[1587; 1594) "ssize_t" |
970 | SEMI@[1594; 1595) ";" | 970 | SEMICOLON@[1594; 1595) ";" |
971 | WHITESPACE@[1595; 1596) "\n" | 971 | WHITESPACE@[1595; 1596) "\n" |
972 | R_CURLY@[1596; 1597) "}" | 972 | R_CURLY@[1596; 1597) "}" |
973 | WHITESPACE@[1597; 1598) "\n" | 973 | WHITESPACE@[1597; 1598) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast b/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast index 3a333480e..f71cf5b6c 100644 --- a/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast +++ b/crates/ra_syntax/test_data/parser/ok/0032_where_for.rast | |||
@@ -74,11 +74,11 @@ SOURCE_FILE@[0; 116) | |||
74 | PATH_SEGMENT@[96; 99) | 74 | PATH_SEGMENT@[96; 99) |
75 | NAME_REF@[96; 99) | 75 | NAME_REF@[96; 99) |
76 | IDENT@[96; 99) "std" | 76 | IDENT@[96; 99) "std" |
77 | COLONCOLON@[99; 101) "::" | 77 | COLON2@[99; 101) "::" |
78 | PATH_SEGMENT@[101; 104) | 78 | PATH_SEGMENT@[101; 104) |
79 | NAME_REF@[101; 104) | 79 | NAME_REF@[101; 104) |
80 | IDENT@[101; 104) "fmt" | 80 | IDENT@[101; 104) "fmt" |
81 | COLONCOLON@[104; 106) "::" | 81 | COLON2@[104; 106) "::" |
82 | PATH_SEGMENT@[106; 111) | 82 | PATH_SEGMENT@[106; 111) |
83 | NAME_REF@[106; 111) | 83 | NAME_REF@[106; 111) |
84 | IDENT@[106; 111) "Debug" | 84 | IDENT@[106; 111) "Debug" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast b/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast index bd9e3fd85..8af41caa0 100644 --- a/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast +++ b/crates/ra_syntax/test_data/parser/ok/0033_label_break.rast | |||
@@ -43,7 +43,7 @@ SOURCE_FILE@[0; 506) | |||
43 | ARG_LIST@[98; 100) | 43 | ARG_LIST@[98; 100) |
44 | L_PAREN@[98; 99) "(" | 44 | L_PAREN@[98; 99) "(" |
45 | R_PAREN@[99; 100) ")" | 45 | R_PAREN@[99; 100) ")" |
46 | SEMI@[100; 101) ";" | 46 | SEMICOLON@[100; 101) ";" |
47 | WHITESPACE@[101; 110) "\n " | 47 | WHITESPACE@[101; 110) "\n " |
48 | EXPR_STMT@[110; 170) | 48 | EXPR_STMT@[110; 170) |
49 | IF_EXPR@[110; 170) | 49 | IF_EXPR@[110; 170) |
@@ -69,7 +69,7 @@ SOURCE_FILE@[0; 506) | |||
69 | BREAK_KW@[147; 152) "break" | 69 | BREAK_KW@[147; 152) "break" |
70 | WHITESPACE@[152; 153) " " | 70 | WHITESPACE@[152; 153) " " |
71 | LIFETIME@[153; 159) "\'block" | 71 | LIFETIME@[153; 159) "\'block" |
72 | SEMI@[159; 160) ";" | 72 | SEMICOLON@[159; 160) ";" |
73 | WHITESPACE@[160; 169) "\n " | 73 | WHITESPACE@[160; 169) "\n " |
74 | R_CURLY@[169; 170) "}" | 74 | R_CURLY@[169; 170) "}" |
75 | WHITESPACE@[170; 179) "\n " | 75 | WHITESPACE@[170; 179) "\n " |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 506) | |||
83 | ARG_LIST@[192; 194) | 83 | ARG_LIST@[192; 194) |
84 | L_PAREN@[192; 193) "(" | 84 | L_PAREN@[192; 193) "(" |
85 | R_PAREN@[193; 194) ")" | 85 | R_PAREN@[193; 194) ")" |
86 | SEMI@[194; 195) ";" | 86 | SEMICOLON@[194; 195) ";" |
87 | WHITESPACE@[195; 204) "\n " | 87 | WHITESPACE@[195; 204) "\n " |
88 | EXPR_STMT@[204; 264) | 88 | EXPR_STMT@[204; 264) |
89 | IF_EXPR@[204; 264) | 89 | IF_EXPR@[204; 264) |
@@ -109,7 +109,7 @@ SOURCE_FILE@[0; 506) | |||
109 | BREAK_KW@[241; 246) "break" | 109 | BREAK_KW@[241; 246) "break" |
110 | WHITESPACE@[246; 247) " " | 110 | WHITESPACE@[246; 247) " " |
111 | LIFETIME@[247; 253) "\'block" | 111 | LIFETIME@[247; 253) "\'block" |
112 | SEMI@[253; 254) ";" | 112 | SEMICOLON@[253; 254) ";" |
113 | WHITESPACE@[254; 263) "\n " | 113 | WHITESPACE@[254; 263) "\n " |
114 | R_CURLY@[263; 264) "}" | 114 | R_CURLY@[263; 264) "}" |
115 | WHITESPACE@[264; 273) "\n " | 115 | WHITESPACE@[264; 273) "\n " |
@@ -123,7 +123,7 @@ SOURCE_FILE@[0; 506) | |||
123 | ARG_LIST@[286; 288) | 123 | ARG_LIST@[286; 288) |
124 | L_PAREN@[286; 287) "(" | 124 | L_PAREN@[286; 287) "(" |
125 | R_PAREN@[287; 288) ")" | 125 | R_PAREN@[287; 288) ")" |
126 | SEMI@[288; 289) ";" | 126 | SEMICOLON@[288; 289) ";" |
127 | WHITESPACE@[289; 294) "\n " | 127 | WHITESPACE@[289; 294) "\n " |
128 | R_CURLY@[294; 295) "}" | 128 | R_CURLY@[294; 295) "}" |
129 | WHITESPACE@[295; 301) "\n\n " | 129 | WHITESPACE@[295; 301) "\n\n " |
@@ -173,7 +173,7 @@ SOURCE_FILE@[0; 506) | |||
173 | WHITESPACE@[390; 391) " " | 173 | WHITESPACE@[390; 391) " " |
174 | LITERAL@[391; 392) | 174 | LITERAL@[391; 392) |
175 | INT_NUMBER@[391; 392) "1" | 175 | INT_NUMBER@[391; 392) "1" |
176 | SEMI@[392; 393) ";" | 176 | SEMICOLON@[392; 393) ";" |
177 | WHITESPACE@[393; 402) "\n " | 177 | WHITESPACE@[393; 402) "\n " |
178 | R_CURLY@[402; 403) "}" | 178 | R_CURLY@[402; 403) "}" |
179 | WHITESPACE@[403; 412) "\n " | 179 | WHITESPACE@[403; 412) "\n " |
@@ -206,7 +206,7 @@ SOURCE_FILE@[0; 506) | |||
206 | WHITESPACE@[473; 474) " " | 206 | WHITESPACE@[473; 474) " " |
207 | LITERAL@[474; 475) | 207 | LITERAL@[474; 475) |
208 | INT_NUMBER@[474; 475) "2" | 208 | INT_NUMBER@[474; 475) "2" |
209 | SEMI@[475; 476) ";" | 209 | SEMICOLON@[475; 476) ";" |
210 | WHITESPACE@[476; 485) "\n " | 210 | WHITESPACE@[476; 485) "\n " |
211 | R_CURLY@[485; 486) "}" | 211 | R_CURLY@[485; 486) "}" |
212 | WHITESPACE@[486; 495) "\n " | 212 | WHITESPACE@[486; 495) "\n " |
@@ -214,7 +214,7 @@ SOURCE_FILE@[0; 506) | |||
214 | INT_NUMBER@[495; 496) "3" | 214 | INT_NUMBER@[495; 496) "3" |
215 | WHITESPACE@[496; 501) "\n " | 215 | WHITESPACE@[496; 501) "\n " |
216 | R_CURLY@[501; 502) "}" | 216 | R_CURLY@[501; 502) "}" |
217 | SEMI@[502; 503) ";" | 217 | SEMICOLON@[502; 503) ";" |
218 | WHITESPACE@[503; 504) "\n" | 218 | WHITESPACE@[503; 504) "\n" |
219 | R_CURLY@[504; 505) "}" | 219 | R_CURLY@[504; 505) "}" |
220 | WHITESPACE@[505; 506) "\n" | 220 | WHITESPACE@[505; 506) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast b/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast index fc0d452f4..beaa96388 100644 --- a/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast +++ b/crates/ra_syntax/test_data/parser/ok/0034_crate_path_in_call.rast | |||
@@ -27,16 +27,16 @@ SOURCE_FILE@[0; 62) | |||
27 | PATH@[27; 32) | 27 | PATH@[27; 32) |
28 | PATH_SEGMENT@[27; 32) | 28 | PATH_SEGMENT@[27; 32) |
29 | CRATE_KW@[27; 32) "crate" | 29 | CRATE_KW@[27; 32) "crate" |
30 | COLONCOLON@[32; 34) "::" | 30 | COLON2@[32; 34) "::" |
31 | PATH_SEGMENT@[34; 44) | 31 | PATH_SEGMENT@[34; 44) |
32 | NAME_REF@[34; 44) | 32 | NAME_REF@[34; 44) |
33 | IDENT@[34; 44) "module_map" | 33 | IDENT@[34; 44) "module_map" |
34 | COLONCOLON@[44; 46) "::" | 34 | COLON2@[44; 46) "::" |
35 | PATH_SEGMENT@[46; 57) | 35 | PATH_SEGMENT@[46; 57) |
36 | NAME_REF@[46; 57) | 36 | NAME_REF@[46; 57) |
37 | IDENT@[46; 57) "module_tree" | 37 | IDENT@[46; 57) "module_tree" |
38 | R_PAREN@[57; 58) ")" | 38 | R_PAREN@[57; 58) ")" |
39 | SEMI@[58; 59) ";" | 39 | SEMICOLON@[58; 59) ";" |
40 | WHITESPACE@[59; 60) "\n" | 40 | WHITESPACE@[59; 60) "\n" |
41 | R_CURLY@[60; 61) "}" | 41 | R_CURLY@[60; 61) "}" |
42 | WHITESPACE@[61; 62) "\n" | 42 | WHITESPACE@[61; 62) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast index 90538b90d..7143a31a5 100644 --- a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast | |||
@@ -9,7 +9,7 @@ SOURCE_FILE@[0; 3813) | |||
9 | WHITESPACE@[269; 271) "\n\n" | 9 | WHITESPACE@[269; 271) "\n\n" |
10 | ATTR@[271; 302) | 10 | ATTR@[271; 302) |
11 | POUND@[271; 272) "#" | 11 | POUND@[271; 272) "#" |
12 | EXCL@[272; 273) "!" | 12 | BANG@[272; 273) "!" |
13 | L_BRACK@[273; 274) "[" | 13 | L_BRACK@[273; 274) "[" |
14 | PATH@[274; 279) | 14 | PATH@[274; 279) |
15 | PATH_SEGMENT@[274; 279) | 15 | PATH_SEGMENT@[274; 279) |
@@ -23,7 +23,7 @@ SOURCE_FILE@[0; 3813) | |||
23 | WHITESPACE@[302; 303) "\n" | 23 | WHITESPACE@[302; 303) "\n" |
24 | ATTR@[303; 323) | 24 | ATTR@[303; 323) |
25 | POUND@[303; 304) "#" | 25 | POUND@[303; 304) "#" |
26 | EXCL@[304; 305) "!" | 26 | BANG@[304; 305) "!" |
27 | L_BRACK@[305; 306) "[" | 27 | L_BRACK@[305; 306) "[" |
28 | PATH@[306; 311) | 28 | PATH@[306; 311) |
29 | PATH_SEGMENT@[306; 311) | 29 | PATH_SEGMENT@[306; 311) |
@@ -37,7 +37,7 @@ SOURCE_FILE@[0; 3813) | |||
37 | WHITESPACE@[323; 324) "\n" | 37 | WHITESPACE@[323; 324) "\n" |
38 | ATTR@[324; 351) | 38 | ATTR@[324; 351) |
39 | POUND@[324; 325) "#" | 39 | POUND@[324; 325) "#" |
40 | EXCL@[325; 326) "!" | 40 | BANG@[325; 326) "!" |
41 | L_BRACK@[326; 327) "[" | 41 | L_BRACK@[326; 327) "[" |
42 | PATH@[327; 332) | 42 | PATH@[327; 332) |
43 | PATH_SEGMENT@[327; 332) | 43 | PATH_SEGMENT@[327; 332) |
@@ -51,7 +51,7 @@ SOURCE_FILE@[0; 3813) | |||
51 | WHITESPACE@[351; 352) "\n" | 51 | WHITESPACE@[351; 352) "\n" |
52 | ATTR@[352; 376) | 52 | ATTR@[352; 376) |
53 | POUND@[352; 353) "#" | 53 | POUND@[352; 353) "#" |
54 | EXCL@[353; 354) "!" | 54 | BANG@[353; 354) "!" |
55 | L_BRACK@[354; 355) "[" | 55 | L_BRACK@[354; 355) "[" |
56 | PATH@[355; 360) | 56 | PATH@[355; 360) |
57 | PATH_SEGMENT@[355; 360) | 57 | PATH_SEGMENT@[355; 360) |
@@ -65,7 +65,7 @@ SOURCE_FILE@[0; 3813) | |||
65 | WHITESPACE@[376; 378) "\n\n" | 65 | WHITESPACE@[376; 378) "\n\n" |
66 | ATTR@[378; 405) | 66 | ATTR@[378; 405) |
67 | POUND@[378; 379) "#" | 67 | POUND@[378; 379) "#" |
68 | EXCL@[379; 380) "!" | 68 | BANG@[379; 380) "!" |
69 | L_BRACK@[380; 381) "[" | 69 | L_BRACK@[380; 381) "[" |
70 | PATH@[381; 396) | 70 | PATH@[381; 396) |
71 | PATH_SEGMENT@[381; 396) | 71 | PATH_SEGMENT@[381; 396) |
@@ -88,15 +88,15 @@ SOURCE_FILE@[0; 3813) | |||
88 | PATH_SEGMENT@[411; 414) | 88 | PATH_SEGMENT@[411; 414) |
89 | NAME_REF@[411; 414) | 89 | NAME_REF@[411; 414) |
90 | IDENT@[411; 414) "std" | 90 | IDENT@[411; 414) "std" |
91 | COLONCOLON@[414; 416) "::" | 91 | COLON2@[414; 416) "::" |
92 | PATH_SEGMENT@[416; 420) | 92 | PATH_SEGMENT@[416; 420) |
93 | NAME_REF@[416; 420) | 93 | NAME_REF@[416; 420) |
94 | IDENT@[416; 420) "cell" | 94 | IDENT@[416; 420) "cell" |
95 | COLONCOLON@[420; 422) "::" | 95 | COLON2@[420; 422) "::" |
96 | PATH_SEGMENT@[422; 426) | 96 | PATH_SEGMENT@[422; 426) |
97 | NAME_REF@[422; 426) | 97 | NAME_REF@[422; 426) |
98 | IDENT@[422; 426) "Cell" | 98 | IDENT@[422; 426) "Cell" |
99 | SEMI@[426; 427) ";" | 99 | SEMICOLON@[426; 427) ";" |
100 | WHITESPACE@[427; 428) "\n" | 100 | WHITESPACE@[427; 428) "\n" |
101 | USE_ITEM@[428; 447) | 101 | USE_ITEM@[428; 447) |
102 | USE_KW@[428; 431) "use" | 102 | USE_KW@[428; 431) "use" |
@@ -108,15 +108,15 @@ SOURCE_FILE@[0; 3813) | |||
108 | PATH_SEGMENT@[432; 435) | 108 | PATH_SEGMENT@[432; 435) |
109 | NAME_REF@[432; 435) | 109 | NAME_REF@[432; 435) |
110 | IDENT@[432; 435) "std" | 110 | IDENT@[432; 435) "std" |
111 | COLONCOLON@[435; 437) "::" | 111 | COLON2@[435; 437) "::" |
112 | PATH_SEGMENT@[437; 440) | 112 | PATH_SEGMENT@[437; 440) |
113 | NAME_REF@[437; 440) | 113 | NAME_REF@[437; 440) |
114 | IDENT@[437; 440) "mem" | 114 | IDENT@[437; 440) "mem" |
115 | COLONCOLON@[440; 442) "::" | 115 | COLON2@[440; 442) "::" |
116 | PATH_SEGMENT@[442; 446) | 116 | PATH_SEGMENT@[442; 446) |
117 | NAME_REF@[442; 446) | 117 | NAME_REF@[442; 446) |
118 | IDENT@[442; 446) "swap" | 118 | IDENT@[442; 446) "swap" |
119 | SEMI@[446; 447) ";" | 119 | SEMICOLON@[446; 447) ";" |
120 | WHITESPACE@[447; 449) "\n\n" | 120 | WHITESPACE@[447; 449) "\n\n" |
121 | COMMENT@[449; 518) "// Just a grab bag of ..." | 121 | COMMENT@[449; 518) "// Just a grab bag of ..." |
122 | WHITESPACE@[518; 520) "\n\n" | 122 | WHITESPACE@[518; 520) "\n\n" |
@@ -163,7 +163,7 @@ SOURCE_FILE@[0; 3813) | |||
163 | WHITESPACE@[564; 565) " " | 163 | WHITESPACE@[564; 565) " " |
164 | LITERAL@[565; 569) | 164 | LITERAL@[565; 569) |
165 | TRUE_KW@[565; 569) "true" | 165 | TRUE_KW@[565; 569) "true" |
166 | SEMI@[569; 570) ";" | 166 | SEMICOLON@[569; 570) ";" |
167 | WHITESPACE@[570; 571) " " | 167 | WHITESPACE@[570; 571) " " |
168 | R_CURLY@[571; 572) "}" | 168 | R_CURLY@[571; 572) "}" |
169 | WHITESPACE@[572; 574) "\n\n" | 169 | WHITESPACE@[572; 574) "\n\n" |
@@ -216,7 +216,7 @@ SOURCE_FILE@[0; 3813) | |||
216 | RETURN_EXPR@[614; 620) | 216 | RETURN_EXPR@[614; 620) |
217 | RETURN_KW@[614; 620) "return" | 217 | RETURN_KW@[614; 620) "return" |
218 | R_PAREN@[620; 621) ")" | 218 | R_PAREN@[620; 621) ")" |
219 | SEMI@[621; 622) ";" | 219 | SEMICOLON@[621; 622) ";" |
220 | WHITESPACE@[622; 623) "\n" | 220 | WHITESPACE@[622; 623) "\n" |
221 | R_CURLY@[623; 624) "}" | 221 | R_CURLY@[623; 624) "}" |
222 | WHITESPACE@[624; 626) "\n\n" | 222 | WHITESPACE@[624; 626) "\n\n" |
@@ -277,7 +277,7 @@ SOURCE_FILE@[0; 3813) | |||
277 | WHITESPACE@[687; 688) " " | 277 | WHITESPACE@[687; 688) " " |
278 | CONDITION@[688; 696) | 278 | CONDITION@[688; 696) |
279 | PREFIX_EXPR@[688; 696) | 279 | PREFIX_EXPR@[688; 696) |
280 | EXCL@[688; 689) "!" | 280 | BANG@[688; 689) "!" |
281 | METHOD_CALL_EXPR@[689; 696) | 281 | METHOD_CALL_EXPR@[689; 696) |
282 | PATH_EXPR@[689; 690) | 282 | PATH_EXPR@[689; 690) |
283 | PATH@[689; 690) | 283 | PATH@[689; 690) |
@@ -310,10 +310,10 @@ SOURCE_FILE@[0; 3813) | |||
310 | LITERAL@[705; 709) | 310 | LITERAL@[705; 709) |
311 | TRUE_KW@[705; 709) "true" | 311 | TRUE_KW@[705; 709) "true" |
312 | R_PAREN@[709; 710) ")" | 312 | R_PAREN@[709; 710) ")" |
313 | SEMI@[710; 711) ";" | 313 | SEMICOLON@[710; 711) ";" |
314 | WHITESPACE@[711; 712) " " | 314 | WHITESPACE@[711; 712) " " |
315 | R_CURLY@[712; 713) "}" | 315 | R_CURLY@[712; 713) "}" |
316 | SEMI@[713; 714) ";" | 316 | SEMICOLON@[713; 714) ";" |
317 | WHITESPACE@[714; 719) "\n " | 317 | WHITESPACE@[714; 719) "\n " |
318 | R_CURLY@[719; 720) "}" | 318 | R_CURLY@[719; 720) "}" |
319 | WHITESPACE@[720; 725) "\n " | 319 | WHITESPACE@[720; 725) "\n " |
@@ -335,7 +335,7 @@ SOURCE_FILE@[0; 3813) | |||
335 | PATH_SEGMENT@[734; 738) | 335 | PATH_SEGMENT@[734; 738) |
336 | NAME_REF@[734; 738) | 336 | NAME_REF@[734; 738) |
337 | IDENT@[734; 738) "Cell" | 337 | IDENT@[734; 738) "Cell" |
338 | COLONCOLON@[738; 740) "::" | 338 | COLON2@[738; 740) "::" |
339 | PATH_SEGMENT@[740; 743) | 339 | PATH_SEGMENT@[740; 743) |
340 | NAME_REF@[740; 743) | 340 | NAME_REF@[740; 743) |
341 | IDENT@[740; 743) "new" | 341 | IDENT@[740; 743) "new" |
@@ -344,7 +344,7 @@ SOURCE_FILE@[0; 3813) | |||
344 | LITERAL@[744; 749) | 344 | LITERAL@[744; 749) |
345 | FALSE_KW@[744; 749) "false" | 345 | FALSE_KW@[744; 749) "false" |
346 | R_PAREN@[749; 750) ")" | 346 | R_PAREN@[749; 750) ")" |
347 | SEMI@[750; 751) ";" | 347 | SEMICOLON@[750; 751) ";" |
348 | WHITESPACE@[751; 756) "\n " | 348 | WHITESPACE@[751; 756) "\n " |
349 | LET_STMT@[756; 778) | 349 | LET_STMT@[756; 778) |
350 | LET_KW@[756; 759) "let" | 350 | LET_KW@[756; 759) "let" |
@@ -377,7 +377,7 @@ SOURCE_FILE@[0; 3813) | |||
377 | IDENT@[774; 775) "i" | 377 | IDENT@[774; 775) "i" |
378 | R_PAREN@[775; 776) ")" | 378 | R_PAREN@[775; 776) ")" |
379 | R_CURLY@[776; 777) "}" | 379 | R_CURLY@[776; 777) "}" |
380 | SEMI@[777; 778) ";" | 380 | SEMICOLON@[777; 778) ";" |
381 | WHITESPACE@[778; 783) "\n " | 381 | WHITESPACE@[778; 783) "\n " |
382 | EXPR_STMT@[783; 790) | 382 | EXPR_STMT@[783; 790) |
383 | CALL_EXPR@[783; 789) | 383 | CALL_EXPR@[783; 789) |
@@ -389,7 +389,7 @@ SOURCE_FILE@[0; 3813) | |||
389 | ARG_LIST@[787; 789) | 389 | ARG_LIST@[787; 789) |
390 | L_PAREN@[787; 788) "(" | 390 | L_PAREN@[787; 788) "(" |
391 | R_PAREN@[788; 789) ")" | 391 | R_PAREN@[788; 789) ")" |
392 | SEMI@[789; 790) ";" | 392 | SEMICOLON@[789; 790) ";" |
393 | WHITESPACE@[790; 795) "\n " | 393 | WHITESPACE@[790; 795) "\n " |
394 | EXPR_STMT@[795; 814) | 394 | EXPR_STMT@[795; 814) |
395 | MACRO_CALL@[795; 813) | 395 | MACRO_CALL@[795; 813) |
@@ -397,7 +397,7 @@ SOURCE_FILE@[0; 3813) | |||
397 | PATH_SEGMENT@[795; 801) | 397 | PATH_SEGMENT@[795; 801) |
398 | NAME_REF@[795; 801) | 398 | NAME_REF@[795; 801) |
399 | IDENT@[795; 801) "assert" | 399 | IDENT@[795; 801) "assert" |
400 | EXCL@[801; 802) "!" | 400 | BANG@[801; 802) "!" |
401 | TOKEN_TREE@[802; 813) | 401 | TOKEN_TREE@[802; 813) |
402 | L_PAREN@[802; 803) "(" | 402 | L_PAREN@[802; 803) "(" |
403 | TOKEN_TREE@[803; 812) | 403 | TOKEN_TREE@[803; 812) |
@@ -410,7 +410,7 @@ SOURCE_FILE@[0; 3813) | |||
410 | R_PAREN@[810; 811) ")" | 410 | R_PAREN@[810; 811) ")" |
411 | R_PAREN@[811; 812) ")" | 411 | R_PAREN@[811; 812) ")" |
412 | R_PAREN@[812; 813) ")" | 412 | R_PAREN@[812; 813) ")" |
413 | SEMI@[813; 814) ";" | 413 | SEMICOLON@[813; 814) ";" |
414 | WHITESPACE@[814; 815) "\n" | 414 | WHITESPACE@[814; 815) "\n" |
415 | R_CURLY@[815; 816) "}" | 415 | R_CURLY@[815; 816) "}" |
416 | WHITESPACE@[816; 818) "\n\n" | 416 | WHITESPACE@[816; 818) "\n\n" |
@@ -535,7 +535,7 @@ SOURCE_FILE@[0; 3813) | |||
535 | R_CURLY@[1182; 1183) "}" | 535 | R_CURLY@[1182; 1183) "}" |
536 | WHITESPACE@[1183; 1200) "\n " | 536 | WHITESPACE@[1183; 1200) "\n " |
537 | R_CURLY@[1200; 1201) "}" | 537 | R_CURLY@[1200; 1201) "}" |
538 | SEMI@[1201; 1202) ";" | 538 | SEMICOLON@[1201; 1202) ";" |
539 | WHITESPACE@[1202; 1215) "\n " | 539 | WHITESPACE@[1202; 1215) "\n " |
540 | R_CURLY@[1215; 1216) "}" | 540 | R_CURLY@[1215; 1216) "}" |
541 | WHITESPACE@[1216; 1217) " " | 541 | WHITESPACE@[1216; 1217) " " |
@@ -558,7 +558,7 @@ SOURCE_FILE@[0; 3813) | |||
558 | EXPR_STMT@[1252; 1259) | 558 | EXPR_STMT@[1252; 1259) |
559 | RETURN_EXPR@[1252; 1258) | 559 | RETURN_EXPR@[1252; 1258) |
560 | RETURN_KW@[1252; 1258) "return" | 560 | RETURN_KW@[1252; 1258) "return" |
561 | SEMI@[1258; 1259) ";" | 561 | SEMICOLON@[1258; 1259) ";" |
562 | WHITESPACE@[1259; 1272) "\n " | 562 | WHITESPACE@[1259; 1272) "\n " |
563 | R_CURLY@[1272; 1273) "}" | 563 | R_CURLY@[1272; 1273) "}" |
564 | WHITESPACE@[1273; 1282) "\n " | 564 | WHITESPACE@[1273; 1282) "\n " |
@@ -581,7 +581,7 @@ SOURCE_FILE@[0; 3813) | |||
581 | EXPR_STMT@[1306; 1312) | 581 | EXPR_STMT@[1306; 1312) |
582 | BREAK_EXPR@[1306; 1311) | 582 | BREAK_EXPR@[1306; 1311) |
583 | BREAK_KW@[1306; 1311) "break" | 583 | BREAK_KW@[1306; 1311) "break" |
584 | SEMI@[1311; 1312) ";" | 584 | SEMICOLON@[1311; 1312) ";" |
585 | WHITESPACE@[1312; 1313) " " | 585 | WHITESPACE@[1312; 1313) " " |
586 | R_CURLY@[1313; 1314) "}" | 586 | R_CURLY@[1313; 1314) "}" |
587 | WHITESPACE@[1314; 1319) "\n " | 587 | WHITESPACE@[1314; 1319) "\n " |
@@ -617,7 +617,7 @@ SOURCE_FILE@[0; 3813) | |||
617 | PATH_SEGMENT@[1355; 1360) | 617 | PATH_SEGMENT@[1355; 1360) |
618 | NAME_REF@[1355; 1360) | 618 | NAME_REF@[1355; 1360) |
619 | IDENT@[1355; 1360) "isize" | 619 | IDENT@[1355; 1360) "isize" |
620 | SEMI@[1360; 1361) ";" | 620 | SEMICOLON@[1360; 1361) ";" |
621 | WHITESPACE@[1361; 1366) "\n " | 621 | WHITESPACE@[1361; 1366) "\n " |
622 | LET_STMT@[1366; 1400) | 622 | LET_STMT@[1366; 1400) |
623 | LET_KW@[1366; 1369) "let" | 623 | LET_KW@[1366; 1369) "let" |
@@ -646,7 +646,7 @@ SOURCE_FILE@[0; 3813) | |||
646 | INT_NUMBER@[1385; 1386) "0" | 646 | INT_NUMBER@[1385; 1386) "0" |
647 | R_PAREN@[1386; 1387) ")" | 647 | R_PAREN@[1386; 1387) ")" |
648 | WHITESPACE@[1387; 1388) " " | 648 | WHITESPACE@[1387; 1388) " " |
649 | EQEQ@[1388; 1390) "==" | 649 | EQ2@[1388; 1390) "==" |
650 | WHITESPACE@[1390; 1391) " " | 650 | WHITESPACE@[1390; 1391) " " |
651 | PAREN_EXPR@[1391; 1399) | 651 | PAREN_EXPR@[1391; 1399) |
652 | L_PAREN@[1391; 1392) "(" | 652 | L_PAREN@[1391; 1392) "(" |
@@ -662,7 +662,7 @@ SOURCE_FILE@[0; 3813) | |||
662 | LITERAL@[1397; 1398) | 662 | LITERAL@[1397; 1398) |
663 | INT_NUMBER@[1397; 1398) "0" | 663 | INT_NUMBER@[1397; 1398) "0" |
664 | R_PAREN@[1398; 1399) ")" | 664 | R_PAREN@[1398; 1399) ")" |
665 | SEMI@[1399; 1400) ";" | 665 | SEMICOLON@[1399; 1400) ";" |
666 | WHITESPACE@[1400; 1405) "\n " | 666 | WHITESPACE@[1400; 1405) "\n " |
667 | LET_STMT@[1405; 1438) | 667 | LET_STMT@[1405; 1438) |
668 | LET_KW@[1405; 1408) "let" | 668 | LET_KW@[1405; 1408) "let" |
@@ -707,7 +707,7 @@ SOURCE_FILE@[0; 3813) | |||
707 | LITERAL@[1435; 1436) | 707 | LITERAL@[1435; 1436) |
708 | INT_NUMBER@[1435; 1436) "0" | 708 | INT_NUMBER@[1435; 1436) "0" |
709 | R_PAREN@[1436; 1437) ")" | 709 | R_PAREN@[1436; 1437) ")" |
710 | SEMI@[1437; 1438) ";" | 710 | SEMICOLON@[1437; 1438) ";" |
711 | WHITESPACE@[1438; 1443) "\n " | 711 | WHITESPACE@[1438; 1443) "\n " |
712 | LET_STMT@[1443; 1474) | 712 | LET_STMT@[1443; 1474) |
713 | LET_KW@[1443; 1446) "let" | 713 | LET_KW@[1443; 1446) "let" |
@@ -734,7 +734,7 @@ SOURCE_FILE@[0; 3813) | |||
734 | INT_NUMBER@[1459; 1460) "0" | 734 | INT_NUMBER@[1459; 1460) "0" |
735 | R_PAREN@[1460; 1461) ")" | 735 | R_PAREN@[1460; 1461) ")" |
736 | WHITESPACE@[1461; 1462) " " | 736 | WHITESPACE@[1461; 1462) " " |
737 | EQEQ@[1462; 1464) "==" | 737 | EQ2@[1462; 1464) "==" |
738 | WHITESPACE@[1464; 1465) " " | 738 | WHITESPACE@[1464; 1465) " " |
739 | PAREN_EXPR@[1465; 1473) | 739 | PAREN_EXPR@[1465; 1473) |
740 | L_PAREN@[1465; 1466) "(" | 740 | L_PAREN@[1465; 1466) "(" |
@@ -750,7 +750,7 @@ SOURCE_FILE@[0; 3813) | |||
750 | LITERAL@[1471; 1472) | 750 | LITERAL@[1471; 1472) |
751 | INT_NUMBER@[1471; 1472) "0" | 751 | INT_NUMBER@[1471; 1472) "0" |
752 | R_PAREN@[1472; 1473) ")" | 752 | R_PAREN@[1472; 1473) ")" |
753 | SEMI@[1473; 1474) ";" | 753 | SEMICOLON@[1473; 1474) ";" |
754 | WHITESPACE@[1474; 1479) "\n " | 754 | WHITESPACE@[1474; 1479) "\n " |
755 | LET_STMT@[1479; 1537) | 755 | LET_STMT@[1479; 1537) |
756 | LET_KW@[1479; 1482) "let" | 756 | LET_KW@[1479; 1482) "let" |
@@ -792,7 +792,7 @@ SOURCE_FILE@[0; 3813) | |||
792 | IDENT@[1507; 1509) "_z" | 792 | IDENT@[1507; 1509) "_z" |
793 | R_PAREN@[1509; 1510) ")" | 793 | R_PAREN@[1509; 1510) ")" |
794 | WHITESPACE@[1510; 1511) " " | 794 | WHITESPACE@[1510; 1511) " " |
795 | EQEQ@[1511; 1513) "==" | 795 | EQ2@[1511; 1513) "==" |
796 | WHITESPACE@[1513; 1514) " " | 796 | WHITESPACE@[1513; 1514) " " |
797 | CALL_EXPR@[1514; 1536) | 797 | CALL_EXPR@[1514; 1536) |
798 | PATH_EXPR@[1514; 1518) | 798 | PATH_EXPR@[1514; 1518) |
@@ -823,7 +823,7 @@ SOURCE_FILE@[0; 3813) | |||
823 | NAME_REF@[1533; 1535) | 823 | NAME_REF@[1533; 1535) |
824 | IDENT@[1533; 1535) "_z" | 824 | IDENT@[1533; 1535) "_z" |
825 | R_PAREN@[1535; 1536) ")" | 825 | R_PAREN@[1535; 1536) ")" |
826 | SEMI@[1536; 1537) ";" | 826 | SEMICOLON@[1536; 1537) ";" |
827 | WHITESPACE@[1537; 1538) "\n" | 827 | WHITESPACE@[1537; 1538) "\n" |
828 | R_CURLY@[1538; 1539) "}" | 828 | R_CURLY@[1538; 1539) "}" |
829 | WHITESPACE@[1539; 1541) "\n\n" | 829 | WHITESPACE@[1539; 1541) "\n\n" |
@@ -893,7 +893,7 @@ SOURCE_FILE@[0; 3813) | |||
893 | PATH_SEGMENT@[1613; 1619) | 893 | PATH_SEGMENT@[1613; 1619) |
894 | NAME_REF@[1613; 1619) | 894 | NAME_REF@[1613; 1619) |
895 | IDENT@[1613; 1619) "assert" | 895 | IDENT@[1613; 1619) "assert" |
896 | EXCL@[1619; 1620) "!" | 896 | BANG@[1619; 1620) "!" |
897 | TOKEN_TREE@[1620; 1628) | 897 | TOKEN_TREE@[1620; 1628) |
898 | L_PAREN@[1620; 1621) "(" | 898 | L_PAREN@[1620; 1621) "(" |
899 | TOKEN_TREE@[1621; 1627) | 899 | TOKEN_TREE@[1621; 1627) |
@@ -902,7 +902,7 @@ SOURCE_FILE@[0; 3813) | |||
902 | R_PAREN@[1626; 1627) ")" | 902 | R_PAREN@[1626; 1627) ")" |
903 | R_PAREN@[1627; 1628) ")" | 903 | R_PAREN@[1627; 1628) ")" |
904 | WHITESPACE@[1628; 1629) " " | 904 | WHITESPACE@[1628; 1629) " " |
905 | EQEQ@[1629; 1631) "==" | 905 | EQ2@[1629; 1631) "==" |
906 | WHITESPACE@[1631; 1632) " " | 906 | WHITESPACE@[1631; 1632) " " |
907 | PAREN_EXPR@[1632; 1646) | 907 | PAREN_EXPR@[1632; 1646) |
908 | L_PAREN@[1632; 1633) "(" | 908 | L_PAREN@[1632; 1633) "(" |
@@ -911,7 +911,7 @@ SOURCE_FILE@[0; 3813) | |||
911 | PATH_SEGMENT@[1633; 1639) | 911 | PATH_SEGMENT@[1633; 1639) |
912 | NAME_REF@[1633; 1639) | 912 | NAME_REF@[1633; 1639) |
913 | IDENT@[1633; 1639) "assert" | 913 | IDENT@[1633; 1639) "assert" |
914 | EXCL@[1639; 1640) "!" | 914 | BANG@[1639; 1640) "!" |
915 | TOKEN_TREE@[1640; 1645) | 915 | TOKEN_TREE@[1640; 1645) |
916 | L_PAREN@[1640; 1641) "(" | 916 | L_PAREN@[1640; 1641) "(" |
917 | IDENT@[1641; 1642) "p" | 917 | IDENT@[1641; 1642) "p" |
@@ -921,7 +921,7 @@ SOURCE_FILE@[0; 3813) | |||
921 | R_PAREN@[1644; 1645) ")" | 921 | R_PAREN@[1644; 1645) ")" |
922 | R_PAREN@[1645; 1646) ")" | 922 | R_PAREN@[1645; 1646) ")" |
923 | R_PAREN@[1646; 1647) ")" | 923 | R_PAREN@[1646; 1647) ")" |
924 | SEMI@[1647; 1648) ";" | 924 | SEMICOLON@[1647; 1648) ";" |
925 | WHITESPACE@[1648; 1653) "\n " | 925 | WHITESPACE@[1648; 1653) "\n " |
926 | LET_STMT@[1653; 1685) | 926 | LET_STMT@[1653; 1685) |
927 | LET_KW@[1653; 1656) "let" | 927 | LET_KW@[1653; 1656) "let" |
@@ -940,7 +940,7 @@ SOURCE_FILE@[0; 3813) | |||
940 | PATH_SEGMENT@[1663; 1669) | 940 | PATH_SEGMENT@[1663; 1669) |
941 | NAME_REF@[1663; 1669) | 941 | NAME_REF@[1663; 1669) |
942 | IDENT@[1663; 1669) "assert" | 942 | IDENT@[1663; 1669) "assert" |
943 | EXCL@[1669; 1670) "!" | 943 | BANG@[1669; 1670) "!" |
944 | TOKEN_TREE@[1670; 1677) | 944 | TOKEN_TREE@[1670; 1677) |
945 | L_PAREN@[1670; 1671) "(" | 945 | L_PAREN@[1670; 1671) "(" |
946 | TOKEN_TREE@[1671; 1676) | 946 | TOKEN_TREE@[1671; 1676) |
@@ -952,13 +952,13 @@ SOURCE_FILE@[0; 3813) | |||
952 | R_PAREN@[1675; 1676) ")" | 952 | R_PAREN@[1675; 1676) ")" |
953 | R_PAREN@[1676; 1677) ")" | 953 | R_PAREN@[1676; 1677) ")" |
954 | WHITESPACE@[1677; 1678) " " | 954 | WHITESPACE@[1677; 1678) " " |
955 | EQEQ@[1678; 1680) "==" | 955 | EQ2@[1678; 1680) "==" |
956 | WHITESPACE@[1680; 1681) " " | 956 | WHITESPACE@[1680; 1681) " " |
957 | TUPLE_EXPR@[1681; 1683) | 957 | TUPLE_EXPR@[1681; 1683) |
958 | L_PAREN@[1681; 1682) "(" | 958 | L_PAREN@[1681; 1682) "(" |
959 | R_PAREN@[1682; 1683) ")" | 959 | R_PAREN@[1682; 1683) ")" |
960 | R_PAREN@[1683; 1684) ")" | 960 | R_PAREN@[1683; 1684) ")" |
961 | SEMI@[1684; 1685) ";" | 961 | SEMICOLON@[1684; 1685) ";" |
962 | WHITESPACE@[1685; 1690) "\n " | 962 | WHITESPACE@[1685; 1690) "\n " |
963 | LET_STMT@[1690; 1739) | 963 | LET_STMT@[1690; 1739) |
964 | LET_KW@[1690; 1693) "let" | 964 | LET_KW@[1690; 1693) "let" |
@@ -984,7 +984,7 @@ SOURCE_FILE@[0; 3813) | |||
984 | PATH_SEGMENT@[1706; 1713) | 984 | PATH_SEGMENT@[1706; 1713) |
985 | NAME_REF@[1706; 1713) | 985 | NAME_REF@[1706; 1713) |
986 | IDENT@[1706; 1713) "println" | 986 | IDENT@[1706; 1713) "println" |
987 | EXCL@[1713; 1714) "!" | 987 | BANG@[1713; 1714) "!" |
988 | TOKEN_TREE@[1714; 1723) | 988 | TOKEN_TREE@[1714; 1723) |
989 | L_PAREN@[1714; 1715) "(" | 989 | L_PAREN@[1714; 1715) "(" |
990 | STRING@[1715; 1719) "\"{}\"" | 990 | STRING@[1715; 1719) "\"{}\"" |
@@ -993,7 +993,7 @@ SOURCE_FILE@[0; 3813) | |||
993 | INT_NUMBER@[1721; 1722) "0" | 993 | INT_NUMBER@[1721; 1722) "0" |
994 | R_PAREN@[1722; 1723) ")" | 994 | R_PAREN@[1722; 1723) ")" |
995 | WHITESPACE@[1723; 1724) " " | 995 | WHITESPACE@[1723; 1724) " " |
996 | EQEQ@[1724; 1726) "==" | 996 | EQ2@[1724; 1726) "==" |
997 | WHITESPACE@[1726; 1727) " " | 997 | WHITESPACE@[1726; 1727) " " |
998 | PAREN_EXPR@[1727; 1737) | 998 | PAREN_EXPR@[1727; 1737) |
999 | L_PAREN@[1727; 1728) "(" | 999 | L_PAREN@[1727; 1728) "(" |
@@ -1004,7 +1004,7 @@ SOURCE_FILE@[0; 3813) | |||
1004 | INT_NUMBER@[1735; 1736) "0" | 1004 | INT_NUMBER@[1735; 1736) "0" |
1005 | R_PAREN@[1736; 1737) ")" | 1005 | R_PAREN@[1736; 1737) ")" |
1006 | R_PAREN@[1737; 1738) ")" | 1006 | R_PAREN@[1737; 1738) ")" |
1007 | SEMI@[1738; 1739) ";" | 1007 | SEMICOLON@[1738; 1739) ";" |
1008 | WHITESPACE@[1739; 1740) "\n" | 1008 | WHITESPACE@[1739; 1740) "\n" |
1009 | R_CURLY@[1740; 1741) "}" | 1009 | R_CURLY@[1740; 1741) "}" |
1010 | WHITESPACE@[1741; 1743) "\n\n" | 1010 | WHITESPACE@[1741; 1743) "\n\n" |
@@ -1057,7 +1057,7 @@ SOURCE_FILE@[0; 3813) | |||
1057 | WHITESPACE@[1801; 1802) " " | 1057 | WHITESPACE@[1801; 1802) " " |
1058 | LITERAL@[1802; 1803) | 1058 | LITERAL@[1802; 1803) |
1059 | INT_NUMBER@[1802; 1803) "0" | 1059 | INT_NUMBER@[1802; 1803) "0" |
1060 | SEMI@[1803; 1804) ";" | 1060 | SEMICOLON@[1803; 1804) ";" |
1061 | WHITESPACE@[1804; 1809) "\n " | 1061 | WHITESPACE@[1804; 1809) "\n " |
1062 | LOOP_EXPR@[1809; 1902) | 1062 | LOOP_EXPR@[1809; 1902) |
1063 | LOOP_KW@[1809; 1813) "loop" | 1063 | LOOP_KW@[1809; 1813) "loop" |
@@ -1078,7 +1078,7 @@ SOURCE_FILE@[0; 3813) | |||
1078 | WHITESPACE@[1820; 1821) " " | 1078 | WHITESPACE@[1820; 1821) " " |
1079 | LITERAL@[1821; 1822) | 1079 | LITERAL@[1821; 1822) |
1080 | INT_NUMBER@[1821; 1822) "1" | 1080 | INT_NUMBER@[1821; 1822) "1" |
1081 | SEMI@[1822; 1823) ";" | 1081 | SEMICOLON@[1822; 1823) ";" |
1082 | WHITESPACE@[1823; 1824) " " | 1082 | WHITESPACE@[1823; 1824) " " |
1083 | EXPR_STMT@[1824; 1887) | 1083 | EXPR_STMT@[1824; 1887) |
1084 | IF_EXPR@[1824; 1887) | 1084 | IF_EXPR@[1824; 1887) |
@@ -1092,7 +1092,7 @@ SOURCE_FILE@[0; 3813) | |||
1092 | NAME_REF@[1827; 1828) | 1092 | NAME_REF@[1827; 1828) |
1093 | IDENT@[1827; 1828) "i" | 1093 | IDENT@[1827; 1828) "i" |
1094 | WHITESPACE@[1828; 1829) " " | 1094 | WHITESPACE@[1828; 1829) " " |
1095 | EQEQ@[1829; 1831) "==" | 1095 | EQ2@[1829; 1831) "==" |
1096 | WHITESPACE@[1831; 1832) " " | 1096 | WHITESPACE@[1831; 1832) " " |
1097 | LITERAL@[1832; 1833) | 1097 | LITERAL@[1832; 1833) |
1098 | INT_NUMBER@[1832; 1833) "1" | 1098 | INT_NUMBER@[1832; 1833) "1" |
@@ -1138,7 +1138,7 @@ SOURCE_FILE@[0; 3813) | |||
1138 | PATH_SEGMENT@[1870; 1875) | 1138 | PATH_SEGMENT@[1870; 1875) |
1139 | NAME_REF@[1870; 1875) | 1139 | NAME_REF@[1870; 1875) |
1140 | IDENT@[1870; 1875) "panic" | 1140 | IDENT@[1870; 1875) "panic" |
1141 | EXCL@[1875; 1876) "!" | 1141 | BANG@[1875; 1876) "!" |
1142 | TOKEN_TREE@[1876; 1883) | 1142 | TOKEN_TREE@[1876; 1883) |
1143 | L_PAREN@[1876; 1877) "(" | 1143 | L_PAREN@[1876; 1877) "(" |
1144 | STRING@[1877; 1882) "\"wat\"" | 1144 | STRING@[1877; 1882) "\"wat\"" |
@@ -1151,7 +1151,7 @@ SOURCE_FILE@[0; 3813) | |||
1151 | EXPR_STMT@[1894; 1900) | 1151 | EXPR_STMT@[1894; 1900) |
1152 | BREAK_EXPR@[1894; 1899) | 1152 | BREAK_EXPR@[1894; 1899) |
1153 | BREAK_KW@[1894; 1899) "break" | 1153 | BREAK_KW@[1894; 1899) "break" |
1154 | SEMI@[1899; 1900) ";" | 1154 | SEMICOLON@[1899; 1900) ";" |
1155 | WHITESPACE@[1900; 1901) " " | 1155 | WHITESPACE@[1900; 1901) " " |
1156 | R_CURLY@[1901; 1902) "}" | 1156 | R_CURLY@[1901; 1902) "}" |
1157 | WHITESPACE@[1902; 1903) "\n" | 1157 | WHITESPACE@[1902; 1903) "\n" |
@@ -1184,12 +1184,12 @@ SOURCE_FILE@[0; 3813) | |||
1184 | PATH_SEGMENT@[1938; 1945) | 1184 | PATH_SEGMENT@[1938; 1945) |
1185 | NAME_REF@[1938; 1945) | 1185 | NAME_REF@[1938; 1945) |
1186 | IDENT@[1938; 1945) "println" | 1186 | IDENT@[1938; 1945) "println" |
1187 | EXCL@[1945; 1946) "!" | 1187 | BANG@[1945; 1946) "!" |
1188 | TOKEN_TREE@[1946; 1957) | 1188 | TOKEN_TREE@[1946; 1957) |
1189 | L_PAREN@[1946; 1947) "(" | 1189 | L_PAREN@[1946; 1947) "(" |
1190 | STRING@[1947; 1956) "\"lincoln\"" | 1190 | STRING@[1947; 1956) "\"lincoln\"" |
1191 | R_PAREN@[1956; 1957) ")" | 1191 | R_PAREN@[1956; 1957) ")" |
1192 | SEMI@[1957; 1958) ";" | 1192 | SEMICOLON@[1957; 1958) ";" |
1193 | WHITESPACE@[1958; 1959) " " | 1193 | WHITESPACE@[1958; 1959) " " |
1194 | R_CURLY@[1959; 1960) "}" | 1194 | R_CURLY@[1959; 1960) "}" |
1195 | WHITESPACE@[1960; 1962) "\n\n" | 1195 | WHITESPACE@[1960; 1962) "\n\n" |
@@ -1212,7 +1212,7 @@ SOURCE_FILE@[0; 3813) | |||
1212 | PATH_SEGMENT@[1978; 1987) | 1212 | PATH_SEGMENT@[1978; 1987) |
1213 | NAME_REF@[1978; 1987) | 1213 | NAME_REF@[1978; 1987) |
1214 | IDENT@[1978; 1987) "assert_eq" | 1214 | IDENT@[1978; 1987) "assert_eq" |
1215 | EXCL@[1987; 1988) "!" | 1215 | BANG@[1987; 1988) "!" |
1216 | TOKEN_TREE@[1988; 2195) | 1216 | TOKEN_TREE@[1988; 2195) |
1217 | L_PAREN@[1988; 1989) "(" | 1217 | L_PAREN@[1988; 1989) "(" |
1218 | IDENT@[1989; 1995) "String" | 1218 | IDENT@[1989; 1995) "String" |
@@ -1226,7 +1226,7 @@ SOURCE_FILE@[0; 3813) | |||
1226 | COMMA@[2055; 2056) "," | 1226 | COMMA@[2055; 2056) "," |
1227 | WHITESPACE@[2056; 2072) "\n " | 1227 | WHITESPACE@[2056; 2072) "\n " |
1228 | IDENT@[2072; 2078) "format" | 1228 | IDENT@[2072; 2078) "format" |
1229 | EXCL@[2078; 2079) "!" | 1229 | BANG@[2078; 2079) "!" |
1230 | TOKEN_TREE@[2079; 2194) | 1230 | TOKEN_TREE@[2079; 2194) |
1231 | L_PAREN@[2079; 2080) "(" | 1231 | L_PAREN@[2079; 2080) "(" |
1232 | STRING@[2080; 2086) "\"{:?}\"" | 1232 | STRING@[2080; 2086) "\"{:?}\"" |
@@ -1308,7 +1308,7 @@ SOURCE_FILE@[0; 3813) | |||
1308 | DOT@[2192; 2193) "." | 1308 | DOT@[2192; 2193) "." |
1309 | R_PAREN@[2193; 2194) ")" | 1309 | R_PAREN@[2193; 2194) ")" |
1310 | R_PAREN@[2194; 2195) ")" | 1310 | R_PAREN@[2194; 2195) ")" |
1311 | SEMI@[2195; 2196) ";" | 1311 | SEMICOLON@[2195; 2196) ";" |
1312 | WHITESPACE@[2196; 2197) "\n" | 1312 | WHITESPACE@[2196; 2197) "\n" |
1313 | R_CURLY@[2197; 2198) "}" | 1313 | R_CURLY@[2197; 2198) "}" |
1314 | WHITESPACE@[2198; 2200) "\n\n" | 1314 | WHITESPACE@[2198; 2200) "\n\n" |
@@ -1362,7 +1362,7 @@ SOURCE_FILE@[0; 3813) | |||
1362 | PATH_SEGMENT@[2243; 2252) | 1362 | PATH_SEGMENT@[2243; 2252) |
1363 | NAME_REF@[2243; 2252) | 1363 | NAME_REF@[2243; 2252) |
1364 | IDENT@[2243; 2252) "assert_eq" | 1364 | IDENT@[2243; 2252) "assert_eq" |
1365 | EXCL@[2252; 2253) "!" | 1365 | BANG@[2252; 2253) "!" |
1366 | TOKEN_TREE@[2253; 2684) | 1366 | TOKEN_TREE@[2253; 2684) |
1367 | L_PAREN@[2253; 2254) "(" | 1367 | L_PAREN@[2253; 2254) "(" |
1368 | INT_NUMBER@[2254; 2257) "8u8" | 1368 | INT_NUMBER@[2254; 2257) "8u8" |
@@ -1372,7 +1372,7 @@ SOURCE_FILE@[0; 3813) | |||
1372 | L_CURLY@[2259; 2260) "{" | 1372 | L_CURLY@[2259; 2260) "{" |
1373 | WHITESPACE@[2260; 2273) "\n " | 1373 | WHITESPACE@[2260; 2273) "\n " |
1374 | IDENT@[2273; 2284) "macro_rules" | 1374 | IDENT@[2273; 2284) "macro_rules" |
1375 | EXCL@[2284; 2285) "!" | 1375 | BANG@[2284; 2285) "!" |
1376 | WHITESPACE@[2285; 2286) " " | 1376 | WHITESPACE@[2285; 2286) " " |
1377 | IDENT@[2286; 2288) "u8" | 1377 | IDENT@[2286; 2288) "u8" |
1378 | WHITESPACE@[2288; 2289) " " | 1378 | WHITESPACE@[2288; 2289) " " |
@@ -1435,7 +1435,7 @@ SOURCE_FILE@[0; 3813) | |||
1435 | L_CURLY@[2420; 2421) "{" | 1435 | L_CURLY@[2420; 2421) "{" |
1436 | WHITESPACE@[2421; 2450) "\n ..." | 1436 | WHITESPACE@[2421; 2450) "\n ..." |
1437 | STRING@[2450; 2454) "\"u8\"" | 1437 | STRING@[2450; 2454) "\"u8\"" |
1438 | SEMI@[2454; 2455) ";" | 1438 | SEMICOLON@[2454; 2455) ";" |
1439 | WHITESPACE@[2455; 2484) "\n ..." | 1439 | WHITESPACE@[2455; 2484) "\n ..." |
1440 | IDENT@[2484; 2486) "u8" | 1440 | IDENT@[2484; 2486) "u8" |
1441 | WHITESPACE@[2486; 2511) "\n ..." | 1441 | WHITESPACE@[2486; 2511) "\n ..." |
@@ -1444,17 +1444,17 @@ SOURCE_FILE@[0; 3813) | |||
1444 | R_CURLY@[2533; 2534) "}" | 1444 | R_CURLY@[2533; 2534) "}" |
1445 | WHITESPACE@[2534; 2551) "\n " | 1445 | WHITESPACE@[2534; 2551) "\n " |
1446 | R_CURLY@[2551; 2552) "}" | 1446 | R_CURLY@[2551; 2552) "}" |
1447 | SEMI@[2552; 2553) ";" | 1447 | SEMICOLON@[2552; 2553) ";" |
1448 | WHITESPACE@[2553; 2566) "\n " | 1448 | WHITESPACE@[2553; 2566) "\n " |
1449 | R_CURLY@[2566; 2567) "}" | 1449 | R_CURLY@[2566; 2567) "}" |
1450 | WHITESPACE@[2567; 2581) "\n\n " | 1450 | WHITESPACE@[2567; 2581) "\n\n " |
1451 | IDENT@[2581; 2583) "u8" | 1451 | IDENT@[2581; 2583) "u8" |
1452 | EXCL@[2583; 2584) "!" | 1452 | BANG@[2583; 2584) "!" |
1453 | TOKEN_TREE@[2584; 2588) | 1453 | TOKEN_TREE@[2584; 2588) |
1454 | L_PAREN@[2584; 2585) "(" | 1454 | L_PAREN@[2584; 2585) "(" |
1455 | IDENT@[2585; 2587) "u8" | 1455 | IDENT@[2585; 2587) "u8" |
1456 | R_PAREN@[2587; 2588) ")" | 1456 | R_PAREN@[2587; 2588) ")" |
1457 | SEMI@[2588; 2589) ";" | 1457 | SEMICOLON@[2588; 2589) ";" |
1458 | WHITESPACE@[2589; 2602) "\n " | 1458 | WHITESPACE@[2589; 2602) "\n " |
1459 | LET_KW@[2602; 2605) "let" | 1459 | LET_KW@[2602; 2605) "let" |
1460 | WHITESPACE@[2605; 2606) " " | 1460 | WHITESPACE@[2605; 2606) " " |
@@ -1476,7 +1476,7 @@ SOURCE_FILE@[0; 3813) | |||
1476 | AMP@[2624; 2625) "&" | 1476 | AMP@[2624; 2625) "&" |
1477 | INT_NUMBER@[2625; 2628) "8u8" | 1477 | INT_NUMBER@[2625; 2628) "8u8" |
1478 | R_PAREN@[2628; 2629) ")" | 1478 | R_PAREN@[2628; 2629) ")" |
1479 | SEMI@[2629; 2630) ";" | 1479 | SEMICOLON@[2629; 2630) ";" |
1480 | WHITESPACE@[2630; 2643) "\n " | 1480 | WHITESPACE@[2630; 2643) "\n " |
1481 | CRATE_KW@[2643; 2648) "crate" | 1481 | CRATE_KW@[2643; 2648) "crate" |
1482 | COLON@[2648; 2649) ":" | 1482 | COLON@[2648; 2649) ":" |
@@ -1486,13 +1486,13 @@ SOURCE_FILE@[0; 3813) | |||
1486 | L_PAREN@[2652; 2653) "(" | 1486 | L_PAREN@[2652; 2653) "(" |
1487 | INT_NUMBER@[2653; 2656) "0u8" | 1487 | INT_NUMBER@[2653; 2656) "0u8" |
1488 | R_PAREN@[2656; 2657) ")" | 1488 | R_PAREN@[2656; 2657) ")" |
1489 | SEMI@[2657; 2658) ";" | 1489 | SEMICOLON@[2657; 2658) ";" |
1490 | WHITESPACE@[2658; 2671) "\n " | 1490 | WHITESPACE@[2658; 2671) "\n " |
1491 | IDENT@[2671; 2673) "u8" | 1491 | IDENT@[2671; 2673) "u8" |
1492 | WHITESPACE@[2673; 2682) "\n " | 1492 | WHITESPACE@[2673; 2682) "\n " |
1493 | R_CURLY@[2682; 2683) "}" | 1493 | R_CURLY@[2682; 2683) "}" |
1494 | R_PAREN@[2683; 2684) ")" | 1494 | R_PAREN@[2683; 2684) ")" |
1495 | SEMI@[2684; 2685) ";" | 1495 | SEMICOLON@[2684; 2685) ";" |
1496 | WHITESPACE@[2685; 2690) "\n " | 1496 | WHITESPACE@[2685; 2690) "\n " |
1497 | R_CURLY@[2690; 2691) "}" | 1497 | R_CURLY@[2690; 2691) "}" |
1498 | WHITESPACE@[2691; 2692) "\n" | 1498 | WHITESPACE@[2691; 2692) "\n" |
@@ -1517,7 +1517,7 @@ SOURCE_FILE@[0; 3813) | |||
1517 | PATH_SEGMENT@[2712; 2721) | 1517 | PATH_SEGMENT@[2712; 2721) |
1518 | NAME_REF@[2712; 2721) | 1518 | NAME_REF@[2712; 2721) |
1519 | IDENT@[2712; 2721) "assert_eq" | 1519 | IDENT@[2712; 2721) "assert_eq" |
1520 | EXCL@[2721; 2722) "!" | 1520 | BANG@[2721; 2722) "!" |
1521 | TOKEN_TREE@[2722; 2829) | 1521 | TOKEN_TREE@[2722; 2829) |
1522 | L_PAREN@[2722; 2723) "(" | 1522 | L_PAREN@[2722; 2723) "(" |
1523 | IDENT@[2723; 2729) "String" | 1523 | IDENT@[2723; 2729) "String" |
@@ -1575,7 +1575,7 @@ SOURCE_FILE@[0; 3813) | |||
1575 | L_PAREN@[2826; 2827) "(" | 1575 | L_PAREN@[2826; 2827) "(" |
1576 | R_PAREN@[2827; 2828) ")" | 1576 | R_PAREN@[2827; 2828) ")" |
1577 | R_PAREN@[2828; 2829) ")" | 1577 | R_PAREN@[2828; 2829) ")" |
1578 | SEMI@[2829; 2830) ";" | 1578 | SEMICOLON@[2829; 2830) ";" |
1579 | WHITESPACE@[2830; 2831) "\n" | 1579 | WHITESPACE@[2830; 2831) "\n" |
1580 | R_CURLY@[2831; 2832) "}" | 1580 | R_CURLY@[2831; 2832) "}" |
1581 | WHITESPACE@[2832; 2834) "\n\n" | 1581 | WHITESPACE@[2832; 2834) "\n\n" |
@@ -1654,7 +1654,7 @@ SOURCE_FILE@[0; 3813) | |||
1654 | EQ@[2946; 2947) "=" | 1654 | EQ@[2946; 2947) "=" |
1655 | WHITESPACE@[2947; 2948) " " | 1655 | WHITESPACE@[2947; 2948) " " |
1656 | PREFIX_EXPR@[2948; 3013) | 1656 | PREFIX_EXPR@[2948; 3013) |
1657 | EXCL@[2948; 2949) "!" | 1657 | BANG@[2948; 2949) "!" |
1658 | PAREN_EXPR@[2949; 3013) | 1658 | PAREN_EXPR@[2949; 3013) |
1659 | L_PAREN@[2949; 2950) "(" | 1659 | L_PAREN@[2949; 2950) "(" |
1660 | BIN_EXPR@[2950; 3012) | 1660 | BIN_EXPR@[2950; 3012) |
@@ -1668,7 +1668,7 @@ SOURCE_FILE@[0; 3813) | |||
1668 | TUPLE_PAT@[2952; 2956) | 1668 | TUPLE_PAT@[2952; 2956) |
1669 | L_PAREN@[2952; 2953) "(" | 1669 | L_PAREN@[2952; 2953) "(" |
1670 | DOT_DOT_PAT@[2953; 2955) | 1670 | DOT_DOT_PAT@[2953; 2955) |
1671 | DOTDOT@[2953; 2955) ".." | 1671 | DOT2@[2953; 2955) ".." |
1672 | R_PAREN@[2955; 2956) ")" | 1672 | R_PAREN@[2955; 2956) ")" |
1673 | COLON@[2956; 2957) ":" | 1673 | COLON@[2956; 2957) ":" |
1674 | TUPLE_TYPE@[2957; 2962) | 1674 | TUPLE_TYPE@[2957; 2962) |
@@ -1715,7 +1715,7 @@ SOURCE_FILE@[0; 3813) | |||
1715 | L_CURLY@[2992; 2993) "{" | 1715 | L_CURLY@[2992; 2993) "{" |
1716 | R_CURLY@[2993; 2994) "}" | 1716 | R_CURLY@[2993; 2994) "}" |
1717 | R_PAREN@[2994; 2995) ")" | 1717 | R_PAREN@[2994; 2995) ")" |
1718 | EQEQ@[2995; 2997) "==" | 1718 | EQ2@[2995; 2997) "==" |
1719 | BLOCK_EXPR@[2997; 3012) | 1719 | BLOCK_EXPR@[2997; 3012) |
1720 | BLOCK@[2997; 3012) | 1720 | BLOCK@[2997; 3012) |
1721 | L_CURLY@[2997; 2998) "{" | 1721 | L_CURLY@[2997; 2998) "{" |
@@ -1726,20 +1726,20 @@ SOURCE_FILE@[0; 3813) | |||
1726 | ARRAY_EXPR@[2999; 3006) | 1726 | ARRAY_EXPR@[2999; 3006) |
1727 | L_BRACK@[2999; 3000) "[" | 1727 | L_BRACK@[2999; 3000) "[" |
1728 | RANGE_EXPR@[3000; 3005) | 1728 | RANGE_EXPR@[3000; 3005) |
1729 | DOTDOTEQ@[3000; 3003) "..=" | 1729 | DOT2EQ@[3000; 3003) "..=" |
1730 | RANGE_EXPR@[3003; 3005) | 1730 | RANGE_EXPR@[3003; 3005) |
1731 | DOTDOT@[3003; 3005) ".." | 1731 | DOT2@[3003; 3005) ".." |
1732 | R_BRACK@[3005; 3006) "]" | 1732 | R_BRACK@[3005; 3006) "]" |
1733 | L_BRACK@[3006; 3007) "[" | 1733 | L_BRACK@[3006; 3007) "[" |
1734 | RANGE_EXPR@[3007; 3009) | 1734 | RANGE_EXPR@[3007; 3009) |
1735 | DOTDOT@[3007; 3009) ".." | 1735 | DOT2@[3007; 3009) ".." |
1736 | R_BRACK@[3009; 3010) "]" | 1736 | R_BRACK@[3009; 3010) "]" |
1737 | SEMI@[3010; 3011) ";" | 1737 | SEMICOLON@[3010; 3011) ";" |
1738 | R_CURLY@[3011; 3012) "}" | 1738 | R_CURLY@[3011; 3012) "}" |
1739 | R_PAREN@[3012; 3013) ")" | 1739 | R_PAREN@[3012; 3013) ")" |
1740 | COMMENT@[3013; 3015) "//" | 1740 | COMMENT@[3013; 3015) "//" |
1741 | WHITESPACE@[3015; 3020) "\n " | 1741 | WHITESPACE@[3015; 3020) "\n " |
1742 | SEMI@[3020; 3021) ";" | 1742 | SEMICOLON@[3020; 3021) ";" |
1743 | WHITESPACE@[3021; 3026) "\n " | 1743 | WHITESPACE@[3021; 3026) "\n " |
1744 | EXPR_STMT@[3026; 3040) | 1744 | EXPR_STMT@[3026; 3040) |
1745 | MACRO_CALL@[3026; 3039) | 1745 | MACRO_CALL@[3026; 3039) |
@@ -1747,13 +1747,13 @@ SOURCE_FILE@[0; 3813) | |||
1747 | PATH_SEGMENT@[3026; 3032) | 1747 | PATH_SEGMENT@[3026; 3032) |
1748 | NAME_REF@[3026; 3032) | 1748 | NAME_REF@[3026; 3032) |
1749 | IDENT@[3026; 3032) "assert" | 1749 | IDENT@[3026; 3032) "assert" |
1750 | EXCL@[3032; 3033) "!" | 1750 | BANG@[3032; 3033) "!" |
1751 | TOKEN_TREE@[3033; 3039) | 1751 | TOKEN_TREE@[3033; 3039) |
1752 | L_PAREN@[3033; 3034) "(" | 1752 | L_PAREN@[3033; 3034) "(" |
1753 | EXCL@[3034; 3035) "!" | 1753 | BANG@[3034; 3035) "!" |
1754 | IDENT@[3035; 3038) "val" | 1754 | IDENT@[3035; 3038) "val" |
1755 | R_PAREN@[3038; 3039) ")" | 1755 | R_PAREN@[3038; 3039) ")" |
1756 | SEMI@[3039; 3040) ";" | 1756 | SEMICOLON@[3039; 3040) ";" |
1757 | WHITESPACE@[3040; 3041) "\n" | 1757 | WHITESPACE@[3040; 3041) "\n" |
1758 | R_CURLY@[3041; 3042) "}" | 1758 | R_CURLY@[3041; 3042) "}" |
1759 | WHITESPACE@[3042; 3044) "\n\n" | 1759 | WHITESPACE@[3042; 3044) "\n\n" |
@@ -1781,11 +1781,11 @@ SOURCE_FILE@[0; 3813) | |||
1781 | PATH_SEGMENT@[3068; 3071) | 1781 | PATH_SEGMENT@[3068; 3071) |
1782 | NAME_REF@[3068; 3071) | 1782 | NAME_REF@[3068; 3071) |
1783 | IDENT@[3068; 3071) "std" | 1783 | IDENT@[3068; 3071) "std" |
1784 | COLONCOLON@[3071; 3073) "::" | 1784 | COLON2@[3071; 3073) "::" |
1785 | PATH_SEGMENT@[3073; 3076) | 1785 | PATH_SEGMENT@[3073; 3076) |
1786 | NAME_REF@[3073; 3076) | 1786 | NAME_REF@[3073; 3076) |
1787 | IDENT@[3073; 3076) "fmt" | 1787 | IDENT@[3073; 3076) "fmt" |
1788 | COLONCOLON@[3076; 3078) "::" | 1788 | COLON2@[3076; 3078) "::" |
1789 | PATH_SEGMENT@[3078; 3083) | 1789 | PATH_SEGMENT@[3078; 3083) |
1790 | NAME_REF@[3078; 3083) | 1790 | NAME_REF@[3078; 3083) |
1791 | IDENT@[3078; 3083) "Debug" | 1791 | IDENT@[3078; 3083) "Debug" |
@@ -1795,300 +1795,300 @@ SOURCE_FILE@[0; 3813) | |||
1795 | L_CURLY@[3084; 3085) "{" | 1795 | L_CURLY@[3084; 3085) "{" |
1796 | WHITESPACE@[3085; 3090) "\n " | 1796 | WHITESPACE@[3085; 3090) "\n " |
1797 | RANGE_EXPR@[3090; 3512) | 1797 | RANGE_EXPR@[3090; 3512) |
1798 | DOTDOTEQ@[3090; 3093) "..=" | 1798 | DOT2EQ@[3090; 3093) "..=" |
1799 | RANGE_EXPR@[3093; 3512) | 1799 | RANGE_EXPR@[3093; 3512) |
1800 | DOTDOTEQ@[3093; 3096) "..=" | 1800 | DOT2EQ@[3093; 3096) "..=" |
1801 | RANGE_EXPR@[3096; 3512) | 1801 | RANGE_EXPR@[3096; 3512) |
1802 | DOTDOT@[3096; 3098) ".." | 1802 | DOT2@[3096; 3098) ".." |
1803 | WHITESPACE@[3098; 3099) " " | 1803 | WHITESPACE@[3098; 3099) " " |
1804 | RANGE_EXPR@[3099; 3512) | 1804 | RANGE_EXPR@[3099; 3512) |
1805 | DOTDOT@[3099; 3101) ".." | 1805 | DOT2@[3099; 3101) ".." |
1806 | WHITESPACE@[3101; 3105) " " | 1806 | WHITESPACE@[3101; 3105) " " |
1807 | RANGE_EXPR@[3105; 3512) | 1807 | RANGE_EXPR@[3105; 3512) |
1808 | DOTDOT@[3105; 3107) ".." | 1808 | DOT2@[3105; 3107) ".." |
1809 | WHITESPACE@[3107; 3108) " " | 1809 | WHITESPACE@[3107; 3108) " " |
1810 | RANGE_EXPR@[3108; 3512) | 1810 | RANGE_EXPR@[3108; 3512) |
1811 | DOTDOT@[3108; 3110) ".." | 1811 | DOT2@[3108; 3110) ".." |
1812 | WHITESPACE@[3110; 3111) " " | 1812 | WHITESPACE@[3110; 3111) " " |
1813 | RANGE_EXPR@[3111; 3512) | 1813 | RANGE_EXPR@[3111; 3512) |
1814 | DOTDOT@[3111; 3113) ".." | 1814 | DOT2@[3111; 3113) ".." |
1815 | WHITESPACE@[3113; 3114) " " | 1815 | WHITESPACE@[3113; 3114) " " |
1816 | RANGE_EXPR@[3114; 3512) | 1816 | RANGE_EXPR@[3114; 3512) |
1817 | DOTDOT@[3114; 3116) ".." | 1817 | DOT2@[3114; 3116) ".." |
1818 | WHITESPACE@[3116; 3120) " " | 1818 | WHITESPACE@[3116; 3120) " " |
1819 | RANGE_EXPR@[3120; 3512) | 1819 | RANGE_EXPR@[3120; 3512) |
1820 | DOTDOT@[3120; 3122) ".." | 1820 | DOT2@[3120; 3122) ".." |
1821 | WHITESPACE@[3122; 3123) " " | 1821 | WHITESPACE@[3122; 3123) " " |
1822 | RANGE_EXPR@[3123; 3512) | 1822 | RANGE_EXPR@[3123; 3512) |
1823 | DOTDOT@[3123; 3125) ".." | 1823 | DOT2@[3123; 3125) ".." |
1824 | WHITESPACE@[3125; 3126) " " | 1824 | WHITESPACE@[3125; 3126) " " |
1825 | RANGE_EXPR@[3126; 3512) | 1825 | RANGE_EXPR@[3126; 3512) |
1826 | DOTDOT@[3126; 3128) ".." | 1826 | DOT2@[3126; 3128) ".." |
1827 | WHITESPACE@[3128; 3129) " " | 1827 | WHITESPACE@[3128; 3129) " " |
1828 | RANGE_EXPR@[3129; 3512) | 1828 | RANGE_EXPR@[3129; 3512) |
1829 | DOTDOT@[3129; 3131) ".." | 1829 | DOT2@[3129; 3131) ".." |
1830 | WHITESPACE@[3131; 3135) " " | 1830 | WHITESPACE@[3131; 3135) " " |
1831 | RANGE_EXPR@[3135; 3512) | 1831 | RANGE_EXPR@[3135; 3512) |
1832 | DOTDOT@[3135; 3137) ".." | 1832 | DOT2@[3135; 3137) ".." |
1833 | WHITESPACE@[3137; 3138) " " | 1833 | WHITESPACE@[3137; 3138) " " |
1834 | RANGE_EXPR@[3138; 3512) | 1834 | RANGE_EXPR@[3138; 3512) |
1835 | DOTDOTEQ@[3138; 3141) "..=" | 1835 | DOT2EQ@[3138; 3141) "..=" |
1836 | RANGE_EXPR@[3141; 3512) | 1836 | RANGE_EXPR@[3141; 3512) |
1837 | DOTDOT@[3141; 3143) ".." | 1837 | DOT2@[3141; 3143) ".." |
1838 | WHITESPACE@[3143; 3144) " " | 1838 | WHITESPACE@[3143; 3144) " " |
1839 | RANGE_EXPR@[3144; 3512) | 1839 | RANGE_EXPR@[3144; 3512) |
1840 | DOTDOT@[3144; 3146) ".." | 1840 | DOT2@[3144; 3146) ".." |
1841 | WHITESPACE@[3146; 3151) "\n " | 1841 | WHITESPACE@[3146; 3151) "\n " |
1842 | RANGE_EXPR@[3151; 3512) | 1842 | RANGE_EXPR@[3151; 3512) |
1843 | DOTDOTEQ@[3151; 3154) "..=" | 1843 | DOT2EQ@[3151; 3154) "..=" |
1844 | RANGE_EXPR@[3154; 3512) | 1844 | RANGE_EXPR@[3154; 3512) |
1845 | DOTDOT@[3154; 3156) ".." | 1845 | DOT2@[3154; 3156) ".." |
1846 | WHITESPACE@[3156; 3157) " " | 1846 | WHITESPACE@[3156; 3157) " " |
1847 | RANGE_EXPR@[3157; 3512) | 1847 | RANGE_EXPR@[3157; 3512) |
1848 | DOTDOTEQ@[3157; 3160) "..=" | 1848 | DOT2EQ@[3157; 3160) "..=" |
1849 | RANGE_EXPR@[3160; 3512) | 1849 | RANGE_EXPR@[3160; 3512) |
1850 | DOTDOT@[3160; 3162) ".." | 1850 | DOT2@[3160; 3162) ".." |
1851 | WHITESPACE@[3162; 3166) " " | 1851 | WHITESPACE@[3162; 3166) " " |
1852 | RANGE_EXPR@[3166; 3512) | 1852 | RANGE_EXPR@[3166; 3512) |
1853 | DOTDOT@[3166; 3168) ".." | 1853 | DOT2@[3166; 3168) ".." |
1854 | WHITESPACE@[3168; 3169) " " | 1854 | WHITESPACE@[3168; 3169) " " |
1855 | RANGE_EXPR@[3169; 3512) | 1855 | RANGE_EXPR@[3169; 3512) |
1856 | DOTDOT@[3169; 3171) ".." | 1856 | DOT2@[3169; 3171) ".." |
1857 | WHITESPACE@[3171; 3172) " " | 1857 | WHITESPACE@[3171; 3172) " " |
1858 | RANGE_EXPR@[3172; 3512) | 1858 | RANGE_EXPR@[3172; 3512) |
1859 | DOTDOT@[3172; 3174) ".." | 1859 | DOT2@[3172; 3174) ".." |
1860 | WHITESPACE@[3174; 3175) " " | 1860 | WHITESPACE@[3174; 3175) " " |
1861 | RANGE_EXPR@[3175; 3512) | 1861 | RANGE_EXPR@[3175; 3512) |
1862 | DOTDOT@[3175; 3177) ".." | 1862 | DOT2@[3175; 3177) ".." |
1863 | WHITESPACE@[3177; 3181) " " | 1863 | WHITESPACE@[3177; 3181) " " |
1864 | RANGE_EXPR@[3181; 3512) | 1864 | RANGE_EXPR@[3181; 3512) |
1865 | DOTDOT@[3181; 3183) ".." | 1865 | DOT2@[3181; 3183) ".." |
1866 | WHITESPACE@[3183; 3184) " " | 1866 | WHITESPACE@[3183; 3184) " " |
1867 | RANGE_EXPR@[3184; 3512) | 1867 | RANGE_EXPR@[3184; 3512) |
1868 | DOTDOT@[3184; 3186) ".." | 1868 | DOT2@[3184; 3186) ".." |
1869 | WHITESPACE@[3186; 3187) " " | 1869 | WHITESPACE@[3186; 3187) " " |
1870 | RANGE_EXPR@[3187; 3512) | 1870 | RANGE_EXPR@[3187; 3512) |
1871 | DOTDOT@[3187; 3189) ".." | 1871 | DOT2@[3187; 3189) ".." |
1872 | WHITESPACE@[3189; 3190) " " | 1872 | WHITESPACE@[3189; 3190) " " |
1873 | RANGE_EXPR@[3190; 3512) | 1873 | RANGE_EXPR@[3190; 3512) |
1874 | DOTDOT@[3190; 3192) ".." | 1874 | DOT2@[3190; 3192) ".." |
1875 | WHITESPACE@[3192; 3196) " " | 1875 | WHITESPACE@[3192; 3196) " " |
1876 | RANGE_EXPR@[3196; 3512) | 1876 | RANGE_EXPR@[3196; 3512) |
1877 | DOTDOTEQ@[3196; 3199) "..=" | 1877 | DOT2EQ@[3196; 3199) "..=" |
1878 | RANGE_EXPR@[3199; 3512) | 1878 | RANGE_EXPR@[3199; 3512) |
1879 | DOTDOTEQ@[3199; 3202) "..=" | 1879 | DOT2EQ@[3199; 3202) "..=" |
1880 | RANGE_EXPR@[3202; 3512) | 1880 | RANGE_EXPR@[3202; 3512) |
1881 | DOTDOTEQ@[3202; 3205) "..=" | 1881 | DOT2EQ@[3202; 3205) "..=" |
1882 | RANGE_EXPR@[3205; 3512) | 1882 | RANGE_EXPR@[3205; 3512) |
1883 | DOTDOT@[3205; 3207) ".." | 1883 | DOT2@[3205; 3207) ".." |
1884 | WHITESPACE@[3207; 3212) "\n " | 1884 | WHITESPACE@[3207; 3212) "\n " |
1885 | RANGE_EXPR@[3212; 3512) | 1885 | RANGE_EXPR@[3212; 3512) |
1886 | DOTDOTEQ@[3212; 3215) "..=" | 1886 | DOT2EQ@[3212; 3215) "..=" |
1887 | RANGE_EXPR@[3215; 3512) | 1887 | RANGE_EXPR@[3215; 3512) |
1888 | DOTDOT@[3215; 3217) ".." | 1888 | DOT2@[3215; 3217) ".." |
1889 | WHITESPACE@[3217; 3218) " " | 1889 | WHITESPACE@[3217; 3218) " " |
1890 | RANGE_EXPR@[3218; 3512) | 1890 | RANGE_EXPR@[3218; 3512) |
1891 | DOTDOTEQ@[3218; 3221) "..=" | 1891 | DOT2EQ@[3218; 3221) "..=" |
1892 | RANGE_EXPR@[3221; 3512) | 1892 | RANGE_EXPR@[3221; 3512) |
1893 | DOTDOT@[3221; 3223) ".." | 1893 | DOT2@[3221; 3223) ".." |
1894 | WHITESPACE@[3223; 3227) " " | 1894 | WHITESPACE@[3223; 3227) " " |
1895 | RANGE_EXPR@[3227; 3512) | 1895 | RANGE_EXPR@[3227; 3512) |
1896 | DOTDOTEQ@[3227; 3230) "..=" | 1896 | DOT2EQ@[3227; 3230) "..=" |
1897 | RANGE_EXPR@[3230; 3512) | 1897 | RANGE_EXPR@[3230; 3512) |
1898 | DOTDOT@[3230; 3232) ".." | 1898 | DOT2@[3230; 3232) ".." |
1899 | WHITESPACE@[3232; 3233) " " | 1899 | WHITESPACE@[3232; 3233) " " |
1900 | RANGE_EXPR@[3233; 3512) | 1900 | RANGE_EXPR@[3233; 3512) |
1901 | DOTDOTEQ@[3233; 3236) "..=" | 1901 | DOT2EQ@[3233; 3236) "..=" |
1902 | RANGE_EXPR@[3236; 3512) | 1902 | RANGE_EXPR@[3236; 3512) |
1903 | DOTDOT@[3236; 3238) ".." | 1903 | DOT2@[3236; 3238) ".." |
1904 | WHITESPACE@[3238; 3242) " " | 1904 | WHITESPACE@[3238; 3242) " " |
1905 | RANGE_EXPR@[3242; 3512) | 1905 | RANGE_EXPR@[3242; 3512) |
1906 | DOTDOT@[3242; 3244) ".." | 1906 | DOT2@[3242; 3244) ".." |
1907 | WHITESPACE@[3244; 3245) " " | 1907 | WHITESPACE@[3244; 3245) " " |
1908 | RANGE_EXPR@[3245; 3512) | 1908 | RANGE_EXPR@[3245; 3512) |
1909 | DOTDOTEQ@[3245; 3248) "..=" | 1909 | DOT2EQ@[3245; 3248) "..=" |
1910 | RANGE_EXPR@[3248; 3512) | 1910 | RANGE_EXPR@[3248; 3512) |
1911 | DOTDOTEQ@[3248; 3251) "..=" | 1911 | DOT2EQ@[3248; 3251) "..=" |
1912 | RANGE_EXPR@[3251; 3512) | 1912 | RANGE_EXPR@[3251; 3512) |
1913 | DOTDOT@[3251; 3253) ".." | 1913 | DOT2@[3251; 3253) ".." |
1914 | WHITESPACE@[3253; 3257) " " | 1914 | WHITESPACE@[3253; 3257) " " |
1915 | RANGE_EXPR@[3257; 3512) | 1915 | RANGE_EXPR@[3257; 3512) |
1916 | DOTDOT@[3257; 3259) ".." | 1916 | DOT2@[3257; 3259) ".." |
1917 | WHITESPACE@[3259; 3260) " " | 1917 | WHITESPACE@[3259; 3260) " " |
1918 | RANGE_EXPR@[3260; 3512) | 1918 | RANGE_EXPR@[3260; 3512) |
1919 | DOTDOTEQ@[3260; 3263) "..=" | 1919 | DOT2EQ@[3260; 3263) "..=" |
1920 | RANGE_EXPR@[3263; 3512) | 1920 | RANGE_EXPR@[3263; 3512) |
1921 | DOTDOT@[3263; 3265) ".." | 1921 | DOT2@[3263; 3265) ".." |
1922 | WHITESPACE@[3265; 3266) " " | 1922 | WHITESPACE@[3265; 3266) " " |
1923 | RANGE_EXPR@[3266; 3512) | 1923 | RANGE_EXPR@[3266; 3512) |
1924 | DOTDOT@[3266; 3268) ".." | 1924 | DOT2@[3266; 3268) ".." |
1925 | WHITESPACE@[3268; 3273) "\n " | 1925 | WHITESPACE@[3268; 3273) "\n " |
1926 | RANGE_EXPR@[3273; 3512) | 1926 | RANGE_EXPR@[3273; 3512) |
1927 | DOTDOTEQ@[3273; 3276) "..=" | 1927 | DOT2EQ@[3273; 3276) "..=" |
1928 | RANGE_EXPR@[3276; 3512) | 1928 | RANGE_EXPR@[3276; 3512) |
1929 | DOTDOTEQ@[3276; 3279) "..=" | 1929 | DOT2EQ@[3276; 3279) "..=" |
1930 | RANGE_EXPR@[3279; 3512) | 1930 | RANGE_EXPR@[3279; 3512) |
1931 | DOTDOT@[3279; 3281) ".." | 1931 | DOT2@[3279; 3281) ".." |
1932 | WHITESPACE@[3281; 3282) " " | 1932 | WHITESPACE@[3281; 3282) " " |
1933 | RANGE_EXPR@[3282; 3512) | 1933 | RANGE_EXPR@[3282; 3512) |
1934 | DOTDOT@[3282; 3284) ".." | 1934 | DOT2@[3282; 3284) ".." |
1935 | WHITESPACE@[3284; 3288) " " | 1935 | WHITESPACE@[3284; 3288) " " |
1936 | RANGE_EXPR@[3288; 3512) | 1936 | RANGE_EXPR@[3288; 3512) |
1937 | DOTDOTEQ@[3288; 3291) "..=" | 1937 | DOT2EQ@[3288; 3291) "..=" |
1938 | RANGE_EXPR@[3291; 3512) | 1938 | RANGE_EXPR@[3291; 3512) |
1939 | DOTDOT@[3291; 3293) ".." | 1939 | DOT2@[3291; 3293) ".." |
1940 | WHITESPACE@[3293; 3294) " " | 1940 | WHITESPACE@[3293; 3294) " " |
1941 | RANGE_EXPR@[3294; 3512) | 1941 | RANGE_EXPR@[3294; 3512) |
1942 | DOTDOTEQ@[3294; 3297) "..=" | 1942 | DOT2EQ@[3294; 3297) "..=" |
1943 | RANGE_EXPR@[3297; 3512) | 1943 | RANGE_EXPR@[3297; 3512) |
1944 | DOTDOT@[3297; 3299) ".." | 1944 | DOT2@[3297; 3299) ".." |
1945 | WHITESPACE@[3299; 3303) " " | 1945 | WHITESPACE@[3299; 3303) " " |
1946 | RANGE_EXPR@[3303; 3512) | 1946 | RANGE_EXPR@[3303; 3512) |
1947 | DOTDOTEQ@[3303; 3306) "..=" | 1947 | DOT2EQ@[3303; 3306) "..=" |
1948 | RANGE_EXPR@[3306; 3512) | 1948 | RANGE_EXPR@[3306; 3512) |
1949 | DOTDOT@[3306; 3308) ".." | 1949 | DOT2@[3306; 3308) ".." |
1950 | WHITESPACE@[3308; 3309) " " | 1950 | WHITESPACE@[3308; 3309) " " |
1951 | RANGE_EXPR@[3309; 3512) | 1951 | RANGE_EXPR@[3309; 3512) |
1952 | DOTDOT@[3309; 3311) ".." | 1952 | DOT2@[3309; 3311) ".." |
1953 | WHITESPACE@[3311; 3312) " " | 1953 | WHITESPACE@[3311; 3312) " " |
1954 | RANGE_EXPR@[3312; 3512) | 1954 | RANGE_EXPR@[3312; 3512) |
1955 | DOTDOT@[3312; 3314) ".." | 1955 | DOT2@[3312; 3314) ".." |
1956 | WHITESPACE@[3314; 3318) " " | 1956 | WHITESPACE@[3314; 3318) " " |
1957 | RANGE_EXPR@[3318; 3512) | 1957 | RANGE_EXPR@[3318; 3512) |
1958 | DOTDOT@[3318; 3320) ".." | 1958 | DOT2@[3318; 3320) ".." |
1959 | WHITESPACE@[3320; 3321) " " | 1959 | WHITESPACE@[3320; 3321) " " |
1960 | RANGE_EXPR@[3321; 3512) | 1960 | RANGE_EXPR@[3321; 3512) |
1961 | DOTDOTEQ@[3321; 3324) "..=" | 1961 | DOT2EQ@[3321; 3324) "..=" |
1962 | RANGE_EXPR@[3324; 3512) | 1962 | RANGE_EXPR@[3324; 3512) |
1963 | DOTDOT@[3324; 3326) ".." | 1963 | DOT2@[3324; 3326) ".." |
1964 | WHITESPACE@[3326; 3327) " " | 1964 | WHITESPACE@[3326; 3327) " " |
1965 | RANGE_EXPR@[3327; 3512) | 1965 | RANGE_EXPR@[3327; 3512) |
1966 | DOTDOT@[3327; 3329) ".." | 1966 | DOT2@[3327; 3329) ".." |
1967 | WHITESPACE@[3329; 3334) "\n " | 1967 | WHITESPACE@[3329; 3334) "\n " |
1968 | RANGE_EXPR@[3334; 3512) | 1968 | RANGE_EXPR@[3334; 3512) |
1969 | DOTDOTEQ@[3334; 3337) "..=" | 1969 | DOT2EQ@[3334; 3337) "..=" |
1970 | RANGE_EXPR@[3337; 3512) | 1970 | RANGE_EXPR@[3337; 3512) |
1971 | DOTDOT@[3337; 3339) ".." | 1971 | DOT2@[3337; 3339) ".." |
1972 | WHITESPACE@[3339; 3340) " " | 1972 | WHITESPACE@[3339; 3340) " " |
1973 | RANGE_EXPR@[3340; 3512) | 1973 | RANGE_EXPR@[3340; 3512) |
1974 | DOTDOTEQ@[3340; 3343) "..=" | 1974 | DOT2EQ@[3340; 3343) "..=" |
1975 | RANGE_EXPR@[3343; 3512) | 1975 | RANGE_EXPR@[3343; 3512) |
1976 | DOTDOT@[3343; 3345) ".." | 1976 | DOT2@[3343; 3345) ".." |
1977 | WHITESPACE@[3345; 3349) " " | 1977 | WHITESPACE@[3345; 3349) " " |
1978 | RANGE_EXPR@[3349; 3512) | 1978 | RANGE_EXPR@[3349; 3512) |
1979 | DOTDOTEQ@[3349; 3352) "..=" | 1979 | DOT2EQ@[3349; 3352) "..=" |
1980 | RANGE_EXPR@[3352; 3512) | 1980 | RANGE_EXPR@[3352; 3512) |
1981 | DOTDOT@[3352; 3354) ".." | 1981 | DOT2@[3352; 3354) ".." |
1982 | WHITESPACE@[3354; 3355) " " | 1982 | WHITESPACE@[3354; 3355) " " |
1983 | RANGE_EXPR@[3355; 3512) | 1983 | RANGE_EXPR@[3355; 3512) |
1984 | DOTDOTEQ@[3355; 3358) "..=" | 1984 | DOT2EQ@[3355; 3358) "..=" |
1985 | RANGE_EXPR@[3358; 3512) | 1985 | RANGE_EXPR@[3358; 3512) |
1986 | DOTDOT@[3358; 3360) ".." | 1986 | DOT2@[3358; 3360) ".." |
1987 | WHITESPACE@[3360; 3364) " " | 1987 | WHITESPACE@[3360; 3364) " " |
1988 | RANGE_EXPR@[3364; 3512) | 1988 | RANGE_EXPR@[3364; 3512) |
1989 | DOTDOT@[3364; 3366) ".." | 1989 | DOT2@[3364; 3366) ".." |
1990 | WHITESPACE@[3366; 3367) " " | 1990 | WHITESPACE@[3366; 3367) " " |
1991 | RANGE_EXPR@[3367; 3512) | 1991 | RANGE_EXPR@[3367; 3512) |
1992 | DOTDOTEQ@[3367; 3370) "..=" | 1992 | DOT2EQ@[3367; 3370) "..=" |
1993 | RANGE_EXPR@[3370; 3512) | 1993 | RANGE_EXPR@[3370; 3512) |
1994 | DOTDOT@[3370; 3372) ".." | 1994 | DOT2@[3370; 3372) ".." |
1995 | WHITESPACE@[3372; 3373) " " | 1995 | WHITESPACE@[3372; 3373) " " |
1996 | RANGE_EXPR@[3373; 3512) | 1996 | RANGE_EXPR@[3373; 3512) |
1997 | DOTDOT@[3373; 3375) ".." | 1997 | DOT2@[3373; 3375) ".." |
1998 | WHITESPACE@[3375; 3379) " " | 1998 | WHITESPACE@[3375; 3379) " " |
1999 | RANGE_EXPR@[3379; 3512) | 1999 | RANGE_EXPR@[3379; 3512) |
2000 | DOTDOT@[3379; 3381) ".." | 2000 | DOT2@[3379; 3381) ".." |
2001 | WHITESPACE@[3381; 3382) " " | 2001 | WHITESPACE@[3381; 3382) " " |
2002 | RANGE_EXPR@[3382; 3512) | 2002 | RANGE_EXPR@[3382; 3512) |
2003 | DOTDOTEQ@[3382; 3385) "..=" | 2003 | DOT2EQ@[3382; 3385) "..=" |
2004 | RANGE_EXPR@[3385; 3512) | 2004 | RANGE_EXPR@[3385; 3512) |
2005 | DOTDOT@[3385; 3387) ".." | 2005 | DOT2@[3385; 3387) ".." |
2006 | WHITESPACE@[3387; 3388) " " | 2006 | WHITESPACE@[3387; 3388) " " |
2007 | RANGE_EXPR@[3388; 3512) | 2007 | RANGE_EXPR@[3388; 3512) |
2008 | DOTDOT@[3388; 3390) ".." | 2008 | DOT2@[3388; 3390) ".." |
2009 | WHITESPACE@[3390; 3395) "\n " | 2009 | WHITESPACE@[3390; 3395) "\n " |
2010 | RANGE_EXPR@[3395; 3512) | 2010 | RANGE_EXPR@[3395; 3512) |
2011 | DOTDOTEQ@[3395; 3398) "..=" | 2011 | DOT2EQ@[3395; 3398) "..=" |
2012 | RANGE_EXPR@[3398; 3512) | 2012 | RANGE_EXPR@[3398; 3512) |
2013 | DOTDOT@[3398; 3400) ".." | 2013 | DOT2@[3398; 3400) ".." |
2014 | WHITESPACE@[3400; 3401) " " | 2014 | WHITESPACE@[3400; 3401) " " |
2015 | RANGE_EXPR@[3401; 3512) | 2015 | RANGE_EXPR@[3401; 3512) |
2016 | DOTDOTEQ@[3401; 3404) "..=" | 2016 | DOT2EQ@[3401; 3404) "..=" |
2017 | RANGE_EXPR@[3404; 3512) | 2017 | RANGE_EXPR@[3404; 3512) |
2018 | DOTDOT@[3404; 3406) ".." | 2018 | DOT2@[3404; 3406) ".." |
2019 | WHITESPACE@[3406; 3410) " " | 2019 | WHITESPACE@[3406; 3410) " " |
2020 | RANGE_EXPR@[3410; 3512) | 2020 | RANGE_EXPR@[3410; 3512) |
2021 | DOTDOTEQ@[3410; 3413) "..=" | 2021 | DOT2EQ@[3410; 3413) "..=" |
2022 | RANGE_EXPR@[3413; 3512) | 2022 | RANGE_EXPR@[3413; 3512) |
2023 | DOTDOT@[3413; 3415) ".." | 2023 | DOT2@[3413; 3415) ".." |
2024 | WHITESPACE@[3415; 3416) " " | 2024 | WHITESPACE@[3415; 3416) " " |
2025 | RANGE_EXPR@[3416; 3512) | 2025 | RANGE_EXPR@[3416; 3512) |
2026 | DOTDOTEQ@[3416; 3419) "..=" | 2026 | DOT2EQ@[3416; 3419) "..=" |
2027 | RANGE_EXPR@[3419; 3512) | 2027 | RANGE_EXPR@[3419; 3512) |
2028 | DOTDOT@[3419; 3421) ".." | 2028 | DOT2@[3419; 3421) ".." |
2029 | WHITESPACE@[3421; 3425) " " | 2029 | WHITESPACE@[3421; 3425) " " |
2030 | RANGE_EXPR@[3425; 3512) | 2030 | RANGE_EXPR@[3425; 3512) |
2031 | DOTDOT@[3425; 3427) ".." | 2031 | DOT2@[3425; 3427) ".." |
2032 | WHITESPACE@[3427; 3428) " " | 2032 | WHITESPACE@[3427; 3428) " " |
2033 | RANGE_EXPR@[3428; 3512) | 2033 | RANGE_EXPR@[3428; 3512) |
2034 | DOTDOT@[3428; 3430) ".." | 2034 | DOT2@[3428; 3430) ".." |
2035 | WHITESPACE@[3430; 3431) " " | 2035 | WHITESPACE@[3430; 3431) " " |
2036 | RANGE_EXPR@[3431; 3512) | 2036 | RANGE_EXPR@[3431; 3512) |
2037 | DOTDOTEQ@[3431; 3434) "..=" | 2037 | DOT2EQ@[3431; 3434) "..=" |
2038 | RANGE_EXPR@[3434; 3512) | 2038 | RANGE_EXPR@[3434; 3512) |
2039 | DOTDOT@[3434; 3436) ".." | 2039 | DOT2@[3434; 3436) ".." |
2040 | WHITESPACE@[3436; 3440) " " | 2040 | WHITESPACE@[3436; 3440) " " |
2041 | RANGE_EXPR@[3440; 3512) | 2041 | RANGE_EXPR@[3440; 3512) |
2042 | DOTDOT@[3440; 3442) ".." | 2042 | DOT2@[3440; 3442) ".." |
2043 | WHITESPACE@[3442; 3443) " " | 2043 | WHITESPACE@[3442; 3443) " " |
2044 | RANGE_EXPR@[3443; 3512) | 2044 | RANGE_EXPR@[3443; 3512) |
2045 | DOTDOTEQ@[3443; 3446) "..=" | 2045 | DOT2EQ@[3443; 3446) "..=" |
2046 | RANGE_EXPR@[3446; 3512) | 2046 | RANGE_EXPR@[3446; 3512) |
2047 | DOTDOT@[3446; 3448) ".." | 2047 | DOT2@[3446; 3448) ".." |
2048 | WHITESPACE@[3448; 3449) " " | 2048 | WHITESPACE@[3448; 3449) " " |
2049 | RANGE_EXPR@[3449; 3512) | 2049 | RANGE_EXPR@[3449; 3512) |
2050 | DOTDOT@[3449; 3451) ".." | 2050 | DOT2@[3449; 3451) ".." |
2051 | WHITESPACE@[3451; 3456) "\n " | 2051 | WHITESPACE@[3451; 3456) "\n " |
2052 | RANGE_EXPR@[3456; 3512) | 2052 | RANGE_EXPR@[3456; 3512) |
2053 | DOTDOTEQ@[3456; 3459) "..=" | 2053 | DOT2EQ@[3456; 3459) "..=" |
2054 | RANGE_EXPR@[3459; 3512) | 2054 | RANGE_EXPR@[3459; 3512) |
2055 | DOTDOT@[3459; 3461) ".." | 2055 | DOT2@[3459; 3461) ".." |
2056 | WHITESPACE@[3461; 3462) " " | 2056 | WHITESPACE@[3461; 3462) " " |
2057 | RANGE_EXPR@[3462; 3512) | 2057 | RANGE_EXPR@[3462; 3512) |
2058 | DOTDOTEQ@[3462; 3465) "..=" | 2058 | DOT2EQ@[3462; 3465) "..=" |
2059 | RANGE_EXPR@[3465; 3512) | 2059 | RANGE_EXPR@[3465; 3512) |
2060 | DOTDOT@[3465; 3467) ".." | 2060 | DOT2@[3465; 3467) ".." |
2061 | WHITESPACE@[3467; 3471) " " | 2061 | WHITESPACE@[3467; 3471) " " |
2062 | RANGE_EXPR@[3471; 3512) | 2062 | RANGE_EXPR@[3471; 3512) |
2063 | DOTDOT@[3471; 3473) ".." | 2063 | DOT2@[3471; 3473) ".." |
2064 | WHITESPACE@[3473; 3474) " " | 2064 | WHITESPACE@[3473; 3474) " " |
2065 | RANGE_EXPR@[3474; 3512) | 2065 | RANGE_EXPR@[3474; 3512) |
2066 | DOTDOTEQ@[3474; 3477) "..=" | 2066 | DOT2EQ@[3474; 3477) "..=" |
2067 | RANGE_EXPR@[3477; 3512) | 2067 | RANGE_EXPR@[3477; 3512) |
2068 | DOTDOTEQ@[3477; 3480) "..=" | 2068 | DOT2EQ@[3477; 3480) "..=" |
2069 | RANGE_EXPR@[3480; 3512) | 2069 | RANGE_EXPR@[3480; 3512) |
2070 | DOTDOT@[3480; 3482) ".." | 2070 | DOT2@[3480; 3482) ".." |
2071 | WHITESPACE@[3482; 3486) " " | 2071 | WHITESPACE@[3482; 3486) " " |
2072 | RANGE_EXPR@[3486; 3512) | 2072 | RANGE_EXPR@[3486; 3512) |
2073 | DOTDOTEQ@[3486; 3489) "..=" | 2073 | DOT2EQ@[3486; 3489) "..=" |
2074 | RANGE_EXPR@[3489; 3512) | 2074 | RANGE_EXPR@[3489; 3512) |
2075 | DOTDOTEQ@[3489; 3492) "..=" | 2075 | DOT2EQ@[3489; 3492) "..=" |
2076 | RANGE_EXPR@[3492; 3512) | 2076 | RANGE_EXPR@[3492; 3512) |
2077 | DOTDOT@[3492; 3494) ".." | 2077 | DOT2@[3492; 3494) ".." |
2078 | WHITESPACE@[3494; 3495) " " | 2078 | WHITESPACE@[3494; 3495) " " |
2079 | RANGE_EXPR@[3495; 3512) | 2079 | RANGE_EXPR@[3495; 3512) |
2080 | DOTDOT@[3495; 3497) ".." | 2080 | DOT2@[3495; 3497) ".." |
2081 | WHITESPACE@[3497; 3501) " " | 2081 | WHITESPACE@[3497; 3501) " " |
2082 | RANGE_EXPR@[3501; 3512) | 2082 | RANGE_EXPR@[3501; 3512) |
2083 | DOTDOT@[3501; 3503) ".." | 2083 | DOT2@[3501; 3503) ".." |
2084 | WHITESPACE@[3503; 3504) " " | 2084 | WHITESPACE@[3503; 3504) " " |
2085 | RANGE_EXPR@[3504; 3512) | 2085 | RANGE_EXPR@[3504; 3512) |
2086 | DOTDOTEQ@[3504; 3507) "..=" | 2086 | DOT2EQ@[3504; 3507) "..=" |
2087 | RANGE_EXPR@[3507; 3512) | 2087 | RANGE_EXPR@[3507; 3512) |
2088 | DOTDOT@[3507; 3509) ".." | 2088 | DOT2@[3507; 3509) ".." |
2089 | WHITESPACE@[3509; 3510) " " | 2089 | WHITESPACE@[3509; 3510) " " |
2090 | RANGE_EXPR@[3510; 3512) | 2090 | RANGE_EXPR@[3510; 3512) |
2091 | DOTDOT@[3510; 3512) ".." | 2091 | DOT2@[3510; 3512) ".." |
2092 | WHITESPACE@[3512; 3513) "\n" | 2092 | WHITESPACE@[3512; 3513) "\n" |
2093 | R_CURLY@[3513; 3514) "}" | 2093 | R_CURLY@[3513; 3514) "}" |
2094 | WHITESPACE@[3514; 3516) "\n\n" | 2094 | WHITESPACE@[3514; 3516) "\n\n" |
@@ -2105,22 +2105,22 @@ SOURCE_FILE@[0; 3813) | |||
2105 | BLOCK@[3528; 3552) | 2105 | BLOCK@[3528; 3552) |
2106 | L_CURLY@[3528; 3529) "{" | 2106 | L_CURLY@[3528; 3529) "{" |
2107 | WHITESPACE@[3529; 3534) "\n " | 2107 | WHITESPACE@[3529; 3534) "\n " |
2108 | SEMI@[3534; 3535) ";" | 2108 | SEMICOLON@[3534; 3535) ";" |
2109 | SEMI@[3535; 3536) ";" | 2109 | SEMICOLON@[3535; 3536) ";" |
2110 | SEMI@[3536; 3537) ";" | 2110 | SEMICOLON@[3536; 3537) ";" |
2111 | EXPR_STMT@[3537; 3540) | 2111 | EXPR_STMT@[3537; 3540) |
2112 | TUPLE_EXPR@[3537; 3539) | 2112 | TUPLE_EXPR@[3537; 3539) |
2113 | L_PAREN@[3537; 3538) "(" | 2113 | L_PAREN@[3537; 3538) "(" |
2114 | R_PAREN@[3538; 3539) ")" | 2114 | R_PAREN@[3538; 3539) ")" |
2115 | SEMI@[3539; 3540) ";" | 2115 | SEMICOLON@[3539; 3540) ";" |
2116 | SEMI@[3540; 3541) ";" | 2116 | SEMICOLON@[3540; 3541) ";" |
2117 | SEMI@[3541; 3542) ";" | 2117 | SEMICOLON@[3541; 3542) ";" |
2118 | SEMI@[3542; 3543) ";" | 2118 | SEMICOLON@[3542; 3543) ";" |
2119 | SEMI@[3543; 3544) ";" | 2119 | SEMICOLON@[3543; 3544) ";" |
2120 | SEMI@[3544; 3545) ";" | 2120 | SEMICOLON@[3544; 3545) ";" |
2121 | SEMI@[3545; 3546) ";" | 2121 | SEMICOLON@[3545; 3546) ";" |
2122 | SEMI@[3546; 3547) ";" | 2122 | SEMICOLON@[3546; 3547) ";" |
2123 | SEMI@[3547; 3548) ";" | 2123 | SEMICOLON@[3547; 3548) ";" |
2124 | TUPLE_EXPR@[3548; 3550) | 2124 | TUPLE_EXPR@[3548; 3550) |
2125 | L_PAREN@[3548; 3549) "(" | 2125 | L_PAREN@[3548; 3549) "(" |
2126 | R_PAREN@[3549; 3550) ")" | 2126 | R_PAREN@[3549; 3550) ")" |
@@ -2153,7 +2153,7 @@ SOURCE_FILE@[0; 3813) | |||
2153 | ARG_LIST@[3581; 3583) | 2153 | ARG_LIST@[3581; 3583) |
2154 | L_PAREN@[3581; 3582) "(" | 2154 | L_PAREN@[3581; 3582) "(" |
2155 | R_PAREN@[3582; 3583) ")" | 2155 | R_PAREN@[3582; 3583) ")" |
2156 | SEMI@[3583; 3584) ";" | 2156 | SEMICOLON@[3583; 3584) ";" |
2157 | WHITESPACE@[3584; 3589) "\n " | 2157 | WHITESPACE@[3584; 3589) "\n " |
2158 | EXPR_STMT@[3589; 3597) | 2158 | EXPR_STMT@[3589; 3597) |
2159 | CALL_EXPR@[3589; 3596) | 2159 | CALL_EXPR@[3589; 3596) |
@@ -2165,7 +2165,7 @@ SOURCE_FILE@[0; 3813) | |||
2165 | ARG_LIST@[3594; 3596) | 2165 | ARG_LIST@[3594; 3596) |
2166 | L_PAREN@[3594; 3595) "(" | 2166 | L_PAREN@[3594; 3595) "(" |
2167 | R_PAREN@[3595; 3596) ")" | 2167 | R_PAREN@[3595; 3596) ")" |
2168 | SEMI@[3596; 3597) ";" | 2168 | SEMICOLON@[3596; 3597) ";" |
2169 | WHITESPACE@[3597; 3602) "\n " | 2169 | WHITESPACE@[3597; 3602) "\n " |
2170 | EXPR_STMT@[3602; 3609) | 2170 | EXPR_STMT@[3602; 3609) |
2171 | CALL_EXPR@[3602; 3608) | 2171 | CALL_EXPR@[3602; 3608) |
@@ -2177,7 +2177,7 @@ SOURCE_FILE@[0; 3813) | |||
2177 | ARG_LIST@[3606; 3608) | 2177 | ARG_LIST@[3606; 3608) |
2178 | L_PAREN@[3606; 3607) "(" | 2178 | L_PAREN@[3606; 3607) "(" |
2179 | R_PAREN@[3607; 3608) ")" | 2179 | R_PAREN@[3607; 3608) ")" |
2180 | SEMI@[3608; 3609) ";" | 2180 | SEMICOLON@[3608; 3609) ";" |
2181 | WHITESPACE@[3609; 3614) "\n " | 2181 | WHITESPACE@[3609; 3614) "\n " |
2182 | EXPR_STMT@[3614; 3628) | 2182 | EXPR_STMT@[3614; 3628) |
2183 | CALL_EXPR@[3614; 3627) | 2183 | CALL_EXPR@[3614; 3627) |
@@ -2189,7 +2189,7 @@ SOURCE_FILE@[0; 3813) | |||
2189 | ARG_LIST@[3625; 3627) | 2189 | ARG_LIST@[3625; 3627) |
2190 | L_PAREN@[3625; 3626) "(" | 2190 | L_PAREN@[3625; 3626) "(" |
2191 | R_PAREN@[3626; 3627) ")" | 2191 | R_PAREN@[3626; 3627) ")" |
2192 | SEMI@[3627; 3628) ";" | 2192 | SEMICOLON@[3627; 3628) ";" |
2193 | WHITESPACE@[3628; 3633) "\n " | 2193 | WHITESPACE@[3628; 3633) "\n " |
2194 | EXPR_STMT@[3633; 3643) | 2194 | EXPR_STMT@[3633; 3643) |
2195 | CALL_EXPR@[3633; 3642) | 2195 | CALL_EXPR@[3633; 3642) |
@@ -2201,7 +2201,7 @@ SOURCE_FILE@[0; 3813) | |||
2201 | ARG_LIST@[3640; 3642) | 2201 | ARG_LIST@[3640; 3642) |
2202 | L_PAREN@[3640; 3641) "(" | 2202 | L_PAREN@[3640; 3641) "(" |
2203 | R_PAREN@[3641; 3642) ")" | 2203 | R_PAREN@[3641; 3642) ")" |
2204 | SEMI@[3642; 3643) ";" | 2204 | SEMICOLON@[3642; 3643) ";" |
2205 | WHITESPACE@[3643; 3648) "\n " | 2205 | WHITESPACE@[3643; 3648) "\n " |
2206 | EXPR_STMT@[3648; 3664) | 2206 | EXPR_STMT@[3648; 3664) |
2207 | CALL_EXPR@[3648; 3663) | 2207 | CALL_EXPR@[3648; 3663) |
@@ -2213,7 +2213,7 @@ SOURCE_FILE@[0; 3813) | |||
2213 | ARG_LIST@[3661; 3663) | 2213 | ARG_LIST@[3661; 3663) |
2214 | L_PAREN@[3661; 3662) "(" | 2214 | L_PAREN@[3661; 3662) "(" |
2215 | R_PAREN@[3662; 3663) ")" | 2215 | R_PAREN@[3662; 3663) ")" |
2216 | SEMI@[3663; 3664) ";" | 2216 | SEMICOLON@[3663; 3664) ";" |
2217 | WHITESPACE@[3664; 3669) "\n " | 2217 | WHITESPACE@[3664; 3669) "\n " |
2218 | EXPR_STMT@[3669; 3681) | 2218 | EXPR_STMT@[3669; 3681) |
2219 | CALL_EXPR@[3669; 3680) | 2219 | CALL_EXPR@[3669; 3680) |
@@ -2225,7 +2225,7 @@ SOURCE_FILE@[0; 3813) | |||
2225 | ARG_LIST@[3678; 3680) | 2225 | ARG_LIST@[3678; 3680) |
2226 | L_PAREN@[3678; 3679) "(" | 2226 | L_PAREN@[3678; 3679) "(" |
2227 | R_PAREN@[3679; 3680) ")" | 2227 | R_PAREN@[3679; 3680) ")" |
2228 | SEMI@[3680; 3681) ";" | 2228 | SEMICOLON@[3680; 3681) ";" |
2229 | WHITESPACE@[3681; 3686) "\n " | 2229 | WHITESPACE@[3681; 3686) "\n " |
2230 | EXPR_STMT@[3686; 3701) | 2230 | EXPR_STMT@[3686; 3701) |
2231 | CALL_EXPR@[3686; 3700) | 2231 | CALL_EXPR@[3686; 3700) |
@@ -2237,7 +2237,7 @@ SOURCE_FILE@[0; 3813) | |||
2237 | ARG_LIST@[3698; 3700) | 2237 | ARG_LIST@[3698; 3700) |
2238 | L_PAREN@[3698; 3699) "(" | 2238 | L_PAREN@[3698; 3699) "(" |
2239 | R_PAREN@[3699; 3700) ")" | 2239 | R_PAREN@[3699; 3700) ")" |
2240 | SEMI@[3700; 3701) ";" | 2240 | SEMICOLON@[3700; 3701) ";" |
2241 | WHITESPACE@[3701; 3706) "\n " | 2241 | WHITESPACE@[3701; 3706) "\n " |
2242 | EXPR_STMT@[3706; 3713) | 2242 | EXPR_STMT@[3706; 3713) |
2243 | CALL_EXPR@[3706; 3712) | 2243 | CALL_EXPR@[3706; 3712) |
@@ -2249,7 +2249,7 @@ SOURCE_FILE@[0; 3813) | |||
2249 | ARG_LIST@[3710; 3712) | 2249 | ARG_LIST@[3710; 3712) |
2250 | L_PAREN@[3710; 3711) "(" | 2250 | L_PAREN@[3710; 3711) "(" |
2251 | R_PAREN@[3711; 3712) ")" | 2251 | R_PAREN@[3711; 3712) ")" |
2252 | SEMI@[3712; 3713) ";" | 2252 | SEMICOLON@[3712; 3713) ";" |
2253 | WHITESPACE@[3713; 3718) "\n " | 2253 | WHITESPACE@[3713; 3718) "\n " |
2254 | EXPR_STMT@[3718; 3726) | 2254 | EXPR_STMT@[3718; 3726) |
2255 | CALL_EXPR@[3718; 3725) | 2255 | CALL_EXPR@[3718; 3725) |
@@ -2263,7 +2263,7 @@ SOURCE_FILE@[0; 3813) | |||
2263 | LITERAL@[3721; 3724) | 2263 | LITERAL@[3721; 3724) |
2264 | INT_NUMBER@[3721; 3724) "8u8" | 2264 | INT_NUMBER@[3721; 3724) "8u8" |
2265 | R_PAREN@[3724; 3725) ")" | 2265 | R_PAREN@[3724; 3725) ")" |
2266 | SEMI@[3725; 3726) ";" | 2266 | SEMICOLON@[3725; 3726) ";" |
2267 | WHITESPACE@[3726; 3731) "\n " | 2267 | WHITESPACE@[3726; 3731) "\n " |
2268 | EXPR_STMT@[3731; 3739) | 2268 | EXPR_STMT@[3731; 3739) |
2269 | CALL_EXPR@[3731; 3738) | 2269 | CALL_EXPR@[3731; 3738) |
@@ -2275,7 +2275,7 @@ SOURCE_FILE@[0; 3813) | |||
2275 | ARG_LIST@[3736; 3738) | 2275 | ARG_LIST@[3736; 3738) |
2276 | L_PAREN@[3736; 3737) "(" | 2276 | L_PAREN@[3736; 3737) "(" |
2277 | R_PAREN@[3737; 3738) ")" | 2277 | R_PAREN@[3737; 3738) ")" |
2278 | SEMI@[3738; 3739) ";" | 2278 | SEMICOLON@[3738; 3739) ";" |
2279 | WHITESPACE@[3739; 3744) "\n " | 2279 | WHITESPACE@[3739; 3744) "\n " |
2280 | EXPR_STMT@[3744; 3752) | 2280 | EXPR_STMT@[3744; 3752) |
2281 | CALL_EXPR@[3744; 3751) | 2281 | CALL_EXPR@[3744; 3751) |
@@ -2287,7 +2287,7 @@ SOURCE_FILE@[0; 3813) | |||
2287 | ARG_LIST@[3749; 3751) | 2287 | ARG_LIST@[3749; 3751) |
2288 | L_PAREN@[3749; 3750) "(" | 2288 | L_PAREN@[3749; 3750) "(" |
2289 | R_PAREN@[3750; 3751) ")" | 2289 | R_PAREN@[3750; 3751) ")" |
2290 | SEMI@[3751; 3752) ";" | 2290 | SEMICOLON@[3751; 3752) ";" |
2291 | WHITESPACE@[3752; 3757) "\n " | 2291 | WHITESPACE@[3752; 3757) "\n " |
2292 | EXPR_STMT@[3757; 3778) | 2292 | EXPR_STMT@[3757; 3778) |
2293 | CALL_EXPR@[3757; 3777) | 2293 | CALL_EXPR@[3757; 3777) |
@@ -2299,7 +2299,7 @@ SOURCE_FILE@[0; 3813) | |||
2299 | ARG_LIST@[3775; 3777) | 2299 | ARG_LIST@[3775; 3777) |
2300 | L_PAREN@[3775; 3776) "(" | 2300 | L_PAREN@[3775; 3776) "(" |
2301 | R_PAREN@[3776; 3777) ")" | 2301 | R_PAREN@[3776; 3777) ")" |
2302 | SEMI@[3777; 3778) ";" | 2302 | SEMICOLON@[3777; 3778) ";" |
2303 | WHITESPACE@[3778; 3783) "\n " | 2303 | WHITESPACE@[3778; 3783) "\n " |
2304 | EXPR_STMT@[3783; 3796) | 2304 | EXPR_STMT@[3783; 3796) |
2305 | CALL_EXPR@[3783; 3795) | 2305 | CALL_EXPR@[3783; 3795) |
@@ -2311,7 +2311,7 @@ SOURCE_FILE@[0; 3813) | |||
2311 | ARG_LIST@[3793; 3795) | 2311 | ARG_LIST@[3793; 3795) |
2312 | L_PAREN@[3793; 3794) "(" | 2312 | L_PAREN@[3793; 3794) "(" |
2313 | R_PAREN@[3794; 3795) ")" | 2313 | R_PAREN@[3794; 3795) ")" |
2314 | SEMI@[3795; 3796) ";" | 2314 | SEMICOLON@[3795; 3796) ";" |
2315 | WHITESPACE@[3796; 3801) "\n " | 2315 | WHITESPACE@[3796; 3801) "\n " |
2316 | EXPR_STMT@[3801; 3810) | 2316 | EXPR_STMT@[3801; 3810) |
2317 | CALL_EXPR@[3801; 3809) | 2317 | CALL_EXPR@[3801; 3809) |
@@ -2323,7 +2323,7 @@ SOURCE_FILE@[0; 3813) | |||
2323 | ARG_LIST@[3807; 3809) | 2323 | ARG_LIST@[3807; 3809) |
2324 | L_PAREN@[3807; 3808) "(" | 2324 | L_PAREN@[3807; 3808) "(" |
2325 | R_PAREN@[3808; 3809) ")" | 2325 | R_PAREN@[3808; 3809) ")" |
2326 | SEMI@[3809; 3810) ";" | 2326 | SEMICOLON@[3809; 3810) ";" |
2327 | WHITESPACE@[3810; 3811) "\n" | 2327 | WHITESPACE@[3810; 3811) "\n" |
2328 | R_CURLY@[3811; 3812) "}" | 2328 | R_CURLY@[3811; 3812) "}" |
2329 | WHITESPACE@[3812; 3813) "\n" | 2329 | WHITESPACE@[3812; 3813) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast b/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast index ac5444087..4df6703f4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast +++ b/crates/ra_syntax/test_data/parser/ok/0036_fully_qualified.rast | |||
@@ -60,7 +60,7 @@ SOURCE_FILE@[0; 157) | |||
60 | NAME_REF@[114; 122) | 60 | NAME_REF@[114; 122) |
61 | IDENT@[114; 122) "Iterator" | 61 | IDENT@[114; 122) "Iterator" |
62 | R_ANGLE@[122; 123) ">" | 62 | R_ANGLE@[122; 123) ">" |
63 | COLONCOLON@[123; 125) "::" | 63 | COLON2@[123; 125) "::" |
64 | PATH_SEGMENT@[125; 129) | 64 | PATH_SEGMENT@[125; 129) |
65 | NAME_REF@[125; 129) | 65 | NAME_REF@[125; 129) |
66 | IDENT@[125; 129) "Item" | 66 | IDENT@[125; 129) "Item" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast b/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast index 64c70e196..825518eda 100644 --- a/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast +++ b/crates/ra_syntax/test_data/parser/ok/0041_raw_keywords.rast | |||
@@ -23,7 +23,7 @@ SOURCE_FILE@[0; 59) | |||
23 | WHITESPACE@[25; 26) " " | 23 | WHITESPACE@[25; 26) " " |
24 | LITERAL@[26; 28) | 24 | LITERAL@[26; 28) |
25 | INT_NUMBER@[26; 28) "92" | 25 | INT_NUMBER@[26; 28) "92" |
26 | SEMI@[28; 29) ";" | 26 | SEMICOLON@[28; 29) ";" |
27 | WHITESPACE@[29; 30) " " | 27 | WHITESPACE@[29; 30) " " |
28 | LET_STMT@[30; 57) | 28 | LET_STMT@[30; 57) |
29 | LET_KW@[30; 33) "let" | 29 | LET_KW@[30; 33) "let" |
@@ -45,6 +45,6 @@ SOURCE_FILE@[0; 59) | |||
45 | WHITESPACE@[54; 55) " " | 45 | WHITESPACE@[54; 55) " " |
46 | LITERAL@[55; 56) | 46 | LITERAL@[55; 56) |
47 | INT_NUMBER@[55; 56) "2" | 47 | INT_NUMBER@[55; 56) "2" |
48 | SEMI@[56; 57) ";" | 48 | SEMICOLON@[56; 57) ";" |
49 | WHITESPACE@[57; 58) " " | 49 | WHITESPACE@[57; 58) " " |
50 | R_CURLY@[58; 59) "}" | 50 | R_CURLY@[58; 59) "}" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast index 341e02704..420a62639 100644 --- a/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast +++ b/crates/ra_syntax/test_data/parser/ok/0042_ufcs_call_list.rast | |||
@@ -6,7 +6,7 @@ SOURCE_FILE@[0; 199) | |||
6 | WHITESPACE@[68; 69) " " | 6 | WHITESPACE@[68; 69) " " |
7 | NAME@[69; 72) | 7 | NAME@[69; 72) |
8 | IDENT@[69; 72) "Foo" | 8 | IDENT@[69; 72) "Foo" |
9 | SEMI@[72; 73) ";" | 9 | SEMICOLON@[72; 73) ";" |
10 | WHITESPACE@[73; 75) "\n\n" | 10 | WHITESPACE@[73; 75) "\n\n" |
11 | IMPL_DEF@[75; 141) | 11 | IMPL_DEF@[75; 141) |
12 | IMPL_KW@[75; 79) "impl" | 12 | IMPL_KW@[75; 79) "impl" |
@@ -47,7 +47,7 @@ SOURCE_FILE@[0; 199) | |||
47 | PATH_SEGMENT@[117; 130) | 47 | PATH_SEGMENT@[117; 130) |
48 | NAME_REF@[117; 130) | 48 | NAME_REF@[117; 130) |
49 | IDENT@[117; 130) "unimplemented" | 49 | IDENT@[117; 130) "unimplemented" |
50 | EXCL@[130; 131) "!" | 50 | BANG@[130; 131) "!" |
51 | TOKEN_TREE@[131; 133) | 51 | TOKEN_TREE@[131; 133) |
52 | L_PAREN@[131; 132) "(" | 52 | L_PAREN@[131; 132) "(" |
53 | R_PAREN@[132; 133) ")" | 53 | R_PAREN@[132; 133) ")" |
@@ -113,7 +113,7 @@ SOURCE_FILE@[0; 199) | |||
113 | NAME_REF@[184; 187) | 113 | NAME_REF@[184; 187) |
114 | IDENT@[184; 187) "Foo" | 114 | IDENT@[184; 187) "Foo" |
115 | R_ANGLE@[187; 188) ">" | 115 | R_ANGLE@[187; 188) ">" |
116 | COLONCOLON@[188; 190) "::" | 116 | COLON2@[188; 190) "::" |
117 | PATH_SEGMENT@[190; 193) | 117 | PATH_SEGMENT@[190; 193) |
118 | NAME_REF@[190; 193) | 118 | NAME_REF@[190; 193) |
119 | IDENT@[190; 193) "bar" | 119 | IDENT@[190; 193) "bar" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast index c5821afd0..3bc0ddbde 100644 --- a/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast +++ b/crates/ra_syntax/test_data/parser/ok/0043_complex_assignment.rast | |||
@@ -22,7 +22,7 @@ SOURCE_FILE@[0; 160) | |||
22 | PATH_SEGMENT@[82; 84) | 22 | PATH_SEGMENT@[82; 84) |
23 | NAME_REF@[82; 84) | 23 | NAME_REF@[82; 84) |
24 | IDENT@[82; 84) "u8" | 24 | IDENT@[82; 84) "u8" |
25 | SEMI@[84; 85) ";" | 25 | SEMICOLON@[84; 85) ";" |
26 | WHITESPACE@[85; 86) " " | 26 | WHITESPACE@[85; 86) " " |
27 | LITERAL@[86; 87) | 27 | LITERAL@[86; 87) |
28 | INT_NUMBER@[86; 87) "1" | 28 | INT_NUMBER@[86; 87) "1" |
@@ -80,7 +80,7 @@ SOURCE_FILE@[0; 160) | |||
80 | WHITESPACE@[133; 134) " " | 80 | WHITESPACE@[133; 134) " " |
81 | LITERAL@[134; 135) | 81 | LITERAL@[134; 135) |
82 | INT_NUMBER@[134; 135) "0" | 82 | INT_NUMBER@[134; 135) "0" |
83 | SEMI@[135; 136) ";" | 83 | SEMICOLON@[135; 136) ";" |
84 | WHITESPACE@[136; 141) "\n " | 84 | WHITESPACE@[136; 141) "\n " |
85 | EXPR_STMT@[141; 157) | 85 | EXPR_STMT@[141; 157) |
86 | CALL_EXPR@[141; 156) | 86 | CALL_EXPR@[141; 156) |
@@ -104,7 +104,7 @@ SOURCE_FILE@[0; 160) | |||
104 | ARG_LIST@[154; 156) | 104 | ARG_LIST@[154; 156) |
105 | L_PAREN@[154; 155) "(" | 105 | L_PAREN@[154; 155) "(" |
106 | R_PAREN@[155; 156) ")" | 106 | R_PAREN@[155; 156) ")" |
107 | SEMI@[156; 157) ";" | 107 | SEMICOLON@[156; 157) ";" |
108 | WHITESPACE@[157; 158) "\n" | 108 | WHITESPACE@[157; 158) "\n" |
109 | R_CURLY@[158; 159) "}" | 109 | R_CURLY@[158; 159) "}" |
110 | WHITESPACE@[159; 160) "\n" | 110 | WHITESPACE@[159; 160) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast index bfc793dc1..4b2593147 100644 --- a/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0044_let_attrs.rast | |||
@@ -47,7 +47,7 @@ SOURCE_FILE@[0; 166) | |||
47 | PATH_SEGMENT@[127; 132) | 47 | PATH_SEGMENT@[127; 132) |
48 | NAME_REF@[127; 132) | 48 | NAME_REF@[127; 132) |
49 | IDENT@[127; 132) "panic" | 49 | IDENT@[127; 132) "panic" |
50 | COLONCOLON@[132; 134) "::" | 50 | COLON2@[132; 134) "::" |
51 | PATH_SEGMENT@[134; 146) | 51 | PATH_SEGMENT@[134; 146) |
52 | NAME_REF@[134; 146) | 52 | NAME_REF@[134; 146) |
53 | IDENT@[134; 146) "catch_unwind" | 53 | IDENT@[134; 146) "catch_unwind" |
@@ -70,7 +70,7 @@ SOURCE_FILE@[0; 166) | |||
70 | L_PAREN@[159; 160) "(" | 70 | L_PAREN@[159; 160) "(" |
71 | R_PAREN@[160; 161) ")" | 71 | R_PAREN@[160; 161) ")" |
72 | R_PAREN@[161; 162) ")" | 72 | R_PAREN@[161; 162) ")" |
73 | SEMI@[162; 163) ";" | 73 | SEMICOLON@[162; 163) ";" |
74 | WHITESPACE@[163; 164) "\n" | 74 | WHITESPACE@[163; 164) "\n" |
75 | R_CURLY@[164; 165) "}" | 75 | R_CURLY@[164; 165) "}" |
76 | WHITESPACE@[165; 166) "\n" | 76 | WHITESPACE@[165; 166) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast index e15447ca7..954b3bc2a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0045_block_inner_attrs.rast | |||
@@ -14,7 +14,7 @@ SOURCE_FILE@[0; 686) | |||
14 | WHITESPACE@[12; 17) "\n " | 14 | WHITESPACE@[12; 17) "\n " |
15 | ATTR@[17; 57) | 15 | ATTR@[17; 57) |
16 | POUND@[17; 18) "#" | 16 | POUND@[17; 18) "#" |
17 | EXCL@[18; 19) "!" | 17 | BANG@[18; 19) "!" |
18 | L_BRACK@[19; 20) "[" | 18 | L_BRACK@[19; 20) "[" |
19 | PATH@[20; 23) | 19 | PATH@[20; 23) |
20 | PATH_SEGMENT@[20; 23) | 20 | PATH_SEGMENT@[20; 23) |
@@ -35,7 +35,7 @@ SOURCE_FILE@[0; 686) | |||
35 | WHITESPACE@[103; 112) "\n " | 35 | WHITESPACE@[103; 112) "\n " |
36 | ATTR@[112; 180) | 36 | ATTR@[112; 180) |
37 | POUND@[112; 113) "#" | 37 | POUND@[112; 113) "#" |
38 | EXCL@[113; 114) "!" | 38 | BANG@[113; 114) "!" |
39 | L_BRACK@[114; 115) "[" | 39 | L_BRACK@[114; 115) "[" |
40 | PATH@[115; 118) | 40 | PATH@[115; 118) |
41 | PATH_SEGMENT@[115; 118) | 41 | PATH_SEGMENT@[115; 118) |
@@ -49,7 +49,7 @@ SOURCE_FILE@[0; 686) | |||
49 | WHITESPACE@[180; 189) "\n " | 49 | WHITESPACE@[180; 189) "\n " |
50 | ATTR@[189; 244) | 50 | ATTR@[189; 244) |
51 | POUND@[189; 190) "#" | 51 | POUND@[189; 190) "#" |
52 | EXCL@[190; 191) "!" | 52 | BANG@[190; 191) "!" |
53 | L_BRACK@[191; 192) "[" | 53 | L_BRACK@[191; 192) "[" |
54 | PATH@[192; 195) | 54 | PATH@[192; 195) |
55 | PATH_SEGMENT@[192; 195) | 55 | PATH_SEGMENT@[192; 195) |
@@ -64,7 +64,7 @@ SOURCE_FILE@[0; 686) | |||
64 | COMMENT@[253; 288) "//! As are ModuleDoc ..." | 64 | COMMENT@[253; 288) "//! As are ModuleDoc ..." |
65 | WHITESPACE@[288; 293) "\n " | 65 | WHITESPACE@[288; 293) "\n " |
66 | R_CURLY@[293; 294) "}" | 66 | R_CURLY@[293; 294) "}" |
67 | SEMI@[294; 295) ";" | 67 | SEMICOLON@[294; 295) ";" |
68 | WHITESPACE@[295; 300) "\n " | 68 | WHITESPACE@[295; 300) "\n " |
69 | BLOCK_EXPR@[300; 459) | 69 | BLOCK_EXPR@[300; 459) |
70 | BLOCK@[300; 459) | 70 | BLOCK@[300; 459) |
@@ -72,7 +72,7 @@ SOURCE_FILE@[0; 686) | |||
72 | WHITESPACE@[301; 310) "\n " | 72 | WHITESPACE@[301; 310) "\n " |
73 | ATTR@[310; 409) | 73 | ATTR@[310; 409) |
74 | POUND@[310; 311) "#" | 74 | POUND@[310; 311) "#" |
75 | EXCL@[311; 312) "!" | 75 | BANG@[311; 312) "!" |
76 | L_BRACK@[312; 313) "[" | 76 | L_BRACK@[312; 313) "[" |
77 | PATH@[313; 316) | 77 | PATH@[313; 316) |
78 | PATH_SEGMENT@[313; 316) | 78 | PATH_SEGMENT@[313; 316) |
@@ -161,7 +161,7 @@ SOURCE_FILE@[0; 686) | |||
161 | WHITESPACE@[603; 612) "\n " | 161 | WHITESPACE@[603; 612) "\n " |
162 | ATTR@[612; 639) | 162 | ATTR@[612; 639) |
163 | POUND@[612; 613) "#" | 163 | POUND@[612; 613) "#" |
164 | EXCL@[613; 614) "!" | 164 | BANG@[613; 614) "!" |
165 | L_BRACK@[614; 615) "[" | 165 | L_BRACK@[614; 615) "[" |
166 | PATH@[615; 620) | 166 | PATH@[615; 620) |
167 | PATH_SEGMENT@[615; 620) | 167 | PATH_SEGMENT@[615; 620) |
diff --git a/crates/ra_syntax/test_data/parser/ok/0046_extern_inner_attributes.rast b/crates/ra_syntax/test_data/parser/ok/0046_extern_inner_attributes.rast index 8f192124b..92c8df2d6 100644 --- a/crates/ra_syntax/test_data/parser/ok/0046_extern_inner_attributes.rast +++ b/crates/ra_syntax/test_data/parser/ok/0046_extern_inner_attributes.rast | |||
@@ -12,7 +12,7 @@ SOURCE_FILE@[0; 87) | |||
12 | WHITESPACE@[42; 47) "\n " | 12 | WHITESPACE@[42; 47) "\n " |
13 | ATTR@[47; 84) | 13 | ATTR@[47; 84) |
14 | POUND@[47; 48) "#" | 14 | POUND@[47; 48) "#" |
15 | EXCL@[48; 49) "!" | 15 | BANG@[48; 49) "!" |
16 | L_BRACK@[49; 50) "[" | 16 | L_BRACK@[49; 50) "[" |
17 | PATH@[50; 53) | 17 | PATH@[50; 53) |
18 | PATH_SEGMENT@[50; 53) | 18 | PATH_SEGMENT@[50; 53) |
diff --git a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast index 07a5fbf2d..de703328a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast +++ b/crates/ra_syntax/test_data/parser/ok/0047_minus_in_inner_pattern.rast | |||
@@ -151,7 +151,7 @@ SOURCE_FILE@[0; 395) | |||
151 | PATH_SEGMENT@[234; 235) | 151 | PATH_SEGMENT@[234; 235) |
152 | NAME_REF@[234; 235) | 152 | NAME_REF@[234; 235) |
153 | IDENT@[234; 235) "A" | 153 | IDENT@[234; 235) "A" |
154 | COLONCOLON@[235; 237) "::" | 154 | COLON2@[235; 237) "::" |
155 | PATH_SEGMENT@[237; 238) | 155 | PATH_SEGMENT@[237; 238) |
156 | NAME_REF@[237; 238) | 156 | NAME_REF@[237; 238) |
157 | IDENT@[237; 238) "B" | 157 | IDENT@[237; 238) "B" |
@@ -179,7 +179,7 @@ SOURCE_FILE@[0; 395) | |||
179 | PATH_SEGMENT@[257; 258) | 179 | PATH_SEGMENT@[257; 258) |
180 | NAME_REF@[257; 258) | 180 | NAME_REF@[257; 258) |
181 | IDENT@[257; 258) "A" | 181 | IDENT@[257; 258) "A" |
182 | COLONCOLON@[258; 260) "::" | 182 | COLON2@[258; 260) "::" |
183 | PATH_SEGMENT@[260; 261) | 183 | PATH_SEGMENT@[260; 261) |
184 | NAME_REF@[260; 261) | 184 | NAME_REF@[260; 261) |
185 | IDENT@[260; 261) "B" | 185 | IDENT@[260; 261) "B" |
@@ -303,7 +303,7 @@ SOURCE_FILE@[0; 395) | |||
303 | MINUS@[376; 377) "-" | 303 | MINUS@[376; 377) "-" |
304 | LITERAL@[377; 380) | 304 | LITERAL@[377; 380) |
305 | INT_NUMBER@[377; 380) "128" | 305 | INT_NUMBER@[377; 380) "128" |
306 | DOTDOTEQ@[380; 383) "..=" | 306 | DOT2EQ@[380; 383) "..=" |
307 | LITERAL_PAT@[383; 386) | 307 | LITERAL_PAT@[383; 386) |
308 | LITERAL@[383; 386) | 308 | LITERAL@[383; 386) |
309 | INT_NUMBER@[383; 386) "127" | 309 | INT_NUMBER@[383; 386) "127" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast b/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast index c9cf84ffd..849d8a445 100644 --- a/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast +++ b/crates/ra_syntax/test_data/parser/ok/0048_compound_assignment.rast | |||
@@ -27,7 +27,7 @@ SOURCE_FILE@[0; 257) | |||
27 | WHITESPACE@[102; 103) " " | 27 | WHITESPACE@[102; 103) " " |
28 | LITERAL@[103; 104) | 28 | LITERAL@[103; 104) |
29 | INT_NUMBER@[103; 104) "0" | 29 | INT_NUMBER@[103; 104) "0" |
30 | SEMI@[104; 105) ";" | 30 | SEMICOLON@[104; 105) ";" |
31 | WHITESPACE@[105; 110) "\n " | 31 | WHITESPACE@[105; 110) "\n " |
32 | EXPR_STMT@[110; 117) | 32 | EXPR_STMT@[110; 117) |
33 | BIN_EXPR@[110; 116) | 33 | BIN_EXPR@[110; 116) |
@@ -41,7 +41,7 @@ SOURCE_FILE@[0; 257) | |||
41 | WHITESPACE@[114; 115) " " | 41 | WHITESPACE@[114; 115) " " |
42 | LITERAL@[115; 116) | 42 | LITERAL@[115; 116) |
43 | INT_NUMBER@[115; 116) "1" | 43 | INT_NUMBER@[115; 116) "1" |
44 | SEMI@[116; 117) ";" | 44 | SEMICOLON@[116; 117) ";" |
45 | WHITESPACE@[117; 122) "\n " | 45 | WHITESPACE@[117; 122) "\n " |
46 | EXPR_STMT@[122; 129) | 46 | EXPR_STMT@[122; 129) |
47 | BIN_EXPR@[122; 128) | 47 | BIN_EXPR@[122; 128) |
@@ -55,7 +55,7 @@ SOURCE_FILE@[0; 257) | |||
55 | WHITESPACE@[126; 127) " " | 55 | WHITESPACE@[126; 127) " " |
56 | LITERAL@[127; 128) | 56 | LITERAL@[127; 128) |
57 | INT_NUMBER@[127; 128) "2" | 57 | INT_NUMBER@[127; 128) "2" |
58 | SEMI@[128; 129) ";" | 58 | SEMICOLON@[128; 129) ";" |
59 | WHITESPACE@[129; 134) "\n " | 59 | WHITESPACE@[129; 134) "\n " |
60 | EXPR_STMT@[134; 141) | 60 | EXPR_STMT@[134; 141) |
61 | BIN_EXPR@[134; 140) | 61 | BIN_EXPR@[134; 140) |
@@ -69,7 +69,7 @@ SOURCE_FILE@[0; 257) | |||
69 | WHITESPACE@[138; 139) " " | 69 | WHITESPACE@[138; 139) " " |
70 | LITERAL@[139; 140) | 70 | LITERAL@[139; 140) |
71 | INT_NUMBER@[139; 140) "3" | 71 | INT_NUMBER@[139; 140) "3" |
72 | SEMI@[140; 141) ";" | 72 | SEMICOLON@[140; 141) ";" |
73 | WHITESPACE@[141; 146) "\n " | 73 | WHITESPACE@[141; 146) "\n " |
74 | EXPR_STMT@[146; 153) | 74 | EXPR_STMT@[146; 153) |
75 | BIN_EXPR@[146; 152) | 75 | BIN_EXPR@[146; 152) |
@@ -83,7 +83,7 @@ SOURCE_FILE@[0; 257) | |||
83 | WHITESPACE@[150; 151) " " | 83 | WHITESPACE@[150; 151) " " |
84 | LITERAL@[151; 152) | 84 | LITERAL@[151; 152) |
85 | INT_NUMBER@[151; 152) "4" | 85 | INT_NUMBER@[151; 152) "4" |
86 | SEMI@[152; 153) ";" | 86 | SEMICOLON@[152; 153) ";" |
87 | WHITESPACE@[153; 158) "\n " | 87 | WHITESPACE@[153; 158) "\n " |
88 | EXPR_STMT@[158; 165) | 88 | EXPR_STMT@[158; 165) |
89 | BIN_EXPR@[158; 164) | 89 | BIN_EXPR@[158; 164) |
@@ -97,7 +97,7 @@ SOURCE_FILE@[0; 257) | |||
97 | WHITESPACE@[162; 163) " " | 97 | WHITESPACE@[162; 163) " " |
98 | LITERAL@[163; 164) | 98 | LITERAL@[163; 164) |
99 | INT_NUMBER@[163; 164) "5" | 99 | INT_NUMBER@[163; 164) "5" |
100 | SEMI@[164; 165) ";" | 100 | SEMICOLON@[164; 165) ";" |
101 | WHITESPACE@[165; 170) "\n " | 101 | WHITESPACE@[165; 170) "\n " |
102 | EXPR_STMT@[170; 177) | 102 | EXPR_STMT@[170; 177) |
103 | BIN_EXPR@[170; 176) | 103 | BIN_EXPR@[170; 176) |
@@ -111,7 +111,7 @@ SOURCE_FILE@[0; 257) | |||
111 | WHITESPACE@[174; 175) " " | 111 | WHITESPACE@[174; 175) " " |
112 | LITERAL@[175; 176) | 112 | LITERAL@[175; 176) |
113 | INT_NUMBER@[175; 176) "6" | 113 | INT_NUMBER@[175; 176) "6" |
114 | SEMI@[176; 177) ";" | 114 | SEMICOLON@[176; 177) ";" |
115 | WHITESPACE@[177; 182) "\n " | 115 | WHITESPACE@[177; 182) "\n " |
116 | EXPR_STMT@[182; 189) | 116 | EXPR_STMT@[182; 189) |
117 | BIN_EXPR@[182; 188) | 117 | BIN_EXPR@[182; 188) |
@@ -125,7 +125,7 @@ SOURCE_FILE@[0; 257) | |||
125 | WHITESPACE@[186; 187) " " | 125 | WHITESPACE@[186; 187) " " |
126 | LITERAL@[187; 188) | 126 | LITERAL@[187; 188) |
127 | INT_NUMBER@[187; 188) "7" | 127 | INT_NUMBER@[187; 188) "7" |
128 | SEMI@[188; 189) ";" | 128 | SEMICOLON@[188; 189) ";" |
129 | WHITESPACE@[189; 194) "\n " | 129 | WHITESPACE@[189; 194) "\n " |
130 | EXPR_STMT@[194; 201) | 130 | EXPR_STMT@[194; 201) |
131 | BIN_EXPR@[194; 200) | 131 | BIN_EXPR@[194; 200) |
@@ -139,7 +139,7 @@ SOURCE_FILE@[0; 257) | |||
139 | WHITESPACE@[198; 199) " " | 139 | WHITESPACE@[198; 199) " " |
140 | LITERAL@[199; 200) | 140 | LITERAL@[199; 200) |
141 | INT_NUMBER@[199; 200) "8" | 141 | INT_NUMBER@[199; 200) "8" |
142 | SEMI@[200; 201) ";" | 142 | SEMICOLON@[200; 201) ";" |
143 | WHITESPACE@[201; 206) "\n " | 143 | WHITESPACE@[201; 206) "\n " |
144 | EXPR_STMT@[206; 213) | 144 | EXPR_STMT@[206; 213) |
145 | BIN_EXPR@[206; 212) | 145 | BIN_EXPR@[206; 212) |
@@ -153,7 +153,7 @@ SOURCE_FILE@[0; 257) | |||
153 | WHITESPACE@[210; 211) " " | 153 | WHITESPACE@[210; 211) " " |
154 | LITERAL@[211; 212) | 154 | LITERAL@[211; 212) |
155 | INT_NUMBER@[211; 212) "9" | 155 | INT_NUMBER@[211; 212) "9" |
156 | SEMI@[212; 213) ";" | 156 | SEMICOLON@[212; 213) ";" |
157 | WHITESPACE@[213; 218) "\n " | 157 | WHITESPACE@[213; 218) "\n " |
158 | EXPR_STMT@[218; 226) | 158 | EXPR_STMT@[218; 226) |
159 | BIN_EXPR@[218; 225) | 159 | BIN_EXPR@[218; 225) |
@@ -167,7 +167,7 @@ SOURCE_FILE@[0; 257) | |||
167 | WHITESPACE@[222; 223) " " | 167 | WHITESPACE@[222; 223) " " |
168 | LITERAL@[223; 225) | 168 | LITERAL@[223; 225) |
169 | INT_NUMBER@[223; 225) "10" | 169 | INT_NUMBER@[223; 225) "10" |
170 | SEMI@[225; 226) ";" | 170 | SEMICOLON@[225; 226) ";" |
171 | WHITESPACE@[226; 231) "\n " | 171 | WHITESPACE@[226; 231) "\n " |
172 | EXPR_STMT@[231; 240) | 172 | EXPR_STMT@[231; 240) |
173 | BIN_EXPR@[231; 239) | 173 | BIN_EXPR@[231; 239) |
@@ -181,7 +181,7 @@ SOURCE_FILE@[0; 257) | |||
181 | WHITESPACE@[236; 237) " " | 181 | WHITESPACE@[236; 237) " " |
182 | LITERAL@[237; 239) | 182 | LITERAL@[237; 239) |
183 | INT_NUMBER@[237; 239) "11" | 183 | INT_NUMBER@[237; 239) "11" |
184 | SEMI@[239; 240) ";" | 184 | SEMICOLON@[239; 240) ";" |
185 | WHITESPACE@[240; 245) "\n " | 185 | WHITESPACE@[240; 245) "\n " |
186 | EXPR_STMT@[245; 254) | 186 | EXPR_STMT@[245; 254) |
187 | BIN_EXPR@[245; 253) | 187 | BIN_EXPR@[245; 253) |
@@ -195,7 +195,7 @@ SOURCE_FILE@[0; 257) | |||
195 | WHITESPACE@[250; 251) " " | 195 | WHITESPACE@[250; 251) " " |
196 | LITERAL@[251; 253) | 196 | LITERAL@[251; 253) |
197 | INT_NUMBER@[251; 253) "12" | 197 | INT_NUMBER@[251; 253) "12" |
198 | SEMI@[253; 254) ";" | 198 | SEMICOLON@[253; 254) ";" |
199 | WHITESPACE@[254; 255) "\n" | 199 | WHITESPACE@[254; 255) "\n" |
200 | R_CURLY@[255; 256) "}" | 200 | R_CURLY@[255; 256) "}" |
201 | WHITESPACE@[256; 257) "\n" | 201 | WHITESPACE@[256; 257) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast b/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast index aa6daff7d..0d32f0115 100644 --- a/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0049_async_block.rast | |||
@@ -19,7 +19,7 @@ SOURCE_FILE@[0; 47) | |||
19 | BLOCK@[21; 23) | 19 | BLOCK@[21; 23) |
20 | L_CURLY@[21; 22) "{" | 20 | L_CURLY@[21; 22) "{" |
21 | R_CURLY@[22; 23) "}" | 21 | R_CURLY@[22; 23) "}" |
22 | SEMI@[23; 24) ";" | 22 | SEMICOLON@[23; 24) ";" |
23 | WHITESPACE@[24; 29) "\n " | 23 | WHITESPACE@[24; 29) "\n " |
24 | EXPR_STMT@[29; 43) | 24 | EXPR_STMT@[29; 43) |
25 | BLOCK_EXPR@[29; 42) | 25 | BLOCK_EXPR@[29; 42) |
@@ -30,7 +30,7 @@ SOURCE_FILE@[0; 47) | |||
30 | BLOCK@[40; 42) | 30 | BLOCK@[40; 42) |
31 | L_CURLY@[40; 41) "{" | 31 | L_CURLY@[40; 41) "{" |
32 | R_CURLY@[41; 42) "}" | 32 | R_CURLY@[41; 42) "}" |
33 | SEMI@[42; 43) ";" | 33 | SEMICOLON@[42; 43) ";" |
34 | WHITESPACE@[43; 44) "\n" | 34 | WHITESPACE@[43; 44) "\n" |
35 | R_CURLY@[44; 45) "}" | 35 | R_CURLY@[44; 45) "}" |
36 | 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.rast b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast index 435f27970..17591d99f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast +++ b/crates/ra_syntax/test_data/parser/ok/0050_async_block_as_argument.rast | |||
@@ -24,11 +24,11 @@ SOURCE_FILE@[0; 95) | |||
24 | PATH_SEGMENT@[15; 18) | 24 | PATH_SEGMENT@[15; 18) |
25 | NAME_REF@[15; 18) | 25 | NAME_REF@[15; 18) |
26 | IDENT@[15; 18) "std" | 26 | IDENT@[15; 18) "std" |
27 | COLONCOLON@[18; 20) "::" | 27 | COLON2@[18; 20) "::" |
28 | PATH_SEGMENT@[20; 26) | 28 | PATH_SEGMENT@[20; 26) |
29 | NAME_REF@[20; 26) | 29 | NAME_REF@[20; 26) |
30 | IDENT@[20; 26) "future" | 30 | IDENT@[20; 26) "future" |
31 | COLONCOLON@[26; 28) "::" | 31 | COLON2@[26; 28) "::" |
32 | PATH_SEGMENT@[28; 48) | 32 | PATH_SEGMENT@[28; 48) |
33 | NAME_REF@[28; 34) | 33 | NAME_REF@[28; 34) |
34 | IDENT@[28; 34) "Future" | 34 | IDENT@[28; 34) "Future" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast index 254eafc36..8fd28427c 100644 --- a/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast +++ b/crates/ra_syntax/test_data/parser/ok/0051_parameter_attrs.rast | |||
@@ -119,7 +119,7 @@ SOURCE_FILE@[0; 519) | |||
119 | R_BRACK@[112; 113) "]" | 119 | R_BRACK@[112; 113) "]" |
120 | WHITESPACE@[113; 114) " " | 120 | WHITESPACE@[113; 114) " " |
121 | PARAM@[114; 117) | 121 | PARAM@[114; 117) |
122 | DOTDOTDOT@[114; 117) "..." | 122 | DOT3@[114; 117) "..." |
123 | R_PAREN@[117; 118) ")" | 123 | R_PAREN@[117; 118) ")" |
124 | WHITESPACE@[118; 119) " " | 124 | WHITESPACE@[118; 119) " " |
125 | RET_TYPE@[119; 125) | 125 | RET_TYPE@[119; 125) |
@@ -130,7 +130,7 @@ SOURCE_FILE@[0; 519) | |||
130 | PATH_SEGMENT@[122; 125) | 130 | PATH_SEGMENT@[122; 125) |
131 | NAME_REF@[122; 125) | 131 | NAME_REF@[122; 125) |
132 | IDENT@[122; 125) "i32" | 132 | IDENT@[122; 125) "i32" |
133 | SEMI@[125; 126) ";" | 133 | SEMICOLON@[125; 126) ";" |
134 | WHITESPACE@[126; 127) " " | 134 | WHITESPACE@[126; 127) " " |
135 | R_CURLY@[127; 128) "}" | 135 | R_CURLY@[127; 128) "}" |
136 | WHITESPACE@[128; 130) "\n\n" | 136 | WHITESPACE@[128; 130) "\n\n" |
@@ -250,7 +250,7 @@ SOURCE_FILE@[0; 519) | |||
250 | NAME_REF@[229; 232) | 250 | NAME_REF@[229; 232) |
251 | IDENT@[229; 232) "i32" | 251 | IDENT@[229; 232) "i32" |
252 | R_PAREN@[232; 233) ")" | 252 | R_PAREN@[232; 233) ")" |
253 | SEMI@[233; 234) ";" | 253 | SEMICOLON@[233; 234) ";" |
254 | WHITESPACE@[234; 235) "\n" | 254 | WHITESPACE@[234; 235) "\n" |
255 | R_CURLY@[235; 236) "}" | 255 | R_CURLY@[235; 236) "}" |
256 | WHITESPACE@[236; 238) "\n\n" | 256 | WHITESPACE@[236; 238) "\n\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast index 374c58670..473966cd4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0052_for_range_block.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 80) | |||
25 | LITERAL@[24; 25) | 25 | LITERAL@[24; 25) |
26 | INT_NUMBER@[24; 25) "0" | 26 | INT_NUMBER@[24; 25) "0" |
27 | WHITESPACE@[25; 26) " " | 27 | WHITESPACE@[25; 26) " " |
28 | DOTDOT@[26; 28) ".." | 28 | DOT2@[26; 28) ".." |
29 | WHITESPACE@[28; 29) " " | 29 | WHITESPACE@[28; 29) " " |
30 | METHOD_CALL_EXPR@[29; 56) | 30 | METHOD_CALL_EXPR@[29; 56) |
31 | PAREN_EXPR@[29; 43) | 31 | PAREN_EXPR@[29; 43) |
@@ -34,7 +34,7 @@ SOURCE_FILE@[0; 80) | |||
34 | LITERAL@[30; 31) | 34 | LITERAL@[30; 31) |
35 | INT_NUMBER@[30; 31) "0" | 35 | INT_NUMBER@[30; 31) "0" |
36 | WHITESPACE@[31; 32) " " | 36 | WHITESPACE@[31; 32) " " |
37 | DOTDOT@[32; 34) ".." | 37 | DOT2@[32; 34) ".." |
38 | WHITESPACE@[34; 35) " " | 38 | WHITESPACE@[34; 35) " " |
39 | BLOCK_EXPR@[35; 42) | 39 | BLOCK_EXPR@[35; 42) |
40 | BLOCK@[35; 42) | 40 | BLOCK@[35; 42) |
@@ -53,7 +53,7 @@ SOURCE_FILE@[0; 80) | |||
53 | NAME_REF@[44; 47) | 53 | NAME_REF@[44; 47) |
54 | IDENT@[44; 47) "sum" | 54 | IDENT@[44; 47) "sum" |
55 | TYPE_ARG_LIST@[47; 54) | 55 | TYPE_ARG_LIST@[47; 54) |
56 | COLONCOLON@[47; 49) "::" | 56 | COLON2@[47; 49) "::" |
57 | L_ANGLE@[49; 50) "<" | 57 | L_ANGLE@[49; 50) "<" |
58 | TYPE_ARG@[50; 53) | 58 | TYPE_ARG@[50; 53) |
59 | PATH_TYPE@[50; 53) | 59 | PATH_TYPE@[50; 53) |
@@ -73,7 +73,7 @@ SOURCE_FILE@[0; 80) | |||
73 | EXPR_STMT@[66; 72) | 73 | EXPR_STMT@[66; 72) |
74 | BREAK_EXPR@[66; 71) | 74 | BREAK_EXPR@[66; 71) |
75 | BREAK_KW@[66; 71) "break" | 75 | BREAK_KW@[66; 71) "break" |
76 | SEMI@[71; 72) ";" | 76 | SEMICOLON@[71; 72) ";" |
77 | WHITESPACE@[72; 76) "\n " | 77 | WHITESPACE@[72; 76) "\n " |
78 | R_CURLY@[76; 77) "}" | 78 | R_CURLY@[76; 77) "}" |
79 | WHITESPACE@[77; 78) "\n" | 79 | WHITESPACE@[77; 78) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast b/crates/ra_syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast index 04ff0e2ff..60a491853 100644 --- a/crates/ra_syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast +++ b/crates/ra_syntax/test_data/parser/ok/0053_outer_attribute_on_macro_rules.rast | |||
@@ -15,7 +15,7 @@ SOURCE_FILE@[0; 65) | |||
15 | PATH_SEGMENT@[30; 41) | 15 | PATH_SEGMENT@[30; 41) |
16 | NAME_REF@[30; 41) | 16 | NAME_REF@[30; 41) |
17 | IDENT@[30; 41) "macro_rules" | 17 | IDENT@[30; 41) "macro_rules" |
18 | EXCL@[41; 42) "!" | 18 | BANG@[41; 42) "!" |
19 | WHITESPACE@[42; 43) " " | 19 | WHITESPACE@[42; 43) " " |
20 | NAME@[43; 46) | 20 | NAME@[43; 46) |
21 | IDENT@[43; 46) "foo" | 21 | IDENT@[43; 46) "foo" |
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 65) | |||
33 | TOKEN_TREE@[59; 61) | 33 | TOKEN_TREE@[59; 61) |
34 | L_CURLY@[59; 60) "{" | 34 | L_CURLY@[59; 60) "{" |
35 | R_CURLY@[60; 61) "}" | 35 | R_CURLY@[60; 61) "}" |
36 | SEMI@[61; 62) ";" | 36 | SEMICOLON@[61; 62) ";" |
37 | WHITESPACE@[62; 63) "\n" | 37 | WHITESPACE@[62; 63) "\n" |
38 | R_CURLY@[63; 64) "}" | 38 | R_CURLY@[63; 64) "}" |
39 | WHITESPACE@[64; 65) "\n" | 39 | WHITESPACE@[64; 65) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast index 7e1af254c..fabf88e8f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast +++ b/crates/ra_syntax/test_data/parser/ok/0054_qual_path_in_type_arg.rast | |||
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 88) | |||
25 | PATH_SEGMENT@[14; 17) | 25 | PATH_SEGMENT@[14; 17) |
26 | NAME_REF@[14; 17) | 26 | NAME_REF@[14; 17) |
27 | IDENT@[14; 17) "bar" | 27 | IDENT@[14; 17) "bar" |
28 | COLONCOLON@[17; 19) "::" | 28 | COLON2@[17; 19) "::" |
29 | PATH_SEGMENT@[19; 22) | 29 | PATH_SEGMENT@[19; 22) |
30 | NAME_REF@[19; 22) | 30 | NAME_REF@[19; 22) |
31 | IDENT@[19; 22) "Baz" | 31 | IDENT@[19; 22) "Baz" |
@@ -67,7 +67,7 @@ SOURCE_FILE@[0; 88) | |||
67 | PATH_SEGMENT@[47; 48) | 67 | PATH_SEGMENT@[47; 48) |
68 | NAME_REF@[47; 48) | 68 | NAME_REF@[47; 48) |
69 | IDENT@[47; 48) "x" | 69 | IDENT@[47; 48) "x" |
70 | COLONCOLON@[48; 50) "::" | 70 | COLON2@[48; 50) "::" |
71 | PATH_SEGMENT@[50; 51) | 71 | PATH_SEGMENT@[50; 51) |
72 | NAME_REF@[50; 51) | 72 | NAME_REF@[50; 51) |
73 | IDENT@[50; 51) "Y" | 73 | IDENT@[50; 51) "Y" |
@@ -112,7 +112,7 @@ SOURCE_FILE@[0; 88) | |||
112 | PATH_SEGMENT@[78; 79) | 112 | PATH_SEGMENT@[78; 79) |
113 | NAME_REF@[78; 79) | 113 | NAME_REF@[78; 79) |
114 | IDENT@[78; 79) "x" | 114 | IDENT@[78; 79) "x" |
115 | COLONCOLON@[79; 81) "::" | 115 | COLON2@[79; 81) "::" |
116 | PATH_SEGMENT@[81; 82) | 116 | PATH_SEGMENT@[81; 82) |
117 | NAME_REF@[81; 82) | 117 | NAME_REF@[81; 82) |
118 | IDENT@[81; 82) "Y" | 118 | IDENT@[81; 82) "Y" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast b/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast index d656e74b1..6ac3f1458 100644 --- a/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast +++ b/crates/ra_syntax/test_data/parser/ok/0055_dot_dot_dot.rast | |||
@@ -10,7 +10,7 @@ SOURCE_FILE@[0; 49) | |||
10 | TUPLE_TYPE@[9; 11) | 10 | TUPLE_TYPE@[9; 11) |
11 | L_PAREN@[9; 10) "(" | 11 | L_PAREN@[9; 10) "(" |
12 | R_PAREN@[10; 11) ")" | 12 | R_PAREN@[10; 11) ")" |
13 | SEMI@[11; 12) ";" | 13 | SEMICOLON@[11; 12) ";" |
14 | WHITESPACE@[12; 14) "\n\n" | 14 | WHITESPACE@[12; 14) "\n\n" |
15 | FN_DEF@[14; 48) | 15 | FN_DEF@[14; 48) |
16 | FN_KW@[14; 16) "fn" | 16 | FN_KW@[14; 16) "fn" |
@@ -35,7 +35,7 @@ SOURCE_FILE@[0; 49) | |||
35 | PATH_TYPE@[37; 40) | 35 | PATH_TYPE@[37; 40) |
36 | PATH@[37; 40) | 36 | PATH@[37; 40) |
37 | PATH_SEGMENT@[37; 40) | 37 | PATH_SEGMENT@[37; 40) |
38 | COLONCOLON@[37; 39) "::" | 38 | COLON2@[37; 39) "::" |
39 | NAME_REF@[39; 40) | 39 | NAME_REF@[39; 40) |
40 | IDENT@[39; 40) "X" | 40 | IDENT@[39; 40) "X" |
41 | WHITESPACE@[40; 41) " " | 41 | WHITESPACE@[40; 41) " " |
@@ -44,7 +44,7 @@ SOURCE_FILE@[0; 49) | |||
44 | TUPLE_EXPR@[43; 45) | 44 | TUPLE_EXPR@[43; 45) |
45 | L_PAREN@[43; 44) "(" | 45 | L_PAREN@[43; 44) "(" |
46 | R_PAREN@[44; 45) ")" | 46 | R_PAREN@[44; 45) ")" |
47 | SEMI@[45; 46) ";" | 47 | SEMICOLON@[45; 46) ";" |
48 | WHITESPACE@[46; 47) "\n" | 48 | WHITESPACE@[46; 47) "\n" |
49 | R_CURLY@[47; 48) "}" | 49 | R_CURLY@[47; 48) "}" |
50 | WHITESPACE@[48; 49) "\n" | 50 | WHITESPACE@[48; 49) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast index cc8c3f7ec..2c07bde43 100644 --- a/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast +++ b/crates/ra_syntax/test_data/parser/ok/0057_loop_in_call.rast | |||
@@ -54,6 +54,6 @@ SOURCE_FILE@[0; 50) | |||
54 | L_CURLY@[44; 45) "{" | 54 | L_CURLY@[44; 45) "{" |
55 | R_CURLY@[45; 46) "}" | 55 | R_CURLY@[45; 46) "}" |
56 | R_PAREN@[46; 47) ")" | 56 | R_PAREN@[46; 47) ")" |
57 | SEMI@[47; 48) ";" | 57 | SEMICOLON@[47; 48) ";" |
58 | WHITESPACE@[48; 49) "\n" | 58 | WHITESPACE@[48; 49) "\n" |
59 | R_CURLY@[49; 50) "}" | 59 | R_CURLY@[49; 50) "}" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast b/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast index d30cb63ff..9de9efbad 100644 --- a/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast +++ b/crates/ra_syntax/test_data/parser/ok/0058_unary_expr_precedence.rast | |||
@@ -31,7 +31,7 @@ SOURCE_FILE@[0; 79) | |||
31 | WHITESPACE@[24; 25) " " | 31 | WHITESPACE@[24; 25) " " |
32 | LITERAL@[25; 26) | 32 | LITERAL@[25; 26) |
33 | INT_NUMBER@[25; 26) "3" | 33 | INT_NUMBER@[25; 26) "3" |
34 | SEMI@[26; 27) ";" | 34 | SEMICOLON@[26; 27) ";" |
35 | WHITESPACE@[27; 32) "\n " | 35 | WHITESPACE@[27; 32) "\n " |
36 | EXPR_STMT@[32; 43) | 36 | EXPR_STMT@[32; 43) |
37 | CAST_EXPR@[32; 42) | 37 | CAST_EXPR@[32; 42) |
@@ -49,7 +49,7 @@ SOURCE_FILE@[0; 79) | |||
49 | PATH_SEGMENT@[39; 42) | 49 | PATH_SEGMENT@[39; 42) |
50 | NAME_REF@[39; 42) | 50 | NAME_REF@[39; 42) |
51 | IDENT@[39; 42) "u64" | 51 | IDENT@[39; 42) "u64" |
52 | SEMI@[42; 43) ";" | 52 | SEMICOLON@[42; 43) ";" |
53 | WHITESPACE@[43; 48) "\n " | 53 | WHITESPACE@[43; 48) "\n " |
54 | EXPR_STMT@[48; 54) | 54 | EXPR_STMT@[48; 54) |
55 | PREFIX_EXPR@[48; 53) | 55 | PREFIX_EXPR@[48; 53) |
@@ -65,7 +65,7 @@ SOURCE_FILE@[0; 79) | |||
65 | LITERAL@[51; 52) | 65 | LITERAL@[51; 52) |
66 | INT_NUMBER@[51; 52) "1" | 66 | INT_NUMBER@[51; 52) "1" |
67 | R_PAREN@[52; 53) ")" | 67 | R_PAREN@[52; 53) ")" |
68 | SEMI@[53; 54) ";" | 68 | SEMICOLON@[53; 54) ";" |
69 | WHITESPACE@[54; 59) "\n " | 69 | WHITESPACE@[54; 59) "\n " |
70 | EXPR_STMT@[59; 65) | 70 | EXPR_STMT@[59; 65) |
71 | REF_EXPR@[59; 64) | 71 | REF_EXPR@[59; 64) |
@@ -80,7 +80,7 @@ SOURCE_FILE@[0; 79) | |||
80 | LITERAL@[62; 63) | 80 | LITERAL@[62; 63) |
81 | INT_NUMBER@[62; 63) "1" | 81 | INT_NUMBER@[62; 63) "1" |
82 | R_BRACK@[63; 64) "]" | 82 | R_BRACK@[63; 64) "]" |
83 | SEMI@[64; 65) ";" | 83 | SEMICOLON@[64; 65) ";" |
84 | WHITESPACE@[65; 70) "\n " | 84 | WHITESPACE@[65; 70) "\n " |
85 | EXPR_STMT@[70; 76) | 85 | EXPR_STMT@[70; 76) |
86 | RANGE_EXPR@[70; 75) | 86 | RANGE_EXPR@[70; 75) |
@@ -88,10 +88,10 @@ SOURCE_FILE@[0; 79) | |||
88 | MINUS@[70; 71) "-" | 88 | MINUS@[70; 71) "-" |
89 | LITERAL@[71; 72) | 89 | LITERAL@[71; 72) |
90 | INT_NUMBER@[71; 72) "1" | 90 | INT_NUMBER@[71; 72) "1" |
91 | DOTDOT@[72; 74) ".." | 91 | DOT2@[72; 74) ".." |
92 | LITERAL@[74; 75) | 92 | LITERAL@[74; 75) |
93 | INT_NUMBER@[74; 75) "2" | 93 | INT_NUMBER@[74; 75) "2" |
94 | SEMI@[75; 76) ";" | 94 | SEMICOLON@[75; 76) ";" |
95 | WHITESPACE@[76; 77) "\n" | 95 | WHITESPACE@[76; 77) "\n" |
96 | R_CURLY@[77; 78) "}" | 96 | R_CURLY@[77; 78) "}" |
97 | WHITESPACE@[78; 79) "\n" | 97 | WHITESPACE@[78; 79) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast b/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast index c011187ea..101478ce1 100644 --- a/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast +++ b/crates/ra_syntax/test_data/parser/ok/0059_loops_in_parens.rast | |||
@@ -47,7 +47,7 @@ SOURCE_FILE@[0; 105) | |||
47 | L_CURLY@[46; 47) "{" | 47 | L_CURLY@[46; 47) "{" |
48 | R_CURLY@[47; 48) "}" | 48 | R_CURLY@[47; 48) "}" |
49 | R_PAREN@[48; 49) ")" | 49 | R_PAREN@[48; 49) ")" |
50 | SEMI@[49; 50) ";" | 50 | SEMICOLON@[49; 50) ";" |
51 | WHITESPACE@[50; 55) "\n " | 51 | WHITESPACE@[50; 55) "\n " |
52 | EXPR_STMT@[55; 77) | 52 | EXPR_STMT@[55; 77) |
53 | CALL_EXPR@[55; 76) | 53 | CALL_EXPR@[55; 76) |
@@ -68,11 +68,11 @@ SOURCE_FILE@[0; 105) | |||
68 | EXPR_STMT@[67; 73) | 68 | EXPR_STMT@[67; 73) |
69 | BREAK_EXPR@[67; 72) | 69 | BREAK_EXPR@[67; 72) |
70 | BREAK_KW@[67; 72) "break" | 70 | BREAK_KW@[67; 72) "break" |
71 | SEMI@[72; 73) ";" | 71 | SEMICOLON@[72; 73) ";" |
72 | WHITESPACE@[73; 74) " " | 72 | WHITESPACE@[73; 74) " " |
73 | R_CURLY@[74; 75) "}" | 73 | R_CURLY@[74; 75) "}" |
74 | R_PAREN@[75; 76) ")" | 74 | R_PAREN@[75; 76) ")" |
75 | SEMI@[76; 77) ";" | 75 | SEMICOLON@[76; 77) ";" |
76 | WHITESPACE@[77; 82) "\n " | 76 | WHITESPACE@[77; 82) "\n " |
77 | EXPR_STMT@[82; 102) | 77 | EXPR_STMT@[82; 102) |
78 | CALL_EXPR@[82; 101) | 78 | CALL_EXPR@[82; 101) |
@@ -95,7 +95,7 @@ SOURCE_FILE@[0; 105) | |||
95 | L_CURLY@[98; 99) "{" | 95 | L_CURLY@[98; 99) "{" |
96 | R_CURLY@[99; 100) "}" | 96 | R_CURLY@[99; 100) "}" |
97 | R_PAREN@[100; 101) ")" | 97 | R_PAREN@[100; 101) ")" |
98 | SEMI@[101; 102) ";" | 98 | SEMICOLON@[101; 102) ";" |
99 | WHITESPACE@[102; 103) "\n" | 99 | WHITESPACE@[102; 103) "\n" |
100 | R_CURLY@[103; 104) "}" | 100 | R_CURLY@[103; 104) "}" |
101 | WHITESPACE@[104; 105) "\n" | 101 | WHITESPACE@[104; 105) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast b/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast index ad0c4a3fe..6bff57505 100644 --- a/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast +++ b/crates/ra_syntax/test_data/parser/ok/0060_as_range.rast | |||
@@ -26,8 +26,8 @@ SOURCE_FILE@[0; 56) | |||
26 | NAME_REF@[21; 26) | 26 | NAME_REF@[21; 26) |
27 | IDENT@[21; 26) "usize" | 27 | IDENT@[21; 26) "usize" |
28 | WHITESPACE@[26; 27) " " | 28 | WHITESPACE@[26; 27) " " |
29 | DOTDOT@[27; 29) ".." | 29 | DOT2@[27; 29) ".." |
30 | SEMI@[29; 30) ";" | 30 | SEMICOLON@[29; 30) ";" |
31 | WHITESPACE@[30; 35) "\n " | 31 | WHITESPACE@[30; 35) "\n " |
32 | EXPR_STMT@[35; 53) | 32 | EXPR_STMT@[35; 53) |
33 | RANGE_EXPR@[35; 52) | 33 | RANGE_EXPR@[35; 52) |
@@ -49,8 +49,8 @@ SOURCE_FILE@[0; 56) | |||
49 | NAME_REF@[44; 49) | 49 | NAME_REF@[44; 49) |
50 | IDENT@[44; 49) "usize" | 50 | IDENT@[44; 49) "usize" |
51 | WHITESPACE@[49; 50) " " | 51 | WHITESPACE@[49; 50) " " |
52 | DOTDOT@[50; 52) ".." | 52 | DOT2@[50; 52) ".." |
53 | SEMI@[52; 53) ";" | 53 | SEMICOLON@[52; 53) ";" |
54 | WHITESPACE@[53; 54) "\n" | 54 | WHITESPACE@[53; 54) "\n" |
55 | R_CURLY@[54; 55) "}" | 55 | R_CURLY@[54; 55) "}" |
56 | WHITESPACE@[55; 56) "\n" | 56 | WHITESPACE@[55; 56) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast b/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast index bdfac9b76..be6774199 100644 --- a/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast +++ b/crates/ra_syntax/test_data/parser/ok/0061_match_full_range.rast | |||
@@ -16,7 +16,7 @@ SOURCE_FILE@[0; 35) | |||
16 | MATCH_KW@[16; 21) "match" | 16 | MATCH_KW@[16; 21) "match" |
17 | WHITESPACE@[21; 22) " " | 17 | WHITESPACE@[21; 22) " " |
18 | RANGE_EXPR@[22; 24) | 18 | RANGE_EXPR@[22; 24) |
19 | DOTDOT@[22; 24) ".." | 19 | DOT2@[22; 24) ".." |
20 | WHITESPACE@[24; 25) " " | 20 | WHITESPACE@[24; 25) " " |
21 | MATCH_ARM_LIST@[25; 32) | 21 | MATCH_ARM_LIST@[25; 32) |
22 | L_CURLY@[25; 26) "{" | 22 | L_CURLY@[25; 26) "{" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast index 2be523fc3..f89d7c0d9 100644 --- a/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast +++ b/crates/ra_syntax/test_data/parser/ok/0062_macro_2.0.rast | |||
@@ -30,7 +30,7 @@ SOURCE_FILE@[0; 349) | |||
30 | L_CURLY@[42; 43) "{" | 30 | L_CURLY@[42; 43) "{" |
31 | WHITESPACE@[43; 48) "\n " | 31 | WHITESPACE@[43; 48) "\n " |
32 | IDENT@[48; 51) "vec" | 32 | IDENT@[48; 51) "vec" |
33 | EXCL@[51; 52) "!" | 33 | BANG@[51; 52) "!" |
34 | TOKEN_TREE@[52; 91) | 34 | TOKEN_TREE@[52; 91) |
35 | L_BRACK@[52; 53) "[" | 35 | L_BRACK@[52; 53) "[" |
36 | WHITESPACE@[53; 62) "\n " | 36 | WHITESPACE@[53; 62) "\n " |
@@ -129,7 +129,7 @@ SOURCE_FILE@[0; 349) | |||
129 | L_CURLY@[204; 205) "{" | 129 | L_CURLY@[204; 205) "{" |
130 | WHITESPACE@[205; 214) "\n " | 130 | WHITESPACE@[205; 214) "\n " |
131 | IDENT@[214; 223) "assert_eq" | 131 | IDENT@[214; 223) "assert_eq" |
132 | EXCL@[223; 224) "!" | 132 | BANG@[223; 224) "!" |
133 | TOKEN_TREE@[224; 339) | 133 | TOKEN_TREE@[224; 339) |
134 | L_PAREN@[224; 225) "(" | 134 | L_PAREN@[224; 225) "(" |
135 | WHITESPACE@[225; 238) "\n " | 135 | WHITESPACE@[225; 238) "\n " |
@@ -137,7 +137,7 @@ SOURCE_FILE@[0; 349) | |||
137 | TOKEN_TREE@[253; 284) | 137 | TOKEN_TREE@[253; 284) |
138 | L_PAREN@[253; 254) "(" | 138 | L_PAREN@[253; 254) "(" |
139 | IDENT@[254; 269) "parse_use_trees" | 139 | IDENT@[254; 269) "parse_use_trees" |
140 | EXCL@[269; 270) "!" | 140 | BANG@[269; 270) "!" |
141 | TOKEN_TREE@[270; 283) | 141 | TOKEN_TREE@[270; 283) |
142 | L_PAREN@[270; 271) "(" | 142 | L_PAREN@[270; 271) "(" |
143 | DOLLAR@[271; 272) "$" | 143 | DOLLAR@[271; 272) "$" |
@@ -153,7 +153,7 @@ SOURCE_FILE@[0; 349) | |||
153 | COMMA@[284; 285) "," | 153 | COMMA@[284; 285) "," |
154 | WHITESPACE@[285; 298) "\n " | 154 | WHITESPACE@[285; 298) "\n " |
155 | IDENT@[298; 313) "parse_use_trees" | 155 | IDENT@[298; 313) "parse_use_trees" |
156 | EXCL@[313; 314) "!" | 156 | BANG@[313; 314) "!" |
157 | TOKEN_TREE@[314; 328) | 157 | TOKEN_TREE@[314; 328) |
158 | L_PAREN@[314; 315) "(" | 158 | L_PAREN@[314; 315) "(" |
159 | DOLLAR@[315; 316) "$" | 159 | DOLLAR@[315; 316) "$" |
@@ -168,7 +168,7 @@ SOURCE_FILE@[0; 349) | |||
168 | COMMA@[328; 329) "," | 168 | COMMA@[328; 329) "," |
169 | WHITESPACE@[329; 338) "\n " | 169 | WHITESPACE@[329; 338) "\n " |
170 | R_PAREN@[338; 339) ")" | 170 | R_PAREN@[338; 339) ")" |
171 | SEMI@[339; 340) ";" | 171 | SEMICOLON@[339; 340) ";" |
172 | WHITESPACE@[340; 345) "\n " | 172 | WHITESPACE@[340; 345) "\n " |
173 | R_CURLY@[345; 346) "}" | 173 | R_CURLY@[345; 346) "}" |
174 | WHITESPACE@[346; 347) "\n" | 174 | WHITESPACE@[346; 347) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast index eb2e3a503..9b5954ebd 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_trait_fn_patterns.rast | |||
@@ -190,7 +190,7 @@ SOURCE_FILE@[0; 170) | |||
190 | NAME_REF@[162; 165) | 190 | NAME_REF@[162; 165) |
191 | IDENT@[162; 165) "i32" | 191 | IDENT@[162; 165) "i32" |
192 | R_PAREN@[165; 166) ")" | 192 | R_PAREN@[165; 166) ")" |
193 | SEMI@[166; 167) ";" | 193 | SEMICOLON@[166; 167) ";" |
194 | WHITESPACE@[167; 168) "\n" | 194 | WHITESPACE@[167; 168) "\n" |
195 | R_CURLY@[168; 169) "}" | 195 | R_CURLY@[168; 169) "}" |
196 | WHITESPACE@[169; 170) "\n" | 196 | WHITESPACE@[169; 170) "\n" |
diff --git a/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast b/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast index 186f03626..17b08197b 100644 --- a/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast +++ b/crates/ra_syntax/test_data/parser/ok/0063_variadic_fun.rast | |||
@@ -32,10 +32,10 @@ SOURCE_FILE@[0; 126) | |||
32 | COMMA@[32; 33) "," | 32 | COMMA@[32; 33) "," |
33 | WHITESPACE@[33; 34) " " | 33 | WHITESPACE@[33; 34) " " |
34 | PARAM@[34; 37) | 34 | PARAM@[34; 37) |
35 | DOTDOTDOT@[34; 37) "..." | 35 | DOT3@[34; 37) "..." |
36 | COMMA@[37; 38) "," | 36 | COMMA@[37; 38) "," |
37 | R_PAREN@[38; 39) ")" | 37 | R_PAREN@[38; 39) ")" |
38 | SEMI@[39; 40) ";" | 38 | SEMICOLON@[39; 40) ";" |
39 | WHITESPACE@[40; 45) "\n " | 39 | WHITESPACE@[40; 45) "\n " |
40 | FN_DEF@[45; 70) | 40 | FN_DEF@[45; 70) |
41 | FN_KW@[45; 47) "fn" | 41 | FN_KW@[45; 47) "fn" |
@@ -65,9 +65,9 @@ SOURCE_FILE@[0; 126) | |||
65 | UNDERSCORE@[62; 63) "_" | 65 | UNDERSCORE@[62; 63) "_" |
66 | COLON@[63; 64) ":" | 66 | COLON@[63; 64) ":" |
67 | WHITESPACE@[64; 65) " " | 67 | WHITESPACE@[64; 65) " " |
68 | DOTDOTDOT@[65; 68) "..." | 68 | DOT3@[65; 68) "..." |
69 | R_PAREN@[68; 69) ")" | 69 | R_PAREN@[68; 69) ")" |
70 | SEMI@[69; 70) ";" | 70 | SEMICOLON@[69; 70) ";" |
71 | WHITESPACE@[70; 75) "\n " | 71 | WHITESPACE@[70; 75) "\n " |
72 | FN_DEF@[75; 123) | 72 | FN_DEF@[75; 123) |
73 | FN_KW@[75; 77) "fn" | 73 | FN_KW@[75; 77) "fn" |
@@ -124,10 +124,10 @@ SOURCE_FILE@[0; 126) | |||
124 | R_BRACK@[114; 115) "]" | 124 | R_BRACK@[114; 115) "]" |
125 | COLON@[115; 116) ":" | 125 | COLON@[115; 116) ":" |
126 | WHITESPACE@[116; 117) " " | 126 | WHITESPACE@[116; 117) " " |
127 | DOTDOTDOT@[117; 120) "..." | 127 | DOT3@[117; 120) "..." |
128 | COMMA@[120; 121) "," | 128 | COMMA@[120; 121) "," |
129 | R_PAREN@[121; 122) ")" | 129 | R_PAREN@[121; 122) ")" |
130 | SEMI@[122; 123) ";" | 130 | SEMICOLON@[122; 123) ";" |
131 | WHITESPACE@[123; 124) "\n" | 131 | WHITESPACE@[123; 124) "\n" |
132 | R_CURLY@[124; 125) "}" | 132 | R_CURLY@[124; 125) "}" |
133 | WHITESPACE@[125; 126) "\n" | 133 | WHITESPACE@[125; 126) "\n" |
diff --git a/crates/rust-analyzer/src/cli/load_cargo.rs b/crates/rust-analyzer/src/cli/load_cargo.rs index 69133e4e4..43062ea10 100644 --- a/crates/rust-analyzer/src/cli/load_cargo.rs +++ b/crates/rust-analyzer/src/cli/load_cargo.rs | |||
@@ -152,7 +152,9 @@ pub(crate) fn load( | |||
152 | &extern_source_roots, | 152 | &extern_source_roots, |
153 | proc_macro_client, | 153 | proc_macro_client, |
154 | &mut |path: &Path| { | 154 | &mut |path: &Path| { |
155 | let vfs_file = vfs.load(path); | 155 | // Some path from metadata will be non canonicalized, e.g. /foo/../bar/lib.rs |
156 | let path = path.canonicalize().ok()?; | ||
157 | let vfs_file = vfs.load(&path); | ||
156 | log::debug!("vfs file {:?} -> {:?}", path, vfs_file); | 158 | log::debug!("vfs file {:?} -> {:?}", path, vfs_file); |
157 | vfs_file.map(vfs_file_to_id) | 159 | vfs_file.map(vfs_file_to_id) |
158 | }, | 160 | }, |
diff --git a/crates/rust-analyzer/src/world.rs b/crates/rust-analyzer/src/world.rs index 365f57d8c..6c42e1d76 100644 --- a/crates/rust-analyzer/src/world.rs +++ b/crates/rust-analyzer/src/world.rs | |||
@@ -139,7 +139,9 @@ impl WorldState { | |||
139 | // Create crate graph from all the workspaces | 139 | // Create crate graph from all the workspaces |
140 | let mut crate_graph = CrateGraph::default(); | 140 | let mut crate_graph = CrateGraph::default(); |
141 | let mut load = |path: &std::path::Path| { | 141 | let mut load = |path: &std::path::Path| { |
142 | let vfs_file = vfs.load(path); | 142 | // Some path from metadata will be non canonicalized, e.g. /foo/../bar/lib.rs |
143 | let path = path.canonicalize().ok()?; | ||
144 | let vfs_file = vfs.load(&path); | ||
143 | vfs_file.map(|f| FileId(f.0)) | 145 | vfs_file.map(|f| FileId(f.0)) |
144 | }; | 146 | }; |
145 | 147 | ||
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs index 401a568bd..01cdf452c 100644 --- a/crates/stdx/src/lib.rs +++ b/crates/stdx/src/lib.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! Missing batteries for standard libraries. | 1 | //! Missing batteries for standard libraries. |
2 | 2 | ||
3 | use std::{cell::Cell, fmt}; | 3 | use std::{cell::Cell, fmt, time::Instant}; |
4 | 4 | ||
5 | #[inline(always)] | 5 | #[inline(always)] |
6 | pub fn is_ci() -> bool { | 6 | pub fn is_ci() -> bool { |
@@ -88,3 +88,17 @@ where | |||
88 | Ok(()) | 88 | Ok(()) |
89 | } | 89 | } |
90 | } | 90 | } |
91 | pub fn timeit(label: &'static str) -> impl Drop { | ||
92 | struct Guard { | ||
93 | label: &'static str, | ||
94 | start: Instant, | ||
95 | } | ||
96 | |||
97 | impl Drop for Guard { | ||
98 | fn drop(&mut self) { | ||
99 | eprintln!("{}: {:?}", self.label, self.start.elapsed()) | ||
100 | } | ||
101 | } | ||
102 | |||
103 | Guard { label, start: Instant::now() } | ||
104 | } | ||
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 4164bfd5e..3b60c55f3 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs | |||
@@ -395,7 +395,7 @@ pub fn skip_slow_tests() -> bool { | |||
395 | should_skip | 395 | should_skip |
396 | } | 396 | } |
397 | 397 | ||
398 | const REWRITE: bool = false; | 398 | const REWRITE: bool = true; |
399 | 399 | ||
400 | /// Asserts that `expected` and `actual` strings are equal. If they differ only | 400 | /// Asserts that `expected` and `actual` strings are equal. If they differ only |
401 | /// in trailing or leading whitespace the test won't fail and | 401 | /// in trailing or leading whitespace the test won't fail and |
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 74a87e900..69cba9168 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -11,7 +11,7 @@ pub(crate) struct KindsSrc<'a> { | |||
11 | 11 | ||
12 | pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | 12 | pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { |
13 | punct: &[ | 13 | punct: &[ |
14 | (";", "SEMI"), | 14 | (";", "SEMICOLON"), |
15 | (",", "COMMA"), | 15 | (",", "COMMA"), |
16 | ("(", "L_PAREN"), | 16 | ("(", "L_PAREN"), |
17 | (")", "R_PAREN"), | 17 | (")", "R_PAREN"), |
@@ -35,15 +35,15 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | |||
35 | ("%", "PERCENT"), | 35 | ("%", "PERCENT"), |
36 | ("_", "UNDERSCORE"), | 36 | ("_", "UNDERSCORE"), |
37 | (".", "DOT"), | 37 | (".", "DOT"), |
38 | ("..", "DOTDOT"), | 38 | ("..", "DOT2"), |
39 | ("...", "DOTDOTDOT"), | 39 | ("...", "DOT3"), |
40 | ("..=", "DOTDOTEQ"), | 40 | ("..=", "DOT2EQ"), |
41 | (":", "COLON"), | 41 | (":", "COLON"), |
42 | ("::", "COLONCOLON"), | 42 | ("::", "COLON2"), |
43 | ("=", "EQ"), | 43 | ("=", "EQ"), |
44 | ("==", "EQEQ"), | 44 | ("==", "EQ2"), |
45 | ("=>", "FAT_ARROW"), | 45 | ("=>", "FAT_ARROW"), |
46 | ("!", "EXCL"), | 46 | ("!", "BANG"), |
47 | ("!=", "NEQ"), | 47 | ("!=", "NEQ"), |
48 | ("-", "MINUS"), | 48 | ("-", "MINUS"), |
49 | ("->", "THIN_ARROW"), | 49 | ("->", "THIN_ARROW"), |
@@ -57,8 +57,8 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | |||
57 | ("/=", "SLASHEQ"), | 57 | ("/=", "SLASHEQ"), |
58 | ("*=", "STAREQ"), | 58 | ("*=", "STAREQ"), |
59 | ("%=", "PERCENTEQ"), | 59 | ("%=", "PERCENTEQ"), |
60 | ("&&", "AMPAMP"), | 60 | ("&&", "AMP2"), |
61 | ("||", "PIPEPIPE"), | 61 | ("||", "PIPE2"), |
62 | ("<<", "SHL"), | 62 | ("<<", "SHL"), |
63 | (">>", "SHR"), | 63 | (">>", "SHR"), |
64 | ("<<=", "SHLEQ"), | 64 | ("<<=", "SHLEQ"), |
@@ -225,21 +225,26 @@ pub(crate) const KINDS_SRC: KindsSrc = KindsSrc { | |||
225 | }; | 225 | }; |
226 | 226 | ||
227 | pub(crate) struct AstSrc<'a> { | 227 | pub(crate) struct AstSrc<'a> { |
228 | pub(crate) tokens: &'a [&'a str], | ||
228 | pub(crate) nodes: &'a [AstNodeSrc<'a>], | 229 | pub(crate) nodes: &'a [AstNodeSrc<'a>], |
229 | pub(crate) enums: &'a [AstEnumSrc<'a>], | 230 | pub(crate) enums: &'a [AstEnumSrc<'a>], |
230 | pub(crate) token_enums: &'a [AstEnumSrc<'a>], | ||
231 | } | 231 | } |
232 | 232 | ||
233 | pub(crate) struct AstNodeSrc<'a> { | 233 | pub(crate) struct AstNodeSrc<'a> { |
234 | pub(crate) name: &'a str, | 234 | pub(crate) name: &'a str, |
235 | pub(crate) traits: &'a [&'a str], | 235 | pub(crate) traits: &'a [&'a str], |
236 | pub(crate) fields: &'a [(&'a str, FieldSrc<&'a str>)], | 236 | pub(crate) fields: &'a [Field<'a>], |
237 | } | ||
238 | |||
239 | pub(crate) enum Field<'a> { | ||
240 | Token(&'a str), | ||
241 | Node { name: &'a str, src: FieldSrc<'a> }, | ||
237 | } | 242 | } |
238 | 243 | ||
239 | pub(crate) enum FieldSrc<T> { | 244 | pub(crate) enum FieldSrc<'a> { |
240 | Shorthand, | 245 | Shorthand, |
241 | Optional(T), | 246 | Optional(&'a str), |
242 | Many(T), | 247 | Many(&'a str), |
243 | } | 248 | } |
244 | 249 | ||
245 | pub(crate) struct AstEnumSrc<'a> { | 250 | pub(crate) struct AstEnumSrc<'a> { |
@@ -251,31 +256,34 @@ pub(crate) struct AstEnumSrc<'a> { | |||
251 | macro_rules! ast_nodes { | 256 | macro_rules! ast_nodes { |
252 | ($( | 257 | ($( |
253 | struct $name:ident$(: $($trait:ident),*)? { | 258 | struct $name:ident$(: $($trait:ident),*)? { |
254 | $($field_name:ident $(: $ty:tt)?),*$(,)? | 259 | $($field_name:ident $(![$token:tt])? $(: $ty:tt)?),*$(,)? |
255 | } | 260 | } |
256 | )*) => { | 261 | )*) => { |
257 | [$( | 262 | [$( |
258 | AstNodeSrc { | 263 | AstNodeSrc { |
259 | name: stringify!($name), | 264 | name: stringify!($name), |
260 | traits: &[$($(stringify!($trait)),*)?], | 265 | traits: &[$($(stringify!($trait)),*)?], |
261 | fields: &[$( | 266 | fields: &[ |
262 | (stringify!($field_name), field_ty!($field_name $($ty)?)) | 267 | $(field!($(T![$token])? $field_name $($ty)?)),* |
263 | ),*], | 268 | ], |
264 | 269 | ||
265 | } | 270 | } |
266 | ),*] | 271 | ),*] |
267 | }; | 272 | }; |
268 | } | 273 | } |
269 | 274 | ||
270 | macro_rules! field_ty { | 275 | macro_rules! field { |
276 | (T![$token:tt] T) => { | ||
277 | Field::Token(stringify!($token)) | ||
278 | }; | ||
271 | ($field_name:ident) => { | 279 | ($field_name:ident) => { |
272 | FieldSrc::Shorthand | 280 | Field::Node { name: stringify!($field_name), src: FieldSrc::Shorthand } |
273 | }; | 281 | }; |
274 | ($field_name:ident [$ty:ident]) => { | 282 | ($field_name:ident [$ty:ident]) => { |
275 | FieldSrc::Many(stringify!($ty)) | 283 | Field::Node { name: stringify!($field_name), src: FieldSrc::Many(stringify!($ty)) } |
276 | }; | 284 | }; |
277 | ($field_name:ident $ty:ident) => { | 285 | ($field_name:ident $ty:ident) => { |
278 | FieldSrc::Optional(stringify!($ty)) | 286 | Field::Node { name: stringify!($field_name), src: FieldSrc::Optional(stringify!($ty)) } |
279 | }; | 287 | }; |
280 | } | 288 | } |
281 | 289 | ||
@@ -290,331 +298,331 @@ macro_rules! ast_enums { | |||
290 | name: stringify!($name), | 298 | name: stringify!($name), |
291 | traits: &[$($(stringify!($trait)),*)?], | 299 | traits: &[$($(stringify!($trait)),*)?], |
292 | variants: &[$(stringify!($variant)),*], | 300 | variants: &[$(stringify!($variant)),*], |
293 | |||
294 | } | 301 | } |
295 | ),*] | 302 | ),*] |
296 | }; | 303 | }; |
297 | } | 304 | } |
298 | 305 | ||
299 | pub(crate) const AST_SRC: AstSrc = AstSrc { | 306 | pub(crate) const AST_SRC: AstSrc = AstSrc { |
307 | tokens: &["Whitespace", "Comment", "String", "RawString"], | ||
300 | nodes: &ast_nodes! { | 308 | nodes: &ast_nodes! { |
301 | struct SourceFile: ModuleItemOwner, FnDefOwner, AttrsOwner { | 309 | struct SourceFile: ModuleItemOwner, AttrsOwner { |
302 | modules: [Module], | 310 | modules: [Module], |
303 | } | 311 | } |
304 | 312 | ||
305 | struct FnDef: VisibilityOwner, NameOwner, TypeParamsOwner, DocCommentsOwner, AttrsOwner { | 313 | struct FnDef: VisibilityOwner, NameOwner, TypeParamsOwner, DocCommentsOwner, AttrsOwner { |
306 | Abi, | 314 | Abi, |
307 | ConstKw, | 315 | T![const], |
308 | DefaultKw, | 316 | T![default], |
309 | AsyncKw, | 317 | T![async], |
310 | UnsafeKw, | 318 | T![unsafe], |
311 | FnKw, | 319 | T![fn], |
312 | ParamList, | 320 | ParamList, |
313 | RetType, | 321 | RetType, |
314 | body: BlockExpr, | 322 | body: BlockExpr, |
315 | Semi | 323 | T![;] |
316 | } | 324 | } |
317 | 325 | ||
318 | struct RetType { ThinArrow, TypeRef } | 326 | struct RetType { T![->], TypeRef } |
319 | 327 | ||
320 | struct StructDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { | 328 | struct StructDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { |
321 | StructKw, | 329 | T![struct], |
322 | FieldDefList, | 330 | FieldDefList, |
323 | Semi | 331 | T![;] |
324 | } | 332 | } |
325 | 333 | ||
326 | struct UnionDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { | 334 | struct UnionDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { |
327 | UnionKw, | 335 | T![union], |
328 | RecordFieldDefList, | 336 | RecordFieldDefList, |
329 | } | 337 | } |
330 | 338 | ||
331 | struct RecordFieldDefList { LCurly, fields: [RecordFieldDef], RCurly } | 339 | struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] } |
332 | struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } | 340 | struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } |
333 | 341 | ||
334 | struct TupleFieldDefList { LParen, fields: [TupleFieldDef], RParen } | 342 | struct TupleFieldDefList { T!['('], fields: [TupleFieldDef], T![')'] } |
335 | struct TupleFieldDef: VisibilityOwner, AttrsOwner { | 343 | struct TupleFieldDef: VisibilityOwner, AttrsOwner { |
336 | TypeRef, | 344 | TypeRef, |
337 | } | 345 | } |
338 | 346 | ||
339 | struct EnumDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { | 347 | struct EnumDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner { |
340 | EnumKw, | 348 | T![enum], |
341 | variant_list: EnumVariantList, | 349 | variant_list: EnumVariantList, |
342 | } | 350 | } |
343 | struct EnumVariantList { | 351 | struct EnumVariantList { |
344 | LCurly, | 352 | T!['{'], |
345 | variants: [EnumVariant], | 353 | variants: [EnumVariant], |
346 | RCurly | 354 | T!['}'] |
347 | } | 355 | } |
348 | struct EnumVariant: VisibilityOwner, NameOwner, DocCommentsOwner, AttrsOwner { | 356 | struct EnumVariant: VisibilityOwner, NameOwner, DocCommentsOwner, AttrsOwner { |
349 | FieldDefList, | 357 | FieldDefList, |
350 | Eq, | 358 | T![=], |
351 | Expr | 359 | Expr |
352 | } | 360 | } |
353 | 361 | ||
354 | struct TraitDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeParamsOwner, TypeBoundsOwner { | 362 | struct TraitDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeParamsOwner, TypeBoundsOwner { |
355 | UnsafeKw, | 363 | T![unsafe], |
356 | AutoKw, | 364 | T![auto], |
357 | TraitKw, | 365 | T![trait], |
358 | ItemList, | 366 | ItemList, |
359 | } | 367 | } |
360 | 368 | ||
361 | struct Module: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner { | 369 | struct Module: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner { |
362 | ModKw, | 370 | T![mod], |
363 | ItemList, | 371 | ItemList, |
364 | Semi | 372 | T![;] |
365 | } | 373 | } |
366 | 374 | ||
367 | struct ItemList: FnDefOwner, ModuleItemOwner { | 375 | struct ItemList: ModuleItemOwner { |
368 | LCurly, | 376 | T!['{'], |
369 | impl_items: [ImplItem], | 377 | impl_items: [ImplItem], |
370 | RCurly | 378 | T!['}'] |
371 | } | 379 | } |
372 | 380 | ||
373 | struct ConstDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { | 381 | struct ConstDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { |
374 | DefaultKw, | 382 | T![default], |
375 | ConstKw, | 383 | T![const], |
376 | Eq, | 384 | T![=], |
377 | body: Expr, | 385 | body: Expr, |
378 | Semi | 386 | T![;] |
379 | } | 387 | } |
380 | 388 | ||
381 | struct StaticDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { | 389 | struct StaticDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { |
382 | StaticKw, | 390 | T![static], |
383 | MutKw, | 391 | T![mut], |
384 | Eq, | 392 | T![=], |
385 | body: Expr, | 393 | body: Expr, |
386 | Semi | 394 | T![;] |
387 | } | 395 | } |
388 | 396 | ||
389 | struct TypeAliasDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner, TypeBoundsOwner { | 397 | struct TypeAliasDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCommentsOwner, TypeBoundsOwner { |
390 | DefaultKw, | 398 | T![default], |
391 | TypeKw, | 399 | T![type], |
392 | Eq, | 400 | T![=], |
393 | TypeRef, | 401 | TypeRef, |
394 | Semi | 402 | T![;] |
395 | } | 403 | } |
396 | 404 | ||
397 | struct ImplDef: TypeParamsOwner, AttrsOwner { | 405 | struct ImplDef: TypeParamsOwner, AttrsOwner { |
398 | DefaultKw, | 406 | T![default], |
399 | ConstKw, | 407 | T![const], |
400 | UnsafeKw, | 408 | T![unsafe], |
401 | ImplKw, | 409 | T![impl], |
402 | Excl, | 410 | T![!], |
403 | ForKw, | 411 | T![for], |
404 | ItemList, | 412 | ItemList, |
405 | } | 413 | } |
406 | 414 | ||
407 | struct ParenType { LParen, TypeRef, RParen } | 415 | struct ParenType { T!['('], TypeRef, T![')'] } |
408 | struct TupleType { LParen, fields: [TypeRef], RParen } | 416 | struct TupleType { T!['('], fields: [TypeRef], T![')'] } |
409 | struct NeverType { Excl } | 417 | struct NeverType { T![!] } |
410 | struct PathType { Path } | 418 | struct PathType { Path } |
411 | struct PointerType { Star, ConstKw, MutKw, TypeRef } | 419 | struct PointerType { T![*], T![const], T![mut], TypeRef } |
412 | struct ArrayType { LBrack, TypeRef, Semi, Expr, RBrack } | 420 | struct ArrayType { T!['['], TypeRef, T![;], Expr, T![']'] } |
413 | struct SliceType { LBrack, TypeRef, RBrack } | 421 | struct SliceType { T!['['], TypeRef, T![']'] } |
414 | struct ReferenceType { Amp, Lifetime, MutKw, TypeRef } | 422 | struct ReferenceType { T![&], T![lifetime], T![mut], TypeRef } |
415 | struct PlaceholderType { Underscore } | 423 | struct PlaceholderType { T![_] } |
416 | struct FnPointerType { Abi, UnsafeKw, FnKw, ParamList, RetType } | 424 | struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType } |
417 | struct ForType { ForKw, TypeParamList, TypeRef } | 425 | struct ForType { T![for], TypeParamList, TypeRef } |
418 | struct ImplTraitType: TypeBoundsOwner { ImplKw } | 426 | struct ImplTraitType: TypeBoundsOwner { T![impl] } |
419 | struct DynTraitType: TypeBoundsOwner { DynKw } | 427 | struct DynTraitType: TypeBoundsOwner { T![dyn] } |
420 | 428 | ||
421 | struct TupleExpr: AttrsOwner { LParen, exprs: [Expr], RParen } | 429 | struct TupleExpr: AttrsOwner { T!['('], exprs: [Expr], T![')'] } |
422 | struct ArrayExpr: AttrsOwner { LBrack, exprs: [Expr], Semi, RBrack } | 430 | struct ArrayExpr: AttrsOwner { T!['['], exprs: [Expr], T![;], T![']'] } |
423 | struct ParenExpr: AttrsOwner { LParen, Expr, RParen } | 431 | struct ParenExpr: AttrsOwner { T!['('], Expr, T![')'] } |
424 | struct PathExpr { Path } | 432 | struct PathExpr { Path } |
425 | struct LambdaExpr: AttrsOwner { | 433 | struct LambdaExpr: AttrsOwner { |
426 | StaticKw, | 434 | T![static], |
427 | AsyncKw, | 435 | T![async], |
428 | MoveKw, | 436 | T![move], |
429 | ParamList, | 437 | ParamList, |
430 | RetType, | 438 | RetType, |
431 | body: Expr, | 439 | body: Expr, |
432 | } | 440 | } |
433 | struct IfExpr: AttrsOwner { IfKw, Condition } | 441 | struct IfExpr: AttrsOwner { T![if], Condition } |
434 | struct LoopExpr: AttrsOwner, LoopBodyOwner { LoopKw } | 442 | struct LoopExpr: AttrsOwner, LoopBodyOwner { T![loop] } |
435 | struct TryBlockExpr: AttrsOwner { TryKw, body: BlockExpr } | 443 | struct TryBlockExpr: AttrsOwner { T![try], body: BlockExpr } |
436 | struct ForExpr: AttrsOwner, LoopBodyOwner { | 444 | struct ForExpr: AttrsOwner, LoopBodyOwner { |
437 | ForKw, | 445 | T![for], |
438 | Pat, | 446 | Pat, |
439 | InKw, | 447 | T![in], |
440 | iterable: Expr, | 448 | iterable: Expr, |
441 | } | 449 | } |
442 | struct WhileExpr: AttrsOwner, LoopBodyOwner { WhileKw, Condition } | 450 | struct WhileExpr: AttrsOwner, LoopBodyOwner { T![while], Condition } |
443 | struct ContinueExpr: AttrsOwner { ContinueKw, Lifetime } | 451 | struct ContinueExpr: AttrsOwner { T![continue], T![lifetime] } |
444 | struct BreakExpr: AttrsOwner { BreakKw, Lifetime, Expr } | 452 | struct BreakExpr: AttrsOwner { T![break], T![lifetime], Expr } |
445 | struct Label { Lifetime } | 453 | struct Label { T![lifetime] } |
446 | struct BlockExpr: AttrsOwner { Label, UnsafeKw, Block } | 454 | struct BlockExpr: AttrsOwner { Label, T![unsafe], Block } |
447 | struct ReturnExpr: AttrsOwner { Expr } | 455 | struct ReturnExpr: AttrsOwner { Expr } |
448 | struct CallExpr: ArgListOwner { Expr } | 456 | struct CallExpr: ArgListOwner { Expr } |
449 | struct MethodCallExpr: AttrsOwner, ArgListOwner { | 457 | struct MethodCallExpr: AttrsOwner, ArgListOwner { |
450 | Expr, Dot, NameRef, TypeArgList, | 458 | Expr, T![.], NameRef, TypeArgList, |
451 | } | 459 | } |
452 | struct IndexExpr: AttrsOwner { LBrack, RBrack } | 460 | struct IndexExpr: AttrsOwner { T!['['], T![']'] } |
453 | struct FieldExpr: AttrsOwner { Expr, Dot, NameRef } | 461 | struct FieldExpr: AttrsOwner { Expr, T![.], NameRef } |
454 | struct AwaitExpr: AttrsOwner { Expr, Dot, AwaitKw } | 462 | struct AwaitExpr: AttrsOwner { Expr, T![.], T![await] } |
455 | struct TryExpr: AttrsOwner { TryKw, Expr } | 463 | struct TryExpr: AttrsOwner { T![try], Expr } |
456 | struct CastExpr: AttrsOwner { Expr, AsKw, TypeRef } | 464 | struct CastExpr: AttrsOwner { Expr, T![as], TypeRef } |
457 | struct RefExpr: AttrsOwner { Amp, RawKw, MutKw, Expr } | 465 | struct RefExpr: AttrsOwner { T![&], T![raw], T![mut], Expr } |
458 | struct PrefixExpr: AttrsOwner { PrefixOp, Expr } | 466 | struct PrefixExpr: AttrsOwner { /*PrefixOp,*/ Expr } |
459 | struct BoxExpr: AttrsOwner { BoxKw, Expr } | 467 | struct BoxExpr: AttrsOwner { T![box], Expr } |
460 | struct RangeExpr: AttrsOwner { RangeOp } | 468 | struct RangeExpr: AttrsOwner { /*RangeOp*/ } |
461 | struct BinExpr: AttrsOwner { BinOp } | 469 | struct BinExpr: AttrsOwner { /*BinOp*/ } |
462 | struct Literal { LiteralToken } | 470 | struct Literal { /*LiteralToken*/ } |
463 | 471 | ||
464 | struct MatchExpr: AttrsOwner { MatchKw, Expr, MatchArmList } | 472 | struct MatchExpr: AttrsOwner { T![match], Expr, MatchArmList } |
465 | struct MatchArmList: AttrsOwner { LCurly, arms: [MatchArm], RCurly } | 473 | struct MatchArmList: AttrsOwner { T!['{'], arms: [MatchArm], T!['}'] } |
466 | struct MatchArm: AttrsOwner { | 474 | struct MatchArm: AttrsOwner { |
467 | pat: Pat, | 475 | pat: Pat, |
468 | guard: MatchGuard, | 476 | guard: MatchGuard, |
469 | FatArrow, | 477 | T![=>], |
470 | Expr, | 478 | Expr, |
471 | } | 479 | } |
472 | struct MatchGuard { IfKw, Expr } | 480 | struct MatchGuard { T![if], Expr } |
473 | 481 | ||
474 | struct RecordLit { Path, RecordFieldList} | 482 | struct RecordLit { Path, RecordFieldList} |
475 | struct RecordFieldList { | 483 | struct RecordFieldList { |
476 | LCurly, | 484 | T!['{'], |
477 | fields: [RecordField], | 485 | fields: [RecordField], |
478 | Dotdot, | 486 | T![..], |
479 | spread: Expr, | 487 | spread: Expr, |
480 | RCurly | 488 | T!['}'] |
481 | } | 489 | } |
482 | struct RecordField: AttrsOwner { NameRef, Colon, Expr } | 490 | struct RecordField: AttrsOwner { NameRef, T![:], Expr } |
483 | 491 | ||
484 | struct OrPat { pats: [Pat] } | 492 | struct OrPat { pats: [Pat] } |
485 | struct ParenPat { LParen, Pat, RParen } | 493 | struct ParenPat { T!['('], Pat, T![')'] } |
486 | struct RefPat { Amp, MutKw, Pat } | 494 | struct RefPat { T![&], T![mut], Pat } |
487 | struct BoxPat { BoxKw, Pat } | 495 | struct BoxPat { T![box], Pat } |
488 | struct BindPat: AttrsOwner, NameOwner { RefKw, MutKw, At, Pat } | 496 | struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], T![@], Pat } |
489 | struct PlaceholderPat { Underscore } | 497 | struct PlaceholderPat { T![_] } |
490 | struct DotDotPat { Dotdot } | 498 | struct DotDotPat { T![..] } |
491 | struct PathPat { Path } | 499 | struct PathPat { Path } |
492 | struct SlicePat { LBrack, args: [Pat], RBrack } | 500 | struct SlicePat { T!['['], args: [Pat], T![']'] } |
493 | struct RangePat { RangeSeparator } | 501 | struct RangePat { /*RangeSeparator*/ } |
494 | struct LiteralPat { Literal } | 502 | struct LiteralPat { Literal } |
495 | struct MacroPat { MacroCall } | 503 | struct MacroPat { MacroCall } |
496 | 504 | ||
497 | struct RecordPat { RecordFieldPatList, Path } | 505 | struct RecordPat { RecordFieldPatList, Path } |
498 | struct RecordFieldPatList { | 506 | struct RecordFieldPatList { |
499 | LCurly, | 507 | T!['{'], |
500 | pats: [RecordInnerPat], | 508 | pats: [RecordInnerPat], |
501 | record_field_pats: [RecordFieldPat], | 509 | record_field_pats: [RecordFieldPat], |
502 | bind_pats: [BindPat], | 510 | bind_pats: [BindPat], |
503 | Dotdot, | 511 | T![..], |
504 | RCurly | 512 | T!['}'] |
505 | } | 513 | } |
506 | struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat } | 514 | struct RecordFieldPat: AttrsOwner, NameOwner { T![:], Pat } |
507 | 515 | ||
508 | struct TupleStructPat { Path, LParen, args: [Pat], RParen } | 516 | struct TupleStructPat { Path, T!['('], args: [Pat], T![')'] } |
509 | struct TuplePat { LParen, args: [Pat], RParen } | 517 | struct TuplePat { T!['('], args: [Pat], T![')'] } |
510 | 518 | ||
511 | struct Visibility { PubKw, SuperKw, SelfKw, CrateKw } | 519 | struct Visibility { T![pub], T![super], T![self], T![crate] } |
512 | struct Name { Ident } | 520 | struct Name { T![ident] } |
513 | struct NameRef { NameRefToken } | 521 | struct NameRef { /*NameRefToken*/ } |
514 | 522 | ||
515 | struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { | 523 | struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { |
516 | Path, Excl, TokenTree, Semi | 524 | Path, T![!], TokenTree, T![;] |
517 | } | 525 | } |
518 | struct Attr { Pound, Excl, LBrack, Path, Eq, input: AttrInput, RBrack } | 526 | struct Attr { T![#], T![!], T!['['], Path, T![=], input: AttrInput, T![']'] } |
519 | struct TokenTree {} | 527 | struct TokenTree {} |
520 | struct TypeParamList { | 528 | struct TypeParamList { |
521 | LAngle, | 529 | T![<], |
522 | generic_params: [GenericParam], | 530 | generic_params: [GenericParam], |
523 | type_params: [TypeParam], | 531 | type_params: [TypeParam], |
524 | lifetime_params: [LifetimeParam], | 532 | lifetime_params: [LifetimeParam], |
525 | const_params: [ConstParam], | 533 | const_params: [ConstParam], |
526 | RAngle | 534 | T![>] |
527 | } | 535 | } |
528 | struct TypeParam: NameOwner, AttrsOwner, TypeBoundsOwner { | 536 | struct TypeParam: NameOwner, AttrsOwner, TypeBoundsOwner { |
529 | Eq, | 537 | T![=], |
530 | default_type: TypeRef, | 538 | default_type: TypeRef, |
531 | } | 539 | } |
532 | struct ConstParam: NameOwner, AttrsOwner, TypeAscriptionOwner { | 540 | struct ConstParam: NameOwner, AttrsOwner, TypeAscriptionOwner { |
533 | Eq, | 541 | T![=], |
534 | default_val: Expr, | 542 | default_val: Expr, |
535 | } | 543 | } |
536 | struct LifetimeParam: AttrsOwner { Lifetime} | 544 | struct LifetimeParam: AttrsOwner { T![lifetime] } |
537 | struct TypeBound { Lifetime, /* Question, */ ConstKw, /* Question, */ TypeRef} | 545 | struct TypeBound { T![lifetime], /* Question, */ T![const], /* Question, */ TypeRef} |
538 | struct TypeBoundList { bounds: [TypeBound] } | 546 | struct TypeBoundList { bounds: [TypeBound] } |
539 | struct WherePred: TypeBoundsOwner { Lifetime, TypeRef } | 547 | struct WherePred: TypeBoundsOwner { T![lifetime], TypeRef } |
540 | struct WhereClause { WhereKw, predicates: [WherePred] } | 548 | struct WhereClause { T![where], predicates: [WherePred] } |
541 | struct Abi { String } | 549 | struct Abi { /*String*/ } |
542 | struct ExprStmt: AttrsOwner { Expr, Semi } | 550 | struct ExprStmt: AttrsOwner { Expr, T![;] } |
543 | struct LetStmt: AttrsOwner, TypeAscriptionOwner { | 551 | struct LetStmt: AttrsOwner, TypeAscriptionOwner { |
544 | LetKw, | 552 | T![let], |
545 | Pat, | 553 | Pat, |
546 | Eq, | 554 | T![=], |
547 | initializer: Expr, | 555 | initializer: Expr, |
548 | Semi, | 556 | T![;], |
549 | } | 557 | } |
550 | struct Condition { LetKw, Pat, Eq, Expr } | 558 | struct Condition { T![let], Pat, T![=], Expr } |
551 | struct Block: AttrsOwner, ModuleItemOwner { | 559 | struct Block: AttrsOwner, ModuleItemOwner { |
552 | LCurly, | 560 | T!['{'], |
553 | statements: [Stmt], | 561 | statements: [Stmt], |
554 | Expr, | 562 | Expr, |
555 | RCurly, | 563 | T!['}'], |
556 | } | 564 | } |
557 | struct ParamList { | 565 | struct ParamList { |
558 | LParen, | 566 | T!['('], |
559 | SelfParam, | 567 | SelfParam, |
560 | params: [Param], | 568 | params: [Param], |
561 | RParen | 569 | T![')'] |
562 | } | 570 | } |
563 | struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, SelfKw } | 571 | struct SelfParam: TypeAscriptionOwner, AttrsOwner { T![&], T![mut], T![lifetime], T![self] } |
564 | struct Param: TypeAscriptionOwner, AttrsOwner { | 572 | struct Param: TypeAscriptionOwner, AttrsOwner { |
565 | Pat, | 573 | Pat, |
566 | Dotdotdot | 574 | T![...] |
567 | } | 575 | } |
568 | struct UseItem: AttrsOwner, VisibilityOwner { | 576 | struct UseItem: AttrsOwner, VisibilityOwner { |
569 | UseKw, | 577 | T![use], |
570 | UseTree, | 578 | UseTree, |
571 | } | 579 | } |
572 | struct UseTree { | 580 | struct UseTree { |
573 | Path, Star, UseTreeList, Alias | 581 | Path, T![*], UseTreeList, Alias |
574 | } | 582 | } |
575 | struct Alias: NameOwner { AsKw } | 583 | struct Alias: NameOwner { T![as] } |
576 | struct UseTreeList { LCurly, use_trees: [UseTree], RCurly } | 584 | struct UseTreeList { T!['{'], use_trees: [UseTree], T!['}'] } |
577 | struct ExternCrateItem: AttrsOwner, VisibilityOwner { | 585 | struct ExternCrateItem: AttrsOwner, VisibilityOwner { |
578 | ExternKw, CrateKw, NameRef, Alias, | 586 | T![extern], T![crate], NameRef, Alias, |
579 | } | 587 | } |
580 | struct ArgList { | 588 | struct ArgList { |
581 | LParen, | 589 | T!['('], |
582 | args: [Expr], | 590 | args: [Expr], |
583 | RParen | 591 | T![')'] |
584 | } | 592 | } |
585 | struct Path { | 593 | struct Path { |
586 | segment: PathSegment, | 594 | segment: PathSegment, |
587 | qualifier: Path, | 595 | qualifier: Path, |
588 | } | 596 | } |
589 | struct PathSegment { | 597 | struct PathSegment { |
590 | Coloncolon, LAngle, NameRef, TypeArgList, ParamList, RetType, PathType, RAngle | 598 | T![::], T![<], NameRef, TypeArgList, ParamList, RetType, PathType, T![>] |
591 | } | 599 | } |
592 | struct TypeArgList { | 600 | struct TypeArgList { |
593 | Coloncolon, | 601 | T![::], |
594 | LAngle, | 602 | T![<], |
595 | generic_args: [GenericArg], | 603 | generic_args: [GenericArg], |
596 | type_args: [TypeArg], | 604 | type_args: [TypeArg], |
597 | lifetime_args: [LifetimeArg], | 605 | lifetime_args: [LifetimeArg], |
598 | assoc_type_args: [AssocTypeArg], | 606 | assoc_type_args: [AssocTypeArg], |
599 | const_args: [ConstArg], | 607 | const_args: [ConstArg], |
600 | RAngle | 608 | T![>] |
601 | } | 609 | } |
602 | struct TypeArg { TypeRef } | 610 | struct TypeArg { TypeRef } |
603 | struct AssocTypeArg : TypeBoundsOwner { NameRef, Eq, TypeRef } | 611 | struct AssocTypeArg : TypeBoundsOwner { NameRef, T![=], TypeRef } |
604 | struct LifetimeArg { Lifetime } | 612 | struct LifetimeArg { T![lifetime] } |
605 | struct ConstArg { Literal, Eq, BlockExpr } | 613 | struct ConstArg { Literal, T![=], BlockExpr } |
606 | 614 | ||
607 | struct MacroItems: ModuleItemOwner, FnDefOwner { } | 615 | struct MacroItems: ModuleItemOwner{ } |
608 | 616 | ||
609 | struct MacroStmts { | 617 | struct MacroStmts { |
610 | statements: [Stmt], | 618 | statements: [Stmt], |
611 | Expr, | 619 | Expr, |
612 | } | 620 | } |
613 | 621 | ||
614 | struct ExternItemList: FnDefOwner, ModuleItemOwner { | 622 | struct ExternItemList: ModuleItemOwner { |
615 | LCurly, | 623 | T!['{'], |
616 | extern_items: [ExternItem], | 624 | extern_items: [ExternItem], |
617 | RCurly | 625 | T!['}'] |
618 | } | 626 | } |
619 | 627 | ||
620 | struct ExternBlock { | 628 | struct ExternBlock { |
@@ -623,7 +631,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
623 | } | 631 | } |
624 | 632 | ||
625 | struct MetaItem { | 633 | struct MetaItem { |
626 | Path, Eq, AttrInput, nested_meta_items: [MetaItem] | 634 | Path, T![=], AttrInput, nested_meta_items: [MetaItem] |
627 | } | 635 | } |
628 | 636 | ||
629 | struct MacroDef { | 637 | struct MacroDef { |
@@ -760,71 +768,4 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
760 | TupleFieldDefList, | 768 | TupleFieldDefList, |
761 | } | 769 | } |
762 | }, | 770 | }, |
763 | |||
764 | token_enums: &ast_enums! { | ||
765 | enum LeftDelimiter { LParen, LBrack, LCurly } | ||
766 | enum RightDelimiter { RParen, RBrack, RCurly } | ||
767 | enum RangeSeparator { Dotdot, Dotdotdot, Dotdoteq} | ||
768 | |||
769 | enum BinOp { | ||
770 | Pipepipe, | ||
771 | Ampamp, | ||
772 | Eqeq, | ||
773 | Neq, | ||
774 | Lteq, | ||
775 | Gteq, | ||
776 | LAngle, | ||
777 | RAngle, | ||
778 | Plus, | ||
779 | Star, | ||
780 | Minus, | ||
781 | Slash, | ||
782 | Percent, | ||
783 | Shl, | ||
784 | Shr, | ||
785 | Caret, | ||
786 | Pipe, | ||
787 | Amp, | ||
788 | Eq, | ||
789 | Pluseq, | ||
790 | Slasheq, | ||
791 | Stareq, | ||
792 | Percenteq, | ||
793 | Shreq, | ||
794 | Shleq, | ||
795 | Minuseq, | ||
796 | Pipeeq, | ||
797 | Ampeq, | ||
798 | Careteq, | ||
799 | } | ||
800 | |||
801 | enum PrefixOp { | ||
802 | Minus, | ||
803 | Excl, | ||
804 | Star | ||
805 | } | ||
806 | |||
807 | enum RangeOp { | ||
808 | Dotdot, | ||
809 | Dotdoteq | ||
810 | } | ||
811 | |||
812 | enum LiteralToken { | ||
813 | IntNumber, | ||
814 | FloatNumber, | ||
815 | String, | ||
816 | RawString, | ||
817 | TrueKw, | ||
818 | FalseKw, | ||
819 | ByteString, | ||
820 | RawByteString, | ||
821 | Char, | ||
822 | Byte | ||
823 | } | ||
824 | |||
825 | enum NameRefToken { | ||
826 | Ident, | ||
827 | IntNumber | ||
828 | } | ||
829 | }, | ||
830 | }; | 771 | }; |
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index b5594e3a9..ec1f6ad8a 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -3,16 +3,13 @@ | |||
3 | //! Specifically, it generates the `SyntaxKind` enum and a number of newtype | 3 | //! Specifically, it generates the `SyntaxKind` enum and a number of newtype |
4 | //! wrappers around `SyntaxNode` which implement `ra_syntax::AstNode`. | 4 | //! wrappers around `SyntaxNode` which implement `ra_syntax::AstNode`. |
5 | 5 | ||
6 | use std::{ | 6 | use std::collections::HashSet; |
7 | borrow::Cow, | ||
8 | collections::{BTreeSet, HashSet}, | ||
9 | }; | ||
10 | 7 | ||
11 | use proc_macro2::{Punct, Spacing}; | 8 | use proc_macro2::{Punct, Spacing}; |
12 | use quote::{format_ident, quote}; | 9 | use quote::{format_ident, quote}; |
13 | 10 | ||
14 | use crate::{ | 11 | use crate::{ |
15 | ast_src::{AstSrc, FieldSrc, KindsSrc, AST_SRC, KINDS_SRC}, | 12 | ast_src::{AstSrc, Field, FieldSrc, KindsSrc, AST_SRC, KINDS_SRC}, |
16 | codegen::{self, update, Mode}, | 13 | codegen::{self, update, Mode}, |
17 | project_root, Result, | 14 | project_root, Result, |
18 | }; | 15 | }; |
@@ -22,58 +19,31 @@ pub fn generate_syntax(mode: Mode) -> Result<()> { | |||
22 | let syntax_kinds = generate_syntax_kinds(KINDS_SRC)?; | 19 | let syntax_kinds = generate_syntax_kinds(KINDS_SRC)?; |
23 | update(syntax_kinds_file.as_path(), &syntax_kinds, mode)?; | 20 | update(syntax_kinds_file.as_path(), &syntax_kinds, mode)?; |
24 | 21 | ||
22 | let ast_tokens_file = project_root().join(codegen::AST_TOKENS); | ||
23 | let contents = generate_tokens(AST_SRC)?; | ||
24 | update(ast_tokens_file.as_path(), &contents, mode)?; | ||
25 | |||
25 | let ast_nodes_file = project_root().join(codegen::AST_NODES); | 26 | let ast_nodes_file = project_root().join(codegen::AST_NODES); |
26 | let contents = generate_nodes(KINDS_SRC, AST_SRC)?; | 27 | let contents = generate_nodes(KINDS_SRC, AST_SRC)?; |
27 | update(ast_nodes_file.as_path(), &contents, mode)?; | 28 | update(ast_nodes_file.as_path(), &contents, mode)?; |
28 | 29 | ||
29 | let ast_tokens_file = project_root().join(codegen::AST_TOKENS); | ||
30 | let contents = generate_tokens(KINDS_SRC, AST_SRC)?; | ||
31 | update(ast_tokens_file.as_path(), &contents, mode)?; | ||
32 | |||
33 | Ok(()) | 30 | Ok(()) |
34 | } | 31 | } |
35 | 32 | ||
36 | #[derive(Debug, Default, Clone)] | 33 | fn generate_tokens(grammar: AstSrc<'_>) -> Result<String> { |
37 | struct ElementKinds { | 34 | let tokens = grammar.tokens.iter().map(|token| { |
38 | kinds: BTreeSet<proc_macro2::Ident>, | 35 | let name = format_ident!("{}", token); |
39 | has_nodes: bool, | 36 | let kind = format_ident!("{}", to_upper_snake_case(token)); |
40 | has_tokens: bool, | ||
41 | } | ||
42 | |||
43 | fn generate_tokens(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { | ||
44 | let all_token_kinds: Vec<_> = kinds | ||
45 | .punct | ||
46 | .into_iter() | ||
47 | .map(|(_, kind)| kind) | ||
48 | .copied() | ||
49 | .map(|x| x.into()) | ||
50 | .chain( | ||
51 | kinds | ||
52 | .keywords | ||
53 | .into_iter() | ||
54 | .chain(kinds.contextual_keywords.into_iter()) | ||
55 | .map(|name| Cow::Owned(format!("{}_KW", to_upper_snake_case(&name)))), | ||
56 | ) | ||
57 | .chain(kinds.literals.into_iter().copied().map(|x| x.into())) | ||
58 | .chain(kinds.tokens.into_iter().copied().map(|x| x.into())) | ||
59 | .collect(); | ||
60 | |||
61 | let tokens = all_token_kinds.iter().map(|kind_str| { | ||
62 | let kind_str = &**kind_str; | ||
63 | let kind = format_ident!("{}", kind_str); | ||
64 | let name = format_ident!("{}", to_pascal_case(kind_str)); | ||
65 | quote! { | 37 | quote! { |
66 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 38 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
67 | pub struct #name { | 39 | pub struct #name { |
68 | pub(crate) syntax: SyntaxToken, | 40 | pub(crate) syntax: SyntaxToken, |
69 | } | 41 | } |
70 | |||
71 | impl std::fmt::Display for #name { | 42 | impl std::fmt::Display for #name { |
72 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 43 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |
73 | std::fmt::Display::fmt(&self.syntax, f) | 44 | std::fmt::Display::fmt(&self.syntax, f) |
74 | } | 45 | } |
75 | } | 46 | } |
76 | |||
77 | impl AstToken for #name { | 47 | impl AstToken for #name { |
78 | fn can_cast(kind: SyntaxKind) -> bool { kind == #kind } | 48 | fn can_cast(kind: SyntaxKind) -> bool { kind == #kind } |
79 | fn cast(syntax: SyntaxToken) -> Option<Self> { | 49 | fn cast(syntax: SyntaxToken) -> Option<Self> { |
@@ -84,99 +54,15 @@ fn generate_tokens(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { | |||
84 | } | 54 | } |
85 | }); | 55 | }); |
86 | 56 | ||
87 | let enums = grammar.token_enums.iter().map(|en| { | 57 | let pretty = crate::reformat(quote! { |
88 | let variants = en.variants.iter().map(|var| format_ident!("{}", var)).collect::<Vec<_>>(); | 58 | use crate::{SyntaxKind::{self, *}, SyntaxToken, ast::AstToken}; |
89 | let name = format_ident!("{}", en.name); | ||
90 | let kinds = variants | ||
91 | .iter() | ||
92 | .map(|name| format_ident!("{}", to_upper_snake_case(&name.to_string()))) | ||
93 | .collect::<Vec<_>>(); | ||
94 | assert!(en.traits.is_empty()); | ||
95 | |||
96 | quote! { | ||
97 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
98 | pub enum #name { | ||
99 | #(#variants(#variants),)* | ||
100 | } | ||
101 | |||
102 | #( | ||
103 | impl From<#variants> for #name { | ||
104 | fn from(node: #variants) -> #name { | ||
105 | #name::#variants(node) | ||
106 | } | ||
107 | } | ||
108 | )* | ||
109 | |||
110 | impl std::fmt::Display for #name { | ||
111 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||
112 | std::fmt::Display::fmt(self.syntax(), f) | ||
113 | } | ||
114 | } | ||
115 | |||
116 | impl AstToken for #name { | ||
117 | fn can_cast(kind: SyntaxKind) -> bool { | ||
118 | match kind { | ||
119 | #(#kinds)|* => true, | ||
120 | _ => false, | ||
121 | } | ||
122 | } | ||
123 | fn cast(syntax: SyntaxToken) -> Option<Self> { | ||
124 | let res = match syntax.kind() { | ||
125 | #( | ||
126 | #kinds => #name::#variants(#variants { syntax }), | ||
127 | )* | ||
128 | _ => return None, | ||
129 | }; | ||
130 | Some(res) | ||
131 | } | ||
132 | fn syntax(&self) -> &SyntaxToken { | ||
133 | match self { | ||
134 | #( | ||
135 | #name::#variants(it) => &it.syntax, | ||
136 | )* | ||
137 | } | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | }); | ||
142 | |||
143 | crate::reformat(quote! { | ||
144 | use crate::{SyntaxToken, SyntaxKind::{self, *}, ast::AstToken}; | ||
145 | |||
146 | #(#tokens)* | 59 | #(#tokens)* |
147 | #(#enums)* | 60 | })? |
148 | }) | 61 | .replace("#[derive", "\n#[derive"); |
62 | Ok(pretty) | ||
149 | } | 63 | } |
150 | 64 | ||
151 | fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { | 65 | fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { |
152 | let all_token_kinds: Vec<_> = kinds | ||
153 | .punct | ||
154 | .into_iter() | ||
155 | .map(|(_, kind)| kind) | ||
156 | .copied() | ||
157 | .map(|x| x.into()) | ||
158 | .chain( | ||
159 | kinds | ||
160 | .keywords | ||
161 | .into_iter() | ||
162 | .chain(kinds.contextual_keywords.into_iter()) | ||
163 | .map(|name| Cow::Owned(format!("{}_KW", to_upper_snake_case(&name)))), | ||
164 | ) | ||
165 | .chain(kinds.literals.into_iter().copied().map(|x| x.into())) | ||
166 | .chain(kinds.tokens.into_iter().copied().map(|x| x.into())) | ||
167 | .collect(); | ||
168 | |||
169 | let mut token_kinds = HashSet::new(); | ||
170 | for kind in &all_token_kinds { | ||
171 | let kind = &**kind; | ||
172 | let name = to_pascal_case(kind); | ||
173 | token_kinds.insert(name); | ||
174 | } | ||
175 | |||
176 | for en in grammar.token_enums { | ||
177 | token_kinds.insert(en.name.to_string()); | ||
178 | } | ||
179 | |||
180 | let nodes = grammar.nodes.iter().map(|node| { | 66 | let nodes = grammar.nodes.iter().map(|node| { |
181 | let name = format_ident!("{}", node.name); | 67 | let name = format_ident!("{}", node.name); |
182 | let kind = format_ident!("{}", to_upper_snake_case(&name.to_string())); | 68 | let kind = format_ident!("{}", to_upper_snake_case(&name.to_string())); |
@@ -185,40 +71,27 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { | |||
185 | quote!(impl ast::#trait_name for #name {}) | 71 | quote!(impl ast::#trait_name for #name {}) |
186 | }); | 72 | }); |
187 | 73 | ||
188 | let methods = node.fields.iter().map(|(name, field)| { | 74 | let methods = node.fields.iter().map(|field| { |
189 | let method_name = match field { | 75 | let method_name = field.method_name(); |
190 | FieldSrc::Shorthand => format_ident!("{}", to_lower_snake_case(&name)), | 76 | let ty = field.ty(); |
191 | _ => format_ident!("{}", name), | ||
192 | }; | ||
193 | let ty = match field { | ||
194 | FieldSrc::Optional(ty) | FieldSrc::Many(ty) => ty, | ||
195 | FieldSrc::Shorthand => name, | ||
196 | }; | ||
197 | 77 | ||
198 | let ty = format_ident!("{}", ty); | 78 | if field.is_many() { |
199 | 79 | quote! { | |
200 | match field { | 80 | pub fn #method_name(&self) -> AstChildren<#ty> { |
201 | FieldSrc::Many(_) => { | 81 | support::children(&self.syntax) |
202 | quote! { | ||
203 | pub fn #method_name(&self) -> AstChildren<#ty> { | ||
204 | support::children(&self.syntax) | ||
205 | } | ||
206 | } | 82 | } |
207 | } | 83 | } |
208 | FieldSrc::Optional(_) | FieldSrc::Shorthand => { | 84 | } else { |
209 | let is_token = token_kinds.contains(&ty.to_string()); | 85 | if let Some(token_kind) = field.token_kind() { |
210 | if is_token { | 86 | quote! { |
211 | let method_name = format_ident!("{}_token", method_name); | 87 | pub fn #method_name(&self) -> Option<#ty> { |
212 | quote! { | 88 | support::token(&self.syntax, #token_kind) |
213 | pub fn #method_name(&self) -> Option<#ty> { | ||
214 | support::token(&self.syntax) | ||
215 | } | ||
216 | } | 89 | } |
217 | } else { | 90 | } |
218 | quote! { | 91 | } else { |
219 | pub fn #method_name(&self) -> Option<#ty> { | 92 | quote! { |
220 | support::child(&self.syntax) | 93 | pub fn #method_name(&self) -> Option<#ty> { |
221 | } | 94 | support::child(&self.syntax) |
222 | } | 95 | } |
223 | } | 96 | } |
224 | } | 97 | } |
@@ -332,18 +205,18 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> { | |||
332 | 205 | ||
333 | let ast = quote! { | 206 | let ast = quote! { |
334 | use crate::{ | 207 | use crate::{ |
335 | SyntaxNode, SyntaxKind::{self, *}, | 208 | SyntaxNode, SyntaxToken, SyntaxKind::{self, *}, |
336 | ast::{self, AstNode, AstChildren, support}, | 209 | ast::{self, AstNode, AstChildren, support}, |
210 | T, | ||
337 | }; | 211 | }; |
338 | 212 | ||
339 | use super::tokens::*; | ||
340 | |||
341 | #(#nodes)* | 213 | #(#nodes)* |
342 | #(#enums)* | 214 | #(#enums)* |
343 | #(#displays)* | 215 | #(#displays)* |
344 | }; | 216 | }; |
345 | 217 | ||
346 | let pretty = crate::reformat(ast)?; | 218 | let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])"); |
219 | let pretty = crate::reformat(ast)?.replace("#[derive", "\n#[derive"); | ||
347 | Ok(pretty) | 220 | Ok(pretty) |
348 | } | 221 | } |
349 | 222 | ||
@@ -451,8 +324,10 @@ fn generate_syntax_kinds(grammar: KindsSrc<'_>) -> Result<String> { | |||
451 | 324 | ||
452 | #[macro_export] | 325 | #[macro_export] |
453 | macro_rules! T { | 326 | macro_rules! T { |
454 | #((#punctuation_values) => { $crate::SyntaxKind::#punctuation };)* | 327 | #([#punctuation_values] => { $crate::SyntaxKind::#punctuation };)* |
455 | #((#all_keywords_idents) => { $crate::SyntaxKind::#all_keywords };)* | 328 | #([#all_keywords_idents] => { $crate::SyntaxKind::#all_keywords };)* |
329 | [lifetime] => { $crate::SyntaxKind::LIFETIME }; | ||
330 | [ident] => { $crate::SyntaxKind::IDENT }; | ||
456 | } | 331 | } |
457 | }; | 332 | }; |
458 | 333 | ||
@@ -502,3 +377,68 @@ fn to_pascal_case(s: &str) -> String { | |||
502 | } | 377 | } |
503 | buf | 378 | buf |
504 | } | 379 | } |
380 | |||
381 | impl Field<'_> { | ||
382 | fn is_many(&self) -> bool { | ||
383 | match self { | ||
384 | Field::Node { src: FieldSrc::Many(_), .. } => true, | ||
385 | _ => false, | ||
386 | } | ||
387 | } | ||
388 | fn token_kind(&self) -> Option<proc_macro2::TokenStream> { | ||
389 | let res = match self { | ||
390 | Field::Token(token) => { | ||
391 | let token: proc_macro2::TokenStream = token.parse().unwrap(); | ||
392 | quote! { T![#token] } | ||
393 | } | ||
394 | _ => return None, | ||
395 | }; | ||
396 | Some(res) | ||
397 | } | ||
398 | fn method_name(&self) -> proc_macro2::Ident { | ||
399 | match self { | ||
400 | Field::Token(name) => { | ||
401 | let name = match *name { | ||
402 | ";" => "semicolon", | ||
403 | "->" => "thin_arrow", | ||
404 | "'{'" => "l_curly", | ||
405 | "'}'" => "r_curly", | ||
406 | "'('" => "l_paren", | ||
407 | "')'" => "r_paren", | ||
408 | "'['" => "l_brack", | ||
409 | "']'" => "r_brack", | ||
410 | "<" => "l_angle", | ||
411 | ">" => "r_angle", | ||
412 | "=" => "eq", | ||
413 | "!" => "excl", | ||
414 | "*" => "star", | ||
415 | "&" => "amp", | ||
416 | "_" => "underscore", | ||
417 | "." => "dot", | ||
418 | ".." => "dotdot", | ||
419 | "..." => "dotdotdot", | ||
420 | "=>" => "fat_arrow", | ||
421 | "@" => "at", | ||
422 | ":" => "colon", | ||
423 | "::" => "coloncolon", | ||
424 | "#" => "pound", | ||
425 | _ => name, | ||
426 | }; | ||
427 | format_ident!("{}_token", name) | ||
428 | } | ||
429 | Field::Node { name, src } => match src { | ||
430 | FieldSrc::Shorthand => format_ident!("{}", to_lower_snake_case(name)), | ||
431 | _ => format_ident!("{}", name), | ||
432 | }, | ||
433 | } | ||
434 | } | ||
435 | fn ty(&self) -> proc_macro2::Ident { | ||
436 | match self { | ||
437 | Field::Token(_) => format_ident!("SyntaxToken"), | ||
438 | Field::Node { name, src } => match src { | ||
439 | FieldSrc::Optional(ty) | FieldSrc::Many(ty) => format_ident!("{}", ty), | ||
440 | FieldSrc::Shorthand => format_ident!("{}", name), | ||
441 | }, | ||
442 | } | ||
443 | } | ||
444 | } | ||