From b1d5817dd18b7b5fc102a63b084b1ee7ff4f9996 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 23:40:41 +0200 Subject: [PATCH 1/5] Convert code to text-size --- Cargo.lock | 16 +-- crates/ra_assists/src/assist_ctx.rs | 8 +- .../src/handlers/add_custom_impl.rs | 8 +- crates/ra_assists/src/handlers/add_derive.rs | 8 +- .../src/handlers/add_explicit_type.rs | 4 +- .../src/handlers/add_from_impl_for_enum.rs | 4 +- .../ra_assists/src/handlers/add_function.rs | 8 +- crates/ra_assists/src/handlers/add_impl.rs | 4 +- crates/ra_assists/src/handlers/add_new.rs | 8 +- .../ra_assists/src/handlers/apply_demorgan.rs | 2 +- .../src/handlers/change_visibility.rs | 4 +- .../ra_assists/src/handlers/flip_binexpr.rs | 2 +- .../src/handlers/inline_local_variable.rs | 2 +- .../src/handlers/introduce_variable.rs | 6 +- crates/ra_assists/src/handlers/invert_if.rs | 2 +- .../src/handlers/merge_match_arms.rs | 10 +- crates/ra_assists/src/handlers/move_guard.rs | 10 +- crates/ra_assists/src/handlers/raw_string.rs | 4 +- crates/ra_assists/src/handlers/remove_dbg.rs | 8 +- crates/ra_assists/src/handlers/remove_mut.rs | 2 +- .../replace_qualified_name_with_use.rs | 2 +- crates/ra_assists/src/lib.rs | 6 +- crates/ra_db/src/lib.rs | 4 +- crates/ra_hir/src/semantics.rs | 18 +-- crates/ra_hir/src/source_analyzer.rs | 18 +-- crates/ra_hir_expand/src/builtin_macro.rs | 4 +- crates/ra_hir_expand/src/lib.rs | 4 +- crates/ra_hir_ty/src/tests.rs | 4 +- crates/ra_ide/src/call_info.rs | 2 +- .../ra_ide/src/completion/complete_keyword.rs | 2 +- .../ra_ide/src/completion/complete_postfix.rs | 6 +- .../src/completion/complete_trait_impl.rs | 8 +- .../src/completion/completion_context.rs | 13 ++- crates/ra_ide/src/diagnostics.rs | 2 +- crates/ra_ide/src/extend_selection.rs | 42 +++---- crates/ra_ide/src/folding_ranges.rs | 4 +- crates/ra_ide/src/hover.rs | 2 +- crates/ra_ide/src/join_lines.rs | 38 +++--- crates/ra_ide/src/lib.rs | 4 +- crates/ra_ide/src/matching_brace.rs | 4 +- crates/ra_ide/src/references/rename.rs | 4 +- crates/ra_ide/src/source_change.rs | 4 +- crates/ra_ide/src/syntax_highlighting.rs | 12 +- crates/ra_ide/src/syntax_highlighting/html.rs | 11 +- crates/ra_ide/src/syntax_tree.rs | 8 +- crates/ra_ide/src/test_utils.rs | 4 +- crates/ra_ide/src/typing.rs | 20 ++-- crates/ra_ide/src/typing/on_enter.rs | 6 +- crates/ra_ide_db/src/line_index.rs | 54 ++++----- crates/ra_ide_db/src/line_index_utils.rs | 48 ++++---- crates/ra_ide_db/src/search.rs | 9 +- crates/ra_mbe/src/syntax_bridge.rs | 69 ++++++----- crates/ra_syntax/Cargo.toml | 2 +- crates/ra_syntax/src/algo.rs | 12 +- crates/ra_syntax/src/ast/tokens.rs | 32 +++--- crates/ra_syntax/src/fuzz.rs | 8 +- crates/ra_syntax/src/lib.rs | 4 +- crates/ra_syntax/src/parsing/lexer.rs | 18 +-- crates/ra_syntax/src/parsing/reparsing.rs | 4 +- .../src/parsing/text_token_source.rs | 8 +- .../ra_syntax/src/parsing/text_tree_sink.rs | 14 +-- crates/ra_syntax/src/ptr.rs | 2 +- crates/ra_syntax/src/syntax_error.rs | 6 +- crates/ra_syntax/src/syntax_node.rs | 4 +- crates/ra_syntax/src/tests.rs | 8 +- crates/ra_syntax/src/validation.rs | 4 +- crates/ra_text_edit/Cargo.toml | 3 +- crates/ra_text_edit/src/lib.rs | 10 +- crates/ra_text_edit/src/text_edit.rs | 25 ++-- .../rust-analyzer/src/cli/analysis_stats.rs | 2 +- crates/rust-analyzer/src/conv.rs | 18 +-- .../rust-analyzer/src/main_loop/handlers.rs | 18 +-- crates/test_utils/Cargo.toml | 2 +- crates/test_utils/src/lib.rs | 26 ++--- docs/dev/syntax.md | 108 +++++++++--------- 75 files changed, 438 insertions(+), 456 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d966ebe61a..70dfa019d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1180,7 +1180,7 @@ dependencies = [ name = "ra_text_edit" version = "0.1.0" dependencies = [ - "text_unit", + "text-size", ] [[package]] @@ -1322,13 +1322,11 @@ dependencies = [ [[package]] name = "rowan" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea7cadf87a9d8432e85cb4eb86bd2e765ace60c24ef86e79084dcae5d1c5a19" +version = "0.10.0-pre.1" dependencies = [ "rustc-hash", "smol_str", - "text_unit", + "text-size", "thin-dst", ] @@ -1620,14 +1618,12 @@ version = "0.1.0" dependencies = [ "difference", "serde_json", - "text_unit", + "text-size", ] [[package]] -name = "text_unit" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20431e104bfecc1a40872578dbc390e10290a0e9c35fffe3ce6f73c15a9dbfc2" +name = "text-size" +version = "1.0.0-pre.1" [[package]] name = "thin-dst" diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index 2791632576..2fe7c3de3d 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs @@ -5,7 +5,7 @@ use ra_fmt::{leading_indent, reindent}; use ra_ide_db::RootDatabase; use ra_syntax::{ algo::{self, find_covering_element, find_node_at_offset}, - AstNode, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextUnit, + AstNode, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize, TokenAtOffset, }; use ra_text_edit::TextEditBuilder; @@ -178,7 +178,7 @@ impl<'a> AssistGroup<'a> { #[derive(Default)] pub(crate) struct ActionBuilder { edit: TextEditBuilder, - cursor_position: Option, + cursor_position: Option, target: Option, file: AssistFile, } @@ -211,12 +211,12 @@ impl ActionBuilder { } /// Append specified `text` at the given `offset` - pub(crate) fn insert(&mut self, offset: TextUnit, text: impl Into) { + pub(crate) fn insert(&mut self, offset: TextSize, text: impl Into) { self.edit.insert(offset, text.into()) } /// Specify desired position of the cursor after the assist is applied. - pub(crate) fn set_cursor(&mut self, offset: TextUnit) { + pub(crate) fn set_cursor(&mut self, offset: TextSize) { self.cursor_position = Some(offset) } diff --git a/crates/ra_assists/src/handlers/add_custom_impl.rs b/crates/ra_assists/src/handlers/add_custom_impl.rs index 15f9b216b6..7bb90dba35 100644 --- a/crates/ra_assists/src/handlers/add_custom_impl.rs +++ b/crates/ra_assists/src/handlers/add_custom_impl.rs @@ -2,7 +2,7 @@ use ra_syntax::{ ast::{self, AstNode}, Direction, SmolStr, SyntaxKind::{IDENT, WHITESPACE}, - TextRange, TextUnit, + TextRange, TextSize, }; use stdx::SepBy; @@ -71,7 +71,7 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option { let cursor_delta = if has_more_derives { edit.replace(input.syntax().text_range(), new_attr_input); - input.syntax().text_range().len() - TextUnit::from_usize(new_attr_input_len) + input.syntax().text_range().len() - TextSize::from_usize(new_attr_input_len) } else { let attr_range = attr.syntax().text_range(); edit.delete(attr_range); @@ -81,13 +81,13 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option { .next_sibling_or_token() .filter(|t| t.kind() == WHITESPACE) .map(|t| t.text_range()) - .unwrap_or_else(|| TextRange::from_to(TextUnit::from(0), TextUnit::from(0))); + .unwrap_or_else(|| TextRange::new(TextSize::from(0), TextSize::from(0))); edit.delete(line_break_range); attr_range.len() + line_break_range.len() }; - edit.set_cursor(start_offset + TextUnit::of_str(&buf) - cursor_delta); + edit.set_cursor(start_offset + TextSize::of(&buf) - cursor_delta); buf.push_str("\n}"); edit.insert(start_offset, buf); }) diff --git a/crates/ra_assists/src/handlers/add_derive.rs b/crates/ra_assists/src/handlers/add_derive.rs index b0d1a0a80d..6254eb7c41 100644 --- a/crates/ra_assists/src/handlers/add_derive.rs +++ b/crates/ra_assists/src/handlers/add_derive.rs @@ -1,7 +1,7 @@ use ra_syntax::{ ast::{self, AstNode, AttrsOwner}, SyntaxKind::{COMMENT, WHITESPACE}, - TextUnit, + TextSize, }; use crate::{Assist, AssistCtx, AssistId}; @@ -37,9 +37,9 @@ pub(crate) fn add_derive(ctx: AssistCtx) -> Option { let offset = match derive_attr { None => { edit.insert(node_start, "#[derive()]\n"); - node_start + TextUnit::of_str("#[derive(") + node_start + TextSize::of("#[derive(") } - Some(tt) => tt.syntax().text_range().end() - TextUnit::of_char(')'), + Some(tt) => tt.syntax().text_range().end() - TextSize::of(')'), }; edit.target(nominal.syntax().text_range()); edit.set_cursor(offset) @@ -47,7 +47,7 @@ pub(crate) fn add_derive(ctx: AssistCtx) -> Option { } // Insert `derive` after doc comments. -fn derive_insertion_offset(nominal: &ast::NominalDef) -> Option { +fn derive_insertion_offset(nominal: &ast::NominalDef) -> Option { let non_ws_child = nominal .syntax() .children_with_tokens() diff --git a/crates/ra_assists/src/handlers/add_explicit_type.rs b/crates/ra_assists/src/handlers/add_explicit_type.rs index 6c56d93d87..bc313782be 100644 --- a/crates/ra_assists/src/handlers/add_explicit_type.rs +++ b/crates/ra_assists/src/handlers/add_explicit_type.rs @@ -37,8 +37,8 @@ pub(crate) fn add_explicit_type(ctx: AssistCtx) -> Option { let stmt_range = stmt.syntax().text_range(); let eq_range = stmt.eq_token()?.text_range(); // Assist should only be applicable if cursor is between 'let' and '=' - let let_range = TextRange::from_to(stmt_range.start(), eq_range.start()); - let cursor_in_range = ctx.frange.range.is_subrange(&let_range); + let let_range = TextRange::new(stmt_range.start(), eq_range.start()); + let cursor_in_range = let_range.contains_range(ctx.frange.range); if !cursor_in_range { return None; } diff --git a/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs b/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs index 0621487e8f..03806724a3 100644 --- a/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs +++ b/crates/ra_assists/src/handlers/add_from_impl_for_enum.rs @@ -1,6 +1,6 @@ use ra_syntax::{ ast::{self, AstNode, NameOwner}, - TextUnit, + TextSize, }; use stdx::format_to; @@ -65,7 +65,7 @@ impl From<{0}> for {1} {{ variant_name ); edit.insert(start_offset, buf); - edit.set_cursor(start_offset + TextUnit::of_str("\n\n")); + edit.set_cursor(start_offset + TextSize::of("\n\n")); }, ) } diff --git a/crates/ra_assists/src/handlers/add_function.rs b/crates/ra_assists/src/handlers/add_function.rs index f185cffdb7..7a8f5705f4 100644 --- a/crates/ra_assists/src/handlers/add_function.rs +++ b/crates/ra_assists/src/handlers/add_function.rs @@ -1,6 +1,6 @@ use ra_syntax::{ ast::{self, AstNode}, - SyntaxKind, SyntaxNode, TextUnit, + SyntaxKind, SyntaxNode, TextSize, }; use crate::{Assist, AssistCtx, AssistFile, AssistId}; @@ -69,8 +69,8 @@ pub(crate) fn add_function(ctx: AssistCtx) -> Option { } struct FunctionTemplate { - insert_offset: TextUnit, - cursor_offset: TextUnit, + insert_offset: TextSize, + cursor_offset: TextSize, fn_def: ast::SourceFile, file: AssistFile, } @@ -129,7 +129,7 @@ impl FunctionBuilder { let fn_def = indent_once.increase_indent(fn_def); let fn_def = ast::make::add_trailing_newlines(1, fn_def); let fn_def = indent.increase_indent(fn_def); - (fn_def, it.syntax().text_range().start() + TextUnit::from_usize(1)) + (fn_def, it.syntax().text_range().start() + TextSize::from_usize(1)) } }; diff --git a/crates/ra_assists/src/handlers/add_impl.rs b/crates/ra_assists/src/handlers/add_impl.rs index 6622eadb2d..d26f8b93da 100644 --- a/crates/ra_assists/src/handlers/add_impl.rs +++ b/crates/ra_assists/src/handlers/add_impl.rs @@ -1,6 +1,6 @@ use ra_syntax::{ ast::{self, AstNode, NameOwner, TypeParamsOwner}, - TextUnit, + TextSize, }; use stdx::{format_to, SepBy}; @@ -51,7 +51,7 @@ pub(crate) fn add_impl(ctx: AssistCtx) -> Option { format_to!(buf, "<{}>", generic_params) } buf.push_str(" {\n"); - edit.set_cursor(start_offset + TextUnit::of_str(&buf)); + edit.set_cursor(start_offset + TextSize::of(&buf)); buf.push_str("\n}"); edit.insert(start_offset, buf); }) diff --git a/crates/ra_assists/src/handlers/add_new.rs b/crates/ra_assists/src/handlers/add_new.rs index 240b19fa37..0698cce88a 100644 --- a/crates/ra_assists/src/handlers/add_new.rs +++ b/crates/ra_assists/src/handlers/add_new.rs @@ -3,7 +3,7 @@ use ra_syntax::{ ast::{ self, AstNode, NameOwner, StructKind, TypeAscriptionOwner, TypeParamsOwner, VisibilityOwner, }, - TextUnit, T, + TextSize, T, }; use stdx::{format_to, SepBy}; @@ -77,16 +77,16 @@ pub(crate) fn add_new(ctx: AssistCtx) -> Option { .text_range() .end(); - Some((start, TextUnit::from_usize(1))) + Some((start, TextSize::from_usize(1))) }) .unwrap_or_else(|| { buf = generate_impl_text(&strukt, &buf); let start = strukt.syntax().text_range().end(); - (start, TextUnit::from_usize(3)) + (start, TextSize::from_usize(3)) }); - edit.set_cursor(start_offset + TextUnit::of_str(&buf) - end_offset); + edit.set_cursor(start_offset + TextSize::of(&buf) - end_offset); edit.insert(start_offset, buf); }) } diff --git a/crates/ra_assists/src/handlers/apply_demorgan.rs b/crates/ra_assists/src/handlers/apply_demorgan.rs index 239807e243..260b9e0732 100644 --- a/crates/ra_assists/src/handlers/apply_demorgan.rs +++ b/crates/ra_assists/src/handlers/apply_demorgan.rs @@ -26,7 +26,7 @@ pub(crate) fn apply_demorgan(ctx: AssistCtx) -> Option { let op = expr.op_kind()?; let op_range = expr.op_token()?.text_range(); let opposite_op = opposite_logic_op(op)?; - let cursor_in_range = ctx.frange.range.is_subrange(&op_range); + let cursor_in_range = op_range.contains_range(ctx.frange.range); if !cursor_in_range { return None; } diff --git a/crates/ra_assists/src/handlers/change_visibility.rs b/crates/ra_assists/src/handlers/change_visibility.rs index cd6d1ee6c3..44f6a1dae0 100644 --- a/crates/ra_assists/src/handlers/change_visibility.rs +++ b/crates/ra_assists/src/handlers/change_visibility.rs @@ -5,7 +5,7 @@ use ra_syntax::{ ATTR, COMMENT, CONST_DEF, ENUM_DEF, FN_DEF, MODULE, STRUCT_DEF, TRAIT_DEF, VISIBILITY, WHITESPACE, }, - SyntaxNode, TextUnit, T, + SyntaxNode, TextSize, T, }; use crate::{Assist, AssistCtx, AssistId}; @@ -67,7 +67,7 @@ fn add_vis(ctx: AssistCtx) -> Option { }) } -fn vis_offset(node: &SyntaxNode) -> TextUnit { +fn vis_offset(node: &SyntaxNode) -> TextSize { node.children_with_tokens() .skip_while(|it| match it.kind() { WHITESPACE | COMMENT | ATTR => true, diff --git a/crates/ra_assists/src/handlers/flip_binexpr.rs b/crates/ra_assists/src/handlers/flip_binexpr.rs index bfcc09e909..8030efb358 100644 --- a/crates/ra_assists/src/handlers/flip_binexpr.rs +++ b/crates/ra_assists/src/handlers/flip_binexpr.rs @@ -23,7 +23,7 @@ pub(crate) fn flip_binexpr(ctx: AssistCtx) -> Option { let rhs = expr.rhs()?.syntax().clone(); let op_range = expr.op_token()?.text_range(); // The assist should be applied only if the cursor is on the operator - let cursor_in_range = ctx.frange.range.is_subrange(&op_range); + let cursor_in_range = op_range.contains_range(ctx.frange.range); if !cursor_in_range { return None; } diff --git a/crates/ra_assists/src/handlers/inline_local_variable.rs b/crates/ra_assists/src/handlers/inline_local_variable.rs index c4fb425b07..f5702f6e0c 100644 --- a/crates/ra_assists/src/handlers/inline_local_variable.rs +++ b/crates/ra_assists/src/handlers/inline_local_variable.rs @@ -52,7 +52,7 @@ pub(crate) fn inline_local_variable(ctx: AssistCtx) -> Option { .next_sibling_or_token() .and_then(|it| ast::Whitespace::cast(it.as_token()?.clone())) { - TextRange::from_to( + TextRange::new( let_stmt.syntax().text_range().start(), whitespace.syntax().text_range().end(), ) diff --git a/crates/ra_assists/src/handlers/introduce_variable.rs b/crates/ra_assists/src/handlers/introduce_variable.rs index 8c09e6bcd0..eda9ac2963 100644 --- a/crates/ra_assists/src/handlers/introduce_variable.rs +++ b/crates/ra_assists/src/handlers/introduce_variable.rs @@ -4,7 +4,7 @@ use ra_syntax::{ BLOCK_EXPR, BREAK_EXPR, COMMENT, LAMBDA_EXPR, LOOP_EXPR, MATCH_ARM, PATH_EXPR, RETURN_EXPR, WHITESPACE, }, - SyntaxNode, TextUnit, + SyntaxNode, TextSize, }; use stdx::format_to; use test_utils::tested_by; @@ -47,10 +47,10 @@ pub(crate) fn introduce_variable(ctx: AssistCtx) -> Option { let cursor_offset = if wrap_in_block { buf.push_str("{ let var_name = "); - TextUnit::of_str("{ let ") + TextSize::of("{ let ") } else { buf.push_str("let var_name = "); - TextUnit::of_str("let ") + TextSize::of("let ") }; format_to!(buf, "{}", expr.syntax()); let full_stmt = ast::ExprStmt::cast(anchor_stmt.clone()); diff --git a/crates/ra_assists/src/handlers/invert_if.rs b/crates/ra_assists/src/handlers/invert_if.rs index 4c57168687..682e085120 100644 --- a/crates/ra_assists/src/handlers/invert_if.rs +++ b/crates/ra_assists/src/handlers/invert_if.rs @@ -28,7 +28,7 @@ pub(crate) fn invert_if(ctx: AssistCtx) -> Option { let if_keyword = ctx.find_token_at_offset(T![if])?; let expr = ast::IfExpr::cast(if_keyword.parent())?; let if_range = if_keyword.text_range(); - let cursor_in_range = ctx.frange.range.is_subrange(&if_range); + let cursor_in_range = if_range.contains_range(ctx.frange.range); if !cursor_in_range { return None; } diff --git a/crates/ra_assists/src/handlers/merge_match_arms.rs b/crates/ra_assists/src/handlers/merge_match_arms.rs index eb967ab929..cd0416f018 100644 --- a/crates/ra_assists/src/handlers/merge_match_arms.rs +++ b/crates/ra_assists/src/handlers/merge_match_arms.rs @@ -3,7 +3,7 @@ use std::iter::successors; use ra_syntax::{ algo::neighbor, ast::{self, AstNode}, - Direction, TextUnit, + Direction, TextSize, }; use crate::{Assist, AssistCtx, AssistId, TextRange}; @@ -42,8 +42,8 @@ pub(crate) fn merge_match_arms(ctx: AssistCtx) -> Option { let current_text_range = current_arm.syntax().text_range(); enum CursorPos { - InExpr(TextUnit), - InPat(TextUnit), + InExpr(TextSize), + InPat(TextSize), } let cursor_pos = ctx.frange.range.start(); let cursor_pos = if current_expr.syntax().text_range().contains(cursor_pos) { @@ -89,10 +89,10 @@ pub(crate) fn merge_match_arms(ctx: AssistCtx) -> Option { edit.target(current_text_range); edit.set_cursor(match cursor_pos { - CursorPos::InExpr(back_offset) => start + TextUnit::from_usize(arm.len()) - back_offset, + CursorPos::InExpr(back_offset) => start + TextSize::from_usize(arm.len()) - back_offset, CursorPos::InPat(offset) => offset, }); - edit.replace(TextRange::from_to(start, end), arm); + edit.replace(TextRange::new(start, end), arm); }) } diff --git a/crates/ra_assists/src/handlers/move_guard.rs b/crates/ra_assists/src/handlers/move_guard.rs index 1cc4986389..d5ccdd91ce 100644 --- a/crates/ra_assists/src/handlers/move_guard.rs +++ b/crates/ra_assists/src/handlers/move_guard.rs @@ -1,7 +1,7 @@ use ra_syntax::{ ast, ast::{AstNode, AstToken, IfExpr, MatchArm}, - TextUnit, + TextSize, }; use crate::{Assist, AssistCtx, AssistId}; @@ -49,16 +49,16 @@ pub(crate) fn move_guard_to_arm_body(ctx: AssistCtx) -> Option { edit.delete(ele); ele.len() } else { - TextUnit::from(0) + TextSize::from(0) } } - _ => TextUnit::from(0), + _ => TextSize::from(0), }; edit.delete(guard.syntax().text_range()); edit.replace_node_and_indent(arm_expr.syntax(), buf); edit.set_cursor( - arm_expr.syntax().text_range().start() + TextUnit::from(3) - offseting_amount, + arm_expr.syntax().text_range().start() + TextSize::from(3) - offseting_amount, ); }) } @@ -123,7 +123,7 @@ pub(crate) fn move_arm_cond_to_match_guard(ctx: AssistCtx) -> Option { } edit.insert(match_pat.syntax().text_range().end(), buf); - edit.set_cursor(match_pat.syntax().text_range().end() + TextUnit::from(1)); + edit.set_cursor(match_pat.syntax().text_range().end() + TextSize::from(1)); }, ) } diff --git a/crates/ra_assists/src/handlers/raw_string.rs b/crates/ra_assists/src/handlers/raw_string.rs index 7e4b83f13f..567400b9c2 100644 --- a/crates/ra_assists/src/handlers/raw_string.rs +++ b/crates/ra_assists/src/handlers/raw_string.rs @@ -2,7 +2,7 @@ use ra_syntax::{ ast::{self, HasStringValue}, AstToken, SyntaxKind::{RAW_STRING, STRING}, - TextUnit, + TextSize, }; use crate::{Assist, AssistCtx, AssistId}; @@ -81,7 +81,7 @@ pub(crate) fn add_hash(ctx: AssistCtx) -> Option { let token = ctx.find_token_at_offset(RAW_STRING)?; ctx.add_assist(AssistId("add_hash"), "Add # to raw string", |edit| { edit.target(token.text_range()); - edit.insert(token.text_range().start() + TextUnit::of_char('r'), "#"); + edit.insert(token.text_range().start() + TextSize::of('r'), "#"); edit.insert(token.text_range().end(), "#"); }) } diff --git a/crates/ra_assists/src/handlers/remove_dbg.rs b/crates/ra_assists/src/handlers/remove_dbg.rs index 5085649b42..4e5eb43505 100644 --- a/crates/ra_assists/src/handlers/remove_dbg.rs +++ b/crates/ra_assists/src/handlers/remove_dbg.rs @@ -1,6 +1,6 @@ use ra_syntax::{ ast::{self, AstNode}, - TextUnit, T, + TextSize, T, }; use crate::{Assist, AssistCtx, AssistId}; @@ -38,9 +38,9 @@ pub(crate) fn remove_dbg(ctx: AssistCtx) -> Option { let offset_start = file_range .start() .checked_sub(macro_range.start()) - .unwrap_or_else(|| TextUnit::from(0)); + .unwrap_or_else(|| TextSize::from(0)); - let dbg_size = TextUnit::of_str("dbg!("); + let dbg_size = TextSize::of("dbg!("); if offset_start > dbg_size { file_range.start() - dbg_size @@ -53,7 +53,7 @@ pub(crate) fn remove_dbg(ctx: AssistCtx) -> Option { let macro_args = macro_call.token_tree()?.syntax().clone(); let text = macro_args.text(); - let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); + let without_parens = TextSize::of('(')..text.len() - TextSize::of(')'); text.slice(without_parens).to_string() }; diff --git a/crates/ra_assists/src/handlers/remove_mut.rs b/crates/ra_assists/src/handlers/remove_mut.rs index 6884830eb6..e598023b25 100644 --- a/crates/ra_assists/src/handlers/remove_mut.rs +++ b/crates/ra_assists/src/handlers/remove_mut.rs @@ -27,6 +27,6 @@ pub(crate) fn remove_mut(ctx: AssistCtx) -> Option { ctx.add_assist(AssistId("remove_mut"), "Remove `mut` keyword", |edit| { edit.set_cursor(delete_from); - edit.delete(TextRange::from_to(delete_from, delete_to)); + edit.delete(TextRange::new(delete_from, delete_to)); }) } diff --git a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs index 94f5d6c503..2f02df3038 100644 --- a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs @@ -43,7 +43,7 @@ pub(crate) fn replace_qualified_name_with_use(ctx: AssistCtx) -> Option if let Some(last) = path.segment() { // Here we are assuming the assist will provide a correct use statement // so we can delete the path qualifier - edit.delete(TextRange::from_to( + edit.delete(TextRange::new( path.syntax().text_range().start(), last.syntax().text_range().start(), )); diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index ccc95735f7..3ffbe4c516 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -19,7 +19,7 @@ pub mod ast_transform; use ra_db::{FileId, FileRange}; use ra_ide_db::RootDatabase; -use ra_syntax::{TextRange, TextUnit}; +use ra_syntax::{TextRange, TextSize}; use ra_text_edit::TextEdit; pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler}; @@ -51,7 +51,7 @@ impl AssistLabel { #[derive(Debug, Clone)] pub struct AssistAction { pub edit: TextEdit, - pub cursor_position: Option, + pub cursor_position: Option, // FIXME: This belongs to `AssistLabel` pub target: Option, pub file: AssistFile, @@ -104,7 +104,7 @@ pub fn resolved_assists(db: &RootDatabase, range: FileRange) -> Vec>(); - a.sort_by_key(|it| it.action.target.map_or(TextUnit::from(!0u32), |it| it.len())); + a.sort_by_key(|it| it.action.target.map_or(TextSize::from(!0u32), |it| it.len())); a } diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index a06f59c140..fd4280de2d 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -6,7 +6,7 @@ pub mod fixture; use std::{panic, sync::Arc}; use ra_prof::profile; -use ra_syntax::{ast, Parse, SourceFile, TextRange, TextUnit}; +use ra_syntax::{ast, Parse, SourceFile, TextRange, TextSize}; pub use crate::{ cancellation::Canceled, @@ -75,7 +75,7 @@ impl CheckCanceled for T { #[derive(Clone, Copy, Debug)] pub struct FilePosition { pub file_id: FileId, - pub offset: TextUnit, + pub offset: TextSize, } #[derive(Clone, Copy, Debug)] diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 5d6edc45c8..e09cf31856 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -14,7 +14,7 @@ use ra_db::{FileId, FileRange}; use ra_prof::profile; use ra_syntax::{ algo::{find_node_at_offset, skip_trivia_token}, - ast, AstNode, Direction, SyntaxNode, SyntaxToken, TextRange, TextUnit, + ast, AstNode, Direction, SyntaxNode, SyntaxToken, TextRange, TextSize, }; use rustc_hash::{FxHashMap, FxHashSet}; @@ -95,7 +95,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { let token = successors(Some(parent.with_value(token)), |token| { let macro_call = token.value.ancestors().find_map(ast::MacroCall::cast)?; let tt = macro_call.token_tree()?; - if !token.value.text_range().is_subrange(&tt.syntax().text_range()) { + if !tt.syntax().text_range().contains_range(token.value.text_range()) { return None; } let file_id = sa.expand(self.db, token.with_value(¯o_call))?; @@ -114,7 +114,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { pub fn descend_node_at_offset( &self, node: &SyntaxNode, - offset: TextUnit, + offset: TextSize, ) -> Option { // Handle macro token cases node.token_at_offset(offset) @@ -142,7 +142,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { pub fn ancestors_at_offset_with_macros( &self, node: &SyntaxNode, - offset: TextUnit, + offset: TextSize, ) -> impl Iterator + '_ { node.token_at_offset(offset) .map(|token| self.ancestors_with_macros(token.parent())) @@ -154,7 +154,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { pub fn find_node_at_offset_with_macros( &self, node: &SyntaxNode, - offset: TextUnit, + offset: TextSize, ) -> Option { self.ancestors_at_offset_with_macros(node, offset).find_map(N::cast) } @@ -164,7 +164,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { pub fn find_node_at_offset_with_descend( &self, node: &SyntaxNode, - offset: TextUnit, + offset: TextSize, ) -> Option { if let Some(it) = find_node_at_offset(&node, offset) { return Some(it); @@ -255,7 +255,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { SemanticsScope { db: self.db, resolver } } - pub fn scope_at_offset(&self, node: &SyntaxNode, offset: TextUnit) -> SemanticsScope<'db, DB> { + pub fn scope_at_offset(&self, node: &SyntaxNode, offset: TextSize) -> SemanticsScope<'db, DB> { let node = self.find_file(node.clone()); let resolver = self.analyze2(node.as_ref(), Some(offset)).resolver; SemanticsScope { db: self.db, resolver } @@ -271,7 +271,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { self.analyze2(src.as_ref(), None) } - fn analyze2(&self, src: InFile<&SyntaxNode>, offset: Option) -> SourceAnalyzer { + fn analyze2(&self, src: InFile<&SyntaxNode>, offset: Option) -> SourceAnalyzer { let _p = profile("Semantics::analyze2"); let container = match self.with_ctx(|ctx| ctx.find_container(src)) { @@ -463,7 +463,7 @@ fn original_range_opt( return None; } - Some(first.with_value(first.value.text_range().extend_to(&last.value.text_range()))) + Some(first.with_value(first.value.text_range().cover(last.value.text_range()))) })?) } diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index 0ed6d09580..59a3a17d28 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -23,7 +23,7 @@ use hir_ty::{ }; use ra_syntax::{ ast::{self, AstNode}, - SyntaxNode, TextRange, TextUnit, + SyntaxNode, TextRange, TextSize, }; use crate::{ @@ -50,7 +50,7 @@ impl SourceAnalyzer { db: &dyn HirDatabase, def: DefWithBodyId, node: InFile<&SyntaxNode>, - offset: Option, + offset: Option, ) -> SourceAnalyzer { let (body, source_map) = db.body_with_source_map(def); let scopes = db.expr_scopes(def); @@ -318,7 +318,7 @@ fn scope_for_offset( db: &dyn HirDatabase, scopes: &ExprScopes, source_map: &BodySourceMap, - offset: InFile, + offset: InFile, ) -> Option { scopes .scope_by_expr() @@ -354,7 +354,7 @@ fn adjust( source_map: &BodySourceMap, expr_range: TextRange, file_id: HirFileId, - offset: TextUnit, + offset: TextSize, ) -> Option { let child_scopes = scopes .scope_by_expr() @@ -369,15 +369,15 @@ fn adjust( let node = source.value.to_node(&root); Some((node.syntax().text_range(), scope)) }) - .filter(|(range, _)| { - range.start() <= offset && range.is_subrange(&expr_range) && *range != expr_range + .filter(|&(range, _)| { + range.start() <= offset && expr_range.contains_range(range) && range != expr_range }); child_scopes - .max_by(|(r1, _), (r2, _)| { - if r2.is_subrange(&r1) { + .max_by(|&(r1, _), &(r2, _)| { + if r1.contains_range(r2) { std::cmp::Ordering::Greater - } else if r1.is_subrange(&r2) { + } else if r2.contains_range(r1) { std::cmp::Ordering::Less } else { r1.start().cmp(&r2.start()) diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 3da137f2e6..2ccebda282 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs @@ -2,7 +2,7 @@ use crate::db::AstDatabase; use crate::{ ast::{self, AstToken, HasStringValue}, - name, AstId, CrateId, MacroDefId, MacroDefKind, TextUnit, + name, AstId, CrateId, MacroDefId, MacroDefKind, TextSize, }; use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; @@ -127,7 +127,7 @@ fn stringify_expand( let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; let macro_args = arg; let text = macro_args.text(); - let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); + let without_parens = TextSize::of('(')..text.len() - TextSize::of(')'); text.slice(without_parens).to_string() }; diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 86299459fa..754a0f005b 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs @@ -22,7 +22,7 @@ use ra_db::{impl_intern_key, salsa, CrateId, FileId}; use ra_syntax::{ algo, ast::{self, AstNode}, - SyntaxNode, SyntaxToken, TextUnit, + SyntaxNode, SyntaxToken, TextSize, }; use crate::ast_id_map::FileAstId; @@ -348,7 +348,7 @@ impl AstId { /// /// * `InFile` -- syntax node in a file /// * `InFile` -- ast node in a file -/// * `InFile` -- offset in a file +/// * `InFile` -- offset in a file #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] pub struct InFile { pub file_id: HirFileId, diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 846005baa1..b6a96bb5ca 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs @@ -117,7 +117,7 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { let macro_prefix = if node.file_id != file_id.into() { "!" } else { "" }; format_to!( buf, - "{}{} '{}': {}\n", + "{}{:?} '{}': {}\n", macro_prefix, range, ellipsize(text, 15), @@ -134,7 +134,7 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { let macro_prefix = if src_ptr.file_id != file_id.into() { "!" } else { "" }; format_to!( buf, - "{}{}: expected {}, got {}\n", + "{}{:?}: expected {}, got {}\n", macro_prefix, range, mismatch.expected.display(&db), diff --git a/crates/ra_ide/src/call_info.rs b/crates/ra_ide/src/call_info.rs index 5da254a6e9..780a03c138 100644 --- a/crates/ra_ide/src/call_info.rs +++ b/crates/ra_ide/src/call_info.rs @@ -126,7 +126,7 @@ impl FnCallNode { ast::CallExpr(it) => Some(FnCallNode::CallExpr(it)), ast::MethodCallExpr(it) => { let arg_list = it.arg_list()?; - if !syntax.text_range().is_subrange(&arg_list.syntax().text_range()) { + if !arg_list.syntax().text_range().contains_range(syntax.text_range()) { return None; } Some(FnCallNode::MethodCallExpr(it)) diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index adefb290e8..306ce96dc8 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs @@ -97,7 +97,7 @@ fn is_in_loop_body(leaf: &SyntaxToken) -> bool { } }; if let Some(body) = loop_body { - if leaf.text_range().is_subrange(&body.syntax().text_range()) { + if body.syntax().text_range().contains_range(leaf.text_range()) { return true; } } diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs index 8d397b0fea..d6a37d720e 100644 --- a/crates/ra_ide/src/completion/complete_postfix.rs +++ b/crates/ra_ide/src/completion/complete_postfix.rs @@ -2,7 +2,7 @@ use ra_syntax::{ ast::{self, AstNode}, - TextRange, TextUnit, + TextRange, TextSize, }; use ra_text_edit::TextEdit; @@ -115,7 +115,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { fn get_receiver_text(receiver: &ast::Expr, receiver_is_ambiguous_float_literal: bool) -> String { if receiver_is_ambiguous_float_literal { let text = receiver.syntax().text(); - let without_dot = ..text.len() - TextUnit::of_char('.'); + let without_dot = ..text.len() - TextSize::of('.'); text.slice(without_dot).to_string() } else { receiver.to_string() @@ -143,7 +143,7 @@ fn postfix_snippet( let edit = { let receiver_syntax = receiver.syntax(); let receiver_range = ctx.sema.original_range(receiver_syntax).range; - let delete_range = TextRange::from_to(receiver_range.start(), ctx.source_range().end()); + let delete_range = TextRange::new(receiver_range.start(), ctx.source_range().end()); TextEdit::replace(delete_range, snippet.to_string()) }; CompletionItem::new(CompletionKind::Postfix, ctx.source_range(), label) diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index c399432524..e2a8c59cde 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs @@ -141,7 +141,7 @@ fn add_function_impl( } else { CompletionItemKind::Function }; - let range = TextRange::from_to(fn_def_node.text_range().start(), ctx.source_range().end()); + let range = TextRange::new(fn_def_node.text_range().start(), ctx.source_range().end()); match ctx.config.snippet_cap { Some(cap) => { @@ -167,7 +167,7 @@ fn add_type_alias_impl( let snippet = format!("type {} = ", alias_name); - let range = TextRange::from_to(type_def_node.text_range().start(), ctx.source_range().end()); + let range = TextRange::new(type_def_node.text_range().start(), ctx.source_range().end()); CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone()) .text_edit(TextEdit::replace(range, snippet)) @@ -189,7 +189,7 @@ fn add_const_impl( let snippet = make_const_compl_syntax(&const_.source(ctx.db).value); let range = - TextRange::from_to(const_def_node.text_range().start(), ctx.source_range().end()); + TextRange::new(const_def_node.text_range().start(), ctx.source_range().end()); CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone()) .text_edit(TextEdit::replace(range, snippet)) @@ -216,7 +216,7 @@ fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { .map_or(const_end, |f| f.text_range().start()); let len = end - start; - let range = TextRange::from_to(0.into(), len); + let range = TextRange::new(0.into(), len); let syntax = const_.syntax().text().slice(range).to_string(); diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs index 37880448ad..5f2797e418 100644 --- a/crates/ra_ide/src/completion/completion_context.rs +++ b/crates/ra_ide/src/completion/completion_context.rs @@ -7,7 +7,7 @@ use ra_syntax::{ algo::{find_covering_element, find_node_at_offset}, ast, AstNode, SyntaxKind::*, - SyntaxNode, SyntaxToken, TextRange, TextUnit, + SyntaxNode, SyntaxToken, TextRange, TextSize, }; use ra_text_edit::AtomTextEdit; @@ -20,7 +20,7 @@ pub(crate) struct CompletionContext<'a> { pub(super) sema: Semantics<'a, RootDatabase>, pub(super) db: &'a RootDatabase, pub(super) config: &'a CompletionConfig, - pub(super) offset: TextUnit, + pub(super) offset: TextSize, /// The token before the cursor, in the original file. pub(super) original_token: SyntaxToken, /// The token before the cursor, in the macro-expanded file. @@ -167,7 +167,7 @@ impl<'a> CompletionContext<'a> { match self.token.kind() { // workaroud when completion is triggered by trigger characters. IDENT => self.original_token.text_range(), - _ => TextRange::offset_len(self.offset, 0.into()), + _ => TextRange::empty(self.offset), } } @@ -190,7 +190,7 @@ impl<'a> CompletionContext<'a> { &mut self, original_file: &SyntaxNode, file_with_fake_ident: SyntaxNode, - offset: TextUnit, + offset: TextSize, ) { // First, let's try to complete a reference to some declaration. if let Some(name_ref) = find_node_at_offset::(&file_with_fake_ident, offset) { @@ -224,7 +224,8 @@ impl<'a> CompletionContext<'a> { } if let Some(let_stmt) = bind_pat.syntax().ancestors().find_map(ast::LetStmt::cast) { if let Some(pat) = let_stmt.pat() { - if bind_pat.syntax().text_range().is_subrange(&pat.syntax().text_range()) { + if pat.syntax().text_range().contains_range(bind_pat.syntax().text_range()) + { self.is_pat_binding_or_const = false; } } @@ -246,7 +247,7 @@ impl<'a> CompletionContext<'a> { &mut self, original_file: &SyntaxNode, name_ref: ast::NameRef, - offset: TextUnit, + offset: TextSize, ) { self.name_ref_syntax = find_node_at_offset(&original_file, name_ref.syntax().text_range().start()); diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index e7e2017098..adfb1b9b2d 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs @@ -171,7 +171,7 @@ fn text_edit_for_remove_unnecessary_braces_with_self_in_use_statement( if single_use_tree.path()?.segment()?.syntax().first_child_or_token()?.kind() == T![self] { let start = use_tree_list_node.prev_sibling_or_token()?.text_range().start(); let end = use_tree_list_node.text_range().end(); - let range = TextRange::from_to(start, end); + let range = TextRange::new(start, end); return Some(TextEdit::delete(range)); } None diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index 753d2ef6a0..9f329b5d37 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs @@ -9,7 +9,7 @@ use ra_syntax::{ ast::{self, AstNode, AstToken}, Direction, NodeOrToken, SyntaxKind::{self, *}, - SyntaxNode, SyntaxToken, TextRange, TextUnit, TokenAtOffset, T, + SyntaxNode, SyntaxToken, TextRange, TextSize, TokenAtOffset, T, }; use crate::FileRange; @@ -121,10 +121,10 @@ fn extend_tokens_from_range( let mut first_token = skip_trivia_token(first_token, Direction::Next)?; let mut last_token = skip_trivia_token(last_token, Direction::Prev)?; - while !first_token.text_range().is_subrange(&original_range) { + while !original_range.contains_range(first_token.text_range()) { first_token = skip_trivia_token(first_token.next_token()?, Direction::Next)?; } - while !last_token.text_range().is_subrange(&original_range) { + while !original_range.contains_range(last_token.text_range()) { last_token = skip_trivia_token(last_token.prev_token()?, Direction::Prev)?; } @@ -161,8 +161,8 @@ fn extend_tokens_from_range( .take_while(validate) .last()?; - let range = first.text_range().extend_to(&last.text_range()); - if original_range.is_subrange(&range) && original_range != range { + let range = first.text_range().cover(last.text_range()); + if range.contains_range(original_range) && original_range != range { Some(range) } else { None @@ -176,7 +176,7 @@ fn shallowest_node(node: &SyntaxNode) -> SyntaxNode { fn extend_single_word_in_comment_or_string( leaf: &SyntaxToken, - offset: TextUnit, + offset: TextSize, ) -> Option { let text: &str = leaf.text(); let cursor_position: u32 = (offset - leaf.text_range().start()).into(); @@ -190,10 +190,10 @@ fn extend_single_word_in_comment_or_string( let start_idx = before.rfind(non_word_char)? as u32; let end_idx = after.find(non_word_char).unwrap_or_else(|| after.len()) as u32; - let from: TextUnit = (start_idx + 1).into(); - let to: TextUnit = (cursor_position + end_idx).into(); + let from: TextSize = (start_idx + 1).into(); + let to: TextSize = (cursor_position + end_idx).into(); - let range = TextRange::from_to(from, to); + let range = TextRange::new(from, to); if range.is_empty() { None } else { @@ -201,24 +201,24 @@ fn extend_single_word_in_comment_or_string( } } -fn extend_ws(root: &SyntaxNode, ws: SyntaxToken, offset: TextUnit) -> TextRange { +fn extend_ws(root: &SyntaxNode, ws: SyntaxToken, offset: TextSize) -> TextRange { let ws_text = ws.text(); - let suffix = TextRange::from_to(offset, ws.text_range().end()) - ws.text_range().start(); - let prefix = TextRange::from_to(ws.text_range().start(), offset) - ws.text_range().start(); + let suffix = TextRange::new(offset, ws.text_range().end()) - ws.text_range().start(); + let prefix = TextRange::new(ws.text_range().start(), offset) - ws.text_range().start(); let ws_suffix = &ws_text.as_str()[suffix]; let ws_prefix = &ws_text.as_str()[prefix]; if ws_text.contains('\n') && !ws_suffix.contains('\n') { if let Some(node) = ws.next_sibling_or_token() { let start = match ws_prefix.rfind('\n') { - Some(idx) => ws.text_range().start() + TextUnit::from((idx + 1) as u32), + Some(idx) => ws.text_range().start() + TextSize::from((idx + 1) as u32), None => node.text_range().start(), }; let end = if root.text().char_at(node.text_range().end()) == Some('\n') { - node.text_range().end() + TextUnit::of_char('\n') + node.text_range().end() + TextSize::of('\n') } else { node.text_range().end() }; - return TextRange::from_to(start, end); + return TextRange::new(start, end); } } ws.text_range() @@ -270,13 +270,10 @@ fn extend_list_item(node: &SyntaxNode) -> Option { .filter(|node| is_single_line_ws(node)) .unwrap_or(delimiter_node); - return Some(TextRange::from_to(node.text_range().start(), final_node.text_range().end())); + return Some(TextRange::new(node.text_range().start(), final_node.text_range().end())); } if let Some(delimiter_node) = nearby_delimiter(delimiter, node, Direction::Prev) { - return Some(TextRange::from_to( - delimiter_node.text_range().start(), - node.text_range().end(), - )); + return Some(TextRange::new(delimiter_node.text_range().start(), node.text_range().end())); } None @@ -286,10 +283,7 @@ fn extend_comments(comment: ast::Comment) -> Option { let prev = adj_comments(&comment, Direction::Prev); let next = adj_comments(&comment, Direction::Next); if prev != next { - Some(TextRange::from_to( - prev.syntax().text_range().start(), - next.syntax().text_range().end(), - )) + Some(TextRange::new(prev.syntax().text_range().start(), next.syntax().text_range().end())) } else { None } diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 4eeb76d143..034c4c7d47 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs @@ -141,7 +141,7 @@ fn contiguous_range_for_group_unless( } if first != &last { - Some(TextRange::from_to(first.text_range().start(), last.text_range().end())) + Some(TextRange::new(first.text_range().start(), last.text_range().end())) } else { // The group consists of only one element, therefore it cannot be folded None @@ -187,7 +187,7 @@ fn contiguous_range_for_comment( } if first != last { - Some(TextRange::from_to( + Some(TextRange::new( first.syntax().text_range().start(), last.syntax().text_range().end(), )) diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index a311879944..fcc2ab7fba 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -275,7 +275,7 @@ mod tests { ", ); let hover = analysis.hover(position).unwrap().unwrap(); - assert_eq!(hover.range, TextRange::from_to(95.into(), 100.into())); + assert_eq!(hover.range, TextRange::new(95.into(), 100.into())); assert_eq!(trim_markup_opt(hover.info.first()), Some("u32")); } diff --git a/crates/ra_ide/src/join_lines.rs b/crates/ra_ide/src/join_lines.rs index 7d70dab9c6..040846ec37 100644 --- a/crates/ra_ide/src/join_lines.rs +++ b/crates/ra_ide/src/join_lines.rs @@ -7,7 +7,7 @@ use ra_syntax::{ ast::{self, AstNode, AstToken}, Direction, NodeOrToken, SourceFile, SyntaxKind::{self, WHITESPACE}, - SyntaxNode, SyntaxToken, TextRange, TextUnit, T, + SyntaxNode, SyntaxToken, TextRange, TextSize, T, }; use ra_text_edit::{TextEdit, TextEditBuilder}; @@ -19,7 +19,7 @@ pub fn join_lines(file: &SourceFile, range: TextRange) -> TextEdit { None => return TextEditBuilder::default().finish(), Some(pos) => pos, }; - TextRange::offset_len(range.start() + pos, TextUnit::of_char('\n')) + TextRange::at(range.start() + pos, TextSize::of('\n')) } else { range }; @@ -30,13 +30,13 @@ pub fn join_lines(file: &SourceFile, range: TextRange) -> TextEdit { }; let mut edit = TextEditBuilder::default(); for token in node.descendants_with_tokens().filter_map(|it| it.into_token()) { - let range = match range.intersection(&token.text_range()) { + let range = match range.intersect(token.text_range()) { Some(range) => range, None => continue, } - token.text_range().start(); let text = token.text(); for (pos, _) in text[range].bytes().enumerate().filter(|&(_, b)| b == b'\n') { - let pos: TextUnit = (pos as u32).into(); + let pos: TextSize = (pos as u32).into(); let off = token.text_range().start() + range.start() + pos; if !edit.invalidates_offset(off) { remove_newline(&mut edit, &token, off); @@ -47,16 +47,16 @@ pub fn join_lines(file: &SourceFile, range: TextRange) -> TextEdit { edit.finish() } -fn remove_newline(edit: &mut TextEditBuilder, token: &SyntaxToken, offset: TextUnit) { +fn remove_newline(edit: &mut TextEditBuilder, token: &SyntaxToken, offset: TextSize) { if token.kind() != WHITESPACE || token.text().bytes().filter(|&b| b == b'\n').count() != 1 { // The node is either the first or the last in the file - let suff = &token.text()[TextRange::from_to( - offset - token.text_range().start() + TextUnit::of_char('\n'), - TextUnit::of_str(token.text()), + let suff = &token.text()[TextRange::new( + offset - token.text_range().start() + TextSize::of('\n'), + TextSize::of(token.text().as_str()), )]; let spaces = suff.bytes().take_while(|&b| b == b' ').count(); - edit.replace(TextRange::offset_len(offset, ((spaces + 1) as u32).into()), " ".to_string()); + edit.replace(TextRange::at(offset, ((spaces + 1) as u32).into()), " ".to_string()); return; } @@ -65,7 +65,7 @@ fn remove_newline(edit: &mut TextEditBuilder, token: &SyntaxToken, offset: TextU let next = token.next_sibling_or_token().unwrap(); if is_trailing_comma(prev.kind(), next.kind()) { // Removes: trailing comma, newline (incl. surrounding whitespace) - edit.delete(TextRange::from_to(prev.text_range().start(), token.text_range().end())); + edit.delete(TextRange::new(prev.text_range().start(), token.text_range().end())); return; } if prev.kind() == T![,] && next.kind() == T!['}'] { @@ -76,7 +76,7 @@ fn remove_newline(edit: &mut TextEditBuilder, token: &SyntaxToken, offset: TextU " " }; edit.replace( - TextRange::from_to(prev.text_range().start(), token.text_range().end()), + TextRange::new(prev.text_range().start(), token.text_range().end()), space.to_string(), ); return; @@ -87,9 +87,9 @@ fn remove_newline(edit: &mut TextEditBuilder, token: &SyntaxToken, offset: TextU next.as_token().cloned().and_then(ast::Comment::cast), ) { // Removes: newline (incl. surrounding whitespace), start of the next comment - edit.delete(TextRange::from_to( + edit.delete(TextRange::new( token.text_range().start(), - next.syntax().text_range().start() + TextUnit::of_str(next.prefix()), + next.syntax().text_range().start() + TextSize::of(next.prefix()), )); return; } @@ -420,10 +420,10 @@ fn foo() { check_join_lines( r" <|>use ra_syntax::{ - TextUnit, TextRange, + TextSize, TextRange, };", r" -<|>use ra_syntax::{TextUnit, TextRange, +<|>use ra_syntax::{TextSize, TextRange, };", ); } @@ -434,11 +434,11 @@ fn foo() { check_join_lines( r" use ra_syntax::{ -<|> TextUnit, TextRange +<|> TextSize, TextRange };", r" use ra_syntax::{ -<|> TextUnit, TextRange};", +<|> TextSize, TextRange};", ); } @@ -448,11 +448,11 @@ use ra_syntax::{ check_join_lines( r" use ra_syntax::{ -<|> TextUnit, TextRange, +<|> TextSize, TextRange, };", r" use ra_syntax::{ -<|> TextUnit, TextRange};", +<|> TextSize, TextRange};", ); } diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index f692fbaa2e..09f602fe1b 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -60,7 +60,7 @@ use ra_ide_db::{ symbol_index::{self, FileSymbol}, LineIndexDatabase, }; -use ra_syntax::{SourceFile, TextRange, TextUnit}; +use ra_syntax::{SourceFile, TextRange, TextSize}; use crate::display::ToNav; @@ -265,7 +265,7 @@ impl Analysis { /// Returns position of the matching brace (all types of braces are /// supported). - pub fn matching_brace(&self, position: FilePosition) -> Cancelable> { + pub fn matching_brace(&self, position: FilePosition) -> Cancelable> { self.with_db(|db| { let parse = db.parse(position.file_id); let file = parse.tree(); diff --git a/crates/ra_ide/src/matching_brace.rs b/crates/ra_ide/src/matching_brace.rs index d1204fac01..b853487060 100644 --- a/crates/ra_ide/src/matching_brace.rs +++ b/crates/ra_ide/src/matching_brace.rs @@ -1,8 +1,8 @@ //! FIXME: write short doc here -use ra_syntax::{ast::AstNode, SourceFile, SyntaxKind, TextUnit, T}; +use ra_syntax::{ast::AstNode, SourceFile, SyntaxKind, TextSize, T}; -pub fn matching_brace(file: &SourceFile, offset: TextUnit) -> Option { +pub fn matching_brace(file: &SourceFile, offset: TextSize) -> Option { const BRACES: &[SyntaxKind] = &[T!['{'], T!['}'], T!['['], T![']'], T!['('], T![')'], T![<], T![>]]; let (brace_node, brace_idx) = file diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 9acc6158a4..1c64b3eb96 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs @@ -54,7 +54,7 @@ fn source_edit_from_reference(reference: Reference, new_name: &str) -> SourceFil ReferenceKind::StructFieldShorthandForField => { replacement_text.push_str(new_name); replacement_text.push_str(": "); - TextRange::from_to( + TextRange::new( reference.file_range.range.start(), reference.file_range.range.start(), ) @@ -62,7 +62,7 @@ fn source_edit_from_reference(reference: Reference, new_name: &str) -> SourceFil ReferenceKind::StructFieldShorthandForLocal => { replacement_text.push_str(": "); replacement_text.push_str(new_name); - TextRange::from_to(reference.file_range.range.end(), reference.file_range.range.end()) + TextRange::new(reference.file_range.range.end(), reference.file_range.range.end()) } _ => { replacement_text.push_str(new_name); diff --git a/crates/ra_ide/src/source_change.rs b/crates/ra_ide/src/source_change.rs index f5f7f8807c..71b0e8f757 100644 --- a/crates/ra_ide/src/source_change.rs +++ b/crates/ra_ide/src/source_change.rs @@ -6,7 +6,7 @@ use ra_db::RelativePathBuf; use ra_text_edit::TextEdit; -use crate::{FileId, FilePosition, SourceRootId, TextUnit}; +use crate::{FileId, FilePosition, SourceRootId, TextSize}; #[derive(Debug)] pub struct SourceChange { @@ -104,7 +104,7 @@ pub enum FileSystemEdit { pub(crate) struct SingleFileChange { pub label: String, pub edit: TextEdit, - pub cursor_position: Option, + pub cursor_position: Option, } impl SingleFileChange { diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index c0728bfb12..6f02614a60 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs @@ -61,16 +61,16 @@ impl HighlightedRangeStack { let prev = self.stack.last_mut().unwrap(); let needs_flattening = !children.is_empty() && !prev.is_empty() - && children.first().unwrap().range.is_subrange(&prev.last().unwrap().range); + && prev.last().unwrap().range.contains_range(children.first().unwrap().range); if !needs_flattening { prev.extend(children); } else { let mut parent = prev.pop().unwrap(); for ele in children { - assert!(ele.range.is_subrange(&parent.range)); + assert!(parent.range.contains_range(ele.range)); let mut cloned = parent.clone(); - parent.range = TextRange::from_to(parent.range.start(), ele.range.start()); - cloned.range = TextRange::from_to(ele.range.end(), cloned.range.end()); + parent.range = TextRange::new(parent.range.start(), ele.range.start()); + cloned.range = TextRange::new(ele.range.end(), cloned.range.end()); if !parent.range.is_empty() { prev.push(parent); } @@ -152,7 +152,7 @@ pub(crate) fn highlight( }; // Element outside of the viewport, no need to highlight - if range_to_highlight.intersection(&event_range).is_none() { + if range_to_highlight.intersect(event_range).is_none() { continue; } @@ -309,7 +309,7 @@ fn macro_call_range(macro_call: &ast::MacroCall) -> Option { } } - Some(TextRange::from_to(range_start, range_end)) + Some(TextRange::new(range_start, range_end)) } fn highlight_element( diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ra_ide/src/syntax_highlighting/html.rs index 4496529a10..4f17d10402 100644 --- a/crates/ra_ide/src/syntax_highlighting/html.rs +++ b/crates/ra_ide/src/syntax_highlighting/html.rs @@ -1,7 +1,7 @@ //! Renders a bit of code as HTML. use ra_db::SourceDatabase; -use ra_syntax::{AstNode, TextUnit}; +use ra_syntax::{AstNode, TextSize}; use crate::{FileId, RootDatabase}; @@ -23,17 +23,18 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo let ranges = highlight(db, file_id, None); let text = parse.tree().syntax().to_string(); - let mut prev_pos = TextUnit::from(0); + let mut prev_pos = TextSize::from(0); let mut buf = String::new(); buf.push_str(&STYLE); buf.push_str("
");
+    // TODO: unusize
     for range in &ranges {
         if range.range.start() > prev_pos {
-            let curr = &text[prev_pos.to_usize()..range.range.start().to_usize()];
+            let curr = &text[usize::from(prev_pos)..usize::from(range.range.start())];
             let text = html_escape(curr);
             buf.push_str(&text);
         }
-        let curr = &text[range.range.start().to_usize()..range.range.end().to_usize()];
+        let curr = &text[usize::from(range.range.start())..usize::from(range.range.end())];
 
         let class = range.highlight.to_string().replace('.', " ");
         let color = match (rainbow, range.binding_hash) {
@@ -47,7 +48,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo
         prev_pos = range.range.end();
     }
     // Add the remaining (non-highlighted) text
-    let curr = &text[prev_pos.to_usize()..];
+    let curr = &text[usize::from(prev_pos)..];
     let text = html_escape(curr);
     buf.push_str(&text);
     buf.push_str("
"); diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index 5842ae2e86..a8a97a69f5 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs @@ -5,7 +5,7 @@ use ra_ide_db::RootDatabase; use ra_syntax::{ algo, AstNode, NodeOrToken, SourceFile, SyntaxKind::{RAW_STRING, STRING}, - SyntaxToken, TextRange, TextUnit, + SyntaxToken, TextRange, TextSize, }; pub use ra_db::FileId; @@ -66,13 +66,13 @@ fn syntax_tree_for_token(node: &SyntaxToken, text_range: TextRange) -> Option Option>( +pub fn check_action Option>( before: &str, after: &str, f: F, diff --git a/crates/ra_ide/src/typing.rs b/crates/ra_ide/src/typing.rs index f55cd3bf53..98af79dff9 100644 --- a/crates/ra_ide/src/typing.rs +++ b/crates/ra_ide/src/typing.rs @@ -21,7 +21,7 @@ use ra_ide_db::RootDatabase; use ra_syntax::{ algo::find_node_at_offset, ast::{self, AstToken}, - AstNode, SourceFile, TextRange, TextUnit, + AstNode, SourceFile, TextRange, TextSize, }; use ra_text_edit::TextEdit; @@ -45,7 +45,7 @@ pub(crate) fn on_char_typed( fn on_char_typed_inner( file: &SourceFile, - offset: TextUnit, + offset: TextSize, char_typed: char, ) -> Option { assert!(TRIGGER_CHARS.contains(char_typed)); @@ -60,7 +60,7 @@ fn on_char_typed_inner( /// Returns an edit which should be applied after `=` was typed. Primarily, /// this works when adding `let =`. // FIXME: use a snippet completion instead of this hack here. -fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option { +fn on_eq_typed(file: &SourceFile, offset: TextSize) -> Option { assert_eq!(file.syntax().text().char_at(offset), Some('=')); let let_stmt: ast::LetStmt = find_node_at_offset(file.syntax(), offset)?; if let_stmt.semicolon_token().is_some() { @@ -86,7 +86,7 @@ fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option } /// Returns an edit which should be applied when a dot ('.') is typed on a blank line, indenting the line appropriately. -fn on_dot_typed(file: &SourceFile, offset: TextUnit) -> Option { +fn on_dot_typed(file: &SourceFile, offset: TextSize) -> Option { assert_eq!(file.syntax().text().char_at(offset), Some('.')); let whitespace = file.syntax().token_at_offset(offset).left_biased().and_then(ast::Whitespace::cast)?; @@ -96,13 +96,13 @@ fn on_dot_typed(file: &SourceFile, offset: TextUnit) -> Option let newline = text.rfind('\n')?; &text[newline + 1..] }; - let current_indent_len = TextUnit::of_str(current_indent); + let current_indent_len = TextSize::of(current_indent); // Make sure dot is a part of call chain let field_expr = ast::FieldExpr::cast(whitespace.syntax().parent())?; let prev_indent = leading_indent(field_expr.syntax())?; let target_indent = format!(" {}", prev_indent); - let target_indent_len = TextUnit::of_str(&target_indent); + let target_indent_len = TextSize::of(&target_indent); if current_indent_len == target_indent_len { return None; } @@ -110,20 +110,20 @@ fn on_dot_typed(file: &SourceFile, offset: TextUnit) -> Option Some(SingleFileChange { label: "reindent dot".to_string(), edit: TextEdit::replace( - TextRange::from_to(offset - current_indent_len, offset), + TextRange::new(offset - current_indent_len, offset), target_indent, ), cursor_position: Some( - offset + target_indent_len - current_indent_len + TextUnit::of_char('.'), + offset + target_indent_len - current_indent_len + TextSize::of('.'), ), }) } /// Adds a space after an arrow when `fn foo() { ... }` is turned into `fn foo() -> { ... }` -fn on_arrow_typed(file: &SourceFile, offset: TextUnit) -> Option { +fn on_arrow_typed(file: &SourceFile, offset: TextSize) -> Option { let file_text = file.syntax().text(); assert_eq!(file_text.char_at(offset), Some('>')); - let after_arrow = offset + TextUnit::of_char('>'); + let after_arrow = offset + TextSize::of('>'); if file_text.char_at(after_arrow) != Some('{') { return None; } diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ra_ide/src/typing/on_enter.rs index 6bcf2d72b6..30c8c55720 100644 --- a/crates/ra_ide/src/typing/on_enter.rs +++ b/crates/ra_ide/src/typing/on_enter.rs @@ -7,7 +7,7 @@ use ra_syntax::{ ast::{self, AstToken}, AstNode, SmolStr, SourceFile, SyntaxKind::*, - SyntaxToken, TextUnit, TokenAtOffset, + SyntaxToken, TextSize, TokenAtOffset, }; use ra_text_edit::TextEdit; @@ -28,7 +28,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option Option, + pub(crate) newlines: Vec, pub(crate) utf16_lines: FxHashMap>, } @@ -22,12 +22,12 @@ pub struct LineCol { #[derive(Clone, Debug, Hash, PartialEq, Eq)] pub(crate) struct Utf16Char { - pub(crate) start: TextUnit, - pub(crate) end: TextUnit, + pub(crate) start: TextSize, + pub(crate) end: TextSize, } impl Utf16Char { - fn len(&self) -> TextUnit { + fn len(&self) -> TextSize { self.end - self.start } } @@ -42,7 +42,7 @@ impl LineIndex { let mut curr_col = 0.into(); let mut line = 0; for c in text.chars() { - curr_row += TextUnit::of_char(c); + curr_row += TextSize::of(c); if c == '\n' { newlines.push(curr_row); @@ -58,8 +58,8 @@ impl LineIndex { continue; } - let char_len = TextUnit::of_char(c); - if char_len > TextUnit::from_usize(1) { + let char_len = TextSize::of(c); + if char_len > TextSize::from_usize(1) { utf16_chars.push(Utf16Char { start: curr_col, end: curr_col + char_len }); } @@ -74,7 +74,7 @@ impl LineIndex { LineIndex { newlines, utf16_lines } } - pub fn line_col(&self, offset: TextUnit) -> LineCol { + pub fn line_col(&self, offset: TextSize) -> LineCol { let line = self.newlines.upper_bound(&offset) - 1; let line_start_offset = self.newlines[line]; let col = offset - line_start_offset; @@ -82,7 +82,7 @@ impl LineIndex { LineCol { line: line as u32, col_utf16: self.utf8_to_utf16_col(line as u32, col) as u32 } } - pub fn offset(&self, line_col: LineCol) -> TextUnit { + pub fn offset(&self, line_col: LineCol) -> TextSize { //FIXME: return Result let col = self.utf16_to_utf8_col(line_col.line, line_col.col_utf16); self.newlines[line_col.line as usize] + col @@ -97,16 +97,16 @@ impl LineIndex { all.clone() .zip(all.skip(1)) - .map(|(lo, hi)| TextRange::from_to(lo, hi)) + .map(|(lo, hi)| TextRange::new(lo, hi)) .filter(|it| !it.is_empty()) } - fn utf8_to_utf16_col(&self, line: u32, col: TextUnit) -> usize { + fn utf8_to_utf16_col(&self, line: u32, col: TextSize) -> usize { if let Some(utf16_chars) = self.utf16_lines.get(&line) { let mut correction = 0; for c in utf16_chars { if col >= c.end { - correction += c.len().to_usize() - 1; + correction += usize::from(c.len()) - 1; } else { // From here on, all utf16 characters come *after* the character we are mapping, // so we don't need to take them into account @@ -114,18 +114,18 @@ impl LineIndex { } } - col.to_usize() - correction + usize::from(col) - correction } else { - col.to_usize() + usize::from(col) } } - fn utf16_to_utf8_col(&self, line: u32, col: u32) -> TextUnit { - let mut col: TextUnit = col.into(); + fn utf16_to_utf8_col(&self, line: u32, col: u32) -> TextSize { + let mut col: TextSize = col.into(); if let Some(utf16_chars) = self.utf16_lines.get(&line) { for c in utf16_chars { if col >= c.start { - col += c.len() - TextUnit::from_usize(1); + col += c.len() - TextSize::from_usize(1); } else { // From here on, all utf16 characters come *after* the character we are mapping, // so we don't need to take them into account @@ -200,10 +200,10 @@ const C: char = 'メ'; assert_eq!(col_index.utf8_to_utf16_col(1, 22.into()), 20); // UTF-16 to UTF-8, no changes - assert_eq!(col_index.utf16_to_utf8_col(1, 15), TextUnit::from(15)); + assert_eq!(col_index.utf16_to_utf8_col(1, 15), TextSize::from(15)); // UTF-16 to UTF-8 - assert_eq!(col_index.utf16_to_utf8_col(1, 19), TextUnit::from(21)); + assert_eq!(col_index.utf16_to_utf8_col(1, 19), TextSize::from(21)); } #[test] @@ -228,18 +228,18 @@ const C: char = \"メ メ\"; assert!(col_index.utf8_to_utf16_col(2, 15.into()) == 15); // UTF-16 to UTF-8 - assert_eq!(col_index.utf16_to_utf8_col(1, 15), TextUnit::from_usize(15)); + assert_eq!(col_index.utf16_to_utf8_col(1, 15), TextSize::from_usize(15)); - assert_eq!(col_index.utf16_to_utf8_col(1, 18), TextUnit::from_usize(20)); - assert_eq!(col_index.utf16_to_utf8_col(1, 19), TextUnit::from_usize(23)); + assert_eq!(col_index.utf16_to_utf8_col(1, 18), TextSize::from_usize(20)); + assert_eq!(col_index.utf16_to_utf8_col(1, 19), TextSize::from_usize(23)); - assert_eq!(col_index.utf16_to_utf8_col(2, 15), TextUnit::from_usize(15)); + assert_eq!(col_index.utf16_to_utf8_col(2, 15), TextSize::from_usize(15)); } #[test] fn test_splitlines() { fn r(lo: u32, hi: u32) -> TextRange { - TextRange::from_to(lo.into(), hi.into()) + TextRange::new(lo.into(), hi.into()) } let text = "a\nbb\nccc\n"; diff --git a/crates/ra_ide_db/src/line_index_utils.rs b/crates/ra_ide_db/src/line_index_utils.rs index 2ebbabdc6d..f050fe77ff 100644 --- a/crates/ra_ide_db/src/line_index_utils.rs +++ b/crates/ra_ide_db/src/line_index_utils.rs @@ -1,20 +1,20 @@ //! Code actions can specify desirable final position of the cursor. //! -//! The position is specified as a `TextUnit` in the final file. We need to send +//! The position is specified as a `TextSize` in the final file. We need to send //! it in `(Line, Column)` coordinate though. However, we only have a LineIndex //! for a file pre-edit! //! //! Code in this module applies this "to (Line, Column) after edit" //! transformation. -use ra_syntax::{TextRange, TextUnit}; +use ra_syntax::{TextRange, TextSize}; use ra_text_edit::{AtomTextEdit, TextEdit}; use crate::line_index::{LineCol, LineIndex, Utf16Char}; pub fn translate_offset_with_edit( line_index: &LineIndex, - offset: TextUnit, + offset: TextSize, text_edit: &TextEdit, ) -> LineCol { let mut state = Edits::from_text_edit(&text_edit); @@ -84,7 +84,7 @@ pub fn translate_offset_with_edit( #[derive(Debug, Clone)] enum Step { - Newline(TextUnit), + Newline(TextSize), Utf16Char(TextRange), } @@ -92,7 +92,7 @@ enum Step { struct LineIndexStepIter<'a> { line_index: &'a LineIndex, next_newline_idx: usize, - utf16_chars: Option<(TextUnit, std::slice::Iter<'a, Utf16Char>)>, + utf16_chars: Option<(TextSize, std::slice::Iter<'a, Utf16Char>)>, } impl LineIndexStepIter<'_> { @@ -111,7 +111,7 @@ impl Iterator for LineIndexStepIter<'_> { .as_mut() .and_then(|(newline, x)| { let x = x.next()?; - Some(Step::Utf16Char(TextRange::from_to(*newline + x.start, *newline + x.end))) + Some(Step::Utf16Char(TextRange::new(*newline + x.start, *newline + x.end))) }) .or_else(|| { let next_newline = *self.line_index.newlines.get(self.next_newline_idx)?; @@ -129,7 +129,7 @@ impl Iterator for LineIndexStepIter<'_> { #[derive(Debug)] struct OffsetStepIter<'a> { text: &'a str, - offset: TextUnit, + offset: TextSize, } impl Iterator for OffsetStepIter<'_> { @@ -140,15 +140,15 @@ impl Iterator for OffsetStepIter<'_> { .char_indices() .filter_map(|(i, c)| { if c == '\n' { - let next_offset = self.offset + TextUnit::from_usize(i + 1); + let next_offset = self.offset + TextSize::from_usize(i + 1); let next = Step::Newline(next_offset); Some((next, next_offset)) } else { - let char_len = TextUnit::of_char(c); - if char_len > TextUnit::from_usize(1) { - let start = self.offset + TextUnit::from_usize(i); + let char_len = TextSize::of(c); + if char_len > TextSize::from_usize(1) { + let start = self.offset + TextSize::from_usize(i); let end = start + char_len; - let next = Step::Utf16Char(TextRange::from_to(start, end)); + let next = Step::Utf16Char(TextRange::new(start, end)); let next_offset = end; Some((next, next_offset)) } else { @@ -157,7 +157,7 @@ impl Iterator for OffsetStepIter<'_> { } }) .next()?; - let next_idx = (next_offset - self.offset).to_usize(); + let next_idx: usize = (next_offset - self.offset).into(); self.text = &self.text[next_idx..]; self.offset = next_offset; Some(next) @@ -195,7 +195,7 @@ impl<'a> Edits<'a> { match self.edits.split_first() { Some((next, rest)) => { let delete = self.translate_range(next.delete); - let diff = next.insert.len() as i64 - next.delete.len().to_usize() as i64; + let diff = next.insert.len() as i64 - usize::from(next.delete.len()) as i64; self.current = Some(TranslatedEdit { delete, insert: &next.insert, diff }); self.edits = rest; } @@ -244,15 +244,15 @@ impl<'a> Edits<'a> { } else { let start = self.translate(range.start()); let end = self.translate(range.end()); - TextRange::from_to(start, end) + TextRange::new(start, end) } } - fn translate(&self, x: TextUnit) -> TextUnit { + fn translate(&self, x: TextSize) -> TextSize { if self.acc_diff == 0 { x } else { - TextUnit::from((x.to_usize() as i64 + self.acc_diff) as u32) + TextSize::from((usize::from(x) as i64 + self.acc_diff) as u32) } } @@ -271,29 +271,29 @@ impl<'a> Edits<'a> { #[derive(Debug)] struct RunningLineCol { line: u32, - last_newline: TextUnit, - col_adjust: TextUnit, + last_newline: TextSize, + col_adjust: TextSize, } impl RunningLineCol { fn new() -> RunningLineCol { - RunningLineCol { line: 0, last_newline: TextUnit::from(0), col_adjust: TextUnit::from(0) } + RunningLineCol { line: 0, last_newline: TextSize::from(0), col_adjust: TextSize::from(0) } } - fn to_line_col(&self, offset: TextUnit) -> LineCol { + fn to_line_col(&self, offset: TextSize) -> LineCol { LineCol { line: self.line, col_utf16: ((offset - self.last_newline) - self.col_adjust).into(), } } - fn add_line(&mut self, newline: TextUnit) { + fn add_line(&mut self, newline: TextSize) { self.line += 1; self.last_newline = newline; - self.col_adjust = TextUnit::from(0); + self.col_adjust = TextSize::from(0); } fn adjust_col(&mut self, range: TextRange) { - self.col_adjust += range.len() - TextUnit::from(1); + self.col_adjust += range.len() - TextSize::from(1); } } diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs index 1bf014149a..c66de4f422 100644 --- a/crates/ra_ide_db/src/search.rs +++ b/crates/ra_ide_db/src/search.rs @@ -10,7 +10,7 @@ use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; use once_cell::unsync::Lazy; use ra_db::{FileId, FileRange, SourceDatabaseExt}; use ra_prof::profile; -use ra_syntax::{ast, match_ast, AstNode, TextRange, TextUnit}; +use ra_syntax::{ast, match_ast, AstNode, TextRange, TextSize}; use rustc_hash::FxHashMap; use test_utils::tested_by; @@ -85,7 +85,7 @@ impl SearchScope { match (r1, r2) { (None, r) | (r, None) => Some(r), (Some(r1), Some(r2)) => { - let r = r1.intersection(&r2)?; + let r = r1.intersect(r2)?; Some(Some(r)) } } @@ -200,14 +200,13 @@ impl Definition { for (file_id, search_range) in search_scope { let text = db.file_text(file_id); - let search_range = - search_range.unwrap_or(TextRange::offset_len(0.into(), TextUnit::of_str(&text))); + let search_range = search_range.unwrap_or(TextRange::up_to(TextSize::of(&text))); let sema = Semantics::new(db); let tree = Lazy::new(|| sema.parse(file_id).syntax().clone()); for (idx, _) in text.match_indices(pat) { - let offset = TextUnit::from_usize(idx); + let offset = TextSize::from_usize(idx); if !search_range.contains_inclusive(offset) { tested_by!(search_filters_by_range; force); continue; diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 2b4390eb26..fa9787266b 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs @@ -5,7 +5,7 @@ use ra_syntax::{ ast::{self, make::tokens::doc_comment}, tokenize, AstToken, Parse, SmolStr, SyntaxKind, SyntaxKind::*, - SyntaxNode, SyntaxToken, SyntaxTreeBuilder, TextRange, TextUnit, Token as RawToken, T, + SyntaxNode, SyntaxToken, SyntaxTreeBuilder, TextRange, TextSize, Token as RawToken, T, }; use rustc_hash::FxHashMap; use tt::buffer::{Cursor, TokenBuffer}; @@ -99,11 +99,11 @@ pub fn parse_to_token_tree(text: &str) -> Option<(tt::Subtree, TokenMap)> { let mut conv = RawConvertor { text, - offset: TextUnit::default(), + offset: TextSize::default(), inner: tokens.iter(), id_alloc: TokenIdAlloc { map: Default::default(), - global_offset: TextUnit::default(), + global_offset: TextSize::default(), next_id: 0, }, }; @@ -227,7 +227,7 @@ fn convert_doc_comment(token: &ra_syntax::SyntaxToken) -> Option { text: &'a str, - offset: TextUnit, + offset: TextSize, id_alloc: TokenIdAlloc, inner: std::slice::Iter<'a, RawToken>, } @@ -314,7 +314,7 @@ trait TokenConvertor { } result.push(if k.is_punct() { - assert_eq!(range.len().to_usize(), 1); + assert_eq!(range.len(), TextSize::of('.')); let delim = match k { T!['('] => Some((tt::DelimiterKind::Parenthesis, T![')'])), T!['{'] => Some((tt::DelimiterKind::Brace, T!['}'])), @@ -381,8 +381,8 @@ trait TokenConvertor { k if k.is_keyword() => make_leaf!(Ident), k if k.is_literal() => make_leaf!(Literal), LIFETIME => { - let char_unit = TextUnit::from_usize(1); - let r = TextRange::offset_len(range.start(), char_unit); + let char_unit = TextSize::of('\''); + let r = TextRange::at(range.start(), char_unit); let apostrophe = tt::Leaf::from(tt::Punct { char: '\'', spacing: tt::Spacing::Joint, @@ -390,8 +390,7 @@ trait TokenConvertor { }); result.push(apostrophe.into()); - let r = - TextRange::offset_len(range.start() + char_unit, range.len() - char_unit); + let r = TextRange::at(range.start() + char_unit, range.len() - char_unit); let ident = tt::Leaf::from(tt::Ident { text: SmolStr::new(&token.to_text()[1..]), id: self.id_alloc().alloc(r), @@ -440,7 +439,7 @@ impl<'a> TokenConvertor for RawConvertor<'a> { fn bump(&mut self) -> Option<(Self::Token, TextRange)> { let token = self.inner.next()?; - let range = TextRange::offset_len(self.offset, token.len); + let range = TextRange::at(self.offset, token.len); self.offset += token.len; Some(((*token, &self.text[range]), range)) @@ -450,7 +449,7 @@ impl<'a> TokenConvertor for RawConvertor<'a> { let token = self.inner.as_slice().get(0).cloned(); token.map(|it| { - let range = TextRange::offset_len(self.offset, it.len); + let range = TextRange::at(self.offset, it.len); (it, &self.text[range]) }) } @@ -464,11 +463,11 @@ struct Convertor { id_alloc: TokenIdAlloc, current: Option, range: TextRange, - punct_offset: Option<(SyntaxToken, TextUnit)>, + punct_offset: Option<(SyntaxToken, TextSize)>, } impl Convertor { - fn new(node: &SyntaxNode, global_offset: TextUnit) -> Convertor { + fn new(node: &SyntaxNode, global_offset: TextSize) -> Convertor { Convertor { id_alloc: { TokenIdAlloc { map: TokenMap::default(), global_offset, next_id: 0 } }, current: node.first_token(), @@ -481,7 +480,7 @@ impl Convertor { #[derive(Debug)] enum SynToken { Ordiniary(SyntaxToken), - Punch(SyntaxToken, TextUnit), + Punch(SyntaxToken, TextSize), } impl SynToken { @@ -500,7 +499,7 @@ impl SrcToken for SynToken { fn to_char(&self) -> Option { match self { SynToken::Ordiniary(_) => None, - SynToken::Punch(it, i) => it.text().chars().nth(i.to_usize()), + SynToken::Punch(it, i) => it.text().chars().nth((*i).into()), } } fn to_text(&self) -> SmolStr { @@ -516,26 +515,26 @@ impl TokenConvertor for Convertor { fn bump(&mut self) -> Option<(Self::Token, TextRange)> { if let Some((punct, offset)) = self.punct_offset.clone() { - if offset.to_usize() + 1 < punct.text().len() { - let offset = offset + TextUnit::from_usize(1); + if usize::from(offset) + 1 < punct.text().len() { + let offset = offset + TextSize::from_usize(1); let range = punct.text_range(); self.punct_offset = Some((punct.clone(), offset)); - let range = TextRange::offset_len(range.start() + offset, TextUnit::from_usize(1)); + let range = TextRange::at(range.start() + offset, TextSize::of('.')); return Some((SynToken::Punch(punct, offset), range)); } } let curr = self.current.clone()?; - if !curr.text_range().is_subrange(&self.range) { + if !&self.range.contains_range(curr.text_range()) { return None; } self.current = curr.next_token(); let token = if curr.kind().is_punct() { let range = curr.text_range(); - let range = TextRange::offset_len(range.start(), TextUnit::from_usize(1)); - self.punct_offset = Some((curr.clone(), TextUnit::from_usize(0))); - (SynToken::Punch(curr, TextUnit::from_usize(0)), range) + let range = TextRange::at(range.start(), TextSize::from_usize(1)); + self.punct_offset = Some((curr.clone(), TextSize::from_usize(0))); + (SynToken::Punch(curr, TextSize::from_usize(0)), range) } else { self.punct_offset = None; let range = curr.text_range(); @@ -547,19 +546,19 @@ impl TokenConvertor for Convertor { fn peek(&self) -> Option { if let Some((punct, mut offset)) = self.punct_offset.clone() { - offset = offset + TextUnit::from_usize(1); - if offset.to_usize() < punct.text().len() { + offset = offset + TextSize::from_usize(1); + if usize::from(offset) < punct.text().len() { return Some(SynToken::Punch(punct, offset)); } } let curr = self.current.clone()?; - if !curr.text_range().is_subrange(&self.range) { + if !self.range.contains_range(curr.text_range()) { return None; } let token = if curr.kind().is_punct() { - SynToken::Punch(curr, TextUnit::from_usize(0)) + SynToken::Punch(curr, TextSize::from_usize(0)) } else { SynToken::Ordiniary(curr) }; @@ -574,8 +573,8 @@ impl TokenConvertor for Convertor { struct TtTreeSink<'a> { buf: String, cursor: Cursor<'a>, - open_delims: FxHashMap, - text_pos: TextUnit, + open_delims: FxHashMap, + text_pos: TextSize, inner: SyntaxTreeBuilder, token_map: TokenMap, @@ -641,7 +640,7 @@ impl<'a> TreeSink for TtTreeSink<'a> { } tt::Leaf::Literal(lit) => (lit.text.clone(), lit.id), }; - let range = TextRange::offset_len(self.text_pos, TextUnit::of_str(&text)); + let range = TextRange::at(self.text_pos, TextSize::of(text.as_str())); self.token_map.insert(id, range); self.cursor = self.cursor.bump(); text @@ -658,10 +657,8 @@ impl<'a> TreeSink for TtTreeSink<'a> { self.cursor = self.cursor.bump(); if let Some(id) = parent.delimiter.map(|it| it.id) { if let Some(open_delim) = self.open_delims.get(&id) { - let open_range = - TextRange::offset_len(*open_delim, TextUnit::from_usize(1)); - let close_range = - TextRange::offset_len(self.text_pos, TextUnit::from_usize(1)); + let open_range = TextRange::at(*open_delim, TextSize::of('(')); + let close_range = TextRange::at(self.text_pos, TextSize::of('(')); self.token_map.insert_delim(id, open_range, close_range); } } @@ -672,7 +669,7 @@ impl<'a> TreeSink for TtTreeSink<'a> { } }; self.buf += &text; - self.text_pos += TextUnit::of_str(&text); + self.text_pos += TextSize::of(text.as_str()); } let text = SmolStr::new(self.buf.as_str()); @@ -690,7 +687,7 @@ impl<'a> TreeSink for TtTreeSink<'a> { // other parts of RA such that we don't add whitespace here. if curr.spacing == tt::Spacing::Alone && curr.char != ';' { self.inner.token(WHITESPACE, " ".into()); - self.text_pos += TextUnit::of_char(' '); + self.text_pos += TextSize::of(' '); } } } diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index 75a2f696e9..dda396582f 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] itertools = "0.9.0" -rowan = "0.9.1" +rowan = { path = "../../../rowan" } rustc_lexer = { version = "652.0.0", package = "rustc-ap-rustc_lexer" } rustc-hash = "1.1.0" arrayvec = "0.5.1" diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs index 06df8495c9..2a8dac757b 100644 --- a/crates/ra_syntax/src/algo.rs +++ b/crates/ra_syntax/src/algo.rs @@ -11,7 +11,7 @@ use rustc_hash::FxHashMap; use crate::{ AstNode, Direction, NodeOrToken, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxNodePtr, - SyntaxToken, TextRange, TextUnit, + SyntaxToken, TextRange, TextSize, }; /// Returns ancestors of the node at the offset, sorted by length. This should @@ -21,7 +21,7 @@ use crate::{ /// t.parent().ancestors())`. pub fn ancestors_at_offset( node: &SyntaxNode, - offset: TextUnit, + offset: TextSize, ) -> impl Iterator { node.token_at_offset(offset) .map(|token| token.parent().ancestors()) @@ -37,7 +37,7 @@ pub fn ancestors_at_offset( /// ``` /// /// then the shorter node will be silently preferred. -pub fn find_node_at_offset(syntax: &SyntaxNode, offset: TextUnit) -> Option { +pub fn find_node_at_offset(syntax: &SyntaxNode, offset: TextSize) -> Option { ancestors_at_offset(syntax, offset).find_map(N::cast) } @@ -180,7 +180,7 @@ fn _insert_children( position: InsertPosition, to_insert: &mut dyn Iterator, ) -> SyntaxNode { - let mut delta = TextUnit::default(); + let mut delta = TextSize::default(); let to_insert = to_insert.map(|element| { delta += element.text_range().len(); to_green_element(element) @@ -347,7 +347,7 @@ fn with_children( parent: &SyntaxNode, new_children: Vec>, ) -> SyntaxNode { - let len = new_children.iter().map(|it| it.text_len()).sum::(); + let len = new_children.iter().map(|it| it.text_len()).sum::(); let new_node = rowan::GreenNode::new(rowan::SyntaxKind(parent.kind() as u16), new_children); let new_root_node = parent.replace_with(new_node); let new_root_node = SyntaxNode::new_root(new_root_node); @@ -355,7 +355,7 @@ fn with_children( // FIXME: use a more elegant way to re-fetch the node (#1185), make // `range` private afterwards let mut ptr = SyntaxNodePtr::new(parent); - ptr.range = TextRange::offset_len(ptr.range.start(), len); + ptr.range = TextRange::at(ptr.range.start(), len); ptr.to_node(&new_root_node) } diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index aa34b682d9..26b8f9c364 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs @@ -2,7 +2,7 @@ use crate::{ ast::{AstToken, Comment, RawString, String, Whitespace}, - TextRange, TextUnit, + TextRange, TextSize, }; impl Comment { @@ -94,14 +94,14 @@ impl QuoteOffsets { return None; } - let start = TextUnit::from(0); - let left_quote = TextUnit::from_usize(left_quote) + TextUnit::of_char('"'); - let right_quote = TextUnit::from_usize(right_quote); - let end = TextUnit::of_str(literal); + let start = TextSize::from(0); + let left_quote = TextSize::from_usize(left_quote) + TextSize::of('"'); + let right_quote = TextSize::from_usize(right_quote); + let end = TextSize::of(literal); let res = QuoteOffsets { - quotes: [TextRange::from_to(start, left_quote), TextRange::from_to(right_quote, end)], - contents: TextRange::from_to(left_quote, right_quote), + quotes: [TextRange::new(start, left_quote), TextRange::new(right_quote, end)], + contents: TextRange::new(left_quote, right_quote), }; Some(res) } @@ -168,7 +168,7 @@ impl HasStringValue for RawString { impl RawString { pub fn map_range_up(&self, range: TextRange) -> Option { let contents_range = self.text_range_between_quotes()?; - assert!(range.is_subrange(&TextRange::offset_len(0.into(), contents_range.len()))); + assert!(TextRange::up_to(contents_range.len()).contains_range(range)); Some(range + contents_range.start()) } } @@ -459,7 +459,7 @@ pub trait HasFormatSpecifier: AstToken { while let Some((r, Ok(next_char))) = chars.peek() { if next_char.is_ascii_digit() { chars.next(); - range = range.extend_to(r); + range = range.cover(*r); } else { break; } @@ -477,7 +477,7 @@ pub trait HasFormatSpecifier: AstToken { while let Some((r, Ok(next_char))) = chars.peek() { if *next_char == '_' || next_char.is_ascii_digit() || next_char.is_alphabetic() { chars.next(); - range = range.extend_to(r); + range = range.cover(*r); } else { break; } @@ -498,10 +498,8 @@ impl HasFormatSpecifier for String { let mut res = Vec::with_capacity(text.len()); rustc_lexer::unescape::unescape_str(text, &mut |range, unescaped_char| { res.push(( - TextRange::from_to( - TextUnit::from_usize(range.start), - TextUnit::from_usize(range.end), - ) + offset, + TextRange::new(TextSize::from_usize(range.start), TextSize::from_usize(range.end)) + + offset, unescaped_char, )) }); @@ -521,10 +519,8 @@ impl HasFormatSpecifier for RawString { let mut res = Vec::with_capacity(text.len()); for (idx, c) in text.char_indices() { res.push(( - TextRange::from_to( - TextUnit::from_usize(idx), - TextUnit::from_usize(idx + c.len_utf8()), - ) + offset, + TextRange::new(TextSize::from_usize(idx), TextSize::from_usize(idx + c.len_utf8())) + + offset, Ok(c), )); } diff --git a/crates/ra_syntax/src/fuzz.rs b/crates/ra_syntax/src/fuzz.rs index 7012df7f02..15aad22056 100644 --- a/crates/ra_syntax/src/fuzz.rs +++ b/crates/ra_syntax/src/fuzz.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use crate::{validation, AstNode, SourceFile, TextRange, TextUnit}; +use crate::{validation, AstNode, SourceFile, TextRange, TextSize}; use ra_text_edit::AtomTextEdit; use std::str::{self, FromStr}; @@ -34,10 +34,8 @@ impl CheckReparse { let text = lines.collect::>().join("\n"); let text = format!("{}{}{}", PREFIX, text, SUFFIX); text.get(delete_start..delete_start.checked_add(delete_len)?)?; // make sure delete is a valid range - let delete = TextRange::offset_len( - TextUnit::from_usize(delete_start), - TextUnit::from_usize(delete_len), - ); + let delete = + TextRange::at(TextSize::from_usize(delete_start), TextSize::from_usize(delete_len)); let edited_text = format!("{}{}{}", &text[..delete_start], &insert, &text[delete_start + delete_len..]); let edit = AtomTextEdit { delete, insert }; diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index a796e78b12..ceeb2bde9f 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs @@ -55,7 +55,7 @@ pub use crate::{ }, }; pub use ra_parser::{SyntaxKind, T}; -pub use rowan::{SmolStr, SyntaxText, TextRange, TextUnit, TokenAtOffset, WalkEvent}; +pub use rowan::{SmolStr, SyntaxText, TextRange, TextSize, TokenAtOffset, WalkEvent}; /// `Parse` is the result of the parsing: a syntax tree and a collection of /// errors. @@ -266,7 +266,7 @@ fn api_walkthrough() { assert_eq!(expr_syntax.kind(), SyntaxKind::BIN_EXPR); // And text range: - assert_eq!(expr_syntax.text_range(), TextRange::from_to(32.into(), 37.into())); + assert_eq!(expr_syntax.text_range(), TextRange::new(32.into(), 37.into())); // You can get node's text as a `SyntaxText` object, which will traverse the // tree collecting token's text: diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index 67c1f1b48d..1fdc76d986 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs @@ -4,7 +4,7 @@ use crate::{ SyntaxError, SyntaxKind::{self, *}, - TextRange, TextUnit, T, + TextRange, TextSize, T, }; /// A token of Rust source. @@ -13,7 +13,7 @@ pub struct Token { /// The kind of token. pub kind: SyntaxKind, /// The length of the token. - pub len: TextUnit, + pub len: TextSize, } /// Break a string up into its component tokens. @@ -30,7 +30,7 @@ pub fn tokenize(text: &str) -> (Vec, Vec) { let mut offset: usize = rustc_lexer::strip_shebang(text) .map(|shebang_len| { - tokens.push(Token { kind: SHEBANG, len: TextUnit::from_usize(shebang_len) }); + tokens.push(Token { kind: SHEBANG, len: TextSize::from_usize(shebang_len) }); shebang_len }) .unwrap_or(0); @@ -38,8 +38,8 @@ pub fn tokenize(text: &str) -> (Vec, Vec) { let text_without_shebang = &text[offset..]; for rustc_token in rustc_lexer::tokenize(text_without_shebang) { - let token_len = TextUnit::from_usize(rustc_token.len); - let token_range = TextRange::offset_len(TextUnit::from_usize(offset), token_len); + let token_len = TextSize::from_usize(rustc_token.len); + let token_range = TextRange::at(TextSize::from_usize(offset), token_len); let (syntax_kind, err_message) = rustc_token_kind_to_syntax_kind(&rustc_token.kind, &text[token_range]); @@ -65,7 +65,7 @@ pub fn tokenize(text: &str) -> (Vec, Vec) { /// Beware that unescape errors are not checked at tokenization time. pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option)> { lex_first_token(text) - .filter(|(token, _)| token.len == TextUnit::of_str(text)) + .filter(|(token, _)| token.len == TextSize::of(text)) .map(|(token, error)| (token.kind, error)) } @@ -75,7 +75,7 @@ pub fn lex_single_syntax_kind(text: &str) -> Option<(SyntaxKind, Option Option { lex_first_token(text) - .filter(|(token, error)| !error.is_some() && token.len == TextUnit::of_str(text)) + .filter(|(token, error)| !error.is_some() && token.len == TextSize::of(text)) .map(|(token, _error)| token.kind) } @@ -96,9 +96,9 @@ fn lex_first_token(text: &str) -> Option<(Token, Option)> { let rustc_token = rustc_lexer::first_token(text); let (syntax_kind, err_message) = rustc_token_kind_to_syntax_kind(&rustc_token.kind, text); - let token = Token { kind: syntax_kind, len: TextUnit::from_usize(rustc_token.len) }; + let token = Token { kind: syntax_kind, len: TextSize::from_usize(rustc_token.len) }; let optional_error = err_message.map(|err_message| { - SyntaxError::new(err_message, TextRange::from_to(0.into(), TextUnit::of_str(text))) + SyntaxError::new(err_message, TextRange::new(0.into(), TextSize::of(text))) }); Some((token, optional_error)) diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index 2d65b91f13..ffff0a7b20 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs @@ -19,7 +19,7 @@ use crate::{ syntax_node::{GreenNode, GreenToken, NodeOrToken, SyntaxElement, SyntaxNode}, SyntaxError, SyntaxKind::*, - TextRange, TextUnit, T, + TextRange, TextSize, T, }; pub(crate) fn incremental_reparse( @@ -176,7 +176,7 @@ fn merge_errors( if old_err_range.end() <= range_before_reparse.start() { res.push(old_err); } else if old_err_range.start() >= range_before_reparse.end() { - let inserted_len = TextUnit::of_str(&edit.insert); + let inserted_len = TextSize::of(&edit.insert); res.push(old_err.with_range((old_err_range + inserted_len) - edit.delete.len())); // Note: extra parens are intentional to prevent uint underflow, HWAB (here was a bug) } diff --git a/crates/ra_syntax/src/parsing/text_token_source.rs b/crates/ra_syntax/src/parsing/text_token_source.rs index e2433913ca..7ddc2c2c39 100644 --- a/crates/ra_syntax/src/parsing/text_token_source.rs +++ b/crates/ra_syntax/src/parsing/text_token_source.rs @@ -3,7 +3,7 @@ use ra_parser::Token as PToken; use ra_parser::TokenSource; -use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextUnit}; +use crate::{parsing::lexer::Token, SyntaxKind::EOF, TextRange, TextSize}; pub(crate) struct TextTokenSource<'t> { text: &'t str, @@ -15,7 +15,7 @@ pub(crate) struct TextTokenSource<'t> { /// 0 7 10 /// ``` /// (token, start_offset): `[(struct, 0), (Foo, 7), (;, 10)]` - start_offsets: Vec, + start_offsets: Vec, /// non-whitespace/comment tokens /// ```non-rust /// struct Foo {} @@ -51,12 +51,12 @@ impl<'t> TokenSource for TextTokenSource<'t> { if pos >= self.tokens.len() { return false; } - let range = TextRange::offset_len(self.start_offsets[pos], self.tokens[pos].len); + let range = TextRange::at(self.start_offsets[pos], self.tokens[pos].len); self.text[range] == *kw } } -fn mk_token(pos: usize, start_offsets: &[TextUnit], tokens: &[Token]) -> PToken { +fn mk_token(pos: usize, start_offsets: &[TextSize], tokens: &[Token]) -> PToken { let kind = tokens.get(pos).map(|t| t.kind).unwrap_or(EOF); let is_jointed_to_next = if pos + 1 < start_offsets.len() { start_offsets[pos] + tokens[pos].len == start_offsets[pos + 1] diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index 87bb21cd9a..22aed1db16 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs @@ -9,7 +9,7 @@ use crate::{ syntax_node::GreenNode, SmolStr, SyntaxError, SyntaxKind::{self, *}, - SyntaxTreeBuilder, TextRange, TextUnit, + SyntaxTreeBuilder, TextRange, TextSize, }; /// Bridges the parser with our specific syntax tree representation. @@ -18,7 +18,7 @@ use crate::{ pub(crate) struct TextTreeSink<'a> { text: &'a str, tokens: &'a [Token], - text_pos: TextUnit, + text_pos: TextSize, token_pos: usize, state: State, inner: SyntaxTreeBuilder, @@ -42,7 +42,7 @@ impl<'a> TreeSink for TextTreeSink<'a> { let len = self.tokens[self.token_pos..self.token_pos + n_tokens] .iter() .map(|it| it.len) - .sum::(); + .sum::(); self.do_token(kind, len, n_tokens); } @@ -62,12 +62,12 @@ impl<'a> TreeSink for TextTreeSink<'a> { self.tokens[self.token_pos..].iter().take_while(|it| it.kind.is_trivia()).count(); let leading_trivias = &self.tokens[self.token_pos..self.token_pos + n_trivias]; let mut trivia_end = - self.text_pos + leading_trivias.iter().map(|it| it.len).sum::(); + self.text_pos + leading_trivias.iter().map(|it| it.len).sum::(); let n_attached_trivias = { let leading_trivias = leading_trivias.iter().rev().map(|it| { let next_end = trivia_end - it.len; - let range = TextRange::from_to(next_end, trivia_end); + let range = TextRange::new(next_end, trivia_end); trivia_end = next_end; (it.kind, &self.text[range]) }); @@ -132,8 +132,8 @@ impl<'a> TextTreeSink<'a> { } } - fn do_token(&mut self, kind: SyntaxKind, len: TextUnit, n_tokens: usize) { - let range = TextRange::offset_len(self.text_pos, len); + fn do_token(&mut self, kind: SyntaxKind, len: TextSize, n_tokens: usize) { + let range = TextRange::at(self.text_pos, len); let text: SmolStr = self.text[range].into(); self.text_pos += len; self.token_pos += n_tokens; diff --git a/crates/ra_syntax/src/ptr.rs b/crates/ra_syntax/src/ptr.rs index ecbfffcf42..62f03e93d0 100644 --- a/crates/ra_syntax/src/ptr.rs +++ b/crates/ra_syntax/src/ptr.rs @@ -24,7 +24,7 @@ impl SyntaxNodePtr { pub fn to_node(&self, root: &SyntaxNode) -> SyntaxNode { assert!(root.parent().is_none()); successors(Some(root.clone()), |node| { - node.children().find(|it| self.range.is_subrange(&it.text_range())) + node.children().find(|it| it.text_range().contains_range(self.range)) }) .find(|it| it.text_range() == self.range && it.kind() == self.kind) .unwrap_or_else(|| panic!("can't resolve local ptr to SyntaxNode: {:?}", self)) diff --git a/crates/ra_syntax/src/syntax_error.rs b/crates/ra_syntax/src/syntax_error.rs index 54acf7847b..7c4511fece 100644 --- a/crates/ra_syntax/src/syntax_error.rs +++ b/crates/ra_syntax/src/syntax_error.rs @@ -2,7 +2,7 @@ use std::fmt; -use crate::{TextRange, TextUnit}; +use crate::{TextRange, TextSize}; /// Represents the result of unsuccessful tokenization, parsing /// or tree validation. @@ -23,8 +23,8 @@ impl SyntaxError { pub fn new(message: impl Into, range: TextRange) -> Self { Self(message.into(), range) } - pub fn new_at_offset(message: impl Into, offset: TextUnit) -> Self { - Self(message.into(), TextRange::offset_len(offset, 0.into())) + pub fn new_at_offset(message: impl Into, offset: TextSize) -> Self { + Self(message.into(), TextRange::empty(offset)) } pub fn range(&self) -> TextRange { diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs index 4e3a1460d5..f9d379abf3 100644 --- a/crates/ra_syntax/src/syntax_node.rs +++ b/crates/ra_syntax/src/syntax_node.rs @@ -8,7 +8,7 @@ use rowan::{GreenNodeBuilder, Language}; -use crate::{Parse, SmolStr, SyntaxError, SyntaxKind, TextUnit}; +use crate::{Parse, SmolStr, SyntaxError, SyntaxKind, TextSize}; pub(crate) use rowan::{GreenNode, GreenToken}; @@ -69,7 +69,7 @@ impl SyntaxTreeBuilder { self.inner.finish_node() } - pub fn error(&mut self, error: ra_parser::ParseError, text_pos: TextUnit) { + pub fn error(&mut self, error: ra_parser::ParseError, text_pos: TextSize) { self.errors.push(SyntaxError::new_at_offset(error.0, text_pos)) } } diff --git a/crates/ra_syntax/src/tests.rs b/crates/ra_syntax/src/tests.rs index 355843b946..4f2b67febd 100644 --- a/crates/ra_syntax/src/tests.rs +++ b/crates/ra_syntax/src/tests.rs @@ -5,7 +5,7 @@ use std::{ use test_utils::{collect_rust_files, dir_tests, project_dir, read_text}; -use crate::{fuzz, tokenize, SourceFile, SyntaxError, TextRange, TextUnit, Token}; +use crate::{fuzz, tokenize, SourceFile, SyntaxError, TextRange, TextSize, Token}; #[test] fn lexer_tests() { @@ -121,12 +121,12 @@ fn assert_errors_are_absent(errors: &[SyntaxError], path: &Path) { fn dump_tokens_and_errors(tokens: &[Token], errors: &[SyntaxError], text: &str) -> String { let mut acc = String::new(); - let mut offset = TextUnit::from_usize(0); + let mut offset = TextSize::from_usize(0); for token in tokens { let token_len = token.len; - let token_text = &text[TextRange::offset_len(offset, token.len)]; + let token_text = &text[TextRange::at(offset, token.len)]; offset += token.len; - writeln!(acc, "{:?} {} {:?}", token.kind, token_len, token_text).unwrap(); + writeln!(acc, "{:?} {:?} {:?}", token.kind, token_len, token_text).unwrap(); } for err in errors { writeln!(acc, "> error{:?} token({:?}) msg({})", err.range(), &text[err.range()], err) diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index f85b3e61b4..77d7e132d8 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs @@ -7,7 +7,7 @@ use rustc_lexer::unescape; use crate::{ ast, match_ast, AstNode, SyntaxError, SyntaxKind::{BYTE, BYTE_STRING, CHAR, CONST_DEF, FN_DEF, INT_NUMBER, STRING, TYPE_ALIAS_DEF}, - SyntaxNode, SyntaxToken, TextUnit, T, + SyntaxNode, SyntaxToken, TextSize, T, }; fn rustc_unescape_error_to_string(err: unescape::EscapeError) -> &'static str { @@ -112,7 +112,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec) { // FIXME: lift this lambda refactor to `fn` (https://github.com/rust-analyzer/rust-analyzer/pull/2834#discussion_r366199205) let mut push_err = |prefix_len, (off, err): (usize, unescape::EscapeError)| { - let off = token.text_range().start() + TextUnit::from_usize(off + prefix_len); + let off = token.text_range().start() + TextSize::from_usize(off + prefix_len); acc.push(SyntaxError::new_at_offset(rustc_unescape_error_to_string(err), off)); }; diff --git a/crates/ra_text_edit/Cargo.toml b/crates/ra_text_edit/Cargo.toml index cae28389dc..9b0567c981 100644 --- a/crates/ra_text_edit/Cargo.toml +++ b/crates/ra_text_edit/Cargo.toml @@ -9,5 +9,4 @@ publish = false doctest = false [dependencies] -text_unit = "0.1.10" - +text-size = { path = "../../../text-size" } diff --git a/crates/ra_text_edit/src/lib.rs b/crates/ra_text_edit/src/lib.rs index f6769e6a64..e656260c73 100644 --- a/crates/ra_text_edit/src/lib.rs +++ b/crates/ra_text_edit/src/lib.rs @@ -2,7 +2,7 @@ mod text_edit; -use text_unit::{TextRange, TextUnit}; +use text_size::{TextRange, TextSize}; pub use crate::text_edit::{TextEdit, TextEditBuilder}; @@ -23,13 +23,13 @@ impl AtomTextEdit { AtomTextEdit::replace(range, String::new()) } - pub fn insert(offset: TextUnit, text: String) -> AtomTextEdit { - AtomTextEdit::replace(TextRange::offset_len(offset, 0.into()), text) + pub fn insert(offset: TextSize, text: String) -> AtomTextEdit { + AtomTextEdit::replace(TextRange::empty(offset), text) } pub fn apply(&self, mut text: String) -> String { - let start = self.delete.start().to_usize(); - let end = self.delete.end().to_usize(); + let start: usize = self.delete.start().into(); + let end: usize = self.delete.end().into(); text.replace_range(start..end, &self.insert); text } diff --git a/crates/ra_text_edit/src/text_edit.rs b/crates/ra_text_edit/src/text_edit.rs index 5c37a08a84..db69a7e7b6 100644 --- a/crates/ra_text_edit/src/text_edit.rs +++ b/crates/ra_text_edit/src/text_edit.rs @@ -1,7 +1,8 @@ //! FIXME: write short doc here use crate::AtomTextEdit; -use text_unit::{TextRange, TextUnit}; +// TODO: fix Cargo.toml +use text_size::{TextRange, TextSize}; #[derive(Debug, Clone)] pub struct TextEdit { @@ -20,19 +21,19 @@ impl TextEditBuilder { pub fn delete(&mut self, range: TextRange) { self.atoms.push(AtomTextEdit::delete(range)) } - pub fn insert(&mut self, offset: TextUnit, text: String) { + pub fn insert(&mut self, offset: TextSize, text: String) { self.atoms.push(AtomTextEdit::insert(offset, text)) } pub fn finish(self) -> TextEdit { TextEdit::from_atoms(self.atoms) } - pub fn invalidates_offset(&self, offset: TextUnit) -> bool { + pub fn invalidates_offset(&self, offset: TextSize) -> bool { self.atoms.iter().any(|atom| atom.delete.contains_inclusive(offset)) } } impl TextEdit { - pub fn insert(offset: TextUnit, text: String) -> TextEdit { + pub fn insert(offset: TextSize, text: String) -> TextEdit { let mut builder = TextEditBuilder::default(); builder.insert(offset, text); builder.finish() @@ -63,16 +64,16 @@ impl TextEdit { } pub fn apply(&self, text: &str) -> String { - let mut total_len = TextUnit::of_str(text); + let mut total_len = TextSize::of(text); for atom in self.atoms.iter() { - total_len += TextUnit::of_str(&atom.insert); + total_len += TextSize::of(&atom.insert); total_len -= atom.delete.end() - atom.delete.start(); } - let mut buf = String::with_capacity(total_len.to_usize()); + let mut buf = String::with_capacity(total_len.into()); let mut prev = 0; for atom in self.atoms.iter() { - let start = atom.delete.start().to_usize(); - let end = atom.delete.end().to_usize(); + let start: usize = atom.delete.start().into(); + let end: usize = atom.delete.end().into(); if start > prev { buf.push_str(&text[prev..start]); } @@ -80,11 +81,11 @@ impl TextEdit { prev = end; } buf.push_str(&text[prev..text.len()]); - assert_eq!(TextUnit::of_str(&buf), total_len); + assert_eq!(TextSize::of(&buf), total_len); buf } - pub fn apply_to_offset(&self, offset: TextUnit) -> Option { + pub fn apply_to_offset(&self, offset: TextSize) -> Option { let mut res = offset; for atom in self.atoms.iter() { if atom.delete.start() >= offset { @@ -93,7 +94,7 @@ impl TextEdit { if offset < atom.delete.end() { return None; } - res += TextUnit::of_str(&atom.insert); + res += TextSize::of(&atom.insert); res -= atom.delete.len(); } Some(res) diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs index 9fa7dad714..72183da151 100644 --- a/crates/rust-analyzer/src/cli/analysis_stats.rs +++ b/crates/rust-analyzer/src/cli/analysis_stats.rs @@ -130,7 +130,7 @@ pub fn analysis_stats( let original_file = src.file_id.original_file(db); let path = db.file_relative_path(original_file); let syntax_range = src.value.syntax().text_range(); - format_to!(msg, " ({:?} {})", path, syntax_range); + format_to!(msg, " ({:?} {:?})", path, syntax_range); } if verbosity.is_spammy() { bar.println(msg.to_string()); diff --git a/crates/rust-analyzer/src/conv.rs b/crates/rust-analyzer/src/conv.rs index 2285cb1d3d..b0f911f713 100644 --- a/crates/rust-analyzer/src/conv.rs +++ b/crates/rust-analyzer/src/conv.rs @@ -14,7 +14,7 @@ use ra_ide::{ InlayHint, InlayKind, InsertTextFormat, LineCol, LineIndex, NavigationTarget, RangeInfo, ReferenceAccess, Severity, SourceChange, SourceFileEdit, }; -use ra_syntax::{SyntaxKind, TextRange, TextUnit}; +use ra_syntax::{SyntaxKind, TextRange, TextSize}; use ra_text_edit::{AtomTextEdit, TextEdit}; use ra_vfs::LineEndings; @@ -124,13 +124,13 @@ impl ConvWith<(&LineIndex, LineEndings)> for CompletionItem { // LSP does not allow arbitrary edits in completion, so we have to do a // non-trivial mapping here. for atom_edit in self.text_edit().as_atoms() { - if self.source_range().is_subrange(&atom_edit.delete) { + if atom_edit.delete.contains_range(self.source_range()) { text_edit = Some(if atom_edit.delete == self.source_range() { atom_edit.conv_with((ctx.0, ctx.1)) } else { assert!(self.source_range().end() == atom_edit.delete.end()); let range1 = - TextRange::from_to(atom_edit.delete.start(), self.source_range().start()); + TextRange::new(atom_edit.delete.start(), self.source_range().start()); let range2 = self.source_range(); let edit1 = AtomTextEdit::replace(range1, String::new()); let edit2 = AtomTextEdit::replace(range2, atom_edit.insert.clone()); @@ -138,7 +138,7 @@ impl ConvWith<(&LineIndex, LineEndings)> for CompletionItem { edit2.conv_with((ctx.0, ctx.1)) }) } else { - assert!(self.source_range().intersection(&atom_edit.delete).is_none()); + assert!(self.source_range().intersect(atom_edit.delete).is_none()); additional_text_edits.push(atom_edit.conv_with((ctx.0, ctx.1))); } } @@ -184,15 +184,15 @@ impl ConvWith<(&LineIndex, LineEndings)> for CompletionItem { } impl ConvWith<&LineIndex> for Position { - type Output = TextUnit; + type Output = TextSize; - fn conv_with(self, line_index: &LineIndex) -> TextUnit { + fn conv_with(self, line_index: &LineIndex) -> TextSize { let line_col = LineCol { line: self.line as u32, col_utf16: self.character as u32 }; line_index.offset(line_col) } } -impl ConvWith<&LineIndex> for TextUnit { +impl ConvWith<&LineIndex> for TextSize { type Output = Position; fn conv_with(self, line_index: &LineIndex) -> Position { @@ -213,7 +213,7 @@ impl ConvWith<&LineIndex> for Range { type Output = TextRange; fn conv_with(self, line_index: &LineIndex) -> TextRange { - TextRange::from_to(self.start.conv_with(line_index), self.end.conv_with(line_index)) + TextRange::new(self.start.conv_with(line_index), self.end.conv_with(line_index)) } } @@ -300,7 +300,7 @@ impl ConvWith<&FoldConvCtx<'_>> for Fold { // range.end.line from the folding region if there is more text after range.end // on the same line. let has_more_text_on_end_line = ctx.text - [TextRange::from_to(self.range.end(), TextUnit::of_str(ctx.text))] + [TextRange::new(self.range.end(), TextSize::of(ctx.text))] .chars() .take_while(|it| *it != '\n') .any(|it| !it.is_whitespace()); diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 41d9fe344d..381f37f169 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs @@ -23,7 +23,7 @@ use ra_ide::{ SearchScope, }; use ra_prof::profile; -use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit}; +use ra_syntax::{AstNode, SyntaxKind, TextRange, TextSize}; use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use serde_json::to_value; @@ -97,7 +97,7 @@ pub fn handle_selection_range( .map(|position| { let mut ranges = Vec::new(); { - let mut range = TextRange::from_to(position, position); + let mut range = TextRange::new(position, position); loop { ranges.push(range); let frange = FileRange { file_id, range }; @@ -184,11 +184,11 @@ pub fn handle_on_type_formatting( // in `ra_ide`, the `on_type` invariant is that // `text.char_at(position) == typed_char`. - position.offset -= TextUnit::of_char('.'); + position.offset -= TextSize::of('.'); let char_typed = params.ch.chars().next().unwrap_or('\0'); assert!({ let text = world.analysis().file_text(position.file_id)?; - text[position.offset.to_usize()..].starts_with(char_typed) + text[usize::from(position.offset)..].starts_with(char_typed) }); // We have an assist that inserts ` ` after typing `->` in `fn foo() ->{`, @@ -403,7 +403,7 @@ pub fn handle_completion( let syntax = source_file.syntax(); let text = syntax.text(); if let Some(next_char) = text.char_at(position.offset) { - let diff = TextUnit::of_char(next_char) + TextUnit::of_char(':'); + let diff = TextSize::of(next_char) + TextSize::of(':'); let prev_char = position.offset - diff; if text.char_at(prev_char) != Some(':') { res = true; @@ -592,7 +592,7 @@ pub fn handle_formatting( let crate_ids = world.analysis().crate_for(file_id)?; let file_line_index = world.analysis().file_line_index(file_id)?; - let end_position = TextUnit::of_str(&file).conv_with(&file_line_index); + let end_position = TextSize::of(&file).conv_with(&file_line_index); let mut rustfmt = match &world.config.rustfmt { RustfmtConfig::Rustfmt { extra_args } => { @@ -698,7 +698,7 @@ pub fn handle_code_action( let fixes_from_diagnostics = diagnostics .into_iter() .filter_map(|d| Some((d.range, d.fix?))) - .filter(|(diag_range, _fix)| diag_range.intersection(&range).is_some()) + .filter(|(diag_range, _fix)| diag_range.intersect(range).is_some()) .map(|(_range, fix)| fix); for source_edit in fixes_from_diagnostics { @@ -723,7 +723,7 @@ pub fn handle_code_action( for fix in world.check_fixes.get(&file_id).into_iter().flatten() { let fix_range = fix.range.conv_with(&line_index); - if fix_range.intersection(&range).is_none() { + if fix_range.intersect(range).is_none() { continue; } res.push(fix.action.clone()); @@ -1107,7 +1107,7 @@ pub fn handle_semantic_tokens( let (token_index, modifier_bitset) = highlight_range.highlight.conv(); for mut range in line_index.lines(highlight_range.range) { if text[range].ends_with('\n') { - range = TextRange::from_to(range.start(), range.end() - TextUnit::of_char('\n')); + range = TextRange::new(range.start(), range.end() - TextSize::of('\n')); } let range = range.conv_with(&line_index); builder.push(range, token_index, modifier_bitset); diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 6a7c6d6f9e..652ab45371 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -9,5 +9,5 @@ doctest = false [dependencies] difference = "2.0.0" -text_unit = "0.1.10" +text-size = { path = "../../../text-size" } serde_json = "1.0.48" diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index 4164bfd5ed..b1365444a8 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -15,7 +15,7 @@ use std::{ }; use serde_json::Value; -use text_unit::{TextRange, TextUnit}; +use text_size::{TextRange, TextSize}; pub use difference::Changeset as __Changeset; @@ -49,7 +49,7 @@ macro_rules! assert_eq_text { } /// Infallible version of `try_extract_offset()`. -pub fn extract_offset(text: &str) -> (TextUnit, String) { +pub fn extract_offset(text: &str) -> (TextSize, String) { match try_extract_offset(text) { None => panic!("text should contain cursor marker"), Some(result) => result, @@ -58,12 +58,12 @@ pub fn extract_offset(text: &str) -> (TextUnit, String) { /// Returns the offset of the first occurence of `<|>` marker and the copy of `text` /// without the marker. -fn try_extract_offset(text: &str) -> Option<(TextUnit, String)> { +fn try_extract_offset(text: &str) -> Option<(TextSize, String)> { let cursor_pos = text.find(CURSOR_MARKER)?; let mut new_text = String::with_capacity(text.len() - CURSOR_MARKER.len()); new_text.push_str(&text[..cursor_pos]); new_text.push_str(&text[cursor_pos + CURSOR_MARKER.len()..]); - let cursor_pos = TextUnit::from(cursor_pos as u32); + let cursor_pos = TextSize::from(cursor_pos as u32); Some((cursor_pos, new_text)) } @@ -80,25 +80,25 @@ pub fn extract_range(text: &str) -> (TextRange, String) { fn try_extract_range(text: &str) -> Option<(TextRange, String)> { let (start, text) = try_extract_offset(text)?; let (end, text) = try_extract_offset(&text)?; - Some((TextRange::from_to(start, end), text)) + Some((TextRange::new(start, end), text)) } #[derive(Clone, Copy)] pub enum RangeOrOffset { Range(TextRange), - Offset(TextUnit), + Offset(TextSize), } impl From for TextRange { fn from(selection: RangeOrOffset) -> Self { match selection { RangeOrOffset::Range(it) => it, - RangeOrOffset::Offset(it) => TextRange::from_to(it, it), + RangeOrOffset::Offset(it) => TextRange::new(it, it), } } } -/// Extracts `TextRange` or `TextUnit` depending on the amount of `<|>` markers +/// Extracts `TextRange` or `TextSize` depending on the amount of `<|>` markers /// found in `text`. /// /// # Panics @@ -129,13 +129,13 @@ pub fn extract_ranges(mut text: &str, tag: &str) -> (Vec, String) { text = &text[i..]; if text.starts_with(&open) { text = &text[open.len()..]; - let from = TextUnit::of_str(&res); + let from = TextSize::of(&res); stack.push(from); } else if text.starts_with(&close) { text = &text[close.len()..]; let from = stack.pop().unwrap_or_else(|| panic!("unmatched ", tag)); - let to = TextUnit::of_str(&res); - ranges.push(TextRange::from_to(from, to)); + let to = TextSize::of(&res); + ranges.push(TextRange::new(from, to)); } } } @@ -146,8 +146,8 @@ pub fn extract_ranges(mut text: &str, tag: &str) -> (Vec, String) { } /// Inserts `<|>` marker into the `text` at `offset`. -pub fn add_cursor(text: &str, offset: TextUnit) -> String { - let offset: usize = offset.to_usize(); +pub fn add_cursor(text: &str, offset: TextSize) -> String { + let offset: usize = offset.into(); let mut res = String::new(); res.push_str(&text[..offset]); res.push_str("<|>"); diff --git a/docs/dev/syntax.md b/docs/dev/syntax.md index 0a4554c55c..e138c656a7 100644 --- a/docs/dev/syntax.md +++ b/docs/dev/syntax.md @@ -17,7 +17,7 @@ The things described are implemented in two places * Syntax trees are lossless, or full fidelity. All comments and whitespace are preserved. * Syntax trees are semantic-less. They describe *strictly* the structure of a sequence of characters, they don't have hygiene, name resolution or type information attached. -* Syntax trees are simple value type. It is possible to create trees for a syntax without any external context. +* Syntax trees are simple value type. It is possible to create trees for a syntax without any external context. * Syntax trees have intuitive traversal API (parent, children, siblings, etc). * Parsing is lossless (even if the input is invalid, the tree produced by the parser represents it exactly). * Parsing is resilient (even if the input is invalid, parser tries to see as much syntax tree fragments in the input as it can). @@ -34,12 +34,12 @@ The syntax tree consists of three layers: * SyntaxNodes (aka RedNode) * AST -Of these, only GreenNodes store the actual data, the other two layers are (non-trivial) views into green tree. +Of these, only GreenNodes store the actual data, the other two layers are (non-trivial) views into green tree. Red-green terminology comes from Roslyn ([link](https://docs.microsoft.com/en-ie/archive/blogs/ericlippert/persistence-facades-and-roslyns-red-green-trees)) and gives the name to the `rowan` library. Green and syntax nodes are defined in rowan, ast is defined in rust-analyzer. Syntax trees are a semi-transient data structure. In general, frontend does not keep syntax trees for all files in memory. -Instead, it *lowers* syntax trees to more compact and rigid representation, which is not full-fidelity, but which can be mapped back to a syntax tree if so desired. +Instead, it *lowers* syntax trees to more compact and rigid representation, which is not full-fidelity, but which can be mapped back to a syntax tree if so desired. ### GreenNode @@ -64,7 +64,7 @@ struct Token { } ``` -All the difference bettwen the above sketch and the real implementation are strictly due to optimizations. +All the difference bettwen the above sketch and the real implementation are strictly due to optimizations. Points of note: * The tree is untyped. Each node has a "type tag", `SyntaxKind`. @@ -73,7 +73,7 @@ Points of note: * Each token carries its full text. * The original text can be recovered by concatenating the texts of all tokens in order. * Accessing a child of particular type (for example, parameter list of a function) generarly involves linerary traversing the children, looking for a specific `kind`. -* Modifying the tree is roughly `O(depth)`. +* Modifying the tree is roughly `O(depth)`. We don't make special efforts to guarantree that the depth is not liner, but, in practice, syntax trees are branchy and shallow. * If mandatory (grammar wise) node is missing from the input, it's just missing from the tree. * If an extra erroneous input is present, it is wrapped into a node with `ERROR` kind, and treated just like any other node. @@ -122,20 +122,20 @@ To reduce the amount of allocations, the GreenNode is a DST, which uses a single To more compactly store the children, we box *both* interior nodes and tokens, and represent `Either, Arc>` as a single pointer with a tag in the last bit. -To avoid allocating EVERY SINGLE TOKEN on the heap, syntax trees use interning. +To avoid allocating EVERY SINGLE TOKEN on the heap, syntax trees use interning. Because the tree is fully imutable, it's valid to structuraly share subtrees. -For example, in `1 + 1`, there will be a *single* token for `1` with ref count 2; the same goes for the ` ` whitespace token. -Interior nodes are shared as well (for example in `(1 + 1) * (1 + 1)`). +For example, in `1 + 1`, there will be a *single* token for `1` with ref count 2; the same goes for the ` ` whitespace token. +Interior nodes are shared as well (for example in `(1 + 1) * (1 + 1)`). -Note that, the result of the interning is an `Arc`. +Note that, the result of the interning is an `Arc`. That is, it's not an index into interning table, so you don't have to have the table around to do anything with the tree. Each tree is fully self-contained (although different trees might share parts). -Currently, the interner is created per-file, but it will be easy to use a per-thread or per-some-contex one. +Currently, the interner is created per-file, but it will be easy to use a per-thread or per-some-contex one. -We use a `TextUnit`, a newtyped `u32`, to store the length of the text. +We use a `TextSize`, a newtyped `u32`, to store the length of the text. -We currently use `SmolStr`, an small object optimized string to store text. -This was mostly relevant *before* we implmented tree interning, to avoid allocating common keywords and identifiers. We should switch to storing text data alongside the interned tokens. +We currently use `SmolStr`, an small object optimized string to store text. +This was mostly relevant *before* we implmented tree interning, to avoid allocating common keywords and identifiers. We should switch to storing text data alongside the interned tokens. #### Alternative designs @@ -153,9 +153,9 @@ struct Token { } ``` -The tree then contains only non-trivia tokens. +The tree then contains only non-trivia tokens. -Another approach (from Dart) is to, in addition to a syntax tree, link all the tokens into a bidirectional link list. +Another approach (from Dart) is to, in addition to a syntax tree, link all the tokens into a bidirectional link list. That way, the tree again contains only non-trivia tokens. Explicit trivia nodes, like in `rowan`, are used by IntelliJ. @@ -165,26 +165,26 @@ Explicit trivia nodes, like in `rowan`, are used by IntelliJ. As noted before, accesing a specific child in the node requires a linear traversal of the children (though we can skip tokens, beacuse the tag is encoded in the pointer itself). It is possible to recover O(1) access with another representation. We explicitly store optional and missing (required by the grammar, but not present) nodes. -That is, we use `Option` for children. +That is, we use `Option` for children. We also remove trivia tokens from the tree. -This way, each child kind genrerally occupies a fixed position in a parent, and we can use index access to fetch it. +This way, each child kind genrerally occupies a fixed position in a parent, and we can use index access to fetch it. The cost is that we now need to allocate space for all not-present optional nodes. -So, `fn foo() {}` will have slots for visibility, unsafeness, attributes, abi and return type. +So, `fn foo() {}` will have slots for visibility, unsafeness, attributes, abi and return type. IntelliJ uses linear traversal. Roslyn and Swift do `O(1)` access. ##### Mutable Trees -IntelliJ uses mutable trees. +IntelliJ uses mutable trees. Overall, it creates a lot of additional complexity. However, the API for *editing* syntax trees is nice. For example the assist to move generic bounds to where clause has this code: ```kotlin - for typeBound in typeBounds { - typeBound.typeParamBounds?.delete() + for typeBound in typeBounds { + typeBound.typeParamBounds?.delete() } ``` @@ -195,7 +195,7 @@ Modeling this with immutable trees is possible, but annoying. A function green tree is not super-convenient to use. The biggest problem is acessing parents (there are no parent pointers!). But there are also "identify" issues. -Let's say you want to write a code which builds a list of expressions in a file: `fn collect_exrepssions(file: GreenNode) -> HashSet`. +Let's say you want to write a code which builds a list of expressions in a file: `fn collect_exrepssions(file: GreenNode) -> HashSet`. For the input like ```rust @@ -233,7 +233,7 @@ impl SyntaxNode { }) } fn parent(&self) -> Option { - self.parent.clone() + self.parent.clone() } fn children(&self) -> impl Iterator { let mut offset = self.offset @@ -251,8 +251,8 @@ impl SyntaxNode { impl PartialEq for SyntaxNode { fn eq(&self, other: &SyntaxNode) { - self.offset == other.offset - && Arc::ptr_eq(&self.green, &other.green) + self.offset == other.offset + && Arc::ptr_eq(&self.green, &other.green) } } ``` @@ -261,35 +261,35 @@ Points of note: * SyntaxNode remembers its parent node (and, transitively, the path to the root of the tree) * SyntaxNode knows its *absolute* text offset in the whole file -* Equality is based on identity. Comparing nodes from different trees does not make sense. +* Equality is based on identity. Comparing nodes from different trees does not make sense. #### Optimization -The reality is different though :-) +The reality is different though :-) Traversal of trees is a common operation, and it makes sense to optimize it. In particular, the above code allocates and does atomic operations during a traversal. To get rid of atomics, `rowan` uses non thread-safe `Rc`. -This is OK because trees traversals mostly (always, in case of rust-analyzer) run on a single thread. If you need to send a `SyntaxNode` to another thread, you can send a pair of **root**`GreenNode` (which is thread safe) and a `Range`. -The other thread can restore the `SyntaxNode` by traversing from the root green node and looking for a node with specified range. +This is OK because trees traversals mostly (always, in case of rust-analyzer) run on a single thread. If you need to send a `SyntaxNode` to another thread, you can send a pair of **root**`GreenNode` (which is thread safe) and a `Range`. +The other thread can restore the `SyntaxNode` by traversing from the root green node and looking for a node with specified range. You can also use the similar trick to store a `SyntaxNode`. That is, a data structure that holds a `(GreenNode, Range)` will be `Sync`. -However rust-analyzer goes even further. +However rust-analyzer goes even further. It treats trees as semi-transient and instead of storing a `GreenNode`, it generally stores just the id of the file from which the tree originated: `(FileId, Range)`. The `SyntaxNode` is the restored by reparsing the file and traversing it from root. With this trick, rust-analyzer holds only a small amount of trees in memory at the same time, which reduces memory usage. Additionally, only the root `SyntaxNode` owns an `Arc` to the (root) `GreenNode`. -All other `SyntaxNode`s point to corresponding `GreenNode`s with a raw pointer. -They also point to the parent (and, consequently, to the root) with an owning `Rc`, so this is sound. +All other `SyntaxNode`s point to corresponding `GreenNode`s with a raw pointer. +They also point to the parent (and, consequently, to the root) with an owning `Rc`, so this is sound. In other words, one needs *one* arc bump when initiating a traversal. -To get rid of allocations, `rowan` takes advantage of `SyntaxNode: !Sync` and uses a thread-local free list of `SyntaxNode`s. -In a typical traversal, you only directly hold a few `SyntaxNode`s at a time (and their ancesstors indirectly), so a free list proportional to the depth of the tree removes all allocations in a typical case. +To get rid of allocations, `rowan` takes advantage of `SyntaxNode: !Sync` and uses a thread-local free list of `SyntaxNode`s. +In a typical traversal, you only directly hold a few `SyntaxNode`s at a time (and their ancesstors indirectly), so a free list proportional to the depth of the tree removes all allocations in a typical case. So, while traversal is not exactly incrementing a pointer, it's still prety cheep: tls + rc bump! -Traversal also yields (cheap) owned nodes, which improves ergonomics quite a bit. +Traversal also yields (cheap) owned nodes, which improves ergonomics quite a bit. #### Alternative Designs @@ -309,14 +309,14 @@ struct SyntaxData { ``` This allows using true pointer equality for comparision of identities of `SyntaxNodes`. -rust-analyzer used to have this design as well, but since we've switch to cursors. -The main problem with memoizing the red nodes is that it more than doubles the memory requirenments for fully realized syntax trees. +rust-analyzer used to have this design as well, but since we've switch to cursors. +The main problem with memoizing the red nodes is that it more than doubles the memory requirenments for fully realized syntax trees. In contrast, cursors generally retain only a path to the root. -C# combats increased memory usage by using weak references. +C# combats increased memory usage by using weak references. ### AST -`GreenTree`s are untyped and homogeneous, because it makes accomodating error nodes, arbitrary whitespace and comments natural, and because it makes possible to write generic tree traversals. +`GreenTree`s are untyped and homogeneous, because it makes accomodating error nodes, arbitrary whitespace and comments natural, and because it makes possible to write generic tree traversals. However, when working with a specific node, like a function definition, one would want a strongly typed API. This is what is provided by the AST layer. AST nodes are transparent wrappers over untyped syntax nodes: @@ -352,13 +352,13 @@ impl AstNode for FnDef { } impl FnDef { - pub fn param_list(&self) -> Option { + pub fn param_list(&self) -> Option { self.syntax.children().find_map(ParamList::cast) } - pub fn ret_type(&self) -> Option { + pub fn ret_type(&self) -> Option { self.syntax.children().find_map(RetType::cast) } - pub fn body(&self) -> Option { + pub fn body(&self) -> Option { self.syntax.children().find_map(BlockExpr::cast) } // ... @@ -409,14 +409,14 @@ Points of note: ##### Semantic Full AST -In IntelliJ the AST layer (dubbed **P**rogram **S**tructure **I**nterface) can have semantics attached, and is usually backed by either syntax tree, indices, or metadata from compiled libraries. +In IntelliJ the AST layer (dubbed **P**rogram **S**tructure **I**nterface) can have semantics attached, and is usually backed by either syntax tree, indices, or metadata from compiled libraries. The backend for PSI can change dynamically. ### Syntax Tree Recap -At its core, the syntax tree is a purely functional n-ary tree, which stores text at the leaf nodes and node "kinds" at all nodes. +At its core, the syntax tree is a purely functional n-ary tree, which stores text at the leaf nodes and node "kinds" at all nodes. A cursor layer is added on top, which gives owned, cheap to clone nodes with identity semantics, parent links and absolute offsets. -An AST layer is added on top, which reifies each node `Kind` as a separate Rust type with the corresponding API. +An AST layer is added on top, which reifies each node `Kind` as a separate Rust type with the corresponding API. ## Parsing @@ -432,17 +432,17 @@ impl GreenNodeBuilder { pub fn start_node(&mut self, kind: SyntaxKind) { ... } pub fn finish_node(&mut self) { ... } - + pub fn finish(self) -> GreenNode { ... } } ``` -The parser, ultimatelly, needs to invoke the `GreenNodeBuilder`. +The parser, ultimatelly, needs to invoke the `GreenNodeBuilder`. There are two principal sources of inputs for the parser: * source text, which contains trivia tokens (whitespace and comments) * token trees from macros, which lack trivia -Additionaly, input tokens do not correspond 1-to-1 with output tokens. +Additionaly, input tokens do not correspond 1-to-1 with output tokens. For example, two consequtive `>` tokens might be glued, by the parser, into a single `>>`. For these reasons, the parser crate defines a callback interfaces for both input tokens and output trees. @@ -474,7 +474,7 @@ pub trait TreeSink { } pub fn parse( - token_source: &mut dyn TokenSource, + token_source: &mut dyn TokenSource, tree_sink: &mut dyn TreeSink, ) { ... } ``` @@ -491,21 +491,21 @@ Syntax errors are not stored directly in the tree. The primary motivation for this is that syntax tree is not necessary produced by the parser, it may also be assembled manually from pieces (which happens all the time in refactorings). Instead, parser reports errors to an error sink, which stores them in a `Vec`. If possible, errors are not reported during parsing and are postponed for a separate validation step. -For example, parser accepts visibility modifiers on trait methods, but then a separate tree traversal flags all such visibilites as erroneous. +For example, parser accepts visibility modifiers on trait methods, but then a separate tree traversal flags all such visibilites as erroneous. ### Macros -The primary difficulty with macros is that individual tokens have identities, which need to be preserved in the syntax tree for hygiene purposes. +The primary difficulty with macros is that individual tokens have identities, which need to be preserved in the syntax tree for hygiene purposes. This is handled by the `TreeSink` layer. Specifically, `TreeSink` constructs the tree in lockstep with draining the original token stream. -In the process, it records which tokens of the tree correspond to which tokens of the input, by using text ranges to identify syntax tokens. +In the process, it records which tokens of the tree correspond to which tokens of the input, by using text ranges to identify syntax tokens. The end result is that parsing an expanded code yields a syntax tree and a mapping of text-ranges of the tree to original tokens. To deal with precedence in cases like `$expr * 1`, we use special invisible parenthesis, which are explicitelly handled by the parser ### Whitespace & Comments -Parser does not see whitespace nodes. +Parser does not see whitespace nodes. Instead, they are attached to the tree in the `TreeSink` layer. For example, in @@ -521,7 +521,7 @@ the comment will be (heuristically) made a child of function node. Green trees are cheap to modify, so incremental reparse works by patching a previous tree, without maintaining any additional state. The reparse is based on heuristic: we try to contain a change to a single `{}` block, and reparse only this block. -To do this, we maintain the invariant that, even for invalid code, curly braces are always paired correctly. +To do this, we maintain the invariant that, even for invalid code, curly braces are always paired correctly. In practice, incremental reparsing doesn't actually matter much for IDE use-cases, parsing from scratch seems to be fast enough. From 8843588fca7a6022b86800d5d2539594c0de93cf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 23:51:02 +0200 Subject: [PATCH 2/5] Convert tests to text-size --- crates/ra_assists/src/lib.rs | 3 +- crates/ra_hir_def/src/body/scope.rs | 2 +- crates/ra_hir_ty/src/tests/coercion.rs | 582 +- crates/ra_hir_ty/src/tests/macros.rs | 202 +- .../ra_hir_ty/src/tests/method_resolution.rs | 376 +- crates/ra_hir_ty/src/tests/patterns.rs | 480 +- crates/ra_hir_ty/src/tests/regression.rs | 278 +- crates/ra_hir_ty/src/tests/simple.rs | 1360 ++--- crates/ra_hir_ty/src/tests/traits.rs | 1106 ++-- crates/ra_ide/src/call_hierarchy.rs | 36 +- .../src/completion/complete_attribute.rs | 240 +- crates/ra_ide/src/completion/complete_dot.rs | 112 +- .../src/completion/complete_fn_param.rs | 12 +- .../ra_ide/src/completion/complete_keyword.rs | 252 +- .../complete_macro_in_item_position.rs | 16 +- .../ra_ide/src/completion/complete_pattern.rs | 28 +- .../ra_ide/src/completion/complete_postfix.rs | 128 +- .../src/completion/complete_qualified_path.rs | 156 +- .../ra_ide/src/completion/complete_record.rs | 60 +- .../ra_ide/src/completion/complete_snippet.rs | 20 +- .../src/completion/complete_trait_impl.rs | 47 +- .../completion/complete_unqualified_path.rs | 308 +- crates/ra_ide/src/completion/presentation.rs | 200 +- crates/ra_ide/src/diagnostics.rs | 8 +- crates/ra_ide/src/display/structure.rs | 76 +- crates/ra_ide/src/extend_selection.rs | 2 +- crates/ra_ide/src/folding_ranges.rs | 5 +- crates/ra_ide/src/goto_definition.rs | 90 +- crates/ra_ide/src/goto_type_definition.rs | 10 +- crates/ra_ide/src/impls.rs | 20 +- crates/ra_ide/src/inlay_hints.rs | 166 +- crates/ra_ide/src/join_lines.rs | 2 +- crates/ra_ide/src/parent_module.rs | 6 +- crates/ra_ide/src/references.rs | 90 +- crates/ra_ide/src/references/rename.rs | 19 +- crates/ra_ide/src/runnables.rs | 18 +- .../ra_ide/src/syntax_highlighting/tests.rs | 2 +- crates/ra_ide/src/syntax_tree.rs | 273 +- crates/ra_ide/src/typing.rs | 9 +- crates/ra_mbe/src/tests.rs | 408 +- .../lexer/err/0001_unclosed_char_at_eof.txt | 2 +- .../err/0002_unclosed_char_with_ferris.txt | 2 +- .../0003_unclosed_char_with_ascii_escape.txt | 2 +- ...0004_unclosed_char_with_unicode_escape.txt | 2 +- .../err/0005_unclosed_char_with_space.txt | 2 +- .../err/0006_unclosed_char_with_slash.txt | 2 +- .../err/0007_unclosed_char_with_slash_n.txt | 2 +- ..._unclosed_char_with_slash_single_quote.txt | 2 +- .../lexer/err/0009_unclosed_byte_at_eof.txt | 2 +- .../err/0010_unclosed_byte_with_ferris.txt | 2 +- .../0011_unclosed_byte_with_ascii_escape.txt | 2 +- ...0012_unclosed_byte_with_unicode_escape.txt | 2 +- .../err/0013_unclosed_byte_with_space.txt | 2 +- .../err/0014_unclosed_byte_with_slash.txt | 2 +- .../err/0015_unclosed_byte_with_slash_n.txt | 2 +- ..._unclosed_byte_with_slash_single_quote.txt | 2 +- .../lexer/err/0017_unclosed_string_at_eof.txt | 2 +- .../err/0018_unclosed_string_with_ferris.txt | 2 +- ...0019_unclosed_string_with_ascii_escape.txt | 2 +- ...20_unclosed_string_with_unicode_escape.txt | 2 +- .../err/0021_unclosed_string_with_space.txt | 2 +- .../err/0022_unclosed_string_with_slash.txt | 2 +- .../err/0023_unclosed_string_with_slash_n.txt | 2 +- ...nclosed_string_with_slash_double_quote.txt | 2 +- .../err/0025_unclosed_byte_string_at_eof.txt | 2 +- .../0026_unclosed_byte_string_with_ferris.txt | 2 +- ...unclosed_byte_string_with_ascii_escape.txt | 2 +- ...closed_byte_string_with_unicode_escape.txt | 2 +- .../0029_unclosed_byte_string_with_space.txt | 2 +- .../0030_unclosed_byte_string_with_slash.txt | 2 +- ...0031_unclosed_byte_string_with_slash_n.txt | 2 +- ...ed_byte_string_with_slash_double_quote.txt | 2 +- .../err/0033_unclosed_raw_string_at_eof.txt | 2 +- .../0034_unclosed_raw_string_with_ferris.txt | 2 +- ..._unclosed_raw_string_with_ascii_escape.txt | 2 +- ...nclosed_raw_string_with_unicode_escape.txt | 2 +- .../0037_unclosed_raw_string_with_space.txt | 2 +- .../0038_unclosed_raw_string_with_slash.txt | 2 +- .../0039_unclosed_raw_string_with_slash_n.txt | 2 +- .../0040_unclosed_raw_byte_string_at_eof.txt | 2 +- ...1_unclosed_raw_byte_string_with_ferris.txt | 2 +- ...osed_raw_byte_string_with_ascii_escape.txt | 2 +- ...ed_raw_byte_string_with_unicode_escape.txt | 2 +- ...44_unclosed_raw_byte_string_with_space.txt | 2 +- ...45_unclosed_raw_byte_string_with_slash.txt | 2 +- ..._unclosed_raw_byte_string_with_slash_n.txt | 2 +- .../err/0047_unstarted_raw_string_at_eof.txt | 2 +- .../0048_unstarted_raw_byte_string_at_eof.txt | 2 +- .../0049_unstarted_raw_string_with_ascii.txt | 2 +- ...0_unstarted_raw_byte_string_with_ascii.txt | 2 +- .../0051_unclosed_block_comment_at_eof.txt | 2 +- ...52_unclosed_block_comment_with_content.txt | 2 +- ...unclosed_nested_block_comment_entirely.txt | 2 +- ...nclosed_nested_block_comment_partially.txt | 2 +- .../test_data/lexer/err/0055_empty_int.txt | 26 +- .../lexer/err/0056_empty_exponent.txt | 28 +- .../0057_lifetime_strarts_with_a_number.txt | 4 +- .../err/0000_struct_field_missing_comma.rast | 68 +- .../err/0001_item_recovery_in_file.rast | 36 +- .../parser/err/0002_duplicate_shebang.rast | 78 +- .../parser/err/0003_C++_semicolon.rast | 76 +- .../parser/err/0004_use_path_bad_segment.rast | 32 +- .../parser/err/0005_attribute_recover.rast | 120 +- .../parser/err/0006_named_field_recovery.rast | 148 +- .../parser/err/0007_stray_curly_in_file.rast | 66 +- .../parser/err/0008_item_block_recovery.rast | 162 +- .../0009_broken_struct_type_parameter.rast | 116 +- .../parser/err/0010_unsafe_lambda_block.rast | 90 +- .../parser/err/0011_extern_struct.rast | 26 +- .../parser/err/0012_broken_lambda.rast | 636 +-- .../parser/err/0013_invalid_type.rast | 178 +- .../parser/err/0014_where_no_bounds.rast | 64 +- .../parser/err/0015_curly_in_params.rast | 48 +- .../parser/err/0016_missing_semi.rast | 88 +- .../parser/err/0017_incomplete_binexpr.rast | 94 +- .../parser/err/0018_incomplete_fn.rast | 264 +- .../parser/err/0019_let_recover.rast | 214 +- .../test_data/parser/err/0020_fn_recover.rast | 42 +- .../parser/err/0021_incomplete_param.rast | 70 +- .../test_data/parser/err/0022_bad_exprs.rast | 366 +- .../parser/err/0023_mismatched_paren.rast | 88 +- .../parser/err/0024_many_type_parens.rast | 642 +-- .../test_data/parser/err/0025_nope.rast | 408 +- .../parser/err/0026_imp_recovery.rast | 98 +- .../parser/err/0027_incomplere_where_for.rast | 58 +- .../parser/err/0029_field_completion.rast | 72 +- .../parser/err/0031_block_inner_attrs.rast | 250 +- .../err/0032_match_arms_inner_attrs.rast | 408 +- .../err/0033_match_arms_outer_attrs.rast | 134 +- .../parser/err/0034_bad_box_pattern.rast | 192 +- .../parser/err/0035_use_recover.rast | 108 +- .../parser/err/0036_partial_use.rast | 102 +- .../parser/err/0037_visibility_in_traits.rast | 198 +- .../err/0038_endless_inclusive_range.rast | 60 +- .../parser/err/0039_lambda_recovery.rast | 166 +- .../err/0001_array_type_missing_semi.rast | 54 +- .../inline/err/0002_misplaced_label_err.rast | 58 +- .../err/0003_pointer_type_no_mutability.rast | 34 +- .../parser/inline/err/0004_impl_type.rast | 158 +- .../err/0005_fn_pointer_type_missing_fn.rast | 46 +- .../inline/err/0006_unsafe_block_in_mod.rast | 74 +- .../err/0007_async_without_semicolon.rast | 64 +- .../parser/inline/err/0008_pub_expr.rast | 52 +- .../err/0009_attr_on_expr_not_allowed.rast | 122 +- .../inline/err/0010_bad_tuple_index_expr.rast | 106 +- .../inline/err/0010_wrong_order_fns.rast | 82 +- .../inline/err/0013_static_underscore.rast | 42 +- .../inline/err/0014_default_fn_type.rast | 118 +- ...cord_literal_before_ellipsis_recovery.rast | 98 +- .../inline/ok/0001_trait_item_list.rast | 144 +- .../parser/inline/ok/0002_use_tree_list.rast | 270 +- .../parser/inline/ok/0003_where_pred_for.rast | 124 +- .../ok/0004_value_parameters_no_patterns.rast | 120 +- .../inline/ok/0005_function_type_params.rast | 76 +- .../parser/inline/ok/0006_self_param.rast | 242 +- .../inline/ok/0007_type_param_bounds.rast | 80 +- .../parser/inline/ok/0008_path_part.rast | 194 +- .../parser/inline/ok/0009_loop_expr.rast | 52 +- .../parser/inline/ok/0010_extern_block.rast | 18 +- .../parser/inline/ok/0011_field_expr.rast | 120 +- .../ok/0012_type_item_where_clause.rast | 66 +- .../inline/ok/0013_pointer_type_mut.rast | 70 +- .../parser/inline/ok/0014_never_type.rast | 26 +- .../parser/inline/ok/0015_continue_expr.rast | 74 +- .../parser/inline/ok/0016_unsafe_trait.rast | 26 +- .../parser/inline/ok/0017_array_type.rast | 42 +- .../parser/inline/ok/0018_arb_self_types.rast | 148 +- .../parser/inline/ok/0019_unary_expr.rast | 90 +- .../parser/inline/ok/0020_use_star.rast | 118 +- .../parser/inline/ok/0021_impl_item_list.rast | 160 +- .../inline/ok/0022_crate_visibility.rast | 106 +- .../inline/ok/0023_placeholder_type.rast | 26 +- .../parser/inline/ok/0024_slice_pat.rast | 84 +- .../parser/inline/ok/0025_slice_type.rast | 34 +- .../inline/ok/0026_tuple_pat_fields.rast | 210 +- .../parser/inline/ok/0027_ref_pat.rast | 100 +- .../inline/ok/0028_impl_trait_type.rast | 86 +- .../parser/inline/ok/0029_cast_expr.rast | 180 +- .../test_data/parser/inline/ok/0030_cond.rast | 418 +- .../parser/inline/ok/0031_while_expr.rast | 178 +- .../inline/ok/0032_fn_pointer_type.rast | 196 +- .../inline/ok/0033_reference_type;.rast | 100 +- .../parser/inline/ok/0034_break_expr.rast | 110 +- .../inline/ok/0036_unsafe_extern_fn.rast | 44 +- .../parser/inline/ok/0037_qual_paths.rast | 158 +- .../inline/ok/0038_full_range_expr.rast | 58 +- .../parser/inline/ok/0039_type_arg.rast | 110 +- .../inline/ok/0040_crate_keyword_vis.rast | 126 +- .../parser/inline/ok/0041_trait_item.rast | 250 +- .../parser/inline/ok/0042_call_expr.rast | 296 +- .../parser/inline/ok/0043_use_alias.rast | 276 +- .../parser/inline/ok/0044_block_items.rast | 60 +- .../ok/0045_param_list_opt_patterns.rast | 94 +- .../inline/ok/0046_singleton_tuple_type.rast | 40 +- .../inline/ok/0047_unsafe_default_impl.rast | 36 +- .../inline/ok/0048_path_type_with_bounds.rast | 166 +- .../parser/inline/ok/0050_fn_decl.rast | 44 +- .../parser/inline/ok/0051_unit_type.rast | 28 +- .../parser/inline/ok/0052_path_type.rast | 140 +- .../parser/inline/ok/0053_path_expr.rast | 192 +- .../inline/ok/0054_record_field_attrs.rast | 88 +- .../inline/ok/0055_literal_pattern.rast | 154 +- .../parser/inline/ok/0056_where_clause.rast | 222 +- .../parser/inline/ok/0057_const_fn.rast | 34 +- .../parser/inline/ok/0058_range_pat.rast | 166 +- .../inline/ok/0059_match_arms_commas.rast | 120 +- .../parser/inline/ok/0060_extern_crate.rast | 20 +- .../parser/inline/ok/0061_record_lit.rast | 250 +- .../parser/inline/ok/0062_mod_contents.rast | 134 +- .../parser/inline/ok/0063_impl_def_neg.rast | 46 +- .../parser/inline/ok/0064_if_expr.rast | 264 +- .../parser/inline/ok/0065_dyn_trait_type.rast | 86 +- .../parser/inline/ok/0066_match_arm.rast | 304 +- .../parser/inline/ok/0067_crate_path.rast | 30 +- .../parser/inline/ok/0068_union_items.rast | 92 +- .../ok/0069_use_tree_list_after_path.rast | 74 +- .../ok/0070_stmt_bin_expr_ambiguity.rast | 106 +- .../parser/inline/ok/0071_match_expr.rast | 192 +- .../parser/inline/ok/0072_return_expr.rast | 58 +- .../inline/ok/0073_type_item_type_params.rast | 40 +- .../ok/0074_stmt_postfix_expr_ambiguity.rast | 126 +- .../parser/inline/ok/0075_block.rast | 180 +- .../inline/ok/0076_function_where_clause.rast | 80 +- .../parser/inline/ok/0077_try_expr.rast | 52 +- .../parser/inline/ok/0078_type_item.rast | 32 +- .../parser/inline/ok/0079_impl_def.rast | 28 +- .../parser/inline/ok/0080_postfix_range.rast | 192 +- .../parser/inline/ok/0081_for_type.rast | 486 +- .../parser/inline/ok/0082_ref_expr.rast | 110 +- .../parser/inline/ok/0083_struct_items.rast | 174 +- .../parser/inline/ok/0084_paren_type.rast | 38 +- .../parser/inline/ok/0085_expr_literals.rast | 272 +- .../inline/ok/0086_function_ret_type.rast | 72 +- .../parser/inline/ok/0087_unsafe_impl.rast | 32 +- .../inline/ok/0088_break_ambiguity.rast | 138 +- .../parser/inline/ok/0089_extern_fn.rast | 36 +- .../inline/ok/0090_type_param_default.rast | 44 +- .../parser/inline/ok/0091_auto_trait.rast | 26 +- .../ok/0092_fn_pointer_type_with_ret.rast | 46 +- .../parser/inline/ok/0093_index_expr.rast | 68 +- .../inline/ok/0094_unsafe_auto_trait.rast | 30 +- .../inline/ok/0095_placeholder_pat.rast | 58 +- .../inline/ok/0096_no_semi_after_block.rast | 260 +- .../parser/inline/ok/0097_default_impl.rast | 32 +- .../inline/ok/0098_const_unsafe_fn.rast | 38 +- .../parser/inline/ok/0099_param_list.rast | 206 +- .../parser/inline/ok/0100_for_expr.rast | 72 +- .../parser/inline/ok/0101_unsafe_fn.rast | 34 +- .../inline/ok/0102_record_field_pat_list.rast | 266 +- .../parser/inline/ok/0103_array_expr.rast | 110 +- .../inline/ok/0104_path_fn_trait_args.rast | 82 +- .../parser/inline/ok/0105_block_expr.rast | 86 +- .../parser/inline/ok/0106_lambda_expr.rast | 280 +- .../inline/ok/0107_method_call_expr.rast | 126 +- .../parser/inline/ok/0108_tuple_expr.rast | 78 +- .../parser/inline/ok/0109_label.rast | 136 +- .../parser/inline/ok/0110_use_path.rast | 76 +- .../parser/inline/ok/0111_tuple_pat.rast | 180 +- .../parser/inline/ok/0112_bind_pat.rast | 256 +- .../parser/inline/ok/0113_nocontentexpr.rast | 114 +- .../inline/ok/0114_tuple_struct_where.rast | 128 +- .../inline/ok/0115_tuple_field_attrs.rast | 82 +- .../inline/ok/0117_macro_call_type.rast | 86 +- .../inline/ok/0118_impl_inner_attributes.rast | 80 +- .../parser/inline/ok/0118_match_guard.rast | 96 +- .../ok/0120_match_arms_inner_attribute.rast | 162 +- .../ok/0121_match_arms_outer_attributes.rast | 292 +- .../0122_generic_lifetime_type_attribute.rast | 132 +- .../inline/ok/0123_param_list_vararg.rast | 100 +- .../parser/inline/ok/0124_async_fn.rast | 34 +- .../inline/ok/0125_crate_keyword_path.rast | 64 +- .../0125_record_literal_field_with_attr.rast | 96 +- .../inline/ok/0126_attr_on_expr_stmt.rast | 198 +- .../ok/0127_attr_on_last_expr_in_block.rast | 118 +- .../parser/inline/ok/0128_combined_fns.rast | 74 +- .../parser/inline/ok/0129_marco_pat.rast | 74 +- .../parser/inline/ok/0130_let_stmt.rast | 258 +- .../parser/inline/ok/0130_try_block_expr.rast | 66 +- .../inline/ok/0131_existential_type.rast | 62 +- .../parser/inline/ok/0132_box_expr.rast | 180 +- .../inline/ok/0132_default_fn_type.rast | 112 +- .../ok/0134_nocontentexpr_after_item.rast | 128 +- .../parser/inline/ok/0137_await_expr.rast | 140 +- .../ok/0138_associated_type_bounds.rast | 112 +- .../ok/0138_expression_after_block.rast | 132 +- .../inline/ok/0138_self_param_outer_attr.rast | 52 +- .../inline/ok/0139_param_outer_arg.rast | 70 +- .../parser/inline/ok/0142_for_range_from.rast | 84 +- .../parser/inline/ok/0143_box_pat.rast | 222 +- .../parser/inline/ok/0144_dot_dot_pat.rast | 912 ++-- .../inline/ok/0145_record_field_pat.rast | 152 +- .../parser/inline/ok/0146_as_precedence.rast | 86 +- .../parser/inline/ok/0147_const_param.rast | 46 +- .../parser/inline/ok/0147_macro_def.rast | 90 +- .../parser/inline/ok/0148_pub_macro_def.rast | 42 +- .../parser/inline/ok/0150_array_attrs.rast | 94 +- .../inline/ok/0150_impl_type_params.rast | 76 +- .../parser/inline/ok/0151_trait_alias.rast | 256 +- .../parser/inline/ok/0152_arg_with_attr.rast | 74 +- .../ok/0154_fn_pointer_param_ident_path.rast | 116 +- .../parser/inline/ok/0155_closure_params.rast | 140 +- .../parser/inline/ok/0156_fn_def_param.rast | 88 +- .../parser/inline/ok/0156_or_pattern.rast | 224 +- .../ok/0157_fn_pointer_unnamed_arg.rast | 52 +- .../inline/ok/0157_variant_discriminant.rast | 60 +- .../ok/0158_binop_resets_statementness.rast | 76 +- .../inline/ok/0158_lambda_ret_block.rast | 90 +- .../test_data/parser/ok/0000_empty.rast | 2 +- .../test_data/parser/ok/0001_struct_item.rast | 78 +- .../parser/ok/0002_struct_item_field.rast | 44 +- .../parser/ok/0004_file_shebang.rast | 4 +- .../test_data/parser/ok/0005_fn_item.rast | 32 +- .../parser/ok/0006_inner_attributes.rast | 368 +- .../parser/ok/0007_extern_crate.rast | 80 +- .../test_data/parser/ok/0008_mod_item.rast | 186 +- .../test_data/parser/ok/0009_use_item.rast | 42 +- .../parser/ok/0010_use_path_segments.rast | 84 +- .../parser/ok/0011_outer_attribute.rast | 116 +- .../test_data/parser/ok/0012_visibility.rast | 214 +- .../parser/ok/0013_use_path_self_super.rast | 114 +- .../test_data/parser/ok/0014_use_tree.rast | 190 +- .../test_data/parser/ok/0015_use_tree.rast | 130 +- .../parser/ok/0016_struct_flavors.rast | 186 +- .../parser/ok/0017_attr_trailing_comma.rast | 58 +- .../parser/ok/0018_struct_type_params.rast | 514 +- .../test_data/parser/ok/0019_enums.rast | 310 +- .../parser/ok/0020_type_param_bounds.rast | 536 +- .../test_data/parser/ok/0021_extern_fn.rast | 118 +- .../parser/ok/0022_empty_extern_block.rast | 42 +- .../parser/ok/0023_static_items.rast | 82 +- .../test_data/parser/ok/0024_const_item.rast | 118 +- .../parser/ok/0025_extern_fn_in_block.rast | 66 +- .../parser/ok/0026_const_fn_in_block.rast | 64 +- .../parser/ok/0027_unsafe_fn_in_block.rast | 86 +- .../ok/0028_operator_binding_power.rast | 372 +- .../test_data/parser/ok/0029_range_forms.rast | 304 +- .../parser/ok/0030_string_suffixes.rast | 128 +- .../test_data/parser/ok/0030_traits.rast | 122 +- .../test_data/parser/ok/0031_extern.rast | 1946 +++---- .../test_data/parser/ok/0032_where_for.rast | 182 +- .../test_data/parser/ok/0033_label_break.rast | 440 +- .../parser/ok/0034_crate_path_in_call.rast | 84 +- .../test_data/parser/ok/0035_weird_exprs.rast | 4658 ++++++++--------- .../parser/ok/0036_fully_qualified.rast | 186 +- .../test_data/parser/ok/0037_mod.rast | 32 +- .../parser/ok/0038_where_pred_type.rast | 86 +- .../test_data/parser/ok/0039_raw_fn_item.rast | 32 +- .../parser/ok/0040_raw_struct_item_field.rast | 44 +- .../parser/ok/0041_raw_keywords.rast | 100 +- .../parser/ok/0042_ufcs_call_list.rast | 252 +- .../parser/ok/0043_complex_assignment.rast | 220 +- .../test_data/parser/ok/0044_let_attrs.rast | 152 +- .../parser/ok/0045_block_inner_attrs.rast | 362 +- .../ok/0046_extern_inner_attributes.rast | 56 +- .../ok/0047_minus_in_inner_pattern.rast | 646 +-- .../parser/ok/0048_compound_assignment.rast | 402 +- .../test_data/parser/ok/0049_async_block.rast | 72 +- .../ok/0050_async_block_as_argument.rast | 184 +- .../parser/ok/0051_parameter_attrs.rast | 1038 ++-- .../parser/ok/0052_for_range_block.rast | 162 +- .../0053_outer_attribute_on_macro_rules.rast | 78 +- .../parser/ok/0054_qual_path_in_type_arg.rast | 252 +- .../test_data/parser/ok/0055_dot_dot_dot.rast | 100 +- .../test_data/parser/ok/0056_neq_in_type.rast | 132 +- .../parser/ok/0057_loop_in_call.rast | 118 +- .../parser/ok/0058_unary_expr_precedence.rast | 194 +- .../parser/ok/0059_loops_in_parens.rast | 202 +- .../test_data/parser/ok/0060_as_range.rast | 112 +- .../parser/ok/0061_match_full_range.rast | 54 +- .../test_data/parser/ok/0062_macro_2.0.rast | 352 +- .../parser/ok/0063_trait_fn_patterns.rast | 396 +- .../parser/ok/0063_variadic_fun.rast | 266 +- .../parser/ok/0064_impl_fn_params.rast | 332 +- .../parser/ok/0065_comment_newline.rast | 34 +- .../ok/0065_plus_after_fn_trait_bound.rast | 122 +- docs/dev/syntax.md | 46 +- 376 files changed, 26489 insertions(+), 26521 deletions(-) diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 3ffbe4c516..64bd87afbd 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -308,8 +308,7 @@ mod tests { let before = "struct Foo { <|>bar: u32 }"; let (before_cursor_pos, before) = extract_offset(before); let (db, file_id) = helpers::with_single_file(&before); - let frange = - FileRange { file_id, range: TextRange::offset_len(before_cursor_pos, 0.into()) }; + let frange = FileRange { file_id, range: TextRange::empty(before_cursor_pos) }; let assists = resolved_assists(&db, frange); let mut assists = assists.iter(); diff --git a/crates/ra_hir_def/src/body/scope.rs b/crates/ra_hir_def/src/body/scope.rs index 5b36a7cc14..86f953c802 100644 --- a/crates/ra_hir_def/src/body/scope.rs +++ b/crates/ra_hir_def/src/body/scope.rs @@ -194,7 +194,7 @@ mod tests { let (off, code) = extract_offset(code); let code = { let mut buf = String::new(); - let off = off.to_usize(); + let off: usize = off.into(); buf.push_str(&code[..off]); buf.push_str("marker"); buf.push_str(&code[off..]); diff --git a/crates/ra_hir_ty/src/tests/coercion.rs b/crates/ra_hir_ty/src/tests/coercion.rs index b2c971f024..e6fb3e1231 100644 --- a/crates/ra_hir_ty/src/tests/coercion.rs +++ b/crates/ra_hir_ty/src/tests/coercion.rs @@ -29,10 +29,10 @@ fn test() { } "#), @r###" - [11; 41) '{ ...4 }; }': () - [21; 22) 'a': i32 - [30; 38) '{ 1i64 }': i64 - [32; 36) '1i64': i64 + 11..41 '{ ...4 }; }': () + 21..22 'a': i32 + 30..38 '{ 1i64 }': i64 + 32..36 '1i64': i64 "###); } @@ -63,50 +63,50 @@ fn test2() { } "#), @r###" - [31; 32) '_': &[T] - [45; 56) '{ loop {} }': T - [47; 54) 'loop {}': ! - [52; 54) '{}': () - [65; 66) '_': S<&[T]> - [82; 93) '{ loop {} }': T - [84; 91) 'loop {}': ! - [89; 91) '{}': () - [122; 133) '{ loop {} }': *mut [T; _] - [124; 131) 'loop {}': ! - [129; 131) '{}': () - [160; 173) '{ gen() }': *mut [U] - [166; 169) 'gen': fn gen() -> *mut [U; _] - [166; 171) 'gen()': *mut [U; _] - [186; 420) '{ ...rr); }': () - [196; 199) 'arr': &[u8; _] - [212; 216) '&[1]': &[u8; _] - [213; 216) '[1]': [u8; _] - [214; 215) '1': u8 - [227; 228) 'a': &[u8] - [237; 240) 'arr': &[u8; _] - [250; 251) 'b': u8 - [254; 255) 'f': fn f(&[u8]) -> u8 - [254; 260) 'f(arr)': u8 - [256; 259) 'arr': &[u8; _] - [270; 271) 'c': &[u8] - [280; 287) '{ arr }': &[u8] - [282; 285) 'arr': &[u8; _] - [297; 298) 'd': u8 - [301; 302) 'g': fn g(S<&[u8]>) -> u8 - [301; 316) 'g(S { a: arr })': u8 - [303; 315) 'S { a: arr }': S<&[u8]> - [310; 313) 'arr': &[u8; _] - [326; 327) 'e': [&[u8]; _] - [341; 346) '[arr]': [&[u8]; _] - [342; 345) 'arr': &[u8; _] - [356; 357) 'f': [&[u8]; _] - [371; 379) '[arr; 2]': [&[u8]; _] - [372; 375) 'arr': &[u8; _] - [377; 378) '2': usize - [389; 390) 'g': (&[u8], &[u8]) - [407; 417) '(arr, arr)': (&[u8], &[u8]) - [408; 411) 'arr': &[u8; _] - [413; 416) 'arr': &[u8; _] + 31..32 '_': &[T] + 45..56 '{ loop {} }': T + 47..54 'loop {}': ! + 52..54 '{}': () + 65..66 '_': S<&[T]> + 82..93 '{ loop {} }': T + 84..91 'loop {}': ! + 89..91 '{}': () + 122..133 '{ loop {} }': *mut [T; _] + 124..131 'loop {}': ! + 129..131 '{}': () + 160..173 '{ gen() }': *mut [U] + 166..169 'gen': fn gen() -> *mut [U; _] + 166..171 'gen()': *mut [U; _] + 186..420 '{ ...rr); }': () + 196..199 'arr': &[u8; _] + 212..216 '&[1]': &[u8; _] + 213..216 '[1]': [u8; _] + 214..215 '1': u8 + 227..228 'a': &[u8] + 237..240 'arr': &[u8; _] + 250..251 'b': u8 + 254..255 'f': fn f(&[u8]) -> u8 + 254..260 'f(arr)': u8 + 256..259 'arr': &[u8; _] + 270..271 'c': &[u8] + 280..287 '{ arr }': &[u8] + 282..285 'arr': &[u8; _] + 297..298 'd': u8 + 301..302 'g': fn g(S<&[u8]>) -> u8 + 301..316 'g(S { a: arr })': u8 + 303..315 'S { a: arr }': S<&[u8]> + 310..313 'arr': &[u8; _] + 326..327 'e': [&[u8]; _] + 341..346 '[arr]': [&[u8]; _] + 342..345 'arr': &[u8; _] + 356..357 'f': [&[u8]; _] + 371..379 '[arr; 2]': [&[u8]; _] + 372..375 'arr': &[u8; _] + 377..378 '2': usize + 389..390 'g': (&[u8], &[u8]) + 407..417 '(arr, arr)': (&[u8], &[u8]) + 408..411 'arr': &[u8; _] + 413..416 'arr': &[u8; _] "### ); } @@ -120,11 +120,11 @@ fn test() { } "#), @r###" - [11; 40) '{ ...[1]; }': () - [21; 22) 'x': &[i32] - [33; 37) '&[1]': &[i32; _] - [34; 37) '[1]': [i32; _] - [35; 36) '1': i32 + 11..40 '{ ...[1]; }': () + 21..22 'x': &[i32] + 33..37 '&[1]': &[i32; _] + 34..37 '[1]': [i32; _] + 35..36 '1': i32 "###); } @@ -150,31 +150,31 @@ fn test(a: A<[u8; 2]>, b: B<[u8; 2]>, c: C<[u8; 2]>) { } "#), @r###" - [258; 259) 'x': A<[T]> - [279; 284) '{ x }': A<[T]> - [281; 282) 'x': A<[T]> - [296; 297) 'x': B<[T]> - [317; 322) '{ x }': B<[T]> - [319; 320) 'x': B<[T]> - [334; 335) 'x': C<[T]> - [355; 360) '{ x }': C<[T]> - [357; 358) 'x': C<[T]> - [370; 371) 'a': A<[u8; _]> - [385; 386) 'b': B<[u8; _]> - [400; 401) 'c': C<[u8; _]> - [415; 481) '{ ...(c); }': () - [425; 426) 'd': A<[{unknown}]> - [429; 433) 'foo1': fn foo1<{unknown}>(A<[{unknown}]>) -> A<[{unknown}]> - [429; 436) 'foo1(a)': A<[{unknown}]> - [434; 435) 'a': A<[u8; _]> - [446; 447) 'e': B<[u8]> - [450; 454) 'foo2': fn foo2(B<[u8]>) -> B<[u8]> - [450; 457) 'foo2(b)': B<[u8]> - [455; 456) 'b': B<[u8; _]> - [467; 468) 'f': C<[u8]> - [471; 475) 'foo3': fn foo3(C<[u8]>) -> C<[u8]> - [471; 478) 'foo3(c)': C<[u8]> - [476; 477) 'c': C<[u8; _]> + 258..259 'x': A<[T]> + 279..284 '{ x }': A<[T]> + 281..282 'x': A<[T]> + 296..297 'x': B<[T]> + 317..322 '{ x }': B<[T]> + 319..320 'x': B<[T]> + 334..335 'x': C<[T]> + 355..360 '{ x }': C<[T]> + 357..358 'x': C<[T]> + 370..371 'a': A<[u8; _]> + 385..386 'b': B<[u8; _]> + 400..401 'c': C<[u8; _]> + 415..481 '{ ...(c); }': () + 425..426 'd': A<[{unknown}]> + 429..433 'foo1': fn foo1<{unknown}>(A<[{unknown}]>) -> A<[{unknown}]> + 429..436 'foo1(a)': A<[{unknown}]> + 434..435 'a': A<[u8; _]> + 446..447 'e': B<[u8]> + 450..454 'foo2': fn foo2(B<[u8]>) -> B<[u8]> + 450..457 'foo2(b)': B<[u8]> + 455..456 'b': B<[u8; _]> + 467..468 'f': C<[u8]> + 471..475 'foo3': fn foo3(C<[u8]>) -> C<[u8]> + 471..478 'foo3(c)': C<[u8]> + 476..477 'c': C<[u8; _]> "### ); } @@ -193,24 +193,24 @@ fn test() { } "#), @r###" - [11; 12) 'x': &[T] - [28; 39) '{ loop {} }': &[T] - [30; 37) 'loop {}': ! - [35; 37) '{}': () - [50; 126) '{ ... }; }': () - [60; 61) 'x': &[i32] - [64; 123) 'if tru... }': &[i32] - [67; 71) 'true': bool - [72; 97) '{ ... }': &[i32] - [82; 85) 'foo': fn foo(&[i32]) -> &[i32] - [82; 91) 'foo(&[1])': &[i32] - [86; 90) '&[1]': &[i32; _] - [87; 90) '[1]': [i32; _] - [88; 89) '1': i32 - [103; 123) '{ ... }': &[i32; _] - [113; 117) '&[1]': &[i32; _] - [114; 117) '[1]': [i32; _] - [115; 116) '1': i32 + 11..12 'x': &[T] + 28..39 '{ loop {} }': &[T] + 30..37 'loop {}': ! + 35..37 '{}': () + 50..126 '{ ... }; }': () + 60..61 'x': &[i32] + 64..123 'if tru... }': &[i32] + 67..71 'true': bool + 72..97 '{ ... }': &[i32] + 82..85 'foo': fn foo(&[i32]) -> &[i32] + 82..91 'foo(&[1])': &[i32] + 86..90 '&[1]': &[i32; _] + 87..90 '[1]': [i32; _] + 88..89 '1': i32 + 103..123 '{ ... }': &[i32; _] + 113..117 '&[1]': &[i32; _] + 114..117 '[1]': [i32; _] + 115..116 '1': i32 "### ); } @@ -229,24 +229,24 @@ fn test() { } "#), @r###" - [11; 12) 'x': &[T] - [28; 39) '{ loop {} }': &[T] - [30; 37) 'loop {}': ! - [35; 37) '{}': () - [50; 126) '{ ... }; }': () - [60; 61) 'x': &[i32] - [64; 123) 'if tru... }': &[i32] - [67; 71) 'true': bool - [72; 92) '{ ... }': &[i32; _] - [82; 86) '&[1]': &[i32; _] - [83; 86) '[1]': [i32; _] - [84; 85) '1': i32 - [98; 123) '{ ... }': &[i32] - [108; 111) 'foo': fn foo(&[i32]) -> &[i32] - [108; 117) 'foo(&[1])': &[i32] - [112; 116) '&[1]': &[i32; _] - [113; 116) '[1]': [i32; _] - [114; 115) '1': i32 + 11..12 'x': &[T] + 28..39 '{ loop {} }': &[T] + 30..37 'loop {}': ! + 35..37 '{}': () + 50..126 '{ ... }; }': () + 60..61 'x': &[i32] + 64..123 'if tru... }': &[i32] + 67..71 'true': bool + 72..92 '{ ... }': &[i32; _] + 82..86 '&[1]': &[i32; _] + 83..86 '[1]': [i32; _] + 84..85 '1': i32 + 98..123 '{ ... }': &[i32] + 108..111 'foo': fn foo(&[i32]) -> &[i32] + 108..117 'foo(&[1])': &[i32] + 112..116 '&[1]': &[i32; _] + 113..116 '[1]': [i32; _] + 114..115 '1': i32 "### ); } @@ -265,31 +265,31 @@ fn test(i: i32) { } "#), @r###" - [11; 12) 'x': &[T] - [28; 39) '{ loop {} }': &[T] - [30; 37) 'loop {}': ! - [35; 37) '{}': () - [48; 49) 'i': i32 - [56; 150) '{ ... }; }': () - [66; 67) 'x': &[i32] - [70; 147) 'match ... }': &[i32] - [76; 77) 'i': i32 - [88; 89) '2': i32 - [88; 89) '2': i32 - [93; 96) 'foo': fn foo(&[i32]) -> &[i32] - [93; 102) 'foo(&[2])': &[i32] - [97; 101) '&[2]': &[i32; _] - [98; 101) '[2]': [i32; _] - [99; 100) '2': i32 - [112; 113) '1': i32 - [112; 113) '1': i32 - [117; 121) '&[1]': &[i32; _] - [118; 121) '[1]': [i32; _] - [119; 120) '1': i32 - [131; 132) '_': i32 - [136; 140) '&[3]': &[i32; _] - [137; 140) '[3]': [i32; _] - [138; 139) '3': i32 + 11..12 'x': &[T] + 28..39 '{ loop {} }': &[T] + 30..37 'loop {}': ! + 35..37 '{}': () + 48..49 'i': i32 + 56..150 '{ ... }; }': () + 66..67 'x': &[i32] + 70..147 'match ... }': &[i32] + 76..77 'i': i32 + 88..89 '2': i32 + 88..89 '2': i32 + 93..96 'foo': fn foo(&[i32]) -> &[i32] + 93..102 'foo(&[2])': &[i32] + 97..101 '&[2]': &[i32; _] + 98..101 '[2]': [i32; _] + 99..100 '2': i32 + 112..113 '1': i32 + 112..113 '1': i32 + 117..121 '&[1]': &[i32; _] + 118..121 '[1]': [i32; _] + 119..120 '1': i32 + 131..132 '_': i32 + 136..140 '&[3]': &[i32; _] + 137..140 '[3]': [i32; _] + 138..139 '3': i32 "### ); } @@ -308,31 +308,31 @@ fn test(i: i32) { } "#), @r###" - [11; 12) 'x': &[T] - [28; 39) '{ loop {} }': &[T] - [30; 37) 'loop {}': ! - [35; 37) '{}': () - [48; 49) 'i': i32 - [56; 150) '{ ... }; }': () - [66; 67) 'x': &[i32] - [70; 147) 'match ... }': &[i32] - [76; 77) 'i': i32 - [88; 89) '1': i32 - [88; 89) '1': i32 - [93; 97) '&[1]': &[i32; _] - [94; 97) '[1]': [i32; _] - [95; 96) '1': i32 - [107; 108) '2': i32 - [107; 108) '2': i32 - [112; 115) 'foo': fn foo(&[i32]) -> &[i32] - [112; 121) 'foo(&[2])': &[i32] - [116; 120) '&[2]': &[i32; _] - [117; 120) '[2]': [i32; _] - [118; 119) '2': i32 - [131; 132) '_': i32 - [136; 140) '&[3]': &[i32; _] - [137; 140) '[3]': [i32; _] - [138; 139) '3': i32 + 11..12 'x': &[T] + 28..39 '{ loop {} }': &[T] + 30..37 'loop {}': ! + 35..37 '{}': () + 48..49 'i': i32 + 56..150 '{ ... }; }': () + 66..67 'x': &[i32] + 70..147 'match ... }': &[i32] + 76..77 'i': i32 + 88..89 '1': i32 + 88..89 '1': i32 + 93..97 '&[1]': &[i32; _] + 94..97 '[1]': [i32; _] + 95..96 '1': i32 + 107..108 '2': i32 + 107..108 '2': i32 + 112..115 'foo': fn foo(&[i32]) -> &[i32] + 112..121 'foo(&[2])': &[i32] + 116..120 '&[2]': &[i32; _] + 117..120 '[2]': [i32; _] + 118..119 '2': i32 + 131..132 '_': i32 + 136..140 '&[3]': &[i32; _] + 137..140 '[3]': [i32; _] + 138..139 '3': i32 "### ); } @@ -353,24 +353,24 @@ fn test() { } "#), @r###" - [11; 145) '{ ... }; }': () - [21; 22) 't': &mut i32 - [25; 31) '&mut 1': &mut i32 - [30; 31) '1': i32 - [41; 42) 'x': *const i32 - [45; 142) 'match ... }': *const i32 - [51; 52) '1': i32 - [63; 64) '1': i32 - [63; 64) '1': i32 - [68; 69) 't': &mut i32 - [68; 81) 't as *mut i32': *mut i32 - [91; 92) '2': i32 - [91; 92) '2': i32 - [96; 97) 't': &mut i32 - [96; 105) 't as &i32': &i32 - [115; 116) '_': i32 - [120; 121) 't': &mut i32 - [120; 135) 't as *const i32': *const i32 + 11..145 '{ ... }; }': () + 21..22 't': &mut i32 + 25..31 '&mut 1': &mut i32 + 30..31 '1': i32 + 41..42 'x': *const i32 + 45..142 'match ... }': *const i32 + 51..52 '1': i32 + 63..64 '1': i32 + 63..64 '1': i32 + 68..69 't': &mut i32 + 68..81 't as *mut i32': *mut i32 + 91..92 '2': i32 + 91..92 '2': i32 + 96..97 't': &mut i32 + 96..105 't as &i32': &i32 + 115..116 '_': i32 + 120..121 't': &mut i32 + 120..135 't as *const i32': *const i32 "### ); } @@ -384,9 +384,9 @@ fn foo() -> u32 { } "#, true), @r###" - [17; 40) '{ ...own; }': ! - [23; 37) 'return unknown': ! - [30; 37) 'unknown': u32 + 17..40 '{ ...own; }': ! + 23..37 'return unknown': ! + 30..37 'unknown': u32 "### ); } @@ -404,24 +404,24 @@ fn test() { } "#, true), @r###" - [30; 31) 'x': &Foo - [39; 41) '{}': () - [52; 133) '{ ...oo); }': () - [58; 71) 'takes_ref_foo': fn takes_ref_foo(&Foo) - [58; 77) 'takes_...(&Foo)': () - [72; 76) '&Foo': &Foo - [73; 76) 'Foo': Foo - [83; 96) 'takes_ref_foo': fn takes_ref_foo(&Foo) - [83; 103) 'takes_...&&Foo)': () - [97; 102) '&&Foo': &&Foo - [98; 102) '&Foo': &Foo - [99; 102) 'Foo': Foo - [109; 122) 'takes_ref_foo': fn takes_ref_foo(&Foo) - [109; 130) 'takes_...&&Foo)': () - [123; 129) '&&&Foo': &&&Foo - [124; 129) '&&Foo': &&Foo - [125; 129) '&Foo': &Foo - [126; 129) 'Foo': Foo + 30..31 'x': &Foo + 39..41 '{}': () + 52..133 '{ ...oo); }': () + 58..71 'takes_ref_foo': fn takes_ref_foo(&Foo) + 58..77 'takes_...(&Foo)': () + 72..76 '&Foo': &Foo + 73..76 'Foo': Foo + 83..96 'takes_ref_foo': fn takes_ref_foo(&Foo) + 83..103 'takes_...&&Foo)': () + 97..102 '&&Foo': &&Foo + 98..102 '&Foo': &Foo + 99..102 'Foo': Foo + 109..122 'takes_ref_foo': fn takes_ref_foo(&Foo) + 109..130 'takes_...&&Foo)': () + 123..129 '&&&Foo': &&&Foo + 124..129 '&&Foo': &&Foo + 125..129 '&Foo': &Foo + 126..129 'Foo': Foo "### ); } @@ -439,26 +439,26 @@ fn test() { } "#, true), @r###" - [29; 30) 'x': &T - [41; 47) '{ *x }': T - [43; 45) '*x': T - [44; 45) 'x': &T - [58; 127) '{ ...oo); }': () - [64; 73) 'takes_ref': fn takes_ref(&Foo) -> Foo - [64; 79) 'takes_ref(&Foo)': Foo - [74; 78) '&Foo': &Foo - [75; 78) 'Foo': Foo - [85; 94) 'takes_ref': fn takes_ref<&Foo>(&&Foo) -> &Foo - [85; 101) 'takes_...&&Foo)': &Foo - [95; 100) '&&Foo': &&Foo - [96; 100) '&Foo': &Foo - [97; 100) 'Foo': Foo - [107; 116) 'takes_ref': fn takes_ref<&&Foo>(&&&Foo) -> &&Foo - [107; 124) 'takes_...&&Foo)': &&Foo - [117; 123) '&&&Foo': &&&Foo - [118; 123) '&&Foo': &&Foo - [119; 123) '&Foo': &Foo - [120; 123) 'Foo': Foo + 29..30 'x': &T + 41..47 '{ *x }': T + 43..45 '*x': T + 44..45 'x': &T + 58..127 '{ ...oo); }': () + 64..73 'takes_ref': fn takes_ref(&Foo) -> Foo + 64..79 'takes_ref(&Foo)': Foo + 74..78 '&Foo': &Foo + 75..78 'Foo': Foo + 85..94 'takes_ref': fn takes_ref<&Foo>(&&Foo) -> &Foo + 85..101 'takes_...&&Foo)': &Foo + 95..100 '&&Foo': &&Foo + 96..100 '&Foo': &Foo + 97..100 'Foo': Foo + 107..116 'takes_ref': fn takes_ref<&&Foo>(&&&Foo) -> &&Foo + 107..124 'takes_...&&Foo)': &&Foo + 117..123 '&&&Foo': &&&Foo + 118..123 '&&Foo': &&Foo + 119..123 '&Foo': &Foo + 120..123 'Foo': Foo "### ); } @@ -478,18 +478,18 @@ fn test() { } "#, true), @r###" - [127; 128) 'x': &str - [136; 138) '{}': () - [169; 180) '{ loop {} }': String - [171; 178) 'loop {}': ! - [176; 178) '{}': () - [191; 236) '{ ... }); }': () - [197; 210) 'takes_ref_str': fn takes_ref_str(&str) - [197; 233) 'takes_...g() })': () - [211; 232) '&{ ret...ng() }': &String - [212; 232) '{ retu...ng() }': String - [214; 228) 'returns_string': fn returns_string() -> String - [214; 230) 'return...ring()': String + 127..128 'x': &str + 136..138 '{}': () + 169..180 '{ loop {} }': String + 171..178 'loop {}': ! + 176..178 '{}': () + 191..236 '{ ... }); }': () + 197..210 'takes_ref_str': fn takes_ref_str(&str) + 197..233 'takes_...g() })': () + 211..232 '&{ ret...ng() }': &String + 212..232 '{ retu...ng() }': String + 214..228 'returns_string': fn returns_string() -> String + 214..230 'return...ring()': String "### ); } @@ -508,19 +508,19 @@ fn foo() { } "#, true), @r###" - [10; 106) '{ ... }; }': () - [20; 21) 'x': || -> &u32 - [24; 103) '|| { ... }': || -> &u32 - [27; 103) '{ ... }': &u32 - [37; 82) 'if tru... }': () - [40; 44) 'true': bool - [45; 82) '{ ... }': ! - [59; 71) 'return &1u32': ! - [66; 71) '&1u32': &u32 - [67; 71) '1u32': u32 - [91; 97) '&&1u32': &&u32 - [92; 97) '&1u32': &u32 - [93; 97) '1u32': u32 + 10..106 '{ ... }; }': () + 20..21 'x': || -> &u32 + 24..103 '|| { ... }': || -> &u32 + 27..103 '{ ... }': &u32 + 37..82 'if tru... }': () + 40..44 'true': bool + 45..82 '{ ... }': ! + 59..71 'return &1u32': ! + 66..71 '&1u32': &u32 + 67..71 '1u32': u32 + 91..97 '&&1u32': &&u32 + 92..97 '&1u32': &u32 + 93..97 '1u32': u32 "### ); } @@ -535,12 +535,12 @@ fn test() { } "#, true), @r###" - [8; 9) 'x': u32 - [25; 30) '{ 1 }': isize - [27; 28) '1': isize - [41; 79) '{ ...foo; }': () - [51; 52) 'f': fn(u32) -> isize - [73; 76) 'foo': fn foo(u32) -> isize + 8..9 'x': u32 + 25..30 '{ 1 }': isize + 27..28 '1': isize + 41..79 '{ ...foo; }': () + 51..52 'f': fn(u32) -> isize + 73..76 'foo': fn foo(u32) -> isize "### ); } @@ -554,12 +554,12 @@ fn test() { } "#, true), @r###" - [11; 55) '{ ...1 }; }': () - [21; 22) 'f': fn(u32) -> isize - [43; 52) '|x| { 1 }': |u32| -> isize - [44; 45) 'x': u32 - [47; 52) '{ 1 }': isize - [49; 50) '1': isize + 11..55 '{ ...1 }; }': () + 21..22 'f': fn(u32) -> isize + 43..52 '|x| { 1 }': |u32| -> isize + 44..45 'x': u32 + 47..52 '{ 1 }': isize + 49..50 '1': isize "### ); } @@ -577,11 +577,11 @@ impl S { } "#, true), @r###" - [51; 55) 'self': &S - [64; 87) '{ ... }': &TT - [74; 81) '&self.t': &TT - [75; 79) 'self': &S - [75; 81) 'self.t': TT + 51..55 'self': &S + 64..87 '{ ... }': &TT + 74..81 '&self.t': &TT + 75..79 'self': &S + 75..81 'self.t': TT "### ); } @@ -602,13 +602,13 @@ fn test() { } "#, true), @r###" - [162; 199) '{ ... 3]; }': () - [172; 173) 'f': &[usize] - [186; 196) '&[1, 2, 3]': &[usize; _] - [187; 196) '[1, 2, 3]': [usize; _] - [188; 189) '1': usize - [191; 192) '2': usize - [194; 195) '3': usize + 162..199 '{ ... 3]; }': () + 172..173 'f': &[usize] + 186..196 '&[1, 2, 3]': &[usize; _] + 187..196 '[1, 2, 3]': [usize; _] + 188..189 '1': usize + 191..192 '2': usize + 194..195 '3': usize "### ); } @@ -642,19 +642,19 @@ fn test() { } "#, true), @r###" - [388; 573) '{ ...bj2; }': () - [398; 401) 'obj': &dyn Baz - [423; 425) '&S': &S - [424; 425) 'S': S - [435; 438) 'obj': &dyn Bar - [460; 463) 'obj': &dyn Baz - [473; 476) 'obj': &dyn Foo - [495; 498) 'obj': &dyn Bar - [508; 512) 'obj2': &dyn Baz - [534; 536) '&S': &S - [535; 536) 'S': S - [546; 547) '_': &dyn Foo - [566; 570) 'obj2': &dyn Baz + 388..573 '{ ...bj2; }': () + 398..401 'obj': &dyn Baz + 423..425 '&S': &S + 424..425 'S': S + 435..438 'obj': &dyn Bar + 460..463 'obj': &dyn Baz + 473..476 'obj': &dyn Foo + 495..498 'obj': &dyn Bar + 508..512 'obj2': &dyn Baz + 534..536 '&S': &S + 535..536 'S': S + 546..547 '_': &dyn Foo + 566..570 'obj2': &dyn Baz "### ); } @@ -687,12 +687,12 @@ fn test() { } "#, true), @r###" - [292; 348) '{ ...obj; }': () - [302; 305) 'obj': &dyn D - [316; 318) '&S': &S - [317; 318) 'S': S - [328; 331) 'obj': &dyn A - [342; 345) 'obj': &dyn D + 292..348 '{ ...obj; }': () + 302..305 'obj': &dyn D + 316..318 '&S': &S + 317..318 'S': S + 328..331 'obj': &dyn A + 342..345 'obj': &dyn D "### ); } diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index f2a9b1c408..6b52672325 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs @@ -67,12 +67,12 @@ fn main() { } "#), @r###" - ![0; 17) '{Foo(v...,2,])}': Foo - ![1; 4) 'Foo': Foo({unknown}) -> Foo - ![1; 16) 'Foo(vec![1,2,])': Foo - ![5; 15) 'vec![1,2,]': {unknown} - [156; 182) '{ ...,2); }': () - [166; 167) 'x': Foo + !0..17 '{Foo(v...,2,])}': Foo + !1..4 'Foo': Foo({unknown}) -> Foo + !1..16 'Foo(vec![1,2,])': Foo + !5..15 'vec![1,2,]': {unknown} + 156..182 '{ ...,2); }': () + 166..167 'x': Foo "### ); } @@ -100,14 +100,14 @@ fn main() { } "#), @r###" - ![0; 17) '{Foo(v...,2,])}': Foo - ![1; 4) 'Foo': Foo({unknown}) -> Foo - ![1; 16) 'Foo(vec![1,2,])': Foo - ![5; 15) 'vec![1,2,]': {unknown} - [195; 251) '{ ...,2); }': () - [205; 206) 'x': Foo - [228; 229) 'y': {unknown} - [232; 248) 'crate:...!(1,2)': {unknown} + !0..17 '{Foo(v...,2,])}': Foo + !1..4 'Foo': Foo({unknown}) -> Foo + !1..16 'Foo(vec![1,2,])': Foo + !5..15 'vec![1,2,]': {unknown} + 195..251 '{ ...,2); }': () + 205..206 'x': Foo + 228..229 'y': {unknown} + 232..248 'crate:...!(1,2)': {unknown} "### ); } @@ -131,11 +131,11 @@ fn main() { } "#), @r###" - ![0; 5) '42i32': i32 - ![0; 5) '42i32': i32 - [111; 164) '{ ...!(); }': () - [121; 122) 'x': i32 - [148; 149) 'y': i32 + !0..5 '42i32': i32 + !0..5 '42i32': i32 + 111..164 '{ ...!(); }': () + 121..122 'x': i32 + 148..149 'y': i32 "### ); } @@ -172,51 +172,51 @@ fn spam() { } "#), @r###" - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - ![0; 6) '1isize': isize - [54; 457) '{ ...!(); }': ! - [88; 109) 'spam!(...am!())': {unknown} - [115; 134) 'for _ ...!() {}': () - [119; 120) '_': {unknown} - [132; 134) '{}': () - [139; 149) '|| spam!()': || -> isize - [155; 171) 'while ...!() {}': () - [169; 171) '{}': () - [176; 189) 'break spam!()': ! - [195; 209) 'return spam!()': ! - [215; 269) 'match ... }': isize - [239; 240) '_': isize - [274; 290) 'spam!(...am!())': {unknown} - [296; 318) 'Spam {...m!() }': {unknown} - [324; 340) 'spam!(...am!()]': {unknown} - [365; 381) 'spam!(... usize': usize - [387; 395) '&spam!()': &isize - [401; 409) '-spam!()': isize - [415; 431) 'spam!(...pam!()': {unknown} - [437; 454) 'spam!(...pam!()': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + !0..6 '1isize': isize + 54..457 '{ ...!(); }': ! + 88..109 'spam!(...am!())': {unknown} + 115..134 'for _ ...!() {}': () + 119..120 '_': {unknown} + 132..134 '{}': () + 139..149 '|| spam!()': || -> isize + 155..171 'while ...!() {}': () + 169..171 '{}': () + 176..189 'break spam!()': ! + 195..209 'return spam!()': ! + 215..269 'match ... }': isize + 239..240 '_': isize + 274..290 'spam!(...am!())': {unknown} + 296..318 'Spam {...m!() }': {unknown} + 324..340 'spam!(...am!()]': {unknown} + 365..381 'spam!(... usize': usize + 387..395 '&spam!()': &isize + 401..409 '-spam!()': isize + 415..431 'spam!(...pam!()': {unknown} + 437..454 'spam!(...pam!()': isize "### ); } @@ -244,9 +244,9 @@ fn foo() { } "#), @r###" - ![0; 5) '42i32': i32 - [171; 206) '{ ...32); }': () - [181; 184) 'foo': i32 + !0..5 '42i32': i32 + 171..206 '{ ...32); }': () + 181..184 'foo': i32 "### ); } @@ -357,12 +357,12 @@ fn main() { } "#), @r###" - [159; 164) '{ 0 }': u64 - [161; 162) '0': u64 - [175; 197) '{ ...f(); }': () - [185; 187) '_a': u64 - [191; 192) 'f': fn f() -> u64 - [191; 194) 'f()': u64 + 159..164 '{ 0 }': u64 + 161..162 '0': u64 + 175..197 '{ ...f(); }': () + 185..187 '_a': u64 + 191..192 'f': fn f() -> u64 + 191..194 'f()': u64 "### ); } @@ -379,10 +379,10 @@ fn main() { } "#), @r###" - ![0; 6) '1usize': usize - [11; 90) '{ ...!(); }': () - [17; 66) 'macro_... }': {unknown} - [75; 77) '_a': usize + !0..6 '1usize': usize + 11..90 '{ ...!(); }': () + 17..66 'macro_... }': {unknown} + 75..77 '_a': usize "### ); } @@ -399,9 +399,9 @@ fn main() { } "#), @r###" - ![0; 1) '0': i32 - [64; 88) '{ ...!(); }': () - [74; 75) 'x': i32 + !0..1 '0': i32 + 64..88 '{ ...!(); }': () + 74..75 'x': i32 "### ); } @@ -418,9 +418,9 @@ fn main() { } "#), @r###" - ![0; 2) '""': &str - [64; 88) '{ ...!(); }': () - [74; 75) 'x': &str + !0..2 '""': &str + 64..88 '{ ...!(); }': () + 74..75 'x': &str "### ); } @@ -437,9 +437,9 @@ fn main() { } "#), @r###" - ![0; 1) '0': i32 - [66; 92) '{ ...!(); }': () - [76; 77) 'x': i32 + !0..1 '0': i32 + 66..92 '{ ...!(); }': () + 76..77 'x': i32 "### ); } @@ -456,9 +456,9 @@ fn main() { } "#), @r###" - ![0; 13) '"helloworld!"': &str - [66; 122) '{ ...")); }': () - [76; 77) 'x': &str + !0..13 '"helloworld!"': &str + 66..122 '{ ...")); }': () + 76..77 'x': &str "### ); } @@ -591,9 +591,9 @@ fn main() { } "#), @r###" - ![0; 13) '"helloworld!"': &str - [104; 161) '{ ...")); }': () - [114; 115) 'x': &str + !0..13 '"helloworld!"': &str + 104..161 '{ ...")); }': () + 114..115 'x': &str "### ); } @@ -611,9 +611,9 @@ fn main() { } "#), @r###" - ![0; 5) '"bar"': &str - [88; 116) '{ ...o"); }': () - [98; 99) 'x': &str + !0..5 '"bar"': &str + 88..116 '{ ...o"); }': () + 98..99 'x': &str "### ); } @@ -703,12 +703,12 @@ fn main() { } "#), @r###" - [52; 111) '{ ... }; }': () - [62; 63) 'x': u32 - [66; 108) 'match ... }': u32 - [72; 74) '()': () - [85; 92) 'unit!()': () - [96; 101) '92u32': u32 + 52..111 '{ ... }; }': () + 62..63 'x': u32 + 66..108 'match ... }': u32 + 72..74 '()': () + 85..92 'unit!()': () + 96..101 '92u32': u32 "### ); } diff --git a/crates/ra_hir_ty/src/tests/method_resolution.rs b/crates/ra_hir_ty/src/tests/method_resolution.rs index af3e5b12cb..ab87f598a6 100644 --- a/crates/ra_hir_ty/src/tests/method_resolution.rs +++ b/crates/ra_hir_ty/src/tests/method_resolution.rs @@ -22,14 +22,14 @@ fn test() { } "#), @r###" - [45; 49) 'self': &[T] - [56; 79) '{ ... }': T - [66; 73) 'loop {}': ! - [71; 73) '{}': () - [133; 160) '{ ...o"); }': () - [139; 149) '<[_]>::foo': fn foo(&[u8]) -> u8 - [139; 157) '<[_]>:..."foo")': u8 - [150; 156) 'b"foo"': &[u8] + 45..49 'self': &[T] + 56..79 '{ ... }': T + 66..73 'loop {}': ! + 71..73 '{}': () + 133..160 '{ ...o"); }': () + 139..149 '<[_]>::foo': fn foo(&[u8]) -> u8 + 139..157 '<[_]>:..."foo")': u8 + 150..156 'b"foo"': &[u8] "### ); } @@ -51,15 +51,15 @@ fn test() { } "#), @r###" - [49; 75) '{ ... }': A - [59; 69) 'A { x: 0 }': A - [66; 67) '0': u32 - [88; 122) '{ ...a.x; }': () - [98; 99) 'a': A - [102; 108) 'A::new': fn new() -> A - [102; 110) 'A::new()': A - [116; 117) 'a': A - [116; 119) 'a.x': u32 + 49..75 '{ ... }': A + 59..69 'A { x: 0 }': A + 66..67 '0': u32 + 88..122 '{ ...a.x; }': () + 98..99 'a': A + 102..108 'A::new': fn new() -> A + 102..110 'A::new()': A + 116..117 'a': A + 116..119 'a.x': u32 "### ); } @@ -86,19 +86,19 @@ fn test() { } "#), @r###" - [47; 67) '{ ... }': A - [57; 61) 'A::B': A - [88; 108) '{ ... }': A - [98; 102) 'A::C': A - [121; 178) '{ ... c; }': () - [131; 132) 'a': A - [135; 139) 'A::b': fn b() -> A - [135; 141) 'A::b()': A - [147; 148) 'a': A - [158; 159) 'c': A - [162; 166) 'A::c': fn c() -> A - [162; 168) 'A::c()': A - [174; 175) 'c': A + 47..67 '{ ... }': A + 57..61 'A::B': A + 88..108 '{ ... }': A + 98..102 'A::C': A + 121..178 '{ ... c; }': () + 131..132 'a': A + 135..139 'A::b': fn b() -> A + 135..141 'A::b()': A + 147..148 'a': A + 158..159 'c': A + 162..166 'A::c': fn c() -> A + 162..168 'A::c()': A + 174..175 'c': A "### ); } @@ -130,22 +130,22 @@ fn test() { } "#), @r###" - [56; 64) '{ A {} }': A - [58; 62) 'A {}': A - [126; 132) '{ 99 }': u32 - [128; 130) '99': u32 - [202; 210) '{ C {} }': C - [204; 208) 'C {}': C - [241; 325) '{ ...g(); }': () - [251; 252) 'x': A - [255; 266) 'a::A::thing': fn thing() -> A - [255; 268) 'a::A::thing()': A - [278; 279) 'y': u32 - [282; 293) 'b::B::thing': fn thing() -> u32 - [282; 295) 'b::B::thing()': u32 - [305; 306) 'z': C - [309; 320) 'c::C::thing': fn thing() -> C - [309; 322) 'c::C::thing()': C + 56..64 '{ A {} }': A + 58..62 'A {}': A + 126..132 '{ 99 }': u32 + 128..130 '99': u32 + 202..210 '{ C {} }': C + 204..208 'C {}': C + 241..325 '{ ...g(); }': () + 251..252 'x': A + 255..266 'a::A::thing': fn thing() -> A + 255..268 'a::A::thing()': A + 278..279 'y': u32 + 282..293 'b::B::thing': fn thing() -> u32 + 282..295 'b::B::thing()': u32 + 305..306 'z': C + 309..320 'c::C::thing': fn thing() -> C + 309..322 'c::C::thing()': C "### ); } @@ -169,15 +169,15 @@ fn test() { } "#), @r###" - [64; 67) 'val': T - [82; 109) '{ ... }': Gen - [92; 103) 'Gen { val }': Gen - [98; 101) 'val': T - [123; 155) '{ ...32); }': () - [133; 134) 'a': Gen - [137; 146) 'Gen::make': fn make(u32) -> Gen - [137; 152) 'Gen::make(0u32)': Gen - [147; 151) '0u32': u32 + 64..67 'val': T + 82..109 '{ ... }': Gen + 92..103 'Gen { val }': Gen + 98..101 'val': T + 123..155 '{ ...32); }': () + 133..134 'a': Gen + 137..146 'Gen::make': fn make(u32) -> Gen + 137..152 'Gen::make(0u32)': Gen + 147..151 '0u32': u32 "### ); } @@ -201,13 +201,13 @@ fn test() { } "#), @r###" - [80; 104) '{ ... }': Gen - [90; 98) 'loop { }': ! - [95; 98) '{ }': () - [118; 146) '{ ...e(); }': () - [128; 129) 'a': Gen - [132; 141) 'Gen::make': fn make() -> Gen - [132; 143) 'Gen::make()': Gen + 80..104 '{ ... }': Gen + 90..98 'loop { }': ! + 95..98 '{ }': () + 118..146 '{ ...e(); }': () + 128..129 'a': Gen + 132..141 'Gen::make': fn make() -> Gen + 132..143 'Gen::make()': Gen "### ); } @@ -255,13 +255,13 @@ fn test() { } "#), @r###" - [76; 100) '{ ... }': Gen - [86; 94) 'loop { }': ! - [91; 94) '{ }': () - [114; 149) '{ ...e(); }': () - [124; 125) 'a': Gen - [128; 144) 'Gen::<...::make': fn make() -> Gen - [128; 146) 'Gen::<...make()': Gen + 76..100 '{ ... }': Gen + 86..94 'loop { }': ! + 91..94 '{ }': () + 114..149 '{ ...e(); }': () + 124..125 'a': Gen + 128..144 'Gen::<...::make': fn make() -> Gen + 128..146 'Gen::<...make()': Gen "### ); } @@ -286,13 +286,13 @@ fn test() { } "#), @r###" - [102; 126) '{ ... }': Gen - [112; 120) 'loop { }': ! - [117; 120) '{ }': () - [140; 180) '{ ...e(); }': () - [150; 151) 'a': Gen - [154; 175) 'Gen::<...::make': fn make() -> Gen - [154; 177) 'Gen::<...make()': Gen + 102..126 '{ ... }': Gen + 112..120 'loop { }': ! + 117..120 '{ }': () + 140..180 '{ ...e(); }': () + 150..151 'a': Gen + 154..175 'Gen::<...::make': fn make() -> Gen + 154..177 'Gen::<...make()': Gen "### ); } @@ -340,13 +340,13 @@ fn test() { } "#), @r###" - [31; 35) 'self': &Self - [110; 114) 'self': &Self - [170; 228) '{ ...i128 }': () - [176; 178) 'S1': S1 - [176; 187) 'S1.method()': u32 - [203; 205) 'S2': S2 - [203; 214) 'S2.method()': i128 + 31..35 'self': &Self + 110..114 'self': &Self + 170..228 '{ ...i128 }': () + 176..178 'S1': S1 + 176..187 'S1.method()': u32 + 203..205 'S2': S2 + 203..214 'S2.method()': i128 "### ); } @@ -387,14 +387,14 @@ mod bar_test { } "#), @r###" - [63; 67) 'self': &Self - [169; 173) 'self': &Self - [300; 337) '{ ... }': () - [310; 311) 'S': S - [310; 320) 'S.method()': u32 - [416; 454) '{ ... }': () - [426; 427) 'S': S - [426; 436) 'S.method()': i128 + 63..67 'self': &Self + 169..173 'self': &Self + 300..337 '{ ... }': () + 310..311 'S': S + 310..320 'S.method()': u32 + 416..454 '{ ... }': () + 426..427 'S': S + 426..436 'S.method()': i128 "### ); } @@ -414,10 +414,10 @@ fn test() { } "#), @r###" - [33; 37) 'self': &Self - [92; 111) '{ ...d(); }': () - [98; 99) 'S': S - [98; 108) 'S.method()': u32 + 33..37 'self': &Self + 92..111 '{ ...d(); }': () + 98..99 'S': S + 98..108 'S.method()': u32 "### ); } @@ -443,17 +443,17 @@ fn test() { } "#), @r###" - [43; 47) 'self': &Self - [82; 86) 'self': &Self - [210; 361) '{ ..., i8 }': () - [216; 218) 'S1': S1 - [216; 228) 'S1.method1()': (u8, u16, u32) - [250; 252) 'S1': S1 - [250; 262) 'S1.method2()': (u32, u16, u8) - [284; 286) 'S2': S2 - [284; 296) 'S2.method1()': (i8, i16, {unknown}) - [324; 326) 'S2': S2 - [324; 336) 'S2.method2()': ({unknown}, i16, i8) + 43..47 'self': &Self + 82..86 'self': &Self + 210..361 '{ ..., i8 }': () + 216..218 'S1': S1 + 216..228 'S1.method1()': (u8, u16, u32) + 250..252 'S1': S1 + 250..262 'S1.method2()': (u32, u16, u8) + 284..286 'S2': S2 + 284..296 'S2.method1()': (i8, i16, {unknown}) + 324..326 'S2': S2 + 324..336 'S2.method2()': ({unknown}, i16, i8) "### ); } @@ -473,12 +473,12 @@ fn test() { } "#), @r###" - [33; 37) 'self': &Self - [102; 127) '{ ...d(); }': () - [108; 109) 'S': S(u32) -> S - [108; 115) 'S(1u32)': S - [108; 124) 'S(1u32...thod()': u32 - [110; 114) '1u32': u32 + 33..37 'self': &Self + 102..127 '{ ...d(); }': () + 108..109 'S': S(u32) -> S + 108..115 'S(1u32)': S + 108..124 'S(1u32...thod()': u32 + 110..114 '1u32': u32 "### ); } @@ -499,16 +499,16 @@ fn test() { } "#), @r###" - [87; 193) '{ ...t(); }': () - [97; 99) 's1': S - [105; 121) 'Defaul...efault': fn default() -> S - [105; 123) 'Defaul...ault()': S - [133; 135) 's2': S - [138; 148) 'S::default': fn default() -> S - [138; 150) 'S::default()': S - [160; 162) 's3': S - [165; 188) '() -> S - [165; 190) '() -> S + 105..123 'Defaul...ault()': S + 133..135 's2': S + 138..148 'S::default': fn default() -> S + 138..150 'S::default()': S + 160..162 's3': S + 165..188 '() -> S + 165..190 '() -> u32 - [141; 150) 'S::make()': u32 - [160; 161) 'b': u64 - [164; 178) 'G::::make': fn make, u64>() -> u64 - [164; 180) 'G::, f64>() -> f64 - [199; 208) 'G::make()': f64 + 127..211 '{ ...e(); }': () + 137..138 'a': u32 + 141..148 'S::make': fn make() -> u32 + 141..150 'S::make()': u32 + 160..161 'b': u64 + 164..178 'G::::make': fn make, u64>() -> u64 + 164..180 'G::, f64>() -> f64 + 199..208 'G::make()': f64 "### ); } @@ -565,22 +565,22 @@ fn test() { } "#), @r###" - [135; 313) '{ ...e(); }': () - [145; 146) 'a': (u32, i64) - [149; 163) 'S::make::': fn make() -> (u32, i64) - [149; 165) 'S::mak...i64>()': (u32, i64) - [175; 176) 'b': (u32, i64) - [189; 196) 'S::make': fn make() -> (u32, i64) - [189; 198) 'S::make()': (u32, i64) - [208; 209) 'c': (u32, i64) - [212; 233) 'G::': fn make, u32, i64>() -> (u32, i64) - [212; 235) 'G::()': (u32, i64) - [245; 246) 'd': (u32, i64) - [259; 273) 'G::make::': fn make, u32, i64>() -> (u32, i64) - [259; 275) 'G::mak...i64>()': (u32, i64) - [285; 286) 'e': (u32, i64) - [301; 308) 'G::make': fn make, u32, i64>() -> (u32, i64) - [301; 310) 'G::make()': (u32, i64) + 135..313 '{ ...e(); }': () + 145..146 'a': (u32, i64) + 149..163 'S::make::': fn make() -> (u32, i64) + 149..165 'S::mak...i64>()': (u32, i64) + 175..176 'b': (u32, i64) + 189..196 'S::make': fn make() -> (u32, i64) + 189..198 'S::make()': (u32, i64) + 208..209 'c': (u32, i64) + 212..233 'G::': fn make, u32, i64>() -> (u32, i64) + 212..235 'G::()': (u32, i64) + 245..246 'd': (u32, i64) + 259..273 'G::make::': fn make, u32, i64>() -> (u32, i64) + 259..275 'G::mak...i64>()': (u32, i64) + 285..286 'e': (u32, i64) + 301..308 'G::make': fn make, u32, i64>() -> (u32, i64) + 301..310 'G::make()': (u32, i64) "### ); } @@ -599,10 +599,10 @@ fn test() { } "#), @r###" - [101; 127) '{ ...e(); }': () - [111; 112) 'a': (S, i64) - [115; 122) 'S::make': fn make, i64>() -> (S, i64) - [115; 124) 'S::make()': (S, i64) + 101..127 '{ ...e(); }': () + 111..112 'a': (S, i64) + 115..122 'S::make': fn make, i64>() -> (S, i64) + 115..124 'S::make()': (S, i64) "### ); } @@ -623,13 +623,13 @@ fn test() { } "#), @r###" - [131; 203) '{ ...e(); }': () - [141; 142) 'a': (S, i64) - [158; 165) 'S::make': fn make, i64>() -> (S, i64) - [158; 167) 'S::make()': (S, i64) - [177; 178) 'b': (S, i32) - [191; 198) 'S::make': fn make, i32>() -> (S, i32) - [191; 200) 'S::make()': (S, i32) + 131..203 '{ ...e(); }': () + 141..142 'a': (S, i64) + 158..165 'S::make': fn make, i64>() -> (S, i64) + 158..167 'S::make()': (S, i64) + 177..178 'b': (S, i32) + 191..198 'S::make': fn make, i32>() -> (S, i32) + 191..200 'S::make()': (S, i32) "### ); } @@ -649,13 +649,13 @@ fn test() { } "#), @r###" - [107; 211) '{ ...>(); }': () - [117; 118) 'a': (S, i64, u8) - [121; 150) '': fn make, i64, u8>() -> (S, i64, u8) - [121; 152) '()': (S, i64, u8) - [162; 163) 'b': (S, i64, u8) - [182; 206) 'Trait:...::': fn make, i64, u8>() -> (S, i64, u8) - [182; 208) 'Trait:...()': (S, i64, u8) + 107..211 '{ ...>(); }': () + 117..118 'a': (S, i64, u8) + 121..150 '': fn make, i64, u8>() -> (S, i64, u8) + 121..152 '()': (S, i64, u8) + 162..163 'b': (S, i64, u8) + 182..206 'Trait:...::': fn make, i64, u8>() -> (S, i64, u8) + 182..208 'Trait:...()': (S, i64, u8) "### ); } @@ -672,11 +672,11 @@ fn test(t: T) { } "#), @r###" - [30; 34) 'self': &Self - [64; 65) 't': T - [70; 89) '{ ...d(); }': () - [76; 77) 't': T - [76; 86) 't.method()': u32 + 30..34 'self': &Self + 64..65 't': T + 70..89 '{ ...d(); }': () + 76..77 't': T + 76..86 't.method()': u32 "### ); } @@ -693,11 +693,11 @@ fn test>(t: T) { } "#), @r###" - [33; 37) 'self': &Self - [71; 72) 't': T - [77; 96) '{ ...d(); }': () - [83; 84) 't': T - [83; 93) 't.method()': U + 33..37 'self': &Self + 71..72 't': T + 77..96 '{ ...d(); }': () + 83..84 't': T + 83..93 't.method()': U "### ); } @@ -719,18 +719,18 @@ fn test() { } "#), @r###" - [29; 33) 'self': Self - [111; 202) '{ ...(S); }': () - [121; 122) 'x': u32 - [130; 131) 'S': S - [130; 138) 'S.into()': u32 - [148; 149) 'y': u64 - [157; 158) 'S': S - [157; 165) 'S.into()': u64 - [175; 176) 'z': u64 - [179; 196) 'Into::...::into': fn into(S) -> u64 - [179; 199) 'Into::...nto(S)': u64 - [197; 198) 'S': S + 29..33 'self': Self + 111..202 '{ ...(S); }': () + 121..122 'x': u32 + 130..131 'S': S + 130..138 'S.into()': u32 + 148..149 'y': u64 + 157..158 'S': S + 157..165 'S.into()': u64 + 175..176 'z': u64 + 179..196 'Into::...::into': fn into(S) -> u64 + 179..199 'Into::...nto(S)': u64 + 197..198 'S': S "### ); } diff --git a/crates/ra_hir_ty/src/tests/patterns.rs b/crates/ra_hir_ty/src/tests/patterns.rs index 6ea51d5d31..af291092d3 100644 --- a/crates/ra_hir_ty/src/tests/patterns.rs +++ b/crates/ra_hir_ty/src/tests/patterns.rs @@ -30,54 +30,54 @@ fn test(x: &i32) { } "#), @r###" - [9; 10) 'x': &i32 - [18; 369) '{ ...o_x; }': () - [28; 29) 'y': &i32 - [32; 33) 'x': &i32 - [43; 45) '&z': &i32 - [44; 45) 'z': i32 - [48; 49) 'x': &i32 - [59; 60) 'a': i32 - [63; 64) 'z': i32 - [74; 80) '(c, d)': (i32, &str) - [75; 76) 'c': i32 - [78; 79) 'd': &str - [83; 95) '(1, "hello")': (i32, &str) - [84; 85) '1': i32 - [87; 94) '"hello"': &str - [102; 152) 'for (e... }': () - [106; 112) '(e, f)': ({unknown}, {unknown}) - [107; 108) 'e': {unknown} - [110; 111) 'f': {unknown} - [116; 125) 'some_iter': {unknown} - [126; 152) '{ ... }': () - [140; 141) 'g': {unknown} - [144; 145) 'e': {unknown} - [158; 205) 'if let... }': () - [165; 170) '[val]': [{unknown}] - [166; 169) 'val': {unknown} - [173; 176) 'opt': [{unknown}] - [177; 205) '{ ... }': () - [191; 192) 'h': {unknown} - [195; 198) 'val': {unknown} - [215; 221) 'lambda': |u64, u64, i32| -> i32 - [224; 256) '|a: u6...b; c }': |u64, u64, i32| -> i32 - [225; 226) 'a': u64 - [233; 234) 'b': u64 - [236; 237) 'c': i32 - [244; 256) '{ a + b; c }': i32 - [246; 247) 'a': u64 - [246; 251) 'a + b': u64 - [250; 251) 'b': u64 - [253; 254) 'c': i32 - [267; 279) 'ref ref_to_x': &&i32 - [282; 283) 'x': &i32 - [293; 302) 'mut mut_x': &i32 - [305; 306) 'x': &i32 - [316; 336) 'ref mu...f_to_x': &mut &i32 - [339; 340) 'x': &i32 - [350; 351) 'k': &mut &i32 - [354; 366) 'mut_ref_to_x': &mut &i32 + 9..10 'x': &i32 + 18..369 '{ ...o_x; }': () + 28..29 'y': &i32 + 32..33 'x': &i32 + 43..45 '&z': &i32 + 44..45 'z': i32 + 48..49 'x': &i32 + 59..60 'a': i32 + 63..64 'z': i32 + 74..80 '(c, d)': (i32, &str) + 75..76 'c': i32 + 78..79 'd': &str + 83..95 '(1, "hello")': (i32, &str) + 84..85 '1': i32 + 87..94 '"hello"': &str + 102..152 'for (e... }': () + 106..112 '(e, f)': ({unknown}, {unknown}) + 107..108 'e': {unknown} + 110..111 'f': {unknown} + 116..125 'some_iter': {unknown} + 126..152 '{ ... }': () + 140..141 'g': {unknown} + 144..145 'e': {unknown} + 158..205 'if let... }': () + 165..170 '[val]': [{unknown}] + 166..169 'val': {unknown} + 173..176 'opt': [{unknown}] + 177..205 '{ ... }': () + 191..192 'h': {unknown} + 195..198 'val': {unknown} + 215..221 'lambda': |u64, u64, i32| -> i32 + 224..256 '|a: u6...b; c }': |u64, u64, i32| -> i32 + 225..226 'a': u64 + 233..234 'b': u64 + 236..237 'c': i32 + 244..256 '{ a + b; c }': i32 + 246..247 'a': u64 + 246..251 'a + b': u64 + 250..251 'b': u64 + 253..254 'c': i32 + 267..279 'ref ref_to_x': &&i32 + 282..283 'x': &i32 + 293..302 'mut mut_x': &i32 + 305..306 'x': &i32 + 316..336 'ref mu...f_to_x': &mut &i32 + 339..340 'x': &i32 + 350..351 'k': &mut &i32 + 354..366 'mut_ref_to_x': &mut &i32 "### ); } @@ -97,47 +97,47 @@ fn test(x: &i32) { } "#, true), @r###" - [18; 29) '{ loop {} }': T - [20; 27) 'loop {}': ! - [25; 27) '{}': () - [38; 39) 'x': &i32 - [47; 209) '{ ...) {} }': () - [53; 76) 'if let...y() {}': () - [60; 65) '"foo"': &str - [60; 65) '"foo"': &str - [68; 71) 'any': fn any<&str>() -> &str - [68; 73) 'any()': &str - [74; 76) '{}': () - [81; 100) 'if let...y() {}': () - [88; 89) '1': i32 - [88; 89) '1': i32 - [92; 95) 'any': fn any() -> i32 - [92; 97) 'any()': i32 - [98; 100) '{}': () - [105; 127) 'if let...y() {}': () - [112; 116) '1u32': u32 - [112; 116) '1u32': u32 - [119; 122) 'any': fn any() -> u32 - [119; 124) 'any()': u32 - [125; 127) '{}': () - [132; 154) 'if let...y() {}': () - [139; 143) '1f32': f32 - [139; 143) '1f32': f32 - [146; 149) 'any': fn any() -> f32 - [146; 151) 'any()': f32 - [152; 154) '{}': () - [159; 180) 'if let...y() {}': () - [166; 169) '1.0': f64 - [166; 169) '1.0': f64 - [172; 175) 'any': fn any() -> f64 - [172; 177) 'any()': f64 - [178; 180) '{}': () - [185; 207) 'if let...y() {}': () - [192; 196) 'true': bool - [192; 196) 'true': bool - [199; 202) 'any': fn any() -> bool - [199; 204) 'any()': bool - [205; 207) '{}': () + 18..29 '{ loop {} }': T + 20..27 'loop {}': ! + 25..27 '{}': () + 38..39 'x': &i32 + 47..209 '{ ...) {} }': () + 53..76 'if let...y() {}': () + 60..65 '"foo"': &str + 60..65 '"foo"': &str + 68..71 'any': fn any<&str>() -> &str + 68..73 'any()': &str + 74..76 '{}': () + 81..100 'if let...y() {}': () + 88..89 '1': i32 + 88..89 '1': i32 + 92..95 'any': fn any() -> i32 + 92..97 'any()': i32 + 98..100 '{}': () + 105..127 'if let...y() {}': () + 112..116 '1u32': u32 + 112..116 '1u32': u32 + 119..122 'any': fn any() -> u32 + 119..124 'any()': u32 + 125..127 '{}': () + 132..154 'if let...y() {}': () + 139..143 '1f32': f32 + 139..143 '1f32': f32 + 146..149 'any': fn any() -> f32 + 146..151 'any()': f32 + 152..154 '{}': () + 159..180 'if let...y() {}': () + 166..169 '1.0': f64 + 166..169 '1.0': f64 + 172..175 'any': fn any() -> f64 + 172..177 'any()': f64 + 178..180 '{}': () + 185..207 'if let...y() {}': () + 192..196 'true': bool + 192..196 'true': bool + 199..202 'any': fn any() -> bool + 199..204 'any()': bool + 205..207 '{}': () "### ); } @@ -152,16 +152,16 @@ fn test(x: &i32) { } "#, true), @r###" - [9; 10) 'x': &i32 - [18; 76) '{ ...2 {} }': () - [24; 46) 'if let...u32 {}': () - [31; 36) '1..76': u32 - [39; 43) '2u32': u32 - [44; 46) '{}': () - [51; 74) 'if let...u32 {}': () - [58; 64) '1..=76': u32 - [67; 71) '2u32': u32 - [72; 74) '{}': () + 9..10 'x': &i32 + 18..76 '{ ...2 {} }': () + 24..46 'if let...u32 {}': () + 31..36 '1..76': u32 + 39..43 '2u32': u32 + 44..46 '{}': () + 51..74 'if let...u32 {}': () + 58..64 '1..=76': u32 + 67..71 '2u32': u32 + 72..74 '{}': () "### ); } @@ -178,19 +178,19 @@ fn test() { } "#), @r###" - [28; 79) '{ ...(1); }': () - [38; 42) 'A(n)': A - [40; 41) 'n': &i32 - [45; 50) '&A(1)': &A - [46; 47) 'A': A(i32) -> A - [46; 50) 'A(1)': A - [48; 49) '1': i32 - [60; 64) 'A(n)': A - [62; 63) 'n': &mut i32 - [67; 76) '&mut A(1)': &mut A - [72; 73) 'A': A(i32) -> A - [72; 76) 'A(1)': A - [74; 75) '1': i32 + 28..79 '{ ...(1); }': () + 38..42 'A(n)': A + 40..41 'n': &i32 + 45..50 '&A(1)': &A + 46..47 'A': A(i32) -> A + 46..50 'A(1)': A + 48..49 '1': i32 + 60..64 'A(n)': A + 62..63 'n': &mut i32 + 67..76 '&mut A(1)': &mut A + 72..73 'A': A(i32) -> A + 72..76 'A(1)': A + 74..75 '1': i32 "### ); } @@ -206,18 +206,18 @@ fn test() { } "#), @r###" - [11; 57) '{ ...= v; }': () - [21; 22) 'v': &(i32, &i32) - [25; 33) '&(1, &2)': &(i32, &i32) - [26; 33) '(1, &2)': (i32, &i32) - [27; 28) '1': i32 - [30; 32) '&2': &i32 - [31; 32) '2': i32 - [43; 50) '(_, &w)': (i32, &i32) - [44; 45) '_': i32 - [47; 49) '&w': &i32 - [48; 49) 'w': i32 - [53; 54) 'v': &(i32, &i32) + 11..57 '{ ...= v; }': () + 21..22 'v': &(i32, &i32) + 25..33 '&(1, &2)': &(i32, &i32) + 26..33 '(1, &2)': (i32, &i32) + 27..28 '1': i32 + 30..32 '&2': &i32 + 31..32 '2': i32 + 43..50 '(_, &w)': (i32, &i32) + 44..45 '_': i32 + 47..49 '&w': &i32 + 48..49 'w': i32 + 53..54 'v': &(i32, &i32) "### ); } @@ -242,30 +242,30 @@ fn test() { } "#), @r###" - [11; 210) '{ ... } }': () - [21; 26) 'slice': &[f64] - [37; 43) '&[0.0]': &[f64; _] - [38; 43) '[0.0]': [f64; _] - [39; 42) '0.0': f64 - [49; 208) 'match ... }': () - [55; 60) 'slice': &[f64] - [71; 74) '&[]': &[f64] - [72; 74) '[]': [f64] - [78; 80) '{}': () - [90; 94) '&[a]': &[f64] - [91; 94) '[a]': [f64] - [92; 93) 'a': f64 - [98; 124) '{ ... }': () - [112; 113) 'a': f64 - [134; 141) '&[b, c]': &[f64] - [135; 141) '[b, c]': [f64] - [136; 137) 'b': f64 - [139; 140) 'c': f64 - [145; 186) '{ ... }': () - [159; 160) 'b': f64 - [174; 175) 'c': f64 - [195; 196) '_': &[f64] - [200; 202) '{}': () + 11..210 '{ ... } }': () + 21..26 'slice': &[f64] + 37..43 '&[0.0]': &[f64; _] + 38..43 '[0.0]': [f64; _] + 39..42 '0.0': f64 + 49..208 'match ... }': () + 55..60 'slice': &[f64] + 71..74 '&[]': &[f64] + 72..74 '[]': [f64] + 78..80 '{}': () + 90..94 '&[a]': &[f64] + 91..94 '[a]': [f64] + 92..93 'a': f64 + 98..124 '{ ... }': () + 112..113 'a': f64 + 134..141 '&[b, c]': &[f64] + 135..141 '[b, c]': [f64] + 136..137 'b': f64 + 139..140 'c': f64 + 145..186 '{ ... }': () + 159..160 'b': f64 + 174..175 'c': f64 + 195..196 '_': &[f64] + 200..202 '{}': () "### ); } @@ -288,25 +288,25 @@ fn test() { } "#), @r###" - [11; 180) '{ ... } }': () - [21; 24) 'arr': [f64; _] - [37; 47) '[0.0, 1.0]': [f64; _] - [38; 41) '0.0': f64 - [43; 46) '1.0': f64 - [53; 178) 'match ... }': () - [59; 62) 'arr': [f64; _] - [73; 81) '[1.0, a]': [f64; _] - [74; 77) '1.0': f64 - [74; 77) '1.0': f64 - [79; 80) 'a': f64 - [85; 111) '{ ... }': () - [99; 100) 'a': f64 - [121; 127) '[b, c]': [f64; _] - [122; 123) 'b': f64 - [125; 126) 'c': f64 - [131; 172) '{ ... }': () - [145; 146) 'b': f64 - [160; 161) 'c': f64 + 11..180 '{ ... } }': () + 21..24 'arr': [f64; _] + 37..47 '[0.0, 1.0]': [f64; _] + 38..41 '0.0': f64 + 43..46 '1.0': f64 + 53..178 'match ... }': () + 59..62 'arr': [f64; _] + 73..81 '[1.0, a]': [f64; _] + 74..77 '1.0': f64 + 74..77 '1.0': f64 + 79..80 'a': f64 + 85..111 '{ ... }': () + 99..100 'a': f64 + 121..127 '[b, c]': [f64; _] + 122..123 'b': f64 + 125..126 'c': f64 + 131..172 '{ ... }': () + 145..146 'b': f64 + 160..161 'c': f64 "### ); } @@ -339,31 +339,31 @@ fn test() { } "#), @r###" - [68; 289) '{ ... d; }': () - [78; 79) 'e': E - [82; 95) 'E::A { x: 3 }': E - [92; 93) '3': usize - [106; 113) 'S(y, z)': S - [108; 109) 'y': u32 - [111; 112) 'z': E - [116; 119) 'foo': S - [129; 148) 'E::A {..._var }': E - [139; 146) 'new_var': usize - [151; 152) 'e': E - [159; 245) 'match ... }': usize - [165; 166) 'e': E - [177; 187) 'E::A { x }': E - [184; 185) 'x': usize - [191; 192) 'x': usize - [202; 206) 'E::B': E - [210; 213) 'foo': bool - [217; 218) '1': usize - [228; 232) 'E::B': E - [236; 238) '10': usize - [256; 275) 'ref d ...{ .. }': &E - [264; 275) 'E::A { .. }': E - [278; 279) 'e': E - [285; 286) 'd': &E + 68..289 '{ ... d; }': () + 78..79 'e': E + 82..95 'E::A { x: 3 }': E + 92..93 '3': usize + 106..113 'S(y, z)': S + 108..109 'y': u32 + 111..112 'z': E + 116..119 'foo': S + 129..148 'E::A {..._var }': E + 139..146 'new_var': usize + 151..152 'e': E + 159..245 'match ... }': usize + 165..166 'e': E + 177..187 'E::A { x }': E + 184..185 'x': usize + 191..192 'x': usize + 202..206 'E::B': E + 210..213 'foo': bool + 217..218 '1': usize + 228..232 'E::B': E + 236..238 '10': usize + 256..275 'ref d ...{ .. }': &E + 264..275 'E::A { .. }': E + 278..279 'e': E + 285..286 'd': &E "### ); } @@ -391,23 +391,23 @@ fn test(a1: A, o: Option) { } "#), @r###" - [79; 81) 'a1': A - [91; 92) 'o': Option - [107; 244) '{ ... }; }': () - [117; 128) 'A { x: x2 }': A - [124; 126) 'x2': u32 - [131; 133) 'a1': A - [143; 161) 'A:: - [157; 159) 'x3': i64 - [164; 174) 'A { x: 1 }': A - [171; 172) '1': i64 - [180; 241) 'match ... }': u64 - [186; 187) 'o': Option - [198; 213) 'Option::Some(t)': Option - [211; 212) 't': u64 - [217; 218) 't': u64 - [228; 229) '_': Option - [233; 234) '1': u64 + 79..81 'a1': A + 91..92 'o': Option + 107..244 '{ ... }; }': () + 117..128 'A { x: x2 }': A + 124..126 'x2': u32 + 131..133 'a1': A + 143..161 'A:: + 157..159 'x3': i64 + 164..174 'A { x: 1 }': A + 171..172 '1': i64 + 180..241 'match ... }': u64 + 186..187 'o': Option + 198..213 'Option::Some(t)': Option + 211..212 't': u64 + 217..218 't': u64 + 228..229 '_': Option + 233..234 '1': u64 "### ); } @@ -431,27 +431,27 @@ fn test() { } "#, true), @r###" - [74; 75) '1': usize - [88; 310) '{ ...atch }': () - [98; 99) 'a': Option - [115; 119) 'None': Option - [129; 130) 'b': Option - [146; 183) 'match ... }': Option - [152; 153) 'a': Option - [164; 168) 'None': Option - [172; 176) 'None': Option - [193; 194) '_': () - [201; 224) 'match ... Foo }': Foo - [207; 209) '()': () - [212; 215) 'Foo': Foo - [219; 222) 'Foo': Foo - [255; 256) '_': () - [263; 286) 'match ... Bar }': usize - [269; 271) '()': () - [274; 277) 'Bar': usize - [281; 284) 'Bar': usize - [201; 224): expected (), got Foo - [263; 286): expected (), got usize + 74..75 '1': usize + 88..310 '{ ...atch }': () + 98..99 'a': Option + 115..119 'None': Option + 129..130 'b': Option + 146..183 'match ... }': Option + 152..153 'a': Option + 164..168 'None': Option + 172..176 'None': Option + 193..194 '_': () + 201..224 'match ... Foo }': Foo + 207..209 '()': () + 212..215 'Foo': Foo + 219..222 'Foo': Foo + 255..256 '_': () + 263..286 'match ... Bar }': usize + 269..271 '()': () + 274..277 'Bar': usize + 281..284 'Bar': usize + 201..224: expected (), got Foo + 263..286: expected (), got usize "### ); } @@ -469,15 +469,15 @@ fn main() { } } "#), @" - [28; 32) 'self': &S - [42; 51) '{ false }': bool - [44; 49) 'false': bool - [65; 116) '{ ... } }': () - [71; 114) 'match ... }': () - [77; 78) 'S': S - [89; 90) 's': S - [94; 95) 's': S - [94; 101) 's.foo()': bool - [105; 107) '()': () + 28..32 'self': &S + 42..51 '{ false }': bool + 44..49 'false': bool + 65..116 '{ ... } }': () + 71..114 'match ... }': () + 77..78 'S': S + 89..90 's': S + 94..95 's': S + 94..101 's.foo()': bool + 105..107 '()': () ") } diff --git a/crates/ra_hir_ty/src/tests/regression.rs b/crates/ra_hir_ty/src/tests/regression.rs index 61a6801fc6..8a1292c7aa 100644 --- a/crates/ra_hir_ty/src/tests/regression.rs +++ b/crates/ra_hir_ty/src/tests/regression.rs @@ -14,11 +14,11 @@ fn test() { } "#), @r###" - [11; 37) '{ l... {}; }': () - [20; 21) 'x': () - [24; 34) 'if true {}': () - [27; 31) 'true': bool - [32; 34) '{}': () + 11..37 '{ l... {}; }': () + 20..21 'x': () + 24..34 'if true {}': () + 27..31 'true': bool + 32..34 '{}': () "### ); } @@ -34,10 +34,10 @@ fn test(x: X) { } "#), @r###" - [20; 21) 'x': X - [26; 47) '{ ...eld; }': () - [32; 33) 'x': X - [32; 44) 'x.some_field': {unknown} + 20..21 'x': X + 26..47 '{ ...eld; }': () + 32..33 'x': X + 32..44 'x.some_field': {unknown} "### ); } @@ -55,14 +55,14 @@ fn test() { } "#), @r###" - [11; 89) '{ ... } }': () - [17; 21) 'X {}': {unknown} - [27; 87) 'match ... }': () - [33; 34) 'x': {unknown} - [45; 52) 'A::B {}': {unknown} - [56; 58) '()': () - [68; 74) 'A::Y()': {unknown} - [78; 80) '()': () + 11..89 '{ ... } }': () + 17..21 'X {}': {unknown} + 27..87 'match ... }': () + 33..34 'x': {unknown} + 45..52 'A::B {}': {unknown} + 56..58 '()': () + 68..74 'A::Y()': {unknown} + 78..80 '()': () "### ); } @@ -77,12 +77,12 @@ fn quux() { } "#), @r###" - [11; 41) '{ ...+ y; }': () - [21; 22) 'y': i32 - [25; 27) '92': i32 - [33; 34) '1': i32 - [33; 38) '1 + y': i32 - [37; 38) 'y': i32 + 11..41 '{ ...+ y; }': () + 21..22 'y': i32 + 25..27 '92': i32 + 33..34 '1': i32 + 33..38 '1 + y': i32 + 37..38 'y': i32 "### ); } @@ -99,13 +99,13 @@ fn test() { } "#), @r###" - [11; 48) '{ ...&y]; }': () - [21; 22) 'y': &{unknown} - [25; 32) 'unknown': &{unknown} - [38; 45) '[y, &y]': [&&{unknown}; _] - [39; 40) 'y': &{unknown} - [42; 44) '&y': &&{unknown} - [43; 44) 'y': &{unknown} + 11..48 '{ ...&y]; }': () + 21..22 'y': &{unknown} + 25..32 'unknown': &{unknown} + 38..45 '[y, &y]': [&&{unknown}; _] + 39..40 'y': &{unknown} + 42..44 '&y': &&{unknown} + 43..44 'y': &{unknown} "### ); } @@ -123,20 +123,20 @@ fn test() { } "#), @r###" - [11; 80) '{ ...x)]; }': () - [21; 22) 'x': &&{unknown} - [25; 32) 'unknown': &&{unknown} - [42; 43) 'y': &&{unknown} - [46; 53) 'unknown': &&{unknown} - [59; 77) '[(x, y..., &x)]': [(&&&{unknown}, &&&{unknown}); _] - [60; 66) '(x, y)': (&&&{unknown}, &&&{unknown}) - [61; 62) 'x': &&{unknown} - [64; 65) 'y': &&{unknown} - [68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown}) - [69; 71) '&y': &&&{unknown} - [70; 71) 'y': &&{unknown} - [73; 75) '&x': &&&{unknown} - [74; 75) 'x': &&{unknown} + 11..80 '{ ...x)]; }': () + 21..22 'x': &&{unknown} + 25..32 'unknown': &&{unknown} + 42..43 'y': &&{unknown} + 46..53 'unknown': &&{unknown} + 59..77 '[(x, y..., &x)]': [(&&&{unknown}, &&&{unknown}); _] + 60..66 '(x, y)': (&&&{unknown}, &&&{unknown}) + 61..62 'x': &&{unknown} + 64..65 'y': &&{unknown} + 68..76 '(&y, &x)': (&&&{unknown}, &&&{unknown}) + 69..71 '&y': &&&{unknown} + 70..71 'y': &&{unknown} + 73..75 '&x': &&&{unknown} + 74..75 'x': &&{unknown} "### ); } @@ -158,12 +158,12 @@ fn write() { } "#), @r###" - [54; 139) '{ ... } }': () - [60; 137) 'match ... }': () - [66; 83) 'someth...nknown': Maybe<{unknown}> - [94; 124) 'Maybe:...thing)': Maybe<{unknown}> - [106; 123) 'ref mu...ething': &mut {unknown} - [128; 130) '()': () + 54..139 '{ ... } }': () + 60..137 'match ... }': () + 66..83 'someth...nknown': Maybe<{unknown}> + 94..124 'Maybe:...thing)': Maybe<{unknown}> + 106..123 'ref mu...ething': &mut {unknown} + 128..130 '()': () "### ); } @@ -179,13 +179,13 @@ fn test_line_buffer() { } "#), @r###" - [23; 53) '{ ...n']; }': () - [29; 50) '&[0, b...b'\n']': &[u8; _] - [30; 50) '[0, b'...b'\n']': [u8; _] - [31; 32) '0': u8 - [34; 39) 'b'\n'': u8 - [41; 42) '1': u8 - [44; 49) 'b'\n'': u8 + 23..53 '{ ...n']; }': () + 29..50 '&[0, b...b'\n']': &[u8; _] + 30..50 '[0, b'...b'\n']': [u8; _] + 31..32 '0': u8 + 34..39 'b'\n'': u8 + 41..42 '1': u8 + 44..49 'b'\n'': u8 "### ); } @@ -202,14 +202,14 @@ pub fn compute() { } "#), @r###" - [18; 108) '{ ... } }': () - [24; 106) 'match ... }': () - [30; 37) 'nope!()': {unknown} - [48; 94) 'SizeSk...tail }': {unknown} - [82; 86) 'true': bool - [82; 86) 'true': bool - [88; 92) 'tail': {unknown} - [98; 100) '{}': () + 18..108 '{ ... } }': () + 24..106 'match ... }': () + 30..37 'nope!()': {unknown} + 48..94 'SizeSk...tail }': {unknown} + 82..86 'true': bool + 82..86 'true': bool + 88..92 'tail': {unknown} + 98..100 '{}': () "### ); } @@ -226,14 +226,14 @@ pub fn primitive_type() { } "#), @r###" - [25; 106) '{ ... } }': () - [31; 104) 'match ... }': () - [37; 42) '*self': {unknown} - [38; 42) 'self': {unknown} - [53; 91) 'Borrow...), ..}': {unknown} - [74; 86) 'Primitive(p)': {unknown} - [84; 85) 'p': {unknown} - [95; 97) '{}': () + 25..106 '{ ... } }': () + 31..104 'match ... }': () + 37..42 '*self': {unknown} + 38..42 'self': {unknown} + 53..91 'Borrow...), ..}': {unknown} + 74..86 'Primitive(p)': {unknown} + 84..85 'p': {unknown} + 95..97 '{}': () "### ); } @@ -260,29 +260,29 @@ fn extra_compiler_flags() { } "#), @r###" - [27; 323) '{ ... } }': () - [33; 321) 'for co... }': () - [37; 44) 'content': &{unknown} - [48; 61) 'doesnt_matter': {unknown} - [62; 321) '{ ... }': () - [76; 80) 'name': &&{unknown} - [83; 167) 'if doe... }': &&{unknown} - [86; 99) 'doesnt_matter': bool - [100; 129) '{ ... }': &&{unknown} - [114; 119) 'first': &&{unknown} - [135; 167) '{ ... }': &&{unknown} - [149; 157) '&content': &&{unknown} - [150; 157) 'content': &{unknown} - [182; 189) 'content': &{unknown} - [192; 314) 'if ICE... }': &{unknown} - [195; 232) 'ICE_RE..._VALUE': {unknown} - [195; 248) 'ICE_RE...&name)': bool - [242; 247) '&name': &&&{unknown} - [243; 247) 'name': &&{unknown} - [249; 277) '{ ... }': &&{unknown} - [263; 267) 'name': &&{unknown} - [283; 314) '{ ... }': &{unknown} - [297; 304) 'content': &{unknown} + 27..323 '{ ... } }': () + 33..321 'for co... }': () + 37..44 'content': &{unknown} + 48..61 'doesnt_matter': {unknown} + 62..321 '{ ... }': () + 76..80 'name': &&{unknown} + 83..167 'if doe... }': &&{unknown} + 86..99 'doesnt_matter': bool + 100..129 '{ ... }': &&{unknown} + 114..119 'first': &&{unknown} + 135..167 '{ ... }': &&{unknown} + 149..157 '&content': &&{unknown} + 150..157 'content': &{unknown} + 182..189 'content': &{unknown} + 192..314 'if ICE... }': &{unknown} + 195..232 'ICE_RE..._VALUE': {unknown} + 195..248 'ICE_RE...&name)': bool + 242..247 '&name': &&&{unknown} + 243..247 'name': &&{unknown} + 249..277 '{ ... }': &&{unknown} + 263..267 'name': &&{unknown} + 283..314 '{ ... }': &{unknown} + 297..304 'content': &{unknown} "### ); } @@ -303,11 +303,11 @@ fn test(query_response: Canonical>) { } "#), @r###" - [92; 106) 'query_response': Canonical> - [137; 167) '{ ...lue; }': () - [143; 164) '&query....value': &QueryResponse - [144; 158) 'query_response': Canonical> - [144; 164) 'query_....value': QueryResponse + 92..106 'query_response': Canonical> + 137..167 '{ ...lue; }': () + 143..164 '&query....value': &QueryResponse + 144..158 'query_response': Canonical> + 144..164 'query_....value': QueryResponse "### ); } @@ -322,9 +322,9 @@ fn test() { } "#), @r###" - ![0; 4) '0u32': u32 - [45; 70) '{ ...()); }': () - [55; 56) 'a': u32 + !0..4 '0u32': u32 + 45..70 '{ ...()); }': () + 55..56 'a': u32 "### ); } @@ -345,10 +345,10 @@ pub fn main_loop() { } "#), @r###" - [144; 146) '{}': () - [169; 198) '{ ...t(); }': () - [175; 193) 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<{unknown}, FxHasher> - [175; 195) 'FxHash...ault()': HashSet<{unknown}, FxHasher> + 144..146 '{}': () + 169..198 '{ ...t(); }': () + 175..193 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<{unknown}, FxHasher> + 175..195 'FxHash...ault()': HashSet<{unknown}, FxHasher> "### ); } @@ -375,13 +375,13 @@ fn issue_2669() { }"# ), @r###" - [147; 262) '{ ... }': () - [161; 164) 'end': fn end<{unknown}>() - [161; 166) 'end()': () - [199; 252) '{ ... }': () - [221; 223) '_x': ! - [230; 237) 'loop {}': ! - [235; 237) '{}': () + 147..262 '{ ... }': () + 161..164 'end': fn end<{unknown}>() + 161..166 'end()': () + 199..252 '{ ... }': () + 221..223 '_x': ! + 230..237 'loop {}': ! + 235..237 '{}': () "### ) } @@ -396,9 +396,9 @@ fn test() { } "#), @r###" - [26; 53) '{ ...oo() }': () - [32; 49) '::foo': {unknown} - [32; 51) '::foo': {unknown} + 32..51 ' - [489; 523) '{ ... }': () - [499; 503) 'self': SelectStatement - [499; 509) 'self.order': O - [499; 516) 'self.o...into()': dyn QueryFragment + 66..70 'self': Self + 268..272 'self': Self + 467..471 'self': SelectStatement + 489..523 '{ ... }': () + 499..503 'self': SelectStatement + 499..509 'self.order': O + 499..516 'self.o...into()': dyn QueryFragment "### ); } diff --git a/crates/ra_hir_ty/src/tests/simple.rs b/crates/ra_hir_ty/src/tests/simple.rs index c2f1ded2f4..56abc65b8c 100644 --- a/crates/ra_hir_ty/src/tests/simple.rs +++ b/crates/ra_hir_ty/src/tests/simple.rs @@ -64,9 +64,9 @@ impl S { } "#, ), @r###" - [63; 93) '{ ... }': () - [73; 86) 'Self { x: 1 }': S - [83; 84) '1': u32 + 63..93 '{ ... }': () + 73..86 'Self { x: 1 }': S + 83..84 '1': u32 "###); } @@ -85,9 +85,9 @@ fn foo() { "#, ), @r###" - [64; 84) '{ ...1 }; }': () - [70; 81) 'SS { x: 1 }': S - [78; 79) '1': u32 + 64..84 '{ ...1 }; }': () + 70..81 'SS { x: 1 }': S + 78..79 '1': u32 "###); } @@ -175,19 +175,19 @@ fn test(a: u32, b: isize, c: !, d: &str) { 1.0f32; }"#), @r###" - [9; 10) 'a': u32 - [17; 18) 'b': isize - [27; 28) 'c': ! - [33; 34) 'd': &str - [42; 121) '{ ...f32; }': ! - [48; 49) 'a': u32 - [55; 56) 'b': isize - [62; 63) 'c': ! - [69; 70) 'd': &str - [76; 82) '1usize': usize - [88; 94) '1isize': isize - [100; 106) '"test"': &str - [112; 118) '1.0f32': f32 + 9..10 'a': u32 + 17..18 'b': isize + 27..28 'c': ! + 33..34 'd': &str + 42..121 '{ ...f32; }': ! + 48..49 'a': u32 + 55..56 'b': isize + 62..63 'c': ! + 69..70 'd': &str + 76..82 '1usize': usize + 88..94 '1isize': isize + 100..106 '"test"': &str + 112..118 '1.0f32': f32 "### ); } @@ -206,17 +206,17 @@ fn test() { } "#), @r###" - [11; 118) '{ ...= e; }': () - [21; 22) 'a': isize - [25; 31) '1isize': isize - [41; 42) 'b': usize - [52; 53) '1': usize - [63; 64) 'c': usize - [67; 68) 'b': usize - [78; 79) 'd': u32 - [94; 95) 'e': i32 - [105; 106) 'f': i32 - [114; 115) 'e': i32 + 11..118 '{ ...= e; }': () + 21..22 'a': isize + 25..31 '1isize': isize + 41..42 'b': usize + 52..53 '1': usize + 63..64 'c': usize + 67..68 'b': usize + 78..79 'd': u32 + 94..95 'e': i32 + 105..106 'f': i32 + 114..115 'e': i32 "### ); } @@ -237,15 +237,15 @@ fn test() { } "#), @r###" - [15; 20) '{ 1 }': u32 - [17; 18) '1': u32 - [48; 53) '{ 1 }': u32 - [50; 51) '1': u32 - [67; 91) '{ ...c(); }': () - [73; 74) 'a': fn a() -> u32 - [73; 76) 'a()': u32 - [82; 86) 'b::c': fn c() -> u32 - [82; 88) 'b::c()': u32 + 15..20 '{ 1 }': u32 + 17..18 '1': u32 + 48..53 '{ 1 }': u32 + 50..51 '1': u32 + 67..91 '{ ...c(); }': () + 73..74 'a': fn a() -> u32 + 73..76 'a()': u32 + 82..86 'b::c': fn c() -> u32 + 82..88 'b::c()': u32 "### ); } @@ -266,13 +266,13 @@ fn test() { } "#), @r###" - [41; 46) '{ 1 }': i32 - [43; 44) '1': i32 - [60; 93) '{ ...o(); }': () - [66; 72) 'S::foo': fn foo() -> i32 - [66; 74) 'S::foo()': i32 - [80; 88) '::foo': fn foo() -> i32 - [80; 90) '::foo()': i32 + 41..46 '{ 1 }': i32 + 43..44 '1': i32 + 60..93 '{ ...o(); }': () + 66..72 'S::foo': fn foo() -> i32 + 66..74 'S::foo()': i32 + 80..88 '::foo': fn foo() -> i32 + 80..90 '::foo()': i32 "### ); } @@ -297,22 +297,22 @@ fn test() { } "#), @r###" - [72; 154) '{ ...a.c; }': () - [82; 83) 'c': C - [86; 87) 'C': C(usize) -> C - [86; 90) 'C(1)': C - [88; 89) '1': usize - [96; 97) 'B': B - [107; 108) 'a': A - [114; 133) 'A { b:...C(1) }': A - [121; 122) 'B': B - [127; 128) 'C': C(usize) -> C - [127; 131) 'C(1)': C - [129; 130) '1': usize - [139; 140) 'a': A - [139; 142) 'a.b': B - [148; 149) 'a': A - [148; 151) 'a.c': C + 72..154 '{ ...a.c; }': () + 82..83 'c': C + 86..87 'C': C(usize) -> C + 86..90 'C(1)': C + 88..89 '1': usize + 96..97 'B': B + 107..108 'a': A + 114..133 'A { b:...C(1) }': A + 121..122 'B': B + 127..128 'C': C(usize) -> C + 127..131 'C(1)': C + 129..130 '1': usize + 139..140 'a': A + 139..142 'a.b': B + 148..149 'a': A + 148..151 'a.c': C "### ); } @@ -330,10 +330,10 @@ fn test() { E::V2; }"#), @r###" - [48; 82) '{ E:...:V2; }': () - [52; 70) 'E::V1 ...d: 1 }': E - [67; 68) '1': u32 - [74; 79) 'E::V2': E + 48..82 '{ E:...:V2; }': () + 52..70 'E::V1 ...d: 1 }': E + 67..68 '1': u32 + 74..79 'E::V2': E "### ); } @@ -357,29 +357,29 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { } "#), @r###" - [9; 10) 'a': &u32 - [18; 19) 'b': &mut u32 - [31; 32) 'c': *const u32 - [46; 47) 'd': *mut u32 - [59; 150) '{ ... *d; }': () - [65; 66) 'a': &u32 - [72; 74) '*a': u32 - [73; 74) 'a': &u32 - [80; 82) '&a': &&u32 - [81; 82) 'a': &u32 - [88; 94) '&mut a': &mut &u32 - [93; 94) 'a': &u32 - [100; 101) 'b': &mut u32 - [107; 109) '*b': u32 - [108; 109) 'b': &mut u32 - [115; 117) '&b': &&mut u32 - [116; 117) 'b': &mut u32 - [123; 124) 'c': *const u32 - [130; 132) '*c': u32 - [131; 132) 'c': *const u32 - [138; 139) 'd': *mut u32 - [145; 147) '*d': u32 - [146; 147) 'd': *mut u32 + 9..10 'a': &u32 + 18..19 'b': &mut u32 + 31..32 'c': *const u32 + 46..47 'd': *mut u32 + 59..150 '{ ... *d; }': () + 65..66 'a': &u32 + 72..74 '*a': u32 + 73..74 'a': &u32 + 80..82 '&a': &&u32 + 81..82 'a': &u32 + 88..94 '&mut a': &mut &u32 + 93..94 'a': &u32 + 100..101 'b': &mut u32 + 107..109 '*b': u32 + 108..109 'b': &mut u32 + 115..117 '&b': &&mut u32 + 116..117 'b': &mut u32 + 123..124 'c': *const u32 + 130..132 '*c': u32 + 131..132 'c': *const u32 + 138..139 'd': *mut u32 + 145..147 '*d': u32 + 146..147 'd': *mut u32 "### ); } @@ -409,20 +409,20 @@ fn test() { } "##), @r###" - [11; 221) '{ ...o"#; }': () - [17; 21) '5i32': i32 - [27; 31) '5f32': f32 - [37; 41) '5f64': f64 - [47; 54) '"hello"': &str - [60; 68) 'b"bytes"': &[u8] - [74; 77) ''c'': char - [83; 87) 'b'b'': u8 - [93; 97) '3.14': f64 - [103; 107) '5000': i32 - [113; 118) 'false': bool - [124; 128) 'true': bool - [134; 202) 'r#" ... "#': &str - [208; 218) 'br#"yolo"#': &[u8] + 11..221 '{ ...o"#; }': () + 17..21 '5i32': i32 + 27..31 '5f32': f32 + 37..41 '5f64': f64 + 47..54 '"hello"': &str + 60..68 'b"bytes"': &[u8] + 74..77 ''c'': char + 83..87 'b'b'': u8 + 93..97 '3.14': f64 + 103..107 '5000': i32 + 113..118 'false': bool + 124..128 'true': bool + 134..202 'r#" ... "#': &str + 208..218 'br#"yolo"#': &[u8] "### ); } @@ -452,47 +452,47 @@ fn test(x: SomeType) { } "#), @r###" - [27; 28) 'x': SomeType - [40; 272) '{ ...lo"; }': () - [50; 51) 'b': bool - [54; 59) 'false': bool - [69; 70) 'c': bool - [73; 75) '!b': bool - [74; 75) 'b': bool - [85; 86) 'a': i128 - [89; 92) '100': i128 - [102; 103) 'd': i128 - [112; 114) '-a': i128 - [113; 114) 'a': i128 - [124; 125) 'e': i32 - [128; 132) '-100': i32 - [129; 132) '100': i32 - [142; 143) 'f': bool - [146; 153) '!!!true': bool - [147; 153) '!!true': bool - [148; 153) '!true': bool - [149; 153) 'true': bool - [163; 164) 'g': i32 - [167; 170) '!42': i32 - [168; 170) '42': i32 - [180; 181) 'h': u32 - [184; 190) '!10u32': u32 - [185; 190) '10u32': u32 - [200; 201) 'j': i128 - [204; 206) '!a': i128 - [205; 206) 'a': i128 - [212; 217) '-3.14': f64 - [213; 217) '3.14': f64 - [223; 225) '!3': i32 - [224; 225) '3': i32 - [231; 233) '-x': {unknown} - [232; 233) 'x': SomeType - [239; 241) '!x': {unknown} - [240; 241) 'x': SomeType - [247; 255) '-"hello"': {unknown} - [248; 255) '"hello"': &str - [261; 269) '!"hello"': {unknown} - [262; 269) '"hello"': &str + 27..28 'x': SomeType + 40..272 '{ ...lo"; }': () + 50..51 'b': bool + 54..59 'false': bool + 69..70 'c': bool + 73..75 '!b': bool + 74..75 'b': bool + 85..86 'a': i128 + 89..92 '100': i128 + 102..103 'd': i128 + 112..114 '-a': i128 + 113..114 'a': i128 + 124..125 'e': i32 + 128..132 '-100': i32 + 129..132 '100': i32 + 142..143 'f': bool + 146..153 '!!!true': bool + 147..153 '!!true': bool + 148..153 '!true': bool + 149..153 'true': bool + 163..164 'g': i32 + 167..170 '!42': i32 + 168..170 '42': i32 + 180..181 'h': u32 + 184..190 '!10u32': u32 + 185..190 '10u32': u32 + 200..201 'j': i128 + 204..206 '!a': i128 + 205..206 'a': i128 + 212..217 '-3.14': f64 + 213..217 '3.14': f64 + 223..225 '!3': i32 + 224..225 '3': i32 + 231..233 '-x': {unknown} + 232..233 'x': SomeType + 239..241 '!x': {unknown} + 240..241 'x': SomeType + 247..255 '-"hello"': {unknown} + 248..255 '"hello"': &str + 261..269 '!"hello"': {unknown} + 262..269 '"hello"': &str "### ); } @@ -515,26 +515,26 @@ fn test() -> &mut &f64 { } "#), @r###" - [14; 15) 'x': u32 - [22; 24) '{}': () - [78; 231) '{ ...t &c }': &mut &f64 - [88; 89) 'a': u32 - [92; 108) 'unknow...nction': {unknown} - [92; 110) 'unknow...tion()': u32 - [116; 125) 'takes_u32': fn takes_u32(u32) - [116; 128) 'takes_u32(a)': () - [126; 127) 'a': u32 - [138; 139) 'b': i32 - [142; 158) 'unknow...nction': {unknown} - [142; 160) 'unknow...tion()': i32 - [166; 184) 'S { i3...d: b }': S - [181; 182) 'b': i32 - [194; 195) 'c': f64 - [198; 214) 'unknow...nction': {unknown} - [198; 216) 'unknow...tion()': f64 - [222; 229) '&mut &c': &mut &f64 - [227; 229) '&c': &f64 - [228; 229) 'c': f64 + 14..15 'x': u32 + 22..24 '{}': () + 78..231 '{ ...t &c }': &mut &f64 + 88..89 'a': u32 + 92..108 'unknow...nction': {unknown} + 92..110 'unknow...tion()': u32 + 116..125 'takes_u32': fn takes_u32(u32) + 116..128 'takes_u32(a)': () + 126..127 'a': u32 + 138..139 'b': i32 + 142..158 'unknow...nction': {unknown} + 142..160 'unknow...tion()': i32 + 166..184 'S { i3...d: b }': S + 181..182 'b': i32 + 194..195 'c': f64 + 198..214 'unknow...nction': {unknown} + 198..216 'unknow...tion()': f64 + 222..229 '&mut &c': &mut &f64 + 227..229 '&c': &f64 + 228..229 'c': f64 "### ); } @@ -561,16 +561,16 @@ impl S { } "#), @r###" - [34; 38) 'self': &S - [40; 61) '{ ... }': () - [50; 54) 'self': &S - [75; 79) 'self': &S - [88; 109) '{ ... }': () - [98; 102) 'self': &S - [133; 153) '{ ... }': S - [143; 147) 'S {}': S - [177; 200) '{ ... }': S - [187; 194) 'Self {}': S + 34..38 'self': &S + 40..61 '{ ... }': () + 50..54 'self': &S + 75..79 'self': &S + 88..109 '{ ... }': () + 98..102 'self': &S + 133..153 '{ ... }': S + 143..147 'S {}': S + 177..200 '{ ... }': S + 187..194 'Self {}': S "### ); } @@ -600,56 +600,56 @@ fn test() -> bool { } "#), @r###" - [6; 7) 'x': bool - [22; 34) '{ 0i32 }': i32 - [28; 32) '0i32': i32 - [54; 370) '{ ... < 3 }': bool - [64; 65) 'x': bool - [68; 69) 'a': bool - [68; 74) 'a && b': bool - [73; 74) 'b': bool - [84; 85) 'y': bool - [88; 92) 'true': bool - [88; 101) 'true || false': bool - [96; 101) 'false': bool - [111; 112) 'z': bool - [115; 116) 'x': bool - [115; 121) 'x == y': bool - [120; 121) 'y': bool - [131; 132) 't': bool - [135; 136) 'x': bool - [135; 141) 'x != y': bool - [140; 141) 'y': bool - [151; 162) 'minus_forty': isize - [172; 180) '-40isize': isize - [173; 180) '40isize': isize - [190; 191) 'h': bool - [194; 205) 'minus_forty': isize - [194; 216) 'minus_...ONST_2': bool - [209; 216) 'CONST_2': isize - [226; 227) 'c': i32 - [230; 231) 'f': fn f(bool) -> i32 - [230; 239) 'f(z || y)': i32 - [230; 243) 'f(z || y) + 5': i32 - [232; 233) 'z': bool - [232; 238) 'z || y': bool - [237; 238) 'y': bool - [242; 243) '5': i32 - [253; 254) 'd': {unknown} - [257; 258) 'b': {unknown} - [268; 269) 'g': () - [272; 283) 'minus_forty': isize - [272; 288) 'minus_...y ^= i': () - [287; 288) 'i': isize - [298; 301) 'ten': usize - [311; 313) '10': usize - [323; 336) 'ten_is_eleven': bool - [339; 342) 'ten': usize - [339; 354) 'ten == some_num': bool - [346; 354) 'some_num': usize - [361; 364) 'ten': usize - [361; 368) 'ten < 3': bool - [367; 368) '3': usize + 6..7 'x': bool + 22..34 '{ 0i32 }': i32 + 28..32 '0i32': i32 + 54..370 '{ ... < 3 }': bool + 64..65 'x': bool + 68..69 'a': bool + 68..74 'a && b': bool + 73..74 'b': bool + 84..85 'y': bool + 88..92 'true': bool + 88..101 'true || false': bool + 96..101 'false': bool + 111..112 'z': bool + 115..116 'x': bool + 115..121 'x == y': bool + 120..121 'y': bool + 131..132 't': bool + 135..136 'x': bool + 135..141 'x != y': bool + 140..141 'y': bool + 151..162 'minus_forty': isize + 172..180 '-40isize': isize + 173..180 '40isize': isize + 190..191 'h': bool + 194..205 'minus_forty': isize + 194..216 'minus_...ONST_2': bool + 209..216 'CONST_2': isize + 226..227 'c': i32 + 230..231 'f': fn f(bool) -> i32 + 230..239 'f(z || y)': i32 + 230..243 'f(z || y) + 5': i32 + 232..233 'z': bool + 232..238 'z || y': bool + 237..238 'y': bool + 242..243 '5': i32 + 253..254 'd': {unknown} + 257..258 'b': {unknown} + 268..269 'g': () + 272..283 'minus_forty': isize + 272..288 'minus_...y ^= i': () + 287..288 'i': isize + 298..301 'ten': usize + 311..313 '10': usize + 323..336 'ten_is_eleven': bool + 339..342 'ten': usize + 339..354 'ten == some_num': bool + 346..354 'some_num': usize + 361..364 'ten': usize + 361..368 'ten < 3': bool + 367..368 '3': usize "### ); } @@ -664,13 +664,13 @@ fn test() { } "#), @r###" - [11; 48) '{ ...5u8; }': () - [17; 21) '1u32': u32 - [17; 28) '1u32 << 5u8': u32 - [25; 28) '5u8': u8 - [34; 38) '1u32': u32 - [34; 45) '1u32 >> 5u8': u32 - [42; 45) '5u8': u8 + 11..48 '{ ...5u8; }': () + 17..21 '1u32': u32 + 17..28 '1u32 << 5u8': u32 + 25..28 '5u8': u8 + 34..38 '1u32': u32 + 34..45 '1u32 >> 5u8': u32 + 42..45 '5u8': u8 "### ); } @@ -703,49 +703,49 @@ fn test2(a1: *const A, a2: *mut A) { } "#), @r###" - [44; 45) 'a': A - [50; 213) '{ ...5.b; }': () - [60; 62) 'a1': A - [65; 66) 'a': A - [72; 74) 'a1': A - [72; 76) 'a1.b': B - [86; 88) 'a2': &A - [91; 93) '&a': &A - [92; 93) 'a': A - [99; 101) 'a2': &A - [99; 103) 'a2.b': B - [113; 115) 'a3': &mut A - [118; 124) '&mut a': &mut A - [123; 124) 'a': A - [130; 132) 'a3': &mut A - [130; 134) 'a3.b': B - [144; 146) 'a4': &&&&&&&A - [149; 157) '&&&&&&&a': &&&&&&&A - [150; 157) '&&&&&&a': &&&&&&A - [151; 157) '&&&&&a': &&&&&A - [152; 157) '&&&&a': &&&&A - [153; 157) '&&&a': &&&A - [154; 157) '&&a': &&A - [155; 157) '&a': &A - [156; 157) 'a': A - [163; 165) 'a4': &&&&&&&A - [163; 167) 'a4.b': B - [177; 179) 'a5': &mut &&mut &&mut A - [182; 200) '&mut &...&mut a': &mut &&mut &&mut A - [187; 200) '&&mut &&mut a': &&mut &&mut A - [188; 200) '&mut &&mut a': &mut &&mut A - [193; 200) '&&mut a': &&mut A - [194; 200) '&mut a': &mut A - [199; 200) 'a': A - [206; 208) 'a5': &mut &&mut &&mut A - [206; 210) 'a5.b': B - [224; 226) 'a1': *const A - [238; 240) 'a2': *mut A - [250; 273) '{ ...2.b; }': () - [256; 258) 'a1': *const A - [256; 260) 'a1.b': B - [266; 268) 'a2': *mut A - [266; 270) 'a2.b': B + 44..45 'a': A + 50..213 '{ ...5.b; }': () + 60..62 'a1': A + 65..66 'a': A + 72..74 'a1': A + 72..76 'a1.b': B + 86..88 'a2': &A + 91..93 '&a': &A + 92..93 'a': A + 99..101 'a2': &A + 99..103 'a2.b': B + 113..115 'a3': &mut A + 118..124 '&mut a': &mut A + 123..124 'a': A + 130..132 'a3': &mut A + 130..134 'a3.b': B + 144..146 'a4': &&&&&&&A + 149..157 '&&&&&&&a': &&&&&&&A + 150..157 '&&&&&&a': &&&&&&A + 151..157 '&&&&&a': &&&&&A + 152..157 '&&&&a': &&&&A + 153..157 '&&&a': &&&A + 154..157 '&&a': &&A + 155..157 '&a': &A + 156..157 'a': A + 163..165 'a4': &&&&&&&A + 163..167 'a4.b': B + 177..179 'a5': &mut &&mut &&mut A + 182..200 '&mut &...&mut a': &mut &&mut &&mut A + 187..200 '&&mut &&mut a': &&mut &&mut A + 188..200 '&mut &&mut a': &mut &&mut A + 193..200 '&&mut a': &&mut A + 194..200 '&mut a': &mut A + 199..200 'a': A + 206..208 'a5': &mut &&mut &&mut A + 206..210 'a5.b': B + 224..226 'a1': *const A + 238..240 'a2': *mut A + 250..273 '{ ...2.b; }': () + 256..258 'a1': *const A + 256..260 'a1.b': B + 266..268 'a2': *mut A + 266..270 'a2.b': B "### ); } @@ -782,30 +782,30 @@ fn test() { } "#), @r###" - [68; 72) 'self': &Self - [139; 143) 'self': &A - [151; 174) '{ ... }': &T - [161; 168) '&self.0': &T - [162; 166) 'self': &A - [162; 168) 'self.0': T - [255; 259) 'self': &B - [278; 301) '{ ... }': &T - [288; 295) '&self.0': &T - [289; 293) 'self': &B - [289; 295) 'self.0': T - [315; 353) '{ ...))); }': () - [325; 326) 't': &i32 - [329; 335) 'A::foo': fn foo(&A) -> &i32 - [329; 350) 'A::foo...42))))': &i32 - [336; 349) '&&B(B(A(42)))': &&B>> - [337; 349) '&B(B(A(42)))': &B>> - [338; 339) 'B': B>>(B>) -> B>> - [338; 349) 'B(B(A(42)))': B>> - [340; 341) 'B': B>(A) -> B> - [340; 348) 'B(A(42))': B> - [342; 343) 'A': A(i32) -> A - [342; 347) 'A(42)': A - [344; 346) '42': i32 + 68..72 'self': &Self + 139..143 'self': &A + 151..174 '{ ... }': &T + 161..168 '&self.0': &T + 162..166 'self': &A + 162..168 'self.0': T + 255..259 'self': &B + 278..301 '{ ... }': &T + 288..295 '&self.0': &T + 289..293 'self': &B + 289..295 'self.0': T + 315..353 '{ ...))); }': () + 325..326 't': &i32 + 329..335 'A::foo': fn foo(&A) -> &i32 + 329..350 'A::foo...42))))': &i32 + 336..349 '&&B(B(A(42)))': &&B>> + 337..349 '&B(B(A(42)))': &B>> + 338..339 'B': B>>(B>) -> B>> + 338..349 'B(B(A(42)))': B>> + 340..341 'B': B>(A) -> B> + 340..348 'B(A(42))': B> + 342..343 'A': A(i32) -> A + 342..347 'A(42)': A + 344..346 '42': i32 "### ); } @@ -842,34 +842,34 @@ fn test(a: A) { } "#), @r###" - [68; 72) 'self': &Self - [144; 148) 'self': &A - [150; 151) 'x': &A - [166; 187) '{ ... }': &T - [176; 181) '&*x.0': &T - [177; 181) '*x.0': T - [178; 179) 'x': &A - [178; 181) 'x.0': *mut T - [268; 272) 'self': &B - [291; 314) '{ ... }': &T - [301; 308) '&self.0': &T - [302; 306) 'self': &B - [302; 308) 'self.0': T - [326; 327) 'a': A - [337; 383) '{ ...))); }': () - [347; 348) 't': &i32 - [351; 352) 'A': A(*mut i32) -> A - [351; 365) 'A(0 as *mut _)': A - [351; 380) 'A(0 as...B(a)))': &i32 - [353; 354) '0': i32 - [353; 364) '0 as *mut _': *mut i32 - [370; 379) '&&B(B(a))': &&B>> - [371; 379) '&B(B(a))': &B>> - [372; 373) 'B': B>>(B>) -> B>> - [372; 379) 'B(B(a))': B>> - [374; 375) 'B': B>(A) -> B> - [374; 378) 'B(a)': B> - [376; 377) 'a': A + 68..72 'self': &Self + 144..148 'self': &A + 150..151 'x': &A + 166..187 '{ ... }': &T + 176..181 '&*x.0': &T + 177..181 '*x.0': T + 178..179 'x': &A + 178..181 'x.0': *mut T + 268..272 'self': &B + 291..314 '{ ... }': &T + 301..308 '&self.0': &T + 302..306 'self': &B + 302..308 'self.0': T + 326..327 'a': A + 337..383 '{ ...))); }': () + 347..348 't': &i32 + 351..352 'A': A(*mut i32) -> A + 351..365 'A(0 as *mut _)': A + 351..380 'A(0 as...B(a)))': &i32 + 353..354 '0': i32 + 353..364 '0 as *mut _': *mut i32 + 370..379 '&&B(B(a))': &&B>> + 371..379 '&B(B(a))': &B>> + 372..373 'B': B>>(B>) -> B>> + 372..379 'B(B(a))': B>> + 374..375 'B': B>(A) -> B> + 374..378 'B(a)': B> + 376..377 'a': A "### ); } @@ -888,16 +888,16 @@ fn main(foo: Foo) { } "#), @r###" - [35; 38) 'foo': Foo - [45; 109) '{ ... } }': () - [51; 107) 'if tru... }': () - [54; 58) 'true': bool - [59; 67) '{ }': () - [73; 107) 'if fal... }': () - [76; 81) 'false': bool - [82; 107) '{ ... }': i32 - [92; 95) 'foo': Foo - [92; 101) 'foo.field': i32 + 35..38 'foo': Foo + 45..109 '{ ... } }': () + 51..107 'if tru... }': () + 54..58 'true': bool + 59..67 '{ }': () + 73..107 'if fal... }': () + 76..81 'false': bool + 82..107 '{ ... }': i32 + 92..95 'foo': Foo + 92..101 'foo.field': i32 "### ) } @@ -929,38 +929,38 @@ fn foo() { }; }"#), @r###" - [10; 323) '{ ... }; }': () - [20; 23) '_x1': i32 - [26; 80) 'if tru... }': i32 - [29; 33) 'true': bool - [34; 51) '{ ... }': i32 - [44; 45) '1': i32 - [57; 80) '{ ... }': ! - [67; 73) 'return': ! - [90; 93) '_x2': i32 - [96; 149) 'if tru... }': i32 - [99; 103) 'true': bool - [104; 121) '{ ... }': i32 - [114; 115) '2': i32 - [127; 149) '{ ... }': ! - [137; 143) 'return': ! - [159; 162) '_x3': i32 - [165; 247) 'match ... }': i32 - [171; 175) 'true': bool - [186; 190) 'true': bool - [186; 190) 'true': bool - [194; 195) '3': i32 - [205; 206) '_': bool - [210; 241) '{ ... }': ! - [224; 230) 'return': ! - [257; 260) '_x4': i32 - [263; 320) 'match ... }': i32 - [269; 273) 'true': bool - [284; 288) 'true': bool - [284; 288) 'true': bool - [292; 293) '4': i32 - [303; 304) '_': bool - [308; 314) 'return': ! + 10..323 '{ ... }; }': () + 20..23 '_x1': i32 + 26..80 'if tru... }': i32 + 29..33 'true': bool + 34..51 '{ ... }': i32 + 44..45 '1': i32 + 57..80 '{ ... }': ! + 67..73 'return': ! + 90..93 '_x2': i32 + 96..149 'if tru... }': i32 + 99..103 'true': bool + 104..121 '{ ... }': i32 + 114..115 '2': i32 + 127..149 '{ ... }': ! + 137..143 'return': ! + 159..162 '_x3': i32 + 165..247 'match ... }': i32 + 171..175 'true': bool + 186..190 'true': bool + 186..190 'true': bool + 194..195 '3': i32 + 205..206 '_': bool + 210..241 '{ ... }': ! + 224..230 'return': ! + 257..260 '_x4': i32 + 263..320 'match ... }': i32 + 269..273 'true': bool + 284..288 'true': bool + 284..288 'true': bool + 292..293 '4': i32 + 303..304 '_': bool + 308..314 'return': ! "### ) } @@ -988,24 +988,24 @@ fn test(a: A) { } "#), @r###" - [32; 36) 'self': A - [38; 39) 'x': u32 - [53; 55) '{}': () - [103; 107) 'self': &A - [109; 110) 'x': u64 - [124; 126) '{}': () - [144; 145) 'a': A - [150; 198) '{ ...(1); }': () - [156; 157) 'a': A - [156; 164) 'a.foo(1)': i32 - [162; 163) '1': u32 - [170; 181) '(&a).bar(1)': i64 - [171; 173) '&a': &A - [172; 173) 'a': A - [179; 180) '1': u64 - [187; 188) 'a': A - [187; 195) 'a.bar(1)': i64 - [193; 194) '1': u64 + 32..36 'self': A + 38..39 'x': u32 + 53..55 '{}': () + 103..107 'self': &A + 109..110 'x': u64 + 124..126 '{}': () + 144..145 'a': A + 150..198 '{ ...(1); }': () + 156..157 'a': A + 156..164 'a.foo(1)': i32 + 162..163 '1': u32 + 170..181 '(&a).bar(1)': i64 + 171..173 '&a': &A + 172..173 'a': A + 179..180 '1': u64 + 187..188 'a': A + 187..195 'a.bar(1)': i64 + 193..194 '1': u64 "### ); } @@ -1024,11 +1024,11 @@ fn test() { } "#), @r###" - [40; 44) 'self': &str - [53; 55) '{}': () - [69; 89) '{ ...o(); }': () - [75; 80) '"foo"': &str - [75; 86) '"foo".foo()': i32 + 40..44 'self': &str + 53..55 '{}': () + 69..89 '{ ...o(); }': () + 75..80 '"foo"': &str + 75..86 '"foo".foo()': i32 "### ); } @@ -1047,33 +1047,33 @@ fn test(x: &str, y: isize) { } "#), @r###" - [9; 10) 'x': &str - [18; 19) 'y': isize - [28; 170) '{ ...d"); }': () - [38; 39) 'a': (u32, &str) - [55; 63) '(1, "a")': (u32, &str) - [56; 57) '1': u32 - [59; 62) '"a"': &str - [73; 74) 'b': ((u32, &str), &str) - [77; 83) '(a, x)': ((u32, &str), &str) - [78; 79) 'a': (u32, &str) - [81; 82) 'x': &str - [93; 94) 'c': (isize, &str) - [97; 103) '(y, x)': (isize, &str) - [98; 99) 'y': isize - [101; 102) 'x': &str - [113; 114) 'd': ((isize, &str), &str) - [117; 123) '(c, x)': ((isize, &str), &str) - [118; 119) 'c': (isize, &str) - [121; 122) 'x': &str - [133; 134) 'e': (i32, &str) - [137; 145) '(1, "e")': (i32, &str) - [138; 139) '1': i32 - [141; 144) '"e"': &str - [155; 156) 'f': ((i32, &str), &str) - [159; 167) '(e, "d")': ((i32, &str), &str) - [160; 161) 'e': (i32, &str) - [163; 166) '"d"': &str + 9..10 'x': &str + 18..19 'y': isize + 28..170 '{ ...d"); }': () + 38..39 'a': (u32, &str) + 55..63 '(1, "a")': (u32, &str) + 56..57 '1': u32 + 59..62 '"a"': &str + 73..74 'b': ((u32, &str), &str) + 77..83 '(a, x)': ((u32, &str), &str) + 78..79 'a': (u32, &str) + 81..82 'x': &str + 93..94 'c': (isize, &str) + 97..103 '(y, x)': (isize, &str) + 98..99 'y': isize + 101..102 'x': &str + 113..114 'd': ((isize, &str), &str) + 117..123 '(c, x)': ((isize, &str), &str) + 118..119 'c': (isize, &str) + 121..122 'x': &str + 133..134 'e': (i32, &str) + 137..145 '(1, "e")': (i32, &str) + 138..139 '1': i32 + 141..144 '"e"': &str + 155..156 'f': ((i32, &str), &str) + 159..167 '(e, "d")': ((i32, &str), &str) + 160..161 'e': (i32, &str) + 163..166 '"d"': &str "### ); } @@ -1101,58 +1101,58 @@ fn test(x: &str, y: isize) { } "#), @r###" - [9; 10) 'x': &str - [18; 19) 'y': isize - [28; 293) '{ ... []; }': () - [38; 39) 'a': [&str; _] - [42; 45) '[x]': [&str; _] - [43; 44) 'x': &str - [55; 56) 'b': [[&str; _]; _] - [59; 65) '[a, a]': [[&str; _]; _] - [60; 61) 'a': [&str; _] - [63; 64) 'a': [&str; _] - [75; 76) 'c': [[[&str; _]; _]; _] - [79; 85) '[b, b]': [[[&str; _]; _]; _] - [80; 81) 'b': [[&str; _]; _] - [83; 84) 'b': [[&str; _]; _] - [96; 97) 'd': [isize; _] - [100; 112) '[y, 1, 2, 3]': [isize; _] - [101; 102) 'y': isize - [104; 105) '1': isize - [107; 108) '2': isize - [110; 111) '3': isize - [122; 123) 'd': [isize; _] - [126; 138) '[1, y, 2, 3]': [isize; _] - [127; 128) '1': isize - [130; 131) 'y': isize - [133; 134) '2': isize - [136; 137) '3': isize - [148; 149) 'e': [isize; _] - [152; 155) '[y]': [isize; _] - [153; 154) 'y': isize - [165; 166) 'f': [[isize; _]; _] - [169; 175) '[d, d]': [[isize; _]; _] - [170; 171) 'd': [isize; _] - [173; 174) 'd': [isize; _] - [185; 186) 'g': [[isize; _]; _] - [189; 195) '[e, e]': [[isize; _]; _] - [190; 191) 'e': [isize; _] - [193; 194) 'e': [isize; _] - [206; 207) 'h': [i32; _] - [210; 216) '[1, 2]': [i32; _] - [211; 212) '1': i32 - [214; 215) '2': i32 - [226; 227) 'i': [&str; _] - [230; 240) '["a", "b"]': [&str; _] - [231; 234) '"a"': &str - [236; 239) '"b"': &str - [251; 252) 'b': [[&str; _]; _] - [255; 265) '[a, ["b"]]': [[&str; _]; _] - [256; 257) 'a': [&str; _] - [259; 264) '["b"]': [&str; _] - [260; 263) '"b"': &str - [275; 276) 'x': [u8; _] - [288; 290) '[]': [u8; _] + 9..10 'x': &str + 18..19 'y': isize + 28..293 '{ ... []; }': () + 38..39 'a': [&str; _] + 42..45 '[x]': [&str; _] + 43..44 'x': &str + 55..56 'b': [[&str; _]; _] + 59..65 '[a, a]': [[&str; _]; _] + 60..61 'a': [&str; _] + 63..64 'a': [&str; _] + 75..76 'c': [[[&str; _]; _]; _] + 79..85 '[b, b]': [[[&str; _]; _]; _] + 80..81 'b': [[&str; _]; _] + 83..84 'b': [[&str; _]; _] + 96..97 'd': [isize; _] + 100..112 '[y, 1, 2, 3]': [isize; _] + 101..102 'y': isize + 104..105 '1': isize + 107..108 '2': isize + 110..111 '3': isize + 122..123 'd': [isize; _] + 126..138 '[1, y, 2, 3]': [isize; _] + 127..128 '1': isize + 130..131 'y': isize + 133..134 '2': isize + 136..137 '3': isize + 148..149 'e': [isize; _] + 152..155 '[y]': [isize; _] + 153..154 'y': isize + 165..166 'f': [[isize; _]; _] + 169..175 '[d, d]': [[isize; _]; _] + 170..171 'd': [isize; _] + 173..174 'd': [isize; _] + 185..186 'g': [[isize; _]; _] + 189..195 '[e, e]': [[isize; _]; _] + 190..191 'e': [isize; _] + 193..194 'e': [isize; _] + 206..207 'h': [i32; _] + 210..216 '[1, 2]': [i32; _] + 211..212 '1': i32 + 214..215 '2': i32 + 226..227 'i': [&str; _] + 230..240 '["a", "b"]': [&str; _] + 231..234 '"a"': &str + 236..239 '"b"': &str + 251..252 'b': [[&str; _]; _] + 255..265 '[a, ["b"]]': [[&str; _]; _] + 256..257 'a': [&str; _] + 259..264 '["b"]': [&str; _] + 260..263 '"b"': &str + 275..276 'x': [u8; _] + 288..290 '[]': [u8; _] "### ); } @@ -1174,21 +1174,21 @@ fn test(a1: A, i: i32) { } "#), @r###" - [36; 38) 'a1': A - [48; 49) 'i': i32 - [56; 147) '{ ...3.x; }': () - [62; 64) 'a1': A - [62; 66) 'a1.x': u32 - [76; 78) 'a2': A - [81; 91) 'A { x: i }': A - [88; 89) 'i': i32 - [97; 99) 'a2': A - [97; 101) 'a2.x': i32 - [111; 113) 'a3': A - [116; 134) 'A:: - [131; 132) '1': i128 - [140; 142) 'a3': A - [140; 144) 'a3.x': i128 + 36..38 'a1': A + 48..49 'i': i32 + 56..147 '{ ...3.x; }': () + 62..64 'a1': A + 62..66 'a1.x': u32 + 76..78 'a2': A + 81..91 'A { x: i }': A + 88..89 'i': i32 + 97..99 'a2': A + 97..101 'a2.x': i32 + 111..113 'a3': A + 116..134 'A:: + 131..132 '1': i128 + 140..142 'a3': A + 140..144 'a3.x': i128 "### ); } @@ -1211,22 +1211,22 @@ fn test() { } "#), @r###" - [76; 184) '{ ...one; }': () - [82; 83) 'A': A(i32) -> A - [82; 87) 'A(42)': A - [84; 86) '42': i32 - [93; 94) 'A': A(u128) -> A - [93; 102) 'A(42u128)': A - [95; 101) '42u128': u128 - [108; 112) 'Some': Some<&str>(&str) -> Option<&str> - [108; 117) 'Some("x")': Option<&str> - [113; 116) '"x"': &str - [123; 135) 'Option::Some': Some<&str>(&str) -> Option<&str> - [123; 140) 'Option...e("x")': Option<&str> - [136; 139) '"x"': &str - [146; 150) 'None': Option<{unknown}> - [160; 161) 'x': Option - [177; 181) 'None': Option + 76..184 '{ ...one; }': () + 82..83 'A': A(i32) -> A + 82..87 'A(42)': A + 84..86 '42': i32 + 93..94 'A': A(u128) -> A + 93..102 'A(42u128)': A + 95..101 '42u128': u128 + 108..112 'Some': Some<&str>(&str) -> Option<&str> + 108..117 'Some("x")': Option<&str> + 113..116 '"x"': &str + 123..135 'Option::Some': Some<&str>(&str) -> Option<&str> + 123..140 'Option...e("x")': Option<&str> + 136..139 '"x"': &str + 146..150 'None': Option<{unknown}> + 160..161 'x': Option + 177..181 'None': Option "### ); } @@ -1244,20 +1244,20 @@ fn test() { } "#), @r###" - [10; 11) 't': T - [21; 26) '{ t }': T - [23; 24) 't': T - [38; 98) '{ ...(1); }': () - [44; 46) 'id': fn id(u32) -> u32 - [44; 52) 'id(1u32)': u32 - [47; 51) '1u32': u32 - [58; 68) 'id::': fn id(i128) -> i128 - [58; 71) 'id::(1)': i128 - [69; 70) '1': i128 - [81; 82) 'x': u64 - [90; 92) 'id': fn id(u64) -> u64 - [90; 95) 'id(1)': u64 - [93; 94) '1': u64 + 10..11 't': T + 21..26 '{ t }': T + 23..24 't': T + 38..98 '{ ...(1); }': () + 44..46 'id': fn id(u32) -> u32 + 44..52 'id(1u32)': u32 + 47..51 '1u32': u32 + 58..68 'id::': fn id(i128) -> i128 + 58..71 'id::(1)': i128 + 69..70 '1': i128 + 81..82 'x': u64 + 90..92 'id': fn id(u64) -> u64 + 90..95 'id(1)': u64 + 93..94 '1': u64 "### ); } @@ -1291,38 +1291,38 @@ fn test() -> i128 { } "#), @r###" - [74; 78) 'self': A - [85; 107) '{ ... }': X - [95; 99) 'self': A - [95; 101) 'self.x': X - [117; 121) 'self': A - [128; 150) '{ ... }': Y - [138; 142) 'self': A - [138; 144) 'self.y': Y - [163; 167) 'self': A - [169; 170) 't': T - [188; 223) '{ ... }': (X, Y, T) - [198; 217) '(self.....y, t)': (X, Y, T) - [199; 203) 'self': A - [199; 205) 'self.x': X - [207; 211) 'self': A - [207; 213) 'self.y': Y - [215; 216) 't': T - [245; 342) '{ ...(1); }': () - [255; 256) 'a': A - [259; 281) 'A { x:...1i64 }': A - [266; 270) '1u64': u64 - [275; 279) '1i64': i64 - [287; 288) 'a': A - [287; 292) 'a.x()': u64 - [298; 299) 'a': A - [298; 303) 'a.y()': i64 - [309; 310) 'a': A - [309; 319) 'a.z(1i128)': (u64, i64, i128) - [313; 318) '1i128': i128 - [325; 326) 'a': A - [325; 339) 'a.z::(1)': (u64, i64, u128) - [337; 338) '1': u128 + 74..78 'self': A + 85..107 '{ ... }': X + 95..99 'self': A + 95..101 'self.x': X + 117..121 'self': A + 128..150 '{ ... }': Y + 138..142 'self': A + 138..144 'self.y': Y + 163..167 'self': A + 169..170 't': T + 188..223 '{ ... }': (X, Y, T) + 198..217 '(self.....y, t)': (X, Y, T) + 199..203 'self': A + 199..205 'self.x': X + 207..211 'self': A + 207..213 'self.y': Y + 215..216 't': T + 245..342 '{ ...(1); }': () + 255..256 'a': A + 259..281 'A { x:...1i64 }': A + 266..270 '1u64': u64 + 275..279 '1i64': i64 + 287..288 'a': A + 287..292 'a.x()': u64 + 298..299 'a': A + 298..303 'a.y()': i64 + 309..310 'a': A + 309..319 'a.z(1i128)': (u64, i64, i128) + 313..318 '1i128': i128 + 325..326 'a': A + 325..339 'a.z::(1)': (u64, i64, u128) + 337..338 '1': u128 "### ); } @@ -1344,15 +1344,15 @@ fn test(o: Option) { } "#), @r###" - [78; 82) 'self': &Option - [98; 100) '{}': () - [111; 112) 'o': Option - [127; 165) '{ ...f(); }': () - [133; 146) '(&o).as_ref()': Option<&u32> - [134; 136) '&o': &Option - [135; 136) 'o': Option - [152; 153) 'o': Option - [152; 162) 'o.as_ref()': Option<&u32> + 78..82 'self': &Option + 98..100 '{}': () + 111..112 'o': Option + 127..165 '{ ...f(); }': () + 133..146 '(&o).as_ref()': Option<&u32> + 134..136 '&o': &Option + 135..136 'o': Option + 152..153 'o': Option + 152..162 'o.as_ref()': Option<&u32> "### ); } @@ -1381,35 +1381,35 @@ fn test() -> i128 { } "#), @r###" - [53; 57) 'self': A - [65; 87) '{ ... }': T2 - [75; 79) 'self': A - [75; 81) 'self.x': T2 - [99; 100) 't': T - [110; 115) '{ t }': T - [112; 113) 't': T - [135; 261) '{ ....x() }': i128 - [146; 147) 'x': i128 - [150; 151) '1': i128 - [162; 163) 'y': i128 - [166; 168) 'id': fn id(i128) -> i128 - [166; 171) 'id(x)': i128 - [169; 170) 'x': i128 - [182; 183) 'a': A - [186; 200) 'A { x: id(y) }': A - [193; 195) 'id': fn id(i128) -> i128 - [193; 198) 'id(y)': i128 - [196; 197) 'y': i128 - [211; 212) 'z': i128 - [215; 217) 'id': fn id(i128) -> i128 - [215; 222) 'id(a.x)': i128 - [218; 219) 'a': A - [218; 221) 'a.x': i128 - [233; 234) 'b': A - [237; 247) 'A { x: z }': A - [244; 245) 'z': i128 - [254; 255) 'b': A - [254; 259) 'b.x()': i128 + 53..57 'self': A + 65..87 '{ ... }': T2 + 75..79 'self': A + 75..81 'self.x': T2 + 99..100 't': T + 110..115 '{ t }': T + 112..113 't': T + 135..261 '{ ....x() }': i128 + 146..147 'x': i128 + 150..151 '1': i128 + 162..163 'y': i128 + 166..168 'id': fn id(i128) -> i128 + 166..171 'id(x)': i128 + 169..170 'x': i128 + 182..183 'a': A + 186..200 'A { x: id(y) }': A + 193..195 'id': fn id(i128) -> i128 + 193..198 'id(y)': i128 + 196..197 'y': i128 + 211..212 'z': i128 + 215..217 'id': fn id(i128) -> i128 + 215..222 'id(a.x)': i128 + 218..219 'a': A + 218..221 'a.x': i128 + 233..234 'b': A + 237..247 'A { x: z }': A + 244..245 'z': i128 + 254..255 'b': A + 254..259 'b.x()': i128 "### ); } @@ -1447,16 +1447,16 @@ fn test() { } "#), @r###" - [52; 53) '1': u32 - [105; 106) '2': u32 - [213; 214) '5': u32 - [229; 307) '{ ...:ID; }': () - [239; 240) 'x': u32 - [243; 254) 'Struct::FOO': u32 - [264; 265) 'y': u32 - [268; 277) 'Enum::BAR': u32 - [287; 288) 'z': u32 - [291; 304) 'TraitTest::ID': u32 + 52..53 '1': u32 + 105..106 '2': u32 + 213..214 '5': u32 + 229..307 '{ ...:ID; }': () + 239..240 'x': u32 + 243..254 'Struct::FOO': u32 + 264..265 'y': u32 + 268..277 'Enum::BAR': u32 + 287..288 'z': u32 + 291..304 'TraitTest::ID': u32 "### ); } @@ -1479,22 +1479,22 @@ fn test(x: Foo, y: Bar<&str>, z: Baz) { } "#), @r###" - [116; 117) 'x': A - [124; 125) 'y': A<&str, u128> - [138; 139) 'z': A - [154; 211) '{ ...z.y; }': () - [160; 161) 'x': A - [160; 163) 'x.x': u32 - [169; 170) 'x': A - [169; 172) 'x.y': i128 - [178; 179) 'y': A<&str, u128> - [178; 181) 'y.x': &str - [187; 188) 'y': A<&str, u128> - [187; 190) 'y.y': u128 - [196; 197) 'z': A - [196; 199) 'z.x': u8 - [205; 206) 'z': A - [205; 208) 'z.y': i8 + 116..117 'x': A + 124..125 'y': A<&str, u128> + 138..139 'z': A + 154..211 '{ ...z.y; }': () + 160..161 'x': A + 160..163 'x.x': u32 + 169..170 'x': A + 169..172 'x.y': i128 + 178..179 'y': A<&str, u128> + 178..181 'y.x': &str + 187..188 'y': A<&str, u128> + 187..190 'y.y': u128 + 196..197 'z': A + 196..199 'z.x': u8 + 205..206 'z': A + 205..208 'z.y': i8 "### ) } @@ -1509,8 +1509,8 @@ type Bar = A; fn test(x: Foo) {} "#), @r###" - [59; 60) 'x': {unknown} - [67; 69) '{}': () + 59..60 'x': {unknown} + 67..69 '{}': () "### ) } @@ -1535,26 +1535,26 @@ fn test() { } "#), @r###" - [10; 11) 'x': T - [21; 30) '{ x }': T - [27; 28) 'x': T - [44; 45) 'x': &T - [56; 66) '{ *x }': T - [62; 64) '*x': T - [63; 64) 'x': &T - [78; 158) '{ ...(1); }': () - [88; 89) 'y': u32 - [92; 97) '10u32': u32 - [103; 105) 'id': fn id(u32) -> u32 - [103; 108) 'id(y)': u32 - [106; 107) 'y': u32 - [118; 119) 'x': bool - [128; 133) 'clone': fn clone(&bool) -> bool - [128; 136) 'clone(z)': bool - [134; 135) 'z': &bool - [142; 152) 'id::': fn id(i128) -> i128 - [142; 155) 'id::(1)': i128 - [153; 154) '1': i128 + 10..11 'x': T + 21..30 '{ x }': T + 27..28 'x': T + 44..45 'x': &T + 56..66 '{ *x }': T + 62..64 '*x': T + 63..64 'x': &T + 78..158 '{ ...(1); }': () + 88..89 'y': u32 + 92..97 '10u32': u32 + 103..105 'id': fn id(u32) -> u32 + 103..108 'id(y)': u32 + 106..107 'y': u32 + 118..119 'x': bool + 128..133 'clone': fn clone(&bool) -> bool + 128..136 'clone(z)': bool + 134..135 'z': &bool + 142..152 'id::': fn id(i128) -> i128 + 142..155 'id::(1)': i128 + 153..154 '1': i128 "### ); } @@ -1574,16 +1574,16 @@ fn test() { } "#), @r###" - [49; 50) '0': u32 - [80; 83) '101': u32 - [95; 213) '{ ...NST; }': () - [138; 139) 'x': u32 - [142; 153) 'LOCAL_CONST': u32 - [163; 164) 'z': u32 - [167; 179) 'GLOBAL_CONST': u32 - [189; 191) 'id': u32 - [194; 210) 'Foo::A..._CONST': u32 - [126; 128) '99': u32 + 49..50 '0': u32 + 80..83 '101': u32 + 95..213 '{ ...NST; }': () + 138..139 'x': u32 + 142..153 'LOCAL_CONST': u32 + 163..164 'z': u32 + 167..179 'GLOBAL_CONST': u32 + 189..191 'id': u32 + 194..210 'Foo::A..._CONST': u32 + 126..128 '99': u32 "### ); } @@ -1604,19 +1604,19 @@ fn test() { } "#), @r###" - [29; 32) '101': u32 - [70; 73) '101': u32 - [85; 280) '{ ...MUT; }': () - [173; 174) 'x': u32 - [177; 189) 'LOCAL_STATIC': u32 - [199; 200) 'y': u32 - [203; 219) 'LOCAL_...IC_MUT': u32 - [229; 230) 'z': u32 - [233; 246) 'GLOBAL_STATIC': u32 - [256; 257) 'w': u32 - [260; 277) 'GLOBAL...IC_MUT': u32 - [118; 120) '99': u32 - [161; 163) '99': u32 + 29..32 '101': u32 + 70..73 '101': u32 + 85..280 '{ ...MUT; }': () + 173..174 'x': u32 + 177..189 'LOCAL_STATIC': u32 + 199..200 'y': u32 + 203..219 'LOCAL_...IC_MUT': u32 + 229..230 'z': u32 + 233..246 'GLOBAL_STATIC': u32 + 256..257 'w': u32 + 260..277 'GLOBAL...IC_MUT': u32 + 118..120 '99': u32 + 161..163 '99': u32 "### ); } @@ -1684,12 +1684,12 @@ fn foo() -> u32 { } "#), @r###" - [17; 59) '{ ...; }; }': () - [27; 28) 'x': || -> usize - [31; 56) '|| -> ...n 1; }': || -> usize - [43; 56) '{ return 1; }': ! - [45; 53) 'return 1': ! - [52; 53) '1': usize + 17..59 '{ ...; }; }': () + 27..28 'x': || -> usize + 31..56 '|| -> ...n 1; }': || -> usize + 43..56 '{ return 1; }': ! + 45..53 'return 1': ! + 52..53 '1': usize "### ); } @@ -1703,11 +1703,11 @@ fn foo() -> u32 { } "#), @r###" - [17; 48) '{ ...; }; }': () - [27; 28) 'x': || -> () - [31; 45) '|| { return; }': || -> () - [34; 45) '{ return; }': ! - [36; 42) 'return': ! + 17..48 '{ ...; }; }': () + 27..28 'x': || -> () + 31..45 '|| { return; }': || -> () + 34..45 '{ return; }': ! + 36..42 'return': ! "### ); } @@ -1721,11 +1721,11 @@ fn foo() -> u32 { } "#), @r###" - [17; 47) '{ ..." }; }': () - [27; 28) 'x': || -> &str - [31; 44) '|| { "test" }': || -> &str - [34; 44) '{ "test" }': &str - [36; 42) '"test"': &str + 17..47 '{ ..." }; }': () + 27..28 'x': || -> &str + 31..44 '|| { "test" }': || -> &str + 34..44 '{ "test" }': &str + 36..42 '"test"': &str "### ); } @@ -1744,14 +1744,14 @@ fn main() { } "#), @r###" - [48; 121) '{ ...hod; }': () - [58; 64) 'vtable': Vtable - [67; 91) 'Vtable...| {} }': Vtable - [84; 89) '|| {}': || -> () - [87; 89) '{}': () - [101; 102) 'm': fn() - [105; 111) 'vtable': Vtable - [105; 118) 'vtable.method': fn() + 48..121 '{ ...hod; }': () + 58..64 'vtable': Vtable + 67..91 'Vtable...| {} }': Vtable + 84..89 '|| {}': || -> () + 87..89 '{}': () + 101..102 'm': fn() + 105..111 'vtable': Vtable + 105..118 'vtable.method': fn() "### ); } diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index a46f03b7f5..f51cdd4964 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs @@ -256,16 +256,16 @@ fn test() { } "#), @r###" - [86; 87) 't': T - [92; 94) '{}': () - [105; 144) '{ ...(s); }': () - [115; 116) 's': S - [119; 120) 'S': S(u32) -> S - [119; 129) 'S(unknown)': S - [121; 128) 'unknown': u32 - [135; 138) 'foo': fn foo>(S) - [135; 141) 'foo(s)': () - [139; 140) 's': S + 86..87 't': T + 92..94 '{}': () + 105..144 '{ ...(s); }': () + 115..116 's': S + 119..120 'S': S(u32) -> S + 119..129 'S(unknown)': S + 121..128 'unknown': u32 + 135..138 'foo': fn foo>(S) + 135..141 'foo(s)': () + 139..140 's': S "### ); } @@ -284,17 +284,17 @@ fn test() { } "#), @r###" - [87; 88) 't': T - [98; 100) '{}': () - [111; 163) '{ ...(s); }': () - [121; 122) 's': S - [125; 126) 'S': S(u32) -> S - [125; 135) 'S(unknown)': S - [127; 134) 'unknown': u32 - [145; 146) 'x': u32 - [154; 157) 'foo': fn foo>(S) -> u32 - [154; 160) 'foo(s)': u32 - [158; 159) 's': S + 87..88 't': T + 98..100 '{}': () + 111..163 '{ ...(s); }': () + 121..122 's': S + 125..126 'S': S(u32) -> S + 125..135 'S(unknown)': S + 127..134 'unknown': u32 + 145..146 'x': u32 + 154..157 'foo': fn foo>(S) -> u32 + 154..160 'foo(s)': u32 + 158..159 's': S "### ); } @@ -312,12 +312,12 @@ trait Trait { } "#), @r###" - [27; 31) 'self': &Self - [53; 57) 'self': &Self - [62; 97) '{ ... }': () - [76; 77) 'x': i64 - [80; 84) 'self': &Self - [80; 90) 'self.foo()': i64 + 27..31 'self': &Self + 53..57 'self': &Self + 62..97 '{ ... }': () + 76..77 'x': i64 + 80..84 'self': &Self + 80..90 'self.foo()': i64 "### ); } @@ -337,12 +337,12 @@ trait Trait: SuperTrait { } "#), @r###" - [32; 36) 'self': &Self - [86; 90) 'self': &Self - [95; 130) '{ ... }': () - [109; 110) 'x': i64 - [113; 117) 'self': &Self - [113; 123) 'self.foo()': i64 + 32..36 'self': &Self + 86..90 'self': &Self + 95..130 '{ ... }': () + 109..110 'x': i64 + 113..117 'self': &Self + 113..123 'self.foo()': i64 "### ); } @@ -364,15 +364,15 @@ fn test() { } "#), @r###" - [108; 261) '{ ...ter; }': () - [118; 119) 'x': u32 - [145; 146) '1': u32 - [156; 157) 'y': Iterable::Item - [183; 192) 'no_matter': Iterable::Item - [202; 203) 'z': Iterable::Item - [215; 224) 'no_matter': Iterable::Item - [234; 235) 'a': Iterable::Item - [249; 258) 'no_matter': Iterable::Item + 108..261 '{ ...ter; }': () + 118..119 'x': u32 + 145..146 '1': u32 + 156..157 'y': Iterable::Item + 183..192 'no_matter': Iterable::Item + 202..203 'z': Iterable::Item + 215..224 'no_matter': Iterable::Item + 234..235 'a': Iterable::Item + 249..258 'no_matter': Iterable::Item "### ); } @@ -396,25 +396,25 @@ fn test() { } "#), @r###" - [106; 107) 't': T - [123; 125) '{}': () - [147; 148) 't': T - [178; 180) '{}': () - [202; 203) 't': T - [221; 223) '{}': () - [234; 300) '{ ...(S); }': () - [244; 245) 'x': u32 - [248; 252) 'foo1': fn foo1(S) -> ::Item - [248; 255) 'foo1(S)': u32 - [253; 254) 'S': S - [265; 266) 'y': u32 - [269; 273) 'foo2': fn foo2(S) -> ::Item - [269; 276) 'foo2(S)': u32 - [274; 275) 'S': S - [286; 287) 'z': u32 - [290; 294) 'foo3': fn foo3(S) -> ::Item - [290; 297) 'foo3(S)': u32 - [295; 296) 'S': S + 106..107 't': T + 123..125 '{}': () + 147..148 't': T + 178..180 '{}': () + 202..203 't': T + 221..223 '{}': () + 234..300 '{ ...(S); }': () + 244..245 'x': u32 + 248..252 'foo1': fn foo1(S) -> ::Item + 248..255 'foo1(S)': u32 + 253..254 'S': S + 265..266 'y': u32 + 269..273 'foo2': fn foo2(S) -> ::Item + 269..276 'foo2(S)': u32 + 274..275 'S': S + 286..287 'z': u32 + 290..294 'foo3': fn foo3(S) -> ::Item + 290..297 'foo3(S)': u32 + 295..296 'S': S "### ); } @@ -431,9 +431,9 @@ fn test>() { } "#), @r###" - [67; 100) '{ ...own; }': () - [77; 78) 'y': u32 - [90; 97) 'unknown': u32 + 67..100 '{ ...own; }': () + 77..78 'y': u32 + 90..97 'unknown': u32 "### ); } @@ -446,13 +446,13 @@ const A: u32 = 1 + 1; static B: u64 = { let x = 1; x }; "#), @r###" - [16; 17) '1': u32 - [16; 21) '1 + 1': u32 - [20; 21) '1': u32 - [39; 55) '{ let ...1; x }': u64 - [45; 46) 'x': u64 - [49; 50) '1': u64 - [52; 53) 'x': u64 + 16..17 '1': u32 + 16..21 '1 + 1': u32 + 20..21 '1': u32 + 39..55 '{ let ...1; x }': u64 + 45..46 'x': u64 + 49..50 '1': u64 + 52..53 'x': u64 "### ); } @@ -469,17 +469,17 @@ fn test() -> u64 { } "#), @r###" - [38; 87) '{ ... a.1 }': u64 - [48; 49) 'a': S - [52; 53) 'S': S(i32, u64) -> S - [52; 59) 'S(4, 6)': S - [54; 55) '4': i32 - [57; 58) '6': u64 - [69; 70) 'b': i32 - [73; 74) 'a': S - [73; 76) 'a.0': i32 - [82; 83) 'a': S - [82; 85) 'a.1': u64 + 38..87 '{ ... a.1 }': u64 + 48..49 'a': S + 52..53 'S': S(i32, u64) -> S + 52..59 'S(4, 6)': S + 54..55 '4': i32 + 57..58 '6': u64 + 69..70 'b': i32 + 73..74 'a': S + 73..76 'a.0': i32 + 82..83 'a': S + 82..85 'a.1': u64 "### ); } @@ -496,24 +496,24 @@ fn test() -> u64 { } "#), @r###" - [44; 102) '{ ...0(2) }': u64 - [54; 55) 'a': S - [58; 59) 'S': S(fn(u32) -> u64) -> S - [58; 68) 'S(|i| 2*i)': S - [60; 67) '|i| 2*i': |u32| -> u64 - [61; 62) 'i': u32 - [64; 65) '2': u32 - [64; 67) '2*i': u32 - [66; 67) 'i': u32 - [78; 79) 'b': u64 - [82; 83) 'a': S - [82; 85) 'a.0': fn(u32) -> u64 - [82; 88) 'a.0(4)': u64 - [86; 87) '4': u32 - [94; 95) 'a': S - [94; 97) 'a.0': fn(u32) -> u64 - [94; 100) 'a.0(2)': u64 - [98; 99) '2': u32 + 44..102 '{ ...0(2) }': u64 + 54..55 'a': S + 58..59 'S': S(fn(u32) -> u64) -> S + 58..68 'S(|i| 2*i)': S + 60..67 '|i| 2*i': |u32| -> u64 + 61..62 'i': u32 + 64..65 '2': u32 + 64..67 '2*i': u32 + 66..67 'i': u32 + 78..79 'b': u64 + 82..83 'a': S + 82..85 'a.0': fn(u32) -> u64 + 82..88 'a.0(4)': u64 + 86..87 '4': u32 + 94..95 'a': S + 94..97 'a.0': fn(u32) -> u64 + 94..100 'a.0(2)': u64 + 98..99 '2': u32 "### ); } @@ -523,12 +523,12 @@ fn indexing_arrays() { assert_snapshot!( infer("fn main() { &mut [9][2]; }"), @r###" - [10; 26) '{ &mut...[2]; }': () - [12; 23) '&mut [9][2]': &mut {unknown} - [17; 20) '[9]': [i32; _] - [17; 23) '[9][2]': {unknown} - [18; 19) '9': i32 - [21; 22) '2': i32 + 10..26 '{ &mut...[2]; }': () + 12..23 '&mut [9][2]': &mut {unknown} + 17..20 '[9]': [i32; _] + 17..23 '[9][2]': {unknown} + 18..19 '9': i32 + 21..22 '2': i32 "### ) } @@ -944,34 +944,34 @@ fn test(x: impl Trait, y: &impl Trait) { } "#, true), @r###" - [30; 34) 'self': &Self - [55; 59) 'self': &Self - [78; 79) 'x': impl Trait - [98; 100) '{}': () - [155; 156) 'x': impl Trait - [175; 176) 'y': &impl Trait - [196; 324) '{ ...2(); }': () - [202; 203) 'x': impl Trait - [209; 210) 'y': &impl Trait - [220; 221) 'z': S - [224; 225) 'S': S(u16) -> S - [224; 228) 'S(1)': S - [226; 227) '1': u16 - [234; 237) 'bar': fn bar(S) - [234; 240) 'bar(z)': () - [238; 239) 'z': S - [246; 247) 'x': impl Trait - [246; 253) 'x.foo()': u64 - [259; 260) 'y': &impl Trait - [259; 266) 'y.foo()': u32 - [272; 273) 'z': S - [272; 279) 'z.foo()': u16 - [285; 286) 'x': impl Trait - [285; 293) 'x.foo2()': i64 - [299; 300) 'y': &impl Trait - [299; 307) 'y.foo2()': i64 - [313; 314) 'z': S - [313; 321) 'z.foo2()': i64 + 30..34 'self': &Self + 55..59 'self': &Self + 78..79 'x': impl Trait + 98..100 '{}': () + 155..156 'x': impl Trait + 175..176 'y': &impl Trait + 196..324 '{ ...2(); }': () + 202..203 'x': impl Trait + 209..210 'y': &impl Trait + 220..221 'z': S + 224..225 'S': S(u16) -> S + 224..228 'S(1)': S + 226..227 '1': u16 + 234..237 'bar': fn bar(S) + 234..240 'bar(z)': () + 238..239 'z': S + 246..247 'x': impl Trait + 246..253 'x.foo()': u64 + 259..260 'y': &impl Trait + 259..266 'y.foo()': u32 + 272..273 'z': S + 272..279 'z.foo()': u16 + 285..286 'x': impl Trait + 285..293 'x.foo2()': i64 + 299..300 'y': &impl Trait + 299..307 'y.foo2()': i64 + 313..314 'z': S + 313..321 'z.foo2()': i64 "### ); } @@ -1005,39 +1005,39 @@ fn test() { } "#, true), @r###" - [156; 157) 'x': impl Trait - [176; 187) '{ loop {} }': T - [178; 185) 'loop {}': ! - [183; 185) '{}': () - [200; 201) 'x': impl Trait - [220; 231) '{ loop {} }': T - [222; 229) 'loop {}': ! - [227; 229) '{}': () - [301; 510) '{ ... i32 }': () - [307; 315) 'Foo::bar': fn bar<{unknown}, {unknown}>(S) -> {unknown} - [307; 318) 'Foo::bar(S)': {unknown} - [316; 317) 'S': S - [324; 339) '::bar': fn bar(S) -> {unknown} - [324; 342) '(S) -> {unknown} - [348; 357) 'F::bar(S)': {unknown} - [355; 356) 'S': S - [363; 378) 'Foo::bar::': fn bar<{unknown}, u32>(S) -> u32 - [363; 381) 'Foo::b...32>(S)': u32 - [379; 380) 'S': S - [387; 409) '': fn bar(S) -> u32 - [387; 412) '(S)': u32 - [410; 411) 'S': S - [419; 422) 'foo': fn foo<{unknown}>(S) -> {unknown} - [419; 425) 'foo(S)': {unknown} - [423; 424) 'S': S - [431; 441) 'foo::': fn foo(S) -> u32 - [431; 444) 'foo::(S)': u32 - [442; 443) 'S': S - [450; 465) 'foo::': fn foo(S) -> u32 - [450; 468) 'foo::<...32>(S)': u32 - [466; 467) 'S': S + 156..157 'x': impl Trait + 176..187 '{ loop {} }': T + 178..185 'loop {}': ! + 183..185 '{}': () + 200..201 'x': impl Trait + 220..231 '{ loop {} }': T + 222..229 'loop {}': ! + 227..229 '{}': () + 301..510 '{ ... i32 }': () + 307..315 'Foo::bar': fn bar<{unknown}, {unknown}>(S) -> {unknown} + 307..318 'Foo::bar(S)': {unknown} + 316..317 'S': S + 324..339 '::bar': fn bar(S) -> {unknown} + 324..342 '(S) -> {unknown} + 348..357 'F::bar(S)': {unknown} + 355..356 'S': S + 363..378 'Foo::bar::': fn bar<{unknown}, u32>(S) -> u32 + 363..381 'Foo::b...32>(S)': u32 + 379..380 'S': S + 387..409 '': fn bar(S) -> u32 + 387..412 '(S)': u32 + 410..411 'S': S + 419..422 'foo': fn foo<{unknown}>(S) -> {unknown} + 419..425 'foo(S)': {unknown} + 423..424 'S': S + 431..441 'foo::': fn foo(S) -> u32 + 431..444 'foo::(S)': u32 + 442..443 'S': S + 450..465 'foo::': fn foo(S) -> u32 + 450..468 'foo::<...32>(S)': u32 + 466..467 'S': S "### ); } @@ -1062,24 +1062,24 @@ fn test() { } "#, true), @r###" - [88; 92) 'self': F - [94; 95) 'x': impl Trait - [119; 130) '{ loop {} }': (T, U) - [121; 128) 'loop {}': ! - [126; 128) '{}': () - [144; 284) '{ ...ored }': () - [150; 151) 'F': F<{unknown}> - [150; 158) 'F.foo(S)': ({unknown}, {unknown}) - [156; 157) 'S': S - [164; 172) 'F::': F - [164; 179) 'F::.foo(S)': (u32, {unknown}) - [177; 178) 'S': S - [185; 193) 'F::': F - [185; 207) 'F::(S)': (u32, i32) - [205; 206) 'S': S - [213; 221) 'F::': F - [213; 240) 'F::(S)': (u32, i32) - [238; 239) 'S': S + 88..92 'self': F + 94..95 'x': impl Trait + 119..130 '{ loop {} }': (T, U) + 121..128 'loop {}': ! + 126..128 '{}': () + 144..284 '{ ...ored }': () + 150..151 'F': F<{unknown}> + 150..158 'F.foo(S)': ({unknown}, {unknown}) + 156..157 'S': S + 164..172 'F::': F + 164..179 'F::.foo(S)': (u32, {unknown}) + 177..178 'S': S + 185..193 'F::': F + 185..207 'F::(S)': (u32, i32) + 205..206 'S': S + 213..221 'F::': F + 213..240 'F::(S)': (u32, i32) + 238..239 'S': S "### ); } @@ -1098,13 +1098,13 @@ fn test() { } "#, true), @r###" - [23; 24) 'x': impl Trait - [38; 49) '{ loop {} }': () - [40; 47) 'loop {}': ! - [45; 47) '{}': () - [91; 124) '{ ...foo; }': () - [101; 102) 'f': fn(S) - [118; 121) 'foo': fn foo(S) + 23..24 'x': impl Trait + 38..49 '{ loop {} }': () + 40..47 'loop {}': ! + 45..47 '{}': () + 91..124 '{ ...foo; }': () + 101..102 'f': fn(S) + 118..121 'foo': fn foo(S) "### ); } @@ -1133,29 +1133,29 @@ fn test(x: impl Trait, y: &impl Trait) { } "#), @r###" - [30; 34) 'self': &Self - [55; 59) 'self': &Self - [99; 101) '{}': () - [111; 112) 'x': impl Trait - [131; 132) 'y': &impl Trait - [152; 269) '{ ...2(); }': () - [158; 159) 'x': impl Trait - [165; 166) 'y': &impl Trait - [176; 177) 'z': impl Trait - [180; 183) 'bar': fn bar() -> impl Trait - [180; 185) 'bar()': impl Trait - [191; 192) 'x': impl Trait - [191; 198) 'x.foo()': u64 - [204; 205) 'y': &impl Trait - [204; 211) 'y.foo()': u64 - [217; 218) 'z': impl Trait - [217; 224) 'z.foo()': u64 - [230; 231) 'x': impl Trait - [230; 238) 'x.foo2()': i64 - [244; 245) 'y': &impl Trait - [244; 252) 'y.foo2()': i64 - [258; 259) 'z': impl Trait - [258; 266) 'z.foo2()': i64 + 30..34 'self': &Self + 55..59 'self': &Self + 99..101 '{}': () + 111..112 'x': impl Trait + 131..132 'y': &impl Trait + 152..269 '{ ...2(); }': () + 158..159 'x': impl Trait + 165..166 'y': &impl Trait + 176..177 'z': impl Trait + 180..183 'bar': fn bar() -> impl Trait + 180..185 'bar()': impl Trait + 191..192 'x': impl Trait + 191..198 'x.foo()': u64 + 204..205 'y': &impl Trait + 204..211 'y.foo()': u64 + 217..218 'z': impl Trait + 217..224 'z.foo()': u64 + 230..231 'x': impl Trait + 230..238 'x.foo2()': i64 + 244..245 'y': &impl Trait + 244..252 'y.foo2()': i64 + 258..259 'z': impl Trait + 258..266 'z.foo2()': i64 "### ); } @@ -1183,29 +1183,29 @@ fn test(x: dyn Trait, y: &dyn Trait) { } "#), @r###" - [30; 34) 'self': &Self - [55; 59) 'self': &Self - [98; 100) '{}': () - [110; 111) 'x': dyn Trait - [129; 130) 'y': &dyn Trait - [149; 266) '{ ...2(); }': () - [155; 156) 'x': dyn Trait - [162; 163) 'y': &dyn Trait - [173; 174) 'z': dyn Trait - [177; 180) 'bar': fn bar() -> dyn Trait - [177; 182) 'bar()': dyn Trait - [188; 189) 'x': dyn Trait - [188; 195) 'x.foo()': u64 - [201; 202) 'y': &dyn Trait - [201; 208) 'y.foo()': u64 - [214; 215) 'z': dyn Trait - [214; 221) 'z.foo()': u64 - [227; 228) 'x': dyn Trait - [227; 235) 'x.foo2()': i64 - [241; 242) 'y': &dyn Trait - [241; 249) 'y.foo2()': i64 - [255; 256) 'z': dyn Trait - [255; 263) 'z.foo2()': i64 + 30..34 'self': &Self + 55..59 'self': &Self + 98..100 '{}': () + 110..111 'x': dyn Trait + 129..130 'y': &dyn Trait + 149..266 '{ ...2(); }': () + 155..156 'x': dyn Trait + 162..163 'y': &dyn Trait + 173..174 'z': dyn Trait + 177..180 'bar': fn bar() -> dyn Trait + 177..182 'bar()': dyn Trait + 188..189 'x': dyn Trait + 188..195 'x.foo()': u64 + 201..202 'y': &dyn Trait + 201..208 'y.foo()': u64 + 214..215 'z': dyn Trait + 214..221 'z.foo()': u64 + 227..228 'x': dyn Trait + 227..235 'x.foo2()': i64 + 241..242 'y': &dyn Trait + 241..249 'y.foo2()': i64 + 255..256 'z': dyn Trait + 255..263 'z.foo2()': i64 "### ); } @@ -1231,17 +1231,17 @@ fn test(s: S) { } "#), @r###" - [33; 37) 'self': &Self - [103; 107) 'self': &S - [129; 140) '{ loop {} }': &dyn Trait - [131; 138) 'loop {}': ! - [136; 138) '{}': () - [176; 180) 'self': &Self - [252; 253) 's': S - [268; 290) '{ ...z(); }': () - [274; 275) 's': S - [274; 281) 's.bar()': &dyn Trait - [274; 287) 's.bar().baz()': (u32, i32) + 33..37 'self': &Self + 103..107 'self': &S + 129..140 '{ loop {} }': &dyn Trait + 131..138 'loop {}': ! + 136..138 '{}': () + 176..180 'self': &Self + 252..253 's': S + 268..290 '{ ...z(); }': () + 274..275 's': S + 274..281 's.bar()': &dyn Trait + 274..287 's.bar().baz()': (u32, i32) "### ); } @@ -1265,22 +1265,22 @@ fn test(x: Trait, y: &Trait) -> u64 { } "#), @r###" - [27; 31) 'self': &Self - [61; 63) '{}': () - [73; 74) 'x': dyn Trait - [83; 84) 'y': &dyn Trait - [101; 176) '{ ...o(); }': () - [107; 108) 'x': dyn Trait - [114; 115) 'y': &dyn Trait - [125; 126) 'z': dyn Trait - [129; 132) 'bar': fn bar() -> dyn Trait - [129; 134) 'bar()': dyn Trait - [140; 141) 'x': dyn Trait - [140; 147) 'x.foo()': u64 - [153; 154) 'y': &dyn Trait - [153; 160) 'y.foo()': u64 - [166; 167) 'z': dyn Trait - [166; 173) 'z.foo()': u64 + 27..31 'self': &Self + 61..63 '{}': () + 73..74 'x': dyn Trait + 83..84 'y': &dyn Trait + 101..176 '{ ...o(); }': () + 107..108 'x': dyn Trait + 114..115 'y': &dyn Trait + 125..126 'z': dyn Trait + 129..132 'bar': fn bar() -> dyn Trait + 129..134 'bar()': dyn Trait + 140..141 'x': dyn Trait + 140..147 'x.foo()': u64 + 153..154 'y': &dyn Trait + 153..160 'y.foo()': u64 + 166..167 'z': dyn Trait + 166..173 'z.foo()': u64 "### ); } @@ -1294,13 +1294,13 @@ fn test(a: impl Trait + 'lifetime, b: impl 'lifetime, c: impl (Trait), d: impl ( } "#), @r###" - [24; 25) 'a': impl Trait + {error} - [51; 52) 'b': impl {error} - [70; 71) 'c': impl Trait - [87; 88) 'd': impl {error} - [108; 109) 'e': impl {error} - [124; 125) 'f': impl Trait + {error} - [148; 151) '{ }': () + 24..25 'a': impl Trait + {error} + 51..52 'b': impl {error} + 70..71 'c': impl Trait + 87..88 'd': impl {error} + 108..109 'e': impl {error} + 124..125 'f': impl Trait + {error} + 148..151 '{ }': () "### ); } @@ -1349,41 +1349,41 @@ fn test>(x: T, y: impl Trait) { } "#), @r###" - [50; 51) 't': T - [78; 80) '{}': () - [112; 113) 't': T - [123; 125) '{}': () - [155; 156) 't': T - [166; 169) '{t}': T - [167; 168) 't': T - [257; 258) 'x': T - [263; 264) 'y': impl Trait - [290; 398) '{ ...r>); }': () - [296; 299) 'get': fn get(T) -> ::Type - [296; 302) 'get(x)': u32 - [300; 301) 'x': T - [308; 312) 'get2': fn get2(T) -> u32 - [308; 315) 'get2(x)': u32 - [313; 314) 'x': T - [321; 324) 'get': fn get>(impl Trait) -> as Trait>::Type - [321; 327) 'get(y)': i64 - [325; 326) 'y': impl Trait - [333; 337) 'get2': fn get2>(impl Trait) -> i64 - [333; 340) 'get2(y)': i64 - [338; 339) 'y': impl Trait - [346; 349) 'get': fn get>(S) -> as Trait>::Type - [346; 357) 'get(set(S))': u64 - [350; 353) 'set': fn set>(S) -> S - [350; 356) 'set(S)': S - [354; 355) 'S': S - [363; 367) 'get2': fn get2>(S) -> u64 - [363; 375) 'get2(set(S))': u64 - [368; 371) 'set': fn set>(S) -> S - [368; 374) 'set(S)': S - [372; 373) 'S': S - [381; 385) 'get2': fn get2>(S) -> str - [381; 395) 'get2(S::)': str - [386; 394) 'S::': S + 50..51 't': T + 78..80 '{}': () + 112..113 't': T + 123..125 '{}': () + 155..156 't': T + 166..169 '{t}': T + 167..168 't': T + 257..258 'x': T + 263..264 'y': impl Trait + 290..398 '{ ...r>); }': () + 296..299 'get': fn get(T) -> ::Type + 296..302 'get(x)': u32 + 300..301 'x': T + 308..312 'get2': fn get2(T) -> u32 + 308..315 'get2(x)': u32 + 313..314 'x': T + 321..324 'get': fn get>(impl Trait) -> as Trait>::Type + 321..327 'get(y)': i64 + 325..326 'y': impl Trait + 333..337 'get2': fn get2>(impl Trait) -> i64 + 333..340 'get2(y)': i64 + 338..339 'y': impl Trait + 346..349 'get': fn get>(S) -> as Trait>::Type + 346..357 'get(set(S))': u64 + 350..353 'set': fn set>(S) -> S + 350..356 'set(S)': S + 354..355 'S': S + 363..367 'get2': fn get2>(S) -> u64 + 363..375 'get2(set(S))': u64 + 368..371 'set': fn set>(S) -> S + 368..374 'set(S)': S + 372..373 'S': S + 381..385 'get2': fn get2>(S) -> str + 381..395 'get2(S::)': str + 386..394 'S::': S "### ); } @@ -1448,11 +1448,11 @@ fn test>(x: T) { } "#), @r###" - [62; 66) 'self': Self - [164; 165) 'x': T - [170; 186) '{ ...o(); }': () - [176; 177) 'x': T - [176; 183) 'x.foo()': u32 + 62..66 'self': Self + 164..165 'x': T + 170..186 '{ ...o(); }': () + 176..177 'x': T + 176..183 'x.foo()': u32 "### ); } @@ -1494,15 +1494,15 @@ fn test(x: T, y: U) { } "#), @r###" - [50; 54) 'self': &Self - [63; 65) '{}': () - [182; 183) 'x': T - [188; 189) 'y': U - [194; 223) '{ ...o(); }': () - [200; 201) 'x': T - [200; 207) 'x.foo()': u32 - [213; 214) 'y': U - [213; 220) 'y.foo()': u32 + 50..54 'self': &Self + 63..65 '{}': () + 182..183 'x': T + 188..189 'y': U + 194..223 '{ ...o(); }': () + 200..201 'x': T + 200..207 'x.foo()': u32 + 213..214 'y': U + 213..220 'y.foo()': u32 "### ); } @@ -1523,12 +1523,12 @@ fn test(x: &impl Trait1) { } "#), @r###" - [50; 54) 'self': &Self - [63; 65) '{}': () - [116; 117) 'x': &impl Trait1 - [133; 149) '{ ...o(); }': () - [139; 140) 'x': &impl Trait1 - [139; 146) 'x.foo()': u32 + 50..54 'self': &Self + 63..65 '{}': () + 116..117 'x': &impl Trait1 + 133..149 '{ ...o(); }': () + 139..140 'x': &impl Trait1 + 139..146 'x.foo()': u32 "### ); } @@ -1546,10 +1546,10 @@ fn test(x: T) { } "#), @r###" - [44; 45) 'x': T - [50; 66) '{ ...o(); }': () - [56; 57) 'x': T - [56; 63) 'x.foo()': {unknown} + 44..45 'x': T + 50..66 '{ ...o(); }': () + 56..57 'x': T + 56..63 'x.foo()': {unknown} "### ); } @@ -1573,17 +1573,17 @@ fn test() { } "#), @r###" - [103; 104) 't': T - [114; 116) '{}': () - [146; 147) 't': T - [157; 160) '{t}': T - [158; 159) 't': T - [259; 280) '{ ...S)); }': () - [265; 269) 'get2': fn get2>(S) -> u64 - [265; 277) 'get2(set(S))': u64 - [270; 273) 'set': fn set>(S) -> S - [270; 276) 'set(S)': S - [274; 275) 'S': S + 103..104 't': T + 114..116 '{}': () + 146..147 't': T + 157..160 '{t}': T + 158..159 't': T + 259..280 '{ ...S)); }': () + 265..269 'get2': fn get2>(S) -> u64 + 265..277 'get2(set(S))': u64 + 270..273 'set': fn set>(S) -> S + 270..276 'set(S)': S + 274..275 'S': S "### ); } @@ -1603,15 +1603,15 @@ fn test u128>(f: F) { } "#), @r###" - [57; 61) 'self': Self - [63; 67) 'args': Args - [150; 151) 'f': F - [156; 184) '{ ...2)); }': () - [162; 163) 'f': F - [162; 181) 'f.call...1, 2))': u128 - [174; 180) '(1, 2)': (u32, u64) - [175; 176) '1': u32 - [178; 179) '2': u64 + 57..61 'self': Self + 63..67 'args': Args + 150..151 'f': F + 156..184 '{ ...2)); }': () + 162..163 'f': F + 162..181 'f.call...1, 2))': u128 + 174..180 '(1, 2)': (u32, u64) + 175..176 '1': u32 + 178..179 '2': u64 "### ); } @@ -1638,32 +1638,32 @@ fn test() { } "#), @r###" - [148; 152) 'self': Option - [154; 155) 'f': F - [173; 175) '{}': () - [189; 308) '{ ... 1); }': () - [199; 200) 'x': Option - [203; 215) 'Option::Some': Some(u32) -> Option - [203; 221) 'Option...(1u32)': Option - [216; 220) '1u32': u32 - [227; 228) 'x': Option - [227; 243) 'x.map(...v + 1)': Option - [233; 242) '|v| v + 1': |u32| -> u32 - [234; 235) 'v': u32 - [237; 238) 'v': u32 - [237; 242) 'v + 1': u32 - [241; 242) '1': u32 - [249; 250) 'x': Option - [249; 265) 'x.map(... 1u64)': Option - [255; 264) '|_v| 1u64': |u32| -> u64 - [256; 258) '_v': u32 - [260; 264) '1u64': u64 - [275; 276) 'y': Option - [292; 293) 'x': Option - [292; 305) 'x.map(|_v| 1)': Option - [298; 304) '|_v| 1': |u32| -> i64 - [299; 301) '_v': u32 - [303; 304) '1': i64 + 148..152 'self': Option + 154..155 'f': F + 173..175 '{}': () + 189..308 '{ ... 1); }': () + 199..200 'x': Option + 203..215 'Option::Some': Some(u32) -> Option + 203..221 'Option...(1u32)': Option + 216..220 '1u32': u32 + 227..228 'x': Option + 227..243 'x.map(...v + 1)': Option + 233..242 '|v| v + 1': |u32| -> u32 + 234..235 'v': u32 + 237..238 'v': u32 + 237..242 'v + 1': u32 + 241..242 '1': u32 + 249..250 'x': Option + 249..265 'x.map(... 1u64)': Option + 255..264 '|_v| 1u64': |u32| -> u64 + 256..258 '_v': u32 + 260..264 '1u64': u64 + 275..276 'y': Option + 292..293 'x': Option + 292..305 'x.map(|_v| 1)': Option + 298..304 '|_v| 1': |u32| -> i64 + 299..301 '_v': u32 + 303..304 '1': i64 "### ); } @@ -1684,26 +1684,26 @@ fn test u64>(f: F) { } "#), @r###" - [73; 74) 'f': F - [79; 155) '{ ...+ v; }': () - [85; 86) 'f': F - [85; 89) 'f(1)': {unknown} - [87; 88) '1': i32 - [99; 100) 'g': |u64| -> i32 - [103; 112) '|v| v + 1': |u64| -> i32 - [104; 105) 'v': u64 - [107; 108) 'v': u64 - [107; 112) 'v + 1': i32 - [111; 112) '1': i32 - [118; 119) 'g': |u64| -> i32 - [118; 125) 'g(1u64)': i32 - [120; 124) '1u64': u64 - [135; 136) 'h': |u128| -> u128 - [139; 152) '|v| 1u128 + v': |u128| -> u128 - [140; 141) 'v': u128 - [143; 148) '1u128': u128 - [143; 152) '1u128 + v': u128 - [151; 152) 'v': u128 + 73..74 'f': F + 79..155 '{ ...+ v; }': () + 85..86 'f': F + 85..89 'f(1)': {unknown} + 87..88 '1': i32 + 99..100 'g': |u64| -> i32 + 103..112 '|v| v + 1': |u64| -> i32 + 104..105 'v': u64 + 107..108 'v': u64 + 107..112 'v + 1': i32 + 111..112 '1': i32 + 118..119 'g': |u64| -> i32 + 118..125 'g(1u64)': i32 + 120..124 '1u64': u64 + 135..136 'h': |u128| -> u128 + 139..152 '|v| 1u128 + v': |u128| -> u128 + 140..141 'v': u128 + 143..148 '1u128': u128 + 143..152 '1u128 + v': u128 + 151..152 'v': u128 "### ); } @@ -1736,54 +1736,54 @@ fn test() { } "#), @r###" - [95; 96) 'x': T - [101; 102) 'f': F - [112; 114) '{}': () - [148; 149) 'f': F - [154; 155) 'x': T - [165; 167) '{}': () - [202; 206) 'self': S - [254; 258) 'self': S - [260; 261) 'x': T - [266; 267) 'f': F - [277; 279) '{}': () - [317; 321) 'self': S - [323; 324) 'f': F - [329; 330) 'x': T - [340; 342) '{}': () - [356; 515) '{ ... S); }': () - [366; 368) 'x1': u64 - [371; 375) 'foo1': fn foo1 u64>(S, |S| -> u64) -> u64 - [371; 394) 'foo1(S...hod())': u64 - [376; 377) 'S': S - [379; 393) '|s| s.method()': |S| -> u64 - [380; 381) 's': S - [383; 384) 's': S - [383; 393) 's.method()': u64 - [404; 406) 'x2': u64 - [409; 413) 'foo2': fn foo2 u64>(|S| -> u64, S) -> u64 - [409; 432) 'foo2(|...(), S)': u64 - [414; 428) '|s| s.method()': |S| -> u64 - [415; 416) 's': S - [418; 419) 's': S - [418; 428) 's.method()': u64 - [430; 431) 'S': S - [442; 444) 'x3': u64 - [447; 448) 'S': S - [447; 472) 'S.foo1...hod())': u64 - [454; 455) 'S': S - [457; 471) '|s| s.method()': |S| -> u64 - [458; 459) 's': S - [461; 462) 's': S - [461; 471) 's.method()': u64 - [482; 484) 'x4': u64 - [487; 488) 'S': S - [487; 512) 'S.foo2...(), S)': u64 - [494; 508) '|s| s.method()': |S| -> u64 - [495; 496) 's': S - [498; 499) 's': S - [498; 508) 's.method()': u64 - [510; 511) 'S': S + 95..96 'x': T + 101..102 'f': F + 112..114 '{}': () + 148..149 'f': F + 154..155 'x': T + 165..167 '{}': () + 202..206 'self': S + 254..258 'self': S + 260..261 'x': T + 266..267 'f': F + 277..279 '{}': () + 317..321 'self': S + 323..324 'f': F + 329..330 'x': T + 340..342 '{}': () + 356..515 '{ ... S); }': () + 366..368 'x1': u64 + 371..375 'foo1': fn foo1 u64>(S, |S| -> u64) -> u64 + 371..394 'foo1(S...hod())': u64 + 376..377 'S': S + 379..393 '|s| s.method()': |S| -> u64 + 380..381 's': S + 383..384 's': S + 383..393 's.method()': u64 + 404..406 'x2': u64 + 409..413 'foo2': fn foo2 u64>(|S| -> u64, S) -> u64 + 409..432 'foo2(|...(), S)': u64 + 414..428 '|s| s.method()': |S| -> u64 + 415..416 's': S + 418..419 's': S + 418..428 's.method()': u64 + 430..431 'S': S + 442..444 'x3': u64 + 447..448 'S': S + 447..472 'S.foo1...hod())': u64 + 454..455 'S': S + 457..471 '|s| s.method()': |S| -> u64 + 458..459 's': S + 461..462 's': S + 461..471 's.method()': u64 + 482..484 'x4': u64 + 487..488 'S': S + 487..512 'S.foo2...(), S)': u64 + 494..508 '|s| s.method()': |S| -> u64 + 495..496 's': S + 498..499 's': S + 498..508 's.method()': u64 + 510..511 'S': S "### ); } @@ -1858,18 +1858,18 @@ impl Trait for S2 { } "#, ), @r###" - [54; 58) 'self': &Self - [60; 61) 'x': Trait::Item - [140; 144) 'self': &S - [146; 147) 'x': u32 - [161; 175) '{ let y = x; }': () - [167; 168) 'y': u32 - [171; 172) 'x': u32 - [242; 246) 'self': &S2 - [248; 249) 'x': i32 - [265; 279) '{ let y = x; }': () - [271; 272) 'y': i32 - [275; 276) 'x': i32 + 54..58 'self': &Self + 60..61 'x': Trait::Item + 140..144 'self': &S + 146..147 'x': u32 + 161..175 '{ let y = x; }': () + 167..168 'y': u32 + 171..172 'x': u32 + 242..246 'self': &S2 + 248..249 'x': i32 + 265..279 '{ let y = x; }': () + 271..272 'y': i32 + 275..276 'x': i32 "###); } @@ -2077,15 +2077,15 @@ impl TokenStream for Rustc { } "#, true), @r###" - [1115; 1126) '{ loop {} }': T - [1117; 1124) 'loop {}': ! - [1122; 1124) '{}': () - [1190; 1253) '{ ... }': {unknown} - [1204; 1209) 'group': {unknown} - [1225; 1229) 'make': fn make<{unknown}>() -> {unknown} - [1225; 1231) 'make()': {unknown} - [1241; 1245) 'make': fn make<{unknown}>() -> {unknown} - [1241; 1247) 'make()': {unknown} + 1115..1126 '{ loop {} }': T + 1117..1124 'loop {}': ! + 1122..1124 '{}': () + 1190..1253 '{ ... }': {unknown} + 1204..1209 'group': {unknown} + 1225..1229 'make': fn make<{unknown}>() -> {unknown} + 1225..1231 'make()': {unknown} + 1241..1245 'make': fn make<{unknown}>() -> {unknown} + 1241..1247 'make()': {unknown} "### ); } @@ -2112,37 +2112,37 @@ fn test() -> impl Trait { } "#, true), @r###" - [27; 28) 'x': impl Trait - [47; 58) '{ loop {} }': () - [49; 56) 'loop {}': ! - [54; 56) '{}': () - [69; 70) 'x': impl Trait - [92; 103) '{ loop {} }': T - [94; 101) 'loop {}': ! - [99; 101) '{}': () - [172; 183) '{ loop {} }': T - [174; 181) 'loop {}': ! - [179; 181) '{}': () - [214; 310) '{ ...t()) }': S<{unknown}> - [224; 226) 's1': S - [229; 230) 'S': S(u32) -> S - [229; 241) 'S(default())': S - [231; 238) 'default': fn default() -> u32 - [231; 240) 'default()': u32 - [247; 250) 'foo': fn foo(S) - [247; 254) 'foo(s1)': () - [251; 253) 's1': S - [264; 265) 'x': i32 - [273; 276) 'bar': fn bar(S) -> i32 - [273; 290) 'bar(S(...lt()))': i32 - [277; 278) 'S': S(i32) -> S - [277; 289) 'S(default())': S - [279; 286) 'default': fn default() -> i32 - [279; 288) 'default()': i32 - [296; 297) 'S': S<{unknown}>({unknown}) -> S<{unknown}> - [296; 308) 'S(default())': S<{unknown}> - [298; 305) 'default': fn default<{unknown}>() -> {unknown} - [298; 307) 'default()': {unknown} + 27..28 'x': impl Trait + 47..58 '{ loop {} }': () + 49..56 'loop {}': ! + 54..56 '{}': () + 69..70 'x': impl Trait + 92..103 '{ loop {} }': T + 94..101 'loop {}': ! + 99..101 '{}': () + 172..183 '{ loop {} }': T + 174..181 'loop {}': ! + 179..181 '{}': () + 214..310 '{ ...t()) }': S<{unknown}> + 224..226 's1': S + 229..230 'S': S(u32) -> S + 229..241 'S(default())': S + 231..238 'default': fn default() -> u32 + 231..240 'default()': u32 + 247..250 'foo': fn foo(S) + 247..254 'foo(s1)': () + 251..253 's1': S + 264..265 'x': i32 + 273..276 'bar': fn bar(S) -> i32 + 273..290 'bar(S(...lt()))': i32 + 277..278 'S': S(i32) -> S + 277..289 'S(default())': S + 279..286 'default': fn default() -> i32 + 279..288 'default()': i32 + 296..297 'S': S<{unknown}>({unknown}) -> S<{unknown}> + 296..308 'S(default())': S<{unknown}> + 298..305 'default': fn default<{unknown}>() -> {unknown} + 298..307 'default()': {unknown} "### ); } @@ -2176,15 +2176,15 @@ fn main() { } "#), @r###" - [147; 149) '_v': F - [192; 195) '{ }': () - [207; 238) '{ ... }); }': () - [213; 223) 'f::<(), _>': fn f<(), |&()| -> ()>(|&()| -> ()) - [213; 235) 'f::<()... z; })': () - [224; 234) '|z| { z; }': |&()| -> () - [225; 226) 'z': &() - [228; 234) '{ z; }': () - [230; 231) 'z': &() + 147..149 '_v': F + 192..195 '{ }': () + 207..238 '{ ... }); }': () + 213..223 'f::<(), _>': fn f<(), |&()| -> ()>(|&()| -> ()) + 213..235 'f::<()... z; })': () + 224..234 '|z| { z; }': |&()| -> () + 225..226 'z': &() + 228..234 '{ z; }': () + 230..231 'z': &() "### ); } @@ -2337,46 +2337,46 @@ fn main() { } "#), @r###" - [240; 244) 'self': Self - [246; 247) 'f': F - [331; 342) '{ loop {} }': FilterMap - [333; 340) 'loop {}': ! - [338; 340) '{}': () - [363; 367) 'self': Self - [369; 370) 'f': F - [419; 430) '{ loop {} }': () - [421; 428) 'loop {}': ! - [426; 428) '{}': () - [539; 543) 'self': Self - [868; 872) 'self': I - [879; 899) '{ ... }': I - [889; 893) 'self': I - [958; 969) '{ loop {} }': Vec - [960; 967) 'loop {}': ! - [965; 967) '{}': () - [1156; 1287) '{ ... }); }': () - [1162; 1177) 'Vec::::new': fn new() -> Vec - [1162; 1179) 'Vec::<...:new()': Vec - [1162; 1191) 'Vec::<...iter()': IntoIter - [1162; 1256) 'Vec::<...one })': FilterMap, |i32| -> Option> - [1162; 1284) 'Vec::<... y; })': () - [1210; 1255) '|x| if...None }': |i32| -> Option - [1211; 1212) 'x': i32 - [1214; 1255) 'if x >...None }': Option - [1217; 1218) 'x': i32 - [1217; 1222) 'x > 0': bool - [1221; 1222) '0': i32 - [1223; 1241) '{ Some...u32) }': Option - [1225; 1229) 'Some': Some(u32) -> Option - [1225; 1239) 'Some(x as u32)': Option - [1230; 1231) 'x': i32 - [1230; 1238) 'x as u32': u32 - [1247; 1255) '{ None }': Option - [1249; 1253) 'None': Option - [1273; 1283) '|y| { y; }': |u32| -> () - [1274; 1275) 'y': u32 - [1277; 1283) '{ y; }': () - [1279; 1280) 'y': u32 + 240..244 'self': Self + 246..247 'f': F + 331..342 '{ loop {} }': FilterMap + 333..340 'loop {}': ! + 338..340 '{}': () + 363..367 'self': Self + 369..370 'f': F + 419..430 '{ loop {} }': () + 421..428 'loop {}': ! + 426..428 '{}': () + 539..543 'self': Self + 868..872 'self': I + 879..899 '{ ... }': I + 889..893 'self': I + 958..969 '{ loop {} }': Vec + 960..967 'loop {}': ! + 965..967 '{}': () + 1156..1287 '{ ... }); }': () + 1162..1177 'Vec::::new': fn new() -> Vec + 1162..1179 'Vec::<...:new()': Vec + 1162..1191 'Vec::<...iter()': IntoIter + 1162..1256 'Vec::<...one })': FilterMap, |i32| -> Option> + 1162..1284 'Vec::<... y; })': () + 1210..1255 '|x| if...None }': |i32| -> Option + 1211..1212 'x': i32 + 1214..1255 'if x >...None }': Option + 1217..1218 'x': i32 + 1217..1222 'x > 0': bool + 1221..1222 '0': i32 + 1223..1241 '{ Some...u32) }': Option + 1225..1229 'Some': Some(u32) -> Option + 1225..1239 'Some(x as u32)': Option + 1230..1231 'x': i32 + 1230..1238 'x as u32': u32 + 1247..1255 '{ None }': Option + 1249..1253 'None': Option + 1273..1283 '|y| { y; }': |u32| -> () + 1274..1275 'y': u32 + 1277..1283 '{ y; }': () + 1279..1280 'y': u32 "### ); } @@ -2428,13 +2428,13 @@ fn test(x: &dyn Foo) { } "#, true), @r###" - [22; 23) 'x': &dyn Foo - [35; 37) '{}': () - [47; 48) 'x': &dyn Foo - [60; 75) '{ foo(x); }': () - [66; 69) 'foo': fn foo(&dyn Foo) - [66; 72) 'foo(x)': () - [70; 71) 'x': &dyn Foo + 22..23 'x': &dyn Foo + 35..37 '{}': () + 47..48 'x': &dyn Foo + 60..75 '{ foo(x); }': () + 66..69 'foo': fn foo(&dyn Foo) + 66..72 'foo(x)': () + 70..71 'x': &dyn Foo "### ); } diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs index b00b6d4310..85d1f0cb15 100644 --- a/crates/ra_ide/src/call_hierarchy.rs +++ b/crates/ra_ide/src/call_hierarchy.rs @@ -183,8 +183,8 @@ mod tests { call<|>ee(); } "#, - "callee FN_DEF FileId(1) [0; 14) [3; 9)", - &["caller FN_DEF FileId(1) [15; 44) [18; 24) : [[33; 39)]"], + "callee FN_DEF FileId(1) 0..14 3..9", + &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], &[], ); } @@ -199,8 +199,8 @@ mod tests { callee(); } "#, - "callee FN_DEF FileId(1) [0; 14) [3; 9)", - &["caller FN_DEF FileId(1) [15; 44) [18; 24) : [[33; 39)]"], + "callee FN_DEF FileId(1) 0..14 3..9", + &["caller FN_DEF FileId(1) 15..44 18..24 : [33..39]"], &[], ); } @@ -216,8 +216,8 @@ mod tests { callee(); } "#, - "callee FN_DEF FileId(1) [0; 14) [3; 9)", - &["caller FN_DEF FileId(1) [15; 58) [18; 24) : [[33; 39), [47; 53)]"], + "callee FN_DEF FileId(1) 0..14 3..9", + &["caller FN_DEF FileId(1) 15..58 18..24 : [33..39, 47..53]"], &[], ); } @@ -236,10 +236,10 @@ mod tests { callee(); } "#, - "callee FN_DEF FileId(1) [0; 14) [3; 9)", + "callee FN_DEF FileId(1) 0..14 3..9", &[ - "caller1 FN_DEF FileId(1) [15; 45) [18; 25) : [[34; 40)]", - "caller2 FN_DEF FileId(1) [46; 76) [49; 56) : [[65; 71)]", + "caller1 FN_DEF FileId(1) 15..45 18..25 : [34..40]", + "caller2 FN_DEF FileId(1) 46..76 49..56 : [65..71]", ], &[], ); @@ -260,8 +260,8 @@ mod tests { //- /foo/mod.rs pub fn callee() {} "#, - "callee FN_DEF FileId(2) [0; 18) [7; 13)", - &["caller FN_DEF FileId(1) [26; 55) [29; 35) : [[44; 50)]"], + "callee FN_DEF FileId(2) 0..18 7..13", + &["caller FN_DEF FileId(1) 26..55 29..35 : [44..50]"], &[], ); } @@ -277,9 +277,9 @@ mod tests { callee(); } "#, - "caller FN_DEF FileId(1) [15; 58) [18; 24)", + "caller FN_DEF FileId(1) 15..58 18..24", &[], - &["callee FN_DEF FileId(1) [0; 14) [3; 9) : [[33; 39), [47; 53)]"], + &["callee FN_DEF FileId(1) 0..14 3..9 : [33..39, 47..53]"], ); } @@ -298,9 +298,9 @@ mod tests { //- /foo/mod.rs pub fn callee() {} "#, - "caller FN_DEF FileId(1) [26; 55) [29; 35)", + "caller FN_DEF FileId(1) 26..55 29..35", &[], - &["callee FN_DEF FileId(2) [0; 18) [7; 13) : [[44; 50)]"], + &["callee FN_DEF FileId(2) 0..18 7..13 : [44..50]"], ); } @@ -321,9 +321,9 @@ mod tests { } "#, - "caller2 FN_DEF FileId(1) [32; 63) [35; 42)", - &["caller1 FN_DEF FileId(1) [0; 31) [3; 10) : [[19; 26)]"], - &["caller3 FN_DEF FileId(1) [64; 80) [67; 74) : [[51; 58)]"], + "caller2 FN_DEF FileId(1) 32..63 35..42", + &["caller1 FN_DEF FileId(1) 0..31 3..10 : [19..26]"], + &["caller3 FN_DEF FileId(1) 64..80 67..74 : [51..58]"], ); } } diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ra_ide/src/completion/complete_attribute.rs index b405042e88..8bf9527980 100644 --- a/crates/ra_ide/src/completion/complete_attribute.rs +++ b/crates/ra_ide/src/completion/complete_attribute.rs @@ -147,190 +147,190 @@ mod tests { [ CompletionItem { label: "allow", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "allow(${0:lint})", kind: Attribute, }, CompletionItem { label: "cfg", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "cfg(${0:predicate})", kind: Attribute, }, CompletionItem { label: "cfg_attr", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "cfg_attr(${1:predicate}, ${0:attr})", kind: Attribute, }, CompletionItem { label: "deny", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "deny(${0:lint})", kind: Attribute, }, CompletionItem { label: "deprecated", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "deprecated = \"${0:reason}\"", kind: Attribute, }, CompletionItem { label: "derive", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "derive(${0:Debug})", kind: Attribute, }, CompletionItem { label: "doc", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "doc = \"${0:docs}\"", kind: Attribute, }, CompletionItem { label: "forbid", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "forbid(${0:lint})", kind: Attribute, }, CompletionItem { label: "ignore", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "ignore(${0:lint})", kind: Attribute, }, CompletionItem { label: "inline", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "inline(${0:lint})", kind: Attribute, }, CompletionItem { label: "link", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "link", kind: Attribute, }, CompletionItem { label: "link_name", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "link_name = \"${0:symbol_name}\"", kind: Attribute, }, CompletionItem { label: "macro_export", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "macro_export", kind: Attribute, }, CompletionItem { label: "macro_use", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "macro_use", kind: Attribute, }, CompletionItem { label: "must_use", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "must_use = \"${0:reason}\"", kind: Attribute, }, CompletionItem { label: "no_mangle", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "no_mangle", kind: Attribute, }, CompletionItem { label: "non_exhaustive", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "non_exhaustive", kind: Attribute, }, CompletionItem { label: "path", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "path =\"${0:path}\"", kind: Attribute, }, CompletionItem { label: "proc_macro", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "proc_macro", kind: Attribute, }, CompletionItem { label: "proc_macro_attribute", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "proc_macro_attribute", kind: Attribute, }, CompletionItem { label: "proc_macro_derive", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "proc_macro_derive(${0:Trait})", kind: Attribute, }, CompletionItem { label: "repr", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "repr(${0:C})", kind: Attribute, }, CompletionItem { label: "should_panic", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "expected = \"${0:reason}\"", kind: Attribute, }, CompletionItem { label: "target_feature", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "target_feature = \"${0:feature}\"", kind: Attribute, }, CompletionItem { label: "test", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "test", kind: Attribute, }, CompletionItem { label: "used", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "used", kind: Attribute, }, CompletionItem { label: "warn", - source_range: [19; 19), - delete: [19; 19), + source_range: 19..19, + delete: 19..19, insert: "warn(${0:lint})", kind: Attribute, }, @@ -351,232 +351,232 @@ mod tests { [ CompletionItem { label: "allow", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "allow(${0:lint})", kind: Attribute, }, CompletionItem { label: "cfg", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "cfg(${0:predicate})", kind: Attribute, }, CompletionItem { label: "cfg_attr", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "cfg_attr(${1:predicate}, ${0:attr})", kind: Attribute, }, CompletionItem { label: "deny", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "deny(${0:lint})", kind: Attribute, }, CompletionItem { label: "deprecated", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "deprecated = \"${0:reason}\"", kind: Attribute, }, CompletionItem { label: "derive", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "derive(${0:Debug})", kind: Attribute, }, CompletionItem { label: "doc", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "doc = \"${0:docs}\"", kind: Attribute, }, CompletionItem { label: "feature", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "feature(${0:flag})", kind: Attribute, }, CompletionItem { label: "forbid", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "forbid(${0:lint})", kind: Attribute, }, CompletionItem { label: "global_allocator", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "global_allocator", kind: Attribute, }, CompletionItem { label: "ignore", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "ignore(${0:lint})", kind: Attribute, }, CompletionItem { label: "inline", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "inline(${0:lint})", kind: Attribute, }, CompletionItem { label: "link", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "link", kind: Attribute, }, CompletionItem { label: "link_name", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "link_name = \"${0:symbol_name}\"", kind: Attribute, }, CompletionItem { label: "macro_export", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "macro_export", kind: Attribute, }, CompletionItem { label: "macro_use", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "macro_use", kind: Attribute, }, CompletionItem { label: "must_use", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "must_use = \"${0:reason}\"", kind: Attribute, }, CompletionItem { label: "no_mangle", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "no_mangle", kind: Attribute, }, CompletionItem { label: "no_std", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "no_std", kind: Attribute, }, CompletionItem { label: "non_exhaustive", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "non_exhaustive", kind: Attribute, }, CompletionItem { label: "panic_handler", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "panic_handler", kind: Attribute, }, CompletionItem { label: "path", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "path =\"${0:path}\"", kind: Attribute, }, CompletionItem { label: "proc_macro", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "proc_macro", kind: Attribute, }, CompletionItem { label: "proc_macro_attribute", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "proc_macro_attribute", kind: Attribute, }, CompletionItem { label: "proc_macro_derive", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "proc_macro_derive(${0:Trait})", kind: Attribute, }, CompletionItem { label: "recursion_limit", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "recursion_limit = ${0:128}", kind: Attribute, }, CompletionItem { label: "repr", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "repr(${0:C})", kind: Attribute, }, CompletionItem { label: "should_panic", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "expected = \"${0:reason}\"", kind: Attribute, }, CompletionItem { label: "target_feature", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "target_feature = \"${0:feature}\"", kind: Attribute, }, CompletionItem { label: "test", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "test", kind: Attribute, }, CompletionItem { label: "used", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "used", kind: Attribute, }, CompletionItem { label: "warn", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "warn(${0:lint})", kind: Attribute, }, CompletionItem { label: "windows_subsystem", - source_range: [20; 20), - delete: [20; 20), + source_range: 20..20, + delete: 20..20, insert: "windows_subsystem = \"${0:subsystem}\"", kind: Attribute, }, diff --git a/crates/ra_ide/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs index b93153b488..814354ffa6 100644 --- a/crates/ra_ide/src/completion/complete_dot.rs +++ b/crates/ra_ide/src/completion/complete_dot.rs @@ -94,8 +94,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [94; 94), - delete: [94; 94), + source_range: 94..94, + delete: 94..94, insert: "the_field", kind: Field, detail: "u32", @@ -125,8 +125,8 @@ mod tests { [ CompletionItem { label: "foo()", - source_range: [187; 187), - delete: [187; 187), + source_range: 187..187, + delete: 187..187, insert: "foo()$0", kind: Method, lookup: "foo", @@ -134,8 +134,8 @@ mod tests { }, CompletionItem { label: "the_field", - source_range: [187; 187), - delete: [187; 187), + source_range: 187..187, + delete: 187..187, insert: "the_field", kind: Field, detail: "(u32,)", @@ -165,8 +165,8 @@ mod tests { [ CompletionItem { label: "foo()", - source_range: [126; 126), - delete: [126; 126), + source_range: 126..126, + delete: 126..126, insert: "foo()$0", kind: Method, lookup: "foo", @@ -174,8 +174,8 @@ mod tests { }, CompletionItem { label: "the_field", - source_range: [126; 126), - delete: [126; 126), + source_range: 126..126, + delete: 126..126, insert: "the_field", kind: Field, detail: "(u32, i32)", @@ -222,24 +222,24 @@ mod tests { [ CompletionItem { label: "crate_field", - source_range: [313; 313), - delete: [313; 313), + source_range: 313..313, + delete: 313..313, insert: "crate_field", kind: Field, detail: "u32", }, CompletionItem { label: "pub_field", - source_range: [313; 313), - delete: [313; 313), + source_range: 313..313, + delete: 313..313, insert: "pub_field", kind: Field, detail: "u32", }, CompletionItem { label: "super_field", - source_range: [313; 313), - delete: [313; 313), + source_range: 313..313, + delete: 313..313, insert: "super_field", kind: Field, detail: "u32", @@ -267,8 +267,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [144; 144), - delete: [144; 144), + source_range: 144..144, + delete: 144..144, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -300,8 +300,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [243; 243), - delete: [243; 243), + source_range: 243..243, + delete: 243..243, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -333,8 +333,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [256; 256), - delete: [256; 256), + source_range: 256..256, + delete: 256..256, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -362,8 +362,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [151; 151), - delete: [151; 151), + source_range: 151..151, + delete: 151..151, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -391,8 +391,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [155; 155), - delete: [155; 155), + source_range: 155..155, + delete: 155..155, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -423,8 +423,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [219; 219), - delete: [219; 219), + source_range: 219..219, + delete: 219..219, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -475,8 +475,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [249; 249), - delete: [249; 249), + source_range: 249..249, + delete: 249..249, insert: "the_method()$0", kind: Method, lookup: "the_method", @@ -502,16 +502,16 @@ mod tests { [ CompletionItem { label: "0", - source_range: [75; 75), - delete: [75; 75), + source_range: 75..75, + delete: 75..75, insert: "0", kind: Field, detail: "i32", }, CompletionItem { label: "1", - source_range: [75; 75), - delete: [75; 75), + source_range: 75..75, + delete: 75..75, insert: "1", kind: Field, detail: "f64", @@ -545,8 +545,8 @@ mod tests { [ CompletionItem { label: "blah()", - source_range: [299; 300), - delete: [299; 300), + source_range: 299..300, + delete: 299..300, insert: "blah()$0", kind: Method, lookup: "blah", @@ -572,8 +572,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [106; 106), - delete: [106; 106), + source_range: 106..106, + delete: 106..106, insert: "the_field", kind: Field, detail: "u32", @@ -606,8 +606,8 @@ mod tests { [ CompletionItem { label: "await", - source_range: [74; 74), - delete: [74; 74), + source_range: 74..74, + delete: 74..74, insert: "await", detail: "expr.await", }, @@ -638,15 +638,15 @@ mod tests { [ CompletionItem { label: "A", - source_range: [217; 217), - delete: [217; 217), + source_range: 217..217, + delete: 217..217, insert: "A", kind: Const, }, CompletionItem { label: "b", - source_range: [217; 217), - delete: [217; 217), + source_range: 217..217, + delete: 217..217, insert: "b", kind: Module, }, @@ -671,8 +671,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [156; 157), - delete: [156; 157), + source_range: 156..157, + delete: 156..157, insert: "the_field", kind: Field, detail: "u32", @@ -698,8 +698,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [156; 157), - delete: [156; 157), + source_range: 156..157, + delete: 156..157, insert: "the_field", kind: Field, detail: "u32", @@ -726,8 +726,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [156; 156), - delete: [156; 156), + source_range: 156..156, + delete: 156..156, insert: "the_field", kind: Field, detail: "u32", @@ -753,8 +753,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [162; 163), - delete: [162; 163), + source_range: 162..163, + delete: 162..163, insert: "the_field", kind: Field, detail: "u32", @@ -790,8 +790,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [552; 552), - delete: [552; 552), + source_range: 552..552, + delete: 552..552, insert: "the_field", kind: Field, detail: "u32", @@ -820,8 +820,8 @@ mod tests { [ CompletionItem { label: "the_method()", - source_range: [201; 201), - delete: [201; 201), + source_range: 201..201, + delete: 201..201, insert: "the_method()$0", kind: Method, lookup: "the_method", diff --git a/crates/ra_ide/src/completion/complete_fn_param.rs b/crates/ra_ide/src/completion/complete_fn_param.rs index f84b559fc1..a661932a31 100644 --- a/crates/ra_ide/src/completion/complete_fn_param.rs +++ b/crates/ra_ide/src/completion/complete_fn_param.rs @@ -75,8 +75,8 @@ mod tests { [ CompletionItem { label: "file_id: FileId", - source_range: [110; 114), - delete: [110; 114), + source_range: 110..114, + delete: 110..114, insert: "file_id: FileId", lookup: "file_id", }, @@ -99,8 +99,8 @@ mod tests { [ CompletionItem { label: "file_id: FileId", - source_range: [110; 114), - delete: [110; 114), + source_range: 110..114, + delete: 110..114, insert: "file_id: FileId", lookup: "file_id", }, @@ -126,8 +126,8 @@ mod tests { [ CompletionItem { label: "file_id: FileId", - source_range: [289; 293), - delete: [289; 293), + source_range: 289..293, + delete: 289..293, insert: "file_id: FileId", lookup: "file_id", }, diff --git a/crates/ra_ide/src/completion/complete_keyword.rs b/crates/ra_ide/src/completion/complete_keyword.rs index 306ce96dc8..fd95bc4103 100644 --- a/crates/ra_ide/src/completion/complete_keyword.rs +++ b/crates/ra_ide/src/completion/complete_keyword.rs @@ -140,22 +140,22 @@ mod tests { [ CompletionItem { label: "crate", - source_range: [21; 21), - delete: [21; 21), + source_range: 21..21, + delete: 21..21, insert: "crate::", kind: Keyword, }, CompletionItem { label: "self", - source_range: [21; 21), - delete: [21; 21), + source_range: 21..21, + delete: 21..21, insert: "self", kind: Keyword, }, CompletionItem { label: "super", - source_range: [21; 21), - delete: [21; 21), + source_range: 21..21, + delete: 21..21, insert: "super::", kind: Keyword, }, @@ -173,15 +173,15 @@ mod tests { [ CompletionItem { label: "self", - source_range: [24; 24), - delete: [24; 24), + source_range: 24..24, + delete: 24..24, insert: "self", kind: Keyword, }, CompletionItem { label: "super", - source_range: [24; 24), - delete: [24; 24), + source_range: 24..24, + delete: 24..24, insert: "super::", kind: Keyword, }, @@ -199,15 +199,15 @@ mod tests { [ CompletionItem { label: "self", - source_range: [28; 28), - delete: [28; 28), + source_range: 28..28, + delete: 28..28, insert: "self", kind: Keyword, }, CompletionItem { label: "super", - source_range: [28; 28), - delete: [28; 28), + source_range: 28..28, + delete: 28..28, insert: "super::", kind: Keyword, }, @@ -230,36 +230,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "return;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "while $0 {}", kind: Keyword, }, @@ -284,50 +284,50 @@ mod tests { [ CompletionItem { label: "else", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "else {$0}", kind: Keyword, }, CompletionItem { label: "else if", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "else if $0 {}", kind: Keyword, }, CompletionItem { label: "if", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "return;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [108; 108), - delete: [108; 108), + source_range: 108..108, + delete: 108..108, insert: "while $0 {}", kind: Keyword, }, @@ -351,36 +351,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [56; 56), - delete: [56; 56), + source_range: 56..56, + delete: 56..56, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [56; 56), - delete: [56; 56), + source_range: 56..56, + delete: 56..56, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [56; 56), - delete: [56; 56), + source_range: 56..56, + delete: 56..56, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [56; 56), - delete: [56; 56), + source_range: 56..56, + delete: 56..56, insert: "return $0;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [56; 56), - delete: [56; 56), + source_range: 56..56, + delete: 56..56, insert: "while $0 {}", kind: Keyword, }, @@ -400,36 +400,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "return;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "while $0 {}", kind: Keyword, }, @@ -454,36 +454,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [97; 97), - delete: [97; 97), + source_range: 97..97, + delete: 97..97, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [97; 97), - delete: [97; 97), + source_range: 97..97, + delete: 97..97, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [97; 97), - delete: [97; 97), + source_range: 97..97, + delete: 97..97, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [97; 97), - delete: [97; 97), + source_range: 97..97, + delete: 97..97, insert: "return $0", kind: Keyword, }, CompletionItem { label: "while", - source_range: [97; 97), - delete: [97; 97), + source_range: 97..97, + delete: 97..97, insert: "while $0 {}", kind: Keyword, }, @@ -508,36 +508,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "return $0;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "while $0 {}", kind: Keyword, }, @@ -560,36 +560,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "return $0;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "while $0 {}", kind: Keyword, }, @@ -612,50 +612,50 @@ mod tests { [ CompletionItem { label: "break", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "break;", kind: Keyword, }, CompletionItem { label: "continue", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "continue;", kind: Keyword, }, CompletionItem { label: "if", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "return $0;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [63; 63), - delete: [63; 63), + source_range: 63..63, + delete: 63..63, insert: "while $0 {}", kind: Keyword, }, @@ -676,36 +676,36 @@ mod tests { [ CompletionItem { label: "if", - source_range: [68; 68), - delete: [68; 68), + source_range: 68..68, + delete: 68..68, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [68; 68), - delete: [68; 68), + source_range: 68..68, + delete: 68..68, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [68; 68), - delete: [68; 68), + source_range: 68..68, + delete: 68..68, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [68; 68), - delete: [68; 68), + source_range: 68..68, + delete: 68..68, insert: "return $0;", kind: Keyword, }, CompletionItem { label: "while", - source_range: [68; 68), - delete: [68; 68), + source_range: 68..68, + delete: 68..68, insert: "while $0 {}", kind: Keyword, }, @@ -732,50 +732,50 @@ mod tests { [ CompletionItem { label: "break", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "break", kind: Keyword, }, CompletionItem { label: "continue", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "continue", kind: Keyword, }, CompletionItem { label: "if", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "if $0 {}", kind: Keyword, }, CompletionItem { label: "loop", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "loop {$0}", kind: Keyword, }, CompletionItem { label: "match", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "match $0 {}", kind: Keyword, }, CompletionItem { label: "return", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "return", kind: Keyword, }, CompletionItem { label: "while", - source_range: [122; 124), - delete: [122; 124), + source_range: 122..124, + delete: 122..124, insert: "while $0 {}", kind: Keyword, }, diff --git a/crates/ra_ide/src/completion/complete_macro_in_item_position.rs b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs index 6000106d01..d9bb5fd25e 100644 --- a/crates/ra_ide/src/completion/complete_macro_in_item_position.rs +++ b/crates/ra_ide/src/completion/complete_macro_in_item_position.rs @@ -42,8 +42,8 @@ mod tests { [ CompletionItem { label: "foo!(…)", - source_range: [46; 46), - delete: [46; 46), + source_range: 46..46, + delete: 46..46, insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", @@ -82,8 +82,8 @@ mod tests { [ CompletionItem { label: "vec![…]", - source_range: [280; 280), - delete: [280; 280), + source_range: 280..280, + delete: 280..280, insert: "vec![$0]", kind: Macro, detail: "macro_rules! vec", @@ -119,8 +119,8 @@ mod tests { [ CompletionItem { label: "foo! {…}", - source_range: [163; 163), - delete: [163; 163), + source_range: 163..163, + delete: 163..163, insert: "foo! {$0}", kind: Macro, detail: "macro_rules! foo", @@ -130,8 +130,8 @@ mod tests { }, CompletionItem { label: "main()", - source_range: [163; 163), - delete: [163; 163), + source_range: 163..163, + delete: 163..163, insert: "main()$0", kind: Function, lookup: "main", diff --git a/crates/ra_ide/src/completion/complete_pattern.rs b/crates/ra_ide/src/completion/complete_pattern.rs index 218829b100..fdd9e928b2 100644 --- a/crates/ra_ide/src/completion/complete_pattern.rs +++ b/crates/ra_ide/src/completion/complete_pattern.rs @@ -63,37 +63,37 @@ mod tests { [ CompletionItem { label: "Bar", - source_range: [246; 246), - delete: [246; 246), + source_range: 246..246, + delete: 246..246, insert: "Bar", kind: Struct, }, CompletionItem { label: "E", - source_range: [246; 246), - delete: [246; 246), + source_range: 246..246, + delete: 246..246, insert: "E", kind: Enum, }, CompletionItem { label: "X", - source_range: [246; 246), - delete: [246; 246), + source_range: 246..246, + delete: 246..246, insert: "X", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Z", - source_range: [246; 246), - delete: [246; 246), + source_range: 246..246, + delete: 246..246, insert: "Z", kind: Const, }, CompletionItem { label: "m", - source_range: [246; 246), - delete: [246; 246), + source_range: 246..246, + delete: 246..246, insert: "m", kind: Module, }, @@ -119,15 +119,15 @@ mod tests { [ CompletionItem { label: "E", - source_range: [151; 151), - delete: [151; 151), + source_range: 151..151, + delete: 151..151, insert: "E", kind: Enum, }, CompletionItem { label: "m!(…)", - source_range: [151; 151), - delete: [151; 151), + source_range: 151..151, + delete: 151..151, insert: "m!($0)", kind: Macro, detail: "macro_rules! m", diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs index d6a37d720e..6a0f0c72e2 100644 --- a/crates/ra_ide/src/completion/complete_postfix.rs +++ b/crates/ra_ide/src/completion/complete_postfix.rs @@ -176,57 +176,57 @@ mod tests { [ CompletionItem { label: "box", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "Box::new(bar)", detail: "Box::new(expr)", }, CompletionItem { label: "dbg", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "dbg!(bar)", detail: "dbg!(expr)", }, CompletionItem { label: "if", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "if bar {$0}", detail: "if expr {}", }, CompletionItem { label: "match", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "match bar {\n ${1:_} => {$0\\},\n}", detail: "match expr {}", }, CompletionItem { label: "not", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "!bar", detail: "!expr", }, CompletionItem { label: "ref", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "&bar", detail: "&expr", }, CompletionItem { label: "refm", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "&mut bar", detail: "&mut expr", }, CompletionItem { label: "while", - source_range: [89; 89), - delete: [85; 89), + source_range: 89..89, + delete: 85..89, insert: "while bar {\n$0\n}", detail: "while expr {}", }, @@ -250,43 +250,43 @@ mod tests { [ CompletionItem { label: "box", - source_range: [91; 91), - delete: [87; 91), + source_range: 91..91, + delete: 87..91, insert: "Box::new(bar)", detail: "Box::new(expr)", }, CompletionItem { label: "dbg", - source_range: [91; 91), - delete: [87; 91), + source_range: 91..91, + delete: 87..91, insert: "dbg!(bar)", detail: "dbg!(expr)", }, CompletionItem { label: "match", - source_range: [91; 91), - delete: [87; 91), + source_range: 91..91, + delete: 87..91, insert: "match bar {\n ${1:_} => {$0\\},\n}", detail: "match expr {}", }, CompletionItem { label: "not", - source_range: [91; 91), - delete: [87; 91), + source_range: 91..91, + delete: 87..91, insert: "!bar", detail: "!expr", }, CompletionItem { label: "ref", - source_range: [91; 91), - delete: [87; 91), + source_range: 91..91, + delete: 87..91, insert: "&bar", detail: "&expr", }, CompletionItem { label: "refm", - source_range: [91; 91), - delete: [87; 91), + source_range: 91..91, + delete: 87..91, insert: "&mut bar", detail: "&mut expr", }, @@ -309,43 +309,43 @@ mod tests { [ CompletionItem { label: "box", - source_range: [52; 52), - delete: [49; 52), + source_range: 52..52, + delete: 49..52, insert: "Box::new(42)", detail: "Box::new(expr)", }, CompletionItem { label: "dbg", - source_range: [52; 52), - delete: [49; 52), + source_range: 52..52, + delete: 49..52, insert: "dbg!(42)", detail: "dbg!(expr)", }, CompletionItem { label: "match", - source_range: [52; 52), - delete: [49; 52), + source_range: 52..52, + delete: 49..52, insert: "match 42 {\n ${1:_} => {$0\\},\n}", detail: "match expr {}", }, CompletionItem { label: "not", - source_range: [52; 52), - delete: [49; 52), + source_range: 52..52, + delete: 49..52, insert: "!42", detail: "!expr", }, CompletionItem { label: "ref", - source_range: [52; 52), - delete: [49; 52), + source_range: 52..52, + delete: 49..52, insert: "&42", detail: "&expr", }, CompletionItem { label: "refm", - source_range: [52; 52), - delete: [49; 52), + source_range: 52..52, + delete: 49..52, insert: "&mut 42", detail: "&mut expr", }, @@ -370,43 +370,43 @@ mod tests { [ CompletionItem { label: "box", - source_range: [149; 150), - delete: [145; 150), + source_range: 149..150, + delete: 145..150, insert: "Box::new(bar)", detail: "Box::new(expr)", }, CompletionItem { label: "dbg", - source_range: [149; 150), - delete: [145; 150), + source_range: 149..150, + delete: 145..150, insert: "dbg!(bar)", detail: "dbg!(expr)", }, CompletionItem { label: "match", - source_range: [149; 150), - delete: [145; 150), + source_range: 149..150, + delete: 145..150, insert: "match bar {\n ${1:_} => {$0\\},\n}", detail: "match expr {}", }, CompletionItem { label: "not", - source_range: [149; 150), - delete: [145; 150), + source_range: 149..150, + delete: 145..150, insert: "!bar", detail: "!expr", }, CompletionItem { label: "ref", - source_range: [149; 150), - delete: [145; 150), + source_range: 149..150, + delete: 145..150, insert: "&bar", detail: "&expr", }, CompletionItem { label: "refm", - source_range: [149; 150), - delete: [145; 150), + source_range: 149..150, + delete: 145..150, insert: "&mut bar", detail: "&mut expr", }, @@ -429,43 +429,43 @@ mod tests { [ CompletionItem { label: "box", - source_range: [56; 56), - delete: [49; 56), + source_range: 56..56, + delete: 49..56, insert: "Box::new(&&&&42)", detail: "Box::new(expr)", }, CompletionItem { label: "dbg", - source_range: [56; 56), - delete: [49; 56), + source_range: 56..56, + delete: 49..56, insert: "dbg!(&&&&42)", detail: "dbg!(expr)", }, CompletionItem { label: "match", - source_range: [56; 56), - delete: [49; 56), + source_range: 56..56, + delete: 49..56, insert: "match &&&&42 {\n ${1:_} => {$0\\},\n}", detail: "match expr {}", }, CompletionItem { label: "not", - source_range: [56; 56), - delete: [53; 56), + source_range: 56..56, + delete: 53..56, insert: "!42", detail: "!expr", }, CompletionItem { label: "ref", - source_range: [56; 56), - delete: [53; 56), + source_range: 56..56, + delete: 53..56, insert: "&42", detail: "&expr", }, CompletionItem { label: "refm", - source_range: [56; 56), - delete: [53; 56), + source_range: 56..56, + delete: 53..56, insert: "&mut 42", detail: "&mut expr", }, diff --git a/crates/ra_ide/src/completion/complete_qualified_path.rs b/crates/ra_ide/src/completion/complete_qualified_path.rs index 5a5139e14c..dd10f74e6d 100644 --- a/crates/ra_ide/src/completion/complete_qualified_path.rs +++ b/crates/ra_ide/src/completion/complete_qualified_path.rs @@ -162,8 +162,8 @@ mod tests { [ CompletionItem { label: "my", - source_range: [27; 29), - delete: [27; 29), + source_range: 27..29, + delete: 27..29, insert: "my", kind: Module, documentation: Documentation( @@ -193,15 +193,15 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [31; 31), - delete: [31; 31), + source_range: 31..31, + delete: 31..31, insert: "Foo", kind: Struct, }, CompletionItem { label: "PublicBar", - source_range: [31; 31), - delete: [31; 31), + source_range: 31..31, + delete: 31..31, insert: "PublicBar", kind: Struct, }, @@ -226,8 +226,8 @@ mod tests { [ CompletionItem { label: "Bar", - source_range: [30; 30), - delete: [30; 30), + source_range: 30..30, + delete: 30..30, insert: "Bar", kind: Struct, }, @@ -252,15 +252,15 @@ mod tests { [ CompletionItem { label: "Spam", - source_range: [11; 13), - delete: [11; 13), + source_range: 11..13, + delete: 11..13, insert: "Spam", kind: Struct, }, CompletionItem { label: "foo", - source_range: [11; 13), - delete: [11; 13), + source_range: 11..13, + delete: 11..13, insert: "foo", kind: Module, }, @@ -285,15 +285,15 @@ mod tests { [ CompletionItem { label: "Spam", - source_range: [12; 14), - delete: [12; 14), + source_range: 12..14, + delete: 12..14, insert: "Spam", kind: Struct, }, CompletionItem { label: "foo", - source_range: [12; 14), - delete: [12; 14), + source_range: 12..14, + delete: 12..14, insert: "foo", kind: Module, }, @@ -322,8 +322,8 @@ mod tests { [ CompletionItem { label: "Spam", - source_range: [23; 25), - delete: [23; 25), + source_range: 23..25, + delete: 23..25, insert: "Spam", kind: Struct, }, @@ -352,8 +352,8 @@ mod tests { [ CompletionItem { label: "Bar(…)", - source_range: [116; 116), - delete: [116; 116), + source_range: 116..116, + delete: 116..116, insert: "Bar($0)", kind: EnumVariant, lookup: "Bar", @@ -365,8 +365,8 @@ mod tests { }, CompletionItem { label: "Foo", - source_range: [116; 116), - delete: [116; 116), + source_range: 116..116, + delete: 116..116, insert: "Foo", kind: EnumVariant, detail: "()", @@ -402,8 +402,8 @@ mod tests { [ CompletionItem { label: "Bar(…)", - source_range: [180; 180), - delete: [180; 180), + source_range: 180..180, + delete: 180..180, insert: "Bar($0)", kind: EnumVariant, lookup: "Bar", @@ -415,8 +415,8 @@ mod tests { }, CompletionItem { label: "Foo", - source_range: [180; 180), - delete: [180; 180), + source_range: 180..180, + delete: 180..180, insert: "Foo", kind: EnumVariant, detail: "()", @@ -426,8 +426,8 @@ mod tests { }, CompletionItem { label: "S(…)", - source_range: [180; 180), - delete: [180; 180), + source_range: 180..180, + delete: 180..180, insert: "S($0)", kind: EnumVariant, lookup: "S", @@ -463,8 +463,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [100; 100), - delete: [100; 100), + source_range: 100..100, + delete: 100..100, insert: "m()$0", kind: Function, lookup: "m", @@ -499,8 +499,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [105; 105), - delete: [105; 105), + source_range: 105..105, + delete: 105..105, insert: "m()$0", kind: Method, lookup: "m", @@ -535,8 +535,8 @@ mod tests { [ CompletionItem { label: "C", - source_range: [107; 107), - delete: [107; 107), + source_range: 107..107, + delete: 107..107, insert: "C", kind: Const, detail: "const C: i32 = 42;", @@ -570,8 +570,8 @@ mod tests { [ CompletionItem { label: "T", - source_range: [101; 101), - delete: [101; 101), + source_range: 101..101, + delete: 101..101, insert: "T", kind: TypeAlias, detail: "type T = i32;", @@ -610,24 +610,24 @@ mod tests { [ CompletionItem { label: "PUBLIC_CONST", - source_range: [302; 302), - delete: [302; 302), + source_range: 302..302, + delete: 302..302, insert: "PUBLIC_CONST", kind: Const, detail: "pub(super) const PUBLIC_CONST: u32 = 1;", }, CompletionItem { label: "PublicType", - source_range: [302; 302), - delete: [302; 302), + source_range: 302..302, + delete: 302..302, insert: "PublicType", kind: TypeAlias, detail: "pub(super) type PublicType = u32;", }, CompletionItem { label: "public_method()", - source_range: [302; 302), - delete: [302; 302), + source_range: 302..302, + delete: 302..302, insert: "public_method()$0", kind: Function, lookup: "public_method", @@ -659,8 +659,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [100; 100), - delete: [100; 100), + source_range: 100..100, + delete: 100..100, insert: "m()$0", kind: Function, lookup: "m", @@ -695,8 +695,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [101; 101), - delete: [101; 101), + source_range: 101..101, + delete: 101..101, insert: "m()$0", kind: Function, lookup: "m", @@ -728,8 +728,8 @@ mod tests { [ CompletionItem { label: "bar", - source_range: [9; 9), - delete: [9; 9), + source_range: 9..9, + delete: 9..9, insert: "bar", kind: Module, }, @@ -756,8 +756,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [73; 73), - delete: [73; 73), + source_range: 73..73, + delete: 73..73, insert: "m()$0", kind: Function, lookup: "m", @@ -792,8 +792,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [99; 99), - delete: [99; 99), + source_range: 99..99, + delete: 99..99, insert: "m()$0", kind: Function, lookup: "m", @@ -828,8 +828,8 @@ mod tests { [ CompletionItem { label: "m()", - source_range: [110; 110), - delete: [110; 110), + source_range: 110..110, + delete: 110..110, insert: "m()$0", kind: Function, lookup: "m", @@ -862,8 +862,8 @@ mod tests { [ CompletionItem { label: "bar()", - source_range: [185; 185), - delete: [185; 185), + source_range: 185..185, + delete: 185..185, insert: "bar()$0", kind: Function, lookup: "bar", @@ -871,8 +871,8 @@ mod tests { }, CompletionItem { label: "foo()", - source_range: [185; 185), - delete: [185; 185), + source_range: 185..185, + delete: 185..185, insert: "foo()$0", kind: Function, lookup: "foo", @@ -902,16 +902,16 @@ mod tests { [ CompletionItem { label: "foo!(…)", - source_range: [179; 179), - delete: [179; 179), + source_range: 179..179, + delete: 179..179, insert: "foo!($0)", kind: Macro, detail: "#[macro_export]\nmacro_rules! foo", }, CompletionItem { label: "main()", - source_range: [179; 179), - delete: [179; 179), + source_range: 179..179, + delete: 179..179, insert: "main()$0", kind: Function, lookup: "main", @@ -947,22 +947,22 @@ mod tests { [ CompletionItem { label: "RIGHT_CONST", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "RIGHT_CONST", kind: Const, }, CompletionItem { label: "RightType", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "RightType", kind: Struct, }, CompletionItem { label: "right_fn()", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "right_fn()$0", kind: Function, lookup: "right_fn", @@ -986,8 +986,8 @@ mod tests { [ CompletionItem { label: "foo()", - source_range: [93; 94), - delete: [93; 94), + source_range: 93..94, + delete: 93..94, insert: "foo()$0", kind: Function, lookup: "foo", @@ -995,8 +995,8 @@ mod tests { }, CompletionItem { label: "main()", - source_range: [93; 94), - delete: [93; 94), + source_range: 93..94, + delete: 93..94, insert: "main()$0", kind: Function, lookup: "main", @@ -1025,15 +1025,15 @@ mod tests { [ CompletionItem { label: "z", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "z", kind: Module, }, CompletionItem { label: "z()", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "z()$0", kind: Function, lookup: "z", @@ -1064,8 +1064,8 @@ mod tests { [ CompletionItem { label: "new()", - source_range: [292; 292), - delete: [292; 292), + source_range: 292..292, + delete: 292..292, insert: "new()$0", kind: Function, lookup: "new", diff --git a/crates/ra_ide/src/completion/complete_record.rs b/crates/ra_ide/src/completion/complete_record.rs index 83a553155b..b7ab654c52 100644 --- a/crates/ra_ide/src/completion/complete_record.rs +++ b/crates/ra_ide/src/completion/complete_record.rs @@ -44,8 +44,8 @@ mod tests { [ CompletionItem { label: "foo", - source_range: [117; 118), - delete: [117; 118), + source_range: 117..118, + delete: 117..118, insert: "foo", kind: Field, detail: "u32", @@ -73,16 +73,16 @@ mod tests { [ CompletionItem { label: "bar", - source_range: [161; 161), - delete: [161; 161), + source_range: 161..161, + delete: 161..161, insert: "bar", kind: Field, detail: "()", }, CompletionItem { label: "foo", - source_range: [161; 161), - delete: [161; 161), + source_range: 161..161, + delete: 161..161, insert: "foo", kind: Field, detail: "u32", @@ -109,8 +109,8 @@ mod tests { [ CompletionItem { label: "foo", - source_range: [171; 172), - delete: [171; 172), + source_range: 171..172, + delete: 171..172, insert: "foo", kind: Field, detail: "u32", @@ -145,16 +145,16 @@ mod tests { [ CompletionItem { label: "bar", - source_range: [372; 372), - delete: [372; 372), + source_range: 372..372, + delete: 372..372, insert: "bar", kind: Field, detail: "u32", }, CompletionItem { label: "baz", - source_range: [372; 372), - delete: [372; 372), + source_range: 372..372, + delete: 372..372, insert: "baz", kind: Field, detail: "u32", @@ -190,8 +190,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [142; 145), - delete: [142; 145), + source_range: 142..145, + delete: 142..145, insert: "the_field", kind: Field, detail: "u32", @@ -215,8 +215,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [83; 86), - delete: [83; 86), + source_range: 83..86, + delete: 83..86, insert: "the_field", kind: Field, detail: "u32", @@ -241,8 +241,8 @@ mod tests { [ CompletionItem { label: "a", - source_range: [119; 119), - delete: [119; 119), + source_range: 119..119, + delete: 119..119, insert: "a", kind: Field, detail: "u32", @@ -267,8 +267,8 @@ mod tests { [ CompletionItem { label: "b", - source_range: [119; 119), - delete: [119; 119), + source_range: 119..119, + delete: 119..119, insert: "b", kind: Field, detail: "u32", @@ -292,8 +292,8 @@ mod tests { [ CompletionItem { label: "a", - source_range: [93; 93), - delete: [93; 93), + source_range: 93..93, + delete: 93..93, insert: "a", kind: Field, detail: "u32", @@ -317,8 +317,8 @@ mod tests { [ CompletionItem { label: "the_field", - source_range: [137; 140), - delete: [137; 140), + source_range: 137..140, + delete: 137..140, insert: "the_field", kind: Field, detail: "u32", @@ -352,16 +352,16 @@ mod tests { [ CompletionItem { label: "bar", - source_range: [302; 302), - delete: [302; 302), + source_range: 302..302, + delete: 302..302, insert: "bar", kind: Field, detail: "u32", }, CompletionItem { label: "baz", - source_range: [302; 302), - delete: [302; 302), + source_range: 302..302, + delete: 302..302, insert: "baz", kind: Field, detail: "u32", @@ -393,8 +393,8 @@ mod tests { [ CompletionItem { label: "foo2", - source_range: [221; 221), - delete: [221; 221), + source_range: 221..221, + delete: 221..221, insert: "foo2", kind: Field, detail: "u32", diff --git a/crates/ra_ide/src/completion/complete_snippet.rs b/crates/ra_ide/src/completion/complete_snippet.rs index 4bccfbfed2..a3f5d1b6a0 100644 --- a/crates/ra_ide/src/completion/complete_snippet.rs +++ b/crates/ra_ide/src/completion/complete_snippet.rs @@ -67,15 +67,15 @@ mod tests { [ CompletionItem { label: "pd", - source_range: [17; 17), - delete: [17; 17), + source_range: 17..17, + delete: 17..17, insert: "eprintln!(\"$0 = {:?}\", $0);", kind: Snippet, }, CompletionItem { label: "ppd", - source_range: [17; 17), - delete: [17; 17), + source_range: 17..17, + delete: 17..17, insert: "eprintln!(\"$0 = {:#?}\", $0);", kind: Snippet, }, @@ -111,23 +111,23 @@ mod tests { [ CompletionItem { label: "Test function", - source_range: [78; 78), - delete: [78; 78), + source_range: 78..78, + delete: 78..78, insert: "#[test]\nfn ${1:feature}() {\n $0\n}", kind: Snippet, lookup: "tfn", }, CompletionItem { label: "macro_rules", - source_range: [78; 78), - delete: [78; 78), + source_range: 78..78, + delete: 78..78, insert: "macro_rules! $1 {\n\t($2) => {\n\t\t$0\n\t};\n}", kind: Snippet, }, CompletionItem { label: "pub(crate)", - source_range: [78; 78), - delete: [78; 78), + source_range: 78..78, + delete: 78..78, insert: "pub(crate) $0", kind: Snippet, }, diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index e2a8c59cde..ee32d1ff60 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs @@ -188,8 +188,7 @@ fn add_const_impl( if let Some(const_name) = const_name { let snippet = make_const_compl_syntax(&const_.source(ctx.db).value); - let range = - TextRange::new(const_def_node.text_range().start(), ctx.source_range().end()); + let range = TextRange::new(const_def_node.text_range().start(), ctx.source_range().end()); CompletionItem::new(CompletionKind::Magic, ctx.source_range(), snippet.clone()) .text_edit(TextEdit::replace(range, snippet)) @@ -254,24 +253,24 @@ mod tests { [ CompletionItem { label: "const TEST_CONST: u16 = ", - source_range: [209; 210), - delete: [209; 210), + source_range: 209..210, + delete: 209..210, insert: "const TEST_CONST: u16 = ", kind: Const, lookup: "TEST_CONST", }, CompletionItem { label: "fn test()", - source_range: [209; 210), - delete: [209; 210), + source_range: 209..210, + delete: 209..210, insert: "fn test() {\n $0\n}", kind: Function, lookup: "test", }, CompletionItem { label: "type TestType = ", - source_range: [209; 210), - delete: [209; 210), + source_range: 209..210, + delete: 209..210, insert: "type TestType = ", kind: TypeAlias, lookup: "TestType", @@ -320,8 +319,8 @@ mod tests { [ CompletionItem { label: "fn test()", - source_range: [139; 140), - delete: [139; 140), + source_range: 139..140, + delete: 139..140, insert: "fn test() {\n $0\n}", kind: Function, lookup: "test", @@ -349,8 +348,8 @@ mod tests { [ CompletionItem { label: "fn foo()", - source_range: [141; 142), - delete: [138; 142), + source_range: 141..142, + delete: 138..142, insert: "fn foo() {\n $0\n}", kind: Function, lookup: "foo", @@ -381,8 +380,8 @@ mod tests { [ CompletionItem { label: "fn foo_bar()", - source_range: [200; 201), - delete: [197; 201), + source_range: 200..201, + delete: 197..201, insert: "fn foo_bar() {\n $0\n}", kind: Function, lookup: "foo_bar", @@ -432,8 +431,8 @@ mod tests { [ CompletionItem { label: "fn foo()", - source_range: [144; 145), - delete: [141; 145), + source_range: 144..145, + delete: 141..145, insert: "fn foo() {\n $0\n}", kind: Function, lookup: "foo", @@ -461,8 +460,8 @@ mod tests { [ CompletionItem { label: "fn foo()", - source_range: [166; 167), - delete: [163; 167), + source_range: 166..167, + delete: 163..167, insert: "fn foo()\nwhere T: Into {\n $0\n}", kind: Function, lookup: "foo", @@ -488,8 +487,8 @@ mod tests { [ CompletionItem { label: "type SomeType = ", - source_range: [124; 125), - delete: [119; 125), + source_range: 124..125, + delete: 119..125, insert: "type SomeType = ", kind: TypeAlias, lookup: "SomeType", @@ -515,8 +514,8 @@ mod tests { [ CompletionItem { label: "const SOME_CONST: u16 = ", - source_range: [133; 134), - delete: [127; 134), + source_range: 133..134, + delete: 127..134, insert: "const SOME_CONST: u16 = ", kind: Const, lookup: "SOME_CONST", @@ -542,8 +541,8 @@ mod tests { [ CompletionItem { label: "const SOME_CONST: u16 = ", - source_range: [138; 139), - delete: [132; 139), + source_range: 138..139, + delete: 132..139, insert: "const SOME_CONST: u16 = ", kind: Const, lookup: "SOME_CONST", diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index 8e3dcf96e0..b2af81ae5b 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs @@ -85,8 +85,8 @@ mod tests { [ CompletionItem { label: "collections", - source_range: [21; 24), - delete: [21; 24), + source_range: 21..24, + delete: 21..24, insert: "collections", }, ] @@ -157,8 +157,8 @@ mod tests { [ CompletionItem { label: "Enum", - source_range: [231; 233), - delete: [231; 233), + source_range: 231..233, + delete: 231..233, insert: "Enum", kind: Enum, }, @@ -183,8 +183,8 @@ mod tests { [ CompletionItem { label: "quux(…)", - source_range: [91; 91), - delete: [91; 91), + source_range: 91..91, + delete: 91..91, insert: "quux(${1:x})$0", kind: Function, lookup: "quux", @@ -193,16 +193,16 @@ mod tests { }, CompletionItem { label: "x", - source_range: [91; 91), - delete: [91; 91), + source_range: 91..91, + delete: 91..91, insert: "x", kind: Binding, detail: "i32", }, CompletionItem { label: "y", - source_range: [91; 91), - delete: [91; 91), + source_range: 91..91, + delete: 91..91, insert: "y", kind: Binding, detail: "i32", @@ -232,23 +232,23 @@ mod tests { [ CompletionItem { label: "a", - source_range: [242; 242), - delete: [242; 242), + source_range: 242..242, + delete: 242..242, insert: "a", kind: Binding, }, CompletionItem { label: "b", - source_range: [242; 242), - delete: [242; 242), + source_range: 242..242, + delete: 242..242, insert: "b", kind: Binding, detail: "i32", }, CompletionItem { label: "quux()", - source_range: [242; 242), - delete: [242; 242), + source_range: 242..242, + delete: 242..242, insert: "quux()$0", kind: Function, lookup: "quux", @@ -275,8 +275,8 @@ mod tests { [ CompletionItem { label: "quux()", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "quux()$0", kind: Function, lookup: "quux", @@ -284,8 +284,8 @@ mod tests { }, CompletionItem { label: "x", - source_range: [95; 95), - delete: [95; 95), + source_range: 95..95, + delete: 95..95, insert: "x", kind: Binding, }, @@ -308,15 +308,15 @@ mod tests { [ CompletionItem { label: "T", - source_range: [52; 52), - delete: [52; 52), + source_range: 52..52, + delete: 52..52, insert: "T", kind: TypeParam, }, CompletionItem { label: "quux()", - source_range: [52; 52), - delete: [52; 52), + source_range: 52..52, + delete: 52..52, insert: "quux()$0", kind: Function, lookup: "quux", @@ -341,22 +341,22 @@ mod tests { [ CompletionItem { label: "Self", - source_range: [54; 54), - delete: [54; 54), + source_range: 54..54, + delete: 54..54, insert: "Self", kind: TypeParam, }, CompletionItem { label: "T", - source_range: [54; 54), - delete: [54; 54), + source_range: 54..54, + delete: 54..54, insert: "T", kind: TypeParam, }, CompletionItem { label: "X<…>", - source_range: [54; 54), - delete: [54; 54), + source_range: 54..54, + delete: 54..54, insert: "X<$0>", kind: Struct, lookup: "X", @@ -380,15 +380,15 @@ mod tests { [ CompletionItem { label: "Self", - source_range: [48; 48), - delete: [48; 48), + source_range: 48..48, + delete: 48..48, insert: "Self", kind: TypeParam, }, CompletionItem { label: "X", - source_range: [48; 48), - delete: [48; 48), + source_range: 48..48, + delete: 48..48, insert: "X", kind: Enum, }, @@ -413,22 +413,22 @@ mod tests { [ CompletionItem { label: "Baz", - source_range: [105; 105), - delete: [105; 105), + source_range: 105..105, + delete: 105..105, insert: "Baz", kind: Enum, }, CompletionItem { label: "Foo", - source_range: [105; 105), - delete: [105; 105), + source_range: 105..105, + delete: 105..105, insert: "Foo", kind: Struct, }, CompletionItem { label: "quux()", - source_range: [105; 105), - delete: [105; 105), + source_range: 105..105, + delete: 105..105, insert: "quux()$0", kind: Function, lookup: "quux", @@ -455,8 +455,8 @@ mod tests { [ CompletionItem { label: "other_crate", - source_range: [4; 4), - delete: [4; 4), + source_range: 4..4, + delete: 4..4, insert: "other_crate", kind: Module, }, @@ -481,15 +481,15 @@ mod tests { [ CompletionItem { label: "Bar", - source_range: [117; 117), - delete: [117; 117), + source_range: 117..117, + delete: 117..117, insert: "Bar", kind: Struct, }, CompletionItem { label: "quux()", - source_range: [117; 117), - delete: [117; 117), + source_range: 117..117, + delete: 117..117, insert: "quux()$0", kind: Function, lookup: "quux", @@ -513,15 +513,15 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [55; 55), - delete: [55; 55), + source_range: 55..55, + delete: 55..55, insert: "Foo", kind: Struct, }, CompletionItem { label: "x()", - source_range: [55; 55), - delete: [55; 55), + source_range: 55..55, + delete: 55..55, insert: "x()$0", kind: Function, lookup: "x", @@ -550,16 +550,16 @@ mod tests { [ CompletionItem { label: "bar", - source_range: [146; 146), - delete: [146; 146), + source_range: 146..146, + delete: 146..146, insert: "bar", kind: Binding, detail: "i32", }, CompletionItem { label: "foo()", - source_range: [146; 146), - delete: [146; 146), + source_range: 146..146, + delete: 146..146, insert: "foo()$0", kind: Function, lookup: "foo", @@ -578,15 +578,15 @@ mod tests { [ CompletionItem { label: "Self", - source_range: [25; 25), - delete: [25; 25), + source_range: 25..25, + delete: 25..25, insert: "Self", kind: TypeParam, }, CompletionItem { label: "self", - source_range: [25; 25), - delete: [25; 25), + source_range: 25..25, + delete: 25..25, insert: "self", kind: Binding, detail: "&{unknown}", @@ -617,15 +617,15 @@ mod tests { [ CompletionItem { label: "Option", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "Option", kind: Struct, }, CompletionItem { label: "foo()", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "foo()$0", kind: Function, lookup: "foo", @@ -633,8 +633,8 @@ mod tests { }, CompletionItem { label: "std", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "std", kind: Module, }, @@ -672,22 +672,22 @@ mod tests { [ CompletionItem { label: "String", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "String", kind: Struct, }, CompletionItem { label: "core", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "core", kind: Module, }, CompletionItem { label: "foo()", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "foo()$0", kind: Function, lookup: "foo", @@ -695,8 +695,8 @@ mod tests { }, CompletionItem { label: "std", - source_range: [18; 18), - delete: [18; 18), + source_range: 18..18, + delete: 18..18, insert: "std", kind: Module, }, @@ -742,46 +742,46 @@ mod tests { [ CompletionItem { label: "bar!(…)", - source_range: [252; 252), - delete: [252; 252), + source_range: 252..252, + delete: 252..252, insert: "bar!($0)", kind: Macro, detail: "macro_rules! bar", }, CompletionItem { label: "baz!(…)", - source_range: [252; 252), - delete: [252; 252), + source_range: 252..252, + delete: 252..252, insert: "baz!($0)", kind: Macro, detail: "#[macro_export]\nmacro_rules! baz", }, CompletionItem { label: "foo!(…)", - source_range: [252; 252), - delete: [252; 252), + source_range: 252..252, + delete: 252..252, insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, CompletionItem { label: "m1", - source_range: [252; 252), - delete: [252; 252), + source_range: 252..252, + delete: 252..252, insert: "m1", kind: Module, }, CompletionItem { label: "m2", - source_range: [252; 252), - delete: [252; 252), + source_range: 252..252, + delete: 252..252, insert: "m2", kind: Module, }, CompletionItem { label: "main()", - source_range: [252; 252), - delete: [252; 252), + source_range: 252..252, + delete: 252..252, insert: "main()$0", kind: Function, lookup: "main", @@ -811,16 +811,16 @@ mod tests { [ CompletionItem { label: "foo!(…)", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, CompletionItem { label: "foo()", - source_range: [49; 49), - delete: [49; 49), + source_range: 49..49, + delete: 49..49, insert: "foo()$0", kind: Function, lookup: "foo", @@ -850,16 +850,16 @@ mod tests { [ CompletionItem { label: "foo!(…)", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, CompletionItem { label: "main()", - source_range: [57; 57), - delete: [57; 57), + source_range: 57..57, + delete: 57..57, insert: "main()$0", kind: Function, lookup: "main", @@ -889,16 +889,16 @@ mod tests { [ CompletionItem { label: "foo!(…)", - source_range: [50; 50), - delete: [50; 50), + source_range: 50..50, + delete: 50..50, insert: "foo!($0)", kind: Macro, detail: "macro_rules! foo", }, CompletionItem { label: "main()", - source_range: [50; 50), - delete: [50; 50), + source_range: 50..50, + delete: 50..50, insert: "main()$0", kind: Function, lookup: "main", @@ -925,8 +925,8 @@ mod tests { [ CompletionItem { label: "frobnicate()", - source_range: [23; 24), - delete: [23; 24), + source_range: 23..24, + delete: 23..24, insert: "frobnicate()$0", kind: Function, lookup: "frobnicate", @@ -934,8 +934,8 @@ mod tests { }, CompletionItem { label: "main()", - source_range: [23; 24), - delete: [23; 24), + source_range: 23..24, + delete: 23..24, insert: "main()$0", kind: Function, lookup: "main", @@ -962,16 +962,16 @@ mod tests { [ CompletionItem { label: "m!(…)", - source_range: [145; 145), - delete: [145; 145), + source_range: 145..145, + delete: 145..145, insert: "m!($0)", kind: Macro, detail: "macro_rules! m", }, CompletionItem { label: "quux(…)", - source_range: [145; 145), - delete: [145; 145), + source_range: 145..145, + delete: 145..145, insert: "quux(${1:x})$0", kind: Function, lookup: "quux", @@ -980,16 +980,16 @@ mod tests { }, CompletionItem { label: "x", - source_range: [145; 145), - delete: [145; 145), + source_range: 145..145, + delete: 145..145, insert: "x", kind: Binding, detail: "i32", }, CompletionItem { label: "y", - source_range: [145; 145), - delete: [145; 145), + source_range: 145..145, + delete: 145..145, insert: "y", kind: Binding, detail: "i32", @@ -1015,16 +1015,16 @@ mod tests { [ CompletionItem { label: "m!(…)", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "m!($0)", kind: Macro, detail: "macro_rules! m", }, CompletionItem { label: "quux(…)", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "quux(${1:x})$0", kind: Function, lookup: "quux", @@ -1033,16 +1033,16 @@ mod tests { }, CompletionItem { label: "x", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "x", kind: Binding, detail: "i32", }, CompletionItem { label: "y", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "y", kind: Binding, detail: "i32", @@ -1068,16 +1068,16 @@ mod tests { [ CompletionItem { label: "m!(…)", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "m!($0)", kind: Macro, detail: "macro_rules! m", }, CompletionItem { label: "quux(…)", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "quux(${1:x})$0", kind: Function, lookup: "quux", @@ -1086,16 +1086,16 @@ mod tests { }, CompletionItem { label: "x", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "x", kind: Binding, detail: "i32", }, CompletionItem { label: "y", - source_range: [145; 146), - delete: [145; 146), + source_range: 145..146, + delete: 145..146, insert: "y", kind: Binding, detail: "i32", @@ -1121,14 +1121,14 @@ mod tests { [ CompletionItem { label: "Quux", - source_range: [82; 82), - delete: [82; 82), + source_range: 82..82, + delete: 82..82, insert: "Quux", }, CompletionItem { label: "main()", - source_range: [82; 82), - delete: [82; 82), + source_range: 82..82, + delete: 82..82, insert: "main()$0", kind: Function, lookup: "main", @@ -1162,31 +1162,31 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [248; 250), - delete: [248; 250), + source_range: 248..250, + delete: 248..250, insert: "Foo", kind: Enum, }, CompletionItem { label: "Foo::Bar", - source_range: [248; 250), - delete: [248; 250), + source_range: 248..250, + delete: 248..250, insert: "Foo::Bar", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Foo::Baz", - source_range: [248; 250), - delete: [248; 250), + source_range: 248..250, + delete: 248..250, insert: "Foo::Baz", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Foo::Quux", - source_range: [248; 250), - delete: [248; 250), + source_range: 248..250, + delete: 248..250, insert: "Foo::Quux", kind: EnumVariant, detail: "()", @@ -1220,31 +1220,31 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [219; 221), - delete: [219; 221), + source_range: 219..221, + delete: 219..221, insert: "Foo", kind: Enum, }, CompletionItem { label: "Foo::Bar", - source_range: [219; 221), - delete: [219; 221), + source_range: 219..221, + delete: 219..221, insert: "Foo::Bar", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Foo::Baz", - source_range: [219; 221), - delete: [219; 221), + source_range: 219..221, + delete: 219..221, insert: "Foo::Baz", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Foo::Quux", - source_range: [219; 221), - delete: [219; 221), + source_range: 219..221, + delete: 219..221, insert: "Foo::Quux", kind: EnumVariant, detail: "()", @@ -1274,39 +1274,39 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [185; 186), - delete: [185; 186), + source_range: 185..186, + delete: 185..186, insert: "Foo", kind: Enum, }, CompletionItem { label: "Foo::Bar", - source_range: [185; 186), - delete: [185; 186), + source_range: 185..186, + delete: 185..186, insert: "Foo::Bar", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Foo::Baz", - source_range: [185; 186), - delete: [185; 186), + source_range: 185..186, + delete: 185..186, insert: "Foo::Baz", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Foo::Quux", - source_range: [185; 186), - delete: [185; 186), + source_range: 185..186, + delete: 185..186, insert: "Foo::Quux", kind: EnumVariant, detail: "()", }, CompletionItem { label: "main()", - source_range: [185; 186), - delete: [185; 186), + source_range: 185..186, + delete: 185..186, insert: "main()$0", kind: Function, lookup: "main", diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs index 6a6ddc7bd8..9f9f06bf05 100644 --- a/crates/ra_ide/src/completion/presentation.rs +++ b/crates/ra_ide/src/completion/presentation.rs @@ -452,8 +452,8 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [121; 123), - delete: [121; 123), + source_range: 121..123, + delete: 121..123, insert: "Foo", kind: EnumVariant, detail: "{ x: i32, y: i32 }", @@ -478,8 +478,8 @@ mod tests { [ CompletionItem { label: "Foo(…)", - source_range: [115; 117), - delete: [115; 117), + source_range: 115..117, + delete: 115..117, insert: "Foo($0)", kind: EnumVariant, lookup: "Foo", @@ -506,8 +506,8 @@ mod tests { [ CompletionItem { label: "Foo", - source_range: [104; 106), - delete: [104; 106), + source_range: 104..106, + delete: 104..106, insert: "Foo", kind: EnumVariant, detail: "()", @@ -534,8 +534,8 @@ mod tests { [ CompletionItem { label: "main()", - source_range: [203; 206), - delete: [203; 206), + source_range: 203..206, + delete: 203..206, insert: "main()$0", kind: Function, lookup: "main", @@ -543,8 +543,8 @@ mod tests { }, CompletionItem { label: "something_deprecated()", - source_range: [203; 206), - delete: [203; 206), + source_range: 203..206, + delete: 203..206, insert: "something_deprecated()$0", kind: Function, lookup: "something_deprecated", @@ -553,8 +553,8 @@ mod tests { }, CompletionItem { label: "something_else_deprecated()", - source_range: [203; 206), - delete: [203; 206), + source_range: 203..206, + delete: 203..206, insert: "something_else_deprecated()$0", kind: Function, lookup: "something_else_deprecated", @@ -580,8 +580,8 @@ mod tests { [ CompletionItem { label: "main()", - source_range: [61; 64), - delete: [61; 64), + source_range: 61..64, + delete: 61..64, insert: "main()$0", kind: Function, lookup: "main", @@ -589,8 +589,8 @@ mod tests { }, CompletionItem { label: "no_args()", - source_range: [61; 64), - delete: [61; 64), + source_range: 61..64, + delete: 61..64, insert: "no_args()$0", kind: Function, lookup: "no_args", @@ -610,8 +610,8 @@ mod tests { [ CompletionItem { label: "main()", - source_range: [80; 85), - delete: [80; 85), + source_range: 80..85, + delete: 80..85, insert: "main()$0", kind: Function, lookup: "main", @@ -619,8 +619,8 @@ mod tests { }, CompletionItem { label: "with_args(…)", - source_range: [80; 85), - delete: [80; 85), + source_range: 80..85, + delete: 80..85, insert: "with_args(${1:x}, ${2:y})$0", kind: Function, lookup: "with_args", @@ -646,8 +646,8 @@ mod tests { [ CompletionItem { label: "foo()", - source_range: [163; 164), - delete: [163; 164), + source_range: 163..164, + delete: 163..164, insert: "foo()$0", kind: Method, lookup: "foo", @@ -674,23 +674,23 @@ mod tests { [ CompletionItem { label: "None", - source_range: [144; 147), - delete: [144; 147), + source_range: 144..147, + delete: 144..147, insert: "None", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Option", - source_range: [144; 147), - delete: [144; 147), + source_range: 144..147, + delete: 144..147, insert: "Option", kind: Enum, }, CompletionItem { label: "Some(…)", - source_range: [144; 147), - delete: [144; 147), + source_range: 144..147, + delete: 144..147, insert: "Some($0)", kind: EnumVariant, lookup: "Some", @@ -699,8 +699,8 @@ mod tests { }, CompletionItem { label: "main()", - source_range: [144; 147), - delete: [144; 147), + source_range: 144..147, + delete: 144..147, insert: "main()$0", kind: Function, lookup: "main", @@ -725,23 +725,23 @@ mod tests { [ CompletionItem { label: "None", - source_range: [185; 188), - delete: [185; 188), + source_range: 185..188, + delete: 185..188, insert: "None", kind: EnumVariant, detail: "()", }, CompletionItem { label: "Option", - source_range: [185; 188), - delete: [185; 188), + source_range: 185..188, + delete: 185..188, insert: "Option", kind: Enum, }, CompletionItem { label: "Some(…)", - source_range: [185; 188), - delete: [185; 188), + source_range: 185..188, + delete: 185..188, insert: "Some($0)", kind: EnumVariant, lookup: "Some", @@ -771,8 +771,8 @@ mod tests { [ CompletionItem { label: "foo(…)", - source_range: [171; 172), - delete: [171; 172), + source_range: 171..172, + delete: 171..172, insert: "foo(${1:x})$0", kind: Method, lookup: "foo", @@ -806,8 +806,8 @@ mod tests { [ CompletionItem { label: "foo(…)", - source_range: [171; 172), - delete: [171; 172), + source_range: 171..172, + delete: 171..172, insert: "foo($0)", kind: Method, lookup: "foo", @@ -833,8 +833,8 @@ mod tests { [ CompletionItem { label: "foo", - source_range: [40; 41), - delete: [40; 41), + source_range: 40..41, + delete: 40..41, insert: "foo", kind: Function, detail: "pub fn foo()", @@ -860,16 +860,16 @@ mod tests { [ CompletionItem { label: "frobnicate", - source_range: [35; 39), - delete: [35; 39), + source_range: 35..39, + delete: 35..39, insert: "frobnicate", kind: Function, detail: "fn frobnicate()", }, CompletionItem { label: "main", - source_range: [35; 39), - delete: [35; 39), + source_range: 35..39, + delete: 35..39, insert: "main", kind: Function, detail: "fn main()", @@ -892,8 +892,8 @@ mod tests { [ CompletionItem { label: "new", - source_range: [67; 69), - delete: [67; 69), + source_range: 67..69, + delete: 67..69, insert: "new", kind: Function, detail: "fn new() -> Foo", @@ -917,16 +917,16 @@ mod tests { [ CompletionItem { label: "Vec<…>", - source_range: [61; 63), - delete: [61; 63), + source_range: 61..63, + delete: 61..63, insert: "Vec<$0>", kind: Struct, lookup: "Vec", }, CompletionItem { label: "foo(…)", - source_range: [61; 63), - delete: [61; 63), + source_range: 61..63, + delete: 61..63, insert: "foo(${1:xs})$0", kind: Function, lookup: "foo", @@ -947,16 +947,16 @@ mod tests { [ CompletionItem { label: "Vec<…>", - source_range: [64; 66), - delete: [64; 66), + source_range: 64..66, + delete: 64..66, insert: "Vec<$0>", kind: TypeAlias, lookup: "Vec", }, CompletionItem { label: "foo(…)", - source_range: [64; 66), - delete: [64; 66), + source_range: 64..66, + delete: 64..66, insert: "foo(${1:xs})$0", kind: Function, lookup: "foo", @@ -977,15 +977,15 @@ mod tests { [ CompletionItem { label: "Vec", - source_range: [68; 70), - delete: [68; 70), + source_range: 68..70, + delete: 68..70, insert: "Vec", kind: Struct, }, CompletionItem { label: "foo(…)", - source_range: [68; 70), - delete: [68; 70), + source_range: 68..70, + delete: 68..70, insert: "foo(${1:xs})$0", kind: Function, lookup: "foo", @@ -1006,15 +1006,15 @@ mod tests { [ CompletionItem { label: "Vec", - source_range: [61; 63), - delete: [61; 63), + source_range: 61..63, + delete: 61..63, insert: "Vec", kind: Struct, }, CompletionItem { label: "foo(…)", - source_range: [61; 63), - delete: [61; 63), + source_range: 61..63, + delete: 61..63, insert: "foo(${1:xs})$0", kind: Function, lookup: "foo", @@ -1046,8 +1046,8 @@ mod tests { [ CompletionItem { label: "frobnicate!", - source_range: [9; 9), - delete: [9; 9), + source_range: 9..9, + delete: 9..9, insert: "frobnicate", kind: Macro, detail: "#[macro_export]\nmacro_rules! frobnicate", @@ -1072,16 +1072,16 @@ mod tests { [ CompletionItem { label: "frobnicate!", - source_range: [56; 60), - delete: [56; 60), + source_range: 56..60, + delete: 56..60, insert: "frobnicate", kind: Macro, detail: "macro_rules! frobnicate", }, CompletionItem { label: "main()", - source_range: [56; 60), - delete: [56; 60), + source_range: 56..60, + delete: 56..60, insert: "main()$0", kind: Function, lookup: "main", @@ -1109,24 +1109,24 @@ mod tests { [ CompletionItem { label: "another_field", - source_range: [201; 201), - delete: [201; 201), + source_range: 201..201, + delete: 201..201, insert: "another_field", kind: Field, detail: "i64", }, CompletionItem { label: "my_string", - source_range: [201; 201), - delete: [201; 201), + source_range: 201..201, + delete: 201..201, insert: "my_string", kind: Field, detail: "{unknown}", }, CompletionItem { label: "the_field", - source_range: [201; 201), - delete: [201; 201), + source_range: 201..201, + delete: 201..201, insert: "the_field", kind: Field, detail: "u32", @@ -1153,16 +1153,16 @@ mod tests { [ CompletionItem { label: "another_field", - source_range: [208; 208), - delete: [208; 208), + source_range: 208..208, + delete: 208..208, insert: "another_field", kind: Field, detail: "i64", }, CompletionItem { label: "another_good_type", - source_range: [208; 208), - delete: [208; 208), + source_range: 208..208, + delete: 208..208, insert: "another_good_type", kind: Field, detail: "u32", @@ -1170,8 +1170,8 @@ mod tests { }, CompletionItem { label: "the_field", - source_range: [208; 208), - delete: [208; 208), + source_range: 208..208, + delete: 208..208, insert: "the_field", kind: Field, detail: "u32", @@ -1201,16 +1201,16 @@ mod tests { [ CompletionItem { label: "another_field", - source_range: [270; 270), - delete: [270; 270), + source_range: 270..270, + delete: 270..270, insert: "another_field", kind: Field, detail: "i64", }, CompletionItem { label: "another_good_type", - source_range: [270; 270), - delete: [270; 270), + source_range: 270..270, + delete: 270..270, insert: "another_good_type", kind: Field, detail: "u32", @@ -1218,8 +1218,8 @@ mod tests { }, CompletionItem { label: "the_field", - source_range: [270; 270), - delete: [270; 270), + source_range: 270..270, + delete: 270..270, insert: "the_field", kind: Field, detail: "u32", @@ -1249,8 +1249,8 @@ mod tests { [ CompletionItem { label: "another_field", - source_range: [336; 336), - delete: [336; 336), + source_range: 336..336, + delete: 336..336, insert: "another_field", kind: Field, detail: "i64", @@ -1258,16 +1258,16 @@ mod tests { }, CompletionItem { label: "another_good_type", - source_range: [336; 336), - delete: [336; 336), + source_range: 336..336, + delete: 336..336, insert: "another_good_type", kind: Field, detail: "u32", }, CompletionItem { label: "the_field", - source_range: [336; 336), - delete: [336; 336), + source_range: 336..336, + delete: 336..336, insert: "the_field", kind: Field, detail: "u32", @@ -1296,16 +1296,16 @@ mod tests { [ CompletionItem { label: "another_field", - source_range: [328; 328), - delete: [328; 328), + source_range: 328..328, + delete: 328..328, insert: "another_field", kind: Field, detail: "i64", }, CompletionItem { label: "another_good_type", - source_range: [328; 328), - delete: [328; 328), + source_range: 328..328, + delete: 328..328, insert: "another_good_type", kind: Field, detail: "u32", @@ -1313,8 +1313,8 @@ mod tests { }, CompletionItem { label: "the_field", - source_range: [328; 328), - delete: [328; 328), + source_range: 328..328, + delete: 328..328, insert: "the_field", kind: Field, detail: "u32", diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs index adfb1b9b2d..a6b4c2c284 100644 --- a/crates/ra_ide/src/diagnostics.rs +++ b/crates/ra_ide/src/diagnostics.rs @@ -277,7 +277,7 @@ mod tests { assert!( diagnostic.range.start() <= file_position.offset && diagnostic.range.end() >= file_position.offset, - "diagnostic range {} does not touch cursor position {}", + "diagnostic range {:?} does not touch cursor position {:?}", diagnostic.range, file_position.offset ); @@ -603,7 +603,7 @@ mod tests { [ Diagnostic { message: "unresolved module", - range: [0; 8), + range: 0..8, fix: Some( SourceChange { label: "create module", @@ -652,7 +652,7 @@ mod tests { [ Diagnostic { message: "Missing structure fields:\n- b", - range: [224; 233), + range: 224..233, fix: Some( SourceChange { label: "fill struct fields", @@ -664,7 +664,7 @@ mod tests { edit: TextEdit { atoms: [ AtomTextEdit { - delete: [3; 9), + delete: 3..9, insert: "{a:42, b: ()}", }, ], diff --git a/crates/ra_ide/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs index 7a774785c0..967eee5d23 100644 --- a/crates/ra_ide/src/display/structure.rs +++ b/crates/ra_ide/src/display/structure.rs @@ -224,8 +224,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "Foo", - navigation_range: [8; 11), - node_range: [1; 26), + navigation_range: 8..11, + node_range: 1..26, kind: STRUCT_DEF, detail: None, deprecated: false, @@ -235,8 +235,8 @@ fn very_obsolete() {} 0, ), label: "x", - navigation_range: [18; 19), - node_range: [18; 24), + navigation_range: 18..19, + node_range: 18..24, kind: RECORD_FIELD_DEF, detail: Some( "i32", @@ -246,8 +246,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "m", - navigation_range: [32; 33), - node_range: [28; 158), + navigation_range: 32..33, + node_range: 28..158, kind: MODULE, detail: None, deprecated: false, @@ -257,8 +257,8 @@ fn very_obsolete() {} 2, ), label: "bar1", - navigation_range: [43; 47), - node_range: [40; 52), + navigation_range: 43..47, + node_range: 40..52, kind: FN_DEF, detail: Some( "fn()", @@ -270,8 +270,8 @@ fn very_obsolete() {} 2, ), label: "bar2", - navigation_range: [60; 64), - node_range: [57; 81), + navigation_range: 60..64, + node_range: 57..81, kind: FN_DEF, detail: Some( "fn(t: T) -> T", @@ -283,8 +283,8 @@ fn very_obsolete() {} 2, ), label: "bar3", - navigation_range: [89; 93), - node_range: [86; 156), + navigation_range: 89..93, + node_range: 86..156, kind: FN_DEF, detail: Some( "fn(a: A, b: B) -> Vec< u32 >", @@ -294,8 +294,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "E", - navigation_range: [165; 166), - node_range: [160; 180), + navigation_range: 165..166, + node_range: 160..180, kind: ENUM_DEF, detail: None, deprecated: false, @@ -305,8 +305,8 @@ fn very_obsolete() {} 6, ), label: "X", - navigation_range: [169; 170), - node_range: [169; 170), + navigation_range: 169..170, + node_range: 169..170, kind: ENUM_VARIANT, detail: None, deprecated: false, @@ -316,8 +316,8 @@ fn very_obsolete() {} 6, ), label: "Y", - navigation_range: [172; 173), - node_range: [172; 178), + navigation_range: 172..173, + node_range: 172..178, kind: ENUM_VARIANT, detail: None, deprecated: false, @@ -325,8 +325,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "T", - navigation_range: [186; 187), - node_range: [181; 193), + navigation_range: 186..187, + node_range: 181..193, kind: TYPE_ALIAS_DEF, detail: Some( "()", @@ -336,8 +336,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "S", - navigation_range: [201; 202), - node_range: [194; 213), + navigation_range: 201..202, + node_range: 194..213, kind: STATIC_DEF, detail: Some( "i32", @@ -347,8 +347,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "C", - navigation_range: [220; 221), - node_range: [214; 232), + navigation_range: 220..221, + node_range: 214..232, kind: CONST_DEF, detail: Some( "i32", @@ -358,8 +358,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "impl E", - navigation_range: [239; 240), - node_range: [234; 243), + navigation_range: 239..240, + node_range: 234..243, kind: IMPL_DEF, detail: None, deprecated: false, @@ -367,8 +367,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "impl fmt::Debug for E", - navigation_range: [265; 266), - node_range: [245; 269), + navigation_range: 265..266, + node_range: 245..269, kind: IMPL_DEF, detail: None, deprecated: false, @@ -376,8 +376,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "mc", - navigation_range: [284; 286), - node_range: [271; 303), + navigation_range: 284..286, + node_range: 271..303, kind: MACRO_CALL, detail: None, deprecated: false, @@ -385,8 +385,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "mcexp", - navigation_range: [334; 339), - node_range: [305; 356), + navigation_range: 334..339, + node_range: 305..356, kind: MACRO_CALL, detail: None, deprecated: false, @@ -394,8 +394,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "mcexp", - navigation_range: [387; 392), - node_range: [358; 409), + navigation_range: 387..392, + node_range: 358..409, kind: MACRO_CALL, detail: None, deprecated: false, @@ -403,8 +403,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "obsolete", - navigation_range: [428; 436), - node_range: [411; 441), + navigation_range: 428..436, + node_range: 411..441, kind: FN_DEF, detail: Some( "fn()", @@ -414,8 +414,8 @@ fn very_obsolete() {} StructureNode { parent: None, label: "very_obsolete", - navigation_range: [481; 494), - node_range: [443; 499), + navigation_range: 481..494, + node_range: 443..499, kind: FN_DEF, detail: Some( "fn()", diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index 9f329b5d37..554594a436 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs @@ -316,7 +316,7 @@ mod tests { fn do_check(before: &str, afters: &[&str]) { let (cursor, before) = extract_offset(before); let (analysis, file_id) = single_file(&before); - let range = TextRange::offset_len(cursor, 0.into()); + let range = TextRange::empty(cursor); let mut frange = FileRange { file_id, range }; for &after in afters { diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 034c4c7d47..4379005aa6 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs @@ -187,10 +187,7 @@ fn contiguous_range_for_comment( } if first != last { - Some(TextRange::new( - first.syntax().text_range().start(), - last.syntax().text_range().end(), - )) + Some(TextRange::new(first.syntax().text_range().start(), last.syntax().text_range().end())) } else { // The group consists of only one element, therefore it cannot be folded None diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index 9998ca5a3d..1dfca819d5 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs @@ -140,7 +140,7 @@ mod tests { struct Foo; enum E { X(Foo<|>) } ", - "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..11 7..10", "struct Foo;|Foo", ); } @@ -153,7 +153,7 @@ mod tests { struct Foo; enum E { X(<|>Foo) } ", - "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..11 7..10", "struct Foo;|Foo", ); } @@ -174,7 +174,7 @@ mod tests { //- /b.rs struct Foo; ", - "Foo STRUCT_DEF FileId(2) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(2) 0..11 7..10", "struct Foo;|Foo", ); } @@ -189,7 +189,7 @@ mod tests { //- /foo.rs // empty ", - "foo SOURCE_FILE FileId(2) [0; 10)", + "foo SOURCE_FILE FileId(2) 0..10", "// empty\n\n", ); @@ -201,7 +201,7 @@ mod tests { //- /foo/mod.rs // empty ", - "foo SOURCE_FILE FileId(2) [0; 10)", + "foo SOURCE_FILE FileId(2) 0..10", "// empty\n\n", ); } @@ -218,7 +218,7 @@ mod tests { <|>foo!(); } ", - "foo MACRO_CALL FileId(1) [0; 33) [13; 16)", + "foo MACRO_CALL FileId(1) 0..33 13..16", "macro_rules! foo { () => { () } }|foo", ); } @@ -238,7 +238,7 @@ mod tests { #[macro_export] macro_rules! foo { () => { () } } ", - "foo MACRO_CALL FileId(2) [0; 49) [29; 32)", + "foo MACRO_CALL FileId(2) 0..49 29..32", "#[macro_export]\nmacro_rules! foo { () => { () } }|foo", ); } @@ -254,7 +254,7 @@ mod tests { #[macro_export] macro_rules! foo { () => { () } } ", - "foo MACRO_CALL FileId(2) [0; 49) [29; 32)", + "foo MACRO_CALL FileId(2) 0..49 29..32", "#[macro_export]\nmacro_rules! foo { () => { () } }|foo", ); } @@ -274,7 +274,7 @@ mod tests { <|>foo(); } ", - "foo FN_DEF FileId(1) [64; 80) [75; 78)", + "foo FN_DEF FileId(1) 64..80 75..78", "define_fn!(foo);|foo", ); } @@ -294,7 +294,7 @@ mod tests { <|>foo(); } ", - "foo FN_DEF FileId(1) [51; 64) [51; 64)", + "foo FN_DEF FileId(1) 51..64 51..64", "define_fn!();|define_fn!();", ); } @@ -312,7 +312,7 @@ mod tests { } } ", - "foo MACRO_CALL FileId(1) [0; 28) [13; 16)", + "foo MACRO_CALL FileId(1) 0..28 13..16", "macro_rules! foo {() => {0}}|foo", ); } @@ -330,7 +330,7 @@ mod tests { } } ", - "foo MACRO_CALL FileId(1) [0; 28) [13; 16)", + "foo MACRO_CALL FileId(1) 0..28 13..16", "macro_rules! foo {() => {0}}|foo", ); } @@ -350,7 +350,7 @@ mod tests { foo.frobnicate<|>(); } ", - "frobnicate FN_DEF FileId(1) [27; 51) [30; 40)", + "frobnicate FN_DEF FileId(1) 27..51 30..40", "fn frobnicate(&self) { }|frobnicate", ); } @@ -369,7 +369,7 @@ mod tests { foo.spam<|>; } ", - "spam RECORD_FIELD_DEF FileId(1) [17; 26) [17; 21)", + "spam RECORD_FIELD_DEF FileId(1) 17..26 17..21", "spam: u32|spam", ); } @@ -390,7 +390,7 @@ mod tests { } } ", - "spam RECORD_FIELD_DEF FileId(1) [17; 26) [17; 21)", + "spam RECORD_FIELD_DEF FileId(1) 17..26 17..21", "spam: u32|spam", ); } @@ -409,7 +409,7 @@ mod tests { let Foo { spam<|>: _, } = foo } ", - "spam RECORD_FIELD_DEF FileId(1) [17; 26) [17; 21)", + "spam RECORD_FIELD_DEF FileId(1) 17..26 17..21", "spam: u32|spam", ); } @@ -426,7 +426,7 @@ mod tests { Foo { spam<|>: m!() } } ", - "spam RECORD_FIELD_DEF FileId(1) [45; 54) [45; 49)", + "spam RECORD_FIELD_DEF FileId(1) 45..54 45..49", "spam: u32|spam", ); } @@ -443,7 +443,7 @@ mod tests { foo.<|>0; } ", - "TUPLE_FIELD_DEF FileId(1) [11; 14)", + "TUPLE_FIELD_DEF FileId(1) 11..14", "u32", ); } @@ -462,7 +462,7 @@ mod tests { Foo::frobnicate<|>(); } ", - "frobnicate FN_DEF FileId(1) [27; 46) [30; 40)", + "frobnicate FN_DEF FileId(1) 27..46 30..40", "fn frobnicate() { }|frobnicate", ); } @@ -480,7 +480,7 @@ mod tests { Foo::frobnicate<|>(); } ", - "frobnicate FN_DEF FileId(1) [16; 32) [19; 29)", + "frobnicate FN_DEF FileId(1) 16..32 19..29", "fn frobnicate();|frobnicate", ); } @@ -500,7 +500,7 @@ mod tests { Foo::frobnicate<|>(); } ", - "frobnicate FN_DEF FileId(1) [30; 46) [33; 43)", + "frobnicate FN_DEF FileId(1) 30..46 33..43", "fn frobnicate();|frobnicate", ); } @@ -517,7 +517,7 @@ mod tests { } } ", - "impl IMPL_DEF FileId(1) [12; 73)", + "impl IMPL_DEF FileId(1) 12..73", "impl Foo {...}", ); @@ -531,7 +531,7 @@ mod tests { } } ", - "impl IMPL_DEF FileId(1) [12; 73)", + "impl IMPL_DEF FileId(1) 12..73", "impl Foo {...}", ); @@ -545,7 +545,7 @@ mod tests { } } ", - "impl IMPL_DEF FileId(1) [15; 75)", + "impl IMPL_DEF FileId(1) 15..75", "impl Foo {...}", ); @@ -558,7 +558,7 @@ mod tests { } } ", - "impl IMPL_DEF FileId(1) [15; 62)", + "impl IMPL_DEF FileId(1) 15..62", "impl Foo {...}", ); } @@ -578,7 +578,7 @@ mod tests { } } ", - "impl IMPL_DEF FileId(1) [49; 115)", + "impl IMPL_DEF FileId(1) 49..115", "impl Make for Foo {...}", ); @@ -595,7 +595,7 @@ mod tests { } } ", - "impl IMPL_DEF FileId(1) [49; 115)", + "impl IMPL_DEF FileId(1) 49..115", "impl Make for Foo {...}", ); } @@ -607,7 +607,7 @@ mod tests { //- /lib.rs struct Foo<|> { value: u32 } ", - "Foo STRUCT_DEF FileId(1) [0; 25) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..25 7..10", "struct Foo { value: u32 }|Foo", ); @@ -618,7 +618,7 @@ mod tests { field<|>: string, } "#, - "field RECORD_FIELD_DEF FileId(1) [17; 30) [17; 22)", + "field RECORD_FIELD_DEF FileId(1) 17..30 17..22", "field: string|field", ); @@ -627,7 +627,7 @@ mod tests { //- /lib.rs fn foo_test<|>() { } ", - "foo_test FN_DEF FileId(1) [0; 17) [3; 11)", + "foo_test FN_DEF FileId(1) 0..17 3..11", "fn foo_test() { }|foo_test", ); @@ -638,7 +638,7 @@ mod tests { Variant, } ", - "Foo ENUM_DEF FileId(1) [0; 25) [5; 8)", + "Foo ENUM_DEF FileId(1) 0..25 5..8", "enum Foo {...}|Foo", ); @@ -651,7 +651,7 @@ mod tests { Variant3, } ", - "Variant2 ENUM_VARIANT FileId(1) [29; 37) [29; 37)", + "Variant2 ENUM_VARIANT FileId(1) 29..37 29..37", "Variant2|Variant2", ); @@ -660,7 +660,7 @@ mod tests { //- /lib.rs static INNER<|>: &str = ""; "#, - "INNER STATIC_DEF FileId(1) [0; 24) [7; 12)", + "INNER STATIC_DEF FileId(1) 0..24 7..12", "static INNER: &str = \"\";|INNER", ); @@ -669,7 +669,7 @@ mod tests { //- /lib.rs const INNER<|>: &str = ""; "#, - "INNER CONST_DEF FileId(1) [0; 23) [6; 11)", + "INNER CONST_DEF FileId(1) 0..23 6..11", "const INNER: &str = \"\";|INNER", ); @@ -678,7 +678,7 @@ mod tests { //- /lib.rs type Thing<|> = Option<()>; "#, - "Thing TYPE_ALIAS_DEF FileId(1) [0; 24) [5; 10)", + "Thing TYPE_ALIAS_DEF FileId(1) 0..24 5..10", "type Thing = Option<()>;|Thing", ); @@ -687,7 +687,7 @@ mod tests { //- /lib.rs trait Foo<|> { } "#, - "Foo TRAIT_DEF FileId(1) [0; 13) [6; 9)", + "Foo TRAIT_DEF FileId(1) 0..13 6..9", "trait Foo { }|Foo", ); @@ -696,7 +696,7 @@ mod tests { //- /lib.rs mod bar<|> { } "#, - "bar MODULE FileId(1) [0; 11) [4; 7)", + "bar MODULE FileId(1) 0..11 4..7", "mod bar { }|bar", ); } @@ -717,7 +717,7 @@ mod tests { } mod confuse_index { fn foo(); } ", - "foo FN_DEF FileId(1) [52; 63) [55; 58)", + "foo FN_DEF FileId(1) 52..63 55..58", "fn foo() {}|foo", ); } @@ -746,7 +746,7 @@ mod tests { format!(\"{}\", fo<|>o()) } ", - "foo FN_DEF FileId(1) [398; 415) [401; 404)", + "foo FN_DEF FileId(1) 398..415 401..404", "fn foo() -> i8 {}|foo", ); } @@ -760,7 +760,7 @@ mod tests { t: <|>T, } ", - "T TYPE_PARAM FileId(1) [11; 12)", + "T TYPE_PARAM FileId(1) 11..12", "T", ); } @@ -782,7 +782,7 @@ mod tests { }); } ", - "x BIND_PAT FileId(1) [69; 70)", + "x BIND_PAT FileId(1) 69..70", "x", ); @@ -801,7 +801,7 @@ mod tests { }); } ", - "y BIND_PAT FileId(1) [98; 99)", + "y BIND_PAT FileId(1) 98..99", "y", ); } @@ -818,7 +818,7 @@ mod tests { } } ", - "x BIND_PAT FileId(1) [39; 40)", + "x BIND_PAT FileId(1) 39..40", "x", ); } @@ -833,7 +833,7 @@ mod tests { <|>foo!(); } ", - "foo MACRO_CALL FileId(1) [15; 48) [28; 31)", + "foo MACRO_CALL FileId(1) 15..48 28..31", "macro_rules! foo { () => { () } }|foo", ); } @@ -850,7 +850,7 @@ mod tests { Foo { x<|> }; } ", - "x BIND_PAT FileId(1) [42; 43)", + "x BIND_PAT FileId(1) 42..43", "x", ) } diff --git a/crates/ra_ide/src/goto_type_definition.rs b/crates/ra_ide/src/goto_type_definition.rs index bd2688df1b..a84637489e 100644 --- a/crates/ra_ide/src/goto_type_definition.rs +++ b/crates/ra_ide/src/goto_type_definition.rs @@ -68,7 +68,7 @@ mod tests { f<|> } ", - "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..11 7..10", ); } @@ -83,7 +83,7 @@ mod tests { f<|> } ", - "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..11 7..10", ); } @@ -102,7 +102,7 @@ mod tests { } } ", - "Foo STRUCT_DEF FileId(1) [52; 65) [59; 62)", + "Foo STRUCT_DEF FileId(1) 52..65 59..62", ); } @@ -114,7 +114,7 @@ mod tests { struct Foo; fn foo(<|>f: Foo) {} ", - "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..11 7..10", ); } @@ -130,7 +130,7 @@ mod tests { bar.<|>0; } ", - "Foo STRUCT_DEF FileId(1) [0; 11) [7; 10)", + "Foo STRUCT_DEF FileId(1) 0..11 7..10", ); } } diff --git a/crates/ra_ide/src/impls.rs b/crates/ra_ide/src/impls.rs index 68529c8a58..ea2225f707 100644 --- a/crates/ra_ide/src/impls.rs +++ b/crates/ra_ide/src/impls.rs @@ -86,7 +86,7 @@ mod tests { struct Foo<|>; impl Foo {} ", - &["impl IMPL_DEF FileId(1) [12; 23)"], + &["impl IMPL_DEF FileId(1) 12..23"], ); } @@ -99,7 +99,7 @@ mod tests { impl Foo {} impl Foo {} ", - &["impl IMPL_DEF FileId(1) [12; 23)", "impl IMPL_DEF FileId(1) [24; 35)"], + &["impl IMPL_DEF FileId(1) 12..23", "impl IMPL_DEF FileId(1) 24..35"], ); } @@ -116,7 +116,7 @@ mod tests { impl super::Foo {} } ", - &["impl IMPL_DEF FileId(1) [24; 42)", "impl IMPL_DEF FileId(1) [57; 75)"], + &["impl IMPL_DEF FileId(1) 24..42", "impl IMPL_DEF FileId(1) 57..75"], ); } @@ -133,7 +133,7 @@ mod tests { //- /b.rs impl crate::Foo {} ", - &["impl IMPL_DEF FileId(2) [0; 18)", "impl IMPL_DEF FileId(3) [0; 18)"], + &["impl IMPL_DEF FileId(2) 0..18", "impl IMPL_DEF FileId(3) 0..18"], ); } @@ -146,7 +146,7 @@ mod tests { struct Foo; impl T for Foo {} ", - &["impl IMPL_DEF FileId(1) [23; 40)"], + &["impl IMPL_DEF FileId(1) 23..40"], ); } @@ -164,7 +164,7 @@ mod tests { //- /b.rs impl crate::T for crate::Foo {} ", - &["impl IMPL_DEF FileId(2) [0; 31)", "impl IMPL_DEF FileId(3) [0; 31)"], + &["impl IMPL_DEF FileId(2) 0..31", "impl IMPL_DEF FileId(3) 0..31"], ); } @@ -180,9 +180,9 @@ mod tests { impl T for &Foo {} ", &[ - "impl IMPL_DEF FileId(1) [23; 34)", - "impl IMPL_DEF FileId(1) [35; 52)", - "impl IMPL_DEF FileId(1) [53; 71)", + "impl IMPL_DEF FileId(1) 23..34", + "impl IMPL_DEF FileId(1) 35..52", + "impl IMPL_DEF FileId(1) 53..71", ], ); } @@ -195,7 +195,7 @@ mod tests { #[derive(Copy)] struct Foo<|>; ", - &["impl IMPL_DEF FileId(1) [0; 15)"], + &["impl IMPL_DEF FileId(1) 0..15"], ); } } diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 0774fa0a14..98483df32e 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -322,12 +322,12 @@ mod tests { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: true, type_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###" [ InlayHint { - range: [106; 107), + range: 106..107, kind: ParameterHint, label: "a", }, InlayHint { - range: [109; 110), + range: 109..110, kind: ParameterHint, label: "b", }, @@ -358,7 +358,7 @@ mod tests { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ type_hints: true, parameter_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###" [ InlayHint { - range: [97; 99), + range: 97..99, kind: TypeHint, label: "i32", }, @@ -382,12 +382,12 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [69; 71), + range: 69..71, kind: TypeHint, label: "Test", }, InlayHint { - range: [105; 111), + range: 105..111, kind: TypeHint, label: "&Test", }, @@ -439,57 +439,57 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [193; 197), + range: 193..197, kind: TypeHint, label: "i32", }, InlayHint { - range: [236; 244), + range: 236..244, kind: TypeHint, label: "i32", }, InlayHint { - range: [275; 279), + range: 275..279, kind: TypeHint, label: "&str", }, InlayHint { - range: [539; 543), + range: 539..543, kind: TypeHint, label: "(i32, char)", }, InlayHint { - range: [566; 567), + range: 566..567, kind: TypeHint, label: "i32", }, InlayHint { - range: [570; 571), + range: 570..571, kind: TypeHint, label: "i32", }, InlayHint { - range: [573; 574), + range: 573..574, kind: TypeHint, label: "i32", }, InlayHint { - range: [577; 578), + range: 577..578, kind: TypeHint, label: "f64", }, InlayHint { - range: [580; 581), + range: 580..581, kind: TypeHint, label: "f64", }, InlayHint { - range: [584; 585), + range: 584..585, kind: TypeHint, label: "i32", }, InlayHint { - range: [627; 628), + range: 627..628, kind: TypeHint, label: "i32", }, @@ -519,47 +519,47 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [21; 30), + range: 21..30, kind: TypeHint, label: "i32", }, InlayHint { - range: [57; 66), + range: 57..66, kind: TypeHint, label: "i32", }, InlayHint { - range: [115; 123), + range: 115..123, kind: TypeHint, label: "|…| -> i32", }, InlayHint { - range: [127; 128), + range: 127..128, kind: TypeHint, label: "i32", }, InlayHint { - range: [130; 131), + range: 130..131, kind: TypeHint, label: "i32", }, InlayHint { - range: [133; 134), + range: 133..134, kind: TypeHint, label: "i32", }, InlayHint { - range: [136; 137), + range: 136..137, kind: TypeHint, label: "i32", }, InlayHint { - range: [201; 213), + range: 201..213, kind: TypeHint, label: "&|…| -> i32", }, InlayHint { - range: [236; 245), + range: 236..245, kind: TypeHint, label: "|| -> i32", }, @@ -583,12 +583,12 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [21; 30), + range: 21..30, kind: TypeHint, label: "i32", }, InlayHint { - range: [44; 53), + range: 44..53, kind: TypeHint, label: "i32", }, @@ -633,57 +633,57 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [188; 192), + range: 188..192, kind: TypeHint, label: "CustomOption", }, InlayHint { - range: [267; 271), + range: 267..271, kind: TypeHint, label: "&CustomOption", }, InlayHint { - range: [300; 304), + range: 300..304, kind: TypeHint, label: "&Test", }, InlayHint { - range: [341; 342), + range: 341..342, kind: TypeHint, label: "&CustomOption", }, InlayHint { - range: [344; 345), + range: 344..345, kind: TypeHint, label: "&u8", }, InlayHint { - range: [387; 388), + range: 387..388, kind: TypeHint, label: "&CustomOption", }, InlayHint { - range: [393; 394), + range: 393..394, kind: TypeHint, label: "&u8", }, InlayHint { - range: [441; 442), + range: 441..442, kind: TypeHint, label: "&u32", }, InlayHint { - range: [448; 449), + range: 448..449, kind: TypeHint, label: "&u8", }, InlayHint { - range: [500; 501), + range: 500..501, kind: TypeHint, label: "&u8", }, InlayHint { - range: [543; 544), + range: 543..544, kind: TypeHint, label: "&u8", }, @@ -728,57 +728,57 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [188; 192), + range: 188..192, kind: TypeHint, label: "CustomOption", }, InlayHint { - range: [273; 277), + range: 273..277, kind: TypeHint, label: "&CustomOption", }, InlayHint { - range: [309; 313), + range: 309..313, kind: TypeHint, label: "&Test", }, InlayHint { - range: [353; 354), + range: 353..354, kind: TypeHint, label: "&CustomOption", }, InlayHint { - range: [356; 357), + range: 356..357, kind: TypeHint, label: "&u8", }, InlayHint { - range: [402; 403), + range: 402..403, kind: TypeHint, label: "&CustomOption", }, InlayHint { - range: [408; 409), + range: 408..409, kind: TypeHint, label: "&u8", }, InlayHint { - range: [459; 460), + range: 459..460, kind: TypeHint, label: "&u32", }, InlayHint { - range: [466; 467), + range: 466..467, kind: TypeHint, label: "&u8", }, InlayHint { - range: [521; 522), + range: 521..522, kind: TypeHint, label: "&u8", }, InlayHint { - range: [567; 568), + range: 567..568, kind: TypeHint, label: "&u8", }, @@ -823,52 +823,52 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [252; 256), + range: 252..256, kind: TypeHint, label: "CustomOption", }, InlayHint { - range: [277; 281), + range: 277..281, kind: TypeHint, label: "Test", }, InlayHint { - range: [310; 311), + range: 310..311, kind: TypeHint, label: "CustomOption", }, InlayHint { - range: [313; 314), + range: 313..314, kind: TypeHint, label: "u8", }, InlayHint { - range: [348; 349), + range: 348..349, kind: TypeHint, label: "CustomOption", }, InlayHint { - range: [354; 355), + range: 354..355, kind: TypeHint, label: "u8", }, InlayHint { - range: [394; 395), + range: 394..395, kind: TypeHint, label: "u32", }, InlayHint { - range: [401; 402), + range: 401..402, kind: TypeHint, label: "u8", }, InlayHint { - range: [445; 446), + range: 445..446, kind: TypeHint, label: "u8", }, InlayHint { - range: [480; 481), + range: 480..481, kind: TypeHint, label: "u8", }, @@ -895,17 +895,17 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig { max_length: Some(8), ..Default::default() }).unwrap(), @r###" [ InlayHint { - range: [74; 75), + range: 74..75, kind: TypeHint, label: "Smol", }, InlayHint { - range: [98; 99), + range: 98..99, kind: TypeHint, label: "VeryLongOuterName<…>", }, InlayHint { - range: [137; 138), + range: 137..138, kind: TypeHint, label: "Smol>", }, @@ -983,77 +983,77 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###" [ InlayHint { - range: [798; 809), + range: 798..809, kind: TypeHint, label: "i32", }, InlayHint { - range: [842; 843), + range: 842..843, kind: ParameterHint, label: "foo", }, InlayHint { - range: [845; 846), + range: 845..846, kind: ParameterHint, label: "bar", }, InlayHint { - range: [848; 855), + range: 848..855, kind: ParameterHint, label: "msg", }, InlayHint { - range: [860; 871), + range: 860..871, kind: ParameterHint, label: "last", }, InlayHint { - range: [914; 917), + range: 914..917, kind: ParameterHint, label: "param", }, InlayHint { - range: [937; 939), + range: 937..939, kind: ParameterHint, label: "&self", }, InlayHint { - range: [941; 945), + range: 941..945, kind: ParameterHint, label: "param", }, InlayHint { - range: [980; 989), + range: 980..989, kind: ParameterHint, label: "file_id", }, InlayHint { - range: [999; 1012), + range: 999..1012, kind: ParameterHint, label: "name", }, InlayHint { - range: [1022; 1026), + range: 1022..1026, kind: ParameterHint, label: "focus_range", }, InlayHint { - range: [1036; 1048), + range: 1036..1048, kind: ParameterHint, label: "full_range", }, InlayHint { - range: [1058; 1071), + range: 1058..1071, kind: ParameterHint, label: "kind", }, InlayHint { - range: [1081; 1085), + range: 1081..1085, kind: ParameterHint, label: "docs", }, InlayHint { - range: [1095; 1099), + range: 1095..1099, kind: ParameterHint, label: "description", }, @@ -1184,12 +1184,12 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###" [ InlayHint { - range: [232; 269), + range: 232..269, kind: ChainingHint, label: "B", }, InlayHint { - range: [232; 239), + range: 232..239, kind: ChainingHint, label: "A", }, @@ -1238,12 +1238,12 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###" [ InlayHint { - range: [252; 323), + range: 252..323, kind: ChainingHint, label: "C", }, InlayHint { - range: [252; 300), + range: 252..300, kind: ChainingHint, label: "B", }, @@ -1276,12 +1276,12 @@ fn main() { assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###" [ InlayHint { - range: [403; 452), + range: 403..452, kind: ChainingHint, label: "B>", }, InlayHint { - range: [403; 422), + range: 403..422, kind: ChainingHint, label: "A>", }, diff --git a/crates/ra_ide/src/join_lines.rs b/crates/ra_ide/src/join_lines.rs index 040846ec37..fde0bfa98b 100644 --- a/crates/ra_ide/src/join_lines.rs +++ b/crates/ra_ide/src/join_lines.rs @@ -170,7 +170,7 @@ mod tests { fn check_join_lines(before: &str, after: &str) { check_action(before, after, |file, offset| { - let range = TextRange::offset_len(offset, 0.into()); + let range = TextRange::empty(offset); let res = join_lines(file, range); Some(res) }) diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs index 958b92bed5..aaf4460dfa 100644 --- a/crates/ra_ide/src/parent_module.rs +++ b/crates/ra_ide/src/parent_module.rs @@ -76,7 +76,7 @@ mod tests { ", ); let nav = analysis.parent_module(pos).unwrap().pop().unwrap(); - nav.assert_match("foo MODULE FileId(1) [0; 8)"); + nav.assert_match("foo MODULE FileId(1) 0..8"); } #[test] @@ -95,7 +95,7 @@ mod tests { ", ); let nav = analysis.parent_module(pos).unwrap().pop().unwrap(); - nav.assert_match("foo MODULE FileId(1) [0; 8)"); + nav.assert_match("foo MODULE FileId(1) 0..8"); } #[test] @@ -111,7 +111,7 @@ mod tests { ", ); let nav = analysis.parent_module(pos).unwrap().pop().unwrap(); - nav.assert_match("baz MODULE FileId(1) [32; 44)"); + nav.assert_match("baz MODULE FileId(1) 32..44"); } #[test] diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs index 7d0544ff44..a3970bf830 100644 --- a/crates/ra_ide/src/references.rs +++ b/crates/ra_ide/src/references.rs @@ -214,8 +214,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "Foo STRUCT_DEF FileId(1) [5; 39) [12; 15) Other", - &["FileId(1) [138; 141) StructLiteral"], + "Foo STRUCT_DEF FileId(1) 5..39 12..15 Other", + &["FileId(1) 138..141 StructLiteral"], ); } @@ -231,8 +231,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "Foo STRUCT_DEF FileId(1) [5; 18) [12; 15) Other", - &["FileId(1) [54; 57) Other", "FileId(1) [71; 74) StructLiteral"], + "Foo STRUCT_DEF FileId(1) 5..18 12..15 Other", + &["FileId(1) 54..57 Other", "FileId(1) 71..74 StructLiteral"], ); } @@ -248,8 +248,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "Foo STRUCT_DEF FileId(1) [5; 21) [12; 15) Other", - &["FileId(1) [81; 84) StructLiteral"], + "Foo STRUCT_DEF FileId(1) 5..21 12..15 Other", + &["FileId(1) 81..84 StructLiteral"], ); } @@ -266,8 +266,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "Foo STRUCT_DEF FileId(1) [5; 21) [12; 15) Other", - &["FileId(1) [71; 74) StructLiteral"], + "Foo STRUCT_DEF FileId(1) 5..21 12..15 Other", + &["FileId(1) 71..74 StructLiteral"], ); } @@ -289,12 +289,12 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "i BIND_PAT FileId(1) [33; 34) Other Write", + "i BIND_PAT FileId(1) 33..34 Other Write", &[ - "FileId(1) [67; 68) Other Write", - "FileId(1) [71; 72) Other Read", - "FileId(1) [101; 102) Other Write", - "FileId(1) [127; 128) Other Write", + "FileId(1) 67..68 Other Write", + "FileId(1) 71..72 Other Read", + "FileId(1) 101..102 Other Write", + "FileId(1) 127..128 Other Write", ], ); } @@ -315,8 +315,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "spam BIND_PAT FileId(1) [44; 48) Other", - &["FileId(1) [71; 75) Other Read", "FileId(1) [78; 82) Other Read"], + "spam BIND_PAT FileId(1) 44..48 Other", + &["FileId(1) 71..75 Other Read", "FileId(1) 78..82 Other Read"], ); } @@ -328,11 +328,7 @@ mod tests { }"#; let refs = get_all_refs(code); - check_result( - refs, - "i BIND_PAT FileId(1) [12; 13) Other", - &["FileId(1) [38; 39) Other Read"], - ); + check_result(refs, "i BIND_PAT FileId(1) 12..13 Other", &["FileId(1) 38..39 Other Read"]); } #[test] @@ -343,11 +339,7 @@ mod tests { }"#; let refs = get_all_refs(code); - check_result( - refs, - "i BIND_PAT FileId(1) [12; 13) Other", - &["FileId(1) [38; 39) Other Read"], - ); + check_result(refs, "i BIND_PAT FileId(1) 12..13 Other", &["FileId(1) 38..39 Other Read"]); } #[test] @@ -366,8 +358,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "spam RECORD_FIELD_DEF FileId(1) [66; 79) [70; 74) Other", - &["FileId(1) [152; 156) Other Read"], + "spam RECORD_FIELD_DEF FileId(1) 66..79 70..74 Other", + &["FileId(1) 152..156 Other Read"], ); } @@ -382,7 +374,7 @@ mod tests { "#; let refs = get_all_refs(code); - check_result(refs, "f FN_DEF FileId(1) [88; 104) [91; 92) Other", &[]); + check_result(refs, "f FN_DEF FileId(1) 88..104 91..92 Other", &[]); } #[test] @@ -397,7 +389,7 @@ mod tests { "#; let refs = get_all_refs(code); - check_result(refs, "B ENUM_VARIANT FileId(1) [83; 84) [83; 84) Other", &[]); + check_result(refs, "B ENUM_VARIANT FileId(1) 83..84 83..84 Other", &[]); } #[test] @@ -438,8 +430,8 @@ mod tests { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "Foo STRUCT_DEF FileId(2) [16; 50) [27; 30) Other", - &["FileId(1) [52; 55) StructLiteral", "FileId(3) [77; 80) StructLiteral"], + "Foo STRUCT_DEF FileId(2) 16..50 27..30 Other", + &["FileId(1) 52..55 StructLiteral", "FileId(3) 77..80 StructLiteral"], ); } @@ -466,11 +458,7 @@ mod tests { let (analysis, pos) = analysis_and_position(code); let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); - check_result( - refs, - "foo SOURCE_FILE FileId(2) [0; 35) Other", - &["FileId(1) [13; 16) Other"], - ); + check_result(refs, "foo SOURCE_FILE FileId(2) 0..35 Other", &["FileId(1) 13..16 Other"]); } #[test] @@ -497,8 +485,8 @@ mod tests { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "Foo STRUCT_DEF FileId(3) [0; 41) [18; 21) Other", - &["FileId(2) [20; 23) Other", "FileId(2) [46; 49) StructLiteral"], + "Foo STRUCT_DEF FileId(3) 0..41 18..21 Other", + &["FileId(2) 20..23 Other", "FileId(2) 46..49 StructLiteral"], ); } @@ -525,16 +513,16 @@ mod tests { let refs = analysis.find_all_refs(pos, None).unwrap().unwrap(); check_result( refs, - "quux FN_DEF FileId(1) [18; 34) [25; 29) Other", - &["FileId(2) [16; 20) StructLiteral", "FileId(3) [16; 20) StructLiteral"], + "quux FN_DEF FileId(1) 18..34 25..29 Other", + &["FileId(2) 16..20 StructLiteral", "FileId(3) 16..20 StructLiteral"], ); let refs = analysis.find_all_refs(pos, Some(SearchScope::single_file(bar))).unwrap().unwrap(); check_result( refs, - "quux FN_DEF FileId(1) [18; 34) [25; 29) Other", - &["FileId(3) [16; 20) StructLiteral"], + "quux FN_DEF FileId(1) 18..34 25..29 Other", + &["FileId(3) 16..20 StructLiteral"], ); } @@ -552,8 +540,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "m1 MACRO_CALL FileId(1) [9; 63) [46; 48) Other", - &["FileId(1) [96; 98) StructLiteral", "FileId(1) [114; 116) StructLiteral"], + "m1 MACRO_CALL FileId(1) 9..63 46..48 Other", + &["FileId(1) 96..98 StructLiteral", "FileId(1) 114..116 StructLiteral"], ); } @@ -568,8 +556,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "i BIND_PAT FileId(1) [40; 41) Other Write", - &["FileId(1) [59; 60) Other Write", "FileId(1) [63; 64) Other Read"], + "i BIND_PAT FileId(1) 40..41 Other Write", + &["FileId(1) 59..60 Other Write", "FileId(1) 63..64 Other Read"], ); } @@ -588,8 +576,8 @@ mod tests { let refs = get_all_refs(code); check_result( refs, - "f RECORD_FIELD_DEF FileId(1) [32; 38) [32; 33) Other", - &["FileId(1) [96; 97) Other Read", "FileId(1) [117; 118) Other Write"], + "f RECORD_FIELD_DEF FileId(1) 32..38 32..33 Other", + &["FileId(1) 96..97 Other Read", "FileId(1) 117..118 Other Write"], ); } @@ -602,11 +590,7 @@ mod tests { }"#; let refs = get_all_refs(code); - check_result( - refs, - "i BIND_PAT FileId(1) [36; 37) Other", - &["FileId(1) [51; 52) Other Write"], - ); + check_result(refs, "i BIND_PAT FileId(1) 36..37 Other", &["FileId(1) 51..52 Other Write"]); } fn get_all_refs(text: &str) -> ReferenceSearchResult { diff --git a/crates/ra_ide/src/references/rename.rs b/crates/ra_ide/src/references/rename.rs index 1c64b3eb96..a8f320e2fb 100644 --- a/crates/ra_ide/src/references/rename.rs +++ b/crates/ra_ide/src/references/rename.rs @@ -54,10 +54,7 @@ fn source_edit_from_reference(reference: Reference, new_name: &str) -> SourceFil ReferenceKind::StructFieldShorthandForField => { replacement_text.push_str(new_name); replacement_text.push_str(": "); - TextRange::new( - reference.file_range.range.start(), - reference.file_range.range.start(), - ) + TextRange::new(reference.file_range.range.start(), reference.file_range.range.start()) } ReferenceKind::StructFieldShorthandForLocal => { replacement_text.push_str(": "); @@ -528,7 +525,7 @@ mod tests { @r###" Some( RangeInfo { - range: [4; 7), + range: 4..7, info: SourceChange { label: "rename", source_file_edits: [ @@ -539,7 +536,7 @@ mod tests { edit: TextEdit { atoms: [ AtomTextEdit { - delete: [4; 7), + delete: 4..7, insert: "foo2", }, ], @@ -580,7 +577,7 @@ mod tests { @r###" Some( RangeInfo { - range: [4; 7), + range: 4..7, info: SourceChange { label: "rename", source_file_edits: [ @@ -591,7 +588,7 @@ mod tests { edit: TextEdit { atoms: [ AtomTextEdit { - delete: [4; 7), + delete: 4..7, insert: "foo2", }, ], @@ -663,7 +660,7 @@ mod tests { @r###" Some( RangeInfo { - range: [8; 11), + range: 8..11, info: SourceChange { label: "rename", source_file_edits: [ @@ -674,7 +671,7 @@ mod tests { edit: TextEdit { atoms: [ AtomTextEdit { - delete: [8; 11), + delete: 8..11, insert: "foo2", }, ], @@ -687,7 +684,7 @@ mod tests { edit: TextEdit { atoms: [ AtomTextEdit { - delete: [27; 30), + delete: 27..30, insert: "foo2", }, ], diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs index 05a66e03ce..38637c19c2 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs @@ -164,11 +164,11 @@ mod tests { @r###" [ Runnable { - range: [1; 21), + range: 1..21, kind: Bin, }, Runnable { - range: [22; 46), + range: 22..46, kind: Test { test_id: Path( "test_foo", @@ -179,7 +179,7 @@ mod tests { }, }, Runnable { - range: [47; 81), + range: 47..81, kind: Test { test_id: Path( "test_foo", @@ -211,13 +211,13 @@ mod tests { @r###" [ Runnable { - range: [1; 59), + range: 1..59, kind: TestMod { path: "test_mod", }, }, Runnable { - range: [28; 57), + range: 28..57, kind: Test { test_id: Path( "test_mod::test_foo1", @@ -251,13 +251,13 @@ mod tests { @r###" [ Runnable { - range: [23; 85), + range: 23..85, kind: TestMod { path: "foo::test_mod", }, }, Runnable { - range: [46; 79), + range: 46..79, kind: Test { test_id: Path( "foo::test_mod::test_foo1", @@ -293,13 +293,13 @@ mod tests { @r###" [ Runnable { - range: [41; 115), + range: 41..115, kind: TestMod { path: "foo::bar::test_mod", }, }, Runnable { - range: [68; 105), + range: 68..105, kind: Test { test_id: Path( "foo::bar::test_mod::test_foo1", diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index a9aae957f0..d2926ba780 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs @@ -126,7 +126,7 @@ fn test_ranges() { // The "x" let highlights = &analysis - .highlight_range(FileRange { file_id, range: TextRange::offset_len(82.into(), 1.into()) }) + .highlight_range(FileRange { file_id, range: TextRange::at(82.into(), 1.into()) }) .unwrap(); assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index a8a97a69f5..bf97f8c569 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs @@ -66,11 +66,8 @@ fn syntax_tree_for_token(node: &SyntaxToken, text_range: TextRange) -> Option Option Some(SingleFileChange { label: "reindent dot".to_string(), - edit: TextEdit::replace( - TextRange::new(offset - current_indent_len, offset), - target_indent, - ), - cursor_position: Some( - offset + target_indent_len - current_indent_len + TextSize::of('.'), - ), + edit: TextEdit::replace(TextRange::new(offset - current_indent_len, offset), target_indent), + cursor_position: Some(offset + target_indent_len - current_indent_len + TextSize::of('.')), }) } diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 100ed41f23..bee59c5c49 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs @@ -257,30 +257,30 @@ fn test_expr_order() { let dump = format!("{:#?}", expanded); assert_eq_text!( dump.trim(), - r#"MACRO_ITEMS@[0; 15) - FN_DEF@[0; 15) - FN_KW@[0; 2) "fn" - NAME@[2; 5) - IDENT@[2; 5) "bar" - PARAM_LIST@[5; 7) - L_PAREN@[5; 6) "(" - R_PAREN@[6; 7) ")" - BLOCK_EXPR@[7; 15) - BLOCK@[7; 15) - L_CURLY@[7; 8) "{" - EXPR_STMT@[8; 14) - BIN_EXPR@[8; 13) - BIN_EXPR@[8; 11) - LITERAL@[8; 9) - INT_NUMBER@[8; 9) "1" - PLUS@[9; 10) "+" - LITERAL@[10; 11) - INT_NUMBER@[10; 11) "1" - STAR@[11; 12) "*" - LITERAL@[12; 13) - INT_NUMBER@[12; 13) "2" - SEMICOLON@[13; 14) ";" - R_CURLY@[14; 15) "}""#, + r#"MACRO_ITEMS@0..15 + FN_DEF@0..15 + FN_KW@0..2 "fn" + NAME@2..5 + IDENT@2..5 "bar" + PARAM_LIST@5..7 + L_PAREN@5..6 "(" + R_PAREN@6..7 ")" + BLOCK_EXPR@7..15 + BLOCK@7..15 + L_CURLY@7..8 "{" + EXPR_STMT@8..14 + BIN_EXPR@8..13 + BIN_EXPR@8..11 + LITERAL@8..9 + INT_NUMBER@8..9 "1" + PLUS@9..10 "+" + LITERAL@10..11 + INT_NUMBER@10..11 "1" + STAR@11..12 "*" + LITERAL@12..13 + INT_NUMBER@12..13 "2" + SEMICOLON@13..14 ";" + R_CURLY@14..15 "}""#, ); } @@ -490,39 +490,39 @@ fn test_expand_to_item_list() { assert_eq!( format!("{:#?}", tree).trim(), r#" -MACRO_ITEMS@[0; 40) - STRUCT_DEF@[0; 20) - STRUCT_KW@[0; 6) "struct" - NAME@[6; 9) - IDENT@[6; 9) "Foo" - RECORD_FIELD_DEF_LIST@[9; 20) - L_CURLY@[9; 10) "{" - RECORD_FIELD_DEF@[10; 19) - NAME@[10; 15) - IDENT@[10; 15) "field" - COLON@[15; 16) ":" - PATH_TYPE@[16; 19) - PATH@[16; 19) - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "u32" - R_CURLY@[19; 20) "}" - STRUCT_DEF@[20; 40) - STRUCT_KW@[20; 26) "struct" - NAME@[26; 29) - IDENT@[26; 29) "Bar" - RECORD_FIELD_DEF_LIST@[29; 40) - L_CURLY@[29; 30) "{" - RECORD_FIELD_DEF@[30; 39) - NAME@[30; 35) - IDENT@[30; 35) "field" - COLON@[35; 36) ":" - PATH_TYPE@[36; 39) - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "u32" - R_CURLY@[39; 40) "}""# +MACRO_ITEMS@0..40 + STRUCT_DEF@0..20 + STRUCT_KW@0..6 "struct" + NAME@6..9 + IDENT@6..9 "Foo" + RECORD_FIELD_DEF_LIST@9..20 + L_CURLY@9..10 "{" + RECORD_FIELD_DEF@10..19 + NAME@10..15 + IDENT@10..15 "field" + COLON@15..16 ":" + PATH_TYPE@16..19 + PATH@16..19 + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "u32" + R_CURLY@19..20 "}" + STRUCT_DEF@20..40 + STRUCT_KW@20..26 "struct" + NAME@26..29 + IDENT@26..29 "Bar" + RECORD_FIELD_DEF_LIST@29..40 + L_CURLY@29..30 "{" + RECORD_FIELD_DEF@30..39 + NAME@30..35 + IDENT@30..35 "field" + COLON@35..36 ":" + PATH_TYPE@36..39 + PATH@36..39 + PATH_SEGMENT@36..39 + NAME_REF@36..39 + IDENT@36..39 "u32" + R_CURLY@39..40 "}""# .trim() ); } @@ -623,37 +623,37 @@ fn test_tt_to_stmts() { assert_eq!( format!("{:#?}", stmts).trim(), - r#"MACRO_STMTS@[0; 15) - LET_STMT@[0; 7) - LET_KW@[0; 3) "let" - BIND_PAT@[3; 4) - NAME@[3; 4) - IDENT@[3; 4) "a" - EQ@[4; 5) "=" - LITERAL@[5; 6) - INT_NUMBER@[5; 6) "0" - SEMICOLON@[6; 7) ";" - EXPR_STMT@[7; 14) - BIN_EXPR@[7; 13) - PATH_EXPR@[7; 8) - PATH@[7; 8) - PATH_SEGMENT@[7; 8) - NAME_REF@[7; 8) - IDENT@[7; 8) "a" - EQ@[8; 9) "=" - BIN_EXPR@[9; 13) - LITERAL@[9; 11) - INT_NUMBER@[9; 11) "10" - PLUS@[11; 12) "+" - LITERAL@[12; 13) - INT_NUMBER@[12; 13) "1" - SEMICOLON@[13; 14) ";" - EXPR_STMT@[14; 15) - PATH_EXPR@[14; 15) - PATH@[14; 15) - PATH_SEGMENT@[14; 15) - NAME_REF@[14; 15) - IDENT@[14; 15) "a""#, + r#"MACRO_STMTS@0..15 + LET_STMT@0..7 + LET_KW@0..3 "let" + BIND_PAT@3..4 + NAME@3..4 + IDENT@3..4 "a" + EQ@4..5 "=" + LITERAL@5..6 + INT_NUMBER@5..6 "0" + SEMICOLON@6..7 ";" + EXPR_STMT@7..14 + BIN_EXPR@7..13 + PATH_EXPR@7..8 + PATH@7..8 + PATH_SEGMENT@7..8 + NAME_REF@7..8 + IDENT@7..8 "a" + EQ@8..9 "=" + BIN_EXPR@9..13 + LITERAL@9..11 + INT_NUMBER@9..11 "10" + PLUS@11..12 "+" + LITERAL@12..13 + INT_NUMBER@12..13 "1" + SEMICOLON@13..14 ";" + EXPR_STMT@14..15 + PATH_EXPR@14..15 + PATH@14..15 + PATH_SEGMENT@14..15 + NAME_REF@14..15 + IDENT@14..15 "a""#, ); } @@ -974,20 +974,20 @@ fn test_tt_composite2() { let res = format!("{:#?}", &node); assert_eq_text!( res.trim(), - r###"MACRO_ITEMS@[0; 10) - MACRO_CALL@[0; 10) - PATH@[0; 3) - PATH_SEGMENT@[0; 3) - NAME_REF@[0; 3) - IDENT@[0; 3) "abs" - BANG@[3; 4) "!" - TOKEN_TREE@[4; 10) - L_PAREN@[4; 5) "(" - EQ@[5; 6) "=" - R_ANGLE@[6; 7) ">" - WHITESPACE@[7; 8) " " - POUND@[8; 9) "#" - R_PAREN@[9; 10) ")""### + r###"MACRO_ITEMS@0..10 + MACRO_CALL@0..10 + PATH@0..3 + PATH_SEGMENT@0..3 + NAME_REF@0..3 + IDENT@0..3 "abs" + BANG@3..4 "!" + TOKEN_TREE@4..10 + L_PAREN@4..5 "(" + EQ@5..6 "=" + R_ANGLE@6..7 ">" + WHITESPACE@7..8 " " + POUND@8..9 "#" + R_PAREN@9..10 ")""### ); } @@ -1113,69 +1113,69 @@ fn test_vec() { assert_eq!( format!("{:#?}", tree).trim(), - r#"BLOCK_EXPR@[0; 45) - BLOCK@[0; 45) - L_CURLY@[0; 1) "{" - LET_STMT@[1; 20) - LET_KW@[1; 4) "let" - BIND_PAT@[4; 8) - MUT_KW@[4; 7) "mut" - NAME@[7; 8) - IDENT@[7; 8) "v" - EQ@[8; 9) "=" - CALL_EXPR@[9; 19) - PATH_EXPR@[9; 17) - PATH@[9; 17) - PATH@[9; 12) - PATH_SEGMENT@[9; 12) - NAME_REF@[9; 12) - IDENT@[9; 12) "Vec" - COLON2@[12; 14) "::" - PATH_SEGMENT@[14; 17) - NAME_REF@[14; 17) - IDENT@[14; 17) "new" - ARG_LIST@[17; 19) - L_PAREN@[17; 18) "(" - R_PAREN@[18; 19) ")" - SEMICOLON@[19; 20) ";" - EXPR_STMT@[20; 33) - METHOD_CALL_EXPR@[20; 32) - PATH_EXPR@[20; 21) - PATH@[20; 21) - PATH_SEGMENT@[20; 21) - NAME_REF@[20; 21) - IDENT@[20; 21) "v" - DOT@[21; 22) "." - NAME_REF@[22; 26) - IDENT@[22; 26) "push" - ARG_LIST@[26; 32) - L_PAREN@[26; 27) "(" - LITERAL@[27; 31) - INT_NUMBER@[27; 31) "1u32" - R_PAREN@[31; 32) ")" - SEMICOLON@[32; 33) ";" - EXPR_STMT@[33; 43) - METHOD_CALL_EXPR@[33; 42) - PATH_EXPR@[33; 34) - PATH@[33; 34) - PATH_SEGMENT@[33; 34) - NAME_REF@[33; 34) - IDENT@[33; 34) "v" - DOT@[34; 35) "." - NAME_REF@[35; 39) - IDENT@[35; 39) "push" - ARG_LIST@[39; 42) - L_PAREN@[39; 40) "(" - LITERAL@[40; 41) - INT_NUMBER@[40; 41) "2" - R_PAREN@[41; 42) ")" - SEMICOLON@[42; 43) ";" - PATH_EXPR@[43; 44) - PATH@[43; 44) - PATH_SEGMENT@[43; 44) - NAME_REF@[43; 44) - IDENT@[43; 44) "v" - R_CURLY@[44; 45) "}""# + r#"BLOCK_EXPR@0..45 + BLOCK@0..45 + L_CURLY@0..1 "{" + LET_STMT@1..20 + LET_KW@1..4 "let" + BIND_PAT@4..8 + MUT_KW@4..7 "mut" + NAME@7..8 + IDENT@7..8 "v" + EQ@8..9 "=" + CALL_EXPR@9..19 + PATH_EXPR@9..17 + PATH@9..17 + PATH@9..12 + PATH_SEGMENT@9..12 + NAME_REF@9..12 + IDENT@9..12 "Vec" + COLON2@12..14 "::" + PATH_SEGMENT@14..17 + NAME_REF@14..17 + IDENT@14..17 "new" + ARG_LIST@17..19 + L_PAREN@17..18 "(" + R_PAREN@18..19 ")" + SEMICOLON@19..20 ";" + EXPR_STMT@20..33 + METHOD_CALL_EXPR@20..32 + PATH_EXPR@20..21 + PATH@20..21 + PATH_SEGMENT@20..21 + NAME_REF@20..21 + IDENT@20..21 "v" + DOT@21..22 "." + NAME_REF@22..26 + IDENT@22..26 "push" + ARG_LIST@26..32 + L_PAREN@26..27 "(" + LITERAL@27..31 + INT_NUMBER@27..31 "1u32" + R_PAREN@31..32 ")" + SEMICOLON@32..33 ";" + EXPR_STMT@33..43 + METHOD_CALL_EXPR@33..42 + PATH_EXPR@33..34 + PATH@33..34 + PATH_SEGMENT@33..34 + NAME_REF@33..34 + IDENT@33..34 "v" + DOT@34..35 "." + NAME_REF@35..39 + IDENT@35..39 "push" + ARG_LIST@39..42 + L_PAREN@39..40 "(" + LITERAL@40..41 + INT_NUMBER@40..41 "2" + R_PAREN@41..42 ")" + SEMICOLON@42..43 ";" + PATH_EXPR@43..44 + PATH@43..44 + PATH_SEGMENT@43..44 + NAME_REF@43..44 + IDENT@43..44 "v" + R_CURLY@44..45 "}""# ); } @@ -1798,45 +1798,45 @@ fn test_no_space_after_semi_colon() { let dump = format!("{:#?}", expanded); assert_eq_text!( dump.trim(), - r###"MACRO_ITEMS@[0; 52) - MODULE@[0; 26) - ATTR@[0; 21) - POUND@[0; 1) "#" - L_BRACK@[1; 2) "[" - PATH@[2; 5) - PATH_SEGMENT@[2; 5) - NAME_REF@[2; 5) - IDENT@[2; 5) "cfg" - TOKEN_TREE@[5; 20) - L_PAREN@[5; 6) "(" - IDENT@[6; 13) "feature" - EQ@[13; 14) "=" - STRING@[14; 19) "\"std\"" - R_PAREN@[19; 20) ")" - R_BRACK@[20; 21) "]" - MOD_KW@[21; 24) "mod" - NAME@[24; 25) - IDENT@[24; 25) "m" - SEMICOLON@[25; 26) ";" - MODULE@[26; 52) - ATTR@[26; 47) - POUND@[26; 27) "#" - L_BRACK@[27; 28) "[" - PATH@[28; 31) - PATH_SEGMENT@[28; 31) - NAME_REF@[28; 31) - IDENT@[28; 31) "cfg" - TOKEN_TREE@[31; 46) - L_PAREN@[31; 32) "(" - IDENT@[32; 39) "feature" - EQ@[39; 40) "=" - STRING@[40; 45) "\"std\"" - R_PAREN@[45; 46) ")" - R_BRACK@[46; 47) "]" - MOD_KW@[47; 50) "mod" - NAME@[50; 51) - IDENT@[50; 51) "f" - SEMICOLON@[51; 52) ";""###, + r###"MACRO_ITEMS@0..52 + MODULE@0..26 + ATTR@0..21 + POUND@0..1 "#" + L_BRACK@1..2 "[" + PATH@2..5 + PATH_SEGMENT@2..5 + NAME_REF@2..5 + IDENT@2..5 "cfg" + TOKEN_TREE@5..20 + L_PAREN@5..6 "(" + IDENT@6..13 "feature" + EQ@13..14 "=" + STRING@14..19 "\"std\"" + R_PAREN@19..20 ")" + R_BRACK@20..21 "]" + MOD_KW@21..24 "mod" + NAME@24..25 + IDENT@24..25 "m" + SEMICOLON@25..26 ";" + MODULE@26..52 + ATTR@26..47 + POUND@26..27 "#" + L_BRACK@27..28 "[" + PATH@28..31 + PATH_SEGMENT@28..31 + NAME_REF@28..31 + IDENT@28..31 "cfg" + TOKEN_TREE@31..46 + L_PAREN@31..32 "(" + IDENT@32..39 "feature" + EQ@39..40 "=" + STRING@40..45 "\"std\"" + R_PAREN@45..46 ")" + R_BRACK@46..47 "]" + MOD_KW@47..50 "mod" + NAME@50..51 + IDENT@50..51 "f" + SEMICOLON@51..52 ";""###, ); } diff --git a/crates/ra_syntax/test_data/lexer/err/0001_unclosed_char_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0001_unclosed_char_at_eof.txt index f24e1fd32a..4d5ad74df5 100644 --- a/crates/ra_syntax/test_data/lexer/err/0001_unclosed_char_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0001_unclosed_char_at_eof.txt @@ -1,2 +1,2 @@ CHAR 1 "\'" -> error[0; 1) token("\'") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..1 token("\'") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0002_unclosed_char_with_ferris.txt b/crates/ra_syntax/test_data/lexer/err/0002_unclosed_char_with_ferris.txt index bd08cfc448..eafdb3c7c9 100644 --- a/crates/ra_syntax/test_data/lexer/err/0002_unclosed_char_with_ferris.txt +++ b/crates/ra_syntax/test_data/lexer/err/0002_unclosed_char_with_ferris.txt @@ -1,2 +1,2 @@ CHAR 5 "\'🦀" -> error[0; 5) token("\'🦀") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..5 token("\'🦀") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0003_unclosed_char_with_ascii_escape.txt b/crates/ra_syntax/test_data/lexer/err/0003_unclosed_char_with_ascii_escape.txt index 0ee22912d1..cc2b4866a1 100644 --- a/crates/ra_syntax/test_data/lexer/err/0003_unclosed_char_with_ascii_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0003_unclosed_char_with_ascii_escape.txt @@ -1,2 +1,2 @@ CHAR 5 "\'\\x7f" -> error[0; 5) token("\'\\x7f") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..5 token("\'\\x7f") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0004_unclosed_char_with_unicode_escape.txt b/crates/ra_syntax/test_data/lexer/err/0004_unclosed_char_with_unicode_escape.txt index 96fac42ce7..a6d422cb3d 100644 --- a/crates/ra_syntax/test_data/lexer/err/0004_unclosed_char_with_unicode_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0004_unclosed_char_with_unicode_escape.txt @@ -1,2 +1,2 @@ CHAR 9 "\'\\u{20AA}" -> error[0; 9) token("\'\\u{20AA}") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..9 token("\'\\u{20AA}") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0005_unclosed_char_with_space.txt b/crates/ra_syntax/test_data/lexer/err/0005_unclosed_char_with_space.txt index 2059f3f81f..47e7baa708 100644 --- a/crates/ra_syntax/test_data/lexer/err/0005_unclosed_char_with_space.txt +++ b/crates/ra_syntax/test_data/lexer/err/0005_unclosed_char_with_space.txt @@ -1,2 +1,2 @@ CHAR 2 "\' " -> error[0; 2) token("\' ") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..2 token("\' ") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0006_unclosed_char_with_slash.txt b/crates/ra_syntax/test_data/lexer/err/0006_unclosed_char_with_slash.txt index 7dd376e597..511029d807 100644 --- a/crates/ra_syntax/test_data/lexer/err/0006_unclosed_char_with_slash.txt +++ b/crates/ra_syntax/test_data/lexer/err/0006_unclosed_char_with_slash.txt @@ -1,2 +1,2 @@ CHAR 2 "\'\\" -> error[0; 2) token("\'\\") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..2 token("\'\\") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0007_unclosed_char_with_slash_n.txt b/crates/ra_syntax/test_data/lexer/err/0007_unclosed_char_with_slash_n.txt index ef7a0a147d..d2ba5742c6 100644 --- a/crates/ra_syntax/test_data/lexer/err/0007_unclosed_char_with_slash_n.txt +++ b/crates/ra_syntax/test_data/lexer/err/0007_unclosed_char_with_slash_n.txt @@ -1,2 +1,2 @@ CHAR 3 "\'\\n" -> error[0; 3) token("\'\\n") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..3 token("\'\\n") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0008_unclosed_char_with_slash_single_quote.txt b/crates/ra_syntax/test_data/lexer/err/0008_unclosed_char_with_slash_single_quote.txt index 13fc5ea9ac..ae9a7f0e2a 100644 --- a/crates/ra_syntax/test_data/lexer/err/0008_unclosed_char_with_slash_single_quote.txt +++ b/crates/ra_syntax/test_data/lexer/err/0008_unclosed_char_with_slash_single_quote.txt @@ -1,2 +1,2 @@ CHAR 3 "\'\\\'" -> error[0; 3) token("\'\\\'") msg(Missing trailing `'` symbol to terminate the character literal) +> error0..3 token("\'\\\'") msg(Missing trailing `'` symbol to terminate the character literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0009_unclosed_byte_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0009_unclosed_byte_at_eof.txt index 269d68c74a..ff15045920 100644 --- a/crates/ra_syntax/test_data/lexer/err/0009_unclosed_byte_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0009_unclosed_byte_at_eof.txt @@ -1,2 +1,2 @@ BYTE 2 "b\'" -> error[0; 2) token("b\'") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..2 token("b\'") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0010_unclosed_byte_with_ferris.txt b/crates/ra_syntax/test_data/lexer/err/0010_unclosed_byte_with_ferris.txt index 91a76e479a..34f7bd6d40 100644 --- a/crates/ra_syntax/test_data/lexer/err/0010_unclosed_byte_with_ferris.txt +++ b/crates/ra_syntax/test_data/lexer/err/0010_unclosed_byte_with_ferris.txt @@ -1,2 +1,2 @@ BYTE 6 "b\'🦀" -> error[0; 6) token("b\'🦀") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..6 token("b\'🦀") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0011_unclosed_byte_with_ascii_escape.txt b/crates/ra_syntax/test_data/lexer/err/0011_unclosed_byte_with_ascii_escape.txt index b8c804a189..c964d0f00a 100644 --- a/crates/ra_syntax/test_data/lexer/err/0011_unclosed_byte_with_ascii_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0011_unclosed_byte_with_ascii_escape.txt @@ -1,2 +1,2 @@ BYTE 6 "b\'\\x7f" -> error[0; 6) token("b\'\\x7f") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..6 token("b\'\\x7f") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0012_unclosed_byte_with_unicode_escape.txt b/crates/ra_syntax/test_data/lexer/err/0012_unclosed_byte_with_unicode_escape.txt index dfca22a598..cc65fb86f9 100644 --- a/crates/ra_syntax/test_data/lexer/err/0012_unclosed_byte_with_unicode_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0012_unclosed_byte_with_unicode_escape.txt @@ -1,2 +1,2 @@ BYTE 10 "b\'\\u{20AA}" -> error[0; 10) token("b\'\\u{20AA}") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..10 token("b\'\\u{20AA}") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0013_unclosed_byte_with_space.txt b/crates/ra_syntax/test_data/lexer/err/0013_unclosed_byte_with_space.txt index 51a1cceabd..800834a144 100644 --- a/crates/ra_syntax/test_data/lexer/err/0013_unclosed_byte_with_space.txt +++ b/crates/ra_syntax/test_data/lexer/err/0013_unclosed_byte_with_space.txt @@ -1,2 +1,2 @@ BYTE 3 "b\' " -> error[0; 3) token("b\' ") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..3 token("b\' ") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0014_unclosed_byte_with_slash.txt b/crates/ra_syntax/test_data/lexer/err/0014_unclosed_byte_with_slash.txt index 24e835c279..7b85ee6463 100644 --- a/crates/ra_syntax/test_data/lexer/err/0014_unclosed_byte_with_slash.txt +++ b/crates/ra_syntax/test_data/lexer/err/0014_unclosed_byte_with_slash.txt @@ -1,2 +1,2 @@ BYTE 3 "b\'\\" -> error[0; 3) token("b\'\\") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..3 token("b\'\\") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0015_unclosed_byte_with_slash_n.txt b/crates/ra_syntax/test_data/lexer/err/0015_unclosed_byte_with_slash_n.txt index f1e39a41ba..4b9a63117b 100644 --- a/crates/ra_syntax/test_data/lexer/err/0015_unclosed_byte_with_slash_n.txt +++ b/crates/ra_syntax/test_data/lexer/err/0015_unclosed_byte_with_slash_n.txt @@ -1,2 +1,2 @@ BYTE 4 "b\'\\n" -> error[0; 4) token("b\'\\n") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..4 token("b\'\\n") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0016_unclosed_byte_with_slash_single_quote.txt b/crates/ra_syntax/test_data/lexer/err/0016_unclosed_byte_with_slash_single_quote.txt index f8ffe815d4..fe337f8d32 100644 --- a/crates/ra_syntax/test_data/lexer/err/0016_unclosed_byte_with_slash_single_quote.txt +++ b/crates/ra_syntax/test_data/lexer/err/0016_unclosed_byte_with_slash_single_quote.txt @@ -1,2 +1,2 @@ BYTE 4 "b\'\\\'" -> error[0; 4) token("b\'\\\'") msg(Missing trailing `'` symbol to terminate the byte literal) +> error0..4 token("b\'\\\'") msg(Missing trailing `'` symbol to terminate the byte literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0017_unclosed_string_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0017_unclosed_string_at_eof.txt index 823daaf6f7..d11a8d880e 100644 --- a/crates/ra_syntax/test_data/lexer/err/0017_unclosed_string_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0017_unclosed_string_at_eof.txt @@ -1,2 +1,2 @@ STRING 1 "\"" -> error[0; 1) token("\"") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..1 token("\"") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0018_unclosed_string_with_ferris.txt b/crates/ra_syntax/test_data/lexer/err/0018_unclosed_string_with_ferris.txt index 164580eb35..167f942d12 100644 --- a/crates/ra_syntax/test_data/lexer/err/0018_unclosed_string_with_ferris.txt +++ b/crates/ra_syntax/test_data/lexer/err/0018_unclosed_string_with_ferris.txt @@ -1,2 +1,2 @@ STRING 5 "\"🦀" -> error[0; 5) token("\"🦀") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..5 token("\"🦀") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0019_unclosed_string_with_ascii_escape.txt b/crates/ra_syntax/test_data/lexer/err/0019_unclosed_string_with_ascii_escape.txt index 4453827c30..224c653d26 100644 --- a/crates/ra_syntax/test_data/lexer/err/0019_unclosed_string_with_ascii_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0019_unclosed_string_with_ascii_escape.txt @@ -1,2 +1,2 @@ STRING 5 "\"\\x7f" -> error[0; 5) token("\"\\x7f") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..5 token("\"\\x7f") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0020_unclosed_string_with_unicode_escape.txt b/crates/ra_syntax/test_data/lexer/err/0020_unclosed_string_with_unicode_escape.txt index aa614f3046..48975bbcbc 100644 --- a/crates/ra_syntax/test_data/lexer/err/0020_unclosed_string_with_unicode_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0020_unclosed_string_with_unicode_escape.txt @@ -1,2 +1,2 @@ STRING 9 "\"\\u{20AA}" -> error[0; 9) token("\"\\u{20AA}") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..9 token("\"\\u{20AA}") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0021_unclosed_string_with_space.txt b/crates/ra_syntax/test_data/lexer/err/0021_unclosed_string_with_space.txt index b7db1236ff..a823cca7a4 100644 --- a/crates/ra_syntax/test_data/lexer/err/0021_unclosed_string_with_space.txt +++ b/crates/ra_syntax/test_data/lexer/err/0021_unclosed_string_with_space.txt @@ -1,2 +1,2 @@ STRING 2 "\" " -> error[0; 2) token("\" ") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..2 token("\" ") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0022_unclosed_string_with_slash.txt b/crates/ra_syntax/test_data/lexer/err/0022_unclosed_string_with_slash.txt index 9d3df37991..0914f001f5 100644 --- a/crates/ra_syntax/test_data/lexer/err/0022_unclosed_string_with_slash.txt +++ b/crates/ra_syntax/test_data/lexer/err/0022_unclosed_string_with_slash.txt @@ -1,2 +1,2 @@ STRING 2 "\"\\" -> error[0; 2) token("\"\\") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..2 token("\"\\") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0023_unclosed_string_with_slash_n.txt b/crates/ra_syntax/test_data/lexer/err/0023_unclosed_string_with_slash_n.txt index e3eb672b69..5674b55fdf 100644 --- a/crates/ra_syntax/test_data/lexer/err/0023_unclosed_string_with_slash_n.txt +++ b/crates/ra_syntax/test_data/lexer/err/0023_unclosed_string_with_slash_n.txt @@ -1,2 +1,2 @@ STRING 3 "\"\\n" -> error[0; 3) token("\"\\n") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..3 token("\"\\n") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0024_unclosed_string_with_slash_double_quote.txt b/crates/ra_syntax/test_data/lexer/err/0024_unclosed_string_with_slash_double_quote.txt index 041d7fb6ef..4c9a774e46 100644 --- a/crates/ra_syntax/test_data/lexer/err/0024_unclosed_string_with_slash_double_quote.txt +++ b/crates/ra_syntax/test_data/lexer/err/0024_unclosed_string_with_slash_double_quote.txt @@ -1,2 +1,2 @@ STRING 3 "\"\\\"" -> error[0; 3) token("\"\\\"") msg(Missing trailing `"` symbol to terminate the string literal) +> error0..3 token("\"\\\"") msg(Missing trailing `"` symbol to terminate the string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0025_unclosed_byte_string_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0025_unclosed_byte_string_at_eof.txt index be7970a835..04e6b0aa4f 100644 --- a/crates/ra_syntax/test_data/lexer/err/0025_unclosed_byte_string_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0025_unclosed_byte_string_at_eof.txt @@ -1,2 +1,2 @@ BYTE_STRING 2 "b\"" -> error[0; 2) token("b\"") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..2 token("b\"") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0026_unclosed_byte_string_with_ferris.txt b/crates/ra_syntax/test_data/lexer/err/0026_unclosed_byte_string_with_ferris.txt index bf9aab132c..0576a0609a 100644 --- a/crates/ra_syntax/test_data/lexer/err/0026_unclosed_byte_string_with_ferris.txt +++ b/crates/ra_syntax/test_data/lexer/err/0026_unclosed_byte_string_with_ferris.txt @@ -1,2 +1,2 @@ BYTE_STRING 6 "b\"🦀" -> error[0; 6) token("b\"🦀") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..6 token("b\"🦀") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0027_unclosed_byte_string_with_ascii_escape.txt b/crates/ra_syntax/test_data/lexer/err/0027_unclosed_byte_string_with_ascii_escape.txt index 76e16d7d34..541a013d85 100644 --- a/crates/ra_syntax/test_data/lexer/err/0027_unclosed_byte_string_with_ascii_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0027_unclosed_byte_string_with_ascii_escape.txt @@ -1,2 +1,2 @@ BYTE_STRING 6 "b\"\\x7f" -> error[0; 6) token("b\"\\x7f") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..6 token("b\"\\x7f") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0028_unclosed_byte_string_with_unicode_escape.txt b/crates/ra_syntax/test_data/lexer/err/0028_unclosed_byte_string_with_unicode_escape.txt index 09adffa160..71b0fb2118 100644 --- a/crates/ra_syntax/test_data/lexer/err/0028_unclosed_byte_string_with_unicode_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0028_unclosed_byte_string_with_unicode_escape.txt @@ -1,2 +1,2 @@ BYTE_STRING 10 "b\"\\u{20AA}" -> error[0; 10) token("b\"\\u{20AA}") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..10 token("b\"\\u{20AA}") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0029_unclosed_byte_string_with_space.txt b/crates/ra_syntax/test_data/lexer/err/0029_unclosed_byte_string_with_space.txt index fcb7253c82..bd5058bc11 100644 --- a/crates/ra_syntax/test_data/lexer/err/0029_unclosed_byte_string_with_space.txt +++ b/crates/ra_syntax/test_data/lexer/err/0029_unclosed_byte_string_with_space.txt @@ -1,2 +1,2 @@ BYTE_STRING 3 "b\" " -> error[0; 3) token("b\" ") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..3 token("b\" ") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0030_unclosed_byte_string_with_slash.txt b/crates/ra_syntax/test_data/lexer/err/0030_unclosed_byte_string_with_slash.txt index 0a1b3e2699..7f94f10ba1 100644 --- a/crates/ra_syntax/test_data/lexer/err/0030_unclosed_byte_string_with_slash.txt +++ b/crates/ra_syntax/test_data/lexer/err/0030_unclosed_byte_string_with_slash.txt @@ -1,2 +1,2 @@ BYTE_STRING 3 "b\"\\" -> error[0; 3) token("b\"\\") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..3 token("b\"\\") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0031_unclosed_byte_string_with_slash_n.txt b/crates/ra_syntax/test_data/lexer/err/0031_unclosed_byte_string_with_slash_n.txt index 1fb89d2b6d..9c3c089d72 100644 --- a/crates/ra_syntax/test_data/lexer/err/0031_unclosed_byte_string_with_slash_n.txt +++ b/crates/ra_syntax/test_data/lexer/err/0031_unclosed_byte_string_with_slash_n.txt @@ -1,2 +1,2 @@ BYTE_STRING 4 "b\"\\n" -> error[0; 4) token("b\"\\n") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..4 token("b\"\\n") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0032_unclosed_byte_string_with_slash_double_quote.txt b/crates/ra_syntax/test_data/lexer/err/0032_unclosed_byte_string_with_slash_double_quote.txt index 718d369929..884b12c8ee 100644 --- a/crates/ra_syntax/test_data/lexer/err/0032_unclosed_byte_string_with_slash_double_quote.txt +++ b/crates/ra_syntax/test_data/lexer/err/0032_unclosed_byte_string_with_slash_double_quote.txt @@ -1,2 +1,2 @@ BYTE_STRING 4 "b\"\\\"" -> error[0; 4) token("b\"\\\"") msg(Missing trailing `"` symbol to terminate the byte string literal) +> error0..4 token("b\"\\\"") msg(Missing trailing `"` symbol to terminate the byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0033_unclosed_raw_string_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0033_unclosed_raw_string_at_eof.txt index 93348f548f..6fd59ccc02 100644 --- a/crates/ra_syntax/test_data/lexer/err/0033_unclosed_raw_string_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0033_unclosed_raw_string_at_eof.txt @@ -1,2 +1,2 @@ RAW_STRING 4 "r##\"" -> error[0; 4) token("r##\"") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..4 token("r##\"") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0034_unclosed_raw_string_with_ferris.txt b/crates/ra_syntax/test_data/lexer/err/0034_unclosed_raw_string_with_ferris.txt index 42c70dfe83..8d9ca0e8f1 100644 --- a/crates/ra_syntax/test_data/lexer/err/0034_unclosed_raw_string_with_ferris.txt +++ b/crates/ra_syntax/test_data/lexer/err/0034_unclosed_raw_string_with_ferris.txt @@ -1,2 +1,2 @@ RAW_STRING 8 "r##\"🦀" -> error[0; 8) token("r##\"🦀") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..8 token("r##\"🦀") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0035_unclosed_raw_string_with_ascii_escape.txt b/crates/ra_syntax/test_data/lexer/err/0035_unclosed_raw_string_with_ascii_escape.txt index 2bdeea0ff5..a906380c71 100644 --- a/crates/ra_syntax/test_data/lexer/err/0035_unclosed_raw_string_with_ascii_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0035_unclosed_raw_string_with_ascii_escape.txt @@ -1,2 +1,2 @@ RAW_STRING 8 "r##\"\\x7f" -> error[0; 8) token("r##\"\\x7f") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..8 token("r##\"\\x7f") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0036_unclosed_raw_string_with_unicode_escape.txt b/crates/ra_syntax/test_data/lexer/err/0036_unclosed_raw_string_with_unicode_escape.txt index 667d4d79f9..5667c61499 100644 --- a/crates/ra_syntax/test_data/lexer/err/0036_unclosed_raw_string_with_unicode_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0036_unclosed_raw_string_with_unicode_escape.txt @@ -1,2 +1,2 @@ RAW_STRING 12 "r##\"\\u{20AA}" -> error[0; 12) token("r##\"\\u{20AA}") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..12 token("r##\"\\u{20AA}") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0037_unclosed_raw_string_with_space.txt b/crates/ra_syntax/test_data/lexer/err/0037_unclosed_raw_string_with_space.txt index dd9597a1a9..141c8268e8 100644 --- a/crates/ra_syntax/test_data/lexer/err/0037_unclosed_raw_string_with_space.txt +++ b/crates/ra_syntax/test_data/lexer/err/0037_unclosed_raw_string_with_space.txt @@ -1,2 +1,2 @@ RAW_STRING 5 "r##\" " -> error[0; 5) token("r##\" ") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..5 token("r##\" ") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0038_unclosed_raw_string_with_slash.txt b/crates/ra_syntax/test_data/lexer/err/0038_unclosed_raw_string_with_slash.txt index 6ac6e3d623..f61d4cc915 100644 --- a/crates/ra_syntax/test_data/lexer/err/0038_unclosed_raw_string_with_slash.txt +++ b/crates/ra_syntax/test_data/lexer/err/0038_unclosed_raw_string_with_slash.txt @@ -1,2 +1,2 @@ RAW_STRING 5 "r##\"\\" -> error[0; 5) token("r##\"\\") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..5 token("r##\"\\") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0039_unclosed_raw_string_with_slash_n.txt b/crates/ra_syntax/test_data/lexer/err/0039_unclosed_raw_string_with_slash_n.txt index 9d35443f51..12e2c0fc03 100644 --- a/crates/ra_syntax/test_data/lexer/err/0039_unclosed_raw_string_with_slash_n.txt +++ b/crates/ra_syntax/test_data/lexer/err/0039_unclosed_raw_string_with_slash_n.txt @@ -1,2 +1,2 @@ RAW_STRING 6 "r##\"\\n" -> error[0; 6) token("r##\"\\n") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) +> error0..6 token("r##\"\\n") msg(Missing trailing `"` with `#` symbols to terminate the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0040_unclosed_raw_byte_string_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0040_unclosed_raw_byte_string_at_eof.txt index 81fa39ea51..fe12cb5fc6 100644 --- a/crates/ra_syntax/test_data/lexer/err/0040_unclosed_raw_byte_string_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0040_unclosed_raw_byte_string_at_eof.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 5 "br##\"" -> error[0; 5) token("br##\"") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..5 token("br##\"") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0041_unclosed_raw_byte_string_with_ferris.txt b/crates/ra_syntax/test_data/lexer/err/0041_unclosed_raw_byte_string_with_ferris.txt index c2503a4d05..5be2a7861b 100644 --- a/crates/ra_syntax/test_data/lexer/err/0041_unclosed_raw_byte_string_with_ferris.txt +++ b/crates/ra_syntax/test_data/lexer/err/0041_unclosed_raw_byte_string_with_ferris.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 9 "br##\"🦀" -> error[0; 9) token("br##\"🦀") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..9 token("br##\"🦀") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0042_unclosed_raw_byte_string_with_ascii_escape.txt b/crates/ra_syntax/test_data/lexer/err/0042_unclosed_raw_byte_string_with_ascii_escape.txt index 3bd3d81529..6cbe08d07e 100644 --- a/crates/ra_syntax/test_data/lexer/err/0042_unclosed_raw_byte_string_with_ascii_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0042_unclosed_raw_byte_string_with_ascii_escape.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 9 "br##\"\\x7f" -> error[0; 9) token("br##\"\\x7f") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..9 token("br##\"\\x7f") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0043_unclosed_raw_byte_string_with_unicode_escape.txt b/crates/ra_syntax/test_data/lexer/err/0043_unclosed_raw_byte_string_with_unicode_escape.txt index a512f0428f..f56a4f9848 100644 --- a/crates/ra_syntax/test_data/lexer/err/0043_unclosed_raw_byte_string_with_unicode_escape.txt +++ b/crates/ra_syntax/test_data/lexer/err/0043_unclosed_raw_byte_string_with_unicode_escape.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 13 "br##\"\\u{20AA}" -> error[0; 13) token("br##\"\\u{20AA}") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..13 token("br##\"\\u{20AA}") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0044_unclosed_raw_byte_string_with_space.txt b/crates/ra_syntax/test_data/lexer/err/0044_unclosed_raw_byte_string_with_space.txt index dc616a623b..3d32ce34ea 100644 --- a/crates/ra_syntax/test_data/lexer/err/0044_unclosed_raw_byte_string_with_space.txt +++ b/crates/ra_syntax/test_data/lexer/err/0044_unclosed_raw_byte_string_with_space.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 6 "br##\" " -> error[0; 6) token("br##\" ") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..6 token("br##\" ") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0045_unclosed_raw_byte_string_with_slash.txt b/crates/ra_syntax/test_data/lexer/err/0045_unclosed_raw_byte_string_with_slash.txt index debafe380e..320fea1770 100644 --- a/crates/ra_syntax/test_data/lexer/err/0045_unclosed_raw_byte_string_with_slash.txt +++ b/crates/ra_syntax/test_data/lexer/err/0045_unclosed_raw_byte_string_with_slash.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 6 "br##\"\\" -> error[0; 6) token("br##\"\\") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..6 token("br##\"\\") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0046_unclosed_raw_byte_string_with_slash_n.txt b/crates/ra_syntax/test_data/lexer/err/0046_unclosed_raw_byte_string_with_slash_n.txt index 524e617b77..b3a56380cb 100644 --- a/crates/ra_syntax/test_data/lexer/err/0046_unclosed_raw_byte_string_with_slash_n.txt +++ b/crates/ra_syntax/test_data/lexer/err/0046_unclosed_raw_byte_string_with_slash_n.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 7 "br##\"\\n" -> error[0; 7) token("br##\"\\n") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) +> error0..7 token("br##\"\\n") msg(Missing trailing `"` with `#` symbols to terminate the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0047_unstarted_raw_string_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0047_unstarted_raw_string_at_eof.txt index 00b0468405..5af1e2d97f 100644 --- a/crates/ra_syntax/test_data/lexer/err/0047_unstarted_raw_string_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0047_unstarted_raw_string_at_eof.txt @@ -1,2 +1,2 @@ RAW_STRING 3 "r##" -> error[0; 3) token("r##") msg(Missing `"` symbol after `#` symbols to begin the raw string literal) +> error0..3 token("r##") msg(Missing `"` symbol after `#` symbols to begin the raw string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0048_unstarted_raw_byte_string_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0048_unstarted_raw_byte_string_at_eof.txt index 33b25e60f8..aec7afd927 100644 --- a/crates/ra_syntax/test_data/lexer/err/0048_unstarted_raw_byte_string_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0048_unstarted_raw_byte_string_at_eof.txt @@ -1,2 +1,2 @@ RAW_BYTE_STRING 4 "br##" -> error[0; 4) token("br##") msg(Missing `"` symbol after `#` symbols to begin the raw byte string literal) +> error0..4 token("br##") msg(Missing `"` symbol after `#` symbols to begin the raw byte string literal) 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 290e0bd7c5..e22fe5374f 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 @@ -7,4 +7,4 @@ IDENT 1 "a" WHITESPACE 1 " " IDENT 5 "quote" BANG 1 "!" -> error[0; 4) token("r## ") msg(Missing `"` symbol after `#` symbols to begin the raw string literal) +> error0..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 5c492906d4..d74ea4c279 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 @@ -7,4 +7,4 @@ IDENT 1 "a" WHITESPACE 1 " " IDENT 5 "quote" BANG 1 "!" -> error[0; 5) token("br## ") msg(Missing `"` symbol after `#` symbols to begin the raw byte string literal) +> error0..5 token("br## ") msg(Missing `"` symbol after `#` symbols to begin the raw byte string literal) diff --git a/crates/ra_syntax/test_data/lexer/err/0051_unclosed_block_comment_at_eof.txt b/crates/ra_syntax/test_data/lexer/err/0051_unclosed_block_comment_at_eof.txt index 5d04cdaa4b..2a256e9dff 100644 --- a/crates/ra_syntax/test_data/lexer/err/0051_unclosed_block_comment_at_eof.txt +++ b/crates/ra_syntax/test_data/lexer/err/0051_unclosed_block_comment_at_eof.txt @@ -1,2 +1,2 @@ COMMENT 2 "/*" -> error[0; 2) token("/*") msg(Missing trailing `*/` symbols to terminate the block comment) +> error0..2 token("/*") msg(Missing trailing `*/` symbols to terminate the block comment) diff --git a/crates/ra_syntax/test_data/lexer/err/0052_unclosed_block_comment_with_content.txt b/crates/ra_syntax/test_data/lexer/err/0052_unclosed_block_comment_with_content.txt index 8c6b678e32..8e8490302a 100644 --- a/crates/ra_syntax/test_data/lexer/err/0052_unclosed_block_comment_with_content.txt +++ b/crates/ra_syntax/test_data/lexer/err/0052_unclosed_block_comment_with_content.txt @@ -1,2 +1,2 @@ COMMENT 11 "/* comment\n" -> error[0; 11) token("/* comment\n") msg(Missing trailing `*/` symbols to terminate the block comment) +> error0..11 token("/* comment\n") msg(Missing trailing `*/` symbols to terminate the block comment) diff --git a/crates/ra_syntax/test_data/lexer/err/0053_unclosed_nested_block_comment_entirely.txt b/crates/ra_syntax/test_data/lexer/err/0053_unclosed_nested_block_comment_entirely.txt index 250de34d9f..b7d28fc05d 100644 --- a/crates/ra_syntax/test_data/lexer/err/0053_unclosed_nested_block_comment_entirely.txt +++ b/crates/ra_syntax/test_data/lexer/err/0053_unclosed_nested_block_comment_entirely.txt @@ -1,2 +1,2 @@ COMMENT 9 "/* /* /*\n" -> error[0; 9) token("/* /* /*\n") msg(Missing trailing `*/` symbols to terminate the block comment) +> error0..9 token("/* /* /*\n") msg(Missing trailing `*/` symbols to terminate the block comment) diff --git a/crates/ra_syntax/test_data/lexer/err/0054_unclosed_nested_block_comment_partially.txt b/crates/ra_syntax/test_data/lexer/err/0054_unclosed_nested_block_comment_partially.txt index f97f2a8c76..4742d2c12c 100644 --- a/crates/ra_syntax/test_data/lexer/err/0054_unclosed_nested_block_comment_partially.txt +++ b/crates/ra_syntax/test_data/lexer/err/0054_unclosed_nested_block_comment_partially.txt @@ -1,2 +1,2 @@ COMMENT 25 "/** /*! /* comment */ */\n" -> error[0; 25) token("/** /*! /* comment */ */\n") msg(Missing trailing `*/` symbols to terminate the block comment) +> error0..25 token("/** /*! /* comment */ */\n") msg(Missing trailing `*/` symbols to terminate the block comment) diff --git a/crates/ra_syntax/test_data/lexer/err/0055_empty_int.txt b/crates/ra_syntax/test_data/lexer/err/0055_empty_int.txt index 2fe5bd950a..bcd094b6ef 100644 --- a/crates/ra_syntax/test_data/lexer/err/0055_empty_int.txt +++ b/crates/ra_syntax/test_data/lexer/err/0055_empty_int.txt @@ -24,16 +24,16 @@ INT_NUMBER 4 "0x_g" WHITESPACE 1 "\n" INT_NUMBER 4 "0x_G" WHITESPACE 1 "\n" -> error[0; 2) token("0b") msg(Missing digits after the integer base prefix) -> error[3; 5) token("0o") msg(Missing digits after the integer base prefix) -> error[6; 8) token("0x") msg(Missing digits after the integer base prefix) -> error[10; 13) token("0b_") msg(Missing digits after the integer base prefix) -> error[14; 17) token("0o_") msg(Missing digits after the integer base prefix) -> error[18; 21) token("0x_") msg(Missing digits after the integer base prefix) -> error[23; 32) token("0bnoDigit") msg(Missing digits after the integer base prefix) -> error[33; 42) token("0onoDigit") msg(Missing digits after the integer base prefix) -> error[43; 52) token("0xnoDigit") msg(Missing digits after the integer base prefix) -> error[54; 57) token("0xG") msg(Missing digits after the integer base prefix) -> error[58; 61) token("0xg") msg(Missing digits after the integer base prefix) -> error[63; 67) token("0x_g") msg(Missing digits after the integer base prefix) -> error[68; 72) token("0x_G") msg(Missing digits after the integer base prefix) +> error0..2 token("0b") msg(Missing digits after the integer base prefix) +> error3..5 token("0o") msg(Missing digits after the integer base prefix) +> error6..8 token("0x") msg(Missing digits after the integer base prefix) +> error10..13 token("0b_") msg(Missing digits after the integer base prefix) +> error14..17 token("0o_") msg(Missing digits after the integer base prefix) +> error18..21 token("0x_") msg(Missing digits after the integer base prefix) +> error23..32 token("0bnoDigit") msg(Missing digits after the integer base prefix) +> error33..42 token("0onoDigit") msg(Missing digits after the integer base prefix) +> error43..52 token("0xnoDigit") msg(Missing digits after the integer base prefix) +> error54..57 token("0xG") msg(Missing digits after the integer base prefix) +> error58..61 token("0xg") msg(Missing digits after the integer base prefix) +> error63..67 token("0x_g") msg(Missing digits after the integer base prefix) +> error68..72 token("0x_G") msg(Missing digits after the integer base prefix) diff --git a/crates/ra_syntax/test_data/lexer/err/0056_empty_exponent.txt b/crates/ra_syntax/test_data/lexer/err/0056_empty_exponent.txt index ab35e20a5c..6a645a6a44 100644 --- a/crates/ra_syntax/test_data/lexer/err/0056_empty_exponent.txt +++ b/crates/ra_syntax/test_data/lexer/err/0056_empty_exponent.txt @@ -46,17 +46,17 @@ FLOAT_NUMBER 9 "42.2E+f32" WHITESPACE 1 "\n" FLOAT_NUMBER 9 "42.2E-f32" WHITESPACE 1 "\n" -> error[0; 2) token("0e") msg(Missing digits after the exponent symbol) -> error[3; 5) token("0E") msg(Missing digits after the exponent symbol) -> error[7; 11) token("42e+") msg(Missing digits after the exponent symbol) -> error[12; 16) token("42e-") msg(Missing digits after the exponent symbol) -> error[17; 21) token("42E+") msg(Missing digits after the exponent symbol) -> error[22; 26) token("42E-") msg(Missing digits after the exponent symbol) -> error[53; 59) token("42.2e+") msg(Missing digits after the exponent symbol) -> error[60; 66) token("42.2e-") msg(Missing digits after the exponent symbol) -> error[67; 73) token("42.2E+") msg(Missing digits after the exponent symbol) -> error[74; 80) token("42.2E-") msg(Missing digits after the exponent symbol) -> error[82; 91) token("42.2e+f32") msg(Missing digits after the exponent symbol) -> error[92; 101) token("42.2e-f32") msg(Missing digits after the exponent symbol) -> error[102; 111) token("42.2E+f32") msg(Missing digits after the exponent symbol) -> error[112; 121) token("42.2E-f32") msg(Missing digits after the exponent symbol) +> error0..2 token("0e") msg(Missing digits after the exponent symbol) +> error3..5 token("0E") msg(Missing digits after the exponent symbol) +> error7..11 token("42e+") msg(Missing digits after the exponent symbol) +> error12..16 token("42e-") msg(Missing digits after the exponent symbol) +> error17..21 token("42E+") msg(Missing digits after the exponent symbol) +> error22..26 token("42E-") msg(Missing digits after the exponent symbol) +> error53..59 token("42.2e+") msg(Missing digits after the exponent symbol) +> error60..66 token("42.2e-") msg(Missing digits after the exponent symbol) +> error67..73 token("42.2E+") msg(Missing digits after the exponent symbol) +> error74..80 token("42.2E-") msg(Missing digits after the exponent symbol) +> error82..91 token("42.2e+f32") msg(Missing digits after the exponent symbol) +> error92..101 token("42.2e-f32") msg(Missing digits after the exponent symbol) +> error102..111 token("42.2E+f32") msg(Missing digits after the exponent symbol) +> error112..121 token("42.2E-f32") msg(Missing digits after the exponent symbol) diff --git a/crates/ra_syntax/test_data/lexer/err/0057_lifetime_strarts_with_a_number.txt b/crates/ra_syntax/test_data/lexer/err/0057_lifetime_strarts_with_a_number.txt index 89b38bfacf..e138bcebcd 100644 --- a/crates/ra_syntax/test_data/lexer/err/0057_lifetime_strarts_with_a_number.txt +++ b/crates/ra_syntax/test_data/lexer/err/0057_lifetime_strarts_with_a_number.txt @@ -2,5 +2,5 @@ LIFETIME 2 "\'1" WHITESPACE 1 "\n" LIFETIME 10 "\'1lifetime" WHITESPACE 1 "\n" -> error[0; 2) token("\'1") msg(Lifetime name cannot start with a number) -> error[3; 13) token("\'1lifetime") msg(Lifetime name cannot start with a number) +> error0..2 token("\'1") msg(Lifetime name cannot start with a number) +> error3..13 token("\'1lifetime") msg(Lifetime name cannot start with a number) diff --git a/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast b/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast index edcd936b07..81f0f575ce 100644 --- a/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast +++ b/crates/ra_syntax/test_data/parser/err/0000_struct_field_missing_comma.rast @@ -1,34 +1,34 @@ -SOURCE_FILE@[0; 34) - STRUCT_DEF@[0; 34) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - RECORD_FIELD_DEF_LIST@[9; 34) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - RECORD_FIELD_DEF@[15; 21) - NAME@[15; 16) - IDENT@[15; 16) "a" - COLON@[16; 17) ":" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 21) - PATH@[18; 21) - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "u32" - WHITESPACE@[21; 26) "\n " - RECORD_FIELD_DEF@[26; 32) - NAME@[26; 27) - IDENT@[26; 27) "b" - COLON@[27; 28) ":" - WHITESPACE@[28; 29) " " - PATH_TYPE@[29; 32) - PATH@[29; 32) - PATH_SEGMENT@[29; 32) - NAME_REF@[29; 32) - IDENT@[29; 32) "u32" - WHITESPACE@[32; 33) "\n" - R_CURLY@[33; 34) "}" -error [21; 21): expected COMMA +SOURCE_FILE@0..34 + STRUCT_DEF@0..34 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + RECORD_FIELD_DEF_LIST@9..34 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + RECORD_FIELD_DEF@15..21 + NAME@15..16 + IDENT@15..16 "a" + COLON@16..17 ":" + WHITESPACE@17..18 " " + PATH_TYPE@18..21 + PATH@18..21 + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "u32" + WHITESPACE@21..26 "\n " + RECORD_FIELD_DEF@26..32 + NAME@26..27 + IDENT@26..27 "b" + COLON@27..28 ":" + WHITESPACE@28..29 " " + PATH_TYPE@29..32 + PATH@29..32 + PATH_SEGMENT@29..32 + NAME_REF@29..32 + IDENT@29..32 "u32" + WHITESPACE@32..33 "\n" + R_CURLY@33..34 "}" +error 21..21: expected COMMA diff --git a/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast b/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast index 2d653715ea..97d0fe910c 100644 --- a/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast +++ b/crates/ra_syntax/test_data/parser/err/0001_item_recovery_in_file.rast @@ -1,18 +1,18 @@ -SOURCE_FILE@[0; 21) - ERROR@[0; 2) - IF_KW@[0; 2) "if" - WHITESPACE@[2; 3) " " - ERROR@[3; 8) - MATCH_KW@[3; 8) "match" - WHITESPACE@[8; 10) "\n\n" - STRUCT_DEF@[10; 21) - STRUCT_KW@[10; 16) "struct" - WHITESPACE@[16; 17) " " - NAME@[17; 18) - IDENT@[17; 18) "S" - WHITESPACE@[18; 19) " " - RECORD_FIELD_DEF_LIST@[19; 21) - L_CURLY@[19; 20) "{" - R_CURLY@[20; 21) "}" -error [0; 0): expected an item -error [3; 3): expected an item +SOURCE_FILE@0..21 + ERROR@0..2 + IF_KW@0..2 "if" + WHITESPACE@2..3 " " + ERROR@3..8 + MATCH_KW@3..8 "match" + WHITESPACE@8..10 "\n\n" + STRUCT_DEF@10..21 + STRUCT_KW@10..16 "struct" + WHITESPACE@16..17 " " + NAME@17..18 + IDENT@17..18 "S" + WHITESPACE@18..19 " " + RECORD_FIELD_DEF_LIST@19..21 + L_CURLY@19..20 "{" + R_CURLY@20..21 "}" +error 0..0: expected an item +error 3..3: expected an item 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 831bbf83fd..6717995e9b 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 @@ -1,39 +1,39 @@ -SOURCE_FILE@[0; 42) - SHEBANG@[0; 20) "#!/use/bin/env rusti" - WHITESPACE@[20; 21) "\n" - ATTR@[21; 23) - POUND@[21; 22) "#" - BANG@[22; 23) "!" - ERROR@[23; 24) - SLASH@[23; 24) "/" - USE_ITEM@[24; 28) - USE_KW@[24; 27) "use" - ERROR@[27; 28) - SLASH@[27; 28) "/" - MACRO_CALL@[28; 31) - PATH@[28; 31) - PATH_SEGMENT@[28; 31) - NAME_REF@[28; 31) - IDENT@[28; 31) "bin" - ERROR@[31; 32) - SLASH@[31; 32) "/" - MACRO_CALL@[32; 41) - PATH@[32; 35) - PATH_SEGMENT@[32; 35) - NAME_REF@[32; 35) - IDENT@[32; 35) "env" - WHITESPACE@[35; 36) " " - NAME@[36; 41) - IDENT@[36; 41) "rusti" - WHITESPACE@[41; 42) "\n" -error [23; 23): expected `[` -error [23; 23): expected an item -error [27; 27): expected one of `*`, `::`, `{`, `self`, `super` or an identifier -error [28; 28): expected SEMICOLON -error [31; 31): expected BANG -error [31; 31): expected `{`, `[`, `(` -error [31; 31): expected SEMICOLON -error [31; 31): expected an item -error [35; 35): expected BANG -error [41; 41): expected `{`, `[`, `(` -error [41; 41): expected SEMICOLON +SOURCE_FILE@0..42 + SHEBANG@0..20 "#!/use/bin/env rusti" + WHITESPACE@20..21 "\n" + ATTR@21..23 + POUND@21..22 "#" + BANG@22..23 "!" + ERROR@23..24 + SLASH@23..24 "/" + USE_ITEM@24..28 + USE_KW@24..27 "use" + ERROR@27..28 + SLASH@27..28 "/" + MACRO_CALL@28..31 + PATH@28..31 + PATH_SEGMENT@28..31 + NAME_REF@28..31 + IDENT@28..31 "bin" + ERROR@31..32 + SLASH@31..32 "/" + MACRO_CALL@32..41 + PATH@32..35 + PATH_SEGMENT@32..35 + NAME_REF@32..35 + IDENT@32..35 "env" + WHITESPACE@35..36 " " + NAME@36..41 + IDENT@36..41 "rusti" + WHITESPACE@41..42 "\n" +error 23..23: expected `[` +error 23..23: expected an item +error 27..27: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 28..28: expected SEMICOLON +error 31..31: expected BANG +error 31..31: expected `{`, `[`, `(` +error 31..31: expected SEMICOLON +error 31..31: expected an item +error 35..35: expected BANG +error 41..41: expected `{`, `[`, `(` +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 6b89e7572e..21c2556987 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 @@ -1,39 +1,39 @@ -SOURCE_FILE@[0; 40) - STRUCT_DEF@[0; 39) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - RECORD_FIELD_DEF_LIST@[9; 39) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - RECORD_FIELD_DEF@[15; 21) - NAME@[15; 16) - IDENT@[15; 16) "a" - COLON@[16; 17) ":" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 21) - PATH@[18; 21) - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "i32" - COMMA@[21; 22) "," - WHITESPACE@[22; 27) "\n " - RECORD_FIELD_DEF@[27; 36) - NAME@[27; 28) - IDENT@[27; 28) "b" - COLON@[28; 29) ":" - WHITESPACE@[29; 30) " " - PATH_TYPE@[30; 36) - PATH@[30; 36) - PATH_SEGMENT@[30; 36) - NAME_REF@[30; 36) - IDENT@[30; 36) "String" - COMMA@[36; 37) "," - WHITESPACE@[37; 38) "\n" - R_CURLY@[38; 39) "}" - ERROR@[39; 40) - SEMICOLON@[39; 40) ";" -error [39; 39): expected item, found `;` +SOURCE_FILE@0..40 + STRUCT_DEF@0..39 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + RECORD_FIELD_DEF_LIST@9..39 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + RECORD_FIELD_DEF@15..21 + NAME@15..16 + IDENT@15..16 "a" + COLON@16..17 ":" + WHITESPACE@17..18 " " + PATH_TYPE@18..21 + PATH@18..21 + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "i32" + COMMA@21..22 "," + WHITESPACE@22..27 "\n " + RECORD_FIELD_DEF@27..36 + NAME@27..28 + IDENT@27..28 "b" + COLON@28..29 ":" + WHITESPACE@29..30 " " + PATH_TYPE@30..36 + PATH@30..36 + PATH_SEGMENT@30..36 + NAME_REF@30..36 + IDENT@30..36 "String" + COMMA@36..37 "," + WHITESPACE@37..38 "\n" + R_CURLY@38..39 "}" + ERROR@39..40 + SEMICOLON@39..40 ";" +error 39..39: expected item, found `;` 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 1d27d4cd6f..8c6b89dc25 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 @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 12) - USE_ITEM@[0; 12) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 11) - PATH@[4; 11) - PATH@[4; 7) - PATH_SEGMENT@[4; 7) - NAME_REF@[4; 7) - IDENT@[4; 7) "foo" - COLON2@[7; 9) "::" - PATH_SEGMENT@[9; 11) - ERROR@[9; 11) - INT_NUMBER@[9; 11) "92" - SEMICOLON@[11; 12) ";" -error [9; 9): expected identifier +SOURCE_FILE@0..12 + USE_ITEM@0..12 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..11 + PATH@4..11 + PATH@4..7 + PATH_SEGMENT@4..7 + NAME_REF@4..7 + IDENT@4..7 "foo" + COLON2@7..9 "::" + PATH_SEGMENT@9..11 + ERROR@9..11 + INT_NUMBER@9..11 "92" + SEMICOLON@11..12 ";" +error 9..9: expected identifier diff --git a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast index cc11421a9a..95cc83caa3 100644 --- a/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0005_attribute_recover.rast @@ -1,60 +1,60 @@ -SOURCE_FILE@[0; 54) - FN_DEF@[0; 31) - ATTR@[0; 18) - POUND@[0; 1) "#" - L_BRACK@[1; 2) "[" - PATH@[2; 5) - PATH_SEGMENT@[2; 5) - NAME_REF@[2; 5) - IDENT@[2; 5) "foo" - TOKEN_TREE@[5; 17) - L_PAREN@[5; 6) "(" - IDENT@[6; 9) "foo" - COMMA@[9; 10) "," - WHITESPACE@[10; 11) " " - PLUS@[11; 12) "+" - COMMA@[12; 13) "," - WHITESPACE@[13; 14) " " - INT_NUMBER@[14; 16) "92" - R_PAREN@[16; 17) ")" - R_BRACK@[17; 18) "]" - WHITESPACE@[18; 19) "\n" - FN_KW@[19; 21) "fn" - WHITESPACE@[21; 22) " " - NAME@[22; 25) - IDENT@[22; 25) "foo" - PARAM_LIST@[25; 27) - L_PAREN@[25; 26) "(" - R_PAREN@[26; 27) ")" - WHITESPACE@[27; 28) " " - BLOCK_EXPR@[28; 31) - BLOCK@[28; 31) - L_CURLY@[28; 29) "{" - WHITESPACE@[29; 30) "\n" - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 34) "\n\n\n" - ATTR@[34; 53) - POUND@[34; 35) "#" - L_BRACK@[35; 36) "[" - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "foo" - TOKEN_TREE@[39; 53) - L_PAREN@[39; 40) "(" - WHITESPACE@[40; 41) "\n" - FN_KW@[41; 43) "fn" - WHITESPACE@[43; 44) " " - IDENT@[44; 47) "foo" - TOKEN_TREE@[47; 49) - L_PAREN@[47; 48) "(" - R_PAREN@[48; 49) ")" - WHITESPACE@[49; 50) " " - TOKEN_TREE@[50; 53) - L_CURLY@[50; 51) "{" - WHITESPACE@[51; 52) "\n" - R_CURLY@[52; 53) "}" - WHITESPACE@[53; 54) "\n" -error [53; 53): expected R_PAREN -error [53; 53): expected `]` -error [53; 53): expected an item +SOURCE_FILE@0..54 + FN_DEF@0..31 + ATTR@0..18 + POUND@0..1 "#" + L_BRACK@1..2 "[" + PATH@2..5 + PATH_SEGMENT@2..5 + NAME_REF@2..5 + IDENT@2..5 "foo" + TOKEN_TREE@5..17 + L_PAREN@5..6 "(" + IDENT@6..9 "foo" + COMMA@9..10 "," + WHITESPACE@10..11 " " + PLUS@11..12 "+" + COMMA@12..13 "," + WHITESPACE@13..14 " " + INT_NUMBER@14..16 "92" + R_PAREN@16..17 ")" + R_BRACK@17..18 "]" + WHITESPACE@18..19 "\n" + FN_KW@19..21 "fn" + WHITESPACE@21..22 " " + NAME@22..25 + IDENT@22..25 "foo" + PARAM_LIST@25..27 + L_PAREN@25..26 "(" + R_PAREN@26..27 ")" + WHITESPACE@27..28 " " + BLOCK_EXPR@28..31 + BLOCK@28..31 + L_CURLY@28..29 "{" + WHITESPACE@29..30 "\n" + R_CURLY@30..31 "}" + WHITESPACE@31..34 "\n\n\n" + ATTR@34..53 + POUND@34..35 "#" + L_BRACK@35..36 "[" + PATH@36..39 + PATH_SEGMENT@36..39 + NAME_REF@36..39 + IDENT@36..39 "foo" + TOKEN_TREE@39..53 + L_PAREN@39..40 "(" + WHITESPACE@40..41 "\n" + FN_KW@41..43 "fn" + WHITESPACE@43..44 " " + IDENT@44..47 "foo" + TOKEN_TREE@47..49 + L_PAREN@47..48 "(" + R_PAREN@48..49 ")" + WHITESPACE@49..50 " " + TOKEN_TREE@50..53 + L_CURLY@50..51 "{" + WHITESPACE@51..52 "\n" + R_CURLY@52..53 "}" + WHITESPACE@53..54 "\n" +error 53..53: expected R_PAREN +error 53..53: expected `]` +error 53..53: expected an item diff --git a/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast b/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast index 84fd928625..2d63649980 100644 --- a/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0006_named_field_recovery.rast @@ -1,74 +1,74 @@ -SOURCE_FILE@[0; 74) - STRUCT_DEF@[0; 73) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - RECORD_FIELD_DEF_LIST@[9; 73) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - RECORD_FIELD_DEF@[15; 21) - NAME@[15; 16) - IDENT@[15; 16) "f" - COLON@[16; 17) ":" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 21) - PATH@[18; 21) - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "u32" - COMMA@[21; 22) "," - WHITESPACE@[22; 27) "\n " - VISIBILITY@[27; 30) - PUB_KW@[27; 30) "pub" - WHITESPACE@[30; 31) " " - ERROR@[31; 33) - INT_NUMBER@[31; 33) "92" - WHITESPACE@[33; 38) "\n " - ERROR@[38; 39) - PLUS@[38; 39) "+" - WHITESPACE@[39; 40) " " - ERROR@[40; 41) - MINUS@[40; 41) "-" - WHITESPACE@[41; 42) " " - ERROR@[42; 43) - STAR@[42; 43) "*" - WHITESPACE@[43; 48) "\n " - RECORD_FIELD_DEF@[48; 58) - VISIBILITY@[48; 51) - PUB_KW@[48; 51) "pub" - WHITESPACE@[51; 52) " " - NAME@[52; 53) - IDENT@[52; 53) "x" - COLON@[53; 54) ":" - WHITESPACE@[54; 55) " " - PATH_TYPE@[55; 58) - PATH@[55; 58) - PATH_SEGMENT@[55; 58) - NAME_REF@[55; 58) - IDENT@[55; 58) "u32" - COMMA@[58; 59) "," - WHITESPACE@[59; 64) "\n " - RECORD_FIELD_DEF@[64; 70) - NAME@[64; 65) - IDENT@[64; 65) "z" - COLON@[65; 66) ":" - WHITESPACE@[66; 67) " " - PATH_TYPE@[67; 70) - PATH@[67; 70) - PATH_SEGMENT@[67; 70) - NAME_REF@[67; 70) - IDENT@[67; 70) "f64" - COMMA@[70; 71) "," - WHITESPACE@[71; 72) "\n" - R_CURLY@[72; 73) "}" - WHITESPACE@[73; 74) "\n" -error [31; 31): expected field declaration -error [33; 33): expected COMMA -error [38; 38): expected field declaration -error [39; 39): expected COMMA -error [40; 40): expected field declaration -error [41; 41): expected COMMA -error [42; 42): expected field declaration -error [43; 43): expected COMMA +SOURCE_FILE@0..74 + STRUCT_DEF@0..73 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + RECORD_FIELD_DEF_LIST@9..73 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + RECORD_FIELD_DEF@15..21 + NAME@15..16 + IDENT@15..16 "f" + COLON@16..17 ":" + WHITESPACE@17..18 " " + PATH_TYPE@18..21 + PATH@18..21 + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "u32" + COMMA@21..22 "," + WHITESPACE@22..27 "\n " + VISIBILITY@27..30 + PUB_KW@27..30 "pub" + WHITESPACE@30..31 " " + ERROR@31..33 + INT_NUMBER@31..33 "92" + WHITESPACE@33..38 "\n " + ERROR@38..39 + PLUS@38..39 "+" + WHITESPACE@39..40 " " + ERROR@40..41 + MINUS@40..41 "-" + WHITESPACE@41..42 " " + ERROR@42..43 + STAR@42..43 "*" + WHITESPACE@43..48 "\n " + RECORD_FIELD_DEF@48..58 + VISIBILITY@48..51 + PUB_KW@48..51 "pub" + WHITESPACE@51..52 " " + NAME@52..53 + IDENT@52..53 "x" + COLON@53..54 ":" + WHITESPACE@54..55 " " + PATH_TYPE@55..58 + PATH@55..58 + PATH_SEGMENT@55..58 + NAME_REF@55..58 + IDENT@55..58 "u32" + COMMA@58..59 "," + WHITESPACE@59..64 "\n " + RECORD_FIELD_DEF@64..70 + NAME@64..65 + IDENT@64..65 "z" + COLON@65..66 ":" + WHITESPACE@66..67 " " + PATH_TYPE@67..70 + PATH@67..70 + PATH_SEGMENT@67..70 + NAME_REF@67..70 + IDENT@67..70 "f64" + COMMA@70..71 "," + WHITESPACE@71..72 "\n" + R_CURLY@72..73 "}" + WHITESPACE@73..74 "\n" +error 31..31: expected field declaration +error 33..33: expected COMMA +error 38..38: expected field declaration +error 39..39: expected COMMA +error 40..40: expected field declaration +error 41..41: expected COMMA +error 42..42: expected field declaration +error 43..43: expected COMMA 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 c24e478f3d..dc3e120918 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 @@ -1,33 +1,33 @@ -SOURCE_FILE@[0; 31) - ERROR@[0; 1) - R_CURLY@[0; 1) "}" - WHITESPACE@[1; 3) "\n\n" - STRUCT_DEF@[3; 12) - STRUCT_KW@[3; 9) "struct" - WHITESPACE@[9; 10) " " - NAME@[10; 11) - IDENT@[10; 11) "S" - SEMICOLON@[11; 12) ";" - WHITESPACE@[12; 14) "\n\n" - ERROR@[14; 15) - R_CURLY@[14; 15) "}" - WHITESPACE@[15; 17) "\n\n" - FN_DEF@[17; 27) - FN_KW@[17; 19) "fn" - WHITESPACE@[19; 20) " " - NAME@[20; 23) - IDENT@[20; 23) "foo" - PARAM_LIST@[23; 25) - L_PAREN@[23; 24) "(" - R_PAREN@[24; 25) ")" - BLOCK_EXPR@[25; 27) - BLOCK@[25; 27) - L_CURLY@[25; 26) "{" - R_CURLY@[26; 27) "}" - WHITESPACE@[27; 29) "\n\n" - ERROR@[29; 30) - R_CURLY@[29; 30) "}" - WHITESPACE@[30; 31) "\n" -error [0; 0): unmatched `}` -error [14; 14): unmatched `}` -error [29; 29): unmatched `}` +SOURCE_FILE@0..31 + ERROR@0..1 + R_CURLY@0..1 "}" + WHITESPACE@1..3 "\n\n" + STRUCT_DEF@3..12 + STRUCT_KW@3..9 "struct" + WHITESPACE@9..10 " " + NAME@10..11 + IDENT@10..11 "S" + SEMICOLON@11..12 ";" + WHITESPACE@12..14 "\n\n" + ERROR@14..15 + R_CURLY@14..15 "}" + WHITESPACE@15..17 "\n\n" + FN_DEF@17..27 + FN_KW@17..19 "fn" + WHITESPACE@19..20 " " + NAME@20..23 + IDENT@20..23 "foo" + PARAM_LIST@23..25 + L_PAREN@23..24 "(" + R_PAREN@24..25 ")" + BLOCK_EXPR@25..27 + BLOCK@25..27 + L_CURLY@25..26 "{" + R_CURLY@26..27 "}" + WHITESPACE@27..29 "\n\n" + ERROR@29..30 + R_CURLY@29..30 "}" + WHITESPACE@30..31 "\n" +error 0..0: unmatched `}` +error 14..14: unmatched `}` +error 29..29: unmatched `}` 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 9f5041ae4c..97539fcf2a 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 @@ -1,81 +1,81 @@ -SOURCE_FILE@[0; 95) - FN_DEF@[0; 12) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 12) - BLOCK@[9; 12) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) "\n" - R_CURLY@[11; 12) "}" - WHITESPACE@[12; 14) "\n\n" - MACRO_CALL@[14; 19) - PATH@[14; 17) - PATH_SEGMENT@[14; 17) - NAME_REF@[14; 17) - IDENT@[14; 17) "bar" - TOKEN_TREE@[17; 19) - L_PAREN@[17; 18) "(" - R_PAREN@[18; 19) ")" - WHITESPACE@[19; 20) " " - ERROR@[20; 80) - L_CURLY@[20; 21) "{" - WHITESPACE@[21; 26) "\n " - IF_EXPR@[26; 78) - IF_KW@[26; 28) "if" - WHITESPACE@[28; 29) " " - CONDITION@[29; 33) - LITERAL@[29; 33) - TRUE_KW@[29; 33) "true" - WHITESPACE@[33; 34) " " - BLOCK_EXPR@[34; 51) - BLOCK@[34; 51) - L_CURLY@[34; 35) "{" - WHITESPACE@[35; 44) "\n " - LITERAL@[44; 45) - INT_NUMBER@[44; 45) "1" - WHITESPACE@[45; 50) "\n " - R_CURLY@[50; 51) "}" - WHITESPACE@[51; 52) " " - ELSE_KW@[52; 56) "else" - WHITESPACE@[56; 57) " " - BLOCK_EXPR@[57; 78) - BLOCK@[57; 78) - L_CURLY@[57; 58) "{" - WHITESPACE@[58; 67) "\n " - BIN_EXPR@[67; 72) - LITERAL@[67; 68) - INT_NUMBER@[67; 68) "2" - WHITESPACE@[68; 69) " " - PLUS@[69; 70) "+" - WHITESPACE@[70; 71) " " - LITERAL@[71; 72) - INT_NUMBER@[71; 72) "3" - WHITESPACE@[72; 77) "\n " - R_CURLY@[77; 78) "}" - WHITESPACE@[78; 79) "\n" - R_CURLY@[79; 80) "}" - WHITESPACE@[80; 82) "\n\n" - FN_DEF@[82; 94) - FN_KW@[82; 84) "fn" - WHITESPACE@[84; 85) " " - NAME@[85; 88) - IDENT@[85; 88) "baz" - PARAM_LIST@[88; 90) - L_PAREN@[88; 89) "(" - R_PAREN@[89; 90) ")" - WHITESPACE@[90; 91) " " - BLOCK_EXPR@[91; 94) - BLOCK@[91; 94) - L_CURLY@[91; 92) "{" - WHITESPACE@[92; 93) "\n" - R_CURLY@[93; 94) "}" - WHITESPACE@[94; 95) "\n" -error [17; 17): expected BANG -error [19; 19): expected SEMICOLON -error [20; 20): expected an item +SOURCE_FILE@0..95 + FN_DEF@0..12 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..12 + BLOCK@9..12 + L_CURLY@9..10 "{" + WHITESPACE@10..11 "\n" + R_CURLY@11..12 "}" + WHITESPACE@12..14 "\n\n" + MACRO_CALL@14..19 + PATH@14..17 + PATH_SEGMENT@14..17 + NAME_REF@14..17 + IDENT@14..17 "bar" + TOKEN_TREE@17..19 + L_PAREN@17..18 "(" + R_PAREN@18..19 ")" + WHITESPACE@19..20 " " + ERROR@20..80 + L_CURLY@20..21 "{" + WHITESPACE@21..26 "\n " + IF_EXPR@26..78 + IF_KW@26..28 "if" + WHITESPACE@28..29 " " + CONDITION@29..33 + LITERAL@29..33 + TRUE_KW@29..33 "true" + WHITESPACE@33..34 " " + BLOCK_EXPR@34..51 + BLOCK@34..51 + L_CURLY@34..35 "{" + WHITESPACE@35..44 "\n " + LITERAL@44..45 + INT_NUMBER@44..45 "1" + WHITESPACE@45..50 "\n " + R_CURLY@50..51 "}" + WHITESPACE@51..52 " " + ELSE_KW@52..56 "else" + WHITESPACE@56..57 " " + BLOCK_EXPR@57..78 + BLOCK@57..78 + L_CURLY@57..58 "{" + WHITESPACE@58..67 "\n " + BIN_EXPR@67..72 + LITERAL@67..68 + INT_NUMBER@67..68 "2" + WHITESPACE@68..69 " " + PLUS@69..70 "+" + WHITESPACE@70..71 " " + LITERAL@71..72 + INT_NUMBER@71..72 "3" + WHITESPACE@72..77 "\n " + R_CURLY@77..78 "}" + WHITESPACE@78..79 "\n" + R_CURLY@79..80 "}" + WHITESPACE@80..82 "\n\n" + FN_DEF@82..94 + FN_KW@82..84 "fn" + WHITESPACE@84..85 " " + NAME@85..88 + IDENT@85..88 "baz" + PARAM_LIST@88..90 + L_PAREN@88..89 "(" + R_PAREN@89..90 ")" + WHITESPACE@90..91 " " + BLOCK_EXPR@91..94 + BLOCK@91..94 + L_CURLY@91..92 "{" + WHITESPACE@92..93 "\n" + R_CURLY@93..94 "}" + WHITESPACE@94..95 "\n" +error 17..17: expected BANG +error 19..19: expected SEMICOLON +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 7ed80477d5..aca02ece49 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 @@ -1,58 +1,58 @@ -SOURCE_FILE@[0; 43) - STRUCT_DEF@[0; 11) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - TYPE_PARAM_LIST@[8; 11) - L_ANGLE@[8; 9) "<" - ERROR@[9; 11) - INT_NUMBER@[9; 11) "90" - WHITESPACE@[11; 12) " " - ERROR@[12; 13) - PLUS@[12; 13) "+" - WHITESPACE@[13; 14) " " - ERROR@[14; 15) - INT_NUMBER@[14; 15) "2" - ERROR@[15; 16) - R_ANGLE@[15; 16) ">" - WHITESPACE@[16; 17) " " - ERROR@[17; 31) - L_CURLY@[17; 18) "{" - WHITESPACE@[18; 23) "\n " - EXPR_STMT@[23; 24) - PATH_EXPR@[23; 24) - PATH@[23; 24) - PATH_SEGMENT@[23; 24) - NAME_REF@[23; 24) - IDENT@[23; 24) "f" - EXPR_STMT@[24; 25) - ERROR@[24; 25) - COLON@[24; 25) ":" - WHITESPACE@[25; 26) " " - PATH_EXPR@[26; 29) - PATH@[26; 29) - PATH_SEGMENT@[26; 29) - NAME_REF@[26; 29) - IDENT@[26; 29) "u32" - WHITESPACE@[29; 30) "\n" - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 33) "\n\n" - STRUCT_DEF@[33; 42) - STRUCT_KW@[33; 39) "struct" - WHITESPACE@[39; 40) " " - NAME@[40; 41) - IDENT@[40; 41) "T" - SEMICOLON@[41; 42) ";" - WHITESPACE@[42; 43) "\n" -error [9; 9): expected type parameter -error [11; 11): expected COMMA -error [11; 11): expected R_ANGLE -error [11; 11): expected `;`, `{`, or `(` -error [12; 12): expected an item -error [14; 14): expected an item -error [15; 15): expected an item -error [17; 17): expected an item -error [24; 24): expected SEMICOLON -error [24; 24): expected expression -error [25; 25): expected SEMICOLON +SOURCE_FILE@0..43 + STRUCT_DEF@0..11 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + TYPE_PARAM_LIST@8..11 + L_ANGLE@8..9 "<" + ERROR@9..11 + INT_NUMBER@9..11 "90" + WHITESPACE@11..12 " " + ERROR@12..13 + PLUS@12..13 "+" + WHITESPACE@13..14 " " + ERROR@14..15 + INT_NUMBER@14..15 "2" + ERROR@15..16 + R_ANGLE@15..16 ">" + WHITESPACE@16..17 " " + ERROR@17..31 + L_CURLY@17..18 "{" + WHITESPACE@18..23 "\n " + EXPR_STMT@23..24 + PATH_EXPR@23..24 + PATH@23..24 + PATH_SEGMENT@23..24 + NAME_REF@23..24 + IDENT@23..24 "f" + EXPR_STMT@24..25 + ERROR@24..25 + COLON@24..25 ":" + WHITESPACE@25..26 " " + PATH_EXPR@26..29 + PATH@26..29 + PATH_SEGMENT@26..29 + NAME_REF@26..29 + IDENT@26..29 "u32" + WHITESPACE@29..30 "\n" + R_CURLY@30..31 "}" + WHITESPACE@31..33 "\n\n" + STRUCT_DEF@33..42 + STRUCT_KW@33..39 "struct" + WHITESPACE@39..40 " " + NAME@40..41 + IDENT@40..41 "T" + SEMICOLON@41..42 ";" + WHITESPACE@42..43 "\n" +error 9..9: expected type parameter +error 11..11: expected COMMA +error 11..11: expected R_ANGLE +error 11..11: expected `;`, `{`, or `(` +error 12..12: expected an item +error 14..14: expected an item +error 15..15: expected an item +error 17..17: expected an item +error 24..24: expected SEMICOLON +error 24..24: expected expression +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 5559c3297a..e10bb81746 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 @@ -1,45 +1,45 @@ -SOURCE_FILE@[0; 42) - FN_DEF@[0; 41) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 41) - BLOCK@[10; 41) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - EXPR_STMT@[16; 24) - LAMBDA_EXPR@[16; 24) - PARAM_LIST@[16; 18) - PIPE@[16; 17) "|" - PIPE@[17; 18) "|" - WHITESPACE@[18; 19) " " - RET_TYPE@[19; 24) - THIN_ARROW@[19; 21) "->" - WHITESPACE@[21; 22) " " - TUPLE_TYPE@[22; 24) - L_PAREN@[22; 23) "(" - R_PAREN@[23; 24) ")" - WHITESPACE@[24; 25) " " - EXPR_STMT@[25; 39) - BLOCK_EXPR@[25; 38) - UNSAFE_KW@[25; 31) "unsafe" - WHITESPACE@[31; 32) " " - BLOCK@[32; 38) - L_CURLY@[32; 33) "{" - WHITESPACE@[33; 34) " " - TUPLE_EXPR@[34; 36) - L_PAREN@[34; 35) "(" - R_PAREN@[35; 36) ")" - WHITESPACE@[36; 37) " " - R_CURLY@[37; 38) "}" - SEMICOLON@[38; 39) ";" - WHITESPACE@[39; 40) "\n" - R_CURLY@[40; 41) "}" - WHITESPACE@[41; 42) "\n" -error [24; 24): expected `{` -error [24; 24): expected SEMICOLON +SOURCE_FILE@0..42 + FN_DEF@0..41 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..41 + BLOCK@10..41 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..24 + LAMBDA_EXPR@16..24 + PARAM_LIST@16..18 + PIPE@16..17 "|" + PIPE@17..18 "|" + WHITESPACE@18..19 " " + RET_TYPE@19..24 + THIN_ARROW@19..21 "->" + WHITESPACE@21..22 " " + TUPLE_TYPE@22..24 + L_PAREN@22..23 "(" + R_PAREN@23..24 ")" + WHITESPACE@24..25 " " + EXPR_STMT@25..39 + BLOCK_EXPR@25..38 + UNSAFE_KW@25..31 "unsafe" + WHITESPACE@31..32 " " + BLOCK@32..38 + L_CURLY@32..33 "{" + WHITESPACE@33..34 " " + TUPLE_EXPR@34..36 + L_PAREN@34..35 "(" + R_PAREN@35..36 ")" + WHITESPACE@36..37 " " + R_CURLY@37..38 "}" + SEMICOLON@38..39 ";" + WHITESPACE@39..40 "\n" + R_CURLY@40..41 "}" + WHITESPACE@41..42 "\n" +error 24..24: expected `{` +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 99c212fd66..87c54c32cf 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 @@ -1,13 +1,13 @@ -SOURCE_FILE@[0; 19) - ERROR@[0; 6) - ABI@[0; 6) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - STRUCT_DEF@[7; 18) - STRUCT_KW@[7; 13) "struct" - WHITESPACE@[13; 14) " " - NAME@[14; 17) - IDENT@[14; 17) "Foo" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" -error [6; 6): expected existential, fn, trait or impl +SOURCE_FILE@0..19 + ERROR@0..6 + ABI@0..6 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + STRUCT_DEF@7..18 + STRUCT_KW@7..13 "struct" + WHITESPACE@13..14 " " + NAME@14..17 + IDENT@14..17 "Foo" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" +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 0a3c0313d1..e1e782f5f3 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 @@ -1,387 +1,387 @@ -SOURCE_FILE@[0; 389) - FN_DEF@[0; 389) - VISIBILITY@[0; 10) - PUB_KW@[0; 3) - L_PAREN@[3; 4) - SUPER_KW@[4; 9) - R_PAREN@[9; 10) - WHITESPACE@[10; 11) - FN_KW@[11; 13) - WHITESPACE@[13; 14) - NAME@[14; 21) - IDENT@[14; 21) "process" - TYPE_PARAM_LIST@[21; 38) - L_ANGLE@[21; 22) - LIFETIME_PARAM@[22; 24) - LIFETIME@[22; 24) "'a" - COMMA@[24; 25) - WHITESPACE@[25; 26) - TYPE_PARAM@[26; 37) - NAME@[26; 27) - IDENT@[26; 27) "S" - COLON@[27; 28) - WHITESPACE@[28; 29) - PATH@[29; 37) - PATH_SEGMENT@[29; 37) - NAME_REF@[29; 33) - IDENT@[29; 33) "Sink" - TYPE_ARG_LIST@[33; 37) - L_ANGLE@[33; 34) - LIFETIME_ARG@[34; 36) - LIFETIME@[34; 36) "'a" - R_ANGLE@[36; 37) - R_ANGLE@[37; 38) - PARAM_LIST@[38; 93) - L_PAREN@[38; 39) - PARAM@[39; 54) - BIND_PAT@[39; 46) - NAME@[39; 46) - IDENT@[39; 46) "builder" - COLON@[46; 47) - WHITESPACE@[47; 48) - REFERENCE_TYPE@[48; 54) - AMP@[48; 49) - MUT_KW@[49; 52) - WHITESPACE@[52; 53) - PATH_TYPE@[53; 54) - PATH@[53; 54) - PATH_SEGMENT@[53; 54) - NAME_REF@[53; 54) - IDENT@[53; 54) "S" - COMMA@[54; 55) - WHITESPACE@[55; 56) - PARAM@[56; 72) - BIND_PAT@[56; 62) - NAME@[56; 62) - IDENT@[56; 62) "tokens" - COLON@[62; 63) - WHITESPACE@[63; 64) - REFERENCE_TYPE@[64; 72) - AMP@[64; 65) - SLICE_TYPE@[65; 72) - L_BRACK@[65; 66) - PATH_TYPE@[66; 71) - PATH@[66; 71) - PATH_SEGMENT@[66; 71) - NAME_REF@[66; 71) - IDENT@[66; 71) "Token" - R_BRACK@[71; 72) - COMMA@[72; 73) - WHITESPACE@[73; 74) - PARAM@[74; 92) - BIND_PAT@[74; 80) - NAME@[74; 80) - IDENT@[74; 80) "events" - COLON@[80; 81) - WHITESPACE@[81; 82) - PATH_TYPE@[82; 92) - PATH@[82; 92) - PATH_SEGMENT@[82; 92) - NAME_REF@[82; 85) - IDENT@[82; 85) "Vec" - TYPE_ARG_LIST@[85; 92) - L_ANGLE@[85; 86) - TYPE_ARG@[86; 91) - PATH_TYPE@[86; 91) - PATH@[86; 91) - PATH_SEGMENT@[86; 91) - NAME_REF@[86; 91) - IDENT@[86; 91) "Event" - R_ANGLE@[91; 92) - R_PAREN@[92; 93) - WHITESPACE@[93; 94) - BLOCK_EXPR@[94; 389) - L_CURLY@[94; 95) - WHITESPACE@[95; 100) - LET_STMT@[100; 125) - LET_KW@[100; 103) - WHITESPACE@[103; 104) - BIND_PAT@[104; 120) - MUT_KW@[104; 107) - WHITESPACE@[107; 108) - NAME@[108; 120) - IDENT@[108; 120) "next_tok_idx" - WHITESPACE@[120; 121) - EQ@[121; 122) - WHITESPACE@[122; 123) - LITERAL@[123; 124) - INT_NUMBER@[123; 124) "0" - SEMICOLON@[124; 125) - WHITESPACE@[125; 130) - LET_STMT@[130; 389) - LET_KW@[130; 133) - WHITESPACE@[133; 134) - BIND_PAT@[134; 140) - NAME@[134; 140) - IDENT@[134; 140) "eat_ws" - WHITESPACE@[140; 141) - EQ@[141; 142) - WHITESPACE@[142; 143) - LAMBDA_EXPR@[143; 389) - PARAM_LIST@[143; 388) - PIPE@[143; 144) - PARAM@[144; 159) - BIND_PAT@[144; 147) - NAME@[144; 147) - IDENT@[144; 147) "idx" - COLON@[147; 148) - WHITESPACE@[148; 149) - REFERENCE_TYPE@[149; 159) - AMP@[149; 150) - MUT_KW@[150; 153) - WHITESPACE@[153; 154) - PATH_TYPE@[154; 159) - PATH@[154; 159) - PATH_SEGMENT@[154; 159) - NAME_REF@[154; 159) - IDENT@[154; 159) "usize" - COMMA@[159; 160) - WHITESPACE@[160; 161) - PARAM@[161; 167) - REF_PAT@[161; 167) - AMP@[161; 162) - MUT_KW@[162; 165) - WHITESPACE@[165; 166) +SOURCE_FILE@0..389 + FN_DEF@0..389 + VISIBILITY@0..10 + PUB_KW@0..3 + L_PAREN@3..4 + SUPER_KW@4..9 + R_PAREN@9..10 + WHITESPACE@10..11 + FN_KW@11..13 + WHITESPACE@13..14 + NAME@14..21 + IDENT@14..21 "process" + TYPE_PARAM_LIST@21..38 + L_ANGLE@21..22 + LIFETIME_PARAM@22..24 + LIFETIME@22..24 "'a" + COMMA@24..25 + WHITESPACE@25..26 + TYPE_PARAM@26..37 + NAME@26..27 + IDENT@26..27 "S" + COLON@27..28 + WHITESPACE@28..29 + PATH@29..37 + PATH_SEGMENT@29..37 + NAME_REF@29..33 + IDENT@29..33 "Sink" + TYPE_ARG_LIST@33..37 + L_ANGLE@33..34 + LIFETIME_ARG@34..36 + LIFETIME@34..36 "'a" + R_ANGLE@36..37 + R_ANGLE@37..38 + PARAM_LIST@38..93 + L_PAREN@38..39 + PARAM@39..54 + BIND_PAT@39..46 + NAME@39..46 + IDENT@39..46 "builder" + COLON@46..47 + WHITESPACE@47..48 + REFERENCE_TYPE@48..54 + AMP@48..49 + MUT_KW@49..52 + WHITESPACE@52..53 + PATH_TYPE@53..54 + PATH@53..54 + PATH_SEGMENT@53..54 + NAME_REF@53..54 + IDENT@53..54 "S" + COMMA@54..55 + WHITESPACE@55..56 + PARAM@56..72 + BIND_PAT@56..62 + NAME@56..62 + IDENT@56..62 "tokens" + COLON@62..63 + WHITESPACE@63..64 + REFERENCE_TYPE@64..72 + AMP@64..65 + SLICE_TYPE@65..72 + L_BRACK@65..66 + PATH_TYPE@66..71 + PATH@66..71 + PATH_SEGMENT@66..71 + NAME_REF@66..71 + IDENT@66..71 "Token" + R_BRACK@71..72 + COMMA@72..73 + WHITESPACE@73..74 + PARAM@74..92 + BIND_PAT@74..80 + NAME@74..80 + IDENT@74..80 "events" + COLON@80..81 + WHITESPACE@81..82 + PATH_TYPE@82..92 + PATH@82..92 + PATH_SEGMENT@82..92 + NAME_REF@82..85 + IDENT@82..85 "Vec" + TYPE_ARG_LIST@85..92 + L_ANGLE@85..86 + TYPE_ARG@86..91 + PATH_TYPE@86..91 + PATH@86..91 + PATH_SEGMENT@86..91 + NAME_REF@86..91 + IDENT@86..91 "Event" + R_ANGLE@91..92 + R_PAREN@92..93 + WHITESPACE@93..94 + BLOCK_EXPR@94..389 + L_CURLY@94..95 + WHITESPACE@95..100 + LET_STMT@100..125 + LET_KW@100..103 + WHITESPACE@103..104 + BIND_PAT@104..120 + MUT_KW@104..107 + WHITESPACE@107..108 + NAME@108..120 + IDENT@108..120 "next_tok_idx" + WHITESPACE@120..121 + EQ@121..122 + WHITESPACE@122..123 + LITERAL@123..124 + INT_NUMBER@123..124 "0" + SEMICOLON@124..125 + WHITESPACE@125..130 + LET_STMT@130..389 + LET_KW@130..133 + WHITESPACE@133..134 + BIND_PAT@134..140 + NAME@134..140 + IDENT@134..140 "eat_ws" + WHITESPACE@140..141 + EQ@141..142 + WHITESPACE@142..143 + LAMBDA_EXPR@143..389 + PARAM_LIST@143..388 + PIPE@143..144 + PARAM@144..159 + BIND_PAT@144..147 + NAME@144..147 + IDENT@144..147 "idx" + COLON@147..148 + WHITESPACE@148..149 + REFERENCE_TYPE@149..159 + AMP@149..150 + MUT_KW@150..153 + WHITESPACE@153..154 + PATH_TYPE@154..159 + PATH@154..159 + PATH_SEGMENT@154..159 + NAME_REF@154..159 + IDENT@154..159 "usize" + COMMA@159..160 + WHITESPACE@160..161 + PARAM@161..167 + REF_PAT@161..167 + AMP@161..162 + MUT_KW@162..165 + WHITESPACE@165..166 err: `expected pattern` - ERROR@[166; 167) - PIPE@[166; 167) + ERROR@166..167 + PIPE@166..167 err: `expected COMMA` - WHITESPACE@[167; 168) + WHITESPACE@167..168 err: `expected pattern` - PARAM@[168; 169) - ERROR@[168; 169) - L_CURLY@[168; 169) + PARAM@168..169 + ERROR@168..169 + L_CURLY@168..169 err: `expected COMMA` - WHITESPACE@[169; 178) + WHITESPACE@169..178 err: `expected pattern` - PARAM@[178; 183) - ERROR@[178; 183) - WHILE_KW@[178; 183) + PARAM@178..183 + ERROR@178..183 + WHILE_KW@178..183 err: `expected COMMA` - WHITESPACE@[183; 184) + WHITESPACE@183..184 err: `expected pattern` - PARAM@[184; 187) - ERROR@[184; 187) - LET_KW@[184; 187) + PARAM@184..187 + ERROR@184..187 + LET_KW@184..187 err: `expected COMMA` - WHITESPACE@[187; 188) - PARAM@[188; 199) - TUPLE_STRUCT_PAT@[188; 199) - PATH@[188; 192) - PATH_SEGMENT@[188; 192) - NAME_REF@[188; 192) - IDENT@[188; 192) "Some" - L_PAREN@[192; 193) - BIND_PAT@[193; 198) - NAME@[193; 198) - IDENT@[193; 198) "token" - R_PAREN@[198; 199) + WHITESPACE@187..188 + PARAM@188..199 + TUPLE_STRUCT_PAT@188..199 + PATH@188..192 + PATH_SEGMENT@188..192 + NAME_REF@188..192 + IDENT@188..192 "Some" + L_PAREN@192..193 + BIND_PAT@193..198 + NAME@193..198 + IDENT@193..198 "token" + R_PAREN@198..199 err: `expected COMMA` - WHITESPACE@[199; 200) + WHITESPACE@199..200 err: `expected pattern` - PARAM@[200; 201) - ERROR@[200; 201) - EQ@[200; 201) + PARAM@200..201 + ERROR@200..201 + EQ@200..201 err: `expected COMMA` - WHITESPACE@[201; 202) - PARAM@[202; 208) - BIND_PAT@[202; 208) - NAME@[202; 208) - IDENT@[202; 208) "tokens" + WHITESPACE@201..202 + PARAM@202..208 + BIND_PAT@202..208 + NAME@202..208 + IDENT@202..208 "tokens" err: `expected COMMA` err: `expected pattern` - PARAM@[208; 209) - ERROR@[208; 209) - DOT@[208; 209) + PARAM@208..209 + ERROR@208..209 + DOT@208..209 err: `expected COMMA` - PARAM@[209; 218) - TUPLE_STRUCT_PAT@[209; 218) - PATH@[209; 212) - PATH_SEGMENT@[209; 212) - NAME_REF@[209; 212) - IDENT@[209; 212) "get" - L_PAREN@[212; 213) + PARAM@209..218 + TUPLE_STRUCT_PAT@209..218 + PATH@209..212 + PATH_SEGMENT@209..212 + NAME_REF@209..212 + IDENT@209..212 "get" + L_PAREN@212..213 err: `expected pattern` - ERROR@[213; 214) - STAR@[213; 214) + ERROR@213..214 + STAR@213..214 err: `expected COMMA` - BIND_PAT@[214; 217) - NAME@[214; 217) - IDENT@[214; 217) "idx" - R_PAREN@[217; 218) + BIND_PAT@214..217 + NAME@214..217 + IDENT@214..217 "idx" + R_PAREN@217..218 err: `expected COMMA` - WHITESPACE@[218; 219) + WHITESPACE@218..219 err: `expected pattern` - PARAM@[219; 220) - ERROR@[219; 220) - L_CURLY@[219; 220) + PARAM@219..220 + ERROR@219..220 + L_CURLY@219..220 err: `expected COMMA` - WHITESPACE@[220; 233) + WHITESPACE@220..233 err: `expected pattern` - PARAM@[233; 235) - ERROR@[233; 235) - IF_KW@[233; 235) + PARAM@233..235 + ERROR@233..235 + IF_KW@233..235 err: `expected COMMA` - WHITESPACE@[235; 236) + WHITESPACE@235..236 err: `expected pattern` - PARAM@[236; 237) - ERROR@[236; 237) - BANG@[236; 237) + PARAM@236..237 + ERROR@236..237 + BANG@236..237 err: `expected COMMA` - PARAM@[237; 242) - BIND_PAT@[237; 242) - NAME@[237; 242) - IDENT@[237; 242) "token" + PARAM@237..242 + BIND_PAT@237..242 + NAME@237..242 + IDENT@237..242 "token" err: `expected COMMA` err: `expected pattern` - PARAM@[242; 243) - ERROR@[242; 243) - DOT@[242; 243) + PARAM@242..243 + ERROR@242..243 + DOT@242..243 err: `expected COMMA` - PARAM@[243; 247) - BIND_PAT@[243; 247) - NAME@[243; 247) - IDENT@[243; 247) "kind" + PARAM@243..247 + BIND_PAT@243..247 + NAME@243..247 + IDENT@243..247 "kind" err: `expected COMMA` err: `expected pattern` - PARAM@[247; 248) - ERROR@[247; 248) - DOT@[247; 248) + PARAM@247..248 + ERROR@247..248 + DOT@247..248 err: `expected COMMA` - PARAM@[248; 259) - TUPLE_STRUCT_PAT@[248; 259) - PATH@[248; 257) - PATH_SEGMENT@[248; 257) - NAME_REF@[248; 257) - IDENT@[248; 257) "is_trivia" - L_PAREN@[257; 258) - R_PAREN@[258; 259) + PARAM@248..259 + TUPLE_STRUCT_PAT@248..259 + PATH@248..257 + PATH_SEGMENT@248..257 + NAME_REF@248..257 + IDENT@248..257 "is_trivia" + L_PAREN@257..258 + R_PAREN@258..259 err: `expected COMMA` - WHITESPACE@[259; 260) + WHITESPACE@259..260 err: `expected pattern` - PARAM@[260; 261) - ERROR@[260; 261) - L_CURLY@[260; 261) + PARAM@260..261 + ERROR@260..261 + L_CURLY@260..261 err: `expected COMMA` - WHITESPACE@[261; 278) - PARAM@[278; 283) - BIND_PAT@[278; 283) - NAME@[278; 283) - IDENT@[278; 283) "break" + WHITESPACE@261..278 + PARAM@278..283 + BIND_PAT@278..283 + NAME@278..283 + IDENT@278..283 "break" err: `expected COMMA` err: `expected pattern` - PARAM@[283; 284) - ERROR@[283; 284) - SEMICOLON@[283; 284) + PARAM@283..284 + ERROR@283..284 + SEMICOLON@283..284 err: `expected COMMA` - WHITESPACE@[284; 297) + WHITESPACE@284..297 err: `expected pattern` - PARAM@[297; 298) - ERROR@[297; 298) - R_CURLY@[297; 298) + PARAM@297..298 + ERROR@297..298 + R_CURLY@297..298 err: `expected COMMA` - WHITESPACE@[298; 311) - PARAM@[311; 318) - BIND_PAT@[311; 318) - NAME@[311; 318) - IDENT@[311; 318) "builder" + WHITESPACE@298..311 + PARAM@311..318 + BIND_PAT@311..318 + NAME@311..318 + IDENT@311..318 "builder" err: `expected COMMA` err: `expected pattern` - PARAM@[318; 319) - ERROR@[318; 319) - DOT@[318; 319) + PARAM@318..319 + ERROR@318..319 + DOT@318..319 err: `expected COMMA` - PARAM@[319; 346) - TUPLE_STRUCT_PAT@[319; 346) - PATH@[319; 323) - PATH_SEGMENT@[319; 323) - NAME_REF@[319; 323) - IDENT@[319; 323) "leaf" - L_PAREN@[323; 324) - BIND_PAT@[324; 329) - NAME@[324; 329) - IDENT@[324; 329) "token" + PARAM@319..346 + TUPLE_STRUCT_PAT@319..346 + PATH@319..323 + PATH_SEGMENT@319..323 + NAME_REF@319..323 + IDENT@319..323 "leaf" + L_PAREN@323..324 + BIND_PAT@324..329 + NAME@324..329 + IDENT@324..329 "token" err: `expected COMMA` err: `expected pattern` - ERROR@[329; 330) - DOT@[329; 330) + ERROR@329..330 + DOT@329..330 err: `expected COMMA` - BIND_PAT@[330; 334) - NAME@[330; 334) - IDENT@[330; 334) "kind" - COMMA@[334; 335) - WHITESPACE@[335; 336) - BIND_PAT@[336; 341) - NAME@[336; 341) - IDENT@[336; 341) "token" + BIND_PAT@330..334 + NAME@330..334 + IDENT@330..334 "kind" + COMMA@334..335 + WHITESPACE@335..336 + BIND_PAT@336..341 + NAME@336..341 + IDENT@336..341 "token" err: `expected COMMA` err: `expected pattern` - ERROR@[341; 342) - DOT@[341; 342) + ERROR@341..342 + DOT@341..342 err: `expected COMMA` - BIND_PAT@[342; 345) - NAME@[342; 345) - IDENT@[342; 345) "len" - R_PAREN@[345; 346) + BIND_PAT@342..345 + NAME@342..345 + IDENT@342..345 "len" + R_PAREN@345..346 err: `expected COMMA` err: `expected pattern` - PARAM@[346; 347) - ERROR@[346; 347) - SEMICOLON@[346; 347) + PARAM@346..347 + ERROR@346..347 + SEMICOLON@346..347 err: `expected COMMA` - WHITESPACE@[347; 360) + WHITESPACE@347..360 err: `expected pattern` - PARAM@[360; 361) - ERROR@[360; 361) - STAR@[360; 361) + PARAM@360..361 + ERROR@360..361 + STAR@360..361 err: `expected COMMA` - PARAM@[361; 364) - BIND_PAT@[361; 364) - NAME@[361; 364) - IDENT@[361; 364) "idx" + PARAM@361..364 + BIND_PAT@361..364 + NAME@361..364 + IDENT@361..364 "idx" err: `expected COMMA` - WHITESPACE@[364; 365) + WHITESPACE@364..365 err: `expected pattern` - PARAM@[365; 366) - ERROR@[365; 366) - PLUS@[365; 366) + PARAM@365..366 + ERROR@365..366 + PLUS@365..366 err: `expected COMMA` err: `expected pattern` - PARAM@[366; 367) - ERROR@[366; 367) - EQ@[366; 367) + PARAM@366..367 + ERROR@366..367 + EQ@366..367 err: `expected COMMA` - WHITESPACE@[367; 368) - PARAM@[368; 369) - LITERAL@[368; 369) - INT_NUMBER@[368; 369) "1" + WHITESPACE@367..368 + PARAM@368..369 + LITERAL@368..369 + INT_NUMBER@368..369 "1" err: `expected COMMA` - WHITESPACE@[369; 378) + WHITESPACE@369..378 err: `expected pattern` - PARAM@[378; 379) - ERROR@[378; 379) - R_CURLY@[378; 379) + PARAM@378..379 + ERROR@378..379 + R_CURLY@378..379 err: `expected COMMA` - WHITESPACE@[379; 384) + WHITESPACE@379..384 err: `expected pattern` - PARAM@[384; 385) - ERROR@[384; 385) - R_CURLY@[384; 385) + PARAM@384..385 + ERROR@384..385 + R_CURLY@384..385 err: `expected COMMA` err: `expected pattern` - PARAM@[385; 386) - ERROR@[385; 386) - SEMICOLON@[385; 386) + PARAM@385..386 + ERROR@385..386 + SEMICOLON@385..386 err: `expected COMMA` - WHITESPACE@[386; 387) + WHITESPACE@386..387 err: `expected pattern` - PARAM@[387; 388) - ERROR@[387; 388) - R_CURLY@[387; 388) + PARAM@387..388 + ERROR@387..388 + R_CURLY@387..388 err: `expected COMMA` err: `expected PIPE` - WHITESPACE@[388; 389) + WHITESPACE@388..389 err: `expected expression` err: `expected SEMI` err: `expected R_CURLY` - ERROR@[389; 389) + ERROR@389..389 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 cb570dc1c7..211e5fd468 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 @@ -1,89 +1,89 @@ -SOURCE_FILE@[0; 86) - STRUCT_DEF@[0; 72) - VISIBILITY@[0; 3) - PUB_KW@[0; 3) "pub" - WHITESPACE@[3; 4) " " - STRUCT_KW@[4; 10) "struct" - WHITESPACE@[10; 11) " " - NAME@[11; 16) - IDENT@[11; 16) "Cache" - TUPLE_FIELD_DEF_LIST@[16; 72) - L_PAREN@[16; 17) "(" - WHITESPACE@[17; 22) "\n " - TUPLE_FIELD_DEF@[22; 68) - PATH_TYPE@[22; 68) - PATH@[22; 68) - PATH_SEGMENT@[22; 68) - NAME_REF@[22; 29) - IDENT@[22; 29) "RefCell" - TYPE_ARG_LIST@[29; 68) - L_ANGLE@[29; 30) "<" - TYPE_ARG@[30; 68) - PATH_TYPE@[30; 68) - PATH@[30; 68) - PATH_SEGMENT@[30; 68) - NAME_REF@[30; 37) - IDENT@[30; 37) "HashMap" - TYPE_ARG_LIST@[37; 68) - L_ANGLE@[37; 38) "<" - WHITESPACE@[38; 47) "\n " - TYPE_ARG@[47; 53) - PATH_TYPE@[47; 53) - PATH@[47; 53) - PATH_SEGMENT@[47; 53) - NAME_REF@[47; 53) - IDENT@[47; 53) "TypeId" - COMMA@[53; 54) "," - WHITESPACE@[54; 63) "\n " - TYPE_ARG@[63; 68) - PATH_TYPE@[63; 68) - PATH@[63; 68) - PATH_SEGMENT@[63; 68) - NAME_REF@[63; 66) - IDENT@[63; 66) "Box" - TYPE_ARG_LIST@[66; 68) - L_ANGLE@[66; 67) "<" - TYPE_ARG@[67; 68) - ERROR@[67; 68) - AT@[67; 68) "@" - WHITESPACE@[68; 69) " " - TUPLE_FIELD_DEF@[69; 72) - PATH_TYPE@[69; 72) - PATH@[69; 72) - PATH_SEGMENT@[69; 72) - NAME_REF@[69; 72) - IDENT@[69; 72) "Any" - ERROR@[72; 72) - ERROR@[72; 73) - R_ANGLE@[72; 73) ">" - ERROR@[73; 74) - COMMA@[73; 74) "," - WHITESPACE@[74; 79) "\n " - ERROR@[79; 80) - R_ANGLE@[79; 80) ">" - ERROR@[80; 81) - R_ANGLE@[80; 81) ">" - WHITESPACE@[81; 82) "\n" - ERROR@[82; 83) - R_PAREN@[82; 83) ")" - ERROR@[83; 84) - SEMICOLON@[83; 84) ";" - WHITESPACE@[84; 86) "\n\n" -error [67; 67): expected type -error [68; 68): expected COMMA -error [68; 68): expected R_ANGLE -error [68; 68): expected COMMA -error [68; 68): expected R_ANGLE -error [68; 68): expected COMMA -error [68; 68): expected R_ANGLE -error [68; 68): expected COMMA -error [72; 72): expected COMMA -error [72; 72): expected a type -error [72; 72): expected R_PAREN -error [72; 72): expected SEMICOLON -error [72; 72): expected an item -error [73; 73): expected an item -error [79; 79): expected an item -error [80; 80): expected an item -error [82; 82): expected an item -error [83; 83): expected an item +SOURCE_FILE@0..86 + STRUCT_DEF@0..72 + VISIBILITY@0..3 + PUB_KW@0..3 "pub" + WHITESPACE@3..4 " " + STRUCT_KW@4..10 "struct" + WHITESPACE@10..11 " " + NAME@11..16 + IDENT@11..16 "Cache" + TUPLE_FIELD_DEF_LIST@16..72 + L_PAREN@16..17 "(" + WHITESPACE@17..22 "\n " + TUPLE_FIELD_DEF@22..68 + PATH_TYPE@22..68 + PATH@22..68 + PATH_SEGMENT@22..68 + NAME_REF@22..29 + IDENT@22..29 "RefCell" + TYPE_ARG_LIST@29..68 + L_ANGLE@29..30 "<" + TYPE_ARG@30..68 + PATH_TYPE@30..68 + PATH@30..68 + PATH_SEGMENT@30..68 + NAME_REF@30..37 + IDENT@30..37 "HashMap" + TYPE_ARG_LIST@37..68 + L_ANGLE@37..38 "<" + WHITESPACE@38..47 "\n " + TYPE_ARG@47..53 + PATH_TYPE@47..53 + PATH@47..53 + PATH_SEGMENT@47..53 + NAME_REF@47..53 + IDENT@47..53 "TypeId" + COMMA@53..54 "," + WHITESPACE@54..63 "\n " + TYPE_ARG@63..68 + PATH_TYPE@63..68 + PATH@63..68 + PATH_SEGMENT@63..68 + NAME_REF@63..66 + IDENT@63..66 "Box" + TYPE_ARG_LIST@66..68 + L_ANGLE@66..67 "<" + TYPE_ARG@67..68 + ERROR@67..68 + AT@67..68 "@" + WHITESPACE@68..69 " " + TUPLE_FIELD_DEF@69..72 + PATH_TYPE@69..72 + PATH@69..72 + PATH_SEGMENT@69..72 + NAME_REF@69..72 + IDENT@69..72 "Any" + ERROR@72..72 + ERROR@72..73 + R_ANGLE@72..73 ">" + ERROR@73..74 + COMMA@73..74 "," + WHITESPACE@74..79 "\n " + ERROR@79..80 + R_ANGLE@79..80 ">" + ERROR@80..81 + R_ANGLE@80..81 ">" + WHITESPACE@81..82 "\n" + ERROR@82..83 + R_PAREN@82..83 ")" + ERROR@83..84 + SEMICOLON@83..84 ";" + WHITESPACE@84..86 "\n\n" +error 67..67: expected type +error 68..68: expected COMMA +error 68..68: expected R_ANGLE +error 68..68: expected COMMA +error 68..68: expected R_ANGLE +error 68..68: expected COMMA +error 68..68: expected R_ANGLE +error 68..68: expected COMMA +error 72..72: expected COMMA +error 72..72: expected a type +error 72..72: expected R_PAREN +error 72..72: expected SEMICOLON +error 72..72: expected an item +error 73..73: expected an item +error 79..79: expected an item +error 80..80: expected an item +error 82..82: expected an item +error 83..83: expected an item diff --git a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast index a25d641b82..61c3618337 100644 --- a/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast +++ b/crates/ra_syntax/test_data/parser/err/0014_where_no_bounds.rast @@ -1,32 +1,32 @@ -SOURCE_FILE@[0; 23) - FN_DEF@[0; 22) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - TYPE_PARAM_LIST@[6; 9) - L_ANGLE@[6; 7) "<" - TYPE_PARAM@[7; 8) - NAME@[7; 8) - IDENT@[7; 8) "T" - R_ANGLE@[8; 9) ">" - PARAM_LIST@[9; 11) - L_PAREN@[9; 10) "(" - R_PAREN@[10; 11) ")" - WHITESPACE@[11; 12) " " - WHERE_CLAUSE@[12; 19) - WHERE_KW@[12; 17) "where" - WHITESPACE@[17; 18) " " - WHERE_PRED@[18; 19) - PATH_TYPE@[18; 19) - PATH@[18; 19) - PATH_SEGMENT@[18; 19) - NAME_REF@[18; 19) - IDENT@[18; 19) "T" - WHITESPACE@[19; 20) " " - BLOCK_EXPR@[20; 22) - BLOCK@[20; 22) - L_CURLY@[20; 21) "{" - R_CURLY@[21; 22) "}" - WHITESPACE@[22; 23) "\n" -error [19; 19): expected colon +SOURCE_FILE@0..23 + FN_DEF@0..22 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + TYPE_PARAM_LIST@6..9 + L_ANGLE@6..7 "<" + TYPE_PARAM@7..8 + NAME@7..8 + IDENT@7..8 "T" + R_ANGLE@8..9 ">" + PARAM_LIST@9..11 + L_PAREN@9..10 "(" + R_PAREN@10..11 ")" + WHITESPACE@11..12 " " + WHERE_CLAUSE@12..19 + WHERE_KW@12..17 "where" + WHITESPACE@17..18 " " + WHERE_PRED@18..19 + PATH_TYPE@18..19 + PATH@18..19 + PATH_SEGMENT@18..19 + NAME_REF@18..19 + IDENT@18..19 "T" + WHITESPACE@19..20 " " + BLOCK_EXPR@20..22 + BLOCK@20..22 + L_CURLY@20..21 "{" + R_CURLY@21..22 "}" + WHITESPACE@22..23 "\n" +error 19..19: expected colon diff --git a/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast b/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast index 36b848be33..b18378cff2 100644 --- a/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast +++ b/crates/ra_syntax/test_data/parser/err/0015_curly_in_params.rast @@ -1,24 +1,24 @@ -SOURCE_FILE@[0; 14) - FN_DEF@[0; 7) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 7) - L_PAREN@[6; 7) "(" - ERROR@[7; 8) - R_CURLY@[7; 8) "}" - ERROR@[8; 9) - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - ERROR@[10; 13) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 12) "\n" - R_CURLY@[12; 13) "}" - WHITESPACE@[13; 14) "\n" -error [7; 7): expected value parameter -error [7; 7): expected R_PAREN -error [7; 7): expected a block -error [7; 7): unmatched `}` -error [8; 8): expected an item -error [10; 10): expected an item +SOURCE_FILE@0..14 + FN_DEF@0..7 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..7 + L_PAREN@6..7 "(" + ERROR@7..8 + R_CURLY@7..8 "}" + ERROR@8..9 + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + ERROR@10..13 + L_CURLY@10..11 "{" + WHITESPACE@11..12 "\n" + R_CURLY@12..13 "}" + WHITESPACE@13..14 "\n" +error 7..7: expected value parameter +error 7..7: expected R_PAREN +error 7..7: expected a block +error 7..7: unmatched `}` +error 8..8: expected an item +error 10..10: 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 aca5a3ada5..92bb47316d 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 @@ -1,44 +1,44 @@ -SOURCE_FILE@[0; 56) - FN_DEF@[0; 55) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 55) - BLOCK@[9; 55) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 38) - CALL_EXPR@[15; 38) - PATH_EXPR@[15; 18) - PATH@[15; 18) - PATH_SEGMENT@[15; 18) - NAME_REF@[15; 18) - IDENT@[15; 18) "foo" - ARG_LIST@[18; 38) - L_PAREN@[18; 19) "(" - WHITESPACE@[19; 28) "\n " - LITERAL@[28; 29) - INT_NUMBER@[28; 29) "1" - COMMA@[29; 30) "," - WHITESPACE@[30; 31) " " - LITERAL@[31; 32) - INT_NUMBER@[31; 32) "2" - WHITESPACE@[32; 37) "\n " - R_PAREN@[37; 38) ")" - WHITESPACE@[38; 43) "\n " - EXPR_STMT@[43; 53) - RETURN_EXPR@[43; 52) - RETURN_KW@[43; 49) "return" - WHITESPACE@[49; 50) " " - LITERAL@[50; 52) - INT_NUMBER@[50; 52) "92" - SEMICOLON@[52; 53) ";" - WHITESPACE@[53; 54) "\n" - R_CURLY@[54; 55) "}" - WHITESPACE@[55; 56) "\n" -error [38; 38): expected SEMICOLON +SOURCE_FILE@0..56 + FN_DEF@0..55 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..55 + BLOCK@9..55 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..38 + CALL_EXPR@15..38 + PATH_EXPR@15..18 + PATH@15..18 + PATH_SEGMENT@15..18 + NAME_REF@15..18 + IDENT@15..18 "foo" + ARG_LIST@18..38 + L_PAREN@18..19 "(" + WHITESPACE@19..28 "\n " + LITERAL@28..29 + INT_NUMBER@28..29 "1" + COMMA@29..30 "," + WHITESPACE@30..31 " " + LITERAL@31..32 + INT_NUMBER@31..32 "2" + WHITESPACE@32..37 "\n " + R_PAREN@37..38 ")" + WHITESPACE@38..43 "\n " + EXPR_STMT@43..53 + RETURN_EXPR@43..52 + RETURN_KW@43..49 "return" + WHITESPACE@49..50 " " + LITERAL@50..52 + INT_NUMBER@50..52 "92" + SEMICOLON@52..53 ";" + WHITESPACE@53..54 "\n" + R_CURLY@54..55 "}" + WHITESPACE@55..56 "\n" +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 f9f4b9bc28..7bc7183021 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 @@ -1,47 +1,47 @@ -SOURCE_FILE@[0; 47) - FN_DEF@[0; 46) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 16) - L_PAREN@[6; 7) "(" - PARAM@[7; 15) - BIND_PAT@[7; 10) - NAME@[7; 10) - IDENT@[7; 10) "foo" - COLON@[10; 11) ":" - WHITESPACE@[11; 12) " " - PATH_TYPE@[12; 15) - PATH@[12; 15) - PATH_SEGMENT@[12; 15) - NAME_REF@[12; 15) - IDENT@[12; 15) "i32" - R_PAREN@[15; 16) ")" - WHITESPACE@[16; 17) " " - BLOCK_EXPR@[17; 46) - BLOCK@[17; 46) - L_CURLY@[17; 18) "{" - WHITESPACE@[18; 23) "\n " - LET_STMT@[23; 36) - LET_KW@[23; 26) "let" - WHITESPACE@[26; 27) " " - BIND_PAT@[27; 30) - NAME@[27; 30) - IDENT@[27; 30) "bar" - WHITESPACE@[30; 31) " " - EQ@[31; 32) "=" - WHITESPACE@[32; 33) " " - LITERAL@[33; 35) - INT_NUMBER@[33; 35) "92" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 41) "\n " - BIN_EXPR@[41; 44) - LITERAL@[41; 42) - INT_NUMBER@[41; 42) "1" - WHITESPACE@[42; 43) " " - PLUS@[43; 44) "+" - WHITESPACE@[44; 45) "\n" - R_CURLY@[45; 46) "}" - WHITESPACE@[46; 47) "\n" -error [44; 44): expected expression +SOURCE_FILE@0..47 + FN_DEF@0..46 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..16 + L_PAREN@6..7 "(" + PARAM@7..15 + BIND_PAT@7..10 + NAME@7..10 + IDENT@7..10 "foo" + COLON@10..11 ":" + WHITESPACE@11..12 " " + PATH_TYPE@12..15 + PATH@12..15 + PATH_SEGMENT@12..15 + NAME_REF@12..15 + IDENT@12..15 "i32" + R_PAREN@15..16 ")" + WHITESPACE@16..17 " " + BLOCK_EXPR@17..46 + BLOCK@17..46 + L_CURLY@17..18 "{" + WHITESPACE@18..23 "\n " + LET_STMT@23..36 + LET_KW@23..26 "let" + WHITESPACE@26..27 " " + BIND_PAT@27..30 + NAME@27..30 + IDENT@27..30 "bar" + WHITESPACE@30..31 " " + EQ@31..32 "=" + WHITESPACE@32..33 " " + LITERAL@33..35 + INT_NUMBER@33..35 "92" + SEMICOLON@35..36 ";" + WHITESPACE@36..41 "\n " + BIN_EXPR@41..44 + LITERAL@41..42 + INT_NUMBER@41..42 "1" + WHITESPACE@42..43 " " + PLUS@43..44 "+" + WHITESPACE@44..45 "\n" + R_CURLY@45..46 "}" + WHITESPACE@46..47 "\n" +error 44..44: expected expression 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 9a8f766739..63194f974d 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 @@ -1,132 +1,132 @@ -SOURCE_FILE@[0; 183) - IMPL_DEF@[0; 182) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 13) - PATH@[5; 13) - PATH_SEGMENT@[5; 13) - NAME_REF@[5; 13) - IDENT@[5; 13) "FnScopes" - WHITESPACE@[13; 14) " " - ITEM_LIST@[14; 182) - L_CURLY@[14; 15) "{" - WHITESPACE@[15; 20) "\n " - FN_DEF@[20; 161) - FN_KW@[20; 22) "fn" - WHITESPACE@[22; 23) " " - NAME@[23; 32) - IDENT@[23; 32) "new_scope" - PARAM_LIST@[32; 35) - L_PAREN@[32; 33) "(" - PARAM@[33; 34) - REF_PAT@[33; 34) - AMP@[33; 34) "&" - R_PAREN@[34; 35) ")" - WHITESPACE@[35; 36) " " - RET_TYPE@[36; 46) - THIN_ARROW@[36; 38) "->" - WHITESPACE@[38; 39) " " - PATH_TYPE@[39; 46) - PATH@[39; 46) - PATH_SEGMENT@[39; 46) - NAME_REF@[39; 46) - IDENT@[39; 46) "ScopeId" - WHITESPACE@[46; 47) " " - BLOCK_EXPR@[47; 161) - BLOCK@[47; 161) - L_CURLY@[47; 48) "{" - WHITESPACE@[48; 57) "\n " - LET_STMT@[57; 85) - LET_KW@[57; 60) "let" - WHITESPACE@[60; 61) " " - BIND_PAT@[61; 64) - NAME@[61; 64) - IDENT@[61; 64) "res" - WHITESPACE@[64; 65) " " - EQ@[65; 66) "=" - WHITESPACE@[66; 67) " " - METHOD_CALL_EXPR@[67; 84) - FIELD_EXPR@[67; 78) - PATH_EXPR@[67; 71) - PATH@[67; 71) - PATH_SEGMENT@[67; 71) - SELF_KW@[67; 71) "self" - DOT@[71; 72) "." - NAME_REF@[72; 78) - IDENT@[72; 78) "scopes" - DOT@[78; 79) "." - NAME_REF@[79; 82) - IDENT@[79; 82) "len" - ARG_LIST@[82; 84) - L_PAREN@[82; 83) "(" - R_PAREN@[83; 84) ")" - SEMICOLON@[84; 85) ";" - WHITESPACE@[85; 94) "\n " - METHOD_CALL_EXPR@[94; 155) - FIELD_EXPR@[94; 105) - PATH_EXPR@[94; 98) - PATH@[94; 98) - PATH_SEGMENT@[94; 98) - SELF_KW@[94; 98) "self" - DOT@[98; 99) "." - NAME_REF@[99; 105) - IDENT@[99; 105) "scopes" - DOT@[105; 106) "." - NAME_REF@[106; 110) - IDENT@[106; 110) "push" - ARG_LIST@[110; 155) - L_PAREN@[110; 111) "(" - RECORD_LIT@[111; 154) - PATH@[111; 120) - PATH_SEGMENT@[111; 120) - NAME_REF@[111; 120) - IDENT@[111; 120) "ScopeData" - WHITESPACE@[120; 121) " " - RECORD_FIELD_LIST@[121; 154) - L_CURLY@[121; 122) "{" - WHITESPACE@[122; 123) " " - RECORD_FIELD@[123; 135) - NAME_REF@[123; 129) - IDENT@[123; 129) "parent" - COLON@[129; 130) ":" - WHITESPACE@[130; 131) " " - PATH_EXPR@[131; 135) - PATH@[131; 135) - PATH_SEGMENT@[131; 135) - NAME_REF@[131; 135) - IDENT@[131; 135) "None" - COMMA@[135; 136) "," - WHITESPACE@[136; 137) " " - RECORD_FIELD@[137; 152) - NAME_REF@[137; 144) - IDENT@[137; 144) "entries" - COLON@[144; 145) ":" - WHITESPACE@[145; 146) " " - MACRO_CALL@[146; 152) - PATH@[146; 149) - PATH_SEGMENT@[146; 149) - NAME_REF@[146; 149) - IDENT@[146; 149) "vec" - BANG@[149; 150) "!" - TOKEN_TREE@[150; 152) - L_BRACK@[150; 151) "[" - R_BRACK@[151; 152) "]" - WHITESPACE@[152; 153) " " - R_CURLY@[153; 154) "}" - R_PAREN@[154; 155) ")" - WHITESPACE@[155; 160) "\n " - R_CURLY@[160; 161) "}" - WHITESPACE@[161; 167) "\n\n " - FN_DEF@[167; 180) - FN_KW@[167; 169) "fn" - WHITESPACE@[169; 170) " " - NAME@[170; 180) - IDENT@[170; 180) "set_parent" - WHITESPACE@[180; 181) "\n" - R_CURLY@[181; 182) "}" - WHITESPACE@[182; 183) "\n" -error [34; 34): expected pattern -error [34; 34): expected COLON -error [34; 34): expected type -error [180; 180): expected function arguments -error [180; 180): expected a block +SOURCE_FILE@0..183 + IMPL_DEF@0..182 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..13 + PATH@5..13 + PATH_SEGMENT@5..13 + NAME_REF@5..13 + IDENT@5..13 "FnScopes" + WHITESPACE@13..14 " " + ITEM_LIST@14..182 + L_CURLY@14..15 "{" + WHITESPACE@15..20 "\n " + FN_DEF@20..161 + FN_KW@20..22 "fn" + WHITESPACE@22..23 " " + NAME@23..32 + IDENT@23..32 "new_scope" + PARAM_LIST@32..35 + L_PAREN@32..33 "(" + PARAM@33..34 + REF_PAT@33..34 + AMP@33..34 "&" + R_PAREN@34..35 ")" + WHITESPACE@35..36 " " + RET_TYPE@36..46 + THIN_ARROW@36..38 "->" + WHITESPACE@38..39 " " + PATH_TYPE@39..46 + PATH@39..46 + PATH_SEGMENT@39..46 + NAME_REF@39..46 + IDENT@39..46 "ScopeId" + WHITESPACE@46..47 " " + BLOCK_EXPR@47..161 + BLOCK@47..161 + L_CURLY@47..48 "{" + WHITESPACE@48..57 "\n " + LET_STMT@57..85 + LET_KW@57..60 "let" + WHITESPACE@60..61 " " + BIND_PAT@61..64 + NAME@61..64 + IDENT@61..64 "res" + WHITESPACE@64..65 " " + EQ@65..66 "=" + WHITESPACE@66..67 " " + METHOD_CALL_EXPR@67..84 + FIELD_EXPR@67..78 + PATH_EXPR@67..71 + PATH@67..71 + PATH_SEGMENT@67..71 + SELF_KW@67..71 "self" + DOT@71..72 "." + NAME_REF@72..78 + IDENT@72..78 "scopes" + DOT@78..79 "." + NAME_REF@79..82 + IDENT@79..82 "len" + ARG_LIST@82..84 + L_PAREN@82..83 "(" + R_PAREN@83..84 ")" + SEMICOLON@84..85 ";" + WHITESPACE@85..94 "\n " + METHOD_CALL_EXPR@94..155 + FIELD_EXPR@94..105 + PATH_EXPR@94..98 + PATH@94..98 + PATH_SEGMENT@94..98 + SELF_KW@94..98 "self" + DOT@98..99 "." + NAME_REF@99..105 + IDENT@99..105 "scopes" + DOT@105..106 "." + NAME_REF@106..110 + IDENT@106..110 "push" + ARG_LIST@110..155 + L_PAREN@110..111 "(" + RECORD_LIT@111..154 + PATH@111..120 + PATH_SEGMENT@111..120 + NAME_REF@111..120 + IDENT@111..120 "ScopeData" + WHITESPACE@120..121 " " + RECORD_FIELD_LIST@121..154 + L_CURLY@121..122 "{" + WHITESPACE@122..123 " " + RECORD_FIELD@123..135 + NAME_REF@123..129 + IDENT@123..129 "parent" + COLON@129..130 ":" + WHITESPACE@130..131 " " + PATH_EXPR@131..135 + PATH@131..135 + PATH_SEGMENT@131..135 + NAME_REF@131..135 + IDENT@131..135 "None" + COMMA@135..136 "," + WHITESPACE@136..137 " " + RECORD_FIELD@137..152 + NAME_REF@137..144 + IDENT@137..144 "entries" + COLON@144..145 ":" + WHITESPACE@145..146 " " + MACRO_CALL@146..152 + PATH@146..149 + PATH_SEGMENT@146..149 + NAME_REF@146..149 + IDENT@146..149 "vec" + BANG@149..150 "!" + TOKEN_TREE@150..152 + L_BRACK@150..151 "[" + R_BRACK@151..152 "]" + WHITESPACE@152..153 " " + R_CURLY@153..154 "}" + R_PAREN@154..155 ")" + WHITESPACE@155..160 "\n " + R_CURLY@160..161 "}" + WHITESPACE@161..167 "\n\n " + FN_DEF@167..180 + FN_KW@167..169 "fn" + WHITESPACE@169..170 " " + NAME@170..180 + IDENT@170..180 "set_parent" + WHITESPACE@180..181 "\n" + R_CURLY@181..182 "}" + WHITESPACE@182..183 "\n" +error 34..34: expected pattern +error 34..34: expected COLON +error 34..34: expected type +error 180..180: expected function arguments +error 180..180: expected a block 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 e283091e13..d20bb60f1d 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 @@ -1,107 +1,107 @@ -SOURCE_FILE@[0; 139) - FN_DEF@[0; 138) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 138) - BLOCK@[9; 138) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 24) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - BIND_PAT@[19; 22) - NAME@[19; 22) - IDENT@[19; 22) "foo" - WHITESPACE@[22; 23) " " - EQ@[23; 24) "=" - WHITESPACE@[24; 29) "\n " - LET_STMT@[29; 41) - LET_KW@[29; 32) "let" - WHITESPACE@[32; 33) " " - BIND_PAT@[33; 36) - NAME@[33; 36) - IDENT@[33; 36) "bar" - WHITESPACE@[36; 37) " " - EQ@[37; 38) "=" - WHITESPACE@[38; 39) " " - LITERAL@[39; 40) - INT_NUMBER@[39; 40) "1" - SEMICOLON@[40; 41) ";" - WHITESPACE@[41; 46) "\n " - LET_STMT@[46; 49) - LET_KW@[46; 49) "let" - WHITESPACE@[49; 54) "\n " - LET_STMT@[54; 67) - LET_KW@[54; 57) "let" - WHITESPACE@[57; 58) " " - BIND_PAT@[58; 61) - NAME@[58; 61) - IDENT@[58; 61) "baz" - WHITESPACE@[61; 62) " " - EQ@[62; 63) "=" - WHITESPACE@[63; 64) " " - LITERAL@[64; 66) - INT_NUMBER@[64; 66) "92" - SEMICOLON@[66; 67) ";" - WHITESPACE@[67; 72) "\n " - LET_STMT@[72; 75) - LET_KW@[72; 75) "let" - WHITESPACE@[75; 80) "\n " - EXPR_STMT@[80; 90) - IF_EXPR@[80; 90) - IF_KW@[80; 82) "if" - WHITESPACE@[82; 83) " " - CONDITION@[83; 87) - LITERAL@[83; 87) - TRUE_KW@[83; 87) "true" - WHITESPACE@[87; 88) " " - BLOCK_EXPR@[88; 90) - BLOCK@[88; 90) - L_CURLY@[88; 89) "{" - R_CURLY@[89; 90) "}" - WHITESPACE@[90; 95) "\n " - LET_STMT@[95; 98) - LET_KW@[95; 98) "let" - WHITESPACE@[98; 103) "\n " - EXPR_STMT@[103; 116) - WHILE_EXPR@[103; 116) - WHILE_KW@[103; 108) "while" - WHITESPACE@[108; 109) " " - CONDITION@[109; 113) - LITERAL@[109; 113) - TRUE_KW@[109; 113) "true" - WHITESPACE@[113; 114) " " - BLOCK_EXPR@[114; 116) - BLOCK@[114; 116) - L_CURLY@[114; 115) "{" - R_CURLY@[115; 116) "}" - WHITESPACE@[116; 121) "\n " - LET_STMT@[121; 124) - LET_KW@[121; 124) "let" - WHITESPACE@[124; 129) "\n " - LOOP_EXPR@[129; 136) - LOOP_KW@[129; 133) "loop" - WHITESPACE@[133; 134) " " - BLOCK_EXPR@[134; 136) - BLOCK@[134; 136) - L_CURLY@[134; 135) "{" - R_CURLY@[135; 136) "}" - WHITESPACE@[136; 137) "\n" - R_CURLY@[137; 138) "}" - WHITESPACE@[138; 139) "\n" -error [24; 24): expected expression -error [24; 24): expected SEMICOLON -error [49; 49): expected pattern -error [49; 49): expected SEMICOLON -error [75; 75): expected pattern -error [75; 75): expected SEMICOLON -error [98; 98): expected pattern -error [98; 98): expected SEMICOLON -error [124; 124): expected pattern -error [124; 124): expected SEMICOLON +SOURCE_FILE@0..139 + FN_DEF@0..138 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..138 + BLOCK@9..138 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..24 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + BIND_PAT@19..22 + NAME@19..22 + IDENT@19..22 "foo" + WHITESPACE@22..23 " " + EQ@23..24 "=" + WHITESPACE@24..29 "\n " + LET_STMT@29..41 + LET_KW@29..32 "let" + WHITESPACE@32..33 " " + BIND_PAT@33..36 + NAME@33..36 + IDENT@33..36 "bar" + WHITESPACE@36..37 " " + EQ@37..38 "=" + WHITESPACE@38..39 " " + LITERAL@39..40 + INT_NUMBER@39..40 "1" + SEMICOLON@40..41 ";" + WHITESPACE@41..46 "\n " + LET_STMT@46..49 + LET_KW@46..49 "let" + WHITESPACE@49..54 "\n " + LET_STMT@54..67 + LET_KW@54..57 "let" + WHITESPACE@57..58 " " + BIND_PAT@58..61 + NAME@58..61 + IDENT@58..61 "baz" + WHITESPACE@61..62 " " + EQ@62..63 "=" + WHITESPACE@63..64 " " + LITERAL@64..66 + INT_NUMBER@64..66 "92" + SEMICOLON@66..67 ";" + WHITESPACE@67..72 "\n " + LET_STMT@72..75 + LET_KW@72..75 "let" + WHITESPACE@75..80 "\n " + EXPR_STMT@80..90 + IF_EXPR@80..90 + IF_KW@80..82 "if" + WHITESPACE@82..83 " " + CONDITION@83..87 + LITERAL@83..87 + TRUE_KW@83..87 "true" + WHITESPACE@87..88 " " + BLOCK_EXPR@88..90 + BLOCK@88..90 + L_CURLY@88..89 "{" + R_CURLY@89..90 "}" + WHITESPACE@90..95 "\n " + LET_STMT@95..98 + LET_KW@95..98 "let" + WHITESPACE@98..103 "\n " + EXPR_STMT@103..116 + WHILE_EXPR@103..116 + WHILE_KW@103..108 "while" + WHITESPACE@108..109 " " + CONDITION@109..113 + LITERAL@109..113 + TRUE_KW@109..113 "true" + WHITESPACE@113..114 " " + BLOCK_EXPR@114..116 + BLOCK@114..116 + L_CURLY@114..115 "{" + R_CURLY@115..116 "}" + WHITESPACE@116..121 "\n " + LET_STMT@121..124 + LET_KW@121..124 "let" + WHITESPACE@124..129 "\n " + LOOP_EXPR@129..136 + LOOP_KW@129..133 "loop" + WHITESPACE@133..134 " " + BLOCK_EXPR@134..136 + BLOCK@134..136 + L_CURLY@134..135 "{" + R_CURLY@135..136 "}" + WHITESPACE@136..137 "\n" + R_CURLY@137..138 "}" + WHITESPACE@138..139 "\n" +error 24..24: expected expression +error 24..24: expected SEMICOLON +error 49..49: expected pattern +error 49..49: expected SEMICOLON +error 75..75: expected pattern +error 75..75: expected SEMICOLON +error 98..98: expected pattern +error 98..98: expected SEMICOLON +error 124..124: expected pattern +error 124..124: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast index c11dc23f53..1185f44f98 100644 --- a/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast +++ b/crates/ra_syntax/test_data/parser/err/0020_fn_recover.rast @@ -1,21 +1,21 @@ -SOURCE_FILE@[0; 16) - FN_DEF@[0; 2) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 4) "\n\n" - FN_DEF@[4; 15) - FN_KW@[4; 6) "fn" - WHITESPACE@[6; 7) " " - NAME@[7; 10) - IDENT@[7; 10) "foo" - PARAM_LIST@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - WHITESPACE@[12; 13) " " - BLOCK_EXPR@[13; 15) - BLOCK@[13; 15) - L_CURLY@[13; 14) "{" - R_CURLY@[14; 15) "}" - WHITESPACE@[15; 16) "\n" -error [2; 2): expected a name -error [2; 2): expected function arguments -error [2; 2): expected a block +SOURCE_FILE@0..16 + FN_DEF@0..2 + FN_KW@0..2 "fn" + WHITESPACE@2..4 "\n\n" + FN_DEF@4..15 + FN_KW@4..6 "fn" + WHITESPACE@6..7 " " + NAME@7..10 + IDENT@7..10 "foo" + PARAM_LIST@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + WHITESPACE@12..13 " " + BLOCK_EXPR@13..15 + BLOCK@13..15 + L_CURLY@13..14 "{" + R_CURLY@14..15 "}" + WHITESPACE@15..16 "\n" +error 2..2: expected a name +error 2..2: expected function arguments +error 2..2: expected a block diff --git a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast index ae04122d88..c7bf4caa08 100644 --- a/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast +++ b/crates/ra_syntax/test_data/parser/err/0021_incomplete_param.rast @@ -1,35 +1,35 @@ -SOURCE_FILE@[0; 22) - FN_DEF@[0; 21) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 17) - L_PAREN@[6; 7) "(" - PARAM@[7; 13) - BIND_PAT@[7; 8) - NAME@[7; 8) - IDENT@[7; 8) "x" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - PATH_TYPE@[10; 13) - PATH@[10; 13) - PATH_SEGMENT@[10; 13) - NAME_REF@[10; 13) - IDENT@[10; 13) "i32" - COMMA@[13; 14) "," - WHITESPACE@[14; 15) " " - PARAM@[15; 16) - BIND_PAT@[15; 16) - NAME@[15; 16) - IDENT@[15; 16) "y" - R_PAREN@[16; 17) ")" - WHITESPACE@[17; 18) " " - BLOCK_EXPR@[18; 21) - BLOCK@[18; 21) - L_CURLY@[18; 19) "{" - WHITESPACE@[19; 20) "\n" - R_CURLY@[20; 21) "}" - WHITESPACE@[21; 22) "\n" -error [16; 16): expected COLON -error [16; 16): expected type +SOURCE_FILE@0..22 + FN_DEF@0..21 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..17 + L_PAREN@6..7 "(" + PARAM@7..13 + BIND_PAT@7..8 + NAME@7..8 + IDENT@7..8 "x" + COLON@8..9 ":" + WHITESPACE@9..10 " " + PATH_TYPE@10..13 + PATH@10..13 + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "i32" + COMMA@13..14 "," + WHITESPACE@14..15 " " + PARAM@15..16 + BIND_PAT@15..16 + NAME@15..16 + IDENT@15..16 "y" + R_PAREN@16..17 ")" + WHITESPACE@17..18 " " + BLOCK_EXPR@18..21 + BLOCK@18..21 + L_CURLY@18..19 "{" + WHITESPACE@19..20 "\n" + R_CURLY@20..21 "}" + WHITESPACE@21..22 "\n" +error 16..16: expected COLON +error 16..16: expected type 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 465749f952..cc0d75cc86 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 @@ -1,183 +1,183 @@ -SOURCE_FILE@[0; 112) - FN_DEF@[0; 33) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "a" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - BLOCK_EXPR@[7; 33) - BLOCK@[7; 33) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 9) " " - EXPR_STMT@[9; 17) - ARRAY_EXPR@[9; 17) - L_BRACK@[9; 10) "[" - LITERAL@[10; 11) - INT_NUMBER@[10; 11) "1" - COMMA@[11; 12) "," - WHITESPACE@[12; 13) " " - LITERAL@[13; 14) - INT_NUMBER@[13; 14) "2" - COMMA@[14; 15) "," - WHITESPACE@[15; 16) " " - ERROR@[16; 17) - AT@[16; 17) "@" - EXPR_STMT@[17; 18) - ERROR@[17; 18) - COMMA@[17; 18) "," - WHITESPACE@[18; 19) " " - STRUCT_DEF@[19; 26) - STRUCT_KW@[19; 25) "struct" - ERROR@[25; 26) - COMMA@[25; 26) "," - WHITESPACE@[26; 27) " " - LET_STMT@[27; 31) - LET_KW@[27; 30) "let" - ERROR@[30; 31) - R_BRACK@[30; 31) "]" - WHITESPACE@[31; 32) " " - R_CURLY@[32; 33) "}" - WHITESPACE@[33; 34) "\n" - FN_DEF@[34; 68) - FN_KW@[34; 36) "fn" - WHITESPACE@[36; 37) " " - NAME@[37; 38) - IDENT@[37; 38) "b" - PARAM_LIST@[38; 40) - L_PAREN@[38; 39) "(" - R_PAREN@[39; 40) ")" - WHITESPACE@[40; 41) " " - BLOCK_EXPR@[41; 68) - BLOCK@[41; 68) - L_CURLY@[41; 42) "{" - WHITESPACE@[42; 43) " " - EXPR_STMT@[43; 54) - CALL_EXPR@[43; 54) - PATH_EXPR@[43; 46) - PATH@[43; 46) - PATH_SEGMENT@[43; 46) - NAME_REF@[43; 46) - IDENT@[43; 46) "foo" - ARG_LIST@[46; 54) - L_PAREN@[46; 47) "(" - LITERAL@[47; 48) - INT_NUMBER@[47; 48) "1" - COMMA@[48; 49) "," - WHITESPACE@[49; 50) " " - LITERAL@[50; 51) - INT_NUMBER@[50; 51) "2" - COMMA@[51; 52) "," - WHITESPACE@[52; 53) " " - ERROR@[53; 54) - AT@[53; 54) "@" - EXPR_STMT@[54; 55) - ERROR@[54; 55) - COMMA@[54; 55) "," - WHITESPACE@[55; 56) " " - IMPL_DEF@[56; 60) - IMPL_KW@[56; 60) "impl" - EXPR_STMT@[60; 61) - ERROR@[60; 61) - COMMA@[60; 61) "," - WHITESPACE@[61; 62) " " - LET_STMT@[62; 65) - LET_KW@[62; 65) "let" - ERROR@[65; 66) - R_PAREN@[65; 66) ")" - WHITESPACE@[66; 67) " " - R_CURLY@[67; 68) "}" - WHITESPACE@[68; 69) "\n" - FN_DEF@[69; 111) - FN_KW@[69; 71) "fn" - WHITESPACE@[71; 72) " " - NAME@[72; 73) - IDENT@[72; 73) "c" - PARAM_LIST@[73; 75) - L_PAREN@[73; 74) "(" - R_PAREN@[74; 75) ")" - WHITESPACE@[75; 76) " " - BLOCK_EXPR@[76; 111) - BLOCK@[76; 111) - L_CURLY@[76; 77) "{" - WHITESPACE@[77; 78) " " - EXPR_STMT@[78; 93) - METHOD_CALL_EXPR@[78; 93) - PATH_EXPR@[78; 81) - PATH@[78; 81) - PATH_SEGMENT@[78; 81) - NAME_REF@[78; 81) - IDENT@[78; 81) "foo" - DOT@[81; 82) "." - NAME_REF@[82; 85) - IDENT@[82; 85) "bar" - ARG_LIST@[85; 93) - L_PAREN@[85; 86) "(" - LITERAL@[86; 87) - INT_NUMBER@[86; 87) "1" - COMMA@[87; 88) "," - WHITESPACE@[88; 89) " " - LITERAL@[89; 90) - INT_NUMBER@[89; 90) "2" - COMMA@[90; 91) "," - WHITESPACE@[91; 92) " " - ERROR@[92; 93) - AT@[92; 93) "@" - EXPR_STMT@[93; 94) - ERROR@[93; 94) - COMMA@[93; 94) "," - WHITESPACE@[94; 95) " " - EXPR_STMT@[95; 96) - ERROR@[95; 96) - R_BRACK@[95; 96) "]" - EXPR_STMT@[96; 97) - ERROR@[96; 97) - COMMA@[96; 97) "," - WHITESPACE@[97; 98) " " - TRAIT_DEF@[98; 104) - TRAIT_KW@[98; 103) "trait" - ERROR@[103; 104) - COMMA@[103; 104) "," - WHITESPACE@[104; 105) " " - LET_STMT@[105; 108) - LET_KW@[105; 108) "let" - ERROR@[108; 109) - R_PAREN@[108; 109) ")" - WHITESPACE@[109; 110) " " - R_CURLY@[110; 111) "}" - WHITESPACE@[111; 112) "\n" -error [16; 16): expected expression -error [17; 17): expected R_BRACK -error [17; 17): expected SEMICOLON -error [17; 17): expected expression -error [18; 18): expected SEMICOLON -error [25; 25): expected a name -error [26; 26): expected `;`, `{`, or `(` -error [30; 30): expected pattern -error [31; 31): expected SEMICOLON -error [53; 53): expected expression -error [54; 54): expected SEMICOLON -error [54; 54): expected expression -error [55; 55): expected SEMICOLON -error [60; 60): expected type -error [60; 60): expected `{` -error [60; 60): expected expression -error [61; 61): expected SEMICOLON -error [65; 65): expected pattern -error [65; 65): expected SEMICOLON -error [65; 65): expected expression -error [92; 92): expected expression -error [93; 93): expected SEMICOLON -error [93; 93): expected expression -error [94; 94): expected SEMICOLON -error [95; 95): expected expression -error [96; 96): expected SEMICOLON -error [96; 96): expected expression -error [97; 97): expected SEMICOLON -error [103; 103): expected a name -error [104; 104): expected `{` -error [108; 108): expected pattern -error [108; 108): expected SEMICOLON -error [108; 108): expected expression +SOURCE_FILE@0..112 + FN_DEF@0..33 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "a" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + BLOCK_EXPR@7..33 + BLOCK@7..33 + L_CURLY@7..8 "{" + WHITESPACE@8..9 " " + EXPR_STMT@9..17 + ARRAY_EXPR@9..17 + L_BRACK@9..10 "[" + LITERAL@10..11 + INT_NUMBER@10..11 "1" + COMMA@11..12 "," + WHITESPACE@12..13 " " + LITERAL@13..14 + INT_NUMBER@13..14 "2" + COMMA@14..15 "," + WHITESPACE@15..16 " " + ERROR@16..17 + AT@16..17 "@" + EXPR_STMT@17..18 + ERROR@17..18 + COMMA@17..18 "," + WHITESPACE@18..19 " " + STRUCT_DEF@19..26 + STRUCT_KW@19..25 "struct" + ERROR@25..26 + COMMA@25..26 "," + WHITESPACE@26..27 " " + LET_STMT@27..31 + LET_KW@27..30 "let" + ERROR@30..31 + R_BRACK@30..31 "]" + WHITESPACE@31..32 " " + R_CURLY@32..33 "}" + WHITESPACE@33..34 "\n" + FN_DEF@34..68 + FN_KW@34..36 "fn" + WHITESPACE@36..37 " " + NAME@37..38 + IDENT@37..38 "b" + PARAM_LIST@38..40 + L_PAREN@38..39 "(" + R_PAREN@39..40 ")" + WHITESPACE@40..41 " " + BLOCK_EXPR@41..68 + BLOCK@41..68 + L_CURLY@41..42 "{" + WHITESPACE@42..43 " " + EXPR_STMT@43..54 + CALL_EXPR@43..54 + PATH_EXPR@43..46 + PATH@43..46 + PATH_SEGMENT@43..46 + NAME_REF@43..46 + IDENT@43..46 "foo" + ARG_LIST@46..54 + L_PAREN@46..47 "(" + LITERAL@47..48 + INT_NUMBER@47..48 "1" + COMMA@48..49 "," + WHITESPACE@49..50 " " + LITERAL@50..51 + INT_NUMBER@50..51 "2" + COMMA@51..52 "," + WHITESPACE@52..53 " " + ERROR@53..54 + AT@53..54 "@" + EXPR_STMT@54..55 + ERROR@54..55 + COMMA@54..55 "," + WHITESPACE@55..56 " " + IMPL_DEF@56..60 + IMPL_KW@56..60 "impl" + EXPR_STMT@60..61 + ERROR@60..61 + COMMA@60..61 "," + WHITESPACE@61..62 " " + LET_STMT@62..65 + LET_KW@62..65 "let" + ERROR@65..66 + R_PAREN@65..66 ")" + WHITESPACE@66..67 " " + R_CURLY@67..68 "}" + WHITESPACE@68..69 "\n" + FN_DEF@69..111 + FN_KW@69..71 "fn" + WHITESPACE@71..72 " " + NAME@72..73 + IDENT@72..73 "c" + PARAM_LIST@73..75 + L_PAREN@73..74 "(" + R_PAREN@74..75 ")" + WHITESPACE@75..76 " " + BLOCK_EXPR@76..111 + BLOCK@76..111 + L_CURLY@76..77 "{" + WHITESPACE@77..78 " " + EXPR_STMT@78..93 + METHOD_CALL_EXPR@78..93 + PATH_EXPR@78..81 + PATH@78..81 + PATH_SEGMENT@78..81 + NAME_REF@78..81 + IDENT@78..81 "foo" + DOT@81..82 "." + NAME_REF@82..85 + IDENT@82..85 "bar" + ARG_LIST@85..93 + L_PAREN@85..86 "(" + LITERAL@86..87 + INT_NUMBER@86..87 "1" + COMMA@87..88 "," + WHITESPACE@88..89 " " + LITERAL@89..90 + INT_NUMBER@89..90 "2" + COMMA@90..91 "," + WHITESPACE@91..92 " " + ERROR@92..93 + AT@92..93 "@" + EXPR_STMT@93..94 + ERROR@93..94 + COMMA@93..94 "," + WHITESPACE@94..95 " " + EXPR_STMT@95..96 + ERROR@95..96 + R_BRACK@95..96 "]" + EXPR_STMT@96..97 + ERROR@96..97 + COMMA@96..97 "," + WHITESPACE@97..98 " " + TRAIT_DEF@98..104 + TRAIT_KW@98..103 "trait" + ERROR@103..104 + COMMA@103..104 "," + WHITESPACE@104..105 " " + LET_STMT@105..108 + LET_KW@105..108 "let" + ERROR@108..109 + R_PAREN@108..109 ")" + WHITESPACE@109..110 " " + R_CURLY@110..111 "}" + WHITESPACE@111..112 "\n" +error 16..16: expected expression +error 17..17: expected R_BRACK +error 17..17: expected SEMICOLON +error 17..17: expected expression +error 18..18: expected SEMICOLON +error 25..25: expected a name +error 26..26: expected `;`, `{`, or `(` +error 30..30: expected pattern +error 31..31: expected SEMICOLON +error 53..53: expected expression +error 54..54: expected SEMICOLON +error 54..54: expected expression +error 55..55: expected SEMICOLON +error 60..60: expected type +error 60..60: expected `{` +error 60..60: expected expression +error 61..61: expected SEMICOLON +error 65..65: expected pattern +error 65..65: expected SEMICOLON +error 65..65: expected expression +error 92..92: expected expression +error 93..93: expected SEMICOLON +error 93..93: expected expression +error 94..94: expected SEMICOLON +error 95..95: expected expression +error 96..96: expected SEMICOLON +error 96..96: expected expression +error 97..97: expected SEMICOLON +error 103..103: expected a name +error 104..104: expected `{` +error 108..108: expected pattern +error 108..108: expected SEMICOLON +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 97abe95102..c37594146d 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 @@ -1,44 +1,44 @@ -SOURCE_FILE@[0; 94) - FN_DEF@[0; 55) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 55) - BLOCK@[10; 55) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - MACRO_CALL@[16; 49) - PATH@[16; 19) - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "foo" - BANG@[19; 20) "!" - WHITESPACE@[20; 21) " " - TOKEN_TREE@[21; 49) - L_PAREN@[21; 22) "(" - WHITESPACE@[22; 31) "\n " - IDENT@[31; 34) "bar" - COMMA@[34; 35) "," - WHITESPACE@[35; 36) " " - STRING@[36; 41) "\"baz\"" - COMMA@[41; 42) "," - WHITESPACE@[42; 43) " " - INT_NUMBER@[43; 44) "1" - COMMA@[44; 45) "," - WHITESPACE@[45; 46) " " - FLOAT_NUMBER@[46; 49) "2.0" - WHITESPACE@[49; 54) "\n " - R_CURLY@[54; 55) "}" - WHITESPACE@[55; 56) " " - COMMENT@[56; 91) "//~ ERROR incorrect c ..." - WHITESPACE@[91; 92) "\n" - ERROR@[92; 93) - R_CURLY@[92; 93) "}" - WHITESPACE@[93; 94) "\n" -error [49; 49): unmatched `}` -error [92; 92): unmatched `}` +SOURCE_FILE@0..94 + FN_DEF@0..55 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..55 + BLOCK@10..55 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + MACRO_CALL@16..49 + PATH@16..19 + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "foo" + BANG@19..20 "!" + WHITESPACE@20..21 " " + TOKEN_TREE@21..49 + L_PAREN@21..22 "(" + WHITESPACE@22..31 "\n " + IDENT@31..34 "bar" + COMMA@34..35 "," + WHITESPACE@35..36 " " + STRING@36..41 "\"baz\"" + COMMA@41..42 "," + WHITESPACE@42..43 " " + INT_NUMBER@43..44 "1" + COMMA@44..45 "," + WHITESPACE@45..46 " " + FLOAT_NUMBER@46..49 "2.0" + WHITESPACE@49..54 "\n " + R_CURLY@54..55 "}" + WHITESPACE@55..56 " " + COMMENT@56..91 "//~ ERROR incorrect c ..." + WHITESPACE@91..92 "\n" + ERROR@92..93 + R_CURLY@92..93 "}" + WHITESPACE@93..94 "\n" +error 49..49: unmatched `}` +error 92..92: unmatched `}` 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 a3cf3e60a0..4296355f2c 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 @@ -1,321 +1,321 @@ -SOURCE_FILE@[0; 240) - FN_DEF@[0; 53) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "f" - TYPE_PARAM_LIST@[4; 48) - L_ANGLE@[4; 5) "<" - TYPE_PARAM@[5; 47) - NAME@[5; 6) - IDENT@[5; 6) "T" - COLON@[6; 7) ":" - WHITESPACE@[7; 8) " " - TYPE_BOUND_LIST@[8; 47) - TYPE_BOUND@[8; 14) - L_PAREN@[8; 9) "(" - PATH_TYPE@[9; 13) - PATH@[9; 13) - PATH_SEGMENT@[9; 13) - NAME_REF@[9; 13) - IDENT@[9; 13) "Copy" - R_PAREN@[13; 14) ")" - WHITESPACE@[14; 15) " " - PLUS@[15; 16) "+" - WHITESPACE@[16; 17) " " - TYPE_BOUND@[17; 25) - L_PAREN@[17; 18) "(" - QUESTION@[18; 19) "?" - PATH_TYPE@[19; 24) - PATH@[19; 24) - PATH_SEGMENT@[19; 24) - NAME_REF@[19; 24) - IDENT@[19; 24) "Sized" - R_PAREN@[24; 25) ")" - WHITESPACE@[25; 26) " " - PLUS@[26; 27) "+" - WHITESPACE@[27; 28) " " - TYPE_BOUND@[28; 47) - L_PAREN@[28; 29) "(" - FOR_TYPE@[29; 46) - FOR_KW@[29; 32) "for" - TYPE_PARAM_LIST@[32; 36) - L_ANGLE@[32; 33) "<" - LIFETIME_PARAM@[33; 35) - LIFETIME@[33; 35) "\'a" - R_ANGLE@[35; 36) ">" - WHITESPACE@[36; 37) " " - PATH_TYPE@[37; 46) - PATH@[37; 46) - PATH_SEGMENT@[37; 46) - NAME_REF@[37; 42) - IDENT@[37; 42) "Trait" - TYPE_ARG_LIST@[42; 46) - L_ANGLE@[42; 43) "<" - LIFETIME_ARG@[43; 45) - LIFETIME@[43; 45) "\'a" - R_ANGLE@[45; 46) ">" - R_PAREN@[46; 47) ")" - R_ANGLE@[47; 48) ">" - PARAM_LIST@[48; 50) - L_PAREN@[48; 49) "(" - R_PAREN@[49; 50) ")" - WHITESPACE@[50; 51) " " - BLOCK_EXPR@[51; 53) - BLOCK@[51; 53) - L_CURLY@[51; 52) "{" - R_CURLY@[52; 53) "}" - WHITESPACE@[53; 55) "\n\n" - FN_DEF@[55; 239) - FN_KW@[55; 57) "fn" - WHITESPACE@[57; 58) " " - NAME@[58; 62) - IDENT@[58; 62) "main" - PARAM_LIST@[62; 64) - L_PAREN@[62; 63) "(" - R_PAREN@[63; 64) ")" - WHITESPACE@[64; 65) " " - BLOCK_EXPR@[65; 239) - BLOCK@[65; 239) - L_CURLY@[65; 66) "{" - WHITESPACE@[66; 71) "\n " - LET_STMT@[71; 121) - LET_KW@[71; 74) "let" - WHITESPACE@[74; 75) " " - PLACEHOLDER_PAT@[75; 76) - UNDERSCORE@[75; 76) "_" - COLON@[76; 77) ":" - WHITESPACE@[77; 78) " " - DYN_TRAIT_TYPE@[78; 121) - TYPE_BOUND_LIST@[78; 121) - TYPE_BOUND@[78; 88) - PATH_TYPE@[78; 88) - PATH@[78; 88) - PATH_SEGMENT@[78; 88) - NAME_REF@[78; 81) - IDENT@[78; 81) "Box" - TYPE_ARG_LIST@[81; 88) - L_ANGLE@[81; 82) "<" - TYPE_ARG@[82; 88) - PAREN_TYPE@[82; 88) - L_PAREN@[82; 83) "(" - PATH_TYPE@[83; 87) - PATH@[83; 87) - PATH_SEGMENT@[83; 87) - NAME_REF@[83; 87) - IDENT@[83; 87) "Copy" - R_PAREN@[87; 88) ")" - WHITESPACE@[88; 89) " " - PLUS@[89; 90) "+" - WHITESPACE@[90; 91) " " - TYPE_BOUND@[91; 99) - L_PAREN@[91; 92) "(" - QUESTION@[92; 93) "?" - PATH_TYPE@[93; 98) - PATH@[93; 98) - PATH_SEGMENT@[93; 98) - NAME_REF@[93; 98) - IDENT@[93; 98) "Sized" - R_PAREN@[98; 99) ")" - WHITESPACE@[99; 100) " " - PLUS@[100; 101) "+" - WHITESPACE@[101; 102) " " - TYPE_BOUND@[102; 121) - L_PAREN@[102; 103) "(" - FOR_TYPE@[103; 120) - FOR_KW@[103; 106) "for" - TYPE_PARAM_LIST@[106; 110) - L_ANGLE@[106; 107) "<" - LIFETIME_PARAM@[107; 109) - LIFETIME@[107; 109) "\'a" - R_ANGLE@[109; 110) ">" - WHITESPACE@[110; 111) " " - PATH_TYPE@[111; 120) - PATH@[111; 120) - PATH_SEGMENT@[111; 120) - NAME_REF@[111; 116) - IDENT@[111; 116) "Trait" - TYPE_ARG_LIST@[116; 120) - L_ANGLE@[116; 117) "<" - LIFETIME_ARG@[117; 119) - LIFETIME@[117; 119) "\'a" - R_ANGLE@[119; 120) ">" - R_PAREN@[120; 121) ")" - EXPR_STMT@[121; 123) - ERROR@[121; 122) - R_ANGLE@[121; 122) ">" - SEMICOLON@[122; 123) ";" - WHITESPACE@[123; 128) "\n " - LET_STMT@[128; 141) - LET_KW@[128; 131) "let" - WHITESPACE@[131; 132) " " - PLACEHOLDER_PAT@[132; 133) - UNDERSCORE@[132; 133) "_" - COLON@[133; 134) ":" - WHITESPACE@[134; 135) " " - PATH_TYPE@[135; 141) - PATH@[135; 141) - PATH_SEGMENT@[135; 141) - NAME_REF@[135; 138) - IDENT@[135; 138) "Box" - TYPE_ARG_LIST@[138; 141) - L_ANGLE@[138; 139) "<" - TYPE_ARG@[139; 141) - PAREN_TYPE@[139; 141) - L_PAREN@[139; 140) "(" - ERROR@[140; 141) - QUESTION@[140; 141) "?" - EXPR_STMT@[141; 146) - PATH_EXPR@[141; 146) - PATH@[141; 146) - PATH_SEGMENT@[141; 146) - NAME_REF@[141; 146) - IDENT@[141; 146) "Sized" - EXPR_STMT@[146; 147) - ERROR@[146; 147) - R_PAREN@[146; 147) ")" - WHITESPACE@[147; 148) " " - EXPR_STMT@[148; 149) - ERROR@[148; 149) - PLUS@[148; 149) "+" - WHITESPACE@[149; 150) " " - EXPR_STMT@[150; 180) - TUPLE_EXPR@[150; 180) - L_PAREN@[150; 151) "(" - BIN_EXPR@[151; 180) - BIN_EXPR@[151; 178) - BIN_EXPR@[151; 169) - BIN_EXPR@[151; 167) - BIN_EXPR@[151; 164) - FOR_EXPR@[151; 157) - FOR_KW@[151; 154) "for" - ERROR@[154; 155) - L_ANGLE@[154; 155) "<" - ERROR@[155; 157) - LIFETIME@[155; 157) "\'a" - R_ANGLE@[157; 158) ">" - WHITESPACE@[158; 159) " " - PATH_EXPR@[159; 164) - PATH@[159; 164) - PATH_SEGMENT@[159; 164) - NAME_REF@[159; 164) - IDENT@[159; 164) "Trait" - L_ANGLE@[164; 165) "<" - ERROR@[165; 167) - LIFETIME@[165; 167) "\'a" - R_ANGLE@[167; 168) ">" - ERROR@[168; 169) - R_PAREN@[168; 169) ")" - WHITESPACE@[169; 170) " " - PLUS@[170; 171) "+" - WHITESPACE@[171; 172) " " - PAREN_EXPR@[172; 178) - L_PAREN@[172; 173) "(" - PATH_EXPR@[173; 177) - PATH@[173; 177) - PATH_SEGMENT@[173; 177) - NAME_REF@[173; 177) - IDENT@[173; 177) "Copy" - R_PAREN@[177; 178) ")" - R_ANGLE@[178; 179) ">" - ERROR@[179; 180) - SEMICOLON@[179; 180) ";" - WHITESPACE@[180; 185) "\n " - LET_STMT@[185; 235) - LET_KW@[185; 188) "let" - WHITESPACE@[188; 189) " " - PLACEHOLDER_PAT@[189; 190) - UNDERSCORE@[189; 190) "_" - COLON@[190; 191) ":" - WHITESPACE@[191; 192) " " - DYN_TRAIT_TYPE@[192; 235) - TYPE_BOUND_LIST@[192; 235) - TYPE_BOUND@[192; 215) - PATH_TYPE@[192; 215) - PATH@[192; 215) - PATH_SEGMENT@[192; 215) - NAME_REF@[192; 195) - IDENT@[192; 195) "Box" - TYPE_ARG_LIST@[195; 215) - L_ANGLE@[195; 196) "<" - TYPE_ARG@[196; 215) - PAREN_TYPE@[196; 215) - L_PAREN@[196; 197) "(" - FOR_TYPE@[197; 214) - FOR_KW@[197; 200) "for" - TYPE_PARAM_LIST@[200; 204) - L_ANGLE@[200; 201) "<" - LIFETIME_PARAM@[201; 203) - LIFETIME@[201; 203) "\'a" - R_ANGLE@[203; 204) ">" - WHITESPACE@[204; 205) " " - PATH_TYPE@[205; 214) - PATH@[205; 214) - PATH_SEGMENT@[205; 214) - NAME_REF@[205; 210) - IDENT@[205; 210) "Trait" - TYPE_ARG_LIST@[210; 214) - L_ANGLE@[210; 211) "<" - LIFETIME_ARG@[211; 213) - LIFETIME@[211; 213) "\'a" - R_ANGLE@[213; 214) ">" - R_PAREN@[214; 215) ")" - WHITESPACE@[215; 216) " " - PLUS@[216; 217) "+" - WHITESPACE@[217; 218) " " - TYPE_BOUND@[218; 224) - L_PAREN@[218; 219) "(" - PATH_TYPE@[219; 223) - PATH@[219; 223) - PATH_SEGMENT@[219; 223) - NAME_REF@[219; 223) - IDENT@[219; 223) "Copy" - R_PAREN@[223; 224) ")" - WHITESPACE@[224; 225) " " - PLUS@[225; 226) "+" - WHITESPACE@[226; 227) " " - TYPE_BOUND@[227; 235) - L_PAREN@[227; 228) "(" - QUESTION@[228; 229) "?" - PATH_TYPE@[229; 234) - PATH@[229; 234) - PATH_SEGMENT@[229; 234) - NAME_REF@[229; 234) - IDENT@[229; 234) "Sized" - R_PAREN@[234; 235) ")" - EXPR_STMT@[235; 237) - ERROR@[235; 236) - R_ANGLE@[235; 236) ">" - SEMICOLON@[236; 237) ";" - WHITESPACE@[237; 238) "\n" - R_CURLY@[238; 239) "}" - WHITESPACE@[239; 240) "\n" -error [88; 88): expected COMMA -error [88; 88): expected R_ANGLE -error [121; 121): expected SEMICOLON -error [121; 121): expected expression -error [140; 140): expected type -error [141; 141): expected R_PAREN -error [141; 141): expected COMMA -error [141; 141): expected R_ANGLE -error [141; 141): expected SEMICOLON -error [146; 146): expected SEMICOLON -error [146; 146): expected expression -error [147; 147): expected SEMICOLON -error [148; 148): expected expression -error [149; 149): expected SEMICOLON -error [154; 154): expected pattern -error [155; 155): expected IN_KW -error [155; 155): expected expression -error [157; 157): expected a block -error [165; 165): expected expression -error [168; 168): expected expression -error [179; 179): expected expression -error [180; 180): expected COMMA -error [180; 180): expected expression -error [180; 180): expected R_PAREN -error [180; 180): expected SEMICOLON -error [215; 215): expected COMMA -error [215; 215): expected R_ANGLE -error [235; 235): expected SEMICOLON -error [235; 235): expected expression +SOURCE_FILE@0..240 + FN_DEF@0..53 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "f" + TYPE_PARAM_LIST@4..48 + L_ANGLE@4..5 "<" + TYPE_PARAM@5..47 + NAME@5..6 + IDENT@5..6 "T" + COLON@6..7 ":" + WHITESPACE@7..8 " " + TYPE_BOUND_LIST@8..47 + TYPE_BOUND@8..14 + L_PAREN@8..9 "(" + PATH_TYPE@9..13 + PATH@9..13 + PATH_SEGMENT@9..13 + NAME_REF@9..13 + IDENT@9..13 "Copy" + R_PAREN@13..14 ")" + WHITESPACE@14..15 " " + PLUS@15..16 "+" + WHITESPACE@16..17 " " + TYPE_BOUND@17..25 + L_PAREN@17..18 "(" + QUESTION@18..19 "?" + PATH_TYPE@19..24 + PATH@19..24 + PATH_SEGMENT@19..24 + NAME_REF@19..24 + IDENT@19..24 "Sized" + R_PAREN@24..25 ")" + WHITESPACE@25..26 " " + PLUS@26..27 "+" + WHITESPACE@27..28 " " + TYPE_BOUND@28..47 + L_PAREN@28..29 "(" + FOR_TYPE@29..46 + FOR_KW@29..32 "for" + TYPE_PARAM_LIST@32..36 + L_ANGLE@32..33 "<" + LIFETIME_PARAM@33..35 + LIFETIME@33..35 "\'a" + R_ANGLE@35..36 ">" + WHITESPACE@36..37 " " + PATH_TYPE@37..46 + PATH@37..46 + PATH_SEGMENT@37..46 + NAME_REF@37..42 + IDENT@37..42 "Trait" + TYPE_ARG_LIST@42..46 + L_ANGLE@42..43 "<" + LIFETIME_ARG@43..45 + LIFETIME@43..45 "\'a" + R_ANGLE@45..46 ">" + R_PAREN@46..47 ")" + R_ANGLE@47..48 ">" + PARAM_LIST@48..50 + L_PAREN@48..49 "(" + R_PAREN@49..50 ")" + WHITESPACE@50..51 " " + BLOCK_EXPR@51..53 + BLOCK@51..53 + L_CURLY@51..52 "{" + R_CURLY@52..53 "}" + WHITESPACE@53..55 "\n\n" + FN_DEF@55..239 + FN_KW@55..57 "fn" + WHITESPACE@57..58 " " + NAME@58..62 + IDENT@58..62 "main" + PARAM_LIST@62..64 + L_PAREN@62..63 "(" + R_PAREN@63..64 ")" + WHITESPACE@64..65 " " + BLOCK_EXPR@65..239 + BLOCK@65..239 + L_CURLY@65..66 "{" + WHITESPACE@66..71 "\n " + LET_STMT@71..121 + LET_KW@71..74 "let" + WHITESPACE@74..75 " " + PLACEHOLDER_PAT@75..76 + UNDERSCORE@75..76 "_" + COLON@76..77 ":" + WHITESPACE@77..78 " " + DYN_TRAIT_TYPE@78..121 + TYPE_BOUND_LIST@78..121 + TYPE_BOUND@78..88 + PATH_TYPE@78..88 + PATH@78..88 + PATH_SEGMENT@78..88 + NAME_REF@78..81 + IDENT@78..81 "Box" + TYPE_ARG_LIST@81..88 + L_ANGLE@81..82 "<" + TYPE_ARG@82..88 + PAREN_TYPE@82..88 + L_PAREN@82..83 "(" + PATH_TYPE@83..87 + PATH@83..87 + PATH_SEGMENT@83..87 + NAME_REF@83..87 + IDENT@83..87 "Copy" + R_PAREN@87..88 ")" + WHITESPACE@88..89 " " + PLUS@89..90 "+" + WHITESPACE@90..91 " " + TYPE_BOUND@91..99 + L_PAREN@91..92 "(" + QUESTION@92..93 "?" + PATH_TYPE@93..98 + PATH@93..98 + PATH_SEGMENT@93..98 + NAME_REF@93..98 + IDENT@93..98 "Sized" + R_PAREN@98..99 ")" + WHITESPACE@99..100 " " + PLUS@100..101 "+" + WHITESPACE@101..102 " " + TYPE_BOUND@102..121 + L_PAREN@102..103 "(" + FOR_TYPE@103..120 + FOR_KW@103..106 "for" + TYPE_PARAM_LIST@106..110 + L_ANGLE@106..107 "<" + LIFETIME_PARAM@107..109 + LIFETIME@107..109 "\'a" + R_ANGLE@109..110 ">" + WHITESPACE@110..111 " " + PATH_TYPE@111..120 + PATH@111..120 + PATH_SEGMENT@111..120 + NAME_REF@111..116 + IDENT@111..116 "Trait" + TYPE_ARG_LIST@116..120 + L_ANGLE@116..117 "<" + LIFETIME_ARG@117..119 + LIFETIME@117..119 "\'a" + R_ANGLE@119..120 ">" + R_PAREN@120..121 ")" + EXPR_STMT@121..123 + ERROR@121..122 + R_ANGLE@121..122 ">" + SEMICOLON@122..123 ";" + WHITESPACE@123..128 "\n " + LET_STMT@128..141 + LET_KW@128..131 "let" + WHITESPACE@131..132 " " + PLACEHOLDER_PAT@132..133 + UNDERSCORE@132..133 "_" + COLON@133..134 ":" + WHITESPACE@134..135 " " + PATH_TYPE@135..141 + PATH@135..141 + PATH_SEGMENT@135..141 + NAME_REF@135..138 + IDENT@135..138 "Box" + TYPE_ARG_LIST@138..141 + L_ANGLE@138..139 "<" + TYPE_ARG@139..141 + PAREN_TYPE@139..141 + L_PAREN@139..140 "(" + ERROR@140..141 + QUESTION@140..141 "?" + EXPR_STMT@141..146 + PATH_EXPR@141..146 + PATH@141..146 + PATH_SEGMENT@141..146 + NAME_REF@141..146 + IDENT@141..146 "Sized" + EXPR_STMT@146..147 + ERROR@146..147 + R_PAREN@146..147 ")" + WHITESPACE@147..148 " " + EXPR_STMT@148..149 + ERROR@148..149 + PLUS@148..149 "+" + WHITESPACE@149..150 " " + EXPR_STMT@150..180 + TUPLE_EXPR@150..180 + L_PAREN@150..151 "(" + BIN_EXPR@151..180 + BIN_EXPR@151..178 + BIN_EXPR@151..169 + BIN_EXPR@151..167 + BIN_EXPR@151..164 + FOR_EXPR@151..157 + FOR_KW@151..154 "for" + ERROR@154..155 + L_ANGLE@154..155 "<" + ERROR@155..157 + LIFETIME@155..157 "\'a" + R_ANGLE@157..158 ">" + WHITESPACE@158..159 " " + PATH_EXPR@159..164 + PATH@159..164 + PATH_SEGMENT@159..164 + NAME_REF@159..164 + IDENT@159..164 "Trait" + L_ANGLE@164..165 "<" + ERROR@165..167 + LIFETIME@165..167 "\'a" + R_ANGLE@167..168 ">" + ERROR@168..169 + R_PAREN@168..169 ")" + WHITESPACE@169..170 " " + PLUS@170..171 "+" + WHITESPACE@171..172 " " + PAREN_EXPR@172..178 + L_PAREN@172..173 "(" + PATH_EXPR@173..177 + PATH@173..177 + PATH_SEGMENT@173..177 + NAME_REF@173..177 + IDENT@173..177 "Copy" + R_PAREN@177..178 ")" + R_ANGLE@178..179 ">" + ERROR@179..180 + SEMICOLON@179..180 ";" + WHITESPACE@180..185 "\n " + LET_STMT@185..235 + LET_KW@185..188 "let" + WHITESPACE@188..189 " " + PLACEHOLDER_PAT@189..190 + UNDERSCORE@189..190 "_" + COLON@190..191 ":" + WHITESPACE@191..192 " " + DYN_TRAIT_TYPE@192..235 + TYPE_BOUND_LIST@192..235 + TYPE_BOUND@192..215 + PATH_TYPE@192..215 + PATH@192..215 + PATH_SEGMENT@192..215 + NAME_REF@192..195 + IDENT@192..195 "Box" + TYPE_ARG_LIST@195..215 + L_ANGLE@195..196 "<" + TYPE_ARG@196..215 + PAREN_TYPE@196..215 + L_PAREN@196..197 "(" + FOR_TYPE@197..214 + FOR_KW@197..200 "for" + TYPE_PARAM_LIST@200..204 + L_ANGLE@200..201 "<" + LIFETIME_PARAM@201..203 + LIFETIME@201..203 "\'a" + R_ANGLE@203..204 ">" + WHITESPACE@204..205 " " + PATH_TYPE@205..214 + PATH@205..214 + PATH_SEGMENT@205..214 + NAME_REF@205..210 + IDENT@205..210 "Trait" + TYPE_ARG_LIST@210..214 + L_ANGLE@210..211 "<" + LIFETIME_ARG@211..213 + LIFETIME@211..213 "\'a" + R_ANGLE@213..214 ">" + R_PAREN@214..215 ")" + WHITESPACE@215..216 " " + PLUS@216..217 "+" + WHITESPACE@217..218 " " + TYPE_BOUND@218..224 + L_PAREN@218..219 "(" + PATH_TYPE@219..223 + PATH@219..223 + PATH_SEGMENT@219..223 + NAME_REF@219..223 + IDENT@219..223 "Copy" + R_PAREN@223..224 ")" + WHITESPACE@224..225 " " + PLUS@225..226 "+" + WHITESPACE@226..227 " " + TYPE_BOUND@227..235 + L_PAREN@227..228 "(" + QUESTION@228..229 "?" + PATH_TYPE@229..234 + PATH@229..234 + PATH_SEGMENT@229..234 + NAME_REF@229..234 + IDENT@229..234 "Sized" + R_PAREN@234..235 ")" + EXPR_STMT@235..237 + ERROR@235..236 + R_ANGLE@235..236 ">" + SEMICOLON@236..237 ";" + WHITESPACE@237..238 "\n" + R_CURLY@238..239 "}" + WHITESPACE@239..240 "\n" +error 88..88: expected COMMA +error 88..88: expected R_ANGLE +error 121..121: expected SEMICOLON +error 121..121: expected expression +error 140..140: expected type +error 141..141: expected R_PAREN +error 141..141: expected COMMA +error 141..141: expected R_ANGLE +error 141..141: expected SEMICOLON +error 146..146: expected SEMICOLON +error 146..146: expected expression +error 147..147: expected SEMICOLON +error 148..148: expected expression +error 149..149: expected SEMICOLON +error 154..154: expected pattern +error 155..155: expected IN_KW +error 155..155: expected expression +error 157..157: expected a block +error 165..165: expected expression +error 168..168: expected expression +error 179..179: expected expression +error 180..180: expected COMMA +error 180..180: expected expression +error 180..180: expected R_PAREN +error 180..180: expected SEMICOLON +error 215..215: expected COMMA +error 215..215: expected R_ANGLE +error 235..235: expected SEMICOLON +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 2b37ce94df..195c08bd98 100644 --- a/crates/ra_syntax/test_data/parser/err/0025_nope.rast +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rast @@ -1,204 +1,204 @@ -SOURCE_FILE@[0; 575) - FN_DEF@[0; 574) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 574) - BLOCK@[10; 574) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - ENUM_DEF@[16; 152) - ENUM_KW@[16; 20) "enum" - WHITESPACE@[20; 21) " " - NAME@[21; 25) - IDENT@[21; 25) "Test" - WHITESPACE@[25; 26) " " - ENUM_VARIANT_LIST@[26; 152) - L_CURLY@[26; 27) "{" - WHITESPACE@[27; 36) "\n " - ENUM_VARIANT@[36; 40) - NAME@[36; 40) - IDENT@[36; 40) "Var1" - COMMA@[40; 41) "," - WHITESPACE@[41; 50) "\n " - ENUM_VARIANT@[50; 62) - NAME@[50; 54) - IDENT@[50; 54) "Var2" - TUPLE_FIELD_DEF_LIST@[54; 62) - L_PAREN@[54; 55) "(" - TUPLE_FIELD_DEF@[55; 61) - PATH_TYPE@[55; 61) - PATH@[55; 61) - PATH_SEGMENT@[55; 61) - NAME_REF@[55; 61) - IDENT@[55; 61) "String" - R_PAREN@[61; 62) ")" - COMMA@[62; 63) "," - WHITESPACE@[63; 72) "\n " - ENUM_VARIANT@[72; 145) - NAME@[72; 76) - IDENT@[72; 76) "Var3" - WHITESPACE@[76; 77) " " - RECORD_FIELD_DEF_LIST@[77; 145) - L_CURLY@[77; 78) "{" - WHITESPACE@[78; 91) "\n " - RECORD_FIELD_DEF@[91; 95) - NAME@[91; 94) - IDENT@[91; 94) "abc" - COLON@[94; 95) ":" - WHITESPACE@[95; 96) " " - ERROR@[96; 98) - L_CURLY@[96; 97) "{" - R_CURLY@[97; 98) "}" - ERROR@[98; 99) - COMMA@[98; 99) "," - WHITESPACE@[99; 100) " " - COMMENT@[100; 135) "//~ ERROR: expected t ..." - WHITESPACE@[135; 144) "\n " - R_CURLY@[144; 145) "}" - COMMA@[145; 146) "," - WHITESPACE@[146; 151) "\n " - R_CURLY@[151; 152) "}" - WHITESPACE@[152; 158) "\n\n " - COMMENT@[158; 171) "// recover..." - WHITESPACE@[171; 176) "\n " - LET_STMT@[176; 186) - LET_KW@[176; 179) "let" - WHITESPACE@[179; 180) " " - BIND_PAT@[180; 181) - NAME@[180; 181) - IDENT@[180; 181) "a" - WHITESPACE@[181; 182) " " - EQ@[182; 183) "=" - WHITESPACE@[183; 184) " " - LITERAL@[184; 185) - INT_NUMBER@[184; 185) "1" - SEMICOLON@[185; 186) ";" - WHITESPACE@[186; 191) "\n " - ENUM_DEF@[191; 223) - ENUM_KW@[191; 195) "enum" - WHITESPACE@[195; 196) " " - NAME@[196; 201) - IDENT@[196; 201) "Test2" - WHITESPACE@[201; 202) " " - ENUM_VARIANT_LIST@[202; 223) - L_CURLY@[202; 203) "{" - WHITESPACE@[203; 212) "\n " - ENUM_VARIANT@[212; 216) - NAME@[212; 216) - IDENT@[212; 216) "Fine" - COMMA@[216; 217) "," - WHITESPACE@[217; 222) "\n " - R_CURLY@[222; 223) "}" - WHITESPACE@[223; 229) "\n\n " - ENUM_DEF@[229; 300) - ENUM_KW@[229; 233) "enum" - WHITESPACE@[233; 234) " " - NAME@[234; 239) - IDENT@[234; 239) "Test3" - WHITESPACE@[239; 240) " " - ENUM_VARIANT_LIST@[240; 300) - L_CURLY@[240; 241) "{" - WHITESPACE@[241; 250) "\n " - ENUM_VARIANT@[250; 293) - NAME@[250; 259) - IDENT@[250; 259) "StillFine" - WHITESPACE@[259; 260) " " - RECORD_FIELD_DEF_LIST@[260; 293) - L_CURLY@[260; 261) "{" - WHITESPACE@[261; 274) "\n " - RECORD_FIELD_DEF@[274; 282) - NAME@[274; 277) - IDENT@[274; 277) "def" - COLON@[277; 278) ":" - WHITESPACE@[278; 279) " " - PATH_TYPE@[279; 282) - PATH@[279; 282) - PATH_SEGMENT@[279; 282) - NAME_REF@[279; 282) - IDENT@[279; 282) "i32" - COMMA@[282; 283) "," - WHITESPACE@[283; 292) "\n " - R_CURLY@[292; 293) "}" - COMMA@[293; 294) "," - WHITESPACE@[294; 299) "\n " - R_CURLY@[299; 300) "}" - WHITESPACE@[300; 306) "\n\n " - EXPR_STMT@[306; 459) - BLOCK_EXPR@[306; 459) - BLOCK@[306; 459) - L_CURLY@[306; 307) "{" - WHITESPACE@[307; 316) "\n " - ENUM_DEF@[316; 453) - COMMENT@[316; 329) "// fail again" - WHITESPACE@[329; 338) "\n " - ENUM_KW@[338; 342) "enum" - WHITESPACE@[342; 343) " " - NAME@[343; 348) - IDENT@[343; 348) "Test4" - WHITESPACE@[348; 349) " " - ENUM_VARIANT_LIST@[349; 453) - L_CURLY@[349; 350) "{" - WHITESPACE@[350; 363) "\n " - ENUM_VARIANT@[363; 372) - NAME@[363; 367) - IDENT@[363; 367) "Nope" - TUPLE_FIELD_DEF_LIST@[367; 372) - L_PAREN@[367; 368) "(" - TUPLE_FIELD_DEF@[368; 371) - PATH_TYPE@[368; 371) - PATH@[368; 371) - PATH_SEGMENT@[368; 371) - NAME_REF@[368; 371) - IDENT@[368; 371) "i32" - WHITESPACE@[371; 372) " " - ERROR@[372; 372) - ERROR@[372; 374) - L_CURLY@[372; 373) "{" - R_CURLY@[373; 374) "}" - ERROR@[374; 375) - R_PAREN@[374; 375) ")" - WHITESPACE@[375; 376) " " - COMMENT@[376; 396) "//~ ERROR: found `{`" - WHITESPACE@[396; 422) "\n ..." - COMMENT@[422; 443) "//~^ ERROR: found `{`" - WHITESPACE@[443; 452) "\n " - R_CURLY@[452; 453) "}" - WHITESPACE@[453; 458) "\n " - R_CURLY@[458; 459) "}" - WHITESPACE@[459; 464) "\n " - COMMENT@[464; 486) "// still recover later" - WHITESPACE@[486; 491) "\n " - LET_STMT@[491; 510) - LET_KW@[491; 494) "let" - WHITESPACE@[494; 495) " " - BIND_PAT@[495; 505) - NAME@[495; 505) - IDENT@[495; 505) "bad_syntax" - WHITESPACE@[505; 506) " " - EQ@[506; 507) "=" - WHITESPACE@[507; 508) " " - ERROR@[508; 509) - UNDERSCORE@[508; 509) "_" - SEMICOLON@[509; 510) ";" - WHITESPACE@[510; 511) " " - COMMENT@[511; 572) "//~ ERROR: expected e ..." - WHITESPACE@[572; 573) "\n" - R_CURLY@[573; 574) "}" - WHITESPACE@[574; 575) "\n" -error [95; 95): expected type -error [95; 95): expected COMMA -error [96; 96): expected field -error [98; 98): expected field declaration -error [371; 371): expected COMMA -error [372; 372): expected a type -error [372; 372): expected R_PAREN -error [372; 372): expected COMMA -error [372; 372): expected enum variant -error [374; 374): expected enum variant -error [508; 508): expected expression +SOURCE_FILE@0..575 + FN_DEF@0..574 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..574 + BLOCK@10..574 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + ENUM_DEF@16..152 + ENUM_KW@16..20 "enum" + WHITESPACE@20..21 " " + NAME@21..25 + IDENT@21..25 "Test" + WHITESPACE@25..26 " " + ENUM_VARIANT_LIST@26..152 + L_CURLY@26..27 "{" + WHITESPACE@27..36 "\n " + ENUM_VARIANT@36..40 + NAME@36..40 + IDENT@36..40 "Var1" + COMMA@40..41 "," + WHITESPACE@41..50 "\n " + ENUM_VARIANT@50..62 + NAME@50..54 + IDENT@50..54 "Var2" + TUPLE_FIELD_DEF_LIST@54..62 + L_PAREN@54..55 "(" + TUPLE_FIELD_DEF@55..61 + PATH_TYPE@55..61 + PATH@55..61 + PATH_SEGMENT@55..61 + NAME_REF@55..61 + IDENT@55..61 "String" + R_PAREN@61..62 ")" + COMMA@62..63 "," + WHITESPACE@63..72 "\n " + ENUM_VARIANT@72..145 + NAME@72..76 + IDENT@72..76 "Var3" + WHITESPACE@76..77 " " + RECORD_FIELD_DEF_LIST@77..145 + L_CURLY@77..78 "{" + WHITESPACE@78..91 "\n " + RECORD_FIELD_DEF@91..95 + NAME@91..94 + IDENT@91..94 "abc" + COLON@94..95 ":" + WHITESPACE@95..96 " " + ERROR@96..98 + L_CURLY@96..97 "{" + R_CURLY@97..98 "}" + ERROR@98..99 + COMMA@98..99 "," + WHITESPACE@99..100 " " + COMMENT@100..135 "//~ ERROR: expected t ..." + WHITESPACE@135..144 "\n " + R_CURLY@144..145 "}" + COMMA@145..146 "," + WHITESPACE@146..151 "\n " + R_CURLY@151..152 "}" + WHITESPACE@152..158 "\n\n " + COMMENT@158..171 "// recover..." + WHITESPACE@171..176 "\n " + LET_STMT@176..186 + LET_KW@176..179 "let" + WHITESPACE@179..180 " " + BIND_PAT@180..181 + NAME@180..181 + IDENT@180..181 "a" + WHITESPACE@181..182 " " + EQ@182..183 "=" + WHITESPACE@183..184 " " + LITERAL@184..185 + INT_NUMBER@184..185 "1" + SEMICOLON@185..186 ";" + WHITESPACE@186..191 "\n " + ENUM_DEF@191..223 + ENUM_KW@191..195 "enum" + WHITESPACE@195..196 " " + NAME@196..201 + IDENT@196..201 "Test2" + WHITESPACE@201..202 " " + ENUM_VARIANT_LIST@202..223 + L_CURLY@202..203 "{" + WHITESPACE@203..212 "\n " + ENUM_VARIANT@212..216 + NAME@212..216 + IDENT@212..216 "Fine" + COMMA@216..217 "," + WHITESPACE@217..222 "\n " + R_CURLY@222..223 "}" + WHITESPACE@223..229 "\n\n " + ENUM_DEF@229..300 + ENUM_KW@229..233 "enum" + WHITESPACE@233..234 " " + NAME@234..239 + IDENT@234..239 "Test3" + WHITESPACE@239..240 " " + ENUM_VARIANT_LIST@240..300 + L_CURLY@240..241 "{" + WHITESPACE@241..250 "\n " + ENUM_VARIANT@250..293 + NAME@250..259 + IDENT@250..259 "StillFine" + WHITESPACE@259..260 " " + RECORD_FIELD_DEF_LIST@260..293 + L_CURLY@260..261 "{" + WHITESPACE@261..274 "\n " + RECORD_FIELD_DEF@274..282 + NAME@274..277 + IDENT@274..277 "def" + COLON@277..278 ":" + WHITESPACE@278..279 " " + PATH_TYPE@279..282 + PATH@279..282 + PATH_SEGMENT@279..282 + NAME_REF@279..282 + IDENT@279..282 "i32" + COMMA@282..283 "," + WHITESPACE@283..292 "\n " + R_CURLY@292..293 "}" + COMMA@293..294 "," + WHITESPACE@294..299 "\n " + R_CURLY@299..300 "}" + WHITESPACE@300..306 "\n\n " + EXPR_STMT@306..459 + BLOCK_EXPR@306..459 + BLOCK@306..459 + L_CURLY@306..307 "{" + WHITESPACE@307..316 "\n " + ENUM_DEF@316..453 + COMMENT@316..329 "// fail again" + WHITESPACE@329..338 "\n " + ENUM_KW@338..342 "enum" + WHITESPACE@342..343 " " + NAME@343..348 + IDENT@343..348 "Test4" + WHITESPACE@348..349 " " + ENUM_VARIANT_LIST@349..453 + L_CURLY@349..350 "{" + WHITESPACE@350..363 "\n " + ENUM_VARIANT@363..372 + NAME@363..367 + IDENT@363..367 "Nope" + TUPLE_FIELD_DEF_LIST@367..372 + L_PAREN@367..368 "(" + TUPLE_FIELD_DEF@368..371 + PATH_TYPE@368..371 + PATH@368..371 + PATH_SEGMENT@368..371 + NAME_REF@368..371 + IDENT@368..371 "i32" + WHITESPACE@371..372 " " + ERROR@372..372 + ERROR@372..374 + L_CURLY@372..373 "{" + R_CURLY@373..374 "}" + ERROR@374..375 + R_PAREN@374..375 ")" + WHITESPACE@375..376 " " + COMMENT@376..396 "//~ ERROR: found `{`" + WHITESPACE@396..422 "\n ..." + COMMENT@422..443 "//~^ ERROR: found `{`" + WHITESPACE@443..452 "\n " + R_CURLY@452..453 "}" + WHITESPACE@453..458 "\n " + R_CURLY@458..459 "}" + WHITESPACE@459..464 "\n " + COMMENT@464..486 "// still recover later" + WHITESPACE@486..491 "\n " + LET_STMT@491..510 + LET_KW@491..494 "let" + WHITESPACE@494..495 " " + BIND_PAT@495..505 + NAME@495..505 + IDENT@495..505 "bad_syntax" + WHITESPACE@505..506 " " + EQ@506..507 "=" + WHITESPACE@507..508 " " + ERROR@508..509 + UNDERSCORE@508..509 "_" + SEMICOLON@509..510 ";" + WHITESPACE@510..511 " " + COMMENT@511..572 "//~ ERROR: expected e ..." + WHITESPACE@572..573 "\n" + R_CURLY@573..574 "}" + WHITESPACE@574..575 "\n" +error 95..95: expected type +error 95..95: expected COMMA +error 96..96: expected field +error 98..98: expected field declaration +error 371..371: expected COMMA +error 372..372: expected a type +error 372..372: expected R_PAREN +error 372..372: expected COMMA +error 372..372: expected enum variant +error 374..374: expected enum variant +error 508..508: expected expression diff --git a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast index f239b7b1e5..bf07409fb0 100644 --- a/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast +++ b/crates/ra_syntax/test_data/parser/err/0026_imp_recovery.rast @@ -1,49 +1,49 @@ -SOURCE_FILE@[0; 38) - IMPL_DEF@[0; 14) - IMPL_KW@[0; 4) "impl" - TYPE_PARAM_LIST@[4; 14) - L_ANGLE@[4; 5) "<" - TYPE_PARAM@[5; 13) - NAME@[5; 6) - IDENT@[5; 6) "T" - COLON@[6; 7) ":" - WHITESPACE@[7; 8) " " - TYPE_BOUND_LIST@[8; 13) - TYPE_BOUND@[8; 13) - PATH_TYPE@[8; 13) - PATH@[8; 13) - PATH_SEGMENT@[8; 13) - NAME_REF@[8; 13) - IDENT@[8; 13) "Clone" - R_ANGLE@[13; 14) ">" - WHITESPACE@[14; 15) "\n" - IMPL_DEF@[15; 37) - IMPL_KW@[15; 19) "impl" - TYPE_PARAM_LIST@[19; 22) - L_ANGLE@[19; 20) "<" - TYPE_PARAM@[20; 21) - NAME@[20; 21) - IDENT@[20; 21) "T" - R_ANGLE@[21; 22) ">" - WHITESPACE@[22; 23) " " - PATH_TYPE@[23; 34) - PATH@[23; 34) - PATH_SEGMENT@[23; 34) - NAME_REF@[23; 31) - IDENT@[23; 31) "OnceCell" - TYPE_ARG_LIST@[31; 34) - L_ANGLE@[31; 32) "<" - TYPE_ARG@[32; 33) - PATH_TYPE@[32; 33) - PATH@[32; 33) - PATH_SEGMENT@[32; 33) - NAME_REF@[32; 33) - IDENT@[32; 33) "T" - R_ANGLE@[33; 34) ">" - WHITESPACE@[34; 35) " " - ITEM_LIST@[35; 37) - L_CURLY@[35; 36) "{" - R_CURLY@[36; 37) "}" - WHITESPACE@[37; 38) "\n" -error [14; 14): expected trait or type -error [14; 14): expected `{` +SOURCE_FILE@0..38 + IMPL_DEF@0..14 + IMPL_KW@0..4 "impl" + TYPE_PARAM_LIST@4..14 + L_ANGLE@4..5 "<" + TYPE_PARAM@5..13 + NAME@5..6 + IDENT@5..6 "T" + COLON@6..7 ":" + WHITESPACE@7..8 " " + TYPE_BOUND_LIST@8..13 + TYPE_BOUND@8..13 + PATH_TYPE@8..13 + PATH@8..13 + PATH_SEGMENT@8..13 + NAME_REF@8..13 + IDENT@8..13 "Clone" + R_ANGLE@13..14 ">" + WHITESPACE@14..15 "\n" + IMPL_DEF@15..37 + IMPL_KW@15..19 "impl" + TYPE_PARAM_LIST@19..22 + L_ANGLE@19..20 "<" + TYPE_PARAM@20..21 + NAME@20..21 + IDENT@20..21 "T" + R_ANGLE@21..22 ">" + WHITESPACE@22..23 " " + PATH_TYPE@23..34 + PATH@23..34 + PATH_SEGMENT@23..34 + NAME_REF@23..31 + IDENT@23..31 "OnceCell" + TYPE_ARG_LIST@31..34 + L_ANGLE@31..32 "<" + TYPE_ARG@32..33 + PATH_TYPE@32..33 + PATH@32..33 + PATH_SEGMENT@32..33 + NAME_REF@32..33 + IDENT@32..33 "T" + R_ANGLE@33..34 ">" + WHITESPACE@34..35 " " + ITEM_LIST@35..37 + L_CURLY@35..36 "{" + R_CURLY@36..37 "}" + WHITESPACE@37..38 "\n" +error 14..14: expected trait or type +error 14..14: expected `{` diff --git a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast index 4a28bcabff..f2fada5105 100644 --- a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast +++ b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast @@ -1,29 +1,29 @@ -SOURCE_FILE@[0; 30) - FN_DEF@[0; 29) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 13) "\n " - WHERE_CLAUSE@[13; 26) - WHERE_KW@[13; 18) "where" - WHITESPACE@[18; 19) " " - WHERE_PRED@[19; 26) - FOR_TYPE@[19; 26) - FOR_KW@[19; 22) "for" - TYPE_PARAM_LIST@[22; 26) - L_ANGLE@[22; 23) "<" - LIFETIME_PARAM@[23; 25) - LIFETIME@[23; 25) "\'a" - R_ANGLE@[25; 26) ">" - WHITESPACE@[26; 27) "\n" - BLOCK_EXPR@[27; 29) - BLOCK@[27; 29) - L_CURLY@[27; 28) "{" - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) "\n" -error [26; 26): expected a path -error [26; 26): expected colon +SOURCE_FILE@0..30 + FN_DEF@0..29 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..13 "\n " + WHERE_CLAUSE@13..26 + WHERE_KW@13..18 "where" + WHITESPACE@18..19 " " + WHERE_PRED@19..26 + FOR_TYPE@19..26 + FOR_KW@19..22 "for" + TYPE_PARAM_LIST@22..26 + L_ANGLE@22..23 "<" + LIFETIME_PARAM@23..25 + LIFETIME@23..25 "\'a" + R_ANGLE@25..26 ">" + WHITESPACE@26..27 "\n" + BLOCK_EXPR@27..29 + BLOCK@27..29 + L_CURLY@27..28 "{" + R_CURLY@28..29 "}" + WHITESPACE@29..30 "\n" +error 26..26: expected a path +error 26..26: expected colon diff --git a/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast b/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast index 1778494760..56682f9661 100644 --- a/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast +++ b/crates/ra_syntax/test_data/parser/err/0029_field_completion.rast @@ -1,36 +1,36 @@ -SOURCE_FILE@[0; 24) - FN_DEF@[0; 23) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 12) - L_PAREN@[6; 7) "(" - PARAM@[7; 11) - BIND_PAT@[7; 8) - NAME@[7; 8) - IDENT@[7; 8) "a" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - PATH_TYPE@[10; 11) - PATH@[10; 11) - PATH_SEGMENT@[10; 11) - NAME_REF@[10; 11) - IDENT@[10; 11) "A" - R_PAREN@[11; 12) ")" - WHITESPACE@[12; 13) " " - BLOCK_EXPR@[13; 23) - BLOCK@[13; 23) - L_CURLY@[13; 14) "{" - WHITESPACE@[14; 19) "\n " - FIELD_EXPR@[19; 21) - PATH_EXPR@[19; 20) - PATH@[19; 20) - PATH_SEGMENT@[19; 20) - NAME_REF@[19; 20) - IDENT@[19; 20) "a" - DOT@[20; 21) "." - WHITESPACE@[21; 22) "\n" - R_CURLY@[22; 23) "}" - WHITESPACE@[23; 24) "\n" -error [21; 21): expected field name or number +SOURCE_FILE@0..24 + FN_DEF@0..23 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..12 + L_PAREN@6..7 "(" + PARAM@7..11 + BIND_PAT@7..8 + NAME@7..8 + IDENT@7..8 "a" + COLON@8..9 ":" + WHITESPACE@9..10 " " + PATH_TYPE@10..11 + PATH@10..11 + PATH_SEGMENT@10..11 + NAME_REF@10..11 + IDENT@10..11 "A" + R_PAREN@11..12 ")" + WHITESPACE@12..13 " " + BLOCK_EXPR@13..23 + BLOCK@13..23 + L_CURLY@13..14 "{" + WHITESPACE@14..19 "\n " + FIELD_EXPR@19..21 + PATH_EXPR@19..20 + PATH@19..20 + PATH_SEGMENT@19..20 + NAME_REF@19..20 + IDENT@19..20 "a" + DOT@20..21 "." + WHITESPACE@21..22 "\n" + R_CURLY@22..23 "}" + WHITESPACE@23..24 "\n" +error 21..21: expected field name or number 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 00d9fd5114..aac4764304 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 @@ -1,125 +1,125 @@ -SOURCE_FILE@[0; 350) - FN_DEF@[0; 349) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 8) - IDENT@[3; 8) "block" - PARAM_LIST@[8; 10) - L_PAREN@[8; 9) "(" - R_PAREN@[9; 10) ")" - WHITESPACE@[10; 11) " " - BLOCK_EXPR@[11; 349) - BLOCK@[11; 349) - L_CURLY@[11; 12) "{" - WHITESPACE@[12; 17) "\n " - LET_STMT@[17; 129) - LET_KW@[17; 20) "let" - WHITESPACE@[20; 21) " " - BIND_PAT@[21; 26) - NAME@[21; 26) - IDENT@[21; 26) "inner" - WHITESPACE@[26; 27) " " - EQ@[27; 28) "=" - WHITESPACE@[28; 29) " " - BLOCK_EXPR@[29; 128) - BLOCK@[29; 128) - L_CURLY@[29; 30) "{" - WHITESPACE@[30; 39) "\n " - ATTR@[39; 83) - POUND@[39; 40) "#" - BANG@[40; 41) "!" - L_BRACK@[41; 42) "[" - PATH@[42; 45) - PATH_SEGMENT@[42; 45) - NAME_REF@[42; 45) - IDENT@[42; 45) "doc" - TOKEN_TREE@[45; 82) - L_PAREN@[45; 46) "(" - STRING@[46; 81) "\"Inner attributes not ..." - R_PAREN@[81; 82) ")" - R_BRACK@[82; 83) "]" - WHITESPACE@[83; 92) "\n " - COMMENT@[92; 122) "//! Nor are ModuleDoc ..." - WHITESPACE@[122; 127) "\n " - R_CURLY@[127; 128) "}" - SEMICOLON@[128; 129) ";" - WHITESPACE@[129; 134) "\n " - EXPR_STMT@[134; 257) - IF_EXPR@[134; 257) - IF_KW@[134; 136) "if" - WHITESPACE@[136; 137) " " - CONDITION@[137; 141) - LITERAL@[137; 141) - TRUE_KW@[137; 141) "true" - WHITESPACE@[141; 142) " " - BLOCK_EXPR@[142; 257) - BLOCK@[142; 257) - L_CURLY@[142; 143) "{" - WHITESPACE@[143; 152) "\n " - ATTR@[152; 171) - POUND@[152; 153) "#" - BANG@[153; 154) "!" - L_BRACK@[154; 155) "[" - PATH@[155; 158) - PATH_SEGMENT@[155; 158) - NAME_REF@[155; 158) - IDENT@[155; 158) "doc" - TOKEN_TREE@[158; 170) - L_PAREN@[158; 159) "(" - STRING@[159; 169) "\"Nor here\"" - R_PAREN@[169; 170) ")" - R_BRACK@[170; 171) "]" - WHITESPACE@[171; 180) "\n " - ATTR@[180; 212) - POUND@[180; 181) "#" - BANG@[181; 182) "!" - L_BRACK@[182; 183) "[" - PATH@[183; 186) - PATH_SEGMENT@[183; 186) - NAME_REF@[183; 186) - IDENT@[183; 186) "doc" - TOKEN_TREE@[186; 211) - L_PAREN@[186; 187) "(" - STRING@[187; 210) "\"We error on each attr\"" - R_PAREN@[210; 211) ")" - R_BRACK@[211; 212) "]" - WHITESPACE@[212; 221) "\n " - COMMENT@[221; 251) "//! Nor are ModuleDoc ..." - WHITESPACE@[251; 256) "\n " - R_CURLY@[256; 257) "}" - WHITESPACE@[257; 262) "\n " - WHILE_EXPR@[262; 347) - WHILE_KW@[262; 267) "while" - WHITESPACE@[267; 268) " " - CONDITION@[268; 272) - LITERAL@[268; 272) - TRUE_KW@[268; 272) "true" - WHITESPACE@[272; 273) " " - BLOCK_EXPR@[273; 347) - BLOCK@[273; 347) - L_CURLY@[273; 274) "{" - WHITESPACE@[274; 283) "\n " - ATTR@[283; 302) - POUND@[283; 284) "#" - BANG@[284; 285) "!" - L_BRACK@[285; 286) "[" - PATH@[286; 289) - PATH_SEGMENT@[286; 289) - NAME_REF@[286; 289) - IDENT@[286; 289) "doc" - TOKEN_TREE@[289; 301) - L_PAREN@[289; 290) "(" - STRING@[290; 300) "\"Nor here\"" - R_PAREN@[300; 301) ")" - R_BRACK@[301; 302) "]" - WHITESPACE@[302; 311) "\n " - COMMENT@[311; 341) "//! Nor are ModuleDoc ..." - WHITESPACE@[341; 346) "\n " - R_CURLY@[346; 347) "}" - WHITESPACE@[347; 348) "\n" - R_CURLY@[348; 349) "}" - WHITESPACE@[349; 350) "\n" -error [39; 83): A block in this position cannot accept inner attributes -error [152; 171): A block in this position cannot accept inner attributes -error [180; 212): A block in this position cannot accept inner attributes -error [283; 302): A block in this position cannot accept inner attributes +SOURCE_FILE@0..350 + FN_DEF@0..349 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..8 + IDENT@3..8 "block" + PARAM_LIST@8..10 + L_PAREN@8..9 "(" + R_PAREN@9..10 ")" + WHITESPACE@10..11 " " + BLOCK_EXPR@11..349 + BLOCK@11..349 + L_CURLY@11..12 "{" + WHITESPACE@12..17 "\n " + LET_STMT@17..129 + LET_KW@17..20 "let" + WHITESPACE@20..21 " " + BIND_PAT@21..26 + NAME@21..26 + IDENT@21..26 "inner" + WHITESPACE@26..27 " " + EQ@27..28 "=" + WHITESPACE@28..29 " " + BLOCK_EXPR@29..128 + BLOCK@29..128 + L_CURLY@29..30 "{" + WHITESPACE@30..39 "\n " + ATTR@39..83 + POUND@39..40 "#" + BANG@40..41 "!" + L_BRACK@41..42 "[" + PATH@42..45 + PATH_SEGMENT@42..45 + NAME_REF@42..45 + IDENT@42..45 "doc" + TOKEN_TREE@45..82 + L_PAREN@45..46 "(" + STRING@46..81 "\"Inner attributes not ..." + R_PAREN@81..82 ")" + R_BRACK@82..83 "]" + WHITESPACE@83..92 "\n " + COMMENT@92..122 "//! Nor are ModuleDoc ..." + WHITESPACE@122..127 "\n " + R_CURLY@127..128 "}" + SEMICOLON@128..129 ";" + WHITESPACE@129..134 "\n " + EXPR_STMT@134..257 + IF_EXPR@134..257 + IF_KW@134..136 "if" + WHITESPACE@136..137 " " + CONDITION@137..141 + LITERAL@137..141 + TRUE_KW@137..141 "true" + WHITESPACE@141..142 " " + BLOCK_EXPR@142..257 + BLOCK@142..257 + L_CURLY@142..143 "{" + WHITESPACE@143..152 "\n " + ATTR@152..171 + POUND@152..153 "#" + BANG@153..154 "!" + L_BRACK@154..155 "[" + PATH@155..158 + PATH_SEGMENT@155..158 + NAME_REF@155..158 + IDENT@155..158 "doc" + TOKEN_TREE@158..170 + L_PAREN@158..159 "(" + STRING@159..169 "\"Nor here\"" + R_PAREN@169..170 ")" + R_BRACK@170..171 "]" + WHITESPACE@171..180 "\n " + ATTR@180..212 + POUND@180..181 "#" + BANG@181..182 "!" + L_BRACK@182..183 "[" + PATH@183..186 + PATH_SEGMENT@183..186 + NAME_REF@183..186 + IDENT@183..186 "doc" + TOKEN_TREE@186..211 + L_PAREN@186..187 "(" + STRING@187..210 "\"We error on each attr\"" + R_PAREN@210..211 ")" + R_BRACK@211..212 "]" + WHITESPACE@212..221 "\n " + COMMENT@221..251 "//! Nor are ModuleDoc ..." + WHITESPACE@251..256 "\n " + R_CURLY@256..257 "}" + WHITESPACE@257..262 "\n " + WHILE_EXPR@262..347 + WHILE_KW@262..267 "while" + WHITESPACE@267..268 " " + CONDITION@268..272 + LITERAL@268..272 + TRUE_KW@268..272 "true" + WHITESPACE@272..273 " " + BLOCK_EXPR@273..347 + BLOCK@273..347 + L_CURLY@273..274 "{" + WHITESPACE@274..283 "\n " + ATTR@283..302 + POUND@283..284 "#" + BANG@284..285 "!" + L_BRACK@285..286 "[" + PATH@286..289 + PATH_SEGMENT@286..289 + NAME_REF@286..289 + IDENT@286..289 "doc" + TOKEN_TREE@289..301 + L_PAREN@289..290 "(" + STRING@290..300 "\"Nor here\"" + R_PAREN@300..301 ")" + R_BRACK@301..302 "]" + WHITESPACE@302..311 "\n " + COMMENT@311..341 "//! Nor are ModuleDoc ..." + WHITESPACE@341..346 "\n " + R_CURLY@346..347 "}" + WHITESPACE@347..348 "\n" + R_CURLY@348..349 "}" + WHITESPACE@349..350 "\n" +error 39..83: A block in this position cannot accept inner attributes +error 152..171: A block in this position cannot accept inner attributes +error 180..212: A block in this position cannot accept inner attributes +error 283..302: A block in this position cannot accept inner attributes 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 b80101e60f..f98de7f151 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 @@ -1,204 +1,204 @@ -SOURCE_FILE@[0; 293) - FN_DEF@[0; 292) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 292) - BLOCK@[9; 292) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 101) - MATCH_EXPR@[15; 101) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 101) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 41) - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - FAT_ARROW@[36; 38) "=>" - WHITESPACE@[38; 39) " " - TUPLE_EXPR@[39; 41) - L_PAREN@[39; 40) "(" - R_PAREN@[40; 41) ")" - COMMA@[41; 42) "," - WHITESPACE@[42; 51) "\n " - MATCH_ARM@[51; 78) - ATTR@[51; 52) - POUND@[51; 52) "#" - ERROR@[52; 53) - BANG@[52; 53) "!" - ARRAY_EXPR@[53; 78) - L_BRACK@[53; 54) "[" - CALL_EXPR@[54; 77) - PATH_EXPR@[54; 57) - PATH@[54; 57) - PATH_SEGMENT@[54; 57) - NAME_REF@[54; 57) - IDENT@[54; 57) "doc" - ARG_LIST@[57; 77) - L_PAREN@[57; 58) "(" - LITERAL@[58; 76) - STRING@[58; 76) "\"Not allowed here\"" - R_PAREN@[76; 77) ")" - R_BRACK@[77; 78) "]" - WHITESPACE@[78; 87) "\n " - MATCH_ARM@[87; 94) - PLACEHOLDER_PAT@[87; 88) - UNDERSCORE@[87; 88) "_" - WHITESPACE@[88; 89) " " - FAT_ARROW@[89; 91) "=>" - WHITESPACE@[91; 92) " " - TUPLE_EXPR@[92; 94) - L_PAREN@[92; 93) "(" - R_PAREN@[93; 94) ")" - COMMA@[94; 95) "," - WHITESPACE@[95; 100) "\n " - R_CURLY@[100; 101) "}" - WHITESPACE@[101; 107) "\n\n " - EXPR_STMT@[107; 185) - MATCH_EXPR@[107; 185) - MATCH_KW@[107; 112) "match" - WHITESPACE@[112; 113) " " - TUPLE_EXPR@[113; 115) - L_PAREN@[113; 114) "(" - R_PAREN@[114; 115) ")" - WHITESPACE@[115; 116) " " - MATCH_ARM_LIST@[116; 185) - L_CURLY@[116; 117) "{" - WHITESPACE@[117; 126) "\n " - MATCH_ARM@[126; 133) - PLACEHOLDER_PAT@[126; 127) - UNDERSCORE@[126; 127) "_" - WHITESPACE@[127; 128) " " - FAT_ARROW@[128; 130) "=>" - WHITESPACE@[130; 131) " " - TUPLE_EXPR@[131; 133) - L_PAREN@[131; 132) "(" - R_PAREN@[132; 133) ")" - COMMA@[133; 134) "," - WHITESPACE@[134; 143) "\n " - MATCH_ARM@[143; 150) - PLACEHOLDER_PAT@[143; 144) - UNDERSCORE@[143; 144) "_" - WHITESPACE@[144; 145) " " - FAT_ARROW@[145; 147) "=>" - WHITESPACE@[147; 148) " " - TUPLE_EXPR@[148; 150) - L_PAREN@[148; 149) "(" - R_PAREN@[149; 150) ")" - COMMA@[150; 151) "," - WHITESPACE@[151; 160) "\n " - MATCH_ARM@[160; 179) - ATTR@[160; 161) - POUND@[160; 161) "#" - ERROR@[161; 162) - BANG@[161; 162) "!" - ARRAY_EXPR@[162; 179) - L_BRACK@[162; 163) "[" - CALL_EXPR@[163; 178) - PATH_EXPR@[163; 166) - PATH@[163; 166) - PATH_SEGMENT@[163; 166) - NAME_REF@[163; 166) - IDENT@[163; 166) "doc" - ARG_LIST@[166; 178) - L_PAREN@[166; 167) "(" - LITERAL@[167; 177) - STRING@[167; 177) "\"Nor here\"" - R_PAREN@[177; 178) ")" - R_BRACK@[178; 179) "]" - WHITESPACE@[179; 184) "\n " - R_CURLY@[184; 185) "}" - WHITESPACE@[185; 191) "\n\n " - MATCH_EXPR@[191; 290) - MATCH_KW@[191; 196) "match" - WHITESPACE@[196; 197) " " - TUPLE_EXPR@[197; 199) - L_PAREN@[197; 198) "(" - R_PAREN@[198; 199) ")" - WHITESPACE@[199; 200) " " - MATCH_ARM_LIST@[200; 290) - L_CURLY@[200; 201) "{" - WHITESPACE@[201; 210) "\n " - MATCH_ARM@[210; 250) - ATTR@[210; 222) - POUND@[210; 211) "#" - L_BRACK@[211; 212) "[" - PATH@[212; 215) - PATH_SEGMENT@[212; 215) - NAME_REF@[212; 215) - IDENT@[212; 215) "cfg" - TOKEN_TREE@[215; 221) - L_PAREN@[215; 216) "(" - IDENT@[216; 220) "test" - R_PAREN@[220; 221) ")" - R_BRACK@[221; 222) "]" - WHITESPACE@[222; 231) "\n " - ATTR@[231; 232) - POUND@[231; 232) "#" - ERROR@[232; 233) - BANG@[232; 233) "!" - ARRAY_EXPR@[233; 250) - L_BRACK@[233; 234) "[" - CALL_EXPR@[234; 249) - PATH_EXPR@[234; 237) - PATH@[234; 237) - PATH_SEGMENT@[234; 237) - NAME_REF@[234; 237) - IDENT@[234; 237) "doc" - ARG_LIST@[237; 249) - L_PAREN@[237; 238) "(" - LITERAL@[238; 248) - STRING@[238; 248) "\"Nor here\"" - R_PAREN@[248; 249) ")" - R_BRACK@[249; 250) "]" - WHITESPACE@[250; 259) "\n " - MATCH_ARM@[259; 266) - PLACEHOLDER_PAT@[259; 260) - UNDERSCORE@[259; 260) "_" - WHITESPACE@[260; 261) " " - FAT_ARROW@[261; 263) "=>" - WHITESPACE@[263; 264) " " - TUPLE_EXPR@[264; 266) - L_PAREN@[264; 265) "(" - R_PAREN@[265; 266) ")" - COMMA@[266; 267) "," - WHITESPACE@[267; 276) "\n " - MATCH_ARM@[276; 283) - PLACEHOLDER_PAT@[276; 277) - UNDERSCORE@[276; 277) "_" - WHITESPACE@[277; 278) " " - FAT_ARROW@[278; 280) "=>" - WHITESPACE@[280; 281) " " - TUPLE_EXPR@[281; 283) - L_PAREN@[281; 282) "(" - R_PAREN@[282; 283) ")" - COMMA@[283; 284) "," - WHITESPACE@[284; 289) "\n " - R_CURLY@[289; 290) "}" - WHITESPACE@[290; 291) "\n" - R_CURLY@[291; 292) "}" - WHITESPACE@[292; 293) "\n" -error [52; 52): expected `[` -error [52; 52): expected pattern -error [53; 53): expected FAT_ARROW -error [78; 78): expected COMMA -error [161; 161): expected `[` -error [161; 161): expected pattern -error [162; 162): expected FAT_ARROW -error [232; 232): expected `[` -error [232; 232): expected pattern -error [233; 233): expected FAT_ARROW -error [250; 250): expected COMMA +SOURCE_FILE@0..293 + FN_DEF@0..292 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..292 + BLOCK@9..292 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..101 + MATCH_EXPR@15..101 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..101 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..41 + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + FAT_ARROW@36..38 "=>" + WHITESPACE@38..39 " " + TUPLE_EXPR@39..41 + L_PAREN@39..40 "(" + R_PAREN@40..41 ")" + COMMA@41..42 "," + WHITESPACE@42..51 "\n " + MATCH_ARM@51..78 + ATTR@51..52 + POUND@51..52 "#" + ERROR@52..53 + BANG@52..53 "!" + ARRAY_EXPR@53..78 + L_BRACK@53..54 "[" + CALL_EXPR@54..77 + PATH_EXPR@54..57 + PATH@54..57 + PATH_SEGMENT@54..57 + NAME_REF@54..57 + IDENT@54..57 "doc" + ARG_LIST@57..77 + L_PAREN@57..58 "(" + LITERAL@58..76 + STRING@58..76 "\"Not allowed here\"" + R_PAREN@76..77 ")" + R_BRACK@77..78 "]" + WHITESPACE@78..87 "\n " + MATCH_ARM@87..94 + PLACEHOLDER_PAT@87..88 + UNDERSCORE@87..88 "_" + WHITESPACE@88..89 " " + FAT_ARROW@89..91 "=>" + WHITESPACE@91..92 " " + TUPLE_EXPR@92..94 + L_PAREN@92..93 "(" + R_PAREN@93..94 ")" + COMMA@94..95 "," + WHITESPACE@95..100 "\n " + R_CURLY@100..101 "}" + WHITESPACE@101..107 "\n\n " + EXPR_STMT@107..185 + MATCH_EXPR@107..185 + MATCH_KW@107..112 "match" + WHITESPACE@112..113 " " + TUPLE_EXPR@113..115 + L_PAREN@113..114 "(" + R_PAREN@114..115 ")" + WHITESPACE@115..116 " " + MATCH_ARM_LIST@116..185 + L_CURLY@116..117 "{" + WHITESPACE@117..126 "\n " + MATCH_ARM@126..133 + PLACEHOLDER_PAT@126..127 + UNDERSCORE@126..127 "_" + WHITESPACE@127..128 " " + FAT_ARROW@128..130 "=>" + WHITESPACE@130..131 " " + TUPLE_EXPR@131..133 + L_PAREN@131..132 "(" + R_PAREN@132..133 ")" + COMMA@133..134 "," + WHITESPACE@134..143 "\n " + MATCH_ARM@143..150 + PLACEHOLDER_PAT@143..144 + UNDERSCORE@143..144 "_" + WHITESPACE@144..145 " " + FAT_ARROW@145..147 "=>" + WHITESPACE@147..148 " " + TUPLE_EXPR@148..150 + L_PAREN@148..149 "(" + R_PAREN@149..150 ")" + COMMA@150..151 "," + WHITESPACE@151..160 "\n " + MATCH_ARM@160..179 + ATTR@160..161 + POUND@160..161 "#" + ERROR@161..162 + BANG@161..162 "!" + ARRAY_EXPR@162..179 + L_BRACK@162..163 "[" + CALL_EXPR@163..178 + PATH_EXPR@163..166 + PATH@163..166 + PATH_SEGMENT@163..166 + NAME_REF@163..166 + IDENT@163..166 "doc" + ARG_LIST@166..178 + L_PAREN@166..167 "(" + LITERAL@167..177 + STRING@167..177 "\"Nor here\"" + R_PAREN@177..178 ")" + R_BRACK@178..179 "]" + WHITESPACE@179..184 "\n " + R_CURLY@184..185 "}" + WHITESPACE@185..191 "\n\n " + MATCH_EXPR@191..290 + MATCH_KW@191..196 "match" + WHITESPACE@196..197 " " + TUPLE_EXPR@197..199 + L_PAREN@197..198 "(" + R_PAREN@198..199 ")" + WHITESPACE@199..200 " " + MATCH_ARM_LIST@200..290 + L_CURLY@200..201 "{" + WHITESPACE@201..210 "\n " + MATCH_ARM@210..250 + ATTR@210..222 + POUND@210..211 "#" + L_BRACK@211..212 "[" + PATH@212..215 + PATH_SEGMENT@212..215 + NAME_REF@212..215 + IDENT@212..215 "cfg" + TOKEN_TREE@215..221 + L_PAREN@215..216 "(" + IDENT@216..220 "test" + R_PAREN@220..221 ")" + R_BRACK@221..222 "]" + WHITESPACE@222..231 "\n " + ATTR@231..232 + POUND@231..232 "#" + ERROR@232..233 + BANG@232..233 "!" + ARRAY_EXPR@233..250 + L_BRACK@233..234 "[" + CALL_EXPR@234..249 + PATH_EXPR@234..237 + PATH@234..237 + PATH_SEGMENT@234..237 + NAME_REF@234..237 + IDENT@234..237 "doc" + ARG_LIST@237..249 + L_PAREN@237..238 "(" + LITERAL@238..248 + STRING@238..248 "\"Nor here\"" + R_PAREN@248..249 ")" + R_BRACK@249..250 "]" + WHITESPACE@250..259 "\n " + MATCH_ARM@259..266 + PLACEHOLDER_PAT@259..260 + UNDERSCORE@259..260 "_" + WHITESPACE@260..261 " " + FAT_ARROW@261..263 "=>" + WHITESPACE@263..264 " " + TUPLE_EXPR@264..266 + L_PAREN@264..265 "(" + R_PAREN@265..266 ")" + COMMA@266..267 "," + WHITESPACE@267..276 "\n " + MATCH_ARM@276..283 + PLACEHOLDER_PAT@276..277 + UNDERSCORE@276..277 "_" + WHITESPACE@277..278 " " + FAT_ARROW@278..280 "=>" + WHITESPACE@280..281 " " + TUPLE_EXPR@281..283 + L_PAREN@281..282 "(" + R_PAREN@282..283 ")" + COMMA@283..284 "," + WHITESPACE@284..289 "\n " + R_CURLY@289..290 "}" + WHITESPACE@290..291 "\n" + R_CURLY@291..292 "}" + WHITESPACE@292..293 "\n" +error 52..52: expected `[` +error 52..52: expected pattern +error 53..53: expected FAT_ARROW +error 78..78: expected COMMA +error 161..161: expected `[` +error 161..161: expected pattern +error 162..162: expected FAT_ARROW +error 232..232: expected `[` +error 232..232: expected pattern +error 233..233: expected FAT_ARROW +error 250..250: expected COMMA diff --git a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast index e914e688bb..d0017c883c 100644 --- a/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast +++ b/crates/ra_syntax/test_data/parser/err/0033_match_arms_outer_attrs.rast @@ -1,67 +1,67 @@ -SOURCE_FILE@[0; 89) - FN_DEF@[0; 88) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 88) - BLOCK@[9; 88) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - MATCH_EXPR@[15; 86) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 86) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 41) - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - FAT_ARROW@[36; 38) "=>" - WHITESPACE@[38; 39) " " - TUPLE_EXPR@[39; 41) - L_PAREN@[39; 40) "(" - R_PAREN@[40; 41) ")" - COMMA@[41; 42) "," - WHITESPACE@[42; 51) "\n " - MATCH_ARM@[51; 58) - PLACEHOLDER_PAT@[51; 52) - UNDERSCORE@[51; 52) "_" - WHITESPACE@[52; 53) " " - FAT_ARROW@[53; 55) "=>" - WHITESPACE@[55; 56) " " - TUPLE_EXPR@[56; 58) - L_PAREN@[56; 57) "(" - R_PAREN@[57; 58) ")" - COMMA@[58; 59) "," - WHITESPACE@[59; 68) "\n " - MATCH_ARM@[68; 80) - ATTR@[68; 80) - POUND@[68; 69) "#" - L_BRACK@[69; 70) "[" - PATH@[70; 73) - PATH_SEGMENT@[70; 73) - NAME_REF@[70; 73) - IDENT@[70; 73) "cfg" - TOKEN_TREE@[73; 79) - L_PAREN@[73; 74) "(" - IDENT@[74; 78) "test" - R_PAREN@[78; 79) ")" - R_BRACK@[79; 80) "]" - WHITESPACE@[80; 85) "\n " - R_CURLY@[85; 86) "}" - WHITESPACE@[86; 87) "\n" - R_CURLY@[87; 88) "}" - WHITESPACE@[88; 89) "\n" -error [80; 80): expected pattern -error [80; 80): expected FAT_ARROW -error [80; 80): expected expression +SOURCE_FILE@0..89 + FN_DEF@0..88 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..88 + BLOCK@9..88 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + MATCH_EXPR@15..86 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..86 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..41 + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + FAT_ARROW@36..38 "=>" + WHITESPACE@38..39 " " + TUPLE_EXPR@39..41 + L_PAREN@39..40 "(" + R_PAREN@40..41 ")" + COMMA@41..42 "," + WHITESPACE@42..51 "\n " + MATCH_ARM@51..58 + PLACEHOLDER_PAT@51..52 + UNDERSCORE@51..52 "_" + WHITESPACE@52..53 " " + FAT_ARROW@53..55 "=>" + WHITESPACE@55..56 " " + TUPLE_EXPR@56..58 + L_PAREN@56..57 "(" + R_PAREN@57..58 ")" + COMMA@58..59 "," + WHITESPACE@59..68 "\n " + MATCH_ARM@68..80 + ATTR@68..80 + POUND@68..69 "#" + L_BRACK@69..70 "[" + PATH@70..73 + PATH_SEGMENT@70..73 + NAME_REF@70..73 + IDENT@70..73 "cfg" + TOKEN_TREE@73..79 + L_PAREN@73..74 "(" + IDENT@74..78 "test" + R_PAREN@78..79 ")" + R_BRACK@79..80 "]" + WHITESPACE@80..85 "\n " + R_CURLY@85..86 "}" + WHITESPACE@86..87 "\n" + R_CURLY@87..88 "}" + WHITESPACE@88..89 "\n" +error 80..80: expected pattern +error 80..80: expected FAT_ARROW +error 80..80: expected expression 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 2ab9ee56f1..2c0bddec85 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 @@ -1,96 +1,96 @@ -SOURCE_FILE@[0; 91) - FN_DEF@[0; 89) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 89) - BLOCK@[10; 89) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 27) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - BIND_PAT@[20; 27) - REF_KW@[20; 23) "ref" - WHITESPACE@[23; 24) " " - ERROR@[24; 27) - BOX_KW@[24; 27) "box" - WHITESPACE@[27; 28) " " - EXPR_STMT@[28; 35) - BIN_EXPR@[28; 34) - PATH_EXPR@[28; 29) - PATH@[28; 29) - PATH_SEGMENT@[28; 29) - NAME_REF@[28; 29) - IDENT@[28; 29) "i" - WHITESPACE@[29; 30) " " - EQ@[30; 31) "=" - WHITESPACE@[31; 32) " " - TUPLE_EXPR@[32; 34) - L_PAREN@[32; 33) "(" - R_PAREN@[33; 34) ")" - SEMICOLON@[34; 35) ";" - WHITESPACE@[35; 40) "\n " - LET_STMT@[40; 51) - LET_KW@[40; 43) "let" - WHITESPACE@[43; 44) " " - BIND_PAT@[44; 51) - MUT_KW@[44; 47) "mut" - WHITESPACE@[47; 48) " " - ERROR@[48; 51) - BOX_KW@[48; 51) "box" - WHITESPACE@[51; 52) " " - EXPR_STMT@[52; 59) - BIN_EXPR@[52; 58) - PATH_EXPR@[52; 53) - PATH@[52; 53) - PATH_SEGMENT@[52; 53) - NAME_REF@[52; 53) - IDENT@[52; 53) "i" - WHITESPACE@[53; 54) " " - EQ@[54; 55) "=" - WHITESPACE@[55; 56) " " - TUPLE_EXPR@[56; 58) - L_PAREN@[56; 57) "(" - R_PAREN@[57; 58) ")" - SEMICOLON@[58; 59) ";" - WHITESPACE@[59; 64) "\n " - LET_STMT@[64; 79) - LET_KW@[64; 67) "let" - WHITESPACE@[67; 68) " " - BIND_PAT@[68; 79) - REF_KW@[68; 71) "ref" - WHITESPACE@[71; 72) " " - MUT_KW@[72; 75) "mut" - WHITESPACE@[75; 76) " " - ERROR@[76; 79) - BOX_KW@[76; 79) "box" - WHITESPACE@[79; 80) " " - EXPR_STMT@[80; 87) - BIN_EXPR@[80; 86) - PATH_EXPR@[80; 81) - PATH@[80; 81) - PATH_SEGMENT@[80; 81) - NAME_REF@[80; 81) - IDENT@[80; 81) "i" - WHITESPACE@[81; 82) " " - EQ@[82; 83) "=" - WHITESPACE@[83; 84) " " - TUPLE_EXPR@[84; 86) - L_PAREN@[84; 85) "(" - R_PAREN@[85; 86) ")" - SEMICOLON@[86; 87) ";" - WHITESPACE@[87; 88) "\n" - R_CURLY@[88; 89) "}" - WHITESPACE@[89; 91) "\n\n" -error [24; 24): expected a name -error [27; 27): expected SEMICOLON -error [48; 48): expected a name -error [51; 51): expected SEMICOLON -error [76; 76): expected a name -error [79; 79): expected SEMICOLON +SOURCE_FILE@0..91 + FN_DEF@0..89 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..89 + BLOCK@10..89 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..27 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + BIND_PAT@20..27 + REF_KW@20..23 "ref" + WHITESPACE@23..24 " " + ERROR@24..27 + BOX_KW@24..27 "box" + WHITESPACE@27..28 " " + EXPR_STMT@28..35 + BIN_EXPR@28..34 + PATH_EXPR@28..29 + PATH@28..29 + PATH_SEGMENT@28..29 + NAME_REF@28..29 + IDENT@28..29 "i" + WHITESPACE@29..30 " " + EQ@30..31 "=" + WHITESPACE@31..32 " " + TUPLE_EXPR@32..34 + L_PAREN@32..33 "(" + R_PAREN@33..34 ")" + SEMICOLON@34..35 ";" + WHITESPACE@35..40 "\n " + LET_STMT@40..51 + LET_KW@40..43 "let" + WHITESPACE@43..44 " " + BIND_PAT@44..51 + MUT_KW@44..47 "mut" + WHITESPACE@47..48 " " + ERROR@48..51 + BOX_KW@48..51 "box" + WHITESPACE@51..52 " " + EXPR_STMT@52..59 + BIN_EXPR@52..58 + PATH_EXPR@52..53 + PATH@52..53 + PATH_SEGMENT@52..53 + NAME_REF@52..53 + IDENT@52..53 "i" + WHITESPACE@53..54 " " + EQ@54..55 "=" + WHITESPACE@55..56 " " + TUPLE_EXPR@56..58 + L_PAREN@56..57 "(" + R_PAREN@57..58 ")" + SEMICOLON@58..59 ";" + WHITESPACE@59..64 "\n " + LET_STMT@64..79 + LET_KW@64..67 "let" + WHITESPACE@67..68 " " + BIND_PAT@68..79 + REF_KW@68..71 "ref" + WHITESPACE@71..72 " " + MUT_KW@72..75 "mut" + WHITESPACE@75..76 " " + ERROR@76..79 + BOX_KW@76..79 "box" + WHITESPACE@79..80 " " + EXPR_STMT@80..87 + BIN_EXPR@80..86 + PATH_EXPR@80..81 + PATH@80..81 + PATH_SEGMENT@80..81 + NAME_REF@80..81 + IDENT@80..81 "i" + WHITESPACE@81..82 " " + EQ@82..83 "=" + WHITESPACE@83..84 " " + TUPLE_EXPR@84..86 + L_PAREN@84..85 "(" + R_PAREN@85..86 ")" + SEMICOLON@86..87 ";" + WHITESPACE@87..88 "\n" + R_CURLY@88..89 "}" + WHITESPACE@89..91 "\n\n" +error 24..24: expected a name +error 27..27: expected SEMICOLON +error 48..48: expected a name +error 51..51: expected SEMICOLON +error 76..76: expected a name +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 f255b0a6be..83851f5d2f 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 @@ -1,54 +1,54 @@ -SOURCE_FILE@[0; 48) - USE_ITEM@[0; 13) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 12) - PATH@[4; 12) - PATH@[4; 7) - PATH_SEGMENT@[4; 7) - NAME_REF@[4; 7) - IDENT@[4; 7) "foo" - COLON2@[7; 9) "::" - PATH_SEGMENT@[9; 12) - NAME_REF@[9; 12) - IDENT@[9; 12) "bar" - SEMICOLON@[12; 13) ";" - WHITESPACE@[13; 14) "\n" - USE_ITEM@[14; 17) - USE_KW@[14; 17) "use" - WHITESPACE@[17; 18) "\n" - USE_ITEM@[18; 33) - USE_KW@[18; 21) "use" - WHITESPACE@[21; 22) " " - USE_TREE@[22; 32) - PATH@[22; 32) - PATH@[22; 27) - PATH_SEGMENT@[22; 27) - CRATE_KW@[22; 27) "crate" - COLON2@[27; 29) "::" - PATH_SEGMENT@[29; 32) - NAME_REF@[29; 32) - IDENT@[29; 32) "baz" - SEMICOLON@[32; 33) ";" - WHITESPACE@[33; 34) "\n" - USE_ITEM@[34; 37) - USE_KW@[34; 37) "use" - WHITESPACE@[37; 38) "\n" - FN_DEF@[38; 47) - FN_KW@[38; 40) "fn" - WHITESPACE@[40; 41) " " - NAME@[41; 42) - IDENT@[41; 42) "f" - PARAM_LIST@[42; 44) - L_PAREN@[42; 43) "(" - R_PAREN@[43; 44) ")" - WHITESPACE@[44; 45) " " - BLOCK_EXPR@[45; 47) - BLOCK@[45; 47) - L_CURLY@[45; 46) "{" - R_CURLY@[46; 47) "}" - WHITESPACE@[47; 48) "\n" -error [17; 17): expected one of `*`, `::`, `{`, `self`, `super` or an identifier -error [17; 17): expected SEMICOLON -error [37; 37): expected one of `*`, `::`, `{`, `self`, `super` or an identifier -error [37; 37): expected SEMICOLON +SOURCE_FILE@0..48 + USE_ITEM@0..13 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..12 + PATH@4..12 + PATH@4..7 + PATH_SEGMENT@4..7 + NAME_REF@4..7 + IDENT@4..7 "foo" + COLON2@7..9 "::" + PATH_SEGMENT@9..12 + NAME_REF@9..12 + IDENT@9..12 "bar" + SEMICOLON@12..13 ";" + WHITESPACE@13..14 "\n" + USE_ITEM@14..17 + USE_KW@14..17 "use" + WHITESPACE@17..18 "\n" + USE_ITEM@18..33 + USE_KW@18..21 "use" + WHITESPACE@21..22 " " + USE_TREE@22..32 + PATH@22..32 + PATH@22..27 + PATH_SEGMENT@22..27 + CRATE_KW@22..27 "crate" + COLON2@27..29 "::" + PATH_SEGMENT@29..32 + NAME_REF@29..32 + IDENT@29..32 "baz" + SEMICOLON@32..33 ";" + WHITESPACE@33..34 "\n" + USE_ITEM@34..37 + USE_KW@34..37 "use" + WHITESPACE@37..38 "\n" + FN_DEF@38..47 + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + NAME@41..42 + IDENT@41..42 "f" + PARAM_LIST@42..44 + L_PAREN@42..43 "(" + R_PAREN@43..44 ")" + WHITESPACE@44..45 " " + BLOCK_EXPR@45..47 + BLOCK@45..47 + L_CURLY@45..46 "{" + R_CURLY@46..47 "}" + WHITESPACE@47..48 "\n" +error 17..17: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 17..17: expected SEMICOLON +error 37..37: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +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 1f2b4f6d93..f926b67d26 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 @@ -1,51 +1,51 @@ -SOURCE_FILE@[0; 37) - USE_ITEM@[0; 36) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 36) - PATH@[4; 7) - PATH_SEGMENT@[4; 7) - NAME_REF@[4; 7) - IDENT@[4; 7) "std" - COLON2@[7; 9) "::" - USE_TREE_LIST@[9; 36) - L_CURLY@[9; 10) "{" - USE_TREE@[10; 22) - PATH@[10; 22) - PATH@[10; 15) - PATH_SEGMENT@[10; 15) - NAME_REF@[10; 15) - IDENT@[10; 15) "error" - COLON2@[15; 17) "::" - PATH_SEGMENT@[17; 22) - NAME_REF@[17; 22) - IDENT@[17; 22) "Error" - ERROR@[22; 23) - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 24) "\n" - ERROR@[24; 27) - USE_KW@[24; 27) "use" - WHITESPACE@[27; 28) " " - USE_TREE@[28; 35) - PATH@[28; 35) - PATH@[28; 31) - PATH_SEGMENT@[28; 31) - NAME_REF@[28; 31) - IDENT@[28; 31) "std" - COLON2@[31; 33) "::" - PATH_SEGMENT@[33; 35) - NAME_REF@[33; 35) - IDENT@[33; 35) "io" - ERROR@[35; 36) - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 37) "\n" -error [22; 22): expected COMMA -error [22; 22): expected one of `*`, `::`, `{`, `self`, `super` or an identifier -error [23; 23): expected COMMA -error [24; 24): expected one of `*`, `::`, `{`, `self`, `super` or an identifier -error [27; 27): expected COMMA -error [35; 35): expected COMMA -error [35; 35): expected one of `*`, `::`, `{`, `self`, `super` or an identifier -error [36; 36): expected COMMA -error [36; 36): expected R_CURLY -error [36; 36): expected SEMICOLON +SOURCE_FILE@0..37 + USE_ITEM@0..36 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..36 + PATH@4..7 + PATH_SEGMENT@4..7 + NAME_REF@4..7 + IDENT@4..7 "std" + COLON2@7..9 "::" + USE_TREE_LIST@9..36 + L_CURLY@9..10 "{" + USE_TREE@10..22 + PATH@10..22 + PATH@10..15 + PATH_SEGMENT@10..15 + NAME_REF@10..15 + IDENT@10..15 "error" + COLON2@15..17 "::" + PATH_SEGMENT@17..22 + NAME_REF@17..22 + IDENT@17..22 "Error" + ERROR@22..23 + SEMICOLON@22..23 ";" + WHITESPACE@23..24 "\n" + ERROR@24..27 + USE_KW@24..27 "use" + WHITESPACE@27..28 " " + USE_TREE@28..35 + PATH@28..35 + PATH@28..31 + PATH_SEGMENT@28..31 + NAME_REF@28..31 + IDENT@28..31 "std" + COLON2@31..33 "::" + PATH_SEGMENT@33..35 + NAME_REF@33..35 + IDENT@33..35 "io" + ERROR@35..36 + SEMICOLON@35..36 ";" + WHITESPACE@36..37 "\n" +error 22..22: expected COMMA +error 22..22: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 23..23: expected COMMA +error 24..24: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 27..27: expected COMMA +error 35..35: expected COMMA +error 35..35: expected one of `*`, `::`, `{`, `self`, `super` or an identifier +error 36..36: expected COMMA +error 36..36: expected R_CURLY +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 5319bf936c..a328222aab 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 @@ -1,99 +1,99 @@ -SOURCE_FILE@[0; 118) - IMPL_DEF@[0; 117) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - FOR_KW@[7; 10) "for" - WHITESPACE@[10; 11) " " - TUPLE_TYPE@[11; 13) - L_PAREN@[11; 12) "(" - R_PAREN@[12; 13) ")" - WHITESPACE@[13; 14) " " - ITEM_LIST@[14; 117) - L_CURLY@[14; 15) "{" - WHITESPACE@[15; 20) "\n " - FN_DEF@[20; 31) - FN_KW@[20; 22) "fn" - WHITESPACE@[22; 23) " " - NAME@[23; 26) - IDENT@[23; 26) "foo" - PARAM_LIST@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - WHITESPACE@[28; 29) " " - BLOCK_EXPR@[29; 31) - BLOCK@[29; 31) - L_CURLY@[29; 30) "{" - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 36) "\n " - FN_DEF@[36; 51) - VISIBILITY@[36; 39) - PUB_KW@[36; 39) "pub" - WHITESPACE@[39; 40) " " - FN_KW@[40; 42) "fn" - WHITESPACE@[42; 43) " " - NAME@[43; 46) - IDENT@[43; 46) "bar" - PARAM_LIST@[46; 48) - L_PAREN@[46; 47) "(" - R_PAREN@[47; 48) ")" - WHITESPACE@[48; 49) " " - BLOCK_EXPR@[49; 51) - BLOCK@[49; 51) - L_CURLY@[49; 50) "{" - R_CURLY@[50; 51) "}" - WHITESPACE@[51; 56) "\n " - TYPE_ALIAS_DEF@[56; 81) - VISIBILITY@[56; 66) - PUB_KW@[56; 59) "pub" - L_PAREN@[59; 60) "(" - CRATE_KW@[60; 65) "crate" - R_PAREN@[65; 66) ")" - WHITESPACE@[66; 67) " " - TYPE_KW@[67; 71) "type" - WHITESPACE@[71; 72) " " - NAME@[72; 75) - IDENT@[72; 75) "Baz" - WHITESPACE@[75; 76) " " - EQ@[76; 77) "=" - WHITESPACE@[77; 78) " " - TUPLE_TYPE@[78; 80) - L_PAREN@[78; 79) "(" - R_PAREN@[79; 80) ")" - SEMICOLON@[80; 81) ";" - WHITESPACE@[81; 86) "\n " - CONST_DEF@[86; 115) - VISIBILITY@[86; 96) - PUB_KW@[86; 89) "pub" - L_PAREN@[89; 90) "(" - CRATE_KW@[90; 95) "crate" - R_PAREN@[95; 96) ")" - WHITESPACE@[96; 97) " " - CONST_KW@[97; 102) "const" - WHITESPACE@[102; 103) " " - NAME@[103; 104) - IDENT@[103; 104) "C" - COLON@[104; 105) ":" - WHITESPACE@[105; 106) " " - PATH_TYPE@[106; 109) - PATH@[106; 109) - PATH_SEGMENT@[106; 109) - NAME_REF@[106; 109) - IDENT@[106; 109) "i32" - WHITESPACE@[109; 110) " " - EQ@[110; 111) "=" - WHITESPACE@[111; 112) " " - LITERAL@[112; 114) - INT_NUMBER@[112; 114) "92" - SEMICOLON@[114; 115) ";" - WHITESPACE@[115; 116) "\n" - R_CURLY@[116; 117) "}" - WHITESPACE@[117; 118) "\n" -error [36; 39): Unnecessary visibility qualifier -error [56; 66): Unnecessary visibility qualifier -error [86; 96): Unnecessary visibility qualifier +SOURCE_FILE@0..118 + IMPL_DEF@0..117 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + FOR_KW@7..10 "for" + WHITESPACE@10..11 " " + TUPLE_TYPE@11..13 + L_PAREN@11..12 "(" + R_PAREN@12..13 ")" + WHITESPACE@13..14 " " + ITEM_LIST@14..117 + L_CURLY@14..15 "{" + WHITESPACE@15..20 "\n " + FN_DEF@20..31 + FN_KW@20..22 "fn" + WHITESPACE@22..23 " " + NAME@23..26 + IDENT@23..26 "foo" + PARAM_LIST@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + WHITESPACE@28..29 " " + BLOCK_EXPR@29..31 + BLOCK@29..31 + L_CURLY@29..30 "{" + R_CURLY@30..31 "}" + WHITESPACE@31..36 "\n " + FN_DEF@36..51 + VISIBILITY@36..39 + PUB_KW@36..39 "pub" + WHITESPACE@39..40 " " + FN_KW@40..42 "fn" + WHITESPACE@42..43 " " + NAME@43..46 + IDENT@43..46 "bar" + PARAM_LIST@46..48 + L_PAREN@46..47 "(" + R_PAREN@47..48 ")" + WHITESPACE@48..49 " " + BLOCK_EXPR@49..51 + BLOCK@49..51 + L_CURLY@49..50 "{" + R_CURLY@50..51 "}" + WHITESPACE@51..56 "\n " + TYPE_ALIAS_DEF@56..81 + VISIBILITY@56..66 + PUB_KW@56..59 "pub" + L_PAREN@59..60 "(" + CRATE_KW@60..65 "crate" + R_PAREN@65..66 ")" + WHITESPACE@66..67 " " + TYPE_KW@67..71 "type" + WHITESPACE@71..72 " " + NAME@72..75 + IDENT@72..75 "Baz" + WHITESPACE@75..76 " " + EQ@76..77 "=" + WHITESPACE@77..78 " " + TUPLE_TYPE@78..80 + L_PAREN@78..79 "(" + R_PAREN@79..80 ")" + SEMICOLON@80..81 ";" + WHITESPACE@81..86 "\n " + CONST_DEF@86..115 + VISIBILITY@86..96 + PUB_KW@86..89 "pub" + L_PAREN@89..90 "(" + CRATE_KW@90..95 "crate" + R_PAREN@95..96 ")" + WHITESPACE@96..97 " " + CONST_KW@97..102 "const" + WHITESPACE@102..103 " " + NAME@103..104 + IDENT@103..104 "C" + COLON@104..105 ":" + WHITESPACE@105..106 " " + PATH_TYPE@106..109 + PATH@106..109 + PATH_SEGMENT@106..109 + NAME_REF@106..109 + IDENT@106..109 "i32" + WHITESPACE@109..110 " " + EQ@110..111 "=" + WHITESPACE@111..112 " " + LITERAL@112..114 + INT_NUMBER@112..114 "92" + SEMICOLON@114..115 ";" + WHITESPACE@115..116 "\n" + R_CURLY@116..117 "}" + WHITESPACE@117..118 "\n" +error 36..39: Unnecessary visibility qualifier +error 56..66: Unnecessary visibility qualifier +error 86..96: Unnecessary visibility qualifier 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 9efdf7ef40..bcd1fad69b 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 @@ -1,30 +1,30 @@ -SOURCE_FILE@[0; 33) - FN_DEF@[0; 32) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 32) - BLOCK@[10; 32) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - EXPR_STMT@[16; 21) - RANGE_EXPR@[16; 20) - LITERAL@[16; 17) - INT_NUMBER@[16; 17) "0" - DOT2EQ@[17; 20) "..=" - SEMICOLON@[20; 21) ";" - WHITESPACE@[21; 26) "\n " - EXPR_STMT@[26; 30) - RANGE_EXPR@[26; 29) - DOT2EQ@[26; 29) "..=" - SEMICOLON@[29; 30) ";" - WHITESPACE@[30; 31) "\n" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" -error [16; 20): An inclusive range must have an end expression -error [26; 29): An inclusive range must have an end expression +SOURCE_FILE@0..33 + FN_DEF@0..32 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..32 + BLOCK@10..32 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..21 + RANGE_EXPR@16..20 + LITERAL@16..17 + INT_NUMBER@16..17 "0" + DOT2EQ@17..20 "..=" + SEMICOLON@20..21 ";" + WHITESPACE@21..26 "\n " + EXPR_STMT@26..30 + RANGE_EXPR@26..29 + DOT2EQ@26..29 "..=" + SEMICOLON@29..30 ";" + WHITESPACE@30..31 "\n" + R_CURLY@31..32 "}" + WHITESPACE@32..33 "\n" +error 16..20: An inclusive range must have an end expression +error 26..29: An inclusive range must have an end expression 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 edf9c32478..433ea7bad1 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 @@ -1,83 +1,83 @@ -SOURCE_FILE@[0; 83) - FN_DEF@[0; 82) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - RET_TYPE@[9; 15) - THIN_ARROW@[9; 11) "->" - WHITESPACE@[11; 12) " " - PATH_TYPE@[12; 15) - PATH@[12; 15) - PATH_SEGMENT@[12; 15) - NAME_REF@[12; 15) - IDENT@[12; 15) "i32" - WHITESPACE@[15; 16) " " - BLOCK_EXPR@[16; 82) - BLOCK@[16; 82) - L_CURLY@[16; 17) "{" - WHITESPACE@[17; 22) "\n " - EXPR_STMT@[22; 80) - METHOD_CALL_EXPR@[22; 79) - METHOD_CALL_EXPR@[22; 57) - METHOD_CALL_EXPR@[22; 38) - ARRAY_EXPR@[22; 31) - L_BRACK@[22; 23) "[" - LITERAL@[23; 24) - INT_NUMBER@[23; 24) "1" - COMMA@[24; 25) "," - WHITESPACE@[25; 26) " " - LITERAL@[26; 27) - INT_NUMBER@[26; 27) "2" - COMMA@[27; 28) "," - WHITESPACE@[28; 29) " " - LITERAL@[29; 30) - INT_NUMBER@[29; 30) "3" - R_BRACK@[30; 31) "]" - DOT@[31; 32) "." - NAME_REF@[32; 36) - IDENT@[32; 36) "iter" - ARG_LIST@[36; 38) - L_PAREN@[36; 37) "(" - R_PAREN@[37; 38) ")" - WHITESPACE@[38; 47) "\n " - DOT@[47; 48) "." - NAME_REF@[48; 51) - IDENT@[48; 51) "map" - ARG_LIST@[51; 57) - L_PAREN@[51; 52) "(" - LAMBDA_EXPR@[52; 56) - PARAM_LIST@[52; 56) - PIPE@[52; 53) "|" - PARAM@[53; 55) - BIND_PAT@[53; 55) - NAME@[53; 55) - IDENT@[53; 55) "it" - PIPE@[55; 56) "|" - R_PAREN@[56; 57) ")" - WHITESPACE@[57; 66) "\n " - DOT@[66; 67) "." - NAME_REF@[67; 70) - IDENT@[67; 70) "max" - TYPE_ARG_LIST@[70; 77) - COLON2@[70; 72) "::" - L_ANGLE@[72; 73) "<" - TYPE_ARG@[73; 76) - PATH_TYPE@[73; 76) - PATH@[73; 76) - PATH_SEGMENT@[73; 76) - NAME_REF@[73; 76) - IDENT@[73; 76) "i32" - R_ANGLE@[76; 77) ">" - ARG_LIST@[77; 79) - L_PAREN@[77; 78) "(" - R_PAREN@[78; 79) ")" - SEMICOLON@[79; 80) ";" - WHITESPACE@[80; 81) "\n" - R_CURLY@[81; 82) "}" - WHITESPACE@[82; 83) "\n" -error [56; 56): expected expression +SOURCE_FILE@0..83 + FN_DEF@0..82 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + RET_TYPE@9..15 + THIN_ARROW@9..11 "->" + WHITESPACE@11..12 " " + PATH_TYPE@12..15 + PATH@12..15 + PATH_SEGMENT@12..15 + NAME_REF@12..15 + IDENT@12..15 "i32" + WHITESPACE@15..16 " " + BLOCK_EXPR@16..82 + BLOCK@16..82 + L_CURLY@16..17 "{" + WHITESPACE@17..22 "\n " + EXPR_STMT@22..80 + METHOD_CALL_EXPR@22..79 + METHOD_CALL_EXPR@22..57 + METHOD_CALL_EXPR@22..38 + ARRAY_EXPR@22..31 + L_BRACK@22..23 "[" + LITERAL@23..24 + INT_NUMBER@23..24 "1" + COMMA@24..25 "," + WHITESPACE@25..26 " " + LITERAL@26..27 + INT_NUMBER@26..27 "2" + COMMA@27..28 "," + WHITESPACE@28..29 " " + LITERAL@29..30 + INT_NUMBER@29..30 "3" + R_BRACK@30..31 "]" + DOT@31..32 "." + NAME_REF@32..36 + IDENT@32..36 "iter" + ARG_LIST@36..38 + L_PAREN@36..37 "(" + R_PAREN@37..38 ")" + WHITESPACE@38..47 "\n " + DOT@47..48 "." + NAME_REF@48..51 + IDENT@48..51 "map" + ARG_LIST@51..57 + L_PAREN@51..52 "(" + LAMBDA_EXPR@52..56 + PARAM_LIST@52..56 + PIPE@52..53 "|" + PARAM@53..55 + BIND_PAT@53..55 + NAME@53..55 + IDENT@53..55 "it" + PIPE@55..56 "|" + R_PAREN@56..57 ")" + WHITESPACE@57..66 "\n " + DOT@66..67 "." + NAME_REF@67..70 + IDENT@67..70 "max" + TYPE_ARG_LIST@70..77 + COLON2@70..72 "::" + L_ANGLE@72..73 "<" + TYPE_ARG@73..76 + PATH_TYPE@73..76 + PATH@73..76 + PATH_SEGMENT@73..76 + NAME_REF@73..76 + IDENT@73..76 "i32" + R_ANGLE@76..77 ">" + ARG_LIST@77..79 + L_PAREN@77..78 "(" + R_PAREN@78..79 ")" + SEMICOLON@79..80 ";" + WHITESPACE@80..81 "\n" + R_CURLY@81..82 "}" + WHITESPACE@82..83 "\n" +error 56..56: expected expression 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 9d807c84f3..bf70ebca43 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 @@ -1,27 +1,27 @@ -SOURCE_FILE@[0; 18) - TYPE_ALIAS_DEF@[0; 12) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - SLICE_TYPE@[9; 12) - L_BRACK@[9; 10) "[" - TUPLE_TYPE@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - WHITESPACE@[12; 13) " " - ERROR@[13; 15) - INT_NUMBER@[13; 15) "92" - ERROR@[15; 16) - R_BRACK@[15; 16) "]" - ERROR@[16; 17) - SEMICOLON@[16; 17) ";" - WHITESPACE@[17; 18) "\n" -error [12; 12): expected `;` or `]` -error [12; 12): expected SEMICOLON -error [13; 13): expected an item -error [15; 15): expected an item -error [16; 16): expected an item +SOURCE_FILE@0..18 + TYPE_ALIAS_DEF@0..12 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + SLICE_TYPE@9..12 + L_BRACK@9..10 "[" + TUPLE_TYPE@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + WHITESPACE@12..13 " " + ERROR@13..15 + INT_NUMBER@13..15 "92" + ERROR@15..16 + R_BRACK@15..16 "]" + ERROR@16..17 + SEMICOLON@16..17 ";" + WHITESPACE@17..18 "\n" +error 12..12: expected `;` or `]` +error 12..12: expected SEMICOLON +error 13..13: expected an item +error 15..15: expected an item +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 a85855f8c4..85bf276a06 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 @@ -1,29 +1,29 @@ -SOURCE_FILE@[0; 30) - FN_DEF@[0; 29) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 29) - BLOCK@[10; 29) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - EXPR_STMT@[16; 22) - ERROR@[16; 22) - LABEL@[16; 22) - LIFETIME@[16; 21) "\'loop" - COLON@[21; 22) ":" - WHITESPACE@[22; 23) " " - IMPL_DEF@[23; 27) - IMPL_KW@[23; 27) "impl" - WHITESPACE@[27; 28) "\n" - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) "\n" -error [22; 22): expected a loop -error [22; 22): expected SEMICOLON -error [27; 27): expected type -error [27; 27): expected `{` +SOURCE_FILE@0..30 + FN_DEF@0..29 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..29 + BLOCK@10..29 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..22 + ERROR@16..22 + LABEL@16..22 + LIFETIME@16..21 "\'loop" + COLON@21..22 ":" + WHITESPACE@22..23 " " + IMPL_DEF@23..27 + IMPL_KW@23..27 "impl" + WHITESPACE@27..28 "\n" + R_CURLY@28..29 "}" + WHITESPACE@29..30 "\n" +error 22..22: expected a loop +error 22..22: expected SEMICOLON +error 27..27: expected type +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 e9efad674a..95bcc3c0a9 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 @@ -1,17 +1,17 @@ -SOURCE_FILE@[0; 14) - TYPE_ALIAS_DEF@[0; 13) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - POINTER_TYPE@[9; 12) - STAR@[9; 10) "*" - TUPLE_TYPE@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - SEMICOLON@[12; 13) ";" - WHITESPACE@[13; 14) "\n" -error [10; 10): expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate) +SOURCE_FILE@0..14 + TYPE_ALIAS_DEF@0..13 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + POINTER_TYPE@9..12 + STAR@9..10 "*" + TUPLE_TYPE@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + SEMICOLON@12..13 ";" + WHITESPACE@13..14 "\n" +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/0004_impl_type.rast b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast index 124f0a8919..fd939be8db 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0004_impl_type.rast @@ -1,79 +1,79 @@ -SOURCE_FILE@[0; 87) - IMPL_DEF@[0; 12) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 9) - PATH@[5; 9) - PATH_SEGMENT@[5; 9) - NAME_REF@[5; 9) - IDENT@[5; 9) "Type" - WHITESPACE@[9; 10) " " - ITEM_LIST@[10; 12) - L_CURLY@[10; 11) "{" - R_CURLY@[11; 12) "}" - WHITESPACE@[12; 13) "\n" - IMPL_DEF@[13; 33) - IMPL_KW@[13; 17) "impl" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 24) - PATH@[18; 24) - PATH_SEGMENT@[18; 24) - NAME_REF@[18; 24) - IDENT@[18; 24) "Trait1" - WHITESPACE@[24; 25) " " - FOR_KW@[25; 28) "for" - WHITESPACE@[28; 29) " " - PATH_TYPE@[29; 30) - PATH@[29; 30) - PATH_SEGMENT@[29; 30) - NAME_REF@[29; 30) - IDENT@[29; 30) "T" - WHITESPACE@[30; 31) " " - ITEM_LIST@[31; 33) - L_CURLY@[31; 32) "{" - R_CURLY@[32; 33) "}" - WHITESPACE@[33; 34) "\n" - IMPL_DEF@[34; 38) - IMPL_KW@[34; 38) "impl" - WHITESPACE@[38; 39) " " - IMPL_DEF@[39; 54) - IMPL_KW@[39; 43) "impl" - WHITESPACE@[43; 44) " " - PATH_TYPE@[44; 51) - PATH@[44; 51) - PATH_SEGMENT@[44; 51) - NAME_REF@[44; 51) - IDENT@[44; 51) "NotType" - WHITESPACE@[51; 52) " " - ITEM_LIST@[52; 54) - L_CURLY@[52; 53) "{" - R_CURLY@[53; 54) "}" - WHITESPACE@[54; 55) "\n" - IMPL_DEF@[55; 70) - IMPL_KW@[55; 59) "impl" - WHITESPACE@[59; 60) " " - PATH_TYPE@[60; 66) - PATH@[60; 66) - PATH_SEGMENT@[60; 66) - NAME_REF@[60; 66) - IDENT@[60; 66) "Trait2" - WHITESPACE@[66; 67) " " - FOR_KW@[67; 70) "for" - WHITESPACE@[70; 71) " " - IMPL_DEF@[71; 86) - IMPL_KW@[71; 75) "impl" - WHITESPACE@[75; 76) " " - PATH_TYPE@[76; 83) - PATH@[76; 83) - PATH_SEGMENT@[76; 83) - NAME_REF@[76; 83) - IDENT@[76; 83) "NotType" - WHITESPACE@[83; 84) " " - ITEM_LIST@[84; 86) - L_CURLY@[84; 85) "{" - R_CURLY@[85; 86) "}" - WHITESPACE@[86; 87) "\n" -error [38; 38): expected trait or type -error [38; 38): expected `{` -error [70; 70): expected trait or type -error [70; 70): expected `{` +SOURCE_FILE@0..87 + IMPL_DEF@0..12 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..9 + PATH@5..9 + PATH_SEGMENT@5..9 + NAME_REF@5..9 + IDENT@5..9 "Type" + WHITESPACE@9..10 " " + ITEM_LIST@10..12 + L_CURLY@10..11 "{" + R_CURLY@11..12 "}" + WHITESPACE@12..13 "\n" + IMPL_DEF@13..33 + IMPL_KW@13..17 "impl" + WHITESPACE@17..18 " " + PATH_TYPE@18..24 + PATH@18..24 + PATH_SEGMENT@18..24 + NAME_REF@18..24 + IDENT@18..24 "Trait1" + WHITESPACE@24..25 " " + FOR_KW@25..28 "for" + WHITESPACE@28..29 " " + PATH_TYPE@29..30 + PATH@29..30 + PATH_SEGMENT@29..30 + NAME_REF@29..30 + IDENT@29..30 "T" + WHITESPACE@30..31 " " + ITEM_LIST@31..33 + L_CURLY@31..32 "{" + R_CURLY@32..33 "}" + WHITESPACE@33..34 "\n" + IMPL_DEF@34..38 + IMPL_KW@34..38 "impl" + WHITESPACE@38..39 " " + IMPL_DEF@39..54 + IMPL_KW@39..43 "impl" + WHITESPACE@43..44 " " + PATH_TYPE@44..51 + PATH@44..51 + PATH_SEGMENT@44..51 + NAME_REF@44..51 + IDENT@44..51 "NotType" + WHITESPACE@51..52 " " + ITEM_LIST@52..54 + L_CURLY@52..53 "{" + R_CURLY@53..54 "}" + WHITESPACE@54..55 "\n" + IMPL_DEF@55..70 + IMPL_KW@55..59 "impl" + WHITESPACE@59..60 " " + PATH_TYPE@60..66 + PATH@60..66 + PATH_SEGMENT@60..66 + NAME_REF@60..66 + IDENT@60..66 "Trait2" + WHITESPACE@66..67 " " + FOR_KW@67..70 "for" + WHITESPACE@70..71 " " + IMPL_DEF@71..86 + IMPL_KW@71..75 "impl" + WHITESPACE@75..76 " " + PATH_TYPE@76..83 + PATH@76..83 + PATH_SEGMENT@76..83 + NAME_REF@76..83 + IDENT@76..83 "NotType" + WHITESPACE@83..84 " " + ITEM_LIST@84..86 + L_CURLY@84..85 "{" + R_CURLY@85..86 "}" + WHITESPACE@86..87 "\n" +error 38..38: expected trait or type +error 38..38: expected `{` +error 70..70: expected trait or type +error 70..70: expected `{` 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 b8a494085b..90202d7643 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 @@ -1,23 +1,23 @@ -SOURCE_FILE@[0; 20) - TYPE_ALIAS_DEF@[0; 15) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "F" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - UNSAFE_KW@[9; 15) "unsafe" - WHITESPACE@[15; 16) " " - ERROR@[16; 17) - L_PAREN@[16; 17) "(" - ERROR@[17; 18) - R_PAREN@[17; 18) ")" - ERROR@[18; 19) - SEMICOLON@[18; 19) ";" - WHITESPACE@[19; 20) "\n" -error [15; 15): expected `fn` -error [15; 15): expected SEMICOLON -error [16; 16): expected an item -error [17; 17): expected an item -error [18; 18): expected an item +SOURCE_FILE@0..20 + TYPE_ALIAS_DEF@0..15 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "F" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + UNSAFE_KW@9..15 "unsafe" + WHITESPACE@15..16 " " + ERROR@16..17 + L_PAREN@16..17 "(" + ERROR@17..18 + R_PAREN@17..18 ")" + ERROR@18..19 + SEMICOLON@18..19 ";" + WHITESPACE@19..20 "\n" +error 15..15: expected `fn` +error 15..15: expected SEMICOLON +error 16..16: expected an item +error 17..17: expected an item +error 18..18: expected an item diff --git a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast index 690acdca35..b901c17f70 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0006_unsafe_block_in_mod.rast @@ -1,37 +1,37 @@ -SOURCE_FILE@[0; 33) - FN_DEF@[0; 10) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - BLOCK_EXPR@[8; 10) - BLOCK@[8; 10) - L_CURLY@[8; 9) "{" - R_CURLY@[9; 10) "}" - WHITESPACE@[10; 11) " " - ERROR@[11; 17) - UNSAFE_KW@[11; 17) "unsafe" - WHITESPACE@[17; 18) " " - ERROR@[18; 21) - L_CURLY@[18; 19) "{" - WHITESPACE@[19; 20) " " - R_CURLY@[20; 21) "}" - WHITESPACE@[21; 22) " " - FN_DEF@[22; 32) - FN_KW@[22; 24) "fn" - WHITESPACE@[24; 25) " " - NAME@[25; 28) - IDENT@[25; 28) "bar" - PARAM_LIST@[28; 30) - L_PAREN@[28; 29) "(" - R_PAREN@[29; 30) ")" - BLOCK_EXPR@[30; 32) - BLOCK@[30; 32) - L_CURLY@[30; 31) "{" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" -error [11; 11): expected an item -error [18; 18): expected an item +SOURCE_FILE@0..33 + FN_DEF@0..10 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + BLOCK_EXPR@8..10 + BLOCK@8..10 + L_CURLY@8..9 "{" + R_CURLY@9..10 "}" + WHITESPACE@10..11 " " + ERROR@11..17 + UNSAFE_KW@11..17 "unsafe" + WHITESPACE@17..18 " " + ERROR@18..21 + L_CURLY@18..19 "{" + WHITESPACE@19..20 " " + R_CURLY@20..21 "}" + WHITESPACE@21..22 " " + FN_DEF@22..32 + FN_KW@22..24 "fn" + WHITESPACE@24..25 " " + NAME@25..28 + IDENT@25..28 "bar" + PARAM_LIST@28..30 + L_PAREN@28..29 "(" + R_PAREN@29..30 ")" + BLOCK_EXPR@30..32 + BLOCK@30..32 + L_CURLY@30..31 "{" + R_CURLY@31..32 "}" + WHITESPACE@32..33 "\n" +error 11..11: expected an item +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 c3f7eb4778..3f48b86edc 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 @@ -1,32 +1,32 @@ -SOURCE_FILE@[0; 30) - FN_DEF@[0; 29) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 29) - BLOCK@[9; 29) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) " " - LET_STMT@[11; 27) - LET_KW@[11; 14) "let" - WHITESPACE@[14; 15) " " - PLACEHOLDER_PAT@[15; 16) - UNDERSCORE@[15; 16) "_" - WHITESPACE@[16; 17) " " - EQ@[17; 18) "=" - WHITESPACE@[18; 19) " " - BLOCK_EXPR@[19; 27) - ASYNC_KW@[19; 24) "async" - WHITESPACE@[24; 25) " " - BLOCK@[25; 27) - L_CURLY@[25; 26) "{" - R_CURLY@[26; 27) "}" - WHITESPACE@[27; 28) " " - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) "\n" -error [27; 27): expected SEMICOLON +SOURCE_FILE@0..30 + FN_DEF@0..29 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..29 + BLOCK@9..29 + L_CURLY@9..10 "{" + WHITESPACE@10..11 " " + LET_STMT@11..27 + LET_KW@11..14 "let" + WHITESPACE@14..15 " " + PLACEHOLDER_PAT@15..16 + UNDERSCORE@15..16 "_" + WHITESPACE@16..17 " " + EQ@17..18 "=" + WHITESPACE@18..19 " " + BLOCK_EXPR@19..27 + ASYNC_KW@19..24 "async" + WHITESPACE@24..25 " " + BLOCK@25..27 + L_CURLY@25..26 "{" + R_CURLY@26..27 "}" + WHITESPACE@27..28 " " + R_CURLY@28..29 "}" + WHITESPACE@29..30 "\n" +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 a345f84884..be02eaeeb0 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 @@ -1,26 +1,26 @@ -SOURCE_FILE@[0; 21) - FN_DEF@[0; 20) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 20) - BLOCK@[9; 20) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) " " - ERROR@[11; 14) - VISIBILITY@[11; 14) - PUB_KW@[11; 14) "pub" - WHITESPACE@[14; 15) " " - EXPR_STMT@[15; 18) - LITERAL@[15; 17) - INT_NUMBER@[15; 17) "92" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) " " - R_CURLY@[19; 20) "}" - WHITESPACE@[20; 21) "\n" -error [14; 14): expected an item +SOURCE_FILE@0..21 + FN_DEF@0..20 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..20 + BLOCK@9..20 + L_CURLY@9..10 "{" + WHITESPACE@10..11 " " + ERROR@11..14 + VISIBILITY@11..14 + PUB_KW@11..14 "pub" + WHITESPACE@14..15 " " + EXPR_STMT@15..18 + LITERAL@15..17 + INT_NUMBER@15..17 "92" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 " " + R_CURLY@19..20 "}" + WHITESPACE@20..21 "\n" +error 14..14: expected an item 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 c3a70147a5..b344e4f7f4 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 @@ -1,61 +1,61 @@ -SOURCE_FILE@[0; 48) - FN_DEF@[0; 47) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 47) - BLOCK@[9; 47) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 14) "\n " - EXPR_STMT@[14; 25) - ATTR@[14; 18) - POUND@[14; 15) "#" - L_BRACK@[15; 16) "[" - PATH@[16; 17) - PATH_SEGMENT@[16; 17) - NAME_REF@[16; 17) - IDENT@[16; 17) "A" - R_BRACK@[17; 18) "]" - WHITESPACE@[18; 19) " " - BIN_EXPR@[19; 24) - LITERAL@[19; 20) - INT_NUMBER@[19; 20) "1" - WHITESPACE@[20; 21) " " - PLUS@[21; 22) "+" - WHITESPACE@[22; 23) " " - LITERAL@[23; 24) - INT_NUMBER@[23; 24) "2" - SEMICOLON@[24; 25) ";" - WHITESPACE@[25; 29) "\n " - EXPR_STMT@[29; 45) - ATTR@[29; 33) - POUND@[29; 30) "#" - L_BRACK@[30; 31) "[" - PATH@[31; 32) - PATH_SEGMENT@[31; 32) - NAME_REF@[31; 32) - IDENT@[31; 32) "B" - R_BRACK@[32; 33) "]" - WHITESPACE@[33; 34) " " - IF_EXPR@[34; 44) - IF_KW@[34; 36) "if" - WHITESPACE@[36; 37) " " - CONDITION@[37; 41) - LITERAL@[37; 41) - TRUE_KW@[37; 41) "true" - WHITESPACE@[41; 42) " " - BLOCK_EXPR@[42; 44) - BLOCK@[42; 44) - L_CURLY@[42; 43) "{" - R_CURLY@[43; 44) "}" - SEMICOLON@[44; 45) ";" - WHITESPACE@[45; 46) "\n" - R_CURLY@[46; 47) "}" - WHITESPACE@[47; 48) "\n" -error [24; 24): attributes are not allowed on BIN_EXPR -error [44; 44): attributes are not allowed on IF_EXPR +SOURCE_FILE@0..48 + FN_DEF@0..47 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..47 + BLOCK@9..47 + L_CURLY@9..10 "{" + WHITESPACE@10..14 "\n " + EXPR_STMT@14..25 + ATTR@14..18 + POUND@14..15 "#" + L_BRACK@15..16 "[" + PATH@16..17 + PATH_SEGMENT@16..17 + NAME_REF@16..17 + IDENT@16..17 "A" + R_BRACK@17..18 "]" + WHITESPACE@18..19 " " + BIN_EXPR@19..24 + LITERAL@19..20 + INT_NUMBER@19..20 "1" + WHITESPACE@20..21 " " + PLUS@21..22 "+" + WHITESPACE@22..23 " " + LITERAL@23..24 + INT_NUMBER@23..24 "2" + SEMICOLON@24..25 ";" + WHITESPACE@25..29 "\n " + EXPR_STMT@29..45 + ATTR@29..33 + POUND@29..30 "#" + L_BRACK@30..31 "[" + PATH@31..32 + PATH_SEGMENT@31..32 + NAME_REF@31..32 + IDENT@31..32 "B" + R_BRACK@32..33 "]" + WHITESPACE@33..34 " " + IF_EXPR@34..44 + IF_KW@34..36 "if" + WHITESPACE@36..37 " " + CONDITION@37..41 + LITERAL@37..41 + TRUE_KW@37..41 "true" + WHITESPACE@41..42 " " + BLOCK_EXPR@42..44 + BLOCK@42..44 + L_CURLY@42..43 "{" + R_CURLY@43..44 "}" + SEMICOLON@44..45 ";" + WHITESPACE@45..46 "\n" + R_CURLY@46..47 "}" + WHITESPACE@47..48 "\n" +error 24..24: attributes are not allowed on BIN_EXPR +error 44..44: attributes are not allowed on IF_EXPR 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 61d737abe9..5339a84d7d 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 @@ -1,53 +1,53 @@ -SOURCE_FILE@[0; 47) - FN_DEF@[0; 46) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 46) - BLOCK@[9; 46) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 20) - FIELD_EXPR@[15; 19) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "x" - DOT@[16; 17) "." - FLOAT_NUMBER@[17; 19) "0." - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 25) "\n " - EXPR_STMT@[25; 32) - FIELD_EXPR@[25; 31) - PATH_EXPR@[25; 26) - PATH@[25; 26) - PATH_SEGMENT@[25; 26) - NAME_REF@[25; 26) - IDENT@[25; 26) "x" - DOT@[26; 27) "." - NAME_REF@[27; 31) - INT_NUMBER@[27; 31) "1i32" - SEMICOLON@[31; 32) ";" - WHITESPACE@[32; 37) "\n " - EXPR_STMT@[37; 44) - FIELD_EXPR@[37; 43) - PATH_EXPR@[37; 38) - PATH@[37; 38) - PATH_SEGMENT@[37; 38) - NAME_REF@[37; 38) - IDENT@[37; 38) "x" - DOT@[38; 39) "." - NAME_REF@[39; 43) - INT_NUMBER@[39; 43) "0x01" - SEMICOLON@[43; 44) ";" - WHITESPACE@[44; 45) "\n" - R_CURLY@[45; 46) "}" - WHITESPACE@[46; 47) "\n" -error [27; 31): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix -error [39; 43): Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix +SOURCE_FILE@0..47 + FN_DEF@0..46 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..46 + BLOCK@9..46 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..20 + FIELD_EXPR@15..19 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "x" + DOT@16..17 "." + FLOAT_NUMBER@17..19 "0." + SEMICOLON@19..20 ";" + WHITESPACE@20..25 "\n " + EXPR_STMT@25..32 + FIELD_EXPR@25..31 + PATH_EXPR@25..26 + PATH@25..26 + PATH_SEGMENT@25..26 + NAME_REF@25..26 + IDENT@25..26 "x" + DOT@26..27 "." + NAME_REF@27..31 + INT_NUMBER@27..31 "1i32" + SEMICOLON@31..32 ";" + WHITESPACE@32..37 "\n " + EXPR_STMT@37..44 + FIELD_EXPR@37..43 + PATH_EXPR@37..38 + PATH@37..38 + PATH_SEGMENT@37..38 + NAME_REF@37..38 + IDENT@37..38 "x" + DOT@38..39 "." + NAME_REF@39..43 + INT_NUMBER@39..43 "0x01" + SEMICOLON@43..44 ";" + WHITESPACE@44..45 "\n" + R_CURLY@45..46 "}" + WHITESPACE@46..47 "\n" +error 27..31: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix +error 39..43: Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix diff --git a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast index f6ac0feaf5..20ed390464 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0010_wrong_order_fns.rast @@ -1,41 +1,41 @@ -SOURCE_FILE@[0; 50) - ERROR@[0; 6) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - FN_DEF@[7; 24) - ASYNC_KW@[7; 12) "async" - WHITESPACE@[12; 13) " " - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 19) - IDENT@[16; 19) "foo" - PARAM_LIST@[19; 21) - L_PAREN@[19; 20) "(" - R_PAREN@[20; 21) ")" - WHITESPACE@[21; 22) " " - BLOCK_EXPR@[22; 24) - BLOCK@[22; 24) - L_CURLY@[22; 23) "{" - R_CURLY@[23; 24) "}" - WHITESPACE@[24; 25) "\n" - ERROR@[25; 31) - UNSAFE_KW@[25; 31) "unsafe" - WHITESPACE@[31; 32) " " - FN_DEF@[32; 49) - CONST_KW@[32; 37) "const" - WHITESPACE@[37; 38) " " - FN_KW@[38; 40) "fn" - WHITESPACE@[40; 41) " " - NAME@[41; 44) - IDENT@[41; 44) "bar" - PARAM_LIST@[44; 46) - L_PAREN@[44; 45) "(" - R_PAREN@[45; 46) ")" - WHITESPACE@[46; 47) " " - BLOCK_EXPR@[47; 49) - BLOCK@[47; 49) - L_CURLY@[47; 48) "{" - R_CURLY@[48; 49) "}" - WHITESPACE@[49; 50) "\n" -error [6; 6): expected existential, fn, trait or impl -error [31; 31): expected existential, fn, trait or impl +SOURCE_FILE@0..50 + ERROR@0..6 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + FN_DEF@7..24 + ASYNC_KW@7..12 "async" + WHITESPACE@12..13 " " + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..19 + IDENT@16..19 "foo" + PARAM_LIST@19..21 + L_PAREN@19..20 "(" + R_PAREN@20..21 ")" + WHITESPACE@21..22 " " + BLOCK_EXPR@22..24 + BLOCK@22..24 + L_CURLY@22..23 "{" + R_CURLY@23..24 "}" + WHITESPACE@24..25 "\n" + ERROR@25..31 + UNSAFE_KW@25..31 "unsafe" + WHITESPACE@31..32 " " + FN_DEF@32..49 + CONST_KW@32..37 "const" + WHITESPACE@37..38 " " + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + NAME@41..44 + IDENT@41..44 "bar" + PARAM_LIST@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + BLOCK_EXPR@47..49 + BLOCK@47..49 + L_CURLY@47..48 "{" + R_CURLY@48..49 "}" + WHITESPACE@49..50 "\n" +error 6..6: expected existential, fn, trait or impl +error 31..31: expected existential, fn, trait or impl 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 62fca0a391..ebcc26e0d6 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 @@ -1,21 +1,21 @@ -SOURCE_FILE@[0; 19) - STATIC_DEF@[0; 18) - STATIC_KW@[0; 6) "static" - WHITESPACE@[6; 7) " " - ERROR@[7; 8) - UNDERSCORE@[7; 8) "_" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - PATH_TYPE@[10; 13) - PATH@[10; 13) - PATH_SEGMENT@[10; 13) - NAME_REF@[10; 13) - IDENT@[10; 13) "i32" - WHITESPACE@[13; 14) " " - EQ@[14; 15) "=" - WHITESPACE@[15; 16) " " - LITERAL@[16; 17) - INT_NUMBER@[16; 17) "5" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" -error [7; 7): expected a name +SOURCE_FILE@0..19 + STATIC_DEF@0..18 + STATIC_KW@0..6 "static" + WHITESPACE@6..7 " " + ERROR@7..8 + UNDERSCORE@7..8 "_" + COLON@8..9 ":" + WHITESPACE@9..10 " " + PATH_TYPE@10..13 + PATH@10..13 + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "i32" + WHITESPACE@13..14 " " + EQ@14..15 "=" + WHITESPACE@15..16 " " + LITERAL@16..17 + INT_NUMBER@16..17 "5" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" +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 aa960d3ef2..88567263e9 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 @@ -1,59 +1,59 @@ -SOURCE_FILE@[0; 62) - TRAIT_DEF@[0; 61) - TRAIT_KW@[0; 5) "trait" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "T" - WHITESPACE@[7; 8) " " - ITEM_LIST@[8; 61) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 14) "\n " - MACRO_CALL@[14; 21) - PATH@[14; 21) - PATH_SEGMENT@[14; 21) - NAME_REF@[14; 21) - IDENT@[14; 21) "default" - WHITESPACE@[21; 22) " " - TYPE_ALIAS_DEF@[22; 35) - TYPE_KW@[22; 26) "type" - WHITESPACE@[26; 27) " " - NAME@[27; 28) - IDENT@[27; 28) "T" - WHITESPACE@[28; 29) " " - EQ@[29; 30) "=" - WHITESPACE@[30; 31) " " - PATH_TYPE@[31; 34) - PATH@[31; 34) - PATH_SEGMENT@[31; 34) - NAME_REF@[31; 34) - IDENT@[31; 34) "Bar" - SEMICOLON@[34; 35) ";" - WHITESPACE@[35; 40) "\n " - MACRO_CALL@[40; 47) - PATH@[40; 47) - PATH_SEGMENT@[40; 47) - NAME_REF@[40; 47) - IDENT@[40; 47) "default" - WHITESPACE@[47; 48) " " - FN_DEF@[48; 59) - FN_KW@[48; 50) "fn" - WHITESPACE@[50; 51) " " - NAME@[51; 54) - IDENT@[51; 54) "foo" - PARAM_LIST@[54; 56) - L_PAREN@[54; 55) "(" - R_PAREN@[55; 56) ")" - WHITESPACE@[56; 57) " " - BLOCK_EXPR@[57; 59) - BLOCK@[57; 59) - L_CURLY@[57; 58) "{" - R_CURLY@[58; 59) "}" - WHITESPACE@[59; 60) "\n" - R_CURLY@[60; 61) "}" - WHITESPACE@[61; 62) "\n" -error [21; 21): expected BANG -error [21; 21): expected `{`, `[`, `(` -error [21; 21): expected SEMICOLON -error [47; 47): expected BANG -error [47; 47): expected `{`, `[`, `(` -error [47; 47): expected SEMICOLON +SOURCE_FILE@0..62 + TRAIT_DEF@0..61 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "T" + WHITESPACE@7..8 " " + ITEM_LIST@8..61 + L_CURLY@8..9 "{" + WHITESPACE@9..14 "\n " + MACRO_CALL@14..21 + PATH@14..21 + PATH_SEGMENT@14..21 + NAME_REF@14..21 + IDENT@14..21 "default" + WHITESPACE@21..22 " " + TYPE_ALIAS_DEF@22..35 + TYPE_KW@22..26 "type" + WHITESPACE@26..27 " " + NAME@27..28 + IDENT@27..28 "T" + WHITESPACE@28..29 " " + EQ@29..30 "=" + WHITESPACE@30..31 " " + PATH_TYPE@31..34 + PATH@31..34 + PATH_SEGMENT@31..34 + NAME_REF@31..34 + IDENT@31..34 "Bar" + SEMICOLON@34..35 ";" + WHITESPACE@35..40 "\n " + MACRO_CALL@40..47 + PATH@40..47 + PATH_SEGMENT@40..47 + NAME_REF@40..47 + IDENT@40..47 "default" + WHITESPACE@47..48 " " + FN_DEF@48..59 + FN_KW@48..50 "fn" + WHITESPACE@50..51 " " + NAME@51..54 + IDENT@51..54 "foo" + PARAM_LIST@54..56 + L_PAREN@54..55 "(" + R_PAREN@55..56 ")" + WHITESPACE@56..57 " " + BLOCK_EXPR@57..59 + BLOCK@57..59 + L_CURLY@57..58 "{" + R_CURLY@58..59 "}" + WHITESPACE@59..60 "\n" + R_CURLY@60..61 "}" + WHITESPACE@61..62 "\n" +error 21..21: expected BANG +error 21..21: expected `{`, `[`, `(` +error 21..21: expected SEMICOLON +error 47..47: expected BANG +error 47..47: expected `{`, `[`, `(` +error 47..47: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast index 75043c9c04..578befa565 100644 --- a/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast +++ b/crates/ra_syntax/test_data/parser/inline/err/0014_record_literal_before_ellipsis_recovery.rast @@ -1,49 +1,49 @@ -SOURCE_FILE@[0; 45) - FN_DEF@[0; 44) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 44) - BLOCK@[10; 44) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - RECORD_LIT@[16; 42) - PATH@[16; 17) - PATH_SEGMENT@[16; 17) - NAME_REF@[16; 17) - IDENT@[16; 17) "S" - WHITESPACE@[17; 18) " " - RECORD_FIELD_LIST@[18; 42) - L_CURLY@[18; 19) "{" - WHITESPACE@[19; 20) " " - RECORD_FIELD@[20; 40) - NAME_REF@[20; 25) - IDENT@[20; 25) "field" - WHITESPACE@[25; 26) " " - RANGE_EXPR@[26; 40) - DOT2@[26; 28) ".." - CALL_EXPR@[28; 40) - PATH_EXPR@[28; 38) - PATH@[28; 38) - PATH@[28; 29) - PATH_SEGMENT@[28; 29) - NAME_REF@[28; 29) - IDENT@[28; 29) "S" - COLON2@[29; 31) "::" - PATH_SEGMENT@[31; 38) - NAME_REF@[31; 38) - IDENT@[31; 38) "default" - ARG_LIST@[38; 40) - L_PAREN@[38; 39) "(" - R_PAREN@[39; 40) ")" - WHITESPACE@[40; 41) " " - R_CURLY@[41; 42) "}" - WHITESPACE@[42; 43) "\n" - R_CURLY@[43; 44) "}" - WHITESPACE@[44; 45) "\n" -error [25; 25): expected COLON +SOURCE_FILE@0..45 + FN_DEF@0..44 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..44 + BLOCK@10..44 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + RECORD_LIT@16..42 + PATH@16..17 + PATH_SEGMENT@16..17 + NAME_REF@16..17 + IDENT@16..17 "S" + WHITESPACE@17..18 " " + RECORD_FIELD_LIST@18..42 + L_CURLY@18..19 "{" + WHITESPACE@19..20 " " + RECORD_FIELD@20..40 + NAME_REF@20..25 + IDENT@20..25 "field" + WHITESPACE@25..26 " " + RANGE_EXPR@26..40 + DOT2@26..28 ".." + CALL_EXPR@28..40 + PATH_EXPR@28..38 + PATH@28..38 + PATH@28..29 + PATH_SEGMENT@28..29 + NAME_REF@28..29 + IDENT@28..29 "S" + COLON2@29..31 "::" + PATH_SEGMENT@31..38 + NAME_REF@31..38 + IDENT@31..38 "default" + ARG_LIST@38..40 + L_PAREN@38..39 "(" + R_PAREN@39..40 ")" + WHITESPACE@40..41 " " + R_CURLY@41..42 "}" + WHITESPACE@42..43 "\n" + R_CURLY@43..44 "}" + WHITESPACE@44..45 "\n" +error 25..25: expected COLON 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 25c6ef7e32..a1fabb557b 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 @@ -1,72 +1,72 @@ -SOURCE_FILE@[0; 83) - IMPL_DEF@[0; 82) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "F" - WHITESPACE@[6; 7) " " - ITEM_LIST@[7; 82) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 13) "\n " - TYPE_ALIAS_DEF@[13; 27) - TYPE_KW@[13; 17) "type" - WHITESPACE@[17; 18) " " - NAME@[18; 19) - IDENT@[18; 19) "A" - COLON@[19; 20) ":" - WHITESPACE@[20; 21) " " - TYPE_BOUND_LIST@[21; 26) - TYPE_BOUND@[21; 26) - PATH_TYPE@[21; 26) - PATH@[21; 26) - PATH_SEGMENT@[21; 26) - NAME_REF@[21; 26) - IDENT@[21; 26) "Clone" - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - CONST_DEF@[32; 45) - CONST_KW@[32; 37) "const" - WHITESPACE@[37; 38) " " - NAME@[38; 39) - IDENT@[38; 39) "B" - COLON@[39; 40) ":" - WHITESPACE@[40; 41) " " - PATH_TYPE@[41; 44) - PATH@[41; 44) - PATH_SEGMENT@[41; 44) - NAME_REF@[41; 44) - IDENT@[41; 44) "i32" - SEMICOLON@[44; 45) ";" - WHITESPACE@[45; 50) "\n " - FN_DEF@[50; 61) - FN_KW@[50; 52) "fn" - WHITESPACE@[52; 53) " " - NAME@[53; 56) - IDENT@[53; 56) "foo" - PARAM_LIST@[56; 58) - L_PAREN@[56; 57) "(" - R_PAREN@[57; 58) ")" - WHITESPACE@[58; 59) " " - BLOCK_EXPR@[59; 61) - BLOCK@[59; 61) - L_CURLY@[59; 60) "{" - R_CURLY@[60; 61) "}" - WHITESPACE@[61; 66) "\n " - FN_DEF@[66; 80) - FN_KW@[66; 68) "fn" - WHITESPACE@[68; 69) " " - NAME@[69; 72) - IDENT@[69; 72) "bar" - PARAM_LIST@[72; 79) - L_PAREN@[72; 73) "(" - SELF_PARAM@[73; 78) - AMP@[73; 74) "&" - SELF_KW@[74; 78) "self" - R_PAREN@[78; 79) ")" - SEMICOLON@[79; 80) ";" - WHITESPACE@[80; 81) "\n" - R_CURLY@[81; 82) "}" - WHITESPACE@[82; 83) "\n" +SOURCE_FILE@0..83 + IMPL_DEF@0..82 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "F" + WHITESPACE@6..7 " " + ITEM_LIST@7..82 + L_CURLY@7..8 "{" + WHITESPACE@8..13 "\n " + TYPE_ALIAS_DEF@13..27 + TYPE_KW@13..17 "type" + WHITESPACE@17..18 " " + NAME@18..19 + IDENT@18..19 "A" + COLON@19..20 ":" + WHITESPACE@20..21 " " + TYPE_BOUND_LIST@21..26 + TYPE_BOUND@21..26 + PATH_TYPE@21..26 + PATH@21..26 + PATH_SEGMENT@21..26 + NAME_REF@21..26 + IDENT@21..26 "Clone" + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + CONST_DEF@32..45 + CONST_KW@32..37 "const" + WHITESPACE@37..38 " " + NAME@38..39 + IDENT@38..39 "B" + COLON@39..40 ":" + WHITESPACE@40..41 " " + PATH_TYPE@41..44 + PATH@41..44 + PATH_SEGMENT@41..44 + NAME_REF@41..44 + IDENT@41..44 "i32" + SEMICOLON@44..45 ";" + WHITESPACE@45..50 "\n " + FN_DEF@50..61 + FN_KW@50..52 "fn" + WHITESPACE@52..53 " " + NAME@53..56 + IDENT@53..56 "foo" + PARAM_LIST@56..58 + L_PAREN@56..57 "(" + R_PAREN@57..58 ")" + WHITESPACE@58..59 " " + BLOCK_EXPR@59..61 + BLOCK@59..61 + L_CURLY@59..60 "{" + R_CURLY@60..61 "}" + WHITESPACE@61..66 "\n " + FN_DEF@66..80 + FN_KW@66..68 "fn" + WHITESPACE@68..69 " " + NAME@69..72 + IDENT@69..72 "bar" + PARAM_LIST@72..79 + L_PAREN@72..73 "(" + SELF_PARAM@73..78 + AMP@73..74 "&" + SELF_KW@74..78 "self" + R_PAREN@78..79 ")" + SEMICOLON@79..80 ";" + WHITESPACE@80..81 "\n" + R_CURLY@81..82 "}" + 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 69c459daf4..bd74b44a68 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 @@ -1,135 +1,135 @@ -SOURCE_FILE@[0; 250) - USE_ITEM@[0; 58) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 57) - USE_TREE_LIST@[4; 57) - L_CURLY@[4; 5) "{" - USE_TREE@[5; 28) - PATH@[5; 28) - PATH@[5; 22) - PATH@[5; 16) - PATH@[5; 10) - PATH_SEGMENT@[5; 10) - CRATE_KW@[5; 10) "crate" - COLON2@[10; 12) "::" - PATH_SEGMENT@[12; 16) - NAME_REF@[12; 16) - IDENT@[12; 16) "path" - COLON2@[16; 18) "::" - PATH_SEGMENT@[18; 22) - NAME_REF@[18; 22) - IDENT@[18; 22) "from" - COLON2@[22; 24) "::" - PATH_SEGMENT@[24; 28) - NAME_REF@[24; 28) - IDENT@[24; 28) "root" - COMMA@[28; 29) "," - WHITESPACE@[29; 30) " " - USE_TREE@[30; 56) - PATH@[30; 56) - PATH@[30; 44) - PATH@[30; 38) - PATH@[30; 32) - PATH_SEGMENT@[30; 32) - NAME_REF@[30; 32) - IDENT@[30; 32) "or" - COLON2@[32; 34) "::" - PATH_SEGMENT@[34; 38) - NAME_REF@[34; 38) - IDENT@[34; 38) "path" - COLON2@[38; 40) "::" - PATH_SEGMENT@[40; 44) - NAME_REF@[40; 44) - IDENT@[40; 44) "from" - COLON2@[44; 46) "::" - PATH_SEGMENT@[46; 56) - NAME_REF@[46; 56) - IDENT@[46; 56) "crate_name" - R_CURLY@[56; 57) "}" - SEMICOLON@[57; 58) ";" - WHITESPACE@[58; 59) " " - COMMENT@[59; 97) "// Rust 2018 (with a ..." - WHITESPACE@[97; 98) "\n" - USE_ITEM@[98; 121) - USE_KW@[98; 101) "use" - WHITESPACE@[101; 102) " " - USE_TREE@[102; 120) - USE_TREE_LIST@[102; 120) - L_CURLY@[102; 103) "{" - USE_TREE@[103; 119) - PATH@[103; 119) - PATH@[103; 113) - PATH@[103; 107) - PATH_SEGMENT@[103; 107) - NAME_REF@[103; 107) - IDENT@[103; 107) "path" - COLON2@[107; 109) "::" - PATH_SEGMENT@[109; 113) - NAME_REF@[109; 113) - IDENT@[109; 113) "from" - COLON2@[113; 115) "::" - PATH_SEGMENT@[115; 119) - NAME_REF@[115; 119) - IDENT@[115; 119) "root" - R_CURLY@[119; 120) "}" - SEMICOLON@[120; 121) ";" - WHITESPACE@[121; 122) " " - COMMENT@[122; 134) "// Rust 2015" - WHITESPACE@[134; 135) "\n" - USE_ITEM@[135; 166) - USE_KW@[135; 138) "use" - WHITESPACE@[138; 139) " " - USE_TREE@[139; 165) - COLON2@[139; 141) "::" - USE_TREE_LIST@[141; 165) - L_CURLY@[141; 142) "{" - USE_TREE@[142; 164) - PATH@[142; 164) - PATH@[142; 158) - PATH@[142; 146) - PATH_SEGMENT@[142; 146) - NAME_REF@[142; 146) - IDENT@[142; 146) "some" - COLON2@[146; 148) "::" - PATH_SEGMENT@[148; 158) - NAME_REF@[148; 158) - IDENT@[148; 158) "arbritrary" - COLON2@[158; 160) "::" - PATH_SEGMENT@[160; 164) - NAME_REF@[160; 164) - IDENT@[160; 164) "path" - R_CURLY@[164; 165) "}" - SEMICOLON@[165; 166) ";" - WHITESPACE@[166; 167) " " - COMMENT@[167; 179) "// Rust 2015" - WHITESPACE@[179; 180) "\n" - USE_ITEM@[180; 206) - USE_KW@[180; 183) "use" - WHITESPACE@[183; 184) " " - USE_TREE@[184; 205) - COLON2@[184; 186) "::" - USE_TREE_LIST@[186; 205) - L_CURLY@[186; 187) "{" - USE_TREE@[187; 204) - USE_TREE_LIST@[187; 204) - L_CURLY@[187; 188) "{" - USE_TREE@[188; 203) - USE_TREE_LIST@[188; 203) - L_CURLY@[188; 189) "{" - USE_TREE@[189; 202) - PATH@[189; 202) - PATH@[189; 194) - PATH_SEGMENT@[189; 194) - CRATE_KW@[189; 194) "crate" - COLON2@[194; 196) "::" - PATH_SEGMENT@[196; 202) - NAME_REF@[196; 202) - IDENT@[196; 202) "export" - R_CURLY@[202; 203) "}" - R_CURLY@[203; 204) "}" - R_CURLY@[204; 205) "}" - SEMICOLON@[205; 206) ";" - WHITESPACE@[206; 207) " " - COMMENT@[207; 249) "// Nonsensical but pe ..." - WHITESPACE@[249; 250) "\n" +SOURCE_FILE@0..250 + USE_ITEM@0..58 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..57 + USE_TREE_LIST@4..57 + L_CURLY@4..5 "{" + USE_TREE@5..28 + PATH@5..28 + PATH@5..22 + PATH@5..16 + PATH@5..10 + PATH_SEGMENT@5..10 + CRATE_KW@5..10 "crate" + COLON2@10..12 "::" + PATH_SEGMENT@12..16 + NAME_REF@12..16 + IDENT@12..16 "path" + COLON2@16..18 "::" + PATH_SEGMENT@18..22 + NAME_REF@18..22 + IDENT@18..22 "from" + COLON2@22..24 "::" + PATH_SEGMENT@24..28 + NAME_REF@24..28 + IDENT@24..28 "root" + COMMA@28..29 "," + WHITESPACE@29..30 " " + USE_TREE@30..56 + PATH@30..56 + PATH@30..44 + PATH@30..38 + PATH@30..32 + PATH_SEGMENT@30..32 + NAME_REF@30..32 + IDENT@30..32 "or" + COLON2@32..34 "::" + PATH_SEGMENT@34..38 + NAME_REF@34..38 + IDENT@34..38 "path" + COLON2@38..40 "::" + PATH_SEGMENT@40..44 + NAME_REF@40..44 + IDENT@40..44 "from" + COLON2@44..46 "::" + PATH_SEGMENT@46..56 + NAME_REF@46..56 + IDENT@46..56 "crate_name" + R_CURLY@56..57 "}" + SEMICOLON@57..58 ";" + WHITESPACE@58..59 " " + COMMENT@59..97 "// Rust 2018 (with a ..." + WHITESPACE@97..98 "\n" + USE_ITEM@98..121 + USE_KW@98..101 "use" + WHITESPACE@101..102 " " + USE_TREE@102..120 + USE_TREE_LIST@102..120 + L_CURLY@102..103 "{" + USE_TREE@103..119 + PATH@103..119 + PATH@103..113 + PATH@103..107 + PATH_SEGMENT@103..107 + NAME_REF@103..107 + IDENT@103..107 "path" + COLON2@107..109 "::" + PATH_SEGMENT@109..113 + NAME_REF@109..113 + IDENT@109..113 "from" + COLON2@113..115 "::" + PATH_SEGMENT@115..119 + NAME_REF@115..119 + IDENT@115..119 "root" + R_CURLY@119..120 "}" + SEMICOLON@120..121 ";" + WHITESPACE@121..122 " " + COMMENT@122..134 "// Rust 2015" + WHITESPACE@134..135 "\n" + USE_ITEM@135..166 + USE_KW@135..138 "use" + WHITESPACE@138..139 " " + USE_TREE@139..165 + COLON2@139..141 "::" + USE_TREE_LIST@141..165 + L_CURLY@141..142 "{" + USE_TREE@142..164 + PATH@142..164 + PATH@142..158 + PATH@142..146 + PATH_SEGMENT@142..146 + NAME_REF@142..146 + IDENT@142..146 "some" + COLON2@146..148 "::" + PATH_SEGMENT@148..158 + NAME_REF@148..158 + IDENT@148..158 "arbritrary" + COLON2@158..160 "::" + PATH_SEGMENT@160..164 + NAME_REF@160..164 + IDENT@160..164 "path" + R_CURLY@164..165 "}" + SEMICOLON@165..166 ";" + WHITESPACE@166..167 " " + COMMENT@167..179 "// Rust 2015" + WHITESPACE@179..180 "\n" + USE_ITEM@180..206 + USE_KW@180..183 "use" + WHITESPACE@183..184 " " + USE_TREE@184..205 + COLON2@184..186 "::" + USE_TREE_LIST@186..205 + L_CURLY@186..187 "{" + USE_TREE@187..204 + USE_TREE_LIST@187..204 + L_CURLY@187..188 "{" + USE_TREE@188..203 + USE_TREE_LIST@188..203 + L_CURLY@188..189 "{" + USE_TREE@189..202 + PATH@189..202 + PATH@189..194 + PATH_SEGMENT@189..194 + CRATE_KW@189..194 "crate" + COLON2@194..196 "::" + PATH_SEGMENT@196..202 + NAME_REF@196..202 + IDENT@196..202 "export" + R_CURLY@202..203 "}" + R_CURLY@203..204 "}" + R_CURLY@204..205 "}" + SEMICOLON@205..206 ";" + WHITESPACE@206..207 " " + COMMENT@207..249 "// Nonsensical but pe ..." + WHITESPACE@249..250 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast index e3f5a7f041..a46d76fdee 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0003_where_pred_for.rast @@ -1,62 +1,62 @@ -SOURCE_FILE@[0; 49) - FN_DEF@[0; 48) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "test" - TYPE_PARAM_LIST@[7; 10) - L_ANGLE@[7; 8) "<" - TYPE_PARAM@[8; 9) - NAME@[8; 9) - IDENT@[8; 9) "F" - R_ANGLE@[9; 10) ">" - PARAM_LIST@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - WHITESPACE@[12; 13) "\n" - WHERE_CLAUSE@[13; 44) - WHERE_KW@[13; 18) "where" - WHITESPACE@[18; 22) "\n " - WHERE_PRED@[22; 44) - FOR_TYPE@[22; 31) - FOR_KW@[22; 25) "for" - TYPE_PARAM_LIST@[25; 29) - L_ANGLE@[25; 26) "<" - LIFETIME_PARAM@[26; 28) - LIFETIME@[26; 28) "\'a" - R_ANGLE@[28; 29) ">" - WHITESPACE@[29; 30) " " - PATH_TYPE@[30; 31) - PATH@[30; 31) - PATH_SEGMENT@[30; 31) - NAME_REF@[30; 31) - IDENT@[30; 31) "F" - COLON@[31; 32) ":" - WHITESPACE@[32; 33) " " - TYPE_BOUND_LIST@[33; 44) - TYPE_BOUND@[33; 44) - PATH_TYPE@[33; 44) - PATH@[33; 44) - PATH_SEGMENT@[33; 44) - NAME_REF@[33; 35) - IDENT@[33; 35) "Fn" - PARAM_LIST@[35; 44) - L_PAREN@[35; 36) "(" - PARAM@[36; 43) - REFERENCE_TYPE@[36; 43) - AMP@[36; 37) "&" - LIFETIME@[37; 39) "\'a" - WHITESPACE@[39; 40) " " - PATH_TYPE@[40; 43) - PATH@[40; 43) - PATH_SEGMENT@[40; 43) - NAME_REF@[40; 43) - IDENT@[40; 43) "str" - R_PAREN@[43; 44) ")" - WHITESPACE@[44; 45) "\n" - BLOCK_EXPR@[45; 48) - BLOCK@[45; 48) - L_CURLY@[45; 46) "{" - WHITESPACE@[46; 47) " " - R_CURLY@[47; 48) "}" - WHITESPACE@[48; 49) "\n" +SOURCE_FILE@0..49 + FN_DEF@0..48 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "test" + TYPE_PARAM_LIST@7..10 + L_ANGLE@7..8 "<" + TYPE_PARAM@8..9 + NAME@8..9 + IDENT@8..9 "F" + R_ANGLE@9..10 ">" + PARAM_LIST@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + WHITESPACE@12..13 "\n" + WHERE_CLAUSE@13..44 + WHERE_KW@13..18 "where" + WHITESPACE@18..22 "\n " + WHERE_PRED@22..44 + FOR_TYPE@22..31 + FOR_KW@22..25 "for" + TYPE_PARAM_LIST@25..29 + L_ANGLE@25..26 "<" + LIFETIME_PARAM@26..28 + LIFETIME@26..28 "\'a" + R_ANGLE@28..29 ">" + WHITESPACE@29..30 " " + PATH_TYPE@30..31 + PATH@30..31 + PATH_SEGMENT@30..31 + NAME_REF@30..31 + IDENT@30..31 "F" + COLON@31..32 ":" + WHITESPACE@32..33 " " + TYPE_BOUND_LIST@33..44 + TYPE_BOUND@33..44 + PATH_TYPE@33..44 + PATH@33..44 + PATH_SEGMENT@33..44 + NAME_REF@33..35 + IDENT@33..35 "Fn" + PARAM_LIST@35..44 + L_PAREN@35..36 "(" + PARAM@36..43 + REFERENCE_TYPE@36..43 + AMP@36..37 "&" + LIFETIME@37..39 "\'a" + WHITESPACE@39..40 " " + PATH_TYPE@40..43 + PATH@40..43 + PATH_SEGMENT@40..43 + NAME_REF@40..43 + IDENT@40..43 "str" + R_PAREN@43..44 ")" + WHITESPACE@44..45 "\n" + BLOCK_EXPR@45..48 + BLOCK@45..48 + L_CURLY@45..46 "{" + WHITESPACE@46..47 " " + R_CURLY@47..48 "}" + WHITESPACE@48..49 "\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 a0cf1e4f6f..20eba09f5f 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 @@ -1,60 +1,60 @@ -SOURCE_FILE@[0; 39) - TYPE_ALIAS_DEF@[0; 38) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "F" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - PATH_TYPE@[9; 37) - PATH@[9; 37) - PATH_SEGMENT@[9; 37) - NAME_REF@[9; 12) - IDENT@[9; 12) "Box" - TYPE_ARG_LIST@[12; 37) - L_ANGLE@[12; 13) "<" - TYPE_ARG@[13; 36) - PATH_TYPE@[13; 36) - PATH@[13; 36) - PATH_SEGMENT@[13; 36) - NAME_REF@[13; 15) - IDENT@[13; 15) "Fn" - PARAM_LIST@[15; 36) - L_PAREN@[15; 16) "(" - PARAM@[16; 19) - PATH_TYPE@[16; 19) - PATH@[16; 19) - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "i32" - COMMA@[19; 20) "," - WHITESPACE@[20; 21) " " - PARAM@[21; 25) - REFERENCE_TYPE@[21; 25) - AMP@[21; 22) "&" - PATH_TYPE@[22; 25) - PATH@[22; 25) - PATH_SEGMENT@[22; 25) - NAME_REF@[22; 25) - IDENT@[22; 25) "i32" - COMMA@[25; 26) "," - WHITESPACE@[26; 27) " " - PARAM@[27; 31) - REFERENCE_TYPE@[27; 31) - AMP@[27; 28) "&" - PATH_TYPE@[28; 31) - PATH@[28; 31) - PATH_SEGMENT@[28; 31) - NAME_REF@[28; 31) - IDENT@[28; 31) "i32" - COMMA@[31; 32) "," - WHITESPACE@[32; 33) " " - PARAM@[33; 35) - TUPLE_TYPE@[33; 35) - L_PAREN@[33; 34) "(" - R_PAREN@[34; 35) ")" - R_PAREN@[35; 36) ")" - R_ANGLE@[36; 37) ">" - SEMICOLON@[37; 38) ";" - WHITESPACE@[38; 39) "\n" +SOURCE_FILE@0..39 + TYPE_ALIAS_DEF@0..38 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "F" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + PATH_TYPE@9..37 + PATH@9..37 + PATH_SEGMENT@9..37 + NAME_REF@9..12 + IDENT@9..12 "Box" + TYPE_ARG_LIST@12..37 + L_ANGLE@12..13 "<" + TYPE_ARG@13..36 + PATH_TYPE@13..36 + PATH@13..36 + PATH_SEGMENT@13..36 + NAME_REF@13..15 + IDENT@13..15 "Fn" + PARAM_LIST@15..36 + L_PAREN@15..16 "(" + PARAM@16..19 + PATH_TYPE@16..19 + PATH@16..19 + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "i32" + COMMA@19..20 "," + WHITESPACE@20..21 " " + PARAM@21..25 + REFERENCE_TYPE@21..25 + AMP@21..22 "&" + PATH_TYPE@22..25 + PATH@22..25 + PATH_SEGMENT@22..25 + NAME_REF@22..25 + IDENT@22..25 "i32" + COMMA@25..26 "," + WHITESPACE@26..27 " " + PARAM@27..31 + REFERENCE_TYPE@27..31 + AMP@27..28 "&" + PATH_TYPE@28..31 + PATH@28..31 + PATH_SEGMENT@28..31 + NAME_REF@28..31 + IDENT@28..31 "i32" + COMMA@31..32 "," + WHITESPACE@32..33 " " + PARAM@33..35 + TUPLE_TYPE@33..35 + L_PAREN@33..34 "(" + R_PAREN@34..35 ")" + R_PAREN@35..36 ")" + R_ANGLE@36..37 ">" + SEMICOLON@37..38 ";" + WHITESPACE@38..39 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast index 8ae7909f99..5181fcd2bc 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0005_function_type_params.rast @@ -1,38 +1,38 @@ -SOURCE_FILE@[0; 28) - FN_DEF@[0; 27) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - TYPE_PARAM_LIST@[6; 23) - L_ANGLE@[6; 7) "<" - TYPE_PARAM@[7; 22) - NAME@[7; 8) - IDENT@[7; 8) "T" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - TYPE_BOUND_LIST@[10; 22) - TYPE_BOUND@[10; 15) - PATH_TYPE@[10; 15) - PATH@[10; 15) - PATH_SEGMENT@[10; 15) - NAME_REF@[10; 15) - IDENT@[10; 15) "Clone" - WHITESPACE@[15; 16) " " - PLUS@[16; 17) "+" - WHITESPACE@[17; 18) " " - TYPE_BOUND@[18; 22) - PATH_TYPE@[18; 22) - PATH@[18; 22) - PATH_SEGMENT@[18; 22) - NAME_REF@[18; 22) - IDENT@[18; 22) "Copy" - R_ANGLE@[22; 23) ">" - PARAM_LIST@[23; 25) - L_PAREN@[23; 24) "(" - R_PAREN@[24; 25) ")" - BLOCK_EXPR@[25; 27) - BLOCK@[25; 27) - L_CURLY@[25; 26) "{" - R_CURLY@[26; 27) "}" - WHITESPACE@[27; 28) "\n" +SOURCE_FILE@0..28 + FN_DEF@0..27 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + TYPE_PARAM_LIST@6..23 + L_ANGLE@6..7 "<" + TYPE_PARAM@7..22 + NAME@7..8 + IDENT@7..8 "T" + COLON@8..9 ":" + WHITESPACE@9..10 " " + TYPE_BOUND_LIST@10..22 + TYPE_BOUND@10..15 + PATH_TYPE@10..15 + PATH@10..15 + PATH_SEGMENT@10..15 + NAME_REF@10..15 + IDENT@10..15 "Clone" + WHITESPACE@15..16 " " + PLUS@16..17 "+" + WHITESPACE@17..18 " " + TYPE_BOUND@18..22 + PATH_TYPE@18..22 + PATH@18..22 + PATH_SEGMENT@18..22 + NAME_REF@18..22 + IDENT@18..22 "Copy" + R_ANGLE@22..23 ">" + PARAM_LIST@23..25 + L_PAREN@23..24 "(" + R_PAREN@24..25 ")" + BLOCK_EXPR@25..27 + BLOCK@25..27 + L_CURLY@25..26 "{" + R_CURLY@26..27 "}" + WHITESPACE@27..28 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast index 757ac092a0..dd41b44e15 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0006_self_param.rast @@ -1,121 +1,121 @@ -SOURCE_FILE@[0; 128) - IMPL_DEF@[0; 127) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "S" - WHITESPACE@[6; 7) " " - ITEM_LIST@[7; 127) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 13) "\n " - FN_DEF@[13; 26) - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 17) - IDENT@[16; 17) "a" - PARAM_LIST@[17; 23) - L_PAREN@[17; 18) "(" - SELF_PARAM@[18; 22) - SELF_KW@[18; 22) "self" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - BLOCK_EXPR@[24; 26) - BLOCK@[24; 26) - L_CURLY@[24; 25) "{" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 31) "\n " - FN_DEF@[31; 46) - FN_KW@[31; 33) "fn" - WHITESPACE@[33; 34) " " - NAME@[34; 35) - IDENT@[34; 35) "b" - PARAM_LIST@[35; 43) - L_PAREN@[35; 36) "(" - SELF_PARAM@[36; 41) - AMP@[36; 37) "&" - SELF_KW@[37; 41) "self" - COMMA@[41; 42) "," - R_PAREN@[42; 43) ")" - WHITESPACE@[43; 44) " " - BLOCK_EXPR@[44; 46) - BLOCK@[44; 46) - L_CURLY@[44; 45) "{" - R_CURLY@[45; 46) "}" - WHITESPACE@[46; 51) "\n " - FN_DEF@[51; 69) - FN_KW@[51; 53) "fn" - WHITESPACE@[53; 54) " " - NAME@[54; 55) - IDENT@[54; 55) "c" - PARAM_LIST@[55; 66) - L_PAREN@[55; 56) "(" - SELF_PARAM@[56; 64) - AMP@[56; 57) "&" - LIFETIME@[57; 59) "\'a" - WHITESPACE@[59; 60) " " - SELF_KW@[60; 64) "self" - COMMA@[64; 65) "," - R_PAREN@[65; 66) ")" - WHITESPACE@[66; 67) " " - BLOCK_EXPR@[67; 69) - BLOCK@[67; 69) - L_CURLY@[67; 68) "{" - R_CURLY@[68; 69) "}" - WHITESPACE@[69; 74) "\n " - FN_DEF@[74; 103) - FN_KW@[74; 76) "fn" - WHITESPACE@[76; 77) " " - NAME@[77; 78) - IDENT@[77; 78) "d" - PARAM_LIST@[78; 100) - L_PAREN@[78; 79) "(" - SELF_PARAM@[79; 91) - AMP@[79; 80) "&" - LIFETIME@[80; 82) "\'a" - WHITESPACE@[82; 83) " " - MUT_KW@[83; 86) "mut" - WHITESPACE@[86; 87) " " - SELF_KW@[87; 91) "self" - COMMA@[91; 92) "," - WHITESPACE@[92; 93) " " - PARAM@[93; 99) - BIND_PAT@[93; 94) - NAME@[93; 94) - IDENT@[93; 94) "x" - COLON@[94; 95) ":" - WHITESPACE@[95; 96) " " - PATH_TYPE@[96; 99) - PATH@[96; 99) - PATH_SEGMENT@[96; 99) - NAME_REF@[96; 99) - IDENT@[96; 99) "i32" - R_PAREN@[99; 100) ")" - WHITESPACE@[100; 101) " " - BLOCK_EXPR@[101; 103) - BLOCK@[101; 103) - L_CURLY@[101; 102) "{" - R_CURLY@[102; 103) "}" - WHITESPACE@[103; 108) "\n " - FN_DEF@[108; 125) - FN_KW@[108; 110) "fn" - WHITESPACE@[110; 111) " " - NAME@[111; 112) - IDENT@[111; 112) "e" - PARAM_LIST@[112; 122) - L_PAREN@[112; 113) "(" - SELF_PARAM@[113; 121) - MUT_KW@[113; 116) "mut" - WHITESPACE@[116; 117) " " - SELF_KW@[117; 121) "self" - R_PAREN@[121; 122) ")" - WHITESPACE@[122; 123) " " - BLOCK_EXPR@[123; 125) - BLOCK@[123; 125) - L_CURLY@[123; 124) "{" - R_CURLY@[124; 125) "}" - WHITESPACE@[125; 126) "\n" - R_CURLY@[126; 127) "}" - WHITESPACE@[127; 128) "\n" +SOURCE_FILE@0..128 + IMPL_DEF@0..127 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "S" + WHITESPACE@6..7 " " + ITEM_LIST@7..127 + L_CURLY@7..8 "{" + WHITESPACE@8..13 "\n " + FN_DEF@13..26 + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..17 + IDENT@16..17 "a" + PARAM_LIST@17..23 + L_PAREN@17..18 "(" + SELF_PARAM@18..22 + SELF_KW@18..22 "self" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + BLOCK_EXPR@24..26 + BLOCK@24..26 + L_CURLY@24..25 "{" + R_CURLY@25..26 "}" + WHITESPACE@26..31 "\n " + FN_DEF@31..46 + FN_KW@31..33 "fn" + WHITESPACE@33..34 " " + NAME@34..35 + IDENT@34..35 "b" + PARAM_LIST@35..43 + L_PAREN@35..36 "(" + SELF_PARAM@36..41 + AMP@36..37 "&" + SELF_KW@37..41 "self" + COMMA@41..42 "," + R_PAREN@42..43 ")" + WHITESPACE@43..44 " " + BLOCK_EXPR@44..46 + BLOCK@44..46 + L_CURLY@44..45 "{" + R_CURLY@45..46 "}" + WHITESPACE@46..51 "\n " + FN_DEF@51..69 + FN_KW@51..53 "fn" + WHITESPACE@53..54 " " + NAME@54..55 + IDENT@54..55 "c" + PARAM_LIST@55..66 + L_PAREN@55..56 "(" + SELF_PARAM@56..64 + AMP@56..57 "&" + LIFETIME@57..59 "\'a" + WHITESPACE@59..60 " " + SELF_KW@60..64 "self" + COMMA@64..65 "," + R_PAREN@65..66 ")" + WHITESPACE@66..67 " " + BLOCK_EXPR@67..69 + BLOCK@67..69 + L_CURLY@67..68 "{" + R_CURLY@68..69 "}" + WHITESPACE@69..74 "\n " + FN_DEF@74..103 + FN_KW@74..76 "fn" + WHITESPACE@76..77 " " + NAME@77..78 + IDENT@77..78 "d" + PARAM_LIST@78..100 + L_PAREN@78..79 "(" + SELF_PARAM@79..91 + AMP@79..80 "&" + LIFETIME@80..82 "\'a" + WHITESPACE@82..83 " " + MUT_KW@83..86 "mut" + WHITESPACE@86..87 " " + SELF_KW@87..91 "self" + COMMA@91..92 "," + WHITESPACE@92..93 " " + PARAM@93..99 + BIND_PAT@93..94 + NAME@93..94 + IDENT@93..94 "x" + COLON@94..95 ":" + WHITESPACE@95..96 " " + PATH_TYPE@96..99 + PATH@96..99 + PATH_SEGMENT@96..99 + NAME_REF@96..99 + IDENT@96..99 "i32" + R_PAREN@99..100 ")" + WHITESPACE@100..101 " " + BLOCK_EXPR@101..103 + BLOCK@101..103 + L_CURLY@101..102 "{" + R_CURLY@102..103 "}" + WHITESPACE@103..108 "\n " + FN_DEF@108..125 + FN_KW@108..110 "fn" + WHITESPACE@110..111 " " + NAME@111..112 + IDENT@111..112 "e" + PARAM_LIST@112..122 + L_PAREN@112..113 "(" + SELF_PARAM@113..121 + MUT_KW@113..116 "mut" + WHITESPACE@116..117 " " + SELF_KW@117..121 "self" + R_PAREN@121..122 ")" + WHITESPACE@122..123 " " + BLOCK_EXPR@123..125 + BLOCK@123..125 + L_CURLY@123..124 "{" + R_CURLY@124..125 "}" + WHITESPACE@125..126 "\n" + R_CURLY@126..127 "}" + WHITESPACE@127..128 "\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 027abf179f..7cb9e1d55e 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 @@ -1,40 +1,40 @@ -SOURCE_FILE@[0; 35) - STRUCT_DEF@[0; 34) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - TYPE_PARAM_LIST@[8; 33) - L_ANGLE@[8; 9) "<" - TYPE_PARAM@[9; 32) - NAME@[9; 10) - IDENT@[9; 10) "T" - COLON@[10; 11) ":" - WHITESPACE@[11; 12) " " - TYPE_BOUND_LIST@[12; 32) - TYPE_BOUND@[12; 14) - LIFETIME@[12; 14) "\'a" - WHITESPACE@[14; 15) " " - PLUS@[15; 16) "+" - WHITESPACE@[16; 17) " " - TYPE_BOUND@[17; 23) - QUESTION@[17; 18) "?" - PATH_TYPE@[18; 23) - PATH@[18; 23) - PATH_SEGMENT@[18; 23) - NAME_REF@[18; 23) - IDENT@[18; 23) "Sized" - WHITESPACE@[23; 24) " " - PLUS@[24; 25) "+" - WHITESPACE@[25; 26) " " - TYPE_BOUND@[26; 32) - L_PAREN@[26; 27) "(" - PATH_TYPE@[27; 31) - PATH@[27; 31) - PATH_SEGMENT@[27; 31) - NAME_REF@[27; 31) - IDENT@[27; 31) "Copy" - R_PAREN@[31; 32) ")" - R_ANGLE@[32; 33) ">" - SEMICOLON@[33; 34) ";" - WHITESPACE@[34; 35) "\n" +SOURCE_FILE@0..35 + STRUCT_DEF@0..34 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + TYPE_PARAM_LIST@8..33 + L_ANGLE@8..9 "<" + TYPE_PARAM@9..32 + NAME@9..10 + IDENT@9..10 "T" + COLON@10..11 ":" + WHITESPACE@11..12 " " + TYPE_BOUND_LIST@12..32 + TYPE_BOUND@12..14 + LIFETIME@12..14 "\'a" + WHITESPACE@14..15 " " + PLUS@15..16 "+" + WHITESPACE@16..17 " " + TYPE_BOUND@17..23 + QUESTION@17..18 "?" + PATH_TYPE@18..23 + PATH@18..23 + PATH_SEGMENT@18..23 + NAME_REF@18..23 + IDENT@18..23 "Sized" + WHITESPACE@23..24 " " + PLUS@24..25 "+" + WHITESPACE@25..26 " " + TYPE_BOUND@26..32 + L_PAREN@26..27 "(" + PATH_TYPE@27..31 + PATH@27..31 + PATH_SEGMENT@27..31 + NAME_REF@27..31 + IDENT@27..31 "Copy" + R_PAREN@31..32 ")" + R_ANGLE@32..33 ">" + SEMICOLON@33..34 ";" + 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 f4697fed6a..a8ddd20c93 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 @@ -1,97 +1,97 @@ -SOURCE_FILE@[0; 103) - FN_DEF@[0; 102) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 102) - BLOCK@[9; 102) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 33) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PATH_PAT@[19; 27) - PATH@[19; 27) - PATH@[19; 22) - PATH_SEGMENT@[19; 22) - NAME_REF@[19; 22) - IDENT@[19; 22) "foo" - COLON2@[22; 24) "::" - PATH_SEGMENT@[24; 27) - NAME_REF@[24; 27) - IDENT@[24; 27) "Bar" - WHITESPACE@[27; 28) " " - EQ@[28; 29) "=" - WHITESPACE@[29; 30) " " - TUPLE_EXPR@[30; 32) - L_PAREN@[30; 31) "(" - R_PAREN@[31; 32) ")" - SEMICOLON@[32; 33) ";" - WHITESPACE@[33; 38) "\n " - LET_STMT@[38; 53) - LET_KW@[38; 41) "let" - WHITESPACE@[41; 42) " " - PATH_PAT@[42; 47) - PATH@[42; 47) - PATH_SEGMENT@[42; 47) - COLON2@[42; 44) "::" - NAME_REF@[44; 47) - IDENT@[44; 47) "Bar" - WHITESPACE@[47; 48) " " - EQ@[48; 49) "=" - WHITESPACE@[49; 50) " " - TUPLE_EXPR@[50; 52) - L_PAREN@[50; 51) "(" - R_PAREN@[51; 52) ")" - SEMICOLON@[52; 53) ";" - WHITESPACE@[53; 58) "\n " - LET_STMT@[58; 78) - LET_KW@[58; 61) "let" - WHITESPACE@[61; 62) " " - RECORD_PAT@[62; 72) - PATH@[62; 65) - PATH_SEGMENT@[62; 65) - NAME_REF@[62; 65) - IDENT@[62; 65) "Bar" - WHITESPACE@[65; 66) " " - RECORD_FIELD_PAT_LIST@[66; 72) - L_CURLY@[66; 67) "{" - WHITESPACE@[67; 68) " " - DOT2@[68; 70) ".." - WHITESPACE@[70; 71) " " - R_CURLY@[71; 72) "}" - WHITESPACE@[72; 73) " " - EQ@[73; 74) "=" - WHITESPACE@[74; 75) " " - TUPLE_EXPR@[75; 77) - L_PAREN@[75; 76) "(" - R_PAREN@[76; 77) ")" - SEMICOLON@[77; 78) ";" - WHITESPACE@[78; 83) "\n " - LET_STMT@[83; 100) - LET_KW@[83; 86) "let" - WHITESPACE@[86; 87) " " - TUPLE_STRUCT_PAT@[87; 94) - PATH@[87; 90) - PATH_SEGMENT@[87; 90) - NAME_REF@[87; 90) - IDENT@[87; 90) "Bar" - L_PAREN@[90; 91) "(" - DOT_DOT_PAT@[91; 93) - DOT2@[91; 93) ".." - R_PAREN@[93; 94) ")" - WHITESPACE@[94; 95) " " - EQ@[95; 96) "=" - WHITESPACE@[96; 97) " " - TUPLE_EXPR@[97; 99) - L_PAREN@[97; 98) "(" - R_PAREN@[98; 99) ")" - SEMICOLON@[99; 100) ";" - WHITESPACE@[100; 101) "\n" - R_CURLY@[101; 102) "}" - WHITESPACE@[102; 103) "\n" +SOURCE_FILE@0..103 + FN_DEF@0..102 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..102 + BLOCK@9..102 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..33 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PATH_PAT@19..27 + PATH@19..27 + PATH@19..22 + PATH_SEGMENT@19..22 + NAME_REF@19..22 + IDENT@19..22 "foo" + COLON2@22..24 "::" + PATH_SEGMENT@24..27 + NAME_REF@24..27 + IDENT@24..27 "Bar" + WHITESPACE@27..28 " " + EQ@28..29 "=" + WHITESPACE@29..30 " " + TUPLE_EXPR@30..32 + L_PAREN@30..31 "(" + R_PAREN@31..32 ")" + SEMICOLON@32..33 ";" + WHITESPACE@33..38 "\n " + LET_STMT@38..53 + LET_KW@38..41 "let" + WHITESPACE@41..42 " " + PATH_PAT@42..47 + PATH@42..47 + PATH_SEGMENT@42..47 + COLON2@42..44 "::" + NAME_REF@44..47 + IDENT@44..47 "Bar" + WHITESPACE@47..48 " " + EQ@48..49 "=" + WHITESPACE@49..50 " " + TUPLE_EXPR@50..52 + L_PAREN@50..51 "(" + R_PAREN@51..52 ")" + SEMICOLON@52..53 ";" + WHITESPACE@53..58 "\n " + LET_STMT@58..78 + LET_KW@58..61 "let" + WHITESPACE@61..62 " " + RECORD_PAT@62..72 + PATH@62..65 + PATH_SEGMENT@62..65 + NAME_REF@62..65 + IDENT@62..65 "Bar" + WHITESPACE@65..66 " " + RECORD_FIELD_PAT_LIST@66..72 + L_CURLY@66..67 "{" + WHITESPACE@67..68 " " + DOT2@68..70 ".." + WHITESPACE@70..71 " " + R_CURLY@71..72 "}" + WHITESPACE@72..73 " " + EQ@73..74 "=" + WHITESPACE@74..75 " " + TUPLE_EXPR@75..77 + L_PAREN@75..76 "(" + R_PAREN@76..77 ")" + SEMICOLON@77..78 ";" + WHITESPACE@78..83 "\n " + LET_STMT@83..100 + LET_KW@83..86 "let" + WHITESPACE@86..87 " " + TUPLE_STRUCT_PAT@87..94 + PATH@87..90 + PATH_SEGMENT@87..90 + NAME_REF@87..90 + IDENT@87..90 "Bar" + L_PAREN@90..91 "(" + DOT_DOT_PAT@91..93 + DOT2@91..93 ".." + R_PAREN@93..94 ")" + WHITESPACE@94..95 " " + EQ@95..96 "=" + WHITESPACE@96..97 " " + TUPLE_EXPR@97..99 + L_PAREN@97..98 "(" + R_PAREN@98..99 ")" + SEMICOLON@99..100 ";" + WHITESPACE@100..101 "\n" + R_CURLY@101..102 "}" + 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 cc759310a1..df8ada62ad 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 @@ -1,26 +1,26 @@ -SOURCE_FILE@[0; 26) - FN_DEF@[0; 25) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 25) - BLOCK@[9; 25) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 23) - LOOP_EXPR@[15; 22) - LOOP_KW@[15; 19) "loop" - WHITESPACE@[19; 20) " " - BLOCK_EXPR@[20; 22) - BLOCK@[20; 22) - L_CURLY@[20; 21) "{" - R_CURLY@[21; 22) "}" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 24) "\n" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" +SOURCE_FILE@0..26 + FN_DEF@0..25 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..25 + BLOCK@9..25 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..23 + LOOP_EXPR@15..22 + LOOP_KW@15..19 "loop" + WHITESPACE@19..20 " " + BLOCK_EXPR@20..22 + BLOCK@20..22 + L_CURLY@20..21 "{" + R_CURLY@21..22 "}" + SEMICOLON@22..23 ";" + WHITESPACE@23..24 "\n" + R_CURLY@24..25 "}" + WHITESPACE@25..26 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rast b/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rast index 506f56fffd..869875875e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0010_extern_block.rast @@ -1,9 +1,9 @@ -SOURCE_FILE@[0; 10) - EXTERN_BLOCK@[0; 9) - ABI@[0; 6) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - EXTERN_ITEM_LIST@[7; 9) - L_CURLY@[7; 8) "{" - R_CURLY@[8; 9) "}" - WHITESPACE@[9; 10) "\n" +SOURCE_FILE@0..10 + EXTERN_BLOCK@0..9 + ABI@0..6 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + EXTERN_ITEM_LIST@7..9 + L_CURLY@7..8 "{" + R_CURLY@8..9 "}" + WHITESPACE@9..10 "\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 c2fafe4727..de01cc79e2 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 @@ -1,60 +1,60 @@ -SOURCE_FILE@[0; 48) - FN_DEF@[0; 47) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 47) - BLOCK@[9; 47) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 21) - FIELD_EXPR@[15; 20) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "x" - DOT@[16; 17) "." - NAME_REF@[17; 20) - IDENT@[17; 20) "foo" - SEMICOLON@[20; 21) ";" - WHITESPACE@[21; 26) "\n " - EXPR_STMT@[26; 34) - FIELD_EXPR@[26; 33) - FIELD_EXPR@[26; 29) - PATH_EXPR@[26; 27) - PATH@[26; 27) - PATH_SEGMENT@[26; 27) - NAME_REF@[26; 27) - IDENT@[26; 27) "x" - DOT@[27; 28) "." - NAME_REF@[28; 29) - INT_NUMBER@[28; 29) "0" - DOT@[29; 30) "." - NAME_REF@[30; 33) - IDENT@[30; 33) "bar" - SEMICOLON@[33; 34) ";" - WHITESPACE@[34; 39) "\n " - EXPR_STMT@[39; 45) - CALL_EXPR@[39; 44) - FIELD_EXPR@[39; 42) - PATH_EXPR@[39; 40) - PATH@[39; 40) - PATH_SEGMENT@[39; 40) - NAME_REF@[39; 40) - IDENT@[39; 40) "x" - DOT@[40; 41) "." - NAME_REF@[41; 42) - INT_NUMBER@[41; 42) "0" - ARG_LIST@[42; 44) - L_PAREN@[42; 43) "(" - R_PAREN@[43; 44) ")" - SEMICOLON@[44; 45) ";" - WHITESPACE@[45; 46) "\n" - R_CURLY@[46; 47) "}" - WHITESPACE@[47; 48) "\n" +SOURCE_FILE@0..48 + FN_DEF@0..47 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..47 + BLOCK@9..47 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..21 + FIELD_EXPR@15..20 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "x" + DOT@16..17 "." + NAME_REF@17..20 + IDENT@17..20 "foo" + SEMICOLON@20..21 ";" + WHITESPACE@21..26 "\n " + EXPR_STMT@26..34 + FIELD_EXPR@26..33 + FIELD_EXPR@26..29 + PATH_EXPR@26..27 + PATH@26..27 + PATH_SEGMENT@26..27 + NAME_REF@26..27 + IDENT@26..27 "x" + DOT@27..28 "." + NAME_REF@28..29 + INT_NUMBER@28..29 "0" + DOT@29..30 "." + NAME_REF@30..33 + IDENT@30..33 "bar" + SEMICOLON@33..34 ";" + WHITESPACE@34..39 "\n " + EXPR_STMT@39..45 + CALL_EXPR@39..44 + FIELD_EXPR@39..42 + PATH_EXPR@39..40 + PATH@39..40 + PATH_SEGMENT@39..40 + NAME_REF@39..40 + IDENT@39..40 "x" + DOT@40..41 "." + NAME_REF@41..42 + INT_NUMBER@41..42 "0" + ARG_LIST@42..44 + L_PAREN@42..43 "(" + R_PAREN@43..44 ")" + SEMICOLON@44..45 ";" + WHITESPACE@45..46 "\n" + R_CURLY@46..47 "}" + 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 15d8c736df..283442a8bf 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 @@ -1,33 +1,33 @@ -SOURCE_FILE@[0; 31) - TYPE_ALIAS_DEF@[0; 30) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 8) - IDENT@[5; 8) "Foo" - WHITESPACE@[8; 9) " " - WHERE_CLAUSE@[9; 24) - WHERE_KW@[9; 14) "where" - WHITESPACE@[14; 15) " " - WHERE_PRED@[15; 24) - PATH_TYPE@[15; 18) - PATH@[15; 18) - PATH_SEGMENT@[15; 18) - NAME_REF@[15; 18) - IDENT@[15; 18) "Foo" - COLON@[18; 19) ":" - WHITESPACE@[19; 20) " " - TYPE_BOUND_LIST@[20; 24) - TYPE_BOUND@[20; 24) - PATH_TYPE@[20; 24) - PATH@[20; 24) - PATH_SEGMENT@[20; 24) - NAME_REF@[20; 24) - IDENT@[20; 24) "Copy" - WHITESPACE@[24; 25) " " - EQ@[25; 26) "=" - WHITESPACE@[26; 27) " " - TUPLE_TYPE@[27; 29) - L_PAREN@[27; 28) "(" - R_PAREN@[28; 29) ")" - SEMICOLON@[29; 30) ";" - WHITESPACE@[30; 31) "\n" +SOURCE_FILE@0..31 + TYPE_ALIAS_DEF@0..30 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..8 + IDENT@5..8 "Foo" + WHITESPACE@8..9 " " + WHERE_CLAUSE@9..24 + WHERE_KW@9..14 "where" + WHITESPACE@14..15 " " + WHERE_PRED@15..24 + PATH_TYPE@15..18 + PATH@15..18 + PATH_SEGMENT@15..18 + NAME_REF@15..18 + IDENT@15..18 "Foo" + COLON@18..19 ":" + WHITESPACE@19..20 " " + TYPE_BOUND_LIST@20..24 + TYPE_BOUND@20..24 + PATH_TYPE@20..24 + PATH@20..24 + PATH_SEGMENT@20..24 + NAME_REF@20..24 + IDENT@20..24 "Copy" + WHITESPACE@24..25 " " + EQ@25..26 "=" + WHITESPACE@26..27 " " + TUPLE_TYPE@27..29 + L_PAREN@27..28 "(" + R_PAREN@28..29 ")" + SEMICOLON@29..30 ";" + 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 a72d564954..e2e871ddaa 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 @@ -1,35 +1,35 @@ -SOURCE_FILE@[0; 36) - TYPE_ALIAS_DEF@[0; 17) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "M" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - POINTER_TYPE@[9; 16) - STAR@[9; 10) "*" - MUT_KW@[10; 13) "mut" - WHITESPACE@[13; 14) " " - TUPLE_TYPE@[14; 16) - L_PAREN@[14; 15) "(" - R_PAREN@[15; 16) ")" - SEMICOLON@[16; 17) ";" - WHITESPACE@[17; 18) "\n" - TYPE_ALIAS_DEF@[18; 35) - TYPE_KW@[18; 22) "type" - WHITESPACE@[22; 23) " " - NAME@[23; 24) - IDENT@[23; 24) "C" - WHITESPACE@[24; 25) " " - EQ@[25; 26) "=" - WHITESPACE@[26; 27) " " - POINTER_TYPE@[27; 34) - STAR@[27; 28) "*" - MUT_KW@[28; 31) "mut" - WHITESPACE@[31; 32) " " - TUPLE_TYPE@[32; 34) - L_PAREN@[32; 33) "(" - R_PAREN@[33; 34) ")" - SEMICOLON@[34; 35) ";" - WHITESPACE@[35; 36) "\n" +SOURCE_FILE@0..36 + TYPE_ALIAS_DEF@0..17 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "M" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + POINTER_TYPE@9..16 + STAR@9..10 "*" + MUT_KW@10..13 "mut" + WHITESPACE@13..14 " " + TUPLE_TYPE@14..16 + L_PAREN@14..15 "(" + R_PAREN@15..16 ")" + SEMICOLON@16..17 ";" + WHITESPACE@17..18 "\n" + TYPE_ALIAS_DEF@18..35 + TYPE_KW@18..22 "type" + WHITESPACE@22..23 " " + NAME@23..24 + IDENT@23..24 "C" + WHITESPACE@24..25 " " + EQ@25..26 "=" + WHITESPACE@26..27 " " + POINTER_TYPE@27..34 + STAR@27..28 "*" + MUT_KW@28..31 "mut" + WHITESPACE@31..32 " " + TUPLE_TYPE@32..34 + L_PAREN@32..33 "(" + R_PAREN@33..34 ")" + SEMICOLON@34..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 3c98467c7f..a60940fcf0 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 @@ -1,13 +1,13 @@ -SOURCE_FILE@[0; 16) - TYPE_ALIAS_DEF@[0; 15) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 10) - IDENT@[5; 10) "Never" - WHITESPACE@[10; 11) " " - EQ@[11; 12) "=" - WHITESPACE@[12; 13) " " - NEVER_TYPE@[13; 14) - BANG@[13; 14) "!" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" +SOURCE_FILE@0..16 + TYPE_ALIAS_DEF@0..15 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..10 + IDENT@5..10 "Never" + WHITESPACE@10..11 " " + EQ@11..12 "=" + WHITESPACE@12..13 " " + NEVER_TYPE@13..14 + BANG@13..14 "!" + SEMICOLON@14..15 ";" + 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 adaece1191..8ac307cb3a 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 @@ -1,37 +1,37 @@ -SOURCE_FILE@[0; 69) - FN_DEF@[0; 68) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 68) - BLOCK@[9; 68) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LOOP_EXPR@[15; 66) - LOOP_KW@[15; 19) "loop" - WHITESPACE@[19; 20) " " - BLOCK_EXPR@[20; 66) - BLOCK@[20; 66) - L_CURLY@[20; 21) "{" - WHITESPACE@[21; 30) "\n " - EXPR_STMT@[30; 39) - CONTINUE_EXPR@[30; 38) - CONTINUE_KW@[30; 38) "continue" - SEMICOLON@[38; 39) ";" - WHITESPACE@[39; 48) "\n " - EXPR_STMT@[48; 60) - CONTINUE_EXPR@[48; 59) - CONTINUE_KW@[48; 56) "continue" - WHITESPACE@[56; 57) " " - LIFETIME@[57; 59) "\'l" - SEMICOLON@[59; 60) ";" - WHITESPACE@[60; 65) "\n " - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 67) "\n" - R_CURLY@[67; 68) "}" - WHITESPACE@[68; 69) "\n" +SOURCE_FILE@0..69 + FN_DEF@0..68 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..68 + BLOCK@9..68 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LOOP_EXPR@15..66 + LOOP_KW@15..19 "loop" + WHITESPACE@19..20 " " + BLOCK_EXPR@20..66 + BLOCK@20..66 + L_CURLY@20..21 "{" + WHITESPACE@21..30 "\n " + EXPR_STMT@30..39 + CONTINUE_EXPR@30..38 + CONTINUE_KW@30..38 "continue" + SEMICOLON@38..39 ";" + WHITESPACE@39..48 "\n " + EXPR_STMT@48..60 + CONTINUE_EXPR@48..59 + CONTINUE_KW@48..56 "continue" + WHITESPACE@56..57 " " + LIFETIME@57..59 "\'l" + SEMICOLON@59..60 ";" + WHITESPACE@60..65 "\n " + R_CURLY@65..66 "}" + WHITESPACE@66..67 "\n" + R_CURLY@67..68 "}" + WHITESPACE@68..69 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast index 7b43f1294b..d59c6006d7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0016_unsafe_trait.rast @@ -1,13 +1,13 @@ -SOURCE_FILE@[0; 18) - TRAIT_DEF@[0; 17) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - TRAIT_KW@[7; 12) "trait" - WHITESPACE@[12; 13) " " - NAME@[13; 14) - IDENT@[13; 14) "T" - WHITESPACE@[14; 15) " " - ITEM_LIST@[15; 17) - L_CURLY@[15; 16) "{" - R_CURLY@[16; 17) "}" - WHITESPACE@[17; 18) "\n" +SOURCE_FILE@0..18 + TRAIT_DEF@0..17 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + TRAIT_KW@7..12 "trait" + WHITESPACE@12..13 " " + NAME@13..14 + IDENT@13..14 "T" + WHITESPACE@14..15 " " + ITEM_LIST@15..17 + L_CURLY@15..16 "{" + R_CURLY@16..17 "}" + WHITESPACE@17..18 "\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 f4c86a05f5..61a0b22f48 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 @@ -1,21 +1,21 @@ -SOURCE_FILE@[0; 19) - TYPE_ALIAS_DEF@[0; 18) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - ARRAY_TYPE@[9; 17) - L_BRACK@[9; 10) "[" - TUPLE_TYPE@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - SEMICOLON@[12; 13) ";" - WHITESPACE@[13; 14) " " - LITERAL@[14; 16) - INT_NUMBER@[14; 16) "92" - R_BRACK@[16; 17) "]" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" +SOURCE_FILE@0..19 + TYPE_ALIAS_DEF@0..18 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + ARRAY_TYPE@9..17 + L_BRACK@9..10 "[" + TUPLE_TYPE@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + SEMICOLON@12..13 ";" + WHITESPACE@13..14 " " + LITERAL@14..16 + INT_NUMBER@14..16 "92" + R_BRACK@16..17 "]" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast index 89caee5433..6f6400d00c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0018_arb_self_types.rast @@ -1,74 +1,74 @@ -SOURCE_FILE@[0; 69) - IMPL_DEF@[0; 68) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "S" - WHITESPACE@[6; 7) " " - ITEM_LIST@[7; 68) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 13) "\n " - FN_DEF@[13; 33) - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 17) - IDENT@[16; 17) "a" - PARAM_LIST@[17; 30) - L_PAREN@[17; 18) "(" - SELF_PARAM@[18; 29) - SELF_KW@[18; 22) "self" - COLON@[22; 23) ":" - WHITESPACE@[23; 24) " " - REFERENCE_TYPE@[24; 29) - AMP@[24; 25) "&" - PATH_TYPE@[25; 29) - PATH@[25; 29) - PATH_SEGMENT@[25; 29) - NAME_REF@[25; 29) - IDENT@[25; 29) "Self" - R_PAREN@[29; 30) ")" - WHITESPACE@[30; 31) " " - BLOCK_EXPR@[31; 33) - BLOCK@[31; 33) - L_CURLY@[31; 32) "{" - R_CURLY@[32; 33) "}" - WHITESPACE@[33; 38) "\n " - FN_DEF@[38; 66) - FN_KW@[38; 40) "fn" - WHITESPACE@[40; 41) " " - NAME@[41; 42) - IDENT@[41; 42) "b" - PARAM_LIST@[42; 63) - L_PAREN@[42; 43) "(" - SELF_PARAM@[43; 62) - MUT_KW@[43; 46) "mut" - WHITESPACE@[46; 47) " " - SELF_KW@[47; 51) "self" - COLON@[51; 52) ":" - WHITESPACE@[52; 53) " " - PATH_TYPE@[53; 62) - PATH@[53; 62) - PATH_SEGMENT@[53; 62) - NAME_REF@[53; 56) - IDENT@[53; 56) "Box" - TYPE_ARG_LIST@[56; 62) - L_ANGLE@[56; 57) "<" - TYPE_ARG@[57; 61) - PATH_TYPE@[57; 61) - PATH@[57; 61) - PATH_SEGMENT@[57; 61) - NAME_REF@[57; 61) - IDENT@[57; 61) "Self" - R_ANGLE@[61; 62) ">" - R_PAREN@[62; 63) ")" - WHITESPACE@[63; 64) " " - BLOCK_EXPR@[64; 66) - BLOCK@[64; 66) - L_CURLY@[64; 65) "{" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 67) "\n" - R_CURLY@[67; 68) "}" - WHITESPACE@[68; 69) "\n" +SOURCE_FILE@0..69 + IMPL_DEF@0..68 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "S" + WHITESPACE@6..7 " " + ITEM_LIST@7..68 + L_CURLY@7..8 "{" + WHITESPACE@8..13 "\n " + FN_DEF@13..33 + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..17 + IDENT@16..17 "a" + PARAM_LIST@17..30 + L_PAREN@17..18 "(" + SELF_PARAM@18..29 + SELF_KW@18..22 "self" + COLON@22..23 ":" + WHITESPACE@23..24 " " + REFERENCE_TYPE@24..29 + AMP@24..25 "&" + PATH_TYPE@25..29 + PATH@25..29 + PATH_SEGMENT@25..29 + NAME_REF@25..29 + IDENT@25..29 "Self" + R_PAREN@29..30 ")" + WHITESPACE@30..31 " " + BLOCK_EXPR@31..33 + BLOCK@31..33 + L_CURLY@31..32 "{" + R_CURLY@32..33 "}" + WHITESPACE@33..38 "\n " + FN_DEF@38..66 + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + NAME@41..42 + IDENT@41..42 "b" + PARAM_LIST@42..63 + L_PAREN@42..43 "(" + SELF_PARAM@43..62 + MUT_KW@43..46 "mut" + WHITESPACE@46..47 " " + SELF_KW@47..51 "self" + COLON@51..52 ":" + WHITESPACE@52..53 " " + PATH_TYPE@53..62 + PATH@53..62 + PATH_SEGMENT@53..62 + NAME_REF@53..56 + IDENT@53..56 "Box" + TYPE_ARG_LIST@56..62 + L_ANGLE@56..57 "<" + TYPE_ARG@57..61 + PATH_TYPE@57..61 + PATH@57..61 + PATH_SEGMENT@57..61 + NAME_REF@57..61 + IDENT@57..61 "Self" + R_ANGLE@61..62 ">" + R_PAREN@62..63 ")" + WHITESPACE@63..64 " " + BLOCK_EXPR@64..66 + BLOCK@64..66 + L_CURLY@64..65 "{" + R_CURLY@65..66 "}" + WHITESPACE@66..67 "\n" + R_CURLY@67..68 "}" + WHITESPACE@68..69 "\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 5a42f360cf..ba422f1ae6 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 @@ -1,45 +1,45 @@ -SOURCE_FILE@[0; 44) - FN_DEF@[0; 43) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 43) - BLOCK@[9; 43) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 20) - PREFIX_EXPR@[15; 19) - STAR@[15; 16) "*" - PREFIX_EXPR@[16; 19) - STAR@[16; 17) "*" - REF_EXPR@[17; 19) - AMP@[17; 18) "&" - LITERAL@[18; 19) - INT_NUMBER@[18; 19) "1" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 25) "\n " - EXPR_STMT@[25; 32) - PREFIX_EXPR@[25; 31) - BANG@[25; 26) "!" - PREFIX_EXPR@[26; 31) - BANG@[26; 27) "!" - LITERAL@[27; 31) - TRUE_KW@[27; 31) "true" - SEMICOLON@[31; 32) ";" - WHITESPACE@[32; 37) "\n " - EXPR_STMT@[37; 41) - PREFIX_EXPR@[37; 40) - MINUS@[37; 38) "-" - PREFIX_EXPR@[38; 40) - MINUS@[38; 39) "-" - LITERAL@[39; 40) - INT_NUMBER@[39; 40) "1" - SEMICOLON@[40; 41) ";" - WHITESPACE@[41; 42) "\n" - R_CURLY@[42; 43) "}" - WHITESPACE@[43; 44) "\n" +SOURCE_FILE@0..44 + FN_DEF@0..43 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..43 + BLOCK@9..43 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..20 + PREFIX_EXPR@15..19 + STAR@15..16 "*" + PREFIX_EXPR@16..19 + STAR@16..17 "*" + REF_EXPR@17..19 + AMP@17..18 "&" + LITERAL@18..19 + INT_NUMBER@18..19 "1" + SEMICOLON@19..20 ";" + WHITESPACE@20..25 "\n " + EXPR_STMT@25..32 + PREFIX_EXPR@25..31 + BANG@25..26 "!" + PREFIX_EXPR@26..31 + BANG@26..27 "!" + LITERAL@27..31 + TRUE_KW@27..31 "true" + SEMICOLON@31..32 ";" + WHITESPACE@32..37 "\n " + EXPR_STMT@37..41 + PREFIX_EXPR@37..40 + MINUS@37..38 "-" + PREFIX_EXPR@38..40 + MINUS@38..39 "-" + LITERAL@39..40 + INT_NUMBER@39..40 "1" + SEMICOLON@40..41 ";" + WHITESPACE@41..42 "\n" + R_CURLY@42..43 "}" + 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 c1bedb37c5..9e898b7b9c 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 @@ -1,59 +1,59 @@ -SOURCE_FILE@[0; 60) - USE_ITEM@[0; 6) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 5) - STAR@[4; 5) "*" - SEMICOLON@[5; 6) ";" - WHITESPACE@[6; 7) "\n" - USE_ITEM@[7; 15) - USE_KW@[7; 10) "use" - WHITESPACE@[10; 11) " " - USE_TREE@[11; 14) - COLON2@[11; 13) "::" - STAR@[13; 14) "*" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" - USE_ITEM@[16; 36) - USE_KW@[16; 19) "use" - WHITESPACE@[19; 20) " " - USE_TREE@[20; 35) - PATH@[20; 30) - PATH@[20; 24) - PATH_SEGMENT@[20; 24) - NAME_REF@[20; 24) - IDENT@[20; 24) "some" - COLON2@[24; 26) "::" - PATH_SEGMENT@[26; 30) - NAME_REF@[26; 30) - IDENT@[26; 30) "path" - COLON2@[30; 32) "::" - USE_TREE_LIST@[32; 35) - L_CURLY@[32; 33) "{" - USE_TREE@[33; 34) - STAR@[33; 34) "*" - R_CURLY@[34; 35) "}" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 37) "\n" - USE_ITEM@[37; 59) - USE_KW@[37; 40) "use" - WHITESPACE@[40; 41) " " - USE_TREE@[41; 58) - PATH@[41; 51) - PATH@[41; 45) - PATH_SEGMENT@[41; 45) - NAME_REF@[41; 45) - IDENT@[41; 45) "some" - COLON2@[45; 47) "::" - PATH_SEGMENT@[47; 51) - NAME_REF@[47; 51) - IDENT@[47; 51) "path" - COLON2@[51; 53) "::" - USE_TREE_LIST@[53; 58) - L_CURLY@[53; 54) "{" - USE_TREE@[54; 57) - COLON2@[54; 56) "::" - STAR@[56; 57) "*" - R_CURLY@[57; 58) "}" - SEMICOLON@[58; 59) ";" - WHITESPACE@[59; 60) "\n" +SOURCE_FILE@0..60 + USE_ITEM@0..6 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..5 + STAR@4..5 "*" + SEMICOLON@5..6 ";" + WHITESPACE@6..7 "\n" + USE_ITEM@7..15 + USE_KW@7..10 "use" + WHITESPACE@10..11 " " + USE_TREE@11..14 + COLON2@11..13 "::" + STAR@13..14 "*" + SEMICOLON@14..15 ";" + WHITESPACE@15..16 "\n" + USE_ITEM@16..36 + USE_KW@16..19 "use" + WHITESPACE@19..20 " " + USE_TREE@20..35 + PATH@20..30 + PATH@20..24 + PATH_SEGMENT@20..24 + NAME_REF@20..24 + IDENT@20..24 "some" + COLON2@24..26 "::" + PATH_SEGMENT@26..30 + NAME_REF@26..30 + IDENT@26..30 "path" + COLON2@30..32 "::" + USE_TREE_LIST@32..35 + L_CURLY@32..33 "{" + USE_TREE@33..34 + STAR@33..34 "*" + R_CURLY@34..35 "}" + SEMICOLON@35..36 ";" + WHITESPACE@36..37 "\n" + USE_ITEM@37..59 + USE_KW@37..40 "use" + WHITESPACE@40..41 " " + USE_TREE@41..58 + PATH@41..51 + PATH@41..45 + PATH_SEGMENT@41..45 + NAME_REF@41..45 + IDENT@41..45 "some" + COLON2@45..47 "::" + PATH_SEGMENT@47..51 + NAME_REF@47..51 + IDENT@47..51 "path" + COLON2@51..53 "::" + USE_TREE_LIST@53..58 + L_CURLY@53..54 "{" + USE_TREE@54..57 + COLON2@54..56 "::" + STAR@56..57 "*" + R_CURLY@57..58 "}" + SEMICOLON@58..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 767a49ce6a..de22b22dd7 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 @@ -1,80 +1,80 @@ -SOURCE_FILE@[0; 89) - IMPL_DEF@[0; 88) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "F" - WHITESPACE@[6; 7) " " - ITEM_LIST@[7; 88) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 13) "\n " - TYPE_ALIAS_DEF@[13; 26) - TYPE_KW@[13; 17) "type" - WHITESPACE@[17; 18) " " - NAME@[18; 19) - IDENT@[18; 19) "A" - WHITESPACE@[19; 20) " " - EQ@[20; 21) "=" - WHITESPACE@[21; 22) " " - PATH_TYPE@[22; 25) - PATH@[22; 25) - PATH_SEGMENT@[22; 25) - NAME_REF@[22; 25) - IDENT@[22; 25) "i32" - SEMICOLON@[25; 26) ";" - WHITESPACE@[26; 31) "\n " - CONST_DEF@[31; 49) - CONST_KW@[31; 36) "const" - WHITESPACE@[36; 37) " " - NAME@[37; 38) - IDENT@[37; 38) "B" - COLON@[38; 39) ":" - WHITESPACE@[39; 40) " " - PATH_TYPE@[40; 43) - PATH@[40; 43) - PATH_SEGMENT@[40; 43) - NAME_REF@[40; 43) - IDENT@[40; 43) "i32" - WHITESPACE@[43; 44) " " - EQ@[44; 45) "=" - WHITESPACE@[45; 46) " " - LITERAL@[46; 48) - INT_NUMBER@[46; 48) "92" - SEMICOLON@[48; 49) ";" - WHITESPACE@[49; 54) "\n " - FN_DEF@[54; 65) - FN_KW@[54; 56) "fn" - WHITESPACE@[56; 57) " " - NAME@[57; 60) - IDENT@[57; 60) "foo" - PARAM_LIST@[60; 62) - L_PAREN@[60; 61) "(" - R_PAREN@[61; 62) ")" - WHITESPACE@[62; 63) " " - BLOCK_EXPR@[63; 65) - BLOCK@[63; 65) - L_CURLY@[63; 64) "{" - R_CURLY@[64; 65) "}" - WHITESPACE@[65; 70) "\n " - FN_DEF@[70; 86) - FN_KW@[70; 72) "fn" - WHITESPACE@[72; 73) " " - NAME@[73; 76) - IDENT@[73; 76) "bar" - PARAM_LIST@[76; 83) - L_PAREN@[76; 77) "(" - SELF_PARAM@[77; 82) - AMP@[77; 78) "&" - SELF_KW@[78; 82) "self" - R_PAREN@[82; 83) ")" - WHITESPACE@[83; 84) " " - BLOCK_EXPR@[84; 86) - BLOCK@[84; 86) - L_CURLY@[84; 85) "{" - R_CURLY@[85; 86) "}" - WHITESPACE@[86; 87) "\n" - R_CURLY@[87; 88) "}" - WHITESPACE@[88; 89) "\n" +SOURCE_FILE@0..89 + IMPL_DEF@0..88 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "F" + WHITESPACE@6..7 " " + ITEM_LIST@7..88 + L_CURLY@7..8 "{" + WHITESPACE@8..13 "\n " + TYPE_ALIAS_DEF@13..26 + TYPE_KW@13..17 "type" + WHITESPACE@17..18 " " + NAME@18..19 + IDENT@18..19 "A" + WHITESPACE@19..20 " " + EQ@20..21 "=" + WHITESPACE@21..22 " " + PATH_TYPE@22..25 + PATH@22..25 + PATH_SEGMENT@22..25 + NAME_REF@22..25 + IDENT@22..25 "i32" + SEMICOLON@25..26 ";" + WHITESPACE@26..31 "\n " + CONST_DEF@31..49 + CONST_KW@31..36 "const" + WHITESPACE@36..37 " " + NAME@37..38 + IDENT@37..38 "B" + COLON@38..39 ":" + WHITESPACE@39..40 " " + PATH_TYPE@40..43 + PATH@40..43 + PATH_SEGMENT@40..43 + NAME_REF@40..43 + IDENT@40..43 "i32" + WHITESPACE@43..44 " " + EQ@44..45 "=" + WHITESPACE@45..46 " " + LITERAL@46..48 + INT_NUMBER@46..48 "92" + SEMICOLON@48..49 ";" + WHITESPACE@49..54 "\n " + FN_DEF@54..65 + FN_KW@54..56 "fn" + WHITESPACE@56..57 " " + NAME@57..60 + IDENT@57..60 "foo" + PARAM_LIST@60..62 + L_PAREN@60..61 "(" + R_PAREN@61..62 ")" + WHITESPACE@62..63 " " + BLOCK_EXPR@63..65 + BLOCK@63..65 + L_CURLY@63..64 "{" + R_CURLY@64..65 "}" + WHITESPACE@65..70 "\n " + FN_DEF@70..86 + FN_KW@70..72 "fn" + WHITESPACE@72..73 " " + NAME@73..76 + IDENT@73..76 "bar" + PARAM_LIST@76..83 + L_PAREN@76..77 "(" + SELF_PARAM@77..82 + AMP@77..78 "&" + SELF_KW@78..82 "self" + R_PAREN@82..83 ")" + WHITESPACE@83..84 " " + BLOCK_EXPR@84..86 + BLOCK@84..86 + L_CURLY@84..85 "{" + R_CURLY@85..86 "}" + WHITESPACE@86..87 "\n" + R_CURLY@87..88 "}" + WHITESPACE@88..89 "\n" 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 e0fc96d336..1b810607ed 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 @@ -1,53 +1,53 @@ -SOURCE_FILE@[0; 81) - STRUCT_DEF@[0; 20) - VISIBILITY@[0; 10) - PUB_KW@[0; 3) "pub" - L_PAREN@[3; 4) "(" - CRATE_KW@[4; 9) "crate" - R_PAREN@[9; 10) ")" - WHITESPACE@[10; 11) " " - STRUCT_KW@[11; 17) "struct" - WHITESPACE@[17; 18) " " - NAME@[18; 19) - IDENT@[18; 19) "S" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 21) "\n" - STRUCT_DEF@[21; 40) - VISIBILITY@[21; 30) - PUB_KW@[21; 24) "pub" - L_PAREN@[24; 25) "(" - SELF_KW@[25; 29) "self" - R_PAREN@[29; 30) ")" - WHITESPACE@[30; 31) " " - STRUCT_KW@[31; 37) "struct" - WHITESPACE@[37; 38) " " - NAME@[38; 39) - IDENT@[38; 39) "S" - SEMICOLON@[39; 40) ";" - WHITESPACE@[40; 41) "\n" - STRUCT_DEF@[41; 60) - VISIBILITY@[41; 50) - PUB_KW@[41; 44) "pub" - L_PAREN@[44; 45) "(" - SELF_KW@[45; 49) "self" - R_PAREN@[49; 50) ")" - WHITESPACE@[50; 51) " " - STRUCT_KW@[51; 57) "struct" - WHITESPACE@[57; 58) " " - NAME@[58; 59) - IDENT@[58; 59) "S" - SEMICOLON@[59; 60) ";" - WHITESPACE@[60; 61) "\n" - STRUCT_DEF@[61; 80) - VISIBILITY@[61; 70) - PUB_KW@[61; 64) "pub" - L_PAREN@[64; 65) "(" - SELF_KW@[65; 69) "self" - R_PAREN@[69; 70) ")" - WHITESPACE@[70; 71) " " - STRUCT_KW@[71; 77) "struct" - WHITESPACE@[77; 78) " " - NAME@[78; 79) - IDENT@[78; 79) "S" - SEMICOLON@[79; 80) ";" - WHITESPACE@[80; 81) "\n" +SOURCE_FILE@0..81 + STRUCT_DEF@0..20 + VISIBILITY@0..10 + PUB_KW@0..3 "pub" + L_PAREN@3..4 "(" + CRATE_KW@4..9 "crate" + R_PAREN@9..10 ")" + WHITESPACE@10..11 " " + STRUCT_KW@11..17 "struct" + WHITESPACE@17..18 " " + NAME@18..19 + IDENT@18..19 "S" + SEMICOLON@19..20 ";" + WHITESPACE@20..21 "\n" + STRUCT_DEF@21..40 + VISIBILITY@21..30 + PUB_KW@21..24 "pub" + L_PAREN@24..25 "(" + SELF_KW@25..29 "self" + R_PAREN@29..30 ")" + WHITESPACE@30..31 " " + STRUCT_KW@31..37 "struct" + WHITESPACE@37..38 " " + NAME@38..39 + IDENT@38..39 "S" + SEMICOLON@39..40 ";" + WHITESPACE@40..41 "\n" + STRUCT_DEF@41..60 + VISIBILITY@41..50 + PUB_KW@41..44 "pub" + L_PAREN@44..45 "(" + SELF_KW@45..49 "self" + R_PAREN@49..50 ")" + WHITESPACE@50..51 " " + STRUCT_KW@51..57 "struct" + WHITESPACE@57..58 " " + NAME@58..59 + IDENT@58..59 "S" + SEMICOLON@59..60 ";" + WHITESPACE@60..61 "\n" + STRUCT_DEF@61..80 + VISIBILITY@61..70 + PUB_KW@61..64 "pub" + L_PAREN@64..65 "(" + SELF_KW@65..69 "self" + R_PAREN@69..70 ")" + WHITESPACE@70..71 " " + STRUCT_KW@71..77 "struct" + WHITESPACE@77..78 " " + NAME@78..79 + IDENT@78..79 "S" + SEMICOLON@79..80 ";" + 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 b7acc3f076..17687617bb 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 @@ -1,13 +1,13 @@ -SOURCE_FILE@[0; 22) - TYPE_ALIAS_DEF@[0; 21) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 16) - IDENT@[5; 16) "Placeholder" - WHITESPACE@[16; 17) " " - EQ@[17; 18) "=" - WHITESPACE@[18; 19) " " - PLACEHOLDER_TYPE@[19; 20) - UNDERSCORE@[19; 20) "_" - SEMICOLON@[20; 21) ";" - WHITESPACE@[21; 22) "\n" +SOURCE_FILE@0..22 + TYPE_ALIAS_DEF@0..21 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..16 + IDENT@5..16 "Placeholder" + WHITESPACE@16..17 " " + EQ@17..18 "=" + WHITESPACE@18..19 " " + PLACEHOLDER_TYPE@19..20 + UNDERSCORE@19..20 "_" + SEMICOLON@20..21 ";" + 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 430e4a999e..7da292a2d7 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 @@ -1,42 +1,42 @@ -SOURCE_FILE@[0; 39) - FN_DEF@[0; 38) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 38) - BLOCK@[10; 38) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 36) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - SLICE_PAT@[20; 30) - L_BRACK@[20; 21) "[" - BIND_PAT@[21; 22) - NAME@[21; 22) - IDENT@[21; 22) "a" - COMMA@[22; 23) "," - WHITESPACE@[23; 24) " " - BIND_PAT@[24; 25) - NAME@[24; 25) - IDENT@[24; 25) "b" - COMMA@[25; 26) "," - WHITESPACE@[26; 27) " " - DOT_DOT_PAT@[27; 29) - DOT2@[27; 29) ".." - R_BRACK@[29; 30) "]" - WHITESPACE@[30; 31) " " - EQ@[31; 32) "=" - WHITESPACE@[32; 33) " " - ARRAY_EXPR@[33; 35) - L_BRACK@[33; 34) "[" - R_BRACK@[34; 35) "]" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 37) "\n" - R_CURLY@[37; 38) "}" - WHITESPACE@[38; 39) "\n" +SOURCE_FILE@0..39 + FN_DEF@0..38 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..38 + BLOCK@10..38 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..36 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + SLICE_PAT@20..30 + L_BRACK@20..21 "[" + BIND_PAT@21..22 + NAME@21..22 + IDENT@21..22 "a" + COMMA@22..23 "," + WHITESPACE@23..24 " " + BIND_PAT@24..25 + NAME@24..25 + IDENT@24..25 "b" + COMMA@25..26 "," + WHITESPACE@26..27 " " + DOT_DOT_PAT@27..29 + DOT2@27..29 ".." + R_BRACK@29..30 "]" + WHITESPACE@30..31 " " + EQ@31..32 "=" + WHITESPACE@32..33 " " + ARRAY_EXPR@33..35 + L_BRACK@33..34 "[" + R_BRACK@34..35 "]" + SEMICOLON@35..36 ";" + WHITESPACE@36..37 "\n" + R_CURLY@37..38 "}" + 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 4eee1e7f1d..0a6d77f452 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 @@ -1,17 +1,17 @@ -SOURCE_FILE@[0; 15) - TYPE_ALIAS_DEF@[0; 14) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - SLICE_TYPE@[9; 13) - L_BRACK@[9; 10) "[" - TUPLE_TYPE@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - R_BRACK@[12; 13) "]" - SEMICOLON@[13; 14) ";" - WHITESPACE@[14; 15) "\n" +SOURCE_FILE@0..15 + TYPE_ALIAS_DEF@0..14 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + SLICE_TYPE@9..13 + L_BRACK@9..10 "[" + TUPLE_TYPE@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + R_BRACK@12..13 "]" + SEMICOLON@13..14 ";" + 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 d8d82dacc5..574942f067 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 @@ -1,105 +1,105 @@ -SOURCE_FILE@[0; 97) - FN_DEF@[0; 96) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 96) - BLOCK@[9; 96) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 28) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - TUPLE_STRUCT_PAT@[19; 22) - PATH@[19; 20) - PATH_SEGMENT@[19; 20) - NAME_REF@[19; 20) - IDENT@[19; 20) "S" - L_PAREN@[20; 21) "(" - R_PAREN@[21; 22) ")" - WHITESPACE@[22; 23) " " - EQ@[23; 24) "=" - WHITESPACE@[24; 25) " " - TUPLE_EXPR@[25; 27) - L_PAREN@[25; 26) "(" - R_PAREN@[26; 27) ")" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 33) "\n " - LET_STMT@[33; 47) - LET_KW@[33; 36) "let" - WHITESPACE@[36; 37) " " - TUPLE_STRUCT_PAT@[37; 41) - PATH@[37; 38) - PATH_SEGMENT@[37; 38) - NAME_REF@[37; 38) - IDENT@[37; 38) "S" - L_PAREN@[38; 39) "(" - PLACEHOLDER_PAT@[39; 40) - UNDERSCORE@[39; 40) "_" - R_PAREN@[40; 41) ")" - WHITESPACE@[41; 42) " " - EQ@[42; 43) "=" - WHITESPACE@[43; 44) " " - TUPLE_EXPR@[44; 46) - L_PAREN@[44; 45) "(" - R_PAREN@[45; 46) ")" - SEMICOLON@[46; 47) ";" - WHITESPACE@[47; 52) "\n " - LET_STMT@[52; 67) - LET_KW@[52; 55) "let" - WHITESPACE@[55; 56) " " - TUPLE_STRUCT_PAT@[56; 61) - PATH@[56; 57) - PATH_SEGMENT@[56; 57) - NAME_REF@[56; 57) - IDENT@[56; 57) "S" - L_PAREN@[57; 58) "(" - PLACEHOLDER_PAT@[58; 59) - UNDERSCORE@[58; 59) "_" - COMMA@[59; 60) "," - R_PAREN@[60; 61) ")" - WHITESPACE@[61; 62) " " - EQ@[62; 63) "=" - WHITESPACE@[63; 64) " " - TUPLE_EXPR@[64; 66) - L_PAREN@[64; 65) "(" - R_PAREN@[65; 66) ")" - SEMICOLON@[66; 67) ";" - WHITESPACE@[67; 72) "\n " - LET_STMT@[72; 94) - LET_KW@[72; 75) "let" - WHITESPACE@[75; 76) " " - TUPLE_STRUCT_PAT@[76; 88) - PATH@[76; 77) - PATH_SEGMENT@[76; 77) - NAME_REF@[76; 77) - IDENT@[76; 77) "S" - L_PAREN@[77; 78) "(" - PLACEHOLDER_PAT@[78; 79) - UNDERSCORE@[78; 79) "_" - COMMA@[79; 80) "," - WHITESPACE@[80; 81) " " - DOT_DOT_PAT@[81; 83) - DOT2@[81; 83) ".." - WHITESPACE@[83; 84) " " - COMMA@[84; 85) "," - WHITESPACE@[85; 86) " " - BIND_PAT@[86; 87) - NAME@[86; 87) - IDENT@[86; 87) "x" - R_PAREN@[87; 88) ")" - WHITESPACE@[88; 89) " " - EQ@[89; 90) "=" - WHITESPACE@[90; 91) " " - TUPLE_EXPR@[91; 93) - L_PAREN@[91; 92) "(" - R_PAREN@[92; 93) ")" - SEMICOLON@[93; 94) ";" - WHITESPACE@[94; 95) "\n" - R_CURLY@[95; 96) "}" - WHITESPACE@[96; 97) "\n" +SOURCE_FILE@0..97 + FN_DEF@0..96 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..96 + BLOCK@9..96 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..28 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + TUPLE_STRUCT_PAT@19..22 + PATH@19..20 + PATH_SEGMENT@19..20 + NAME_REF@19..20 + IDENT@19..20 "S" + L_PAREN@20..21 "(" + R_PAREN@21..22 ")" + WHITESPACE@22..23 " " + EQ@23..24 "=" + WHITESPACE@24..25 " " + TUPLE_EXPR@25..27 + L_PAREN@25..26 "(" + R_PAREN@26..27 ")" + SEMICOLON@27..28 ";" + WHITESPACE@28..33 "\n " + LET_STMT@33..47 + LET_KW@33..36 "let" + WHITESPACE@36..37 " " + TUPLE_STRUCT_PAT@37..41 + PATH@37..38 + PATH_SEGMENT@37..38 + NAME_REF@37..38 + IDENT@37..38 "S" + L_PAREN@38..39 "(" + PLACEHOLDER_PAT@39..40 + UNDERSCORE@39..40 "_" + R_PAREN@40..41 ")" + WHITESPACE@41..42 " " + EQ@42..43 "=" + WHITESPACE@43..44 " " + TUPLE_EXPR@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + SEMICOLON@46..47 ";" + WHITESPACE@47..52 "\n " + LET_STMT@52..67 + LET_KW@52..55 "let" + WHITESPACE@55..56 " " + TUPLE_STRUCT_PAT@56..61 + PATH@56..57 + PATH_SEGMENT@56..57 + NAME_REF@56..57 + IDENT@56..57 "S" + L_PAREN@57..58 "(" + PLACEHOLDER_PAT@58..59 + UNDERSCORE@58..59 "_" + COMMA@59..60 "," + R_PAREN@60..61 ")" + WHITESPACE@61..62 " " + EQ@62..63 "=" + WHITESPACE@63..64 " " + TUPLE_EXPR@64..66 + L_PAREN@64..65 "(" + R_PAREN@65..66 ")" + SEMICOLON@66..67 ";" + WHITESPACE@67..72 "\n " + LET_STMT@72..94 + LET_KW@72..75 "let" + WHITESPACE@75..76 " " + TUPLE_STRUCT_PAT@76..88 + PATH@76..77 + PATH_SEGMENT@76..77 + NAME_REF@76..77 + IDENT@76..77 "S" + L_PAREN@77..78 "(" + PLACEHOLDER_PAT@78..79 + UNDERSCORE@78..79 "_" + COMMA@79..80 "," + WHITESPACE@80..81 " " + DOT_DOT_PAT@81..83 + DOT2@81..83 ".." + WHITESPACE@83..84 " " + COMMA@84..85 "," + WHITESPACE@85..86 " " + BIND_PAT@86..87 + NAME@86..87 + IDENT@86..87 "x" + R_PAREN@87..88 ")" + WHITESPACE@88..89 " " + EQ@89..90 "=" + WHITESPACE@90..91 " " + TUPLE_EXPR@91..93 + L_PAREN@91..92 "(" + R_PAREN@92..93 ")" + SEMICOLON@93..94 ";" + WHITESPACE@94..95 "\n" + R_CURLY@95..96 "}" + 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 ac6ab31f28..1927438bbe 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 @@ -1,50 +1,50 @@ -SOURCE_FILE@[0; 52) - FN_DEF@[0; 51) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 51) - BLOCK@[10; 51) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 28) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - REF_PAT@[20; 22) - AMP@[20; 21) "&" - BIND_PAT@[21; 22) - NAME@[21; 22) - IDENT@[21; 22) "a" - WHITESPACE@[22; 23) " " - EQ@[23; 24) "=" - WHITESPACE@[24; 25) " " - TUPLE_EXPR@[25; 27) - L_PAREN@[25; 26) "(" - R_PAREN@[26; 27) ")" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 33) "\n " - LET_STMT@[33; 49) - LET_KW@[33; 36) "let" - WHITESPACE@[36; 37) " " - REF_PAT@[37; 43) - AMP@[37; 38) "&" - MUT_KW@[38; 41) "mut" - WHITESPACE@[41; 42) " " - BIND_PAT@[42; 43) - NAME@[42; 43) - IDENT@[42; 43) "b" - WHITESPACE@[43; 44) " " - EQ@[44; 45) "=" - WHITESPACE@[45; 46) " " - TUPLE_EXPR@[46; 48) - L_PAREN@[46; 47) "(" - R_PAREN@[47; 48) ")" - SEMICOLON@[48; 49) ";" - WHITESPACE@[49; 50) "\n" - R_CURLY@[50; 51) "}" - WHITESPACE@[51; 52) "\n" +SOURCE_FILE@0..52 + FN_DEF@0..51 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..51 + BLOCK@10..51 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..28 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + REF_PAT@20..22 + AMP@20..21 "&" + BIND_PAT@21..22 + NAME@21..22 + IDENT@21..22 "a" + WHITESPACE@22..23 " " + EQ@23..24 "=" + WHITESPACE@24..25 " " + TUPLE_EXPR@25..27 + L_PAREN@25..26 "(" + R_PAREN@26..27 ")" + SEMICOLON@27..28 ";" + WHITESPACE@28..33 "\n " + LET_STMT@33..49 + LET_KW@33..36 "let" + WHITESPACE@36..37 " " + REF_PAT@37..43 + AMP@37..38 "&" + MUT_KW@38..41 "mut" + WHITESPACE@41..42 " " + BIND_PAT@42..43 + NAME@42..43 + IDENT@42..43 "b" + WHITESPACE@43..44 " " + EQ@44..45 "=" + WHITESPACE@45..46 " " + TUPLE_EXPR@46..48 + L_PAREN@46..47 "(" + R_PAREN@47..48 ")" + SEMICOLON@48..49 ";" + WHITESPACE@49..50 "\n" + R_CURLY@50..51 "}" + 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 3371cab829..93f5c738c2 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 @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 43) - TYPE_ALIAS_DEF@[0; 42) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - IMPL_TRAIT_TYPE@[9; 41) - IMPL_KW@[9; 13) "impl" - WHITESPACE@[13; 14) " " - TYPE_BOUND_LIST@[14; 41) - TYPE_BOUND@[14; 36) - PATH_TYPE@[14; 36) - PATH@[14; 36) - PATH_SEGMENT@[14; 36) - NAME_REF@[14; 22) - IDENT@[14; 22) "Iterator" - TYPE_ARG_LIST@[22; 36) - L_ANGLE@[22; 23) "<" - ASSOC_TYPE_ARG@[23; 35) - NAME_REF@[23; 27) - IDENT@[23; 27) "Item" - EQ@[27; 28) "=" - PATH_TYPE@[28; 35) - PATH@[28; 35) - PATH_SEGMENT@[28; 35) - NAME_REF@[28; 31) - IDENT@[28; 31) "Foo" - TYPE_ARG_LIST@[31; 35) - L_ANGLE@[31; 32) "<" - LIFETIME_ARG@[32; 34) - LIFETIME@[32; 34) "\'a" - R_ANGLE@[34; 35) ">" - R_ANGLE@[35; 36) ">" - WHITESPACE@[36; 37) " " - PLUS@[37; 38) "+" - WHITESPACE@[38; 39) " " - TYPE_BOUND@[39; 41) - LIFETIME@[39; 41) "\'a" - SEMICOLON@[41; 42) ";" - WHITESPACE@[42; 43) "\n" +SOURCE_FILE@0..43 + TYPE_ALIAS_DEF@0..42 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + IMPL_TRAIT_TYPE@9..41 + IMPL_KW@9..13 "impl" + WHITESPACE@13..14 " " + TYPE_BOUND_LIST@14..41 + TYPE_BOUND@14..36 + PATH_TYPE@14..36 + PATH@14..36 + PATH_SEGMENT@14..36 + NAME_REF@14..22 + IDENT@14..22 "Iterator" + TYPE_ARG_LIST@22..36 + L_ANGLE@22..23 "<" + ASSOC_TYPE_ARG@23..35 + NAME_REF@23..27 + IDENT@23..27 "Item" + EQ@27..28 "=" + PATH_TYPE@28..35 + PATH@28..35 + PATH_SEGMENT@28..35 + NAME_REF@28..31 + IDENT@28..31 "Foo" + TYPE_ARG_LIST@31..35 + L_ANGLE@31..32 "<" + LIFETIME_ARG@32..34 + LIFETIME@32..34 "\'a" + R_ANGLE@34..35 ">" + R_ANGLE@35..36 ">" + WHITESPACE@36..37 " " + PLUS@37..38 "+" + WHITESPACE@38..39 " " + TYPE_BOUND@39..41 + LIFETIME@39..41 "\'a" + SEMICOLON@41..42 ";" + 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 e9ca214bb8..9effb345fd 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 @@ -1,90 +1,90 @@ -SOURCE_FILE@[0; 89) - FN_DEF@[0; 88) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 88) - BLOCK@[9; 88) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 25) - CAST_EXPR@[15; 24) - LITERAL@[15; 17) - INT_NUMBER@[15; 17) "82" - WHITESPACE@[17; 18) " " - AS_KW@[18; 20) "as" - WHITESPACE@[20; 21) " " - PATH_TYPE@[21; 24) - PATH@[21; 24) - PATH_SEGMENT@[21; 24) - NAME_REF@[21; 24) - IDENT@[21; 24) "i32" - SEMICOLON@[24; 25) ";" - WHITESPACE@[25; 30) "\n " - EXPR_STMT@[30; 43) - BIN_EXPR@[30; 42) - CAST_EXPR@[30; 38) - LITERAL@[30; 32) - INT_NUMBER@[30; 32) "81" - WHITESPACE@[32; 33) " " - AS_KW@[33; 35) "as" - WHITESPACE@[35; 36) " " - PATH_TYPE@[36; 38) - PATH@[36; 38) - PATH_SEGMENT@[36; 38) - NAME_REF@[36; 38) - IDENT@[36; 38) "i8" - WHITESPACE@[38; 39) " " - PLUS@[39; 40) "+" - WHITESPACE@[40; 41) " " - LITERAL@[41; 42) - INT_NUMBER@[41; 42) "1" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 48) "\n " - EXPR_STMT@[48; 62) - BIN_EXPR@[48; 61) - CAST_EXPR@[48; 57) - LITERAL@[48; 50) - INT_NUMBER@[48; 50) "79" - WHITESPACE@[50; 51) " " - AS_KW@[51; 53) "as" - WHITESPACE@[53; 54) " " - PATH_TYPE@[54; 57) - PATH@[54; 57) - PATH_SEGMENT@[54; 57) - NAME_REF@[54; 57) - IDENT@[54; 57) "i16" - WHITESPACE@[57; 58) " " - MINUS@[58; 59) "-" - WHITESPACE@[59; 60) " " - LITERAL@[60; 61) - INT_NUMBER@[60; 61) "1" - SEMICOLON@[61; 62) ";" - WHITESPACE@[62; 67) "\n " - EXPR_STMT@[67; 86) - BIN_EXPR@[67; 85) - CAST_EXPR@[67; 77) - LITERAL@[67; 71) - INT_NUMBER@[67; 71) "0x36" - WHITESPACE@[71; 72) " " - AS_KW@[72; 74) "as" - WHITESPACE@[74; 75) " " - PATH_TYPE@[75; 77) - PATH@[75; 77) - PATH_SEGMENT@[75; 77) - NAME_REF@[75; 77) - IDENT@[75; 77) "u8" - WHITESPACE@[77; 78) " " - LTEQ@[78; 80) "<=" - WHITESPACE@[80; 81) " " - LITERAL@[81; 85) - INT_NUMBER@[81; 85) "0x37" - SEMICOLON@[85; 86) ";" - WHITESPACE@[86; 87) "\n" - R_CURLY@[87; 88) "}" - WHITESPACE@[88; 89) "\n" +SOURCE_FILE@0..89 + FN_DEF@0..88 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..88 + BLOCK@9..88 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..25 + CAST_EXPR@15..24 + LITERAL@15..17 + INT_NUMBER@15..17 "82" + WHITESPACE@17..18 " " + AS_KW@18..20 "as" + WHITESPACE@20..21 " " + PATH_TYPE@21..24 + PATH@21..24 + PATH_SEGMENT@21..24 + NAME_REF@21..24 + IDENT@21..24 "i32" + SEMICOLON@24..25 ";" + WHITESPACE@25..30 "\n " + EXPR_STMT@30..43 + BIN_EXPR@30..42 + CAST_EXPR@30..38 + LITERAL@30..32 + INT_NUMBER@30..32 "81" + WHITESPACE@32..33 " " + AS_KW@33..35 "as" + WHITESPACE@35..36 " " + PATH_TYPE@36..38 + PATH@36..38 + PATH_SEGMENT@36..38 + NAME_REF@36..38 + IDENT@36..38 "i8" + WHITESPACE@38..39 " " + PLUS@39..40 "+" + WHITESPACE@40..41 " " + LITERAL@41..42 + INT_NUMBER@41..42 "1" + SEMICOLON@42..43 ";" + WHITESPACE@43..48 "\n " + EXPR_STMT@48..62 + BIN_EXPR@48..61 + CAST_EXPR@48..57 + LITERAL@48..50 + INT_NUMBER@48..50 "79" + WHITESPACE@50..51 " " + AS_KW@51..53 "as" + WHITESPACE@53..54 " " + PATH_TYPE@54..57 + PATH@54..57 + PATH_SEGMENT@54..57 + NAME_REF@54..57 + IDENT@54..57 "i16" + WHITESPACE@57..58 " " + MINUS@58..59 "-" + WHITESPACE@59..60 " " + LITERAL@60..61 + INT_NUMBER@60..61 "1" + SEMICOLON@61..62 ";" + WHITESPACE@62..67 "\n " + EXPR_STMT@67..86 + BIN_EXPR@67..85 + CAST_EXPR@67..77 + LITERAL@67..71 + INT_NUMBER@67..71 "0x36" + WHITESPACE@71..72 " " + AS_KW@72..74 "as" + WHITESPACE@74..75 " " + PATH_TYPE@75..77 + PATH@75..77 + PATH_SEGMENT@75..77 + NAME_REF@75..77 + IDENT@75..77 "u8" + WHITESPACE@77..78 " " + LTEQ@78..80 "<=" + WHITESPACE@80..81 " " + LITERAL@81..85 + INT_NUMBER@81..85 "0x37" + SEMICOLON@85..86 ";" + WHITESPACE@86..87 "\n" + R_CURLY@87..88 "}" + WHITESPACE@88..89 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast index 6fd49c7bc6..b6759541ef 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0030_cond.rast @@ -1,209 +1,209 @@ -SOURCE_FILE@[0; 197) - FN_DEF@[0; 37) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 37) - BLOCK@[9; 37) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) " " - IF_EXPR@[11; 35) - IF_KW@[11; 13) "if" - WHITESPACE@[13; 14) " " - CONDITION@[14; 32) - LET_KW@[14; 17) "let" - WHITESPACE@[17; 18) " " - TUPLE_STRUCT_PAT@[18; 25) - PATH@[18; 22) - PATH_SEGMENT@[18; 22) - NAME_REF@[18; 22) - IDENT@[18; 22) "Some" - L_PAREN@[22; 23) "(" - PLACEHOLDER_PAT@[23; 24) - UNDERSCORE@[23; 24) "_" - R_PAREN@[24; 25) ")" - WHITESPACE@[25; 26) " " - EQ@[26; 27) "=" - WHITESPACE@[27; 28) " " - PATH_EXPR@[28; 32) - PATH@[28; 32) - PATH_SEGMENT@[28; 32) - NAME_REF@[28; 32) - IDENT@[28; 32) "None" - WHITESPACE@[32; 33) " " - BLOCK_EXPR@[33; 35) - BLOCK@[33; 35) - L_CURLY@[33; 34) "{" - R_CURLY@[34; 35) "}" - WHITESPACE@[35; 36) " " - R_CURLY@[36; 37) "}" - WHITESPACE@[37; 38) "\n" - FN_DEF@[38; 196) - FN_KW@[38; 40) "fn" - WHITESPACE@[40; 41) " " - NAME@[41; 44) - IDENT@[41; 44) "bar" - PARAM_LIST@[44; 46) - L_PAREN@[44; 45) "(" - R_PAREN@[45; 46) ")" - WHITESPACE@[46; 47) " " - BLOCK_EXPR@[47; 196) - BLOCK@[47; 196) - L_CURLY@[47; 48) "{" - WHITESPACE@[48; 53) "\n " - EXPR_STMT@[53; 87) - IF_EXPR@[53; 87) - IF_KW@[53; 55) "if" - WHITESPACE@[55; 56) " " - CONDITION@[56; 84) - LET_KW@[56; 59) "let" - WHITESPACE@[59; 60) " " - OR_PAT@[60; 77) - TUPLE_STRUCT_PAT@[60; 67) - PATH@[60; 64) - PATH_SEGMENT@[60; 64) - NAME_REF@[60; 64) - IDENT@[60; 64) "Some" - L_PAREN@[64; 65) "(" - PLACEHOLDER_PAT@[65; 66) - UNDERSCORE@[65; 66) "_" - R_PAREN@[66; 67) ")" - WHITESPACE@[67; 68) " " - PIPE@[68; 69) "|" - WHITESPACE@[69; 70) " " - TUPLE_STRUCT_PAT@[70; 77) - PATH@[70; 74) - PATH_SEGMENT@[70; 74) - NAME_REF@[70; 74) - IDENT@[70; 74) "Some" - L_PAREN@[74; 75) "(" - PLACEHOLDER_PAT@[75; 76) - UNDERSCORE@[75; 76) "_" - R_PAREN@[76; 77) ")" - WHITESPACE@[77; 78) " " - EQ@[78; 79) "=" - WHITESPACE@[79; 80) " " - PATH_EXPR@[80; 84) - PATH@[80; 84) - PATH_SEGMENT@[80; 84) - NAME_REF@[80; 84) - IDENT@[80; 84) "None" - WHITESPACE@[84; 85) " " - BLOCK_EXPR@[85; 87) - BLOCK@[85; 87) - L_CURLY@[85; 86) "{" - R_CURLY@[86; 87) "}" - WHITESPACE@[87; 92) "\n " - EXPR_STMT@[92; 118) - IF_EXPR@[92; 118) - IF_KW@[92; 94) "if" - WHITESPACE@[94; 95) " " - CONDITION@[95; 115) - LET_KW@[95; 98) "let" - WHITESPACE@[98; 99) " " - PIPE@[99; 100) "|" - WHITESPACE@[100; 101) " " - TUPLE_STRUCT_PAT@[101; 108) - PATH@[101; 105) - PATH_SEGMENT@[101; 105) - NAME_REF@[101; 105) - IDENT@[101; 105) "Some" - L_PAREN@[105; 106) "(" - PLACEHOLDER_PAT@[106; 107) - UNDERSCORE@[106; 107) "_" - R_PAREN@[107; 108) ")" - WHITESPACE@[108; 109) " " - EQ@[109; 110) "=" - WHITESPACE@[110; 111) " " - PATH_EXPR@[111; 115) - PATH@[111; 115) - PATH_SEGMENT@[111; 115) - NAME_REF@[111; 115) - IDENT@[111; 115) "None" - WHITESPACE@[115; 116) " " - BLOCK_EXPR@[116; 118) - BLOCK@[116; 118) - L_CURLY@[116; 117) "{" - R_CURLY@[117; 118) "}" - WHITESPACE@[118; 123) "\n " - EXPR_STMT@[123; 160) - WHILE_EXPR@[123; 160) - WHILE_KW@[123; 128) "while" - WHITESPACE@[128; 129) " " - CONDITION@[129; 157) - LET_KW@[129; 132) "let" - WHITESPACE@[132; 133) " " - OR_PAT@[133; 150) - TUPLE_STRUCT_PAT@[133; 140) - PATH@[133; 137) - PATH_SEGMENT@[133; 137) - NAME_REF@[133; 137) - IDENT@[133; 137) "Some" - L_PAREN@[137; 138) "(" - PLACEHOLDER_PAT@[138; 139) - UNDERSCORE@[138; 139) "_" - R_PAREN@[139; 140) ")" - WHITESPACE@[140; 141) " " - PIPE@[141; 142) "|" - WHITESPACE@[142; 143) " " - TUPLE_STRUCT_PAT@[143; 150) - PATH@[143; 147) - PATH_SEGMENT@[143; 147) - NAME_REF@[143; 147) - IDENT@[143; 147) "Some" - L_PAREN@[147; 148) "(" - PLACEHOLDER_PAT@[148; 149) - UNDERSCORE@[148; 149) "_" - R_PAREN@[149; 150) ")" - WHITESPACE@[150; 151) " " - EQ@[151; 152) "=" - WHITESPACE@[152; 153) " " - PATH_EXPR@[153; 157) - PATH@[153; 157) - PATH_SEGMENT@[153; 157) - NAME_REF@[153; 157) - IDENT@[153; 157) "None" - WHITESPACE@[157; 158) " " - BLOCK_EXPR@[158; 160) - BLOCK@[158; 160) - L_CURLY@[158; 159) "{" - R_CURLY@[159; 160) "}" - WHITESPACE@[160; 165) "\n " - WHILE_EXPR@[165; 194) - WHILE_KW@[165; 170) "while" - WHITESPACE@[170; 171) " " - CONDITION@[171; 191) - LET_KW@[171; 174) "let" - WHITESPACE@[174; 175) " " - PIPE@[175; 176) "|" - WHITESPACE@[176; 177) " " - TUPLE_STRUCT_PAT@[177; 184) - PATH@[177; 181) - PATH_SEGMENT@[177; 181) - NAME_REF@[177; 181) - IDENT@[177; 181) "Some" - L_PAREN@[181; 182) "(" - PLACEHOLDER_PAT@[182; 183) - UNDERSCORE@[182; 183) "_" - R_PAREN@[183; 184) ")" - WHITESPACE@[184; 185) " " - EQ@[185; 186) "=" - WHITESPACE@[186; 187) " " - PATH_EXPR@[187; 191) - PATH@[187; 191) - PATH_SEGMENT@[187; 191) - NAME_REF@[187; 191) - IDENT@[187; 191) "None" - WHITESPACE@[191; 192) " " - BLOCK_EXPR@[192; 194) - BLOCK@[192; 194) - L_CURLY@[192; 193) "{" - R_CURLY@[193; 194) "}" - WHITESPACE@[194; 195) "\n" - R_CURLY@[195; 196) "}" - WHITESPACE@[196; 197) "\n" +SOURCE_FILE@0..197 + FN_DEF@0..37 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..37 + BLOCK@9..37 + L_CURLY@9..10 "{" + WHITESPACE@10..11 " " + IF_EXPR@11..35 + IF_KW@11..13 "if" + WHITESPACE@13..14 " " + CONDITION@14..32 + LET_KW@14..17 "let" + WHITESPACE@17..18 " " + TUPLE_STRUCT_PAT@18..25 + PATH@18..22 + PATH_SEGMENT@18..22 + NAME_REF@18..22 + IDENT@18..22 "Some" + L_PAREN@22..23 "(" + PLACEHOLDER_PAT@23..24 + UNDERSCORE@23..24 "_" + R_PAREN@24..25 ")" + WHITESPACE@25..26 " " + EQ@26..27 "=" + WHITESPACE@27..28 " " + PATH_EXPR@28..32 + PATH@28..32 + PATH_SEGMENT@28..32 + NAME_REF@28..32 + IDENT@28..32 "None" + WHITESPACE@32..33 " " + BLOCK_EXPR@33..35 + BLOCK@33..35 + L_CURLY@33..34 "{" + R_CURLY@34..35 "}" + WHITESPACE@35..36 " " + R_CURLY@36..37 "}" + WHITESPACE@37..38 "\n" + FN_DEF@38..196 + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + NAME@41..44 + IDENT@41..44 "bar" + PARAM_LIST@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + BLOCK_EXPR@47..196 + BLOCK@47..196 + L_CURLY@47..48 "{" + WHITESPACE@48..53 "\n " + EXPR_STMT@53..87 + IF_EXPR@53..87 + IF_KW@53..55 "if" + WHITESPACE@55..56 " " + CONDITION@56..84 + LET_KW@56..59 "let" + WHITESPACE@59..60 " " + OR_PAT@60..77 + TUPLE_STRUCT_PAT@60..67 + PATH@60..64 + PATH_SEGMENT@60..64 + NAME_REF@60..64 + IDENT@60..64 "Some" + L_PAREN@64..65 "(" + PLACEHOLDER_PAT@65..66 + UNDERSCORE@65..66 "_" + R_PAREN@66..67 ")" + WHITESPACE@67..68 " " + PIPE@68..69 "|" + WHITESPACE@69..70 " " + TUPLE_STRUCT_PAT@70..77 + PATH@70..74 + PATH_SEGMENT@70..74 + NAME_REF@70..74 + IDENT@70..74 "Some" + L_PAREN@74..75 "(" + PLACEHOLDER_PAT@75..76 + UNDERSCORE@75..76 "_" + R_PAREN@76..77 ")" + WHITESPACE@77..78 " " + EQ@78..79 "=" + WHITESPACE@79..80 " " + PATH_EXPR@80..84 + PATH@80..84 + PATH_SEGMENT@80..84 + NAME_REF@80..84 + IDENT@80..84 "None" + WHITESPACE@84..85 " " + BLOCK_EXPR@85..87 + BLOCK@85..87 + L_CURLY@85..86 "{" + R_CURLY@86..87 "}" + WHITESPACE@87..92 "\n " + EXPR_STMT@92..118 + IF_EXPR@92..118 + IF_KW@92..94 "if" + WHITESPACE@94..95 " " + CONDITION@95..115 + LET_KW@95..98 "let" + WHITESPACE@98..99 " " + PIPE@99..100 "|" + WHITESPACE@100..101 " " + TUPLE_STRUCT_PAT@101..108 + PATH@101..105 + PATH_SEGMENT@101..105 + NAME_REF@101..105 + IDENT@101..105 "Some" + L_PAREN@105..106 "(" + PLACEHOLDER_PAT@106..107 + UNDERSCORE@106..107 "_" + R_PAREN@107..108 ")" + WHITESPACE@108..109 " " + EQ@109..110 "=" + WHITESPACE@110..111 " " + PATH_EXPR@111..115 + PATH@111..115 + PATH_SEGMENT@111..115 + NAME_REF@111..115 + IDENT@111..115 "None" + WHITESPACE@115..116 " " + BLOCK_EXPR@116..118 + BLOCK@116..118 + L_CURLY@116..117 "{" + R_CURLY@117..118 "}" + WHITESPACE@118..123 "\n " + EXPR_STMT@123..160 + WHILE_EXPR@123..160 + WHILE_KW@123..128 "while" + WHITESPACE@128..129 " " + CONDITION@129..157 + LET_KW@129..132 "let" + WHITESPACE@132..133 " " + OR_PAT@133..150 + TUPLE_STRUCT_PAT@133..140 + PATH@133..137 + PATH_SEGMENT@133..137 + NAME_REF@133..137 + IDENT@133..137 "Some" + L_PAREN@137..138 "(" + PLACEHOLDER_PAT@138..139 + UNDERSCORE@138..139 "_" + R_PAREN@139..140 ")" + WHITESPACE@140..141 " " + PIPE@141..142 "|" + WHITESPACE@142..143 " " + TUPLE_STRUCT_PAT@143..150 + PATH@143..147 + PATH_SEGMENT@143..147 + NAME_REF@143..147 + IDENT@143..147 "Some" + L_PAREN@147..148 "(" + PLACEHOLDER_PAT@148..149 + UNDERSCORE@148..149 "_" + R_PAREN@149..150 ")" + WHITESPACE@150..151 " " + EQ@151..152 "=" + WHITESPACE@152..153 " " + PATH_EXPR@153..157 + PATH@153..157 + PATH_SEGMENT@153..157 + NAME_REF@153..157 + IDENT@153..157 "None" + WHITESPACE@157..158 " " + BLOCK_EXPR@158..160 + BLOCK@158..160 + L_CURLY@158..159 "{" + R_CURLY@159..160 "}" + WHITESPACE@160..165 "\n " + WHILE_EXPR@165..194 + WHILE_KW@165..170 "while" + WHITESPACE@170..171 " " + CONDITION@171..191 + LET_KW@171..174 "let" + WHITESPACE@174..175 " " + PIPE@175..176 "|" + WHITESPACE@176..177 " " + TUPLE_STRUCT_PAT@177..184 + PATH@177..181 + PATH_SEGMENT@177..181 + NAME_REF@177..181 + IDENT@177..181 "Some" + L_PAREN@181..182 "(" + PLACEHOLDER_PAT@182..183 + UNDERSCORE@182..183 "_" + R_PAREN@183..184 ")" + WHITESPACE@184..185 " " + EQ@185..186 "=" + WHITESPACE@186..187 " " + PATH_EXPR@187..191 + PATH@187..191 + PATH_SEGMENT@187..191 + NAME_REF@187..191 + IDENT@187..191 "None" + WHITESPACE@191..192 " " + BLOCK_EXPR@192..194 + BLOCK@192..194 + L_CURLY@192..193 "{" + R_CURLY@193..194 "}" + WHITESPACE@194..195 "\n" + R_CURLY@195..196 "}" + WHITESPACE@196..197 "\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 aaef408cc6..e5138a5990 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 @@ -1,89 +1,89 @@ -SOURCE_FILE@[0; 93) - FN_DEF@[0; 92) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 92) - BLOCK@[9; 92) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 29) - WHILE_EXPR@[15; 28) - WHILE_KW@[15; 20) "while" - WHITESPACE@[20; 21) " " - CONDITION@[21; 25) - LITERAL@[21; 25) - TRUE_KW@[21; 25) "true" - WHITESPACE@[25; 26) " " - BLOCK_EXPR@[26; 28) - BLOCK@[26; 28) - L_CURLY@[26; 27) "{" - R_CURLY@[27; 28) "}" - SEMICOLON@[28; 29) ";" - WHITESPACE@[29; 34) "\n " - EXPR_STMT@[34; 67) - WHILE_EXPR@[34; 66) - WHILE_KW@[34; 39) "while" - WHITESPACE@[39; 40) " " - CONDITION@[40; 63) - LET_KW@[40; 43) "let" - WHITESPACE@[43; 44) " " - TUPLE_STRUCT_PAT@[44; 51) - PATH@[44; 48) - PATH_SEGMENT@[44; 48) - NAME_REF@[44; 48) - IDENT@[44; 48) "Some" - L_PAREN@[48; 49) "(" - BIND_PAT@[49; 50) - NAME@[49; 50) - IDENT@[49; 50) "x" - R_PAREN@[50; 51) ")" - WHITESPACE@[51; 52) " " - EQ@[52; 53) "=" - WHITESPACE@[53; 54) " " - METHOD_CALL_EXPR@[54; 63) - PATH_EXPR@[54; 56) - PATH@[54; 56) - PATH_SEGMENT@[54; 56) - NAME_REF@[54; 56) - IDENT@[54; 56) "it" - DOT@[56; 57) "." - NAME_REF@[57; 61) - IDENT@[57; 61) "next" - ARG_LIST@[61; 63) - L_PAREN@[61; 62) "(" - R_PAREN@[62; 63) ")" - WHITESPACE@[63; 64) " " - BLOCK_EXPR@[64; 66) - BLOCK@[64; 66) - L_CURLY@[64; 65) "{" - R_CURLY@[65; 66) "}" - SEMICOLON@[66; 67) ";" - WHITESPACE@[67; 72) "\n " - EXPR_STMT@[72; 90) - WHILE_EXPR@[72; 89) - WHILE_KW@[72; 77) "while" - WHITESPACE@[77; 78) " " - CONDITION@[78; 86) - BLOCK_EXPR@[78; 86) - BLOCK@[78; 86) - L_CURLY@[78; 79) "{" - WHITESPACE@[79; 80) " " - LITERAL@[80; 84) - TRUE_KW@[80; 84) "true" - WHITESPACE@[84; 85) " " - R_CURLY@[85; 86) "}" - WHITESPACE@[86; 87) " " - BLOCK_EXPR@[87; 89) - BLOCK@[87; 89) - L_CURLY@[87; 88) "{" - R_CURLY@[88; 89) "}" - SEMICOLON@[89; 90) ";" - WHITESPACE@[90; 91) "\n" - R_CURLY@[91; 92) "}" - WHITESPACE@[92; 93) "\n" +SOURCE_FILE@0..93 + FN_DEF@0..92 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..92 + BLOCK@9..92 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..29 + WHILE_EXPR@15..28 + WHILE_KW@15..20 "while" + WHITESPACE@20..21 " " + CONDITION@21..25 + LITERAL@21..25 + TRUE_KW@21..25 "true" + WHITESPACE@25..26 " " + BLOCK_EXPR@26..28 + BLOCK@26..28 + L_CURLY@26..27 "{" + R_CURLY@27..28 "}" + SEMICOLON@28..29 ";" + WHITESPACE@29..34 "\n " + EXPR_STMT@34..67 + WHILE_EXPR@34..66 + WHILE_KW@34..39 "while" + WHITESPACE@39..40 " " + CONDITION@40..63 + LET_KW@40..43 "let" + WHITESPACE@43..44 " " + TUPLE_STRUCT_PAT@44..51 + PATH@44..48 + PATH_SEGMENT@44..48 + NAME_REF@44..48 + IDENT@44..48 "Some" + L_PAREN@48..49 "(" + BIND_PAT@49..50 + NAME@49..50 + IDENT@49..50 "x" + R_PAREN@50..51 ")" + WHITESPACE@51..52 " " + EQ@52..53 "=" + WHITESPACE@53..54 " " + METHOD_CALL_EXPR@54..63 + PATH_EXPR@54..56 + PATH@54..56 + PATH_SEGMENT@54..56 + NAME_REF@54..56 + IDENT@54..56 "it" + DOT@56..57 "." + NAME_REF@57..61 + IDENT@57..61 "next" + ARG_LIST@61..63 + L_PAREN@61..62 "(" + R_PAREN@62..63 ")" + WHITESPACE@63..64 " " + BLOCK_EXPR@64..66 + BLOCK@64..66 + L_CURLY@64..65 "{" + R_CURLY@65..66 "}" + SEMICOLON@66..67 ";" + WHITESPACE@67..72 "\n " + EXPR_STMT@72..90 + WHILE_EXPR@72..89 + WHILE_KW@72..77 "while" + WHITESPACE@77..78 " " + CONDITION@78..86 + BLOCK_EXPR@78..86 + BLOCK@78..86 + L_CURLY@78..79 "{" + WHITESPACE@79..80 " " + LITERAL@80..84 + TRUE_KW@80..84 "true" + WHITESPACE@84..85 " " + R_CURLY@85..86 "}" + WHITESPACE@86..87 " " + BLOCK_EXPR@87..89 + BLOCK@87..89 + L_CURLY@87..88 "{" + R_CURLY@88..89 "}" + SEMICOLON@89..90 ";" + WHITESPACE@90..91 "\n" + R_CURLY@91..92 "}" + 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 bad7698500..72705e1483 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 @@ -1,98 +1,98 @@ -SOURCE_FILE@[0; 113) - TYPE_ALIAS_DEF@[0; 14) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - FN_POINTER_TYPE@[9; 13) - FN_KW@[9; 11) "fn" - PARAM_LIST@[11; 13) - L_PAREN@[11; 12) "(" - R_PAREN@[12; 13) ")" - SEMICOLON@[13; 14) ";" - WHITESPACE@[14; 15) "\n" - TYPE_ALIAS_DEF@[15; 36) - TYPE_KW@[15; 19) "type" - WHITESPACE@[19; 20) " " - NAME@[20; 21) - IDENT@[20; 21) "B" - WHITESPACE@[21; 22) " " - EQ@[22; 23) "=" - WHITESPACE@[23; 24) " " - FN_POINTER_TYPE@[24; 35) - UNSAFE_KW@[24; 30) "unsafe" - WHITESPACE@[30; 31) " " - FN_KW@[31; 33) "fn" - PARAM_LIST@[33; 35) - L_PAREN@[33; 34) "(" - R_PAREN@[34; 35) ")" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 37) "\n" - TYPE_ALIAS_DEF@[37; 69) - TYPE_KW@[37; 41) "type" - WHITESPACE@[41; 42) " " - NAME@[42; 43) - IDENT@[42; 43) "C" - WHITESPACE@[43; 44) " " - EQ@[44; 45) "=" - WHITESPACE@[45; 46) " " - FN_POINTER_TYPE@[46; 68) - UNSAFE_KW@[46; 52) "unsafe" - WHITESPACE@[52; 53) " " - ABI@[53; 63) - EXTERN_KW@[53; 59) "extern" - WHITESPACE@[59; 60) " " - STRING@[60; 63) "\"C\"" - WHITESPACE@[63; 64) " " - FN_KW@[64; 66) "fn" - PARAM_LIST@[66; 68) - L_PAREN@[66; 67) "(" - R_PAREN@[67; 68) ")" - SEMICOLON@[68; 69) ";" - WHITESPACE@[69; 70) "\n" - TYPE_ALIAS_DEF@[70; 112) - TYPE_KW@[70; 74) "type" - WHITESPACE@[74; 75) " " - NAME@[75; 76) - IDENT@[75; 76) "D" - WHITESPACE@[76; 77) " " - EQ@[77; 78) "=" - WHITESPACE@[78; 79) " " - FN_POINTER_TYPE@[79; 111) - ABI@[79; 89) - EXTERN_KW@[79; 85) "extern" - WHITESPACE@[85; 86) " " - STRING@[86; 89) "\"C\"" - WHITESPACE@[89; 90) " " - FN_KW@[90; 92) "fn" - WHITESPACE@[92; 93) " " - PARAM_LIST@[93; 105) - L_PAREN@[93; 94) "(" - WHITESPACE@[94; 95) " " - PARAM@[95; 97) - PATH_TYPE@[95; 97) - PATH@[95; 97) - PATH_SEGMENT@[95; 97) - NAME_REF@[95; 97) - IDENT@[95; 97) "u8" - WHITESPACE@[97; 98) " " - COMMA@[98; 99) "," - WHITESPACE@[99; 100) " " - PARAM@[100; 103) - DOT3@[100; 103) "..." - WHITESPACE@[103; 104) " " - R_PAREN@[104; 105) ")" - WHITESPACE@[105; 106) " " - RET_TYPE@[106; 111) - THIN_ARROW@[106; 108) "->" - WHITESPACE@[108; 109) " " - PATH_TYPE@[109; 111) - PATH@[109; 111) - PATH_SEGMENT@[109; 111) - NAME_REF@[109; 111) - IDENT@[109; 111) "u8" - SEMICOLON@[111; 112) ";" - WHITESPACE@[112; 113) "\n" +SOURCE_FILE@0..113 + TYPE_ALIAS_DEF@0..14 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + FN_POINTER_TYPE@9..13 + FN_KW@9..11 "fn" + PARAM_LIST@11..13 + L_PAREN@11..12 "(" + R_PAREN@12..13 ")" + SEMICOLON@13..14 ";" + WHITESPACE@14..15 "\n" + TYPE_ALIAS_DEF@15..36 + TYPE_KW@15..19 "type" + WHITESPACE@19..20 " " + NAME@20..21 + IDENT@20..21 "B" + WHITESPACE@21..22 " " + EQ@22..23 "=" + WHITESPACE@23..24 " " + FN_POINTER_TYPE@24..35 + UNSAFE_KW@24..30 "unsafe" + WHITESPACE@30..31 " " + FN_KW@31..33 "fn" + PARAM_LIST@33..35 + L_PAREN@33..34 "(" + R_PAREN@34..35 ")" + SEMICOLON@35..36 ";" + WHITESPACE@36..37 "\n" + TYPE_ALIAS_DEF@37..69 + TYPE_KW@37..41 "type" + WHITESPACE@41..42 " " + NAME@42..43 + IDENT@42..43 "C" + WHITESPACE@43..44 " " + EQ@44..45 "=" + WHITESPACE@45..46 " " + FN_POINTER_TYPE@46..68 + UNSAFE_KW@46..52 "unsafe" + WHITESPACE@52..53 " " + ABI@53..63 + EXTERN_KW@53..59 "extern" + WHITESPACE@59..60 " " + STRING@60..63 "\"C\"" + WHITESPACE@63..64 " " + FN_KW@64..66 "fn" + PARAM_LIST@66..68 + L_PAREN@66..67 "(" + R_PAREN@67..68 ")" + SEMICOLON@68..69 ";" + WHITESPACE@69..70 "\n" + TYPE_ALIAS_DEF@70..112 + TYPE_KW@70..74 "type" + WHITESPACE@74..75 " " + NAME@75..76 + IDENT@75..76 "D" + WHITESPACE@76..77 " " + EQ@77..78 "=" + WHITESPACE@78..79 " " + FN_POINTER_TYPE@79..111 + ABI@79..89 + EXTERN_KW@79..85 "extern" + WHITESPACE@85..86 " " + STRING@86..89 "\"C\"" + WHITESPACE@89..90 " " + FN_KW@90..92 "fn" + WHITESPACE@92..93 " " + PARAM_LIST@93..105 + L_PAREN@93..94 "(" + WHITESPACE@94..95 " " + PARAM@95..97 + PATH_TYPE@95..97 + PATH@95..97 + PATH_SEGMENT@95..97 + NAME_REF@95..97 + IDENT@95..97 "u8" + WHITESPACE@97..98 " " + COMMA@98..99 "," + WHITESPACE@99..100 " " + PARAM@100..103 + DOT3@100..103 "..." + WHITESPACE@103..104 " " + R_PAREN@104..105 ")" + WHITESPACE@105..106 " " + RET_TYPE@106..111 + THIN_ARROW@106..108 "->" + WHITESPACE@108..109 " " + PATH_TYPE@109..111 + PATH@109..111 + PATH_SEGMENT@109..111 + NAME_REF@109..111 + IDENT@109..111 "u8" + SEMICOLON@111..112 ";" + 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 e6ee20b9a6..784fbb5923 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 @@ -1,50 +1,50 @@ -SOURCE_FILE@[0; 54) - TYPE_ALIAS_DEF@[0; 13) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - REFERENCE_TYPE@[9; 12) - AMP@[9; 10) "&" - TUPLE_TYPE@[10; 12) - L_PAREN@[10; 11) "(" - R_PAREN@[11; 12) ")" - SEMICOLON@[12; 13) ";" - WHITESPACE@[13; 14) "\n" - TYPE_ALIAS_DEF@[14; 35) - TYPE_KW@[14; 18) "type" - WHITESPACE@[18; 19) " " - NAME@[19; 20) - IDENT@[19; 20) "B" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - REFERENCE_TYPE@[23; 34) - AMP@[23; 24) "&" - LIFETIME@[24; 31) "\'static" - WHITESPACE@[31; 32) " " - TUPLE_TYPE@[32; 34) - L_PAREN@[32; 33) "(" - R_PAREN@[33; 34) ")" - SEMICOLON@[34; 35) ";" - WHITESPACE@[35; 36) "\n" - TYPE_ALIAS_DEF@[36; 53) - TYPE_KW@[36; 40) "type" - WHITESPACE@[40; 41) " " - NAME@[41; 42) - IDENT@[41; 42) "C" - WHITESPACE@[42; 43) " " - EQ@[43; 44) "=" - WHITESPACE@[44; 45) " " - REFERENCE_TYPE@[45; 52) - AMP@[45; 46) "&" - MUT_KW@[46; 49) "mut" - WHITESPACE@[49; 50) " " - TUPLE_TYPE@[50; 52) - L_PAREN@[50; 51) "(" - R_PAREN@[51; 52) ")" - SEMICOLON@[52; 53) ";" - WHITESPACE@[53; 54) "\n" +SOURCE_FILE@0..54 + TYPE_ALIAS_DEF@0..13 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + REFERENCE_TYPE@9..12 + AMP@9..10 "&" + TUPLE_TYPE@10..12 + L_PAREN@10..11 "(" + R_PAREN@11..12 ")" + SEMICOLON@12..13 ";" + WHITESPACE@13..14 "\n" + TYPE_ALIAS_DEF@14..35 + TYPE_KW@14..18 "type" + WHITESPACE@18..19 " " + NAME@19..20 + IDENT@19..20 "B" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + REFERENCE_TYPE@23..34 + AMP@23..24 "&" + LIFETIME@24..31 "\'static" + WHITESPACE@31..32 " " + TUPLE_TYPE@32..34 + L_PAREN@32..33 "(" + R_PAREN@33..34 ")" + SEMICOLON@34..35 ";" + WHITESPACE@35..36 "\n" + TYPE_ALIAS_DEF@36..53 + TYPE_KW@36..40 "type" + WHITESPACE@40..41 " " + NAME@41..42 + IDENT@41..42 "C" + WHITESPACE@42..43 " " + EQ@43..44 "=" + WHITESPACE@44..45 " " + REFERENCE_TYPE@45..52 + AMP@45..46 "&" + MUT_KW@46..49 "mut" + WHITESPACE@49..50 " " + TUPLE_TYPE@50..52 + L_PAREN@50..51 "(" + R_PAREN@51..52 ")" + SEMICOLON@52..53 ";" + 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 4bb95314f6..52644da8f0 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 @@ -1,55 +1,55 @@ -SOURCE_FILE@[0; 102) - FN_DEF@[0; 101) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 101) - BLOCK@[9; 101) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LOOP_EXPR@[15; 99) - LOOP_KW@[15; 19) "loop" - WHITESPACE@[19; 20) " " - BLOCK_EXPR@[20; 99) - BLOCK@[20; 99) - L_CURLY@[20; 21) "{" - WHITESPACE@[21; 30) "\n " - EXPR_STMT@[30; 36) - BREAK_EXPR@[30; 35) - BREAK_KW@[30; 35) "break" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 45) "\n " - EXPR_STMT@[45; 54) - BREAK_EXPR@[45; 53) - BREAK_KW@[45; 50) "break" - WHITESPACE@[50; 51) " " - LIFETIME@[51; 53) "\'l" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 63) "\n " - EXPR_STMT@[63; 72) - BREAK_EXPR@[63; 71) - BREAK_KW@[63; 68) "break" - WHITESPACE@[68; 69) " " - LITERAL@[69; 71) - INT_NUMBER@[69; 71) "92" - SEMICOLON@[71; 72) ";" - WHITESPACE@[72; 81) "\n " - EXPR_STMT@[81; 93) - BREAK_EXPR@[81; 92) - BREAK_KW@[81; 86) "break" - WHITESPACE@[86; 87) " " - LIFETIME@[87; 89) "\'l" - WHITESPACE@[89; 90) " " - LITERAL@[90; 92) - INT_NUMBER@[90; 92) "92" - SEMICOLON@[92; 93) ";" - WHITESPACE@[93; 98) "\n " - R_CURLY@[98; 99) "}" - WHITESPACE@[99; 100) "\n" - R_CURLY@[100; 101) "}" - WHITESPACE@[101; 102) "\n" +SOURCE_FILE@0..102 + FN_DEF@0..101 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..101 + BLOCK@9..101 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LOOP_EXPR@15..99 + LOOP_KW@15..19 "loop" + WHITESPACE@19..20 " " + BLOCK_EXPR@20..99 + BLOCK@20..99 + L_CURLY@20..21 "{" + WHITESPACE@21..30 "\n " + EXPR_STMT@30..36 + BREAK_EXPR@30..35 + BREAK_KW@30..35 "break" + SEMICOLON@35..36 ";" + WHITESPACE@36..45 "\n " + EXPR_STMT@45..54 + BREAK_EXPR@45..53 + BREAK_KW@45..50 "break" + WHITESPACE@50..51 " " + LIFETIME@51..53 "\'l" + SEMICOLON@53..54 ";" + WHITESPACE@54..63 "\n " + EXPR_STMT@63..72 + BREAK_EXPR@63..71 + BREAK_KW@63..68 "break" + WHITESPACE@68..69 " " + LITERAL@69..71 + INT_NUMBER@69..71 "92" + SEMICOLON@71..72 ";" + WHITESPACE@72..81 "\n " + EXPR_STMT@81..93 + BREAK_EXPR@81..92 + BREAK_KW@81..86 "break" + WHITESPACE@86..87 " " + LIFETIME@87..89 "\'l" + WHITESPACE@89..90 " " + LITERAL@90..92 + INT_NUMBER@90..92 "92" + SEMICOLON@92..93 ";" + WHITESPACE@93..98 "\n " + R_CURLY@98..99 "}" + WHITESPACE@99..100 "\n" + R_CURLY@100..101 "}" + WHITESPACE@101..102 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast index a7dfe167c1..f061c0cac3 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0036_unsafe_extern_fn.rast @@ -1,22 +1,22 @@ -SOURCE_FILE@[0; 30) - FN_DEF@[0; 29) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - ABI@[7; 17) - EXTERN_KW@[7; 13) "extern" - WHITESPACE@[13; 14) " " - STRING@[14; 17) "\"C\"" - WHITESPACE@[17; 18) " " - FN_KW@[18; 20) "fn" - WHITESPACE@[20; 21) " " - NAME@[21; 24) - IDENT@[21; 24) "foo" - PARAM_LIST@[24; 26) - L_PAREN@[24; 25) "(" - R_PAREN@[25; 26) ")" - WHITESPACE@[26; 27) " " - BLOCK_EXPR@[27; 29) - BLOCK@[27; 29) - L_CURLY@[27; 28) "{" - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) "\n" +SOURCE_FILE@0..30 + FN_DEF@0..29 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + ABI@7..17 + EXTERN_KW@7..13 "extern" + WHITESPACE@13..14 " " + STRING@14..17 "\"C\"" + WHITESPACE@17..18 " " + FN_KW@18..20 "fn" + WHITESPACE@20..21 " " + NAME@21..24 + IDENT@21..24 "foo" + PARAM_LIST@24..26 + L_PAREN@24..25 "(" + R_PAREN@25..26 ")" + WHITESPACE@26..27 " " + BLOCK_EXPR@27..29 + BLOCK@27..29 + L_CURLY@27..28 "{" + R_CURLY@28..29 "}" + WHITESPACE@29..30 "\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 1cd7a443f5..e25fc8c3e3 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 @@ -1,79 +1,79 @@ -SOURCE_FILE@[0; 71) - TYPE_ALIAS_DEF@[0; 26) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "X" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - PATH_TYPE@[9; 25) - PATH@[9; 25) - PATH@[9; 17) - PATH_SEGMENT@[9; 17) - L_ANGLE@[9; 10) "<" - PATH_TYPE@[10; 11) - PATH@[10; 11) - PATH_SEGMENT@[10; 11) - NAME_REF@[10; 11) - IDENT@[10; 11) "A" - WHITESPACE@[11; 12) " " - AS_KW@[12; 14) "as" - WHITESPACE@[14; 15) " " - PATH_TYPE@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "B" - R_ANGLE@[16; 17) ">" - COLON2@[17; 19) "::" - PATH_SEGMENT@[19; 25) - NAME_REF@[19; 25) - IDENT@[19; 25) "Output" - SEMICOLON@[25; 26) ";" - WHITESPACE@[26; 27) "\n" - FN_DEF@[27; 70) - FN_KW@[27; 29) "fn" - WHITESPACE@[29; 30) " " - NAME@[30; 33) - IDENT@[30; 33) "foo" - PARAM_LIST@[33; 35) - L_PAREN@[33; 34) "(" - R_PAREN@[34; 35) ")" - WHITESPACE@[35; 36) " " - BLOCK_EXPR@[36; 70) - BLOCK@[36; 70) - L_CURLY@[36; 37) "{" - WHITESPACE@[37; 38) " " - EXPR_STMT@[38; 68) - CALL_EXPR@[38; 67) - PATH_EXPR@[38; 65) - PATH@[38; 65) - PATH@[38; 56) - PATH_SEGMENT@[38; 56) - L_ANGLE@[38; 39) "<" - PATH_TYPE@[39; 44) - PATH@[39; 44) - PATH_SEGMENT@[39; 44) - NAME_REF@[39; 44) - IDENT@[39; 44) "usize" - WHITESPACE@[44; 45) " " - AS_KW@[45; 47) "as" - WHITESPACE@[47; 48) " " - PATH_TYPE@[48; 55) - PATH@[48; 55) - PATH_SEGMENT@[48; 55) - NAME_REF@[48; 55) - IDENT@[48; 55) "Default" - R_ANGLE@[55; 56) ">" - COLON2@[56; 58) "::" - PATH_SEGMENT@[58; 65) - NAME_REF@[58; 65) - IDENT@[58; 65) "default" - ARG_LIST@[65; 67) - L_PAREN@[65; 66) "(" - R_PAREN@[66; 67) ")" - SEMICOLON@[67; 68) ";" - WHITESPACE@[68; 69) " " - R_CURLY@[69; 70) "}" - WHITESPACE@[70; 71) "\n" +SOURCE_FILE@0..71 + TYPE_ALIAS_DEF@0..26 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "X" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + PATH_TYPE@9..25 + PATH@9..25 + PATH@9..17 + PATH_SEGMENT@9..17 + L_ANGLE@9..10 "<" + PATH_TYPE@10..11 + PATH@10..11 + PATH_SEGMENT@10..11 + NAME_REF@10..11 + IDENT@10..11 "A" + WHITESPACE@11..12 " " + AS_KW@12..14 "as" + WHITESPACE@14..15 " " + PATH_TYPE@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "B" + R_ANGLE@16..17 ">" + COLON2@17..19 "::" + PATH_SEGMENT@19..25 + NAME_REF@19..25 + IDENT@19..25 "Output" + SEMICOLON@25..26 ";" + WHITESPACE@26..27 "\n" + FN_DEF@27..70 + FN_KW@27..29 "fn" + WHITESPACE@29..30 " " + NAME@30..33 + IDENT@30..33 "foo" + PARAM_LIST@33..35 + L_PAREN@33..34 "(" + R_PAREN@34..35 ")" + WHITESPACE@35..36 " " + BLOCK_EXPR@36..70 + BLOCK@36..70 + L_CURLY@36..37 "{" + WHITESPACE@37..38 " " + EXPR_STMT@38..68 + CALL_EXPR@38..67 + PATH_EXPR@38..65 + PATH@38..65 + PATH@38..56 + PATH_SEGMENT@38..56 + L_ANGLE@38..39 "<" + PATH_TYPE@39..44 + PATH@39..44 + PATH_SEGMENT@39..44 + NAME_REF@39..44 + IDENT@39..44 "usize" + WHITESPACE@44..45 " " + AS_KW@45..47 "as" + WHITESPACE@47..48 " " + PATH_TYPE@48..55 + PATH@48..55 + PATH_SEGMENT@48..55 + NAME_REF@48..55 + IDENT@48..55 "Default" + R_ANGLE@55..56 ">" + COLON2@56..58 "::" + PATH_SEGMENT@58..65 + NAME_REF@58..65 + IDENT@58..65 "default" + ARG_LIST@65..67 + L_PAREN@65..66 "(" + R_PAREN@66..67 ")" + SEMICOLON@67..68 ";" + WHITESPACE@68..69 " " + R_CURLY@69..70 "}" + 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 f5db5a9e60..a1238d6102 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 @@ -1,29 +1,29 @@ -SOURCE_FILE@[0; 21) - FN_DEF@[0; 20) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 20) - BLOCK@[9; 20) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) " " - EXPR_STMT@[11; 18) - INDEX_EXPR@[11; 17) - PATH_EXPR@[11; 13) - PATH@[11; 13) - PATH_SEGMENT@[11; 13) - NAME_REF@[11; 13) - IDENT@[11; 13) "xs" - L_BRACK@[13; 14) "[" - RANGE_EXPR@[14; 16) - DOT2@[14; 16) ".." - R_BRACK@[16; 17) "]" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) " " - R_CURLY@[19; 20) "}" - WHITESPACE@[20; 21) "\n" +SOURCE_FILE@0..21 + FN_DEF@0..20 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..20 + BLOCK@9..20 + L_CURLY@9..10 "{" + WHITESPACE@10..11 " " + EXPR_STMT@11..18 + INDEX_EXPR@11..17 + PATH_EXPR@11..13 + PATH@11..13 + PATH_SEGMENT@11..13 + NAME_REF@11..13 + IDENT@11..13 "xs" + L_BRACK@13..14 "[" + RANGE_EXPR@14..16 + DOT2@14..16 ".." + R_BRACK@16..17 "]" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 " " + R_CURLY@19..20 "}" + 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 2d9db61b30..69e5fe4bc6 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 @@ -1,55 +1,55 @@ -SOURCE_FILE@[0; 46) - TYPE_ALIAS_DEF@[0; 45) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - PATH_TYPE@[9; 44) - PATH@[9; 44) - PATH_SEGMENT@[9; 44) - NAME_REF@[9; 10) - IDENT@[9; 10) "B" - TYPE_ARG_LIST@[10; 44) - L_ANGLE@[10; 11) "<" - LIFETIME_ARG@[11; 18) - LIFETIME@[11; 18) "\'static" - COMMA@[18; 19) "," - WHITESPACE@[19; 20) " " - TYPE_ARG@[20; 23) - PATH_TYPE@[20; 23) - PATH@[20; 23) - PATH_SEGMENT@[20; 23) - NAME_REF@[20; 23) - IDENT@[20; 23) "i32" - COMMA@[23; 24) "," - WHITESPACE@[24; 25) " " - CONST_ARG@[25; 26) - INT_NUMBER@[25; 26) "1" - COMMA@[26; 27) "," - WHITESPACE@[27; 28) " " - CONST_ARG@[28; 33) - BLOCK_EXPR@[28; 33) - BLOCK@[28; 33) - L_CURLY@[28; 29) "{" - WHITESPACE@[29; 30) " " - LITERAL@[30; 31) - INT_NUMBER@[30; 31) "2" - WHITESPACE@[31; 32) " " - R_CURLY@[32; 33) "}" - COMMA@[33; 34) "," - WHITESPACE@[34; 35) " " - ASSOC_TYPE_ARG@[35; 43) - NAME_REF@[35; 39) - IDENT@[35; 39) "Item" - EQ@[39; 40) "=" - PATH_TYPE@[40; 43) - PATH@[40; 43) - PATH_SEGMENT@[40; 43) - NAME_REF@[40; 43) - IDENT@[40; 43) "u64" - R_ANGLE@[43; 44) ">" - SEMICOLON@[44; 45) ";" - WHITESPACE@[45; 46) "\n" +SOURCE_FILE@0..46 + TYPE_ALIAS_DEF@0..45 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + PATH_TYPE@9..44 + PATH@9..44 + PATH_SEGMENT@9..44 + NAME_REF@9..10 + IDENT@9..10 "B" + TYPE_ARG_LIST@10..44 + L_ANGLE@10..11 "<" + LIFETIME_ARG@11..18 + LIFETIME@11..18 "\'static" + COMMA@18..19 "," + WHITESPACE@19..20 " " + TYPE_ARG@20..23 + PATH_TYPE@20..23 + PATH@20..23 + PATH_SEGMENT@20..23 + NAME_REF@20..23 + IDENT@20..23 "i32" + COMMA@23..24 "," + WHITESPACE@24..25 " " + CONST_ARG@25..26 + INT_NUMBER@25..26 "1" + COMMA@26..27 "," + WHITESPACE@27..28 " " + CONST_ARG@28..33 + BLOCK_EXPR@28..33 + BLOCK@28..33 + L_CURLY@28..29 "{" + WHITESPACE@29..30 " " + LITERAL@30..31 + INT_NUMBER@30..31 "2" + WHITESPACE@31..32 " " + R_CURLY@32..33 "}" + COMMA@33..34 "," + WHITESPACE@34..35 " " + ASSOC_TYPE_ARG@35..43 + NAME_REF@35..39 + IDENT@35..39 "Item" + EQ@39..40 "=" + PATH_TYPE@40..43 + PATH@40..43 + PATH_SEGMENT@40..43 + NAME_REF@40..43 + IDENT@40..43 "u64" + R_ANGLE@43..44 ">" + SEMICOLON@44..45 ";" + 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 4c175e2108..1a98e2610f 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 @@ -1,63 +1,63 @@ -SOURCE_FILE@[0; 71) - FN_DEF@[0; 19) - VISIBILITY@[0; 5) - CRATE_KW@[0; 5) "crate" - WHITESPACE@[5; 6) " " - FN_KW@[6; 8) "fn" - WHITESPACE@[8; 9) " " - NAME@[9; 13) - IDENT@[9; 13) "main" - PARAM_LIST@[13; 15) - L_PAREN@[13; 14) "(" - R_PAREN@[14; 15) ")" - WHITESPACE@[15; 16) " " - BLOCK_EXPR@[16; 19) - BLOCK@[16; 19) - L_CURLY@[16; 17) "{" - WHITESPACE@[17; 18) " " - R_CURLY@[18; 19) "}" - WHITESPACE@[19; 20) "\n" - STRUCT_DEF@[20; 49) - STRUCT_KW@[20; 26) "struct" - WHITESPACE@[26; 27) " " - NAME@[27; 28) - IDENT@[27; 28) "S" - WHITESPACE@[28; 29) " " - RECORD_FIELD_DEF_LIST@[29; 49) - L_CURLY@[29; 30) "{" - WHITESPACE@[30; 31) " " - RECORD_FIELD_DEF@[31; 47) - VISIBILITY@[31; 36) - CRATE_KW@[31; 36) "crate" - WHITESPACE@[36; 37) " " - NAME@[37; 42) - IDENT@[37; 42) "field" - COLON@[42; 43) ":" - WHITESPACE@[43; 44) " " - PATH_TYPE@[44; 47) - PATH@[44; 47) - PATH_SEGMENT@[44; 47) - NAME_REF@[44; 47) - IDENT@[44; 47) "u32" - WHITESPACE@[47; 48) " " - R_CURLY@[48; 49) "}" - WHITESPACE@[49; 50) "\n" - STRUCT_DEF@[50; 70) - STRUCT_KW@[50; 56) "struct" - WHITESPACE@[56; 57) " " - NAME@[57; 58) - IDENT@[57; 58) "T" - TUPLE_FIELD_DEF_LIST@[58; 69) - L_PAREN@[58; 59) "(" - TUPLE_FIELD_DEF@[59; 68) - VISIBILITY@[59; 64) - CRATE_KW@[59; 64) "crate" - WHITESPACE@[64; 65) " " - PATH_TYPE@[65; 68) - PATH@[65; 68) - PATH_SEGMENT@[65; 68) - NAME_REF@[65; 68) - IDENT@[65; 68) "u32" - R_PAREN@[68; 69) ")" - SEMICOLON@[69; 70) ";" - WHITESPACE@[70; 71) "\n" +SOURCE_FILE@0..71 + FN_DEF@0..19 + VISIBILITY@0..5 + CRATE_KW@0..5 "crate" + WHITESPACE@5..6 " " + FN_KW@6..8 "fn" + WHITESPACE@8..9 " " + NAME@9..13 + IDENT@9..13 "main" + PARAM_LIST@13..15 + L_PAREN@13..14 "(" + R_PAREN@14..15 ")" + WHITESPACE@15..16 " " + BLOCK_EXPR@16..19 + BLOCK@16..19 + L_CURLY@16..17 "{" + WHITESPACE@17..18 " " + R_CURLY@18..19 "}" + WHITESPACE@19..20 "\n" + STRUCT_DEF@20..49 + STRUCT_KW@20..26 "struct" + WHITESPACE@26..27 " " + NAME@27..28 + IDENT@27..28 "S" + WHITESPACE@28..29 " " + RECORD_FIELD_DEF_LIST@29..49 + L_CURLY@29..30 "{" + WHITESPACE@30..31 " " + RECORD_FIELD_DEF@31..47 + VISIBILITY@31..36 + CRATE_KW@31..36 "crate" + WHITESPACE@36..37 " " + NAME@37..42 + IDENT@37..42 "field" + COLON@42..43 ":" + WHITESPACE@43..44 " " + PATH_TYPE@44..47 + PATH@44..47 + PATH_SEGMENT@44..47 + NAME_REF@44..47 + IDENT@44..47 "u32" + WHITESPACE@47..48 " " + R_CURLY@48..49 "}" + WHITESPACE@49..50 "\n" + STRUCT_DEF@50..70 + STRUCT_KW@50..56 "struct" + WHITESPACE@56..57 " " + NAME@57..58 + IDENT@57..58 "T" + TUPLE_FIELD_DEF_LIST@58..69 + L_PAREN@58..59 "(" + TUPLE_FIELD_DEF@59..68 + VISIBILITY@59..64 + CRATE_KW@59..64 "crate" + WHITESPACE@64..65 " " + PATH_TYPE@65..68 + PATH@65..68 + PATH_SEGMENT@65..68 + NAME_REF@65..68 + IDENT@65..68 "u32" + R_PAREN@68..69 ")" + SEMICOLON@69..70 ";" + WHITESPACE@70..71 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast index 5783617156..1ae7913616 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0041_trait_item.rast @@ -1,125 +1,125 @@ -SOURCE_FILE@[0; 101) - TRAIT_DEF@[0; 41) - TRAIT_KW@[0; 5) "trait" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "T" - TYPE_PARAM_LIST@[7; 10) - L_ANGLE@[7; 8) "<" - TYPE_PARAM@[8; 9) - NAME@[8; 9) - IDENT@[8; 9) "U" - R_ANGLE@[9; 10) ">" - COLON@[10; 11) ":" - WHITESPACE@[11; 12) " " - TYPE_BOUND_LIST@[12; 24) - TYPE_BOUND@[12; 16) - PATH_TYPE@[12; 16) - PATH@[12; 16) - PATH_SEGMENT@[12; 16) - NAME_REF@[12; 16) - IDENT@[12; 16) "Hash" - WHITESPACE@[16; 17) " " - PLUS@[17; 18) "+" - WHITESPACE@[18; 19) " " - TYPE_BOUND@[19; 24) - PATH_TYPE@[19; 24) - PATH@[19; 24) - PATH_SEGMENT@[19; 24) - NAME_REF@[19; 24) - IDENT@[19; 24) "Clone" - WHITESPACE@[24; 25) " " - WHERE_CLAUSE@[25; 38) - WHERE_KW@[25; 30) "where" - WHITESPACE@[30; 31) " " - WHERE_PRED@[31; 38) - PATH_TYPE@[31; 32) - PATH@[31; 32) - PATH_SEGMENT@[31; 32) - NAME_REF@[31; 32) - IDENT@[31; 32) "U" - COLON@[32; 33) ":" - WHITESPACE@[33; 34) " " - TYPE_BOUND_LIST@[34; 38) - TYPE_BOUND@[34; 38) - PATH_TYPE@[34; 38) - PATH@[34; 38) - PATH_SEGMENT@[34; 38) - NAME_REF@[34; 38) - IDENT@[34; 38) "Copy" - WHITESPACE@[38; 39) " " - ITEM_LIST@[39; 41) - L_CURLY@[39; 40) "{" - R_CURLY@[40; 41) "}" - WHITESPACE@[41; 42) "\n" - TRAIT_DEF@[42; 100) - TRAIT_KW@[42; 47) "trait" - WHITESPACE@[47; 48) " " - NAME@[48; 49) - IDENT@[48; 49) "X" - TYPE_PARAM_LIST@[49; 69) - L_ANGLE@[49; 50) "<" - TYPE_PARAM@[50; 68) - NAME@[50; 51) - IDENT@[50; 51) "U" - COLON@[51; 52) ":" - WHITESPACE@[52; 53) " " - TYPE_BOUND_LIST@[53; 68) - TYPE_BOUND@[53; 58) - PATH_TYPE@[53; 58) - PATH@[53; 58) - PATH_SEGMENT@[53; 58) - NAME_REF@[53; 58) - IDENT@[53; 58) "Debug" - WHITESPACE@[58; 59) " " - PLUS@[59; 60) "+" - WHITESPACE@[60; 61) " " - TYPE_BOUND@[61; 68) - PATH_TYPE@[61; 68) - PATH@[61; 68) - PATH_SEGMENT@[61; 68) - NAME_REF@[61; 68) - IDENT@[61; 68) "Display" - R_ANGLE@[68; 69) ">" - COLON@[69; 70) ":" - WHITESPACE@[70; 71) " " - TYPE_BOUND_LIST@[71; 83) - TYPE_BOUND@[71; 75) - PATH_TYPE@[71; 75) - PATH@[71; 75) - PATH_SEGMENT@[71; 75) - NAME_REF@[71; 75) - IDENT@[71; 75) "Hash" - WHITESPACE@[75; 76) " " - PLUS@[76; 77) "+" - WHITESPACE@[77; 78) " " - TYPE_BOUND@[78; 83) - PATH_TYPE@[78; 83) - PATH@[78; 83) - PATH_SEGMENT@[78; 83) - NAME_REF@[78; 83) - IDENT@[78; 83) "Clone" - WHITESPACE@[83; 84) " " - WHERE_CLAUSE@[84; 97) - WHERE_KW@[84; 89) "where" - WHITESPACE@[89; 90) " " - WHERE_PRED@[90; 97) - PATH_TYPE@[90; 91) - PATH@[90; 91) - PATH_SEGMENT@[90; 91) - NAME_REF@[90; 91) - IDENT@[90; 91) "U" - COLON@[91; 92) ":" - WHITESPACE@[92; 93) " " - TYPE_BOUND_LIST@[93; 97) - TYPE_BOUND@[93; 97) - PATH_TYPE@[93; 97) - PATH@[93; 97) - PATH_SEGMENT@[93; 97) - NAME_REF@[93; 97) - IDENT@[93; 97) "Copy" - WHITESPACE@[97; 98) " " - ITEM_LIST@[98; 100) - L_CURLY@[98; 99) "{" - R_CURLY@[99; 100) "}" - WHITESPACE@[100; 101) "\n" +SOURCE_FILE@0..101 + TRAIT_DEF@0..41 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "T" + TYPE_PARAM_LIST@7..10 + L_ANGLE@7..8 "<" + TYPE_PARAM@8..9 + NAME@8..9 + IDENT@8..9 "U" + R_ANGLE@9..10 ">" + COLON@10..11 ":" + WHITESPACE@11..12 " " + TYPE_BOUND_LIST@12..24 + TYPE_BOUND@12..16 + PATH_TYPE@12..16 + PATH@12..16 + PATH_SEGMENT@12..16 + NAME_REF@12..16 + IDENT@12..16 "Hash" + WHITESPACE@16..17 " " + PLUS@17..18 "+" + WHITESPACE@18..19 " " + TYPE_BOUND@19..24 + PATH_TYPE@19..24 + PATH@19..24 + PATH_SEGMENT@19..24 + NAME_REF@19..24 + IDENT@19..24 "Clone" + WHITESPACE@24..25 " " + WHERE_CLAUSE@25..38 + WHERE_KW@25..30 "where" + WHITESPACE@30..31 " " + WHERE_PRED@31..38 + PATH_TYPE@31..32 + PATH@31..32 + PATH_SEGMENT@31..32 + NAME_REF@31..32 + IDENT@31..32 "U" + COLON@32..33 ":" + WHITESPACE@33..34 " " + TYPE_BOUND_LIST@34..38 + TYPE_BOUND@34..38 + PATH_TYPE@34..38 + PATH@34..38 + PATH_SEGMENT@34..38 + NAME_REF@34..38 + IDENT@34..38 "Copy" + WHITESPACE@38..39 " " + ITEM_LIST@39..41 + L_CURLY@39..40 "{" + R_CURLY@40..41 "}" + WHITESPACE@41..42 "\n" + TRAIT_DEF@42..100 + TRAIT_KW@42..47 "trait" + WHITESPACE@47..48 " " + NAME@48..49 + IDENT@48..49 "X" + TYPE_PARAM_LIST@49..69 + L_ANGLE@49..50 "<" + TYPE_PARAM@50..68 + NAME@50..51 + IDENT@50..51 "U" + COLON@51..52 ":" + WHITESPACE@52..53 " " + TYPE_BOUND_LIST@53..68 + TYPE_BOUND@53..58 + PATH_TYPE@53..58 + PATH@53..58 + PATH_SEGMENT@53..58 + NAME_REF@53..58 + IDENT@53..58 "Debug" + WHITESPACE@58..59 " " + PLUS@59..60 "+" + WHITESPACE@60..61 " " + TYPE_BOUND@61..68 + PATH_TYPE@61..68 + PATH@61..68 + PATH_SEGMENT@61..68 + NAME_REF@61..68 + IDENT@61..68 "Display" + R_ANGLE@68..69 ">" + COLON@69..70 ":" + WHITESPACE@70..71 " " + TYPE_BOUND_LIST@71..83 + TYPE_BOUND@71..75 + PATH_TYPE@71..75 + PATH@71..75 + PATH_SEGMENT@71..75 + NAME_REF@71..75 + IDENT@71..75 "Hash" + WHITESPACE@75..76 " " + PLUS@76..77 "+" + WHITESPACE@77..78 " " + TYPE_BOUND@78..83 + PATH_TYPE@78..83 + PATH@78..83 + PATH_SEGMENT@78..83 + NAME_REF@78..83 + IDENT@78..83 "Clone" + WHITESPACE@83..84 " " + WHERE_CLAUSE@84..97 + WHERE_KW@84..89 "where" + WHITESPACE@89..90 " " + WHERE_PRED@90..97 + PATH_TYPE@90..91 + PATH@90..91 + PATH_SEGMENT@90..91 + NAME_REF@90..91 + IDENT@90..91 "U" + COLON@91..92 ":" + WHITESPACE@92..93 " " + TYPE_BOUND_LIST@93..97 + TYPE_BOUND@93..97 + PATH_TYPE@93..97 + PATH@93..97 + PATH_SEGMENT@93..97 + NAME_REF@93..97 + IDENT@93..97 "Copy" + WHITESPACE@97..98 " " + ITEM_LIST@98..100 + L_CURLY@98..99 "{" + R_CURLY@99..100 "}" + WHITESPACE@100..101 "\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 f9e677a031..bbf6dc4949 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 @@ -1,148 +1,148 @@ -SOURCE_FILE@[0; 118) - FN_DEF@[0; 117) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 117) - BLOCK@[9; 117) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 27) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - CALL_EXPR@[23; 26) - PATH_EXPR@[23; 24) - PATH@[23; 24) - PATH_SEGMENT@[23; 24) - NAME_REF@[23; 24) - IDENT@[23; 24) "f" - ARG_LIST@[24; 26) - L_PAREN@[24; 25) "(" - R_PAREN@[25; 26) ")" - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - LET_STMT@[32; 54) - LET_KW@[32; 35) "let" - WHITESPACE@[35; 36) " " - PLACEHOLDER_PAT@[36; 37) - UNDERSCORE@[36; 37) "_" - WHITESPACE@[37; 38) " " - EQ@[38; 39) "=" - WHITESPACE@[39; 40) " " - CALL_EXPR@[40; 53) - CALL_EXPR@[40; 46) - CALL_EXPR@[40; 43) - PATH_EXPR@[40; 41) - PATH@[40; 41) - PATH_SEGMENT@[40; 41) - NAME_REF@[40; 41) - IDENT@[40; 41) "f" - ARG_LIST@[41; 43) - L_PAREN@[41; 42) "(" - R_PAREN@[42; 43) ")" - ARG_LIST@[43; 46) - L_PAREN@[43; 44) "(" - LITERAL@[44; 45) - INT_NUMBER@[44; 45) "1" - R_PAREN@[45; 46) ")" - ARG_LIST@[46; 53) - L_PAREN@[46; 47) "(" - LITERAL@[47; 48) - INT_NUMBER@[47; 48) "1" - COMMA@[48; 49) "," - WHITESPACE@[49; 50) " " - LITERAL@[50; 51) - INT_NUMBER@[50; 51) "2" - COMMA@[51; 52) "," - R_PAREN@[52; 53) ")" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 59) "\n " - LET_STMT@[59; 84) - LET_KW@[59; 62) "let" - WHITESPACE@[62; 63) " " - PLACEHOLDER_PAT@[63; 64) - UNDERSCORE@[63; 64) "_" - WHITESPACE@[64; 65) " " - EQ@[65; 66) "=" - WHITESPACE@[66; 67) " " - CALL_EXPR@[67; 83) - PATH_EXPR@[67; 68) - PATH@[67; 68) - PATH_SEGMENT@[67; 68) - NAME_REF@[67; 68) - IDENT@[67; 68) "f" - ARG_LIST@[68; 83) - L_PAREN@[68; 69) "(" - CALL_EXPR@[69; 82) - PATH_EXPR@[69; 80) - PATH@[69; 80) - PATH@[69; 74) - PATH_SEGMENT@[69; 74) - L_ANGLE@[69; 70) "<" - PATH_TYPE@[70; 73) - PATH@[70; 73) - PATH_SEGMENT@[70; 73) - NAME_REF@[70; 73) - IDENT@[70; 73) "Foo" - R_ANGLE@[73; 74) ">" - COLON2@[74; 76) "::" - PATH_SEGMENT@[76; 80) - NAME_REF@[76; 80) - IDENT@[76; 80) "func" - ARG_LIST@[80; 82) - L_PAREN@[80; 81) "(" - R_PAREN@[81; 82) ")" - R_PAREN@[82; 83) ")" - SEMICOLON@[83; 84) ";" - WHITESPACE@[84; 89) "\n " - EXPR_STMT@[89; 115) - CALL_EXPR@[89; 114) - PATH_EXPR@[89; 90) - PATH@[89; 90) - PATH_SEGMENT@[89; 90) - NAME_REF@[89; 90) - IDENT@[89; 90) "f" - ARG_LIST@[90; 114) - L_PAREN@[90; 91) "(" - CALL_EXPR@[91; 113) - PATH_EXPR@[91; 111) - PATH@[91; 111) - PATH@[91; 105) - PATH_SEGMENT@[91; 105) - L_ANGLE@[91; 92) "<" - PATH_TYPE@[92; 95) - PATH@[92; 95) - PATH_SEGMENT@[92; 95) - NAME_REF@[92; 95) - IDENT@[92; 95) "Foo" - WHITESPACE@[95; 96) " " - AS_KW@[96; 98) "as" - WHITESPACE@[98; 99) " " - PATH_TYPE@[99; 104) - PATH@[99; 104) - PATH_SEGMENT@[99; 104) - NAME_REF@[99; 104) - IDENT@[99; 104) "Trait" - R_ANGLE@[104; 105) ">" - COLON2@[105; 107) "::" - PATH_SEGMENT@[107; 111) - NAME_REF@[107; 111) - IDENT@[107; 111) "func" - ARG_LIST@[111; 113) - L_PAREN@[111; 112) "(" - R_PAREN@[112; 113) ")" - R_PAREN@[113; 114) ")" - SEMICOLON@[114; 115) ";" - WHITESPACE@[115; 116) "\n" - R_CURLY@[116; 117) "}" - WHITESPACE@[117; 118) "\n" +SOURCE_FILE@0..118 + FN_DEF@0..117 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..117 + BLOCK@9..117 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..27 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + CALL_EXPR@23..26 + PATH_EXPR@23..24 + PATH@23..24 + PATH_SEGMENT@23..24 + NAME_REF@23..24 + IDENT@23..24 "f" + ARG_LIST@24..26 + L_PAREN@24..25 "(" + R_PAREN@25..26 ")" + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + LET_STMT@32..54 + LET_KW@32..35 "let" + WHITESPACE@35..36 " " + PLACEHOLDER_PAT@36..37 + UNDERSCORE@36..37 "_" + WHITESPACE@37..38 " " + EQ@38..39 "=" + WHITESPACE@39..40 " " + CALL_EXPR@40..53 + CALL_EXPR@40..46 + CALL_EXPR@40..43 + PATH_EXPR@40..41 + PATH@40..41 + PATH_SEGMENT@40..41 + NAME_REF@40..41 + IDENT@40..41 "f" + ARG_LIST@41..43 + L_PAREN@41..42 "(" + R_PAREN@42..43 ")" + ARG_LIST@43..46 + L_PAREN@43..44 "(" + LITERAL@44..45 + INT_NUMBER@44..45 "1" + R_PAREN@45..46 ")" + ARG_LIST@46..53 + L_PAREN@46..47 "(" + LITERAL@47..48 + INT_NUMBER@47..48 "1" + COMMA@48..49 "," + WHITESPACE@49..50 " " + LITERAL@50..51 + INT_NUMBER@50..51 "2" + COMMA@51..52 "," + R_PAREN@52..53 ")" + SEMICOLON@53..54 ";" + WHITESPACE@54..59 "\n " + LET_STMT@59..84 + LET_KW@59..62 "let" + WHITESPACE@62..63 " " + PLACEHOLDER_PAT@63..64 + UNDERSCORE@63..64 "_" + WHITESPACE@64..65 " " + EQ@65..66 "=" + WHITESPACE@66..67 " " + CALL_EXPR@67..83 + PATH_EXPR@67..68 + PATH@67..68 + PATH_SEGMENT@67..68 + NAME_REF@67..68 + IDENT@67..68 "f" + ARG_LIST@68..83 + L_PAREN@68..69 "(" + CALL_EXPR@69..82 + PATH_EXPR@69..80 + PATH@69..80 + PATH@69..74 + PATH_SEGMENT@69..74 + L_ANGLE@69..70 "<" + PATH_TYPE@70..73 + PATH@70..73 + PATH_SEGMENT@70..73 + NAME_REF@70..73 + IDENT@70..73 "Foo" + R_ANGLE@73..74 ">" + COLON2@74..76 "::" + PATH_SEGMENT@76..80 + NAME_REF@76..80 + IDENT@76..80 "func" + ARG_LIST@80..82 + L_PAREN@80..81 "(" + R_PAREN@81..82 ")" + R_PAREN@82..83 ")" + SEMICOLON@83..84 ";" + WHITESPACE@84..89 "\n " + EXPR_STMT@89..115 + CALL_EXPR@89..114 + PATH_EXPR@89..90 + PATH@89..90 + PATH_SEGMENT@89..90 + NAME_REF@89..90 + IDENT@89..90 "f" + ARG_LIST@90..114 + L_PAREN@90..91 "(" + CALL_EXPR@91..113 + PATH_EXPR@91..111 + PATH@91..111 + PATH@91..105 + PATH_SEGMENT@91..105 + L_ANGLE@91..92 "<" + PATH_TYPE@92..95 + PATH@92..95 + PATH_SEGMENT@92..95 + NAME_REF@92..95 + IDENT@92..95 "Foo" + WHITESPACE@95..96 " " + AS_KW@96..98 "as" + WHITESPACE@98..99 " " + PATH_TYPE@99..104 + PATH@99..104 + PATH_SEGMENT@99..104 + NAME_REF@99..104 + IDENT@99..104 "Trait" + R_ANGLE@104..105 ">" + COLON2@105..107 "::" + PATH_SEGMENT@107..111 + NAME_REF@107..111 + IDENT@107..111 "func" + ARG_LIST@111..113 + L_PAREN@111..112 "(" + R_PAREN@112..113 ")" + R_PAREN@113..114 ")" + SEMICOLON@114..115 ";" + WHITESPACE@115..116 "\n" + R_CURLY@116..117 "}" + 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 580f29cfb0..f0e09d40da 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 @@ -1,138 +1,138 @@ -SOURCE_FILE@[0; 198) - USE_ITEM@[0; 28) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 27) - PATH@[4; 14) - PATH@[4; 8) - PATH_SEGMENT@[4; 8) - NAME_REF@[4; 8) - IDENT@[4; 8) "some" - COLON2@[8; 10) "::" - PATH_SEGMENT@[10; 14) - NAME_REF@[10; 14) - IDENT@[10; 14) "path" - WHITESPACE@[14; 15) " " - ALIAS@[15; 27) - AS_KW@[15; 17) "as" - WHITESPACE@[17; 18) " " - NAME@[18; 27) - IDENT@[18; 27) "some_name" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 29) "\n" - USE_ITEM@[29; 181) - USE_KW@[29; 32) "use" - WHITESPACE@[32; 33) " " - USE_TREE@[33; 180) - PATH@[33; 37) - PATH_SEGMENT@[33; 37) - NAME_REF@[33; 37) - IDENT@[33; 37) "some" - COLON2@[37; 39) "::" - USE_TREE_LIST@[39; 180) - L_CURLY@[39; 40) "{" - WHITESPACE@[40; 42) "\n " - USE_TREE@[42; 72) - PATH@[42; 53) - PATH@[42; 47) - PATH_SEGMENT@[42; 47) - NAME_REF@[42; 47) - IDENT@[42; 47) "other" - COLON2@[47; 49) "::" - PATH_SEGMENT@[49; 53) - NAME_REF@[49; 53) - IDENT@[49; 53) "path" - WHITESPACE@[53; 54) " " - ALIAS@[54; 72) - AS_KW@[54; 56) "as" - WHITESPACE@[56; 57) " " - NAME@[57; 72) - IDENT@[57; 72) "some_other_name" - COMMA@[72; 73) "," - WHITESPACE@[73; 75) "\n " - USE_TREE@[75; 108) - PATH@[75; 90) - PATH@[75; 84) - PATH_SEGMENT@[75; 84) - NAME_REF@[75; 84) - IDENT@[75; 84) "different" - COLON2@[84; 86) "::" - PATH_SEGMENT@[86; 90) - NAME_REF@[86; 90) - IDENT@[86; 90) "path" - WHITESPACE@[90; 91) " " - ALIAS@[91; 108) - AS_KW@[91; 93) "as" - WHITESPACE@[93; 94) " " - NAME@[94; 108) - IDENT@[94; 108) "different_name" - COMMA@[108; 109) "," - WHITESPACE@[109; 111) "\n " - USE_TREE@[111; 129) - PATH@[111; 129) - PATH@[111; 123) - PATH@[111; 114) - PATH_SEGMENT@[111; 114) - NAME_REF@[111; 114) - IDENT@[111; 114) "yet" - COLON2@[114; 116) "::" - PATH_SEGMENT@[116; 123) - NAME_REF@[116; 123) - IDENT@[116; 123) "another" - COLON2@[123; 125) "::" - PATH_SEGMENT@[125; 129) - NAME_REF@[125; 129) - IDENT@[125; 129) "path" - COMMA@[129; 130) "," - WHITESPACE@[130; 132) "\n " - USE_TREE@[132; 178) - PATH@[132; 175) - PATH@[132; 164) - PATH@[132; 158) - PATH@[132; 148) - PATH@[132; 144) - PATH@[132; 139) - PATH_SEGMENT@[132; 139) - NAME_REF@[132; 139) - IDENT@[132; 139) "running" - COLON2@[139; 141) "::" - PATH_SEGMENT@[141; 144) - NAME_REF@[141; 144) - IDENT@[141; 144) "out" - COLON2@[144; 146) "::" - PATH_SEGMENT@[146; 148) - NAME_REF@[146; 148) - IDENT@[146; 148) "of" - COLON2@[148; 150) "::" - PATH_SEGMENT@[150; 158) - NAME_REF@[150; 158) - IDENT@[150; 158) "synonyms" - COLON2@[158; 160) "::" - PATH_SEGMENT@[160; 164) - NAME_REF@[160; 164) - IDENT@[160; 164) "for_" - COLON2@[164; 166) "::" - PATH_SEGMENT@[166; 175) - NAME_REF@[166; 175) - IDENT@[166; 175) "different" - COLON2@[175; 177) "::" - STAR@[177; 178) "*" - WHITESPACE@[178; 179) "\n" - R_CURLY@[179; 180) "}" - SEMICOLON@[180; 181) ";" - WHITESPACE@[181; 182) "\n" - USE_ITEM@[182; 197) - USE_KW@[182; 185) "use" - WHITESPACE@[185; 186) " " - USE_TREE@[186; 196) - PATH@[186; 191) - PATH_SEGMENT@[186; 191) - NAME_REF@[186; 191) - IDENT@[186; 191) "Trait" - WHITESPACE@[191; 192) " " - ALIAS@[192; 196) - AS_KW@[192; 194) "as" - WHITESPACE@[194; 195) " " - UNDERSCORE@[195; 196) "_" - SEMICOLON@[196; 197) ";" - WHITESPACE@[197; 198) "\n" +SOURCE_FILE@0..198 + USE_ITEM@0..28 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..27 + PATH@4..14 + PATH@4..8 + PATH_SEGMENT@4..8 + NAME_REF@4..8 + IDENT@4..8 "some" + COLON2@8..10 "::" + PATH_SEGMENT@10..14 + NAME_REF@10..14 + IDENT@10..14 "path" + WHITESPACE@14..15 " " + ALIAS@15..27 + AS_KW@15..17 "as" + WHITESPACE@17..18 " " + NAME@18..27 + IDENT@18..27 "some_name" + SEMICOLON@27..28 ";" + WHITESPACE@28..29 "\n" + USE_ITEM@29..181 + USE_KW@29..32 "use" + WHITESPACE@32..33 " " + USE_TREE@33..180 + PATH@33..37 + PATH_SEGMENT@33..37 + NAME_REF@33..37 + IDENT@33..37 "some" + COLON2@37..39 "::" + USE_TREE_LIST@39..180 + L_CURLY@39..40 "{" + WHITESPACE@40..42 "\n " + USE_TREE@42..72 + PATH@42..53 + PATH@42..47 + PATH_SEGMENT@42..47 + NAME_REF@42..47 + IDENT@42..47 "other" + COLON2@47..49 "::" + PATH_SEGMENT@49..53 + NAME_REF@49..53 + IDENT@49..53 "path" + WHITESPACE@53..54 " " + ALIAS@54..72 + AS_KW@54..56 "as" + WHITESPACE@56..57 " " + NAME@57..72 + IDENT@57..72 "some_other_name" + COMMA@72..73 "," + WHITESPACE@73..75 "\n " + USE_TREE@75..108 + PATH@75..90 + PATH@75..84 + PATH_SEGMENT@75..84 + NAME_REF@75..84 + IDENT@75..84 "different" + COLON2@84..86 "::" + PATH_SEGMENT@86..90 + NAME_REF@86..90 + IDENT@86..90 "path" + WHITESPACE@90..91 " " + ALIAS@91..108 + AS_KW@91..93 "as" + WHITESPACE@93..94 " " + NAME@94..108 + IDENT@94..108 "different_name" + COMMA@108..109 "," + WHITESPACE@109..111 "\n " + USE_TREE@111..129 + PATH@111..129 + PATH@111..123 + PATH@111..114 + PATH_SEGMENT@111..114 + NAME_REF@111..114 + IDENT@111..114 "yet" + COLON2@114..116 "::" + PATH_SEGMENT@116..123 + NAME_REF@116..123 + IDENT@116..123 "another" + COLON2@123..125 "::" + PATH_SEGMENT@125..129 + NAME_REF@125..129 + IDENT@125..129 "path" + COMMA@129..130 "," + WHITESPACE@130..132 "\n " + USE_TREE@132..178 + PATH@132..175 + PATH@132..164 + PATH@132..158 + PATH@132..148 + PATH@132..144 + PATH@132..139 + PATH_SEGMENT@132..139 + NAME_REF@132..139 + IDENT@132..139 "running" + COLON2@139..141 "::" + PATH_SEGMENT@141..144 + NAME_REF@141..144 + IDENT@141..144 "out" + COLON2@144..146 "::" + PATH_SEGMENT@146..148 + NAME_REF@146..148 + IDENT@146..148 "of" + COLON2@148..150 "::" + PATH_SEGMENT@150..158 + NAME_REF@150..158 + IDENT@150..158 "synonyms" + COLON2@158..160 "::" + PATH_SEGMENT@160..164 + NAME_REF@160..164 + IDENT@160..164 "for_" + COLON2@164..166 "::" + PATH_SEGMENT@166..175 + NAME_REF@166..175 + IDENT@166..175 "different" + COLON2@175..177 "::" + STAR@177..178 "*" + WHITESPACE@178..179 "\n" + R_CURLY@179..180 "}" + SEMICOLON@180..181 ";" + WHITESPACE@181..182 "\n" + USE_ITEM@182..197 + USE_KW@182..185 "use" + WHITESPACE@185..186 " " + USE_TREE@186..196 + PATH@186..191 + PATH_SEGMENT@186..191 + NAME_REF@186..191 + IDENT@186..191 "Trait" + WHITESPACE@191..192 " " + ALIAS@192..196 + AS_KW@192..194 "as" + WHITESPACE@194..195 " " + UNDERSCORE@195..196 "_" + SEMICOLON@196..197 ";" + WHITESPACE@197..198 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast index e75d569f00..a454dfc3a2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0044_block_items.rast @@ -1,30 +1,30 @@ -SOURCE_FILE@[0; 21) - FN_DEF@[0; 20) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "a" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - BLOCK_EXPR@[7; 20) - BLOCK@[7; 20) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 9) " " - FN_DEF@[9; 18) - FN_KW@[9; 11) "fn" - WHITESPACE@[11; 12) " " - NAME@[12; 13) - IDENT@[12; 13) "b" - PARAM_LIST@[13; 15) - L_PAREN@[13; 14) "(" - R_PAREN@[14; 15) ")" - WHITESPACE@[15; 16) " " - BLOCK_EXPR@[16; 18) - BLOCK@[16; 18) - L_CURLY@[16; 17) "{" - R_CURLY@[17; 18) "}" - WHITESPACE@[18; 19) " " - R_CURLY@[19; 20) "}" - WHITESPACE@[20; 21) "\n" +SOURCE_FILE@0..21 + FN_DEF@0..20 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "a" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + BLOCK_EXPR@7..20 + BLOCK@7..20 + L_CURLY@7..8 "{" + WHITESPACE@8..9 " " + FN_DEF@9..18 + FN_KW@9..11 "fn" + WHITESPACE@11..12 " " + NAME@12..13 + IDENT@12..13 "b" + PARAM_LIST@13..15 + L_PAREN@13..14 "(" + R_PAREN@14..15 ")" + WHITESPACE@15..16 " " + BLOCK_EXPR@16..18 + BLOCK@16..18 + L_CURLY@16..17 "{" + R_CURLY@17..18 "}" + WHITESPACE@18..19 " " + R_CURLY@19..20 "}" + WHITESPACE@20..21 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast index 33886154dd..2a50f796c7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0045_param_list_opt_patterns.rast @@ -1,47 +1,47 @@ -SOURCE_FILE@[0; 35) - FN_DEF@[0; 34) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - TYPE_PARAM_LIST@[6; 30) - L_ANGLE@[6; 7) "<" - TYPE_PARAM@[7; 29) - NAME@[7; 8) - IDENT@[7; 8) "F" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - TYPE_BOUND_LIST@[10; 29) - TYPE_BOUND@[10; 29) - PATH_TYPE@[10; 29) - PATH@[10; 29) - PATH_SEGMENT@[10; 29) - NAME_REF@[10; 15) - IDENT@[10; 15) "FnMut" - PARAM_LIST@[15; 29) - L_PAREN@[15; 16) "(" - PARAM@[16; 28) - REFERENCE_TYPE@[16; 28) - AMP@[16; 17) "&" - MUT_KW@[17; 20) "mut" - WHITESPACE@[20; 21) " " - PATH_TYPE@[21; 28) - PATH@[21; 28) - PATH_SEGMENT@[21; 28) - NAME_REF@[21; 24) - IDENT@[21; 24) "Foo" - TYPE_ARG_LIST@[24; 28) - L_ANGLE@[24; 25) "<" - LIFETIME_ARG@[25; 27) - LIFETIME@[25; 27) "\'a" - R_ANGLE@[27; 28) ">" - R_PAREN@[28; 29) ")" - R_ANGLE@[29; 30) ">" - PARAM_LIST@[30; 32) - L_PAREN@[30; 31) "(" - R_PAREN@[31; 32) ")" - BLOCK_EXPR@[32; 34) - BLOCK@[32; 34) - L_CURLY@[32; 33) "{" - R_CURLY@[33; 34) "}" - WHITESPACE@[34; 35) "\n" +SOURCE_FILE@0..35 + FN_DEF@0..34 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + TYPE_PARAM_LIST@6..30 + L_ANGLE@6..7 "<" + TYPE_PARAM@7..29 + NAME@7..8 + IDENT@7..8 "F" + COLON@8..9 ":" + WHITESPACE@9..10 " " + TYPE_BOUND_LIST@10..29 + TYPE_BOUND@10..29 + PATH_TYPE@10..29 + PATH@10..29 + PATH_SEGMENT@10..29 + NAME_REF@10..15 + IDENT@10..15 "FnMut" + PARAM_LIST@15..29 + L_PAREN@15..16 "(" + PARAM@16..28 + REFERENCE_TYPE@16..28 + AMP@16..17 "&" + MUT_KW@17..20 "mut" + WHITESPACE@20..21 " " + PATH_TYPE@21..28 + PATH@21..28 + PATH_SEGMENT@21..28 + NAME_REF@21..24 + IDENT@21..24 "Foo" + TYPE_ARG_LIST@24..28 + L_ANGLE@24..25 "<" + LIFETIME_ARG@25..27 + LIFETIME@25..27 "\'a" + R_ANGLE@27..28 ">" + R_PAREN@28..29 ")" + R_ANGLE@29..30 ">" + PARAM_LIST@30..32 + L_PAREN@30..31 "(" + R_PAREN@31..32 ")" + BLOCK_EXPR@32..34 + BLOCK@32..34 + L_CURLY@32..33 "{" + R_CURLY@33..34 "}" + WHITESPACE@34..35 "\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 988b58d826..c28dc9d61a 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 @@ -1,20 +1,20 @@ -SOURCE_FILE@[0; 17) - TYPE_ALIAS_DEF@[0; 16) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - TUPLE_TYPE@[9; 15) - L_PAREN@[9; 10) "(" - PATH_TYPE@[10; 13) - PATH@[10; 13) - PATH_SEGMENT@[10; 13) - NAME_REF@[10; 13) - IDENT@[10; 13) "i32" - COMMA@[13; 14) "," - R_PAREN@[14; 15) ")" - SEMICOLON@[15; 16) ";" - WHITESPACE@[16; 17) "\n" +SOURCE_FILE@0..17 + TYPE_ALIAS_DEF@0..16 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + TUPLE_TYPE@9..15 + L_PAREN@9..10 "(" + PATH_TYPE@10..13 + PATH@10..13 + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "i32" + COMMA@13..14 "," + R_PAREN@14..15 ")" + SEMICOLON@15..16 ";" + WHITESPACE@16..17 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast index 0a768a8e3e..52de6023b4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0047_unsafe_default_impl.rast @@ -1,18 +1,18 @@ -SOURCE_FILE@[0; 27) - IMPL_DEF@[0; 26) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - DEFAULT_KW@[7; 14) "default" - WHITESPACE@[14; 15) " " - IMPL_KW@[15; 19) "impl" - WHITESPACE@[19; 20) " " - PATH_TYPE@[20; 23) - PATH@[20; 23) - PATH_SEGMENT@[20; 23) - NAME_REF@[20; 23) - IDENT@[20; 23) "Foo" - WHITESPACE@[23; 24) " " - ITEM_LIST@[24; 26) - L_CURLY@[24; 25) "{" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 27) "\n" +SOURCE_FILE@0..27 + IMPL_DEF@0..26 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + DEFAULT_KW@7..14 "default" + WHITESPACE@14..15 " " + IMPL_KW@15..19 "impl" + WHITESPACE@19..20 " " + PATH_TYPE@20..23 + PATH@20..23 + PATH_SEGMENT@20..23 + NAME_REF@20..23 + IDENT@20..23 "Foo" + WHITESPACE@23..24 " " + ITEM_LIST@24..26 + L_CURLY@24..25 "{" + R_CURLY@25..26 "}" + WHITESPACE@26..27 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast index 02f2a9db6c..7f87e05ecb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0048_path_type_with_bounds.rast @@ -1,83 +1,83 @@ -SOURCE_FILE@[0; 58) - FN_DEF@[0; 26) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - RET_TYPE@[9; 23) - THIN_ARROW@[9; 11) "->" - WHITESPACE@[11; 12) " " - PATH_TYPE@[12; 23) - PATH@[12; 23) - PATH_SEGMENT@[12; 23) - NAME_REF@[12; 15) - IDENT@[12; 15) "Box" - TYPE_ARG_LIST@[15; 23) - L_ANGLE@[15; 16) "<" - TYPE_ARG@[16; 22) - DYN_TRAIT_TYPE@[16; 22) - TYPE_BOUND_LIST@[16; 22) - TYPE_BOUND@[16; 17) - PATH_TYPE@[16; 17) - PATH@[16; 17) - PATH_SEGMENT@[16; 17) - NAME_REF@[16; 17) - IDENT@[16; 17) "T" - WHITESPACE@[17; 18) " " - PLUS@[18; 19) "+" - WHITESPACE@[19; 20) " " - TYPE_BOUND@[20; 22) - LIFETIME@[20; 22) "\'f" - R_ANGLE@[22; 23) ">" - WHITESPACE@[23; 24) " " - BLOCK_EXPR@[24; 26) - BLOCK@[24; 26) - L_CURLY@[24; 25) "{" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 27) "\n" - FN_DEF@[27; 57) - FN_KW@[27; 29) "fn" - WHITESPACE@[29; 30) " " - NAME@[30; 33) - IDENT@[30; 33) "foo" - PARAM_LIST@[33; 35) - L_PAREN@[33; 34) "(" - R_PAREN@[34; 35) ")" - WHITESPACE@[35; 36) " " - RET_TYPE@[36; 54) - THIN_ARROW@[36; 38) "->" - WHITESPACE@[38; 39) " " - PATH_TYPE@[39; 54) - PATH@[39; 54) - PATH_SEGMENT@[39; 54) - NAME_REF@[39; 42) - IDENT@[39; 42) "Box" - TYPE_ARG_LIST@[42; 54) - L_ANGLE@[42; 43) "<" - TYPE_ARG@[43; 53) - DYN_TRAIT_TYPE@[43; 53) - DYN_KW@[43; 46) "dyn" - WHITESPACE@[46; 47) " " - TYPE_BOUND_LIST@[47; 53) - TYPE_BOUND@[47; 48) - PATH_TYPE@[47; 48) - PATH@[47; 48) - PATH_SEGMENT@[47; 48) - NAME_REF@[47; 48) - IDENT@[47; 48) "T" - WHITESPACE@[48; 49) " " - PLUS@[49; 50) "+" - WHITESPACE@[50; 51) " " - TYPE_BOUND@[51; 53) - LIFETIME@[51; 53) "\'f" - R_ANGLE@[53; 54) ">" - WHITESPACE@[54; 55) " " - BLOCK_EXPR@[55; 57) - BLOCK@[55; 57) - L_CURLY@[55; 56) "{" - R_CURLY@[56; 57) "}" - WHITESPACE@[57; 58) "\n" +SOURCE_FILE@0..58 + FN_DEF@0..26 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + RET_TYPE@9..23 + THIN_ARROW@9..11 "->" + WHITESPACE@11..12 " " + PATH_TYPE@12..23 + PATH@12..23 + PATH_SEGMENT@12..23 + NAME_REF@12..15 + IDENT@12..15 "Box" + TYPE_ARG_LIST@15..23 + L_ANGLE@15..16 "<" + TYPE_ARG@16..22 + DYN_TRAIT_TYPE@16..22 + TYPE_BOUND_LIST@16..22 + TYPE_BOUND@16..17 + PATH_TYPE@16..17 + PATH@16..17 + PATH_SEGMENT@16..17 + NAME_REF@16..17 + IDENT@16..17 "T" + WHITESPACE@17..18 " " + PLUS@18..19 "+" + WHITESPACE@19..20 " " + TYPE_BOUND@20..22 + LIFETIME@20..22 "\'f" + R_ANGLE@22..23 ">" + WHITESPACE@23..24 " " + BLOCK_EXPR@24..26 + BLOCK@24..26 + L_CURLY@24..25 "{" + R_CURLY@25..26 "}" + WHITESPACE@26..27 "\n" + FN_DEF@27..57 + FN_KW@27..29 "fn" + WHITESPACE@29..30 " " + NAME@30..33 + IDENT@30..33 "foo" + PARAM_LIST@33..35 + L_PAREN@33..34 "(" + R_PAREN@34..35 ")" + WHITESPACE@35..36 " " + RET_TYPE@36..54 + THIN_ARROW@36..38 "->" + WHITESPACE@38..39 " " + PATH_TYPE@39..54 + PATH@39..54 + PATH_SEGMENT@39..54 + NAME_REF@39..42 + IDENT@39..42 "Box" + TYPE_ARG_LIST@42..54 + L_ANGLE@42..43 "<" + TYPE_ARG@43..53 + DYN_TRAIT_TYPE@43..53 + DYN_KW@43..46 "dyn" + WHITESPACE@46..47 " " + TYPE_BOUND_LIST@47..53 + TYPE_BOUND@47..48 + PATH_TYPE@47..48 + PATH@47..48 + PATH_SEGMENT@47..48 + NAME_REF@47..48 + IDENT@47..48 "T" + WHITESPACE@48..49 " " + PLUS@49..50 "+" + WHITESPACE@50..51 " " + TYPE_BOUND@51..53 + LIFETIME@51..53 "\'f" + R_ANGLE@53..54 ">" + WHITESPACE@54..55 " " + BLOCK_EXPR@55..57 + BLOCK@55..57 + L_CURLY@55..56 "{" + R_CURLY@56..57 "}" + WHITESPACE@57..58 "\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 036035f6c3..8bf62cda90 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 @@ -1,22 +1,22 @@ -SOURCE_FILE@[0; 22) - TRAIT_DEF@[0; 21) - TRAIT_KW@[0; 5) "trait" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "T" - WHITESPACE@[7; 8) " " - ITEM_LIST@[8; 21) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 10) " " - FN_DEF@[10; 19) - FN_KW@[10; 12) "fn" - WHITESPACE@[12; 13) " " - NAME@[13; 16) - IDENT@[13; 16) "foo" - PARAM_LIST@[16; 18) - L_PAREN@[16; 17) "(" - R_PAREN@[17; 18) ")" - SEMICOLON@[18; 19) ";" - WHITESPACE@[19; 20) " " - R_CURLY@[20; 21) "}" - WHITESPACE@[21; 22) "\n" +SOURCE_FILE@0..22 + TRAIT_DEF@0..21 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "T" + WHITESPACE@7..8 " " + ITEM_LIST@8..21 + L_CURLY@8..9 "{" + WHITESPACE@9..10 " " + FN_DEF@10..19 + FN_KW@10..12 "fn" + WHITESPACE@12..13 " " + NAME@13..16 + IDENT@13..16 "foo" + PARAM_LIST@16..18 + L_PAREN@16..17 "(" + R_PAREN@17..18 ")" + SEMICOLON@18..19 ";" + WHITESPACE@19..20 " " + R_CURLY@20..21 "}" + 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 d9fc5eb8ac..798ef2a481 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 @@ -1,14 +1,14 @@ -SOURCE_FILE@[0; 13) - TYPE_ALIAS_DEF@[0; 12) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - TUPLE_TYPE@[9; 11) - L_PAREN@[9; 10) "(" - R_PAREN@[10; 11) ")" - SEMICOLON@[11; 12) ";" - WHITESPACE@[12; 13) "\n" +SOURCE_FILE@0..13 + TYPE_ALIAS_DEF@0..12 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + TUPLE_TYPE@9..11 + L_PAREN@9..10 "(" + R_PAREN@10..11 ")" + SEMICOLON@11..12 ";" + 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 8647c23bfe..0d2f5ff56d 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 @@ -1,70 +1,70 @@ -SOURCE_FILE@[0; 71) - TYPE_ALIAS_DEF@[0; 13) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - PATH_TYPE@[9; 12) - PATH@[9; 12) - PATH_SEGMENT@[9; 12) - NAME_REF@[9; 12) - IDENT@[9; 12) "Foo" - SEMICOLON@[12; 13) ";" - WHITESPACE@[13; 14) "\n" - TYPE_ALIAS_DEF@[14; 29) - TYPE_KW@[14; 18) "type" - WHITESPACE@[18; 19) " " - NAME@[19; 20) - IDENT@[19; 20) "B" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - PATH_TYPE@[23; 28) - PATH@[23; 28) - PATH_SEGMENT@[23; 28) - COLON2@[23; 25) "::" - NAME_REF@[25; 28) - IDENT@[25; 28) "Foo" - SEMICOLON@[28; 29) ";" - WHITESPACE@[29; 30) "\n" - TYPE_ALIAS_DEF@[30; 49) - TYPE_KW@[30; 34) "type" - WHITESPACE@[34; 35) " " - NAME@[35; 36) - IDENT@[35; 36) "C" - WHITESPACE@[36; 37) " " - EQ@[37; 38) "=" - WHITESPACE@[38; 39) " " - PATH_TYPE@[39; 48) - PATH@[39; 48) - PATH@[39; 43) - PATH_SEGMENT@[39; 43) - SELF_KW@[39; 43) "self" - COLON2@[43; 45) "::" - PATH_SEGMENT@[45; 48) - NAME_REF@[45; 48) - IDENT@[45; 48) "Foo" - SEMICOLON@[48; 49) ";" - WHITESPACE@[49; 50) "\n" - TYPE_ALIAS_DEF@[50; 70) - TYPE_KW@[50; 54) "type" - WHITESPACE@[54; 55) " " - NAME@[55; 56) - IDENT@[55; 56) "D" - WHITESPACE@[56; 57) " " - EQ@[57; 58) "=" - WHITESPACE@[58; 59) " " - PATH_TYPE@[59; 69) - PATH@[59; 69) - PATH@[59; 64) - PATH_SEGMENT@[59; 64) - SUPER_KW@[59; 64) "super" - COLON2@[64; 66) "::" - PATH_SEGMENT@[66; 69) - NAME_REF@[66; 69) - IDENT@[66; 69) "Foo" - SEMICOLON@[69; 70) ";" - WHITESPACE@[70; 71) "\n" +SOURCE_FILE@0..71 + TYPE_ALIAS_DEF@0..13 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + PATH_TYPE@9..12 + PATH@9..12 + PATH_SEGMENT@9..12 + NAME_REF@9..12 + IDENT@9..12 "Foo" + SEMICOLON@12..13 ";" + WHITESPACE@13..14 "\n" + TYPE_ALIAS_DEF@14..29 + TYPE_KW@14..18 "type" + WHITESPACE@18..19 " " + NAME@19..20 + IDENT@19..20 "B" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + PATH_TYPE@23..28 + PATH@23..28 + PATH_SEGMENT@23..28 + COLON2@23..25 "::" + NAME_REF@25..28 + IDENT@25..28 "Foo" + SEMICOLON@28..29 ";" + WHITESPACE@29..30 "\n" + TYPE_ALIAS_DEF@30..49 + TYPE_KW@30..34 "type" + WHITESPACE@34..35 " " + NAME@35..36 + IDENT@35..36 "C" + WHITESPACE@36..37 " " + EQ@37..38 "=" + WHITESPACE@38..39 " " + PATH_TYPE@39..48 + PATH@39..48 + PATH@39..43 + PATH_SEGMENT@39..43 + SELF_KW@39..43 "self" + COLON2@43..45 "::" + PATH_SEGMENT@45..48 + NAME_REF@45..48 + IDENT@45..48 "Foo" + SEMICOLON@48..49 ";" + WHITESPACE@49..50 "\n" + TYPE_ALIAS_DEF@50..70 + TYPE_KW@50..54 "type" + WHITESPACE@54..55 " " + NAME@55..56 + IDENT@55..56 "D" + WHITESPACE@56..57 " " + EQ@57..58 "=" + WHITESPACE@58..59 " " + PATH_TYPE@59..69 + PATH@59..69 + PATH@59..64 + PATH_SEGMENT@59..64 + SUPER_KW@59..64 "super" + COLON2@64..66 "::" + PATH_SEGMENT@66..69 + NAME_REF@66..69 + IDENT@66..69 "Foo" + SEMICOLON@69..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 690d8504ea..5f846177e6 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 @@ -1,96 +1,96 @@ -SOURCE_FILE@[0; 91) - FN_DEF@[0; 90) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 90) - BLOCK@[9; 90) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 25) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - PATH_EXPR@[23; 24) - PATH@[23; 24) - PATH_SEGMENT@[23; 24) - NAME_REF@[23; 24) - IDENT@[23; 24) "a" - SEMICOLON@[24; 25) ";" - WHITESPACE@[25; 30) "\n " - LET_STMT@[30; 43) - LET_KW@[30; 33) "let" - WHITESPACE@[33; 34) " " - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - EQ@[36; 37) "=" - WHITESPACE@[37; 38) " " - PATH_EXPR@[38; 42) - PATH@[38; 42) - PATH@[38; 39) - PATH_SEGMENT@[38; 39) - NAME_REF@[38; 39) - IDENT@[38; 39) "a" - COLON2@[39; 41) "::" - PATH_SEGMENT@[41; 42) - NAME_REF@[41; 42) - IDENT@[41; 42) "b" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 48) "\n " - LET_STMT@[48; 65) - LET_KW@[48; 51) "let" - WHITESPACE@[51; 52) " " - PLACEHOLDER_PAT@[52; 53) - UNDERSCORE@[52; 53) "_" - WHITESPACE@[53; 54) " " - EQ@[54; 55) "=" - WHITESPACE@[55; 56) " " - PATH_EXPR@[56; 64) - PATH@[56; 64) - PATH_SEGMENT@[56; 64) - COLON2@[56; 58) "::" - NAME_REF@[58; 59) - IDENT@[58; 59) "a" - TYPE_ARG_LIST@[59; 64) - COLON2@[59; 61) "::" - L_ANGLE@[61; 62) "<" - TYPE_ARG@[62; 63) - PATH_TYPE@[62; 63) - PATH@[62; 63) - PATH_SEGMENT@[62; 63) - NAME_REF@[62; 63) - IDENT@[62; 63) "b" - R_ANGLE@[63; 64) ">" - SEMICOLON@[64; 65) ";" - WHITESPACE@[65; 70) "\n " - LET_STMT@[70; 88) - LET_KW@[70; 73) "let" - WHITESPACE@[73; 74) " " - PLACEHOLDER_PAT@[74; 75) - UNDERSCORE@[74; 75) "_" - WHITESPACE@[75; 76) " " - EQ@[76; 77) "=" - WHITESPACE@[77; 78) " " - MACRO_CALL@[78; 87) - PATH@[78; 84) - PATH_SEGMENT@[78; 84) - NAME_REF@[78; 84) - IDENT@[78; 84) "format" - BANG@[84; 85) "!" - TOKEN_TREE@[85; 87) - L_PAREN@[85; 86) "(" - R_PAREN@[86; 87) ")" - SEMICOLON@[87; 88) ";" - WHITESPACE@[88; 89) "\n" - R_CURLY@[89; 90) "}" - WHITESPACE@[90; 91) "\n" +SOURCE_FILE@0..91 + FN_DEF@0..90 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..90 + BLOCK@9..90 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..25 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + PATH_EXPR@23..24 + PATH@23..24 + PATH_SEGMENT@23..24 + NAME_REF@23..24 + IDENT@23..24 "a" + SEMICOLON@24..25 ";" + WHITESPACE@25..30 "\n " + LET_STMT@30..43 + LET_KW@30..33 "let" + WHITESPACE@33..34 " " + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + EQ@36..37 "=" + WHITESPACE@37..38 " " + PATH_EXPR@38..42 + PATH@38..42 + PATH@38..39 + PATH_SEGMENT@38..39 + NAME_REF@38..39 + IDENT@38..39 "a" + COLON2@39..41 "::" + PATH_SEGMENT@41..42 + NAME_REF@41..42 + IDENT@41..42 "b" + SEMICOLON@42..43 ";" + WHITESPACE@43..48 "\n " + LET_STMT@48..65 + LET_KW@48..51 "let" + WHITESPACE@51..52 " " + PLACEHOLDER_PAT@52..53 + UNDERSCORE@52..53 "_" + WHITESPACE@53..54 " " + EQ@54..55 "=" + WHITESPACE@55..56 " " + PATH_EXPR@56..64 + PATH@56..64 + PATH_SEGMENT@56..64 + COLON2@56..58 "::" + NAME_REF@58..59 + IDENT@58..59 "a" + TYPE_ARG_LIST@59..64 + COLON2@59..61 "::" + L_ANGLE@61..62 "<" + TYPE_ARG@62..63 + PATH_TYPE@62..63 + PATH@62..63 + PATH_SEGMENT@62..63 + NAME_REF@62..63 + IDENT@62..63 "b" + R_ANGLE@63..64 ">" + SEMICOLON@64..65 ";" + WHITESPACE@65..70 "\n " + LET_STMT@70..88 + LET_KW@70..73 "let" + WHITESPACE@73..74 " " + PLACEHOLDER_PAT@74..75 + UNDERSCORE@74..75 "_" + WHITESPACE@75..76 " " + EQ@76..77 "=" + WHITESPACE@77..78 " " + MACRO_CALL@78..87 + PATH@78..84 + PATH_SEGMENT@78..84 + NAME_REF@78..84 + IDENT@78..84 "format" + BANG@84..85 "!" + TOKEN_TREE@85..87 + L_PAREN@85..86 "(" + R_PAREN@86..87 ")" + SEMICOLON@87..88 ";" + WHITESPACE@88..89 "\n" + R_CURLY@89..90 "}" + WHITESPACE@90..91 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast b/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast index 731c31f763..6362aa02d5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0054_record_field_attrs.rast @@ -1,44 +1,44 @@ -SOURCE_FILE@[0; 64) - STRUCT_DEF@[0; 63) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - RECORD_FIELD_DEF_LIST@[9; 63) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - RECORD_FIELD_DEF@[15; 60) - ATTR@[15; 43) - POUND@[15; 16) "#" - L_BRACK@[16; 17) "[" - PATH@[17; 22) - PATH_SEGMENT@[17; 22) - NAME_REF@[17; 22) - IDENT@[17; 22) "serde" - TOKEN_TREE@[22; 42) - L_PAREN@[22; 23) "(" - IDENT@[23; 27) "with" - WHITESPACE@[27; 28) " " - EQ@[28; 29) "=" - WHITESPACE@[29; 30) " " - STRING@[30; 41) "\"url_serde\"" - R_PAREN@[41; 42) ")" - R_BRACK@[42; 43) "]" - WHITESPACE@[43; 48) "\n " - VISIBILITY@[48; 51) - PUB_KW@[48; 51) "pub" - WHITESPACE@[51; 52) " " - NAME@[52; 55) - IDENT@[52; 55) "uri" - COLON@[55; 56) ":" - WHITESPACE@[56; 57) " " - PATH_TYPE@[57; 60) - PATH@[57; 60) - PATH_SEGMENT@[57; 60) - NAME_REF@[57; 60) - IDENT@[57; 60) "Uri" - COMMA@[60; 61) "," - WHITESPACE@[61; 62) "\n" - R_CURLY@[62; 63) "}" - WHITESPACE@[63; 64) "\n" +SOURCE_FILE@0..64 + STRUCT_DEF@0..63 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + RECORD_FIELD_DEF_LIST@9..63 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + RECORD_FIELD_DEF@15..60 + ATTR@15..43 + POUND@15..16 "#" + L_BRACK@16..17 "[" + PATH@17..22 + PATH_SEGMENT@17..22 + NAME_REF@17..22 + IDENT@17..22 "serde" + TOKEN_TREE@22..42 + L_PAREN@22..23 "(" + IDENT@23..27 "with" + WHITESPACE@27..28 " " + EQ@28..29 "=" + WHITESPACE@29..30 " " + STRING@30..41 "\"url_serde\"" + R_PAREN@41..42 ")" + R_BRACK@42..43 "]" + WHITESPACE@43..48 "\n " + VISIBILITY@48..51 + PUB_KW@48..51 "pub" + WHITESPACE@51..52 " " + NAME@52..55 + IDENT@52..55 "uri" + COLON@55..56 ":" + WHITESPACE@56..57 " " + PATH_TYPE@57..60 + PATH@57..60 + PATH_SEGMENT@57..60 + NAME_REF@57..60 + IDENT@57..60 "Uri" + COMMA@60..61 "," + WHITESPACE@61..62 "\n" + R_CURLY@62..63 "}" + WHITESPACE@63..64 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast index 2b28cec672..d9310e82eb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0055_literal_pattern.rast @@ -1,77 +1,77 @@ -SOURCE_FILE@[0; 113) - FN_DEF@[0; 112) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 112) - BLOCK@[10; 112) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - MATCH_EXPR@[16; 110) - MATCH_KW@[16; 21) "match" - WHITESPACE@[21; 22) " " - TUPLE_EXPR@[22; 24) - L_PAREN@[22; 23) "(" - R_PAREN@[23; 24) ")" - WHITESPACE@[24; 25) " " - MATCH_ARM_LIST@[25; 110) - L_CURLY@[25; 26) "{" - WHITESPACE@[26; 35) "\n " - MATCH_ARM@[35; 43) - LITERAL_PAT@[35; 37) - MINUS@[35; 36) "-" - LITERAL@[36; 37) - INT_NUMBER@[36; 37) "1" - WHITESPACE@[37; 38) " " - FAT_ARROW@[38; 40) "=>" - WHITESPACE@[40; 41) " " - TUPLE_EXPR@[41; 43) - L_PAREN@[41; 42) "(" - R_PAREN@[42; 43) ")" - COMMA@[43; 44) "," - WHITESPACE@[44; 53) "\n " - MATCH_ARM@[53; 61) - LITERAL_PAT@[53; 55) - LITERAL@[53; 55) - INT_NUMBER@[53; 55) "92" - WHITESPACE@[55; 56) " " - FAT_ARROW@[56; 58) "=>" - WHITESPACE@[58; 59) " " - TUPLE_EXPR@[59; 61) - L_PAREN@[59; 60) "(" - R_PAREN@[60; 61) ")" - COMMA@[61; 62) "," - WHITESPACE@[62; 71) "\n " - MATCH_ARM@[71; 80) - LITERAL_PAT@[71; 74) - LITERAL@[71; 74) - CHAR@[71; 74) "\'c\'" - WHITESPACE@[74; 75) " " - FAT_ARROW@[75; 77) "=>" - WHITESPACE@[77; 78) " " - TUPLE_EXPR@[78; 80) - L_PAREN@[78; 79) "(" - R_PAREN@[79; 80) ")" - COMMA@[80; 81) "," - WHITESPACE@[81; 90) "\n " - MATCH_ARM@[90; 103) - LITERAL_PAT@[90; 97) - LITERAL@[90; 97) - STRING@[90; 97) "\"hello\"" - WHITESPACE@[97; 98) " " - FAT_ARROW@[98; 100) "=>" - WHITESPACE@[100; 101) " " - TUPLE_EXPR@[101; 103) - L_PAREN@[101; 102) "(" - R_PAREN@[102; 103) ")" - COMMA@[103; 104) "," - WHITESPACE@[104; 109) "\n " - R_CURLY@[109; 110) "}" - WHITESPACE@[110; 111) "\n" - R_CURLY@[111; 112) "}" - WHITESPACE@[112; 113) "\n" +SOURCE_FILE@0..113 + FN_DEF@0..112 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..112 + BLOCK@10..112 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + MATCH_EXPR@16..110 + MATCH_KW@16..21 "match" + WHITESPACE@21..22 " " + TUPLE_EXPR@22..24 + L_PAREN@22..23 "(" + R_PAREN@23..24 ")" + WHITESPACE@24..25 " " + MATCH_ARM_LIST@25..110 + L_CURLY@25..26 "{" + WHITESPACE@26..35 "\n " + MATCH_ARM@35..43 + LITERAL_PAT@35..37 + MINUS@35..36 "-" + LITERAL@36..37 + INT_NUMBER@36..37 "1" + WHITESPACE@37..38 " " + FAT_ARROW@38..40 "=>" + WHITESPACE@40..41 " " + TUPLE_EXPR@41..43 + L_PAREN@41..42 "(" + R_PAREN@42..43 ")" + COMMA@43..44 "," + WHITESPACE@44..53 "\n " + MATCH_ARM@53..61 + LITERAL_PAT@53..55 + LITERAL@53..55 + INT_NUMBER@53..55 "92" + WHITESPACE@55..56 " " + FAT_ARROW@56..58 "=>" + WHITESPACE@58..59 " " + TUPLE_EXPR@59..61 + L_PAREN@59..60 "(" + R_PAREN@60..61 ")" + COMMA@61..62 "," + WHITESPACE@62..71 "\n " + MATCH_ARM@71..80 + LITERAL_PAT@71..74 + LITERAL@71..74 + CHAR@71..74 "\'c\'" + WHITESPACE@74..75 " " + FAT_ARROW@75..77 "=>" + WHITESPACE@77..78 " " + TUPLE_EXPR@78..80 + L_PAREN@78..79 "(" + R_PAREN@79..80 ")" + COMMA@80..81 "," + WHITESPACE@81..90 "\n " + MATCH_ARM@90..103 + LITERAL_PAT@90..97 + LITERAL@90..97 + STRING@90..97 "\"hello\"" + WHITESPACE@97..98 " " + FAT_ARROW@98..100 "=>" + WHITESPACE@100..101 " " + TUPLE_EXPR@101..103 + L_PAREN@101..102 "(" + R_PAREN@102..103 ")" + COMMA@103..104 "," + WHITESPACE@104..109 "\n " + R_CURLY@109..110 "}" + WHITESPACE@110..111 "\n" + R_CURLY@111..112 "}" + WHITESPACE@112..113 "\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 c6082791a0..2e727c1efb 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 @@ -1,111 +1,111 @@ -SOURCE_FILE@[0; 116) - FN_DEF@[0; 115) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) "\n" - WHERE_CLAUSE@[9; 112) - WHERE_KW@[9; 14) "where" - WHITESPACE@[14; 18) "\n " - WHERE_PRED@[18; 29) - LIFETIME@[18; 20) "\'a" - COLON@[20; 21) ":" - WHITESPACE@[21; 22) " " - TYPE_BOUND_LIST@[22; 29) - TYPE_BOUND@[22; 24) - LIFETIME@[22; 24) "\'b" - WHITESPACE@[24; 25) " " - PLUS@[25; 26) "+" - WHITESPACE@[26; 27) " " - TYPE_BOUND@[27; 29) - LIFETIME@[27; 29) "\'c" - COMMA@[29; 30) "," - WHITESPACE@[30; 34) "\n " - WHERE_PRED@[34; 59) - PATH_TYPE@[34; 35) - PATH@[34; 35) - PATH_SEGMENT@[34; 35) - NAME_REF@[34; 35) - IDENT@[34; 35) "T" - COLON@[35; 36) ":" - WHITESPACE@[36; 37) " " - TYPE_BOUND_LIST@[37; 59) - TYPE_BOUND@[37; 42) - PATH_TYPE@[37; 42) - PATH@[37; 42) - PATH_SEGMENT@[37; 42) - NAME_REF@[37; 42) - IDENT@[37; 42) "Clone" - WHITESPACE@[42; 43) " " - PLUS@[43; 44) "+" - WHITESPACE@[44; 45) " " - TYPE_BOUND@[45; 49) - PATH_TYPE@[45; 49) - PATH@[45; 49) - PATH_SEGMENT@[45; 49) - NAME_REF@[45; 49) - IDENT@[45; 49) "Copy" - WHITESPACE@[49; 50) " " - PLUS@[50; 51) "+" - WHITESPACE@[51; 52) " " - TYPE_BOUND@[52; 59) - LIFETIME@[52; 59) "\'static" - COMMA@[59; 60) "," - WHITESPACE@[60; 64) "\n " - WHERE_PRED@[64; 82) - PATH_TYPE@[64; 78) - PATH@[64; 78) - PATH@[64; 72) - PATH_SEGMENT@[64; 72) - NAME_REF@[64; 72) - IDENT@[64; 72) "Iterator" - COLON2@[72; 74) "::" - PATH_SEGMENT@[74; 78) - NAME_REF@[74; 78) - IDENT@[74; 78) "Item" - COLON@[78; 79) ":" - WHITESPACE@[79; 80) " " - TYPE_BOUND_LIST@[80; 82) - TYPE_BOUND@[80; 82) - LIFETIME@[80; 82) "\'a" - COMMA@[82; 83) "," - WHITESPACE@[83; 87) "\n " - WHERE_PRED@[87; 112) - PATH_TYPE@[87; 108) - PATH@[87; 108) - PATH@[87; 102) - PATH_SEGMENT@[87; 102) - L_ANGLE@[87; 88) "<" - PATH_TYPE@[88; 89) - PATH@[88; 89) - PATH_SEGMENT@[88; 89) - NAME_REF@[88; 89) - IDENT@[88; 89) "T" - WHITESPACE@[89; 90) " " - AS_KW@[90; 92) "as" - WHITESPACE@[92; 93) " " - PATH_TYPE@[93; 101) - PATH@[93; 101) - PATH_SEGMENT@[93; 101) - NAME_REF@[93; 101) - IDENT@[93; 101) "Iterator" - R_ANGLE@[101; 102) ">" - COLON2@[102; 104) "::" - PATH_SEGMENT@[104; 108) - NAME_REF@[104; 108) - IDENT@[104; 108) "Item" - COLON@[108; 109) ":" - WHITESPACE@[109; 110) " " - TYPE_BOUND_LIST@[110; 112) - TYPE_BOUND@[110; 112) - LIFETIME@[110; 112) "\'a" - WHITESPACE@[112; 113) "\n" - BLOCK_EXPR@[113; 115) - BLOCK@[113; 115) - L_CURLY@[113; 114) "{" - R_CURLY@[114; 115) "}" - WHITESPACE@[115; 116) "\n" +SOURCE_FILE@0..116 + FN_DEF@0..115 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 "\n" + WHERE_CLAUSE@9..112 + WHERE_KW@9..14 "where" + WHITESPACE@14..18 "\n " + WHERE_PRED@18..29 + LIFETIME@18..20 "\'a" + COLON@20..21 ":" + WHITESPACE@21..22 " " + TYPE_BOUND_LIST@22..29 + TYPE_BOUND@22..24 + LIFETIME@22..24 "\'b" + WHITESPACE@24..25 " " + PLUS@25..26 "+" + WHITESPACE@26..27 " " + TYPE_BOUND@27..29 + LIFETIME@27..29 "\'c" + COMMA@29..30 "," + WHITESPACE@30..34 "\n " + WHERE_PRED@34..59 + PATH_TYPE@34..35 + PATH@34..35 + PATH_SEGMENT@34..35 + NAME_REF@34..35 + IDENT@34..35 "T" + COLON@35..36 ":" + WHITESPACE@36..37 " " + TYPE_BOUND_LIST@37..59 + TYPE_BOUND@37..42 + PATH_TYPE@37..42 + PATH@37..42 + PATH_SEGMENT@37..42 + NAME_REF@37..42 + IDENT@37..42 "Clone" + WHITESPACE@42..43 " " + PLUS@43..44 "+" + WHITESPACE@44..45 " " + TYPE_BOUND@45..49 + PATH_TYPE@45..49 + PATH@45..49 + PATH_SEGMENT@45..49 + NAME_REF@45..49 + IDENT@45..49 "Copy" + WHITESPACE@49..50 " " + PLUS@50..51 "+" + WHITESPACE@51..52 " " + TYPE_BOUND@52..59 + LIFETIME@52..59 "\'static" + COMMA@59..60 "," + WHITESPACE@60..64 "\n " + WHERE_PRED@64..82 + PATH_TYPE@64..78 + PATH@64..78 + PATH@64..72 + PATH_SEGMENT@64..72 + NAME_REF@64..72 + IDENT@64..72 "Iterator" + COLON2@72..74 "::" + PATH_SEGMENT@74..78 + NAME_REF@74..78 + IDENT@74..78 "Item" + COLON@78..79 ":" + WHITESPACE@79..80 " " + TYPE_BOUND_LIST@80..82 + TYPE_BOUND@80..82 + LIFETIME@80..82 "\'a" + COMMA@82..83 "," + WHITESPACE@83..87 "\n " + WHERE_PRED@87..112 + PATH_TYPE@87..108 + PATH@87..108 + PATH@87..102 + PATH_SEGMENT@87..102 + L_ANGLE@87..88 "<" + PATH_TYPE@88..89 + PATH@88..89 + PATH_SEGMENT@88..89 + NAME_REF@88..89 + IDENT@88..89 "T" + WHITESPACE@89..90 " " + AS_KW@90..92 "as" + WHITESPACE@92..93 " " + PATH_TYPE@93..101 + PATH@93..101 + PATH_SEGMENT@93..101 + NAME_REF@93..101 + IDENT@93..101 "Iterator" + R_ANGLE@101..102 ">" + COLON2@102..104 "::" + PATH_SEGMENT@104..108 + NAME_REF@104..108 + IDENT@104..108 "Item" + COLON@108..109 ":" + WHITESPACE@109..110 " " + TYPE_BOUND_LIST@110..112 + TYPE_BOUND@110..112 + LIFETIME@110..112 "\'a" + WHITESPACE@112..113 "\n" + BLOCK_EXPR@113..115 + BLOCK@113..115 + L_CURLY@113..114 "{" + R_CURLY@114..115 "}" + WHITESPACE@115..116 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast index 9788197bea..c1e58f9bf9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0057_const_fn.rast @@ -1,17 +1,17 @@ -SOURCE_FILE@[0; 18) - FN_DEF@[0; 17) - CONST_KW@[0; 5) "const" - WHITESPACE@[5; 6) " " - FN_KW@[6; 8) "fn" - WHITESPACE@[8; 9) " " - NAME@[9; 12) - IDENT@[9; 12) "foo" - PARAM_LIST@[12; 14) - L_PAREN@[12; 13) "(" - R_PAREN@[13; 14) ")" - WHITESPACE@[14; 15) " " - BLOCK_EXPR@[15; 17) - BLOCK@[15; 17) - L_CURLY@[15; 16) "{" - R_CURLY@[16; 17) "}" - WHITESPACE@[17; 18) "\n" +SOURCE_FILE@0..18 + FN_DEF@0..17 + CONST_KW@0..5 "const" + WHITESPACE@5..6 " " + FN_KW@6..8 "fn" + WHITESPACE@8..9 " " + NAME@9..12 + IDENT@9..12 "foo" + PARAM_LIST@12..14 + L_PAREN@12..13 "(" + R_PAREN@13..14 ")" + WHITESPACE@14..15 " " + BLOCK_EXPR@15..17 + BLOCK@15..17 + L_CURLY@15..16 "{" + R_CURLY@16..17 "}" + WHITESPACE@17..18 "\n" 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 8d7083e971..9bdf2379f1 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 @@ -1,83 +1,83 @@ -SOURCE_FILE@[0; 112) - FN_DEF@[0; 111) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 111) - BLOCK@[10; 111) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - MATCH_EXPR@[16; 109) - MATCH_KW@[16; 21) "match" - WHITESPACE@[21; 22) " " - LITERAL@[22; 24) - INT_NUMBER@[22; 24) "92" - WHITESPACE@[24; 25) " " - MATCH_ARM_LIST@[25; 109) - L_CURLY@[25; 26) "{" - WHITESPACE@[26; 35) "\n " - MATCH_ARM@[35; 50) - RANGE_PAT@[35; 44) - LITERAL_PAT@[35; 36) - LITERAL@[35; 36) - INT_NUMBER@[35; 36) "0" - WHITESPACE@[36; 37) " " - DOT3@[37; 40) "..." - WHITESPACE@[40; 41) " " - LITERAL_PAT@[41; 44) - LITERAL@[41; 44) - INT_NUMBER@[41; 44) "100" - WHITESPACE@[44; 45) " " - FAT_ARROW@[45; 47) "=>" - WHITESPACE@[47; 48) " " - TUPLE_EXPR@[48; 50) - L_PAREN@[48; 49) "(" - R_PAREN@[49; 50) ")" - COMMA@[50; 51) "," - WHITESPACE@[51; 60) "\n " - MATCH_ARM@[60; 77) - RANGE_PAT@[60; 71) - LITERAL_PAT@[60; 63) - LITERAL@[60; 63) - INT_NUMBER@[60; 63) "101" - WHITESPACE@[63; 64) " " - DOT2EQ@[64; 67) "..=" - WHITESPACE@[67; 68) " " - LITERAL_PAT@[68; 71) - LITERAL@[68; 71) - INT_NUMBER@[68; 71) "200" - WHITESPACE@[71; 72) " " - FAT_ARROW@[72; 74) "=>" - WHITESPACE@[74; 75) " " - TUPLE_EXPR@[75; 77) - L_PAREN@[75; 76) "(" - R_PAREN@[76; 77) ")" - COMMA@[77; 78) "," - WHITESPACE@[78; 87) "\n " - MATCH_ARM@[87; 102) - RANGE_PAT@[87; 97) - LITERAL_PAT@[87; 90) - LITERAL@[87; 90) - INT_NUMBER@[87; 90) "200" - WHITESPACE@[90; 91) " " - DOT2@[91; 93) ".." - WHITESPACE@[93; 94) " " - LITERAL_PAT@[94; 97) - LITERAL@[94; 97) - INT_NUMBER@[94; 97) "301" - FAT_ARROW@[97; 99) "=>" - WHITESPACE@[99; 100) " " - TUPLE_EXPR@[100; 102) - L_PAREN@[100; 101) "(" - R_PAREN@[101; 102) ")" - COMMA@[102; 103) "," - WHITESPACE@[103; 108) "\n " - R_CURLY@[108; 109) "}" - WHITESPACE@[109; 110) "\n" - R_CURLY@[110; 111) "}" - WHITESPACE@[111; 112) "\n" +SOURCE_FILE@0..112 + FN_DEF@0..111 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..111 + BLOCK@10..111 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + MATCH_EXPR@16..109 + MATCH_KW@16..21 "match" + WHITESPACE@21..22 " " + LITERAL@22..24 + INT_NUMBER@22..24 "92" + WHITESPACE@24..25 " " + MATCH_ARM_LIST@25..109 + L_CURLY@25..26 "{" + WHITESPACE@26..35 "\n " + MATCH_ARM@35..50 + RANGE_PAT@35..44 + LITERAL_PAT@35..36 + LITERAL@35..36 + INT_NUMBER@35..36 "0" + WHITESPACE@36..37 " " + DOT3@37..40 "..." + WHITESPACE@40..41 " " + LITERAL_PAT@41..44 + LITERAL@41..44 + INT_NUMBER@41..44 "100" + WHITESPACE@44..45 " " + FAT_ARROW@45..47 "=>" + WHITESPACE@47..48 " " + TUPLE_EXPR@48..50 + L_PAREN@48..49 "(" + R_PAREN@49..50 ")" + COMMA@50..51 "," + WHITESPACE@51..60 "\n " + MATCH_ARM@60..77 + RANGE_PAT@60..71 + LITERAL_PAT@60..63 + LITERAL@60..63 + INT_NUMBER@60..63 "101" + WHITESPACE@63..64 " " + DOT2EQ@64..67 "..=" + WHITESPACE@67..68 " " + LITERAL_PAT@68..71 + LITERAL@68..71 + INT_NUMBER@68..71 "200" + WHITESPACE@71..72 " " + FAT_ARROW@72..74 "=>" + WHITESPACE@74..75 " " + TUPLE_EXPR@75..77 + L_PAREN@75..76 "(" + R_PAREN@76..77 ")" + COMMA@77..78 "," + WHITESPACE@78..87 "\n " + MATCH_ARM@87..102 + RANGE_PAT@87..97 + LITERAL_PAT@87..90 + LITERAL@87..90 + INT_NUMBER@87..90 "200" + WHITESPACE@90..91 " " + DOT2@91..93 ".." + WHITESPACE@93..94 " " + LITERAL_PAT@94..97 + LITERAL@94..97 + INT_NUMBER@94..97 "301" + FAT_ARROW@97..99 "=>" + WHITESPACE@99..100 " " + TUPLE_EXPR@100..102 + L_PAREN@100..101 "(" + R_PAREN@101..102 ")" + COMMA@102..103 "," + WHITESPACE@103..108 "\n " + R_CURLY@108..109 "}" + WHITESPACE@109..110 "\n" + R_CURLY@110..111 "}" + WHITESPACE@111..112 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast index efcd89c4c3..e9ca92364b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0059_match_arms_commas.rast @@ -1,60 +1,60 @@ -SOURCE_FILE@[0; 83) - FN_DEF@[0; 82) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 82) - BLOCK@[9; 82) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - MATCH_EXPR@[15; 80) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 80) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 41) - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - FAT_ARROW@[36; 38) "=>" - WHITESPACE@[38; 39) " " - TUPLE_EXPR@[39; 41) - L_PAREN@[39; 40) "(" - R_PAREN@[40; 41) ")" - COMMA@[41; 42) "," - WHITESPACE@[42; 51) "\n " - MATCH_ARM@[51; 58) - PLACEHOLDER_PAT@[51; 52) - UNDERSCORE@[51; 52) "_" - WHITESPACE@[52; 53) " " - FAT_ARROW@[53; 55) "=>" - WHITESPACE@[55; 56) " " - BLOCK_EXPR@[56; 58) - BLOCK@[56; 58) - L_CURLY@[56; 57) "{" - R_CURLY@[57; 58) "}" - WHITESPACE@[58; 67) "\n " - MATCH_ARM@[67; 74) - PLACEHOLDER_PAT@[67; 68) - UNDERSCORE@[67; 68) "_" - WHITESPACE@[68; 69) " " - FAT_ARROW@[69; 71) "=>" - WHITESPACE@[71; 72) " " - TUPLE_EXPR@[72; 74) - L_PAREN@[72; 73) "(" - R_PAREN@[73; 74) ")" - WHITESPACE@[74; 79) "\n " - R_CURLY@[79; 80) "}" - WHITESPACE@[80; 81) "\n" - R_CURLY@[81; 82) "}" - WHITESPACE@[82; 83) "\n" +SOURCE_FILE@0..83 + FN_DEF@0..82 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..82 + BLOCK@9..82 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + MATCH_EXPR@15..80 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..80 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..41 + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + FAT_ARROW@36..38 "=>" + WHITESPACE@38..39 " " + TUPLE_EXPR@39..41 + L_PAREN@39..40 "(" + R_PAREN@40..41 ")" + COMMA@41..42 "," + WHITESPACE@42..51 "\n " + MATCH_ARM@51..58 + PLACEHOLDER_PAT@51..52 + UNDERSCORE@51..52 "_" + WHITESPACE@52..53 " " + FAT_ARROW@53..55 "=>" + WHITESPACE@55..56 " " + BLOCK_EXPR@56..58 + BLOCK@56..58 + L_CURLY@56..57 "{" + R_CURLY@57..58 "}" + WHITESPACE@58..67 "\n " + MATCH_ARM@67..74 + PLACEHOLDER_PAT@67..68 + UNDERSCORE@67..68 "_" + WHITESPACE@68..69 " " + FAT_ARROW@69..71 "=>" + WHITESPACE@71..72 " " + TUPLE_EXPR@72..74 + L_PAREN@72..73 "(" + R_PAREN@73..74 ")" + WHITESPACE@74..79 "\n " + R_CURLY@79..80 "}" + WHITESPACE@80..81 "\n" + R_CURLY@81..82 "}" + WHITESPACE@82..83 "\n" 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 c6e4ee532f..d06fc0be51 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 @@ -1,10 +1,10 @@ -SOURCE_FILE@[0; 18) - EXTERN_CRATE_ITEM@[0; 17) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - CRATE_KW@[7; 12) "crate" - WHITESPACE@[12; 13) " " - NAME_REF@[13; 16) - IDENT@[13; 16) "foo" - SEMICOLON@[16; 17) ";" - WHITESPACE@[17; 18) "\n" +SOURCE_FILE@0..18 + EXTERN_CRATE_ITEM@0..17 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + CRATE_KW@7..12 "crate" + WHITESPACE@12..13 " " + NAME_REF@13..16 + IDENT@13..16 "foo" + SEMICOLON@16..17 ";" + 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 89a6117996..15d3329387 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 @@ -1,125 +1,125 @@ -SOURCE_FILE@[0; 112) - FN_DEF@[0; 111) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 111) - BLOCK@[9; 111) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 20) - RECORD_LIT@[15; 19) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "S" - WHITESPACE@[16; 17) " " - RECORD_FIELD_LIST@[17; 19) - L_CURLY@[17; 18) "{" - R_CURLY@[18; 19) "}" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 25) "\n " - EXPR_STMT@[25; 41) - RECORD_LIT@[25; 40) - PATH@[25; 26) - PATH_SEGMENT@[25; 26) - NAME_REF@[25; 26) - IDENT@[25; 26) "S" - WHITESPACE@[26; 27) " " - RECORD_FIELD_LIST@[27; 40) - L_CURLY@[27; 28) "{" - WHITESPACE@[28; 29) " " - RECORD_FIELD@[29; 30) - PATH_EXPR@[29; 30) - PATH@[29; 30) - PATH_SEGMENT@[29; 30) - NAME_REF@[29; 30) - IDENT@[29; 30) "x" - COMMA@[30; 31) "," - WHITESPACE@[31; 32) " " - RECORD_FIELD@[32; 37) - NAME_REF@[32; 33) - IDENT@[32; 33) "y" - COLON@[33; 34) ":" - WHITESPACE@[34; 35) " " - LITERAL@[35; 37) - INT_NUMBER@[35; 37) "32" - COMMA@[37; 38) "," - WHITESPACE@[38; 39) " " - R_CURLY@[39; 40) "}" - SEMICOLON@[40; 41) ";" - WHITESPACE@[41; 46) "\n " - EXPR_STMT@[46; 83) - RECORD_LIT@[46; 82) - PATH@[46; 47) - PATH_SEGMENT@[46; 47) - NAME_REF@[46; 47) - IDENT@[46; 47) "S" - WHITESPACE@[47; 48) " " - RECORD_FIELD_LIST@[48; 82) - L_CURLY@[48; 49) "{" - WHITESPACE@[49; 50) " " - RECORD_FIELD@[50; 51) - PATH_EXPR@[50; 51) - PATH@[50; 51) - PATH_SEGMENT@[50; 51) - NAME_REF@[50; 51) - IDENT@[50; 51) "x" - COMMA@[51; 52) "," - WHITESPACE@[52; 53) " " - RECORD_FIELD@[53; 58) - NAME_REF@[53; 54) - IDENT@[53; 54) "y" - COLON@[54; 55) ":" - WHITESPACE@[55; 56) " " - LITERAL@[56; 58) - INT_NUMBER@[56; 58) "32" - COMMA@[58; 59) "," - WHITESPACE@[59; 60) " " - DOT2@[60; 62) ".." - CALL_EXPR@[62; 80) - PATH_EXPR@[62; 78) - PATH@[62; 78) - PATH@[62; 69) - PATH_SEGMENT@[62; 69) - NAME_REF@[62; 69) - IDENT@[62; 69) "Default" - COLON2@[69; 71) "::" - PATH_SEGMENT@[71; 78) - NAME_REF@[71; 78) - IDENT@[71; 78) "default" - ARG_LIST@[78; 80) - L_PAREN@[78; 79) "(" - R_PAREN@[79; 80) ")" - WHITESPACE@[80; 81) " " - R_CURLY@[81; 82) "}" - SEMICOLON@[82; 83) ";" - WHITESPACE@[83; 88) "\n " - EXPR_STMT@[88; 109) - RECORD_LIT@[88; 108) - PATH@[88; 99) - PATH_SEGMENT@[88; 99) - NAME_REF@[88; 99) - IDENT@[88; 99) "TupleStruct" - WHITESPACE@[99; 100) " " - RECORD_FIELD_LIST@[100; 108) - L_CURLY@[100; 101) "{" - WHITESPACE@[101; 102) " " - RECORD_FIELD@[102; 106) - NAME_REF@[102; 103) - INT_NUMBER@[102; 103) "0" - COLON@[103; 104) ":" - WHITESPACE@[104; 105) " " - LITERAL@[105; 106) - INT_NUMBER@[105; 106) "1" - WHITESPACE@[106; 107) " " - R_CURLY@[107; 108) "}" - SEMICOLON@[108; 109) ";" - WHITESPACE@[109; 110) "\n" - R_CURLY@[110; 111) "}" - WHITESPACE@[111; 112) "\n" +SOURCE_FILE@0..112 + FN_DEF@0..111 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..111 + BLOCK@9..111 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..20 + RECORD_LIT@15..19 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "S" + WHITESPACE@16..17 " " + RECORD_FIELD_LIST@17..19 + L_CURLY@17..18 "{" + R_CURLY@18..19 "}" + SEMICOLON@19..20 ";" + WHITESPACE@20..25 "\n " + EXPR_STMT@25..41 + RECORD_LIT@25..40 + PATH@25..26 + PATH_SEGMENT@25..26 + NAME_REF@25..26 + IDENT@25..26 "S" + WHITESPACE@26..27 " " + RECORD_FIELD_LIST@27..40 + L_CURLY@27..28 "{" + WHITESPACE@28..29 " " + RECORD_FIELD@29..30 + PATH_EXPR@29..30 + PATH@29..30 + PATH_SEGMENT@29..30 + NAME_REF@29..30 + IDENT@29..30 "x" + COMMA@30..31 "," + WHITESPACE@31..32 " " + RECORD_FIELD@32..37 + NAME_REF@32..33 + IDENT@32..33 "y" + COLON@33..34 ":" + WHITESPACE@34..35 " " + LITERAL@35..37 + INT_NUMBER@35..37 "32" + COMMA@37..38 "," + WHITESPACE@38..39 " " + R_CURLY@39..40 "}" + SEMICOLON@40..41 ";" + WHITESPACE@41..46 "\n " + EXPR_STMT@46..83 + RECORD_LIT@46..82 + PATH@46..47 + PATH_SEGMENT@46..47 + NAME_REF@46..47 + IDENT@46..47 "S" + WHITESPACE@47..48 " " + RECORD_FIELD_LIST@48..82 + L_CURLY@48..49 "{" + WHITESPACE@49..50 " " + RECORD_FIELD@50..51 + PATH_EXPR@50..51 + PATH@50..51 + PATH_SEGMENT@50..51 + NAME_REF@50..51 + IDENT@50..51 "x" + COMMA@51..52 "," + WHITESPACE@52..53 " " + RECORD_FIELD@53..58 + NAME_REF@53..54 + IDENT@53..54 "y" + COLON@54..55 ":" + WHITESPACE@55..56 " " + LITERAL@56..58 + INT_NUMBER@56..58 "32" + COMMA@58..59 "," + WHITESPACE@59..60 " " + DOT2@60..62 ".." + CALL_EXPR@62..80 + PATH_EXPR@62..78 + PATH@62..78 + PATH@62..69 + PATH_SEGMENT@62..69 + NAME_REF@62..69 + IDENT@62..69 "Default" + COLON2@69..71 "::" + PATH_SEGMENT@71..78 + NAME_REF@71..78 + IDENT@71..78 "default" + ARG_LIST@78..80 + L_PAREN@78..79 "(" + R_PAREN@79..80 ")" + WHITESPACE@80..81 " " + R_CURLY@81..82 "}" + SEMICOLON@82..83 ";" + WHITESPACE@83..88 "\n " + EXPR_STMT@88..109 + RECORD_LIT@88..108 + PATH@88..99 + PATH_SEGMENT@88..99 + NAME_REF@88..99 + IDENT@88..99 "TupleStruct" + WHITESPACE@99..100 " " + RECORD_FIELD_LIST@100..108 + L_CURLY@100..101 "{" + WHITESPACE@101..102 " " + RECORD_FIELD@102..106 + NAME_REF@102..103 + INT_NUMBER@102..103 "0" + COLON@103..104 ":" + WHITESPACE@104..105 " " + LITERAL@105..106 + INT_NUMBER@105..106 "1" + WHITESPACE@106..107 " " + R_CURLY@107..108 "}" + SEMICOLON@108..109 ";" + WHITESPACE@109..110 "\n" + R_CURLY@110..111 "}" + 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 99e0a0bece..3cce106e40 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 @@ -1,67 +1,67 @@ -SOURCE_FILE@[0; 70) - FN_DEF@[0; 11) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 11) - BLOCK@[9; 11) - L_CURLY@[9; 10) "{" - R_CURLY@[10; 11) "}" - WHITESPACE@[11; 12) "\n" - MACRO_CALL@[12; 31) - PATH@[12; 23) - PATH_SEGMENT@[12; 23) - NAME_REF@[12; 23) - IDENT@[12; 23) "macro_rules" - BANG@[23; 24) "!" - WHITESPACE@[24; 25) " " - NAME@[25; 28) - IDENT@[25; 28) "foo" - WHITESPACE@[28; 29) " " - TOKEN_TREE@[29; 31) - L_CURLY@[29; 30) "{" - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 32) "\n" - MACRO_CALL@[32; 44) - PATH@[32; 40) - PATH@[32; 35) - PATH_SEGMENT@[32; 35) - NAME_REF@[32; 35) - IDENT@[32; 35) "foo" - COLON2@[35; 37) "::" - PATH_SEGMENT@[37; 40) - NAME_REF@[37; 40) - IDENT@[37; 40) "bar" - BANG@[40; 41) "!" - TOKEN_TREE@[41; 43) - L_PAREN@[41; 42) "(" - R_PAREN@[42; 43) ")" - SEMICOLON@[43; 44) ";" - WHITESPACE@[44; 45) "\n" - MACRO_CALL@[45; 59) - PATH@[45; 55) - PATH@[45; 50) - PATH_SEGMENT@[45; 50) - SUPER_KW@[45; 50) "super" - COLON2@[50; 52) "::" - PATH_SEGMENT@[52; 55) - NAME_REF@[52; 55) - IDENT@[52; 55) "baz" - BANG@[55; 56) "!" - WHITESPACE@[56; 57) " " - TOKEN_TREE@[57; 59) - L_CURLY@[57; 58) "{" - R_CURLY@[58; 59) "}" - WHITESPACE@[59; 60) "\n" - STRUCT_DEF@[60; 69) - STRUCT_KW@[60; 66) "struct" - WHITESPACE@[66; 67) " " - NAME@[67; 68) - IDENT@[67; 68) "S" - SEMICOLON@[68; 69) ";" - WHITESPACE@[69; 70) "\n" +SOURCE_FILE@0..70 + FN_DEF@0..11 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..11 + BLOCK@9..11 + L_CURLY@9..10 "{" + R_CURLY@10..11 "}" + WHITESPACE@11..12 "\n" + MACRO_CALL@12..31 + PATH@12..23 + PATH_SEGMENT@12..23 + NAME_REF@12..23 + IDENT@12..23 "macro_rules" + BANG@23..24 "!" + WHITESPACE@24..25 " " + NAME@25..28 + IDENT@25..28 "foo" + WHITESPACE@28..29 " " + TOKEN_TREE@29..31 + L_CURLY@29..30 "{" + R_CURLY@30..31 "}" + WHITESPACE@31..32 "\n" + MACRO_CALL@32..44 + PATH@32..40 + PATH@32..35 + PATH_SEGMENT@32..35 + NAME_REF@32..35 + IDENT@32..35 "foo" + COLON2@35..37 "::" + PATH_SEGMENT@37..40 + NAME_REF@37..40 + IDENT@37..40 "bar" + BANG@40..41 "!" + TOKEN_TREE@41..43 + L_PAREN@41..42 "(" + R_PAREN@42..43 ")" + SEMICOLON@43..44 ";" + WHITESPACE@44..45 "\n" + MACRO_CALL@45..59 + PATH@45..55 + PATH@45..50 + PATH_SEGMENT@45..50 + SUPER_KW@45..50 "super" + COLON2@50..52 "::" + PATH_SEGMENT@52..55 + NAME_REF@52..55 + IDENT@52..55 "baz" + BANG@55..56 "!" + WHITESPACE@56..57 " " + TOKEN_TREE@57..59 + L_CURLY@57..58 "{" + R_CURLY@58..59 "}" + WHITESPACE@59..60 "\n" + STRUCT_DEF@60..69 + STRUCT_KW@60..66 "struct" + WHITESPACE@66..67 " " + NAME@67..68 + IDENT@67..68 "S" + SEMICOLON@68..69 ";" + 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 278549a46f..24b9a1f461 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 @@ -1,23 +1,23 @@ -SOURCE_FILE@[0; 20) - IMPL_DEF@[0; 19) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - BANG@[5; 6) "!" - PATH_TYPE@[6; 10) - PATH@[6; 10) - PATH_SEGMENT@[6; 10) - NAME_REF@[6; 10) - IDENT@[6; 10) "Send" - WHITESPACE@[10; 11) " " - FOR_KW@[11; 14) "for" - WHITESPACE@[14; 15) " " - PATH_TYPE@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "X" - WHITESPACE@[16; 17) " " - ITEM_LIST@[17; 19) - L_CURLY@[17; 18) "{" - R_CURLY@[18; 19) "}" - WHITESPACE@[19; 20) "\n" +SOURCE_FILE@0..20 + IMPL_DEF@0..19 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + BANG@5..6 "!" + PATH_TYPE@6..10 + PATH@6..10 + PATH_SEGMENT@6..10 + NAME_REF@6..10 + IDENT@6..10 "Send" + WHITESPACE@10..11 " " + FOR_KW@11..14 "for" + WHITESPACE@14..15 " " + PATH_TYPE@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "X" + WHITESPACE@16..17 " " + ITEM_LIST@17..19 + L_CURLY@17..18 "{" + R_CURLY@18..19 "}" + WHITESPACE@19..20 "\n" 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 df24ae1890..5e1b4cc681 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 @@ -1,132 +1,132 @@ -SOURCE_FILE@[0; 137) - FN_DEF@[0; 136) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 136) - BLOCK@[9; 136) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 26) - IF_EXPR@[15; 25) - IF_KW@[15; 17) "if" - WHITESPACE@[17; 18) " " - CONDITION@[18; 22) - LITERAL@[18; 22) - TRUE_KW@[18; 22) "true" - WHITESPACE@[22; 23) " " - BLOCK_EXPR@[23; 25) - BLOCK@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - SEMICOLON@[25; 26) ";" - WHITESPACE@[26; 31) "\n " - EXPR_STMT@[31; 50) - IF_EXPR@[31; 49) - IF_KW@[31; 33) "if" - WHITESPACE@[33; 34) " " - CONDITION@[34; 38) - LITERAL@[34; 38) - TRUE_KW@[34; 38) "true" - WHITESPACE@[38; 39) " " - BLOCK_EXPR@[39; 41) - BLOCK@[39; 41) - L_CURLY@[39; 40) "{" - R_CURLY@[40; 41) "}" - WHITESPACE@[41; 42) " " - ELSE_KW@[42; 46) "else" - WHITESPACE@[46; 47) " " - BLOCK_EXPR@[47; 49) - BLOCK@[47; 49) - L_CURLY@[47; 48) "{" - R_CURLY@[48; 49) "}" - SEMICOLON@[49; 50) ";" - WHITESPACE@[50; 55) "\n " - EXPR_STMT@[55; 91) - IF_EXPR@[55; 90) - IF_KW@[55; 57) "if" - WHITESPACE@[57; 58) " " - CONDITION@[58; 62) - LITERAL@[58; 62) - TRUE_KW@[58; 62) "true" - WHITESPACE@[62; 63) " " - BLOCK_EXPR@[63; 65) - BLOCK@[63; 65) - L_CURLY@[63; 64) "{" - R_CURLY@[64; 65) "}" - WHITESPACE@[65; 66) " " - ELSE_KW@[66; 70) "else" - WHITESPACE@[70; 71) " " - IF_EXPR@[71; 90) - IF_KW@[71; 73) "if" - WHITESPACE@[73; 74) " " - CONDITION@[74; 79) - LITERAL@[74; 79) - FALSE_KW@[74; 79) "false" - WHITESPACE@[79; 80) " " - BLOCK_EXPR@[80; 82) - BLOCK@[80; 82) - L_CURLY@[80; 81) "{" - R_CURLY@[81; 82) "}" - WHITESPACE@[82; 83) " " - ELSE_KW@[83; 87) "else" - WHITESPACE@[87; 88) " " - BLOCK_EXPR@[88; 90) - BLOCK@[88; 90) - L_CURLY@[88; 89) "{" - R_CURLY@[89; 90) "}" - SEMICOLON@[90; 91) ";" - WHITESPACE@[91; 96) "\n " - EXPR_STMT@[96; 104) - IF_EXPR@[96; 103) - IF_KW@[96; 98) "if" - WHITESPACE@[98; 99) " " - CONDITION@[99; 100) - PATH_EXPR@[99; 100) - PATH@[99; 100) - PATH_SEGMENT@[99; 100) - NAME_REF@[99; 100) - IDENT@[99; 100) "S" - WHITESPACE@[100; 101) " " - BLOCK_EXPR@[101; 103) - BLOCK@[101; 103) - L_CURLY@[101; 102) "{" - R_CURLY@[102; 103) "}" - SEMICOLON@[103; 104) ";" - WHITESPACE@[104; 109) "\n " - EXPR_STMT@[109; 134) - IF_EXPR@[109; 133) - IF_KW@[109; 111) "if" - WHITESPACE@[111; 112) " " - CONDITION@[112; 120) - BLOCK_EXPR@[112; 120) - BLOCK@[112; 120) - L_CURLY@[112; 113) "{" - WHITESPACE@[113; 114) " " - LITERAL@[114; 118) - TRUE_KW@[114; 118) "true" - WHITESPACE@[118; 119) " " - R_CURLY@[119; 120) "}" - WHITESPACE@[120; 121) " " - BLOCK_EXPR@[121; 124) - BLOCK@[121; 124) - L_CURLY@[121; 122) "{" - WHITESPACE@[122; 123) " " - R_CURLY@[123; 124) "}" - WHITESPACE@[124; 125) " " - ELSE_KW@[125; 129) "else" - WHITESPACE@[129; 130) " " - BLOCK_EXPR@[130; 133) - BLOCK@[130; 133) - L_CURLY@[130; 131) "{" - WHITESPACE@[131; 132) " " - R_CURLY@[132; 133) "}" - SEMICOLON@[133; 134) ";" - WHITESPACE@[134; 135) "\n" - R_CURLY@[135; 136) "}" - WHITESPACE@[136; 137) "\n" +SOURCE_FILE@0..137 + FN_DEF@0..136 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..136 + BLOCK@9..136 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..26 + IF_EXPR@15..25 + IF_KW@15..17 "if" + WHITESPACE@17..18 " " + CONDITION@18..22 + LITERAL@18..22 + TRUE_KW@18..22 "true" + WHITESPACE@22..23 " " + BLOCK_EXPR@23..25 + BLOCK@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + SEMICOLON@25..26 ";" + WHITESPACE@26..31 "\n " + EXPR_STMT@31..50 + IF_EXPR@31..49 + IF_KW@31..33 "if" + WHITESPACE@33..34 " " + CONDITION@34..38 + LITERAL@34..38 + TRUE_KW@34..38 "true" + WHITESPACE@38..39 " " + BLOCK_EXPR@39..41 + BLOCK@39..41 + L_CURLY@39..40 "{" + R_CURLY@40..41 "}" + WHITESPACE@41..42 " " + ELSE_KW@42..46 "else" + WHITESPACE@46..47 " " + BLOCK_EXPR@47..49 + BLOCK@47..49 + L_CURLY@47..48 "{" + R_CURLY@48..49 "}" + SEMICOLON@49..50 ";" + WHITESPACE@50..55 "\n " + EXPR_STMT@55..91 + IF_EXPR@55..90 + IF_KW@55..57 "if" + WHITESPACE@57..58 " " + CONDITION@58..62 + LITERAL@58..62 + TRUE_KW@58..62 "true" + WHITESPACE@62..63 " " + BLOCK_EXPR@63..65 + BLOCK@63..65 + L_CURLY@63..64 "{" + R_CURLY@64..65 "}" + WHITESPACE@65..66 " " + ELSE_KW@66..70 "else" + WHITESPACE@70..71 " " + IF_EXPR@71..90 + IF_KW@71..73 "if" + WHITESPACE@73..74 " " + CONDITION@74..79 + LITERAL@74..79 + FALSE_KW@74..79 "false" + WHITESPACE@79..80 " " + BLOCK_EXPR@80..82 + BLOCK@80..82 + L_CURLY@80..81 "{" + R_CURLY@81..82 "}" + WHITESPACE@82..83 " " + ELSE_KW@83..87 "else" + WHITESPACE@87..88 " " + BLOCK_EXPR@88..90 + BLOCK@88..90 + L_CURLY@88..89 "{" + R_CURLY@89..90 "}" + SEMICOLON@90..91 ";" + WHITESPACE@91..96 "\n " + EXPR_STMT@96..104 + IF_EXPR@96..103 + IF_KW@96..98 "if" + WHITESPACE@98..99 " " + CONDITION@99..100 + PATH_EXPR@99..100 + PATH@99..100 + PATH_SEGMENT@99..100 + NAME_REF@99..100 + IDENT@99..100 "S" + WHITESPACE@100..101 " " + BLOCK_EXPR@101..103 + BLOCK@101..103 + L_CURLY@101..102 "{" + R_CURLY@102..103 "}" + SEMICOLON@103..104 ";" + WHITESPACE@104..109 "\n " + EXPR_STMT@109..134 + IF_EXPR@109..133 + IF_KW@109..111 "if" + WHITESPACE@111..112 " " + CONDITION@112..120 + BLOCK_EXPR@112..120 + BLOCK@112..120 + L_CURLY@112..113 "{" + WHITESPACE@113..114 " " + LITERAL@114..118 + TRUE_KW@114..118 "true" + WHITESPACE@118..119 " " + R_CURLY@119..120 "}" + WHITESPACE@120..121 " " + BLOCK_EXPR@121..124 + BLOCK@121..124 + L_CURLY@121..122 "{" + WHITESPACE@122..123 " " + R_CURLY@123..124 "}" + WHITESPACE@124..125 " " + ELSE_KW@125..129 "else" + WHITESPACE@129..130 " " + BLOCK_EXPR@130..133 + BLOCK@130..133 + L_CURLY@130..131 "{" + WHITESPACE@131..132 " " + R_CURLY@132..133 "}" + SEMICOLON@133..134 ";" + WHITESPACE@134..135 "\n" + R_CURLY@135..136 "}" + 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 bbf3475809..8e10f36737 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 @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 42) - TYPE_ALIAS_DEF@[0; 41) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - DYN_TRAIT_TYPE@[9; 40) - DYN_KW@[9; 12) "dyn" - WHITESPACE@[12; 13) " " - TYPE_BOUND_LIST@[13; 40) - TYPE_BOUND@[13; 35) - PATH_TYPE@[13; 35) - PATH@[13; 35) - PATH_SEGMENT@[13; 35) - NAME_REF@[13; 21) - IDENT@[13; 21) "Iterator" - TYPE_ARG_LIST@[21; 35) - L_ANGLE@[21; 22) "<" - ASSOC_TYPE_ARG@[22; 34) - NAME_REF@[22; 26) - IDENT@[22; 26) "Item" - EQ@[26; 27) "=" - PATH_TYPE@[27; 34) - PATH@[27; 34) - PATH_SEGMENT@[27; 34) - NAME_REF@[27; 30) - IDENT@[27; 30) "Foo" - TYPE_ARG_LIST@[30; 34) - L_ANGLE@[30; 31) "<" - LIFETIME_ARG@[31; 33) - LIFETIME@[31; 33) "\'a" - R_ANGLE@[33; 34) ">" - R_ANGLE@[34; 35) ">" - WHITESPACE@[35; 36) " " - PLUS@[36; 37) "+" - WHITESPACE@[37; 38) " " - TYPE_BOUND@[38; 40) - LIFETIME@[38; 40) "\'a" - SEMICOLON@[40; 41) ";" - WHITESPACE@[41; 42) "\n" +SOURCE_FILE@0..42 + TYPE_ALIAS_DEF@0..41 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + DYN_TRAIT_TYPE@9..40 + DYN_KW@9..12 "dyn" + WHITESPACE@12..13 " " + TYPE_BOUND_LIST@13..40 + TYPE_BOUND@13..35 + PATH_TYPE@13..35 + PATH@13..35 + PATH_SEGMENT@13..35 + NAME_REF@13..21 + IDENT@13..21 "Iterator" + TYPE_ARG_LIST@21..35 + L_ANGLE@21..22 "<" + ASSOC_TYPE_ARG@22..34 + NAME_REF@22..26 + IDENT@22..26 "Item" + EQ@26..27 "=" + PATH_TYPE@27..34 + PATH@27..34 + PATH_SEGMENT@27..34 + NAME_REF@27..30 + IDENT@27..30 "Foo" + TYPE_ARG_LIST@30..34 + L_ANGLE@30..31 "<" + LIFETIME_ARG@31..33 + LIFETIME@31..33 "\'a" + R_ANGLE@33..34 ">" + R_ANGLE@34..35 ">" + WHITESPACE@35..36 " " + PLUS@36..37 "+" + WHITESPACE@37..38 " " + TYPE_BOUND@38..40 + LIFETIME@38..40 "\'a" + SEMICOLON@40..41 ";" + 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 85edd08450..108e5c5cc2 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 @@ -1,152 +1,152 @@ -SOURCE_FILE@[0; 167) - FN_DEF@[0; 166) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 166) - BLOCK@[9; 166) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 164) - MATCH_EXPR@[15; 163) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 163) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 41) - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - FAT_ARROW@[36; 38) "=>" - WHITESPACE@[38; 39) " " - TUPLE_EXPR@[39; 41) - L_PAREN@[39; 40) "(" - R_PAREN@[40; 41) ")" - COMMA@[41; 42) "," - WHITESPACE@[42; 51) "\n " - MATCH_ARM@[51; 83) - PLACEHOLDER_PAT@[51; 52) - UNDERSCORE@[51; 52) "_" - WHITESPACE@[52; 53) " " - MATCH_GUARD@[53; 77) - IF_KW@[53; 55) "if" - WHITESPACE@[55; 56) " " - BIN_EXPR@[56; 77) - PATH_EXPR@[56; 60) - PATH@[56; 60) - PATH_SEGMENT@[56; 60) - NAME_REF@[56; 60) - IDENT@[56; 60) "Test" - WHITESPACE@[60; 61) " " - R_ANGLE@[61; 62) ">" - WHITESPACE@[62; 63) " " - RECORD_LIT@[63; 77) - PATH@[63; 67) - PATH_SEGMENT@[63; 67) - NAME_REF@[63; 67) - IDENT@[63; 67) "Test" - RECORD_FIELD_LIST@[67; 77) - L_CURLY@[67; 68) "{" - RECORD_FIELD@[68; 76) - NAME_REF@[68; 73) - IDENT@[68; 73) "field" - COLON@[73; 74) ":" - WHITESPACE@[74; 75) " " - LITERAL@[75; 76) - INT_NUMBER@[75; 76) "0" - R_CURLY@[76; 77) "}" - WHITESPACE@[77; 78) " " - FAT_ARROW@[78; 80) "=>" - WHITESPACE@[80; 81) " " - TUPLE_EXPR@[81; 83) - L_PAREN@[81; 82) "(" - R_PAREN@[82; 83) ")" - COMMA@[83; 84) "," - WHITESPACE@[84; 93) "\n " - MATCH_ARM@[93; 109) - OR_PAT@[93; 98) - BIND_PAT@[93; 94) - NAME@[93; 94) - IDENT@[93; 94) "X" - WHITESPACE@[94; 95) " " - PIPE@[95; 96) "|" - WHITESPACE@[96; 97) " " - BIND_PAT@[97; 98) - NAME@[97; 98) - IDENT@[97; 98) "Y" - WHITESPACE@[98; 99) " " - MATCH_GUARD@[99; 103) - IF_KW@[99; 101) "if" - WHITESPACE@[101; 102) " " - PATH_EXPR@[102; 103) - PATH@[102; 103) - PATH_SEGMENT@[102; 103) - NAME_REF@[102; 103) - IDENT@[102; 103) "Z" - WHITESPACE@[103; 104) " " - FAT_ARROW@[104; 106) "=>" - WHITESPACE@[106; 107) " " - TUPLE_EXPR@[107; 109) - L_PAREN@[107; 108) "(" - R_PAREN@[108; 109) ")" - COMMA@[109; 110) "," - WHITESPACE@[110; 119) "\n " - MATCH_ARM@[119; 137) - PIPE@[119; 120) "|" - WHITESPACE@[120; 121) " " - OR_PAT@[121; 126) - BIND_PAT@[121; 122) - NAME@[121; 122) - IDENT@[121; 122) "X" - WHITESPACE@[122; 123) " " - PIPE@[123; 124) "|" - WHITESPACE@[124; 125) " " - BIND_PAT@[125; 126) - NAME@[125; 126) - IDENT@[125; 126) "Y" - WHITESPACE@[126; 127) " " - MATCH_GUARD@[127; 131) - IF_KW@[127; 129) "if" - WHITESPACE@[129; 130) " " - PATH_EXPR@[130; 131) - PATH@[130; 131) - PATH_SEGMENT@[130; 131) - NAME_REF@[130; 131) - IDENT@[130; 131) "Z" - WHITESPACE@[131; 132) " " - FAT_ARROW@[132; 134) "=>" - WHITESPACE@[134; 135) " " - TUPLE_EXPR@[135; 137) - L_PAREN@[135; 136) "(" - R_PAREN@[136; 137) ")" - COMMA@[137; 138) "," - WHITESPACE@[138; 147) "\n " - MATCH_ARM@[147; 156) - PIPE@[147; 148) "|" - WHITESPACE@[148; 149) " " - BIND_PAT@[149; 150) - NAME@[149; 150) - IDENT@[149; 150) "X" - WHITESPACE@[150; 151) " " - FAT_ARROW@[151; 153) "=>" - WHITESPACE@[153; 154) " " - TUPLE_EXPR@[154; 156) - L_PAREN@[154; 155) "(" - R_PAREN@[155; 156) ")" - COMMA@[156; 157) "," - WHITESPACE@[157; 162) "\n " - R_CURLY@[162; 163) "}" - SEMICOLON@[163; 164) ";" - WHITESPACE@[164; 165) "\n" - R_CURLY@[165; 166) "}" - WHITESPACE@[166; 167) "\n" +SOURCE_FILE@0..167 + FN_DEF@0..166 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..166 + BLOCK@9..166 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..164 + MATCH_EXPR@15..163 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..163 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..41 + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + FAT_ARROW@36..38 "=>" + WHITESPACE@38..39 " " + TUPLE_EXPR@39..41 + L_PAREN@39..40 "(" + R_PAREN@40..41 ")" + COMMA@41..42 "," + WHITESPACE@42..51 "\n " + MATCH_ARM@51..83 + PLACEHOLDER_PAT@51..52 + UNDERSCORE@51..52 "_" + WHITESPACE@52..53 " " + MATCH_GUARD@53..77 + IF_KW@53..55 "if" + WHITESPACE@55..56 " " + BIN_EXPR@56..77 + PATH_EXPR@56..60 + PATH@56..60 + PATH_SEGMENT@56..60 + NAME_REF@56..60 + IDENT@56..60 "Test" + WHITESPACE@60..61 " " + R_ANGLE@61..62 ">" + WHITESPACE@62..63 " " + RECORD_LIT@63..77 + PATH@63..67 + PATH_SEGMENT@63..67 + NAME_REF@63..67 + IDENT@63..67 "Test" + RECORD_FIELD_LIST@67..77 + L_CURLY@67..68 "{" + RECORD_FIELD@68..76 + NAME_REF@68..73 + IDENT@68..73 "field" + COLON@73..74 ":" + WHITESPACE@74..75 " " + LITERAL@75..76 + INT_NUMBER@75..76 "0" + R_CURLY@76..77 "}" + WHITESPACE@77..78 " " + FAT_ARROW@78..80 "=>" + WHITESPACE@80..81 " " + TUPLE_EXPR@81..83 + L_PAREN@81..82 "(" + R_PAREN@82..83 ")" + COMMA@83..84 "," + WHITESPACE@84..93 "\n " + MATCH_ARM@93..109 + OR_PAT@93..98 + BIND_PAT@93..94 + NAME@93..94 + IDENT@93..94 "X" + WHITESPACE@94..95 " " + PIPE@95..96 "|" + WHITESPACE@96..97 " " + BIND_PAT@97..98 + NAME@97..98 + IDENT@97..98 "Y" + WHITESPACE@98..99 " " + MATCH_GUARD@99..103 + IF_KW@99..101 "if" + WHITESPACE@101..102 " " + PATH_EXPR@102..103 + PATH@102..103 + PATH_SEGMENT@102..103 + NAME_REF@102..103 + IDENT@102..103 "Z" + WHITESPACE@103..104 " " + FAT_ARROW@104..106 "=>" + WHITESPACE@106..107 " " + TUPLE_EXPR@107..109 + L_PAREN@107..108 "(" + R_PAREN@108..109 ")" + COMMA@109..110 "," + WHITESPACE@110..119 "\n " + MATCH_ARM@119..137 + PIPE@119..120 "|" + WHITESPACE@120..121 " " + OR_PAT@121..126 + BIND_PAT@121..122 + NAME@121..122 + IDENT@121..122 "X" + WHITESPACE@122..123 " " + PIPE@123..124 "|" + WHITESPACE@124..125 " " + BIND_PAT@125..126 + NAME@125..126 + IDENT@125..126 "Y" + WHITESPACE@126..127 " " + MATCH_GUARD@127..131 + IF_KW@127..129 "if" + WHITESPACE@129..130 " " + PATH_EXPR@130..131 + PATH@130..131 + PATH_SEGMENT@130..131 + NAME_REF@130..131 + IDENT@130..131 "Z" + WHITESPACE@131..132 " " + FAT_ARROW@132..134 "=>" + WHITESPACE@134..135 " " + TUPLE_EXPR@135..137 + L_PAREN@135..136 "(" + R_PAREN@136..137 ")" + COMMA@137..138 "," + WHITESPACE@138..147 "\n " + MATCH_ARM@147..156 + PIPE@147..148 "|" + WHITESPACE@148..149 " " + BIND_PAT@149..150 + NAME@149..150 + IDENT@149..150 "X" + WHITESPACE@150..151 " " + FAT_ARROW@151..153 "=>" + WHITESPACE@153..154 " " + TUPLE_EXPR@154..156 + L_PAREN@154..155 "(" + R_PAREN@155..156 ")" + COMMA@156..157 "," + WHITESPACE@157..162 "\n " + R_CURLY@162..163 "}" + SEMICOLON@163..164 ";" + WHITESPACE@164..165 "\n" + R_CURLY@165..166 "}" + 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 35994e3fdd..caa76fe8ad 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 @@ -1,15 +1,15 @@ -SOURCE_FILE@[0; 16) - USE_ITEM@[0; 15) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 14) - PATH@[4; 14) - PATH@[4; 9) - PATH_SEGMENT@[4; 9) - CRATE_KW@[4; 9) "crate" - COLON2@[9; 11) "::" - PATH_SEGMENT@[11; 14) - NAME_REF@[11; 14) - IDENT@[11; 14) "foo" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" +SOURCE_FILE@0..16 + USE_ITEM@0..15 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..14 + PATH@4..14 + PATH@4..9 + PATH_SEGMENT@4..9 + CRATE_KW@4..9 "crate" + COLON2@9..11 "::" + PATH_SEGMENT@11..14 + NAME_REF@11..14 + IDENT@11..14 "foo" + SEMICOLON@14..15 ";" + WHITESPACE@15..16 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rast b/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rast index 9d79826846..ec24960725 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0068_union_items.rast @@ -1,46 +1,46 @@ -SOURCE_FILE@[0; 51) - UNION_DEF@[0; 12) - UNION_KW@[0; 5) "union" - WHITESPACE@[5; 6) " " - NAME@[6; 9) - IDENT@[6; 9) "Foo" - WHITESPACE@[9; 10) " " - RECORD_FIELD_DEF_LIST@[10; 12) - L_CURLY@[10; 11) "{" - R_CURLY@[11; 12) "}" - WHITESPACE@[12; 13) "\n" - UNION_DEF@[13; 50) - UNION_KW@[13; 18) "union" - WHITESPACE@[18; 19) " " - NAME@[19; 22) - IDENT@[19; 22) "Foo" - WHITESPACE@[22; 23) " " - RECORD_FIELD_DEF_LIST@[23; 50) - L_CURLY@[23; 24) "{" - WHITESPACE@[24; 29) "\n " - RECORD_FIELD_DEF@[29; 35) - NAME@[29; 30) - IDENT@[29; 30) "a" - COLON@[30; 31) ":" - WHITESPACE@[31; 32) " " - PATH_TYPE@[32; 35) - PATH@[32; 35) - PATH_SEGMENT@[32; 35) - NAME_REF@[32; 35) - IDENT@[32; 35) "i32" - COMMA@[35; 36) "," - WHITESPACE@[36; 41) "\n " - RECORD_FIELD_DEF@[41; 47) - NAME@[41; 42) - IDENT@[41; 42) "b" - COLON@[42; 43) ":" - WHITESPACE@[43; 44) " " - PATH_TYPE@[44; 47) - PATH@[44; 47) - PATH_SEGMENT@[44; 47) - NAME_REF@[44; 47) - IDENT@[44; 47) "f32" - COMMA@[47; 48) "," - WHITESPACE@[48; 49) "\n" - R_CURLY@[49; 50) "}" - WHITESPACE@[50; 51) "\n" +SOURCE_FILE@0..51 + UNION_DEF@0..12 + UNION_KW@0..5 "union" + WHITESPACE@5..6 " " + NAME@6..9 + IDENT@6..9 "Foo" + WHITESPACE@9..10 " " + RECORD_FIELD_DEF_LIST@10..12 + L_CURLY@10..11 "{" + R_CURLY@11..12 "}" + WHITESPACE@12..13 "\n" + UNION_DEF@13..50 + UNION_KW@13..18 "union" + WHITESPACE@18..19 " " + NAME@19..22 + IDENT@19..22 "Foo" + WHITESPACE@22..23 " " + RECORD_FIELD_DEF_LIST@23..50 + L_CURLY@23..24 "{" + WHITESPACE@24..29 "\n " + RECORD_FIELD_DEF@29..35 + NAME@29..30 + IDENT@29..30 "a" + COLON@30..31 ":" + WHITESPACE@31..32 " " + PATH_TYPE@32..35 + PATH@32..35 + PATH_SEGMENT@32..35 + NAME_REF@32..35 + IDENT@32..35 "i32" + COMMA@35..36 "," + WHITESPACE@36..41 "\n " + RECORD_FIELD_DEF@41..47 + NAME@41..42 + IDENT@41..42 "b" + COLON@42..43 ":" + WHITESPACE@43..44 " " + PATH_TYPE@44..47 + PATH@44..47 + PATH_SEGMENT@44..47 + NAME_REF@44..47 + IDENT@44..47 "f32" + COMMA@47..48 "," + WHITESPACE@48..49 "\n" + R_CURLY@49..50 "}" + WHITESPACE@50..51 "\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 e242478909..18cd5271ff 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 @@ -1,37 +1,37 @@ -SOURCE_FILE@[0; 37) - USE_ITEM@[0; 18) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 17) - PATH@[4; 9) - PATH_SEGMENT@[4; 9) - CRATE_KW@[4; 9) "crate" - COLON2@[9; 11) "::" - USE_TREE_LIST@[11; 17) - L_CURLY@[11; 12) "{" - USE_TREE@[12; 16) - PATH@[12; 16) - PATH_SEGMENT@[12; 16) - NAME_REF@[12; 16) - IDENT@[12; 16) "Item" - R_CURLY@[16; 17) "}" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" - USE_ITEM@[19; 36) - USE_KW@[19; 22) "use" - WHITESPACE@[22; 23) " " - USE_TREE@[23; 35) - PATH@[23; 27) - PATH_SEGMENT@[23; 27) - SELF_KW@[23; 27) "self" - COLON2@[27; 29) "::" - USE_TREE_LIST@[29; 35) - L_CURLY@[29; 30) "{" - USE_TREE@[30; 34) - PATH@[30; 34) - PATH_SEGMENT@[30; 34) - NAME_REF@[30; 34) - IDENT@[30; 34) "Item" - R_CURLY@[34; 35) "}" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 37) "\n" +SOURCE_FILE@0..37 + USE_ITEM@0..18 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..17 + PATH@4..9 + PATH_SEGMENT@4..9 + CRATE_KW@4..9 "crate" + COLON2@9..11 "::" + USE_TREE_LIST@11..17 + L_CURLY@11..12 "{" + USE_TREE@12..16 + PATH@12..16 + PATH_SEGMENT@12..16 + NAME_REF@12..16 + IDENT@12..16 "Item" + R_CURLY@16..17 "}" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" + USE_ITEM@19..36 + USE_KW@19..22 "use" + WHITESPACE@22..23 " " + USE_TREE@23..35 + PATH@23..27 + PATH_SEGMENT@23..27 + SELF_KW@23..27 "self" + COLON2@27..29 "::" + USE_TREE_LIST@29..35 + L_CURLY@29..30 "{" + USE_TREE@30..34 + PATH@30..34 + PATH_SEGMENT@30..34 + NAME_REF@30..34 + IDENT@30..34 "Item" + R_CURLY@34..35 "}" + SEMICOLON@35..36 ";" + 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 4b075569ad..1e888063e8 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 @@ -1,53 +1,53 @@ -SOURCE_FILE@[0; 46) - FN_DEF@[0; 45) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 45) - BLOCK@[9; 45) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 31) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - BIN_EXPR@[23; 30) - BLOCK_EXPR@[23; 26) - BLOCK@[23; 26) - L_CURLY@[23; 24) "{" - LITERAL@[24; 25) - INT_NUMBER@[24; 25) "1" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 27) " " - AMP@[27; 28) "&" - WHITESPACE@[28; 29) " " - LITERAL@[29; 30) - INT_NUMBER@[29; 30) "2" - SEMICOLON@[30; 31) ";" - WHITESPACE@[31; 36) "\n " - EXPR_STMT@[36; 39) - BLOCK_EXPR@[36; 39) - BLOCK@[36; 39) - L_CURLY@[36; 37) "{" - LITERAL@[37; 38) - INT_NUMBER@[37; 38) "1" - R_CURLY@[38; 39) "}" - WHITESPACE@[39; 40) " " - EXPR_STMT@[40; 43) - REF_EXPR@[40; 42) - AMP@[40; 41) "&" - LITERAL@[41; 42) - INT_NUMBER@[41; 42) "2" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 44) "\n" - R_CURLY@[44; 45) "}" - WHITESPACE@[45; 46) "\n" +SOURCE_FILE@0..46 + FN_DEF@0..45 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..45 + BLOCK@9..45 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..31 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + BIN_EXPR@23..30 + BLOCK_EXPR@23..26 + BLOCK@23..26 + L_CURLY@23..24 "{" + LITERAL@24..25 + INT_NUMBER@24..25 "1" + R_CURLY@25..26 "}" + WHITESPACE@26..27 " " + AMP@27..28 "&" + WHITESPACE@28..29 " " + LITERAL@29..30 + INT_NUMBER@29..30 "2" + SEMICOLON@30..31 ";" + WHITESPACE@31..36 "\n " + EXPR_STMT@36..39 + BLOCK_EXPR@36..39 + BLOCK@36..39 + L_CURLY@36..37 "{" + LITERAL@37..38 + INT_NUMBER@37..38 "1" + R_CURLY@38..39 "}" + WHITESPACE@39..40 " " + EXPR_STMT@40..43 + REF_EXPR@40..42 + AMP@40..41 "&" + LITERAL@41..42 + INT_NUMBER@41..42 "2" + SEMICOLON@42..43 ";" + WHITESPACE@43..44 "\n" + R_CURLY@44..45 "}" + 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 559ffb578b..218b3ec9e6 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 @@ -1,96 +1,96 @@ -SOURCE_FILE@[0; 97) - FN_DEF@[0; 96) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 96) - BLOCK@[9; 96) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 28) - MATCH_EXPR@[15; 27) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 27) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 26) " " - R_CURLY@[26; 27) "}" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 33) "\n " - EXPR_STMT@[33; 44) - MATCH_EXPR@[33; 43) - MATCH_KW@[33; 38) "match" - WHITESPACE@[38; 39) " " - PATH_EXPR@[39; 40) - PATH@[39; 40) - PATH_SEGMENT@[39; 40) - NAME_REF@[39; 40) - IDENT@[39; 40) "S" - WHITESPACE@[40; 41) " " - MATCH_ARM_LIST@[41; 43) - L_CURLY@[41; 42) "{" - R_CURLY@[42; 43) "}" - SEMICOLON@[43; 44) ";" - WHITESPACE@[44; 49) "\n " - EXPR_STMT@[49; 71) - MATCH_EXPR@[49; 70) - MATCH_KW@[49; 54) "match" - WHITESPACE@[54; 55) " " - BLOCK_EXPR@[55; 58) - BLOCK@[55; 58) - L_CURLY@[55; 56) "{" - WHITESPACE@[56; 57) " " - R_CURLY@[57; 58) "}" - WHITESPACE@[58; 59) " " - MATCH_ARM_LIST@[59; 70) - L_CURLY@[59; 60) "{" - WHITESPACE@[60; 61) " " - MATCH_ARM@[61; 68) - PLACEHOLDER_PAT@[61; 62) - UNDERSCORE@[61; 62) "_" - WHITESPACE@[62; 63) " " - FAT_ARROW@[63; 65) "=>" - WHITESPACE@[65; 66) " " - TUPLE_EXPR@[66; 68) - L_PAREN@[66; 67) "(" - R_PAREN@[67; 68) ")" - WHITESPACE@[68; 69) " " - R_CURLY@[69; 70) "}" - SEMICOLON@[70; 71) ";" - WHITESPACE@[71; 76) "\n " - EXPR_STMT@[76; 94) - MATCH_EXPR@[76; 93) - MATCH_KW@[76; 81) "match" - WHITESPACE@[81; 82) " " - BLOCK_EXPR@[82; 90) - BLOCK@[82; 90) - L_CURLY@[82; 83) "{" - WHITESPACE@[83; 84) " " - RECORD_LIT@[84; 88) - PATH@[84; 85) - PATH_SEGMENT@[84; 85) - NAME_REF@[84; 85) - IDENT@[84; 85) "S" - WHITESPACE@[85; 86) " " - RECORD_FIELD_LIST@[86; 88) - L_CURLY@[86; 87) "{" - R_CURLY@[87; 88) "}" - WHITESPACE@[88; 89) " " - R_CURLY@[89; 90) "}" - WHITESPACE@[90; 91) " " - MATCH_ARM_LIST@[91; 93) - L_CURLY@[91; 92) "{" - R_CURLY@[92; 93) "}" - SEMICOLON@[93; 94) ";" - WHITESPACE@[94; 95) "\n" - R_CURLY@[95; 96) "}" - WHITESPACE@[96; 97) "\n" +SOURCE_FILE@0..97 + FN_DEF@0..96 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..96 + BLOCK@9..96 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..28 + MATCH_EXPR@15..27 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..27 + L_CURLY@24..25 "{" + WHITESPACE@25..26 " " + R_CURLY@26..27 "}" + SEMICOLON@27..28 ";" + WHITESPACE@28..33 "\n " + EXPR_STMT@33..44 + MATCH_EXPR@33..43 + MATCH_KW@33..38 "match" + WHITESPACE@38..39 " " + PATH_EXPR@39..40 + PATH@39..40 + PATH_SEGMENT@39..40 + NAME_REF@39..40 + IDENT@39..40 "S" + WHITESPACE@40..41 " " + MATCH_ARM_LIST@41..43 + L_CURLY@41..42 "{" + R_CURLY@42..43 "}" + SEMICOLON@43..44 ";" + WHITESPACE@44..49 "\n " + EXPR_STMT@49..71 + MATCH_EXPR@49..70 + MATCH_KW@49..54 "match" + WHITESPACE@54..55 " " + BLOCK_EXPR@55..58 + BLOCK@55..58 + L_CURLY@55..56 "{" + WHITESPACE@56..57 " " + R_CURLY@57..58 "}" + WHITESPACE@58..59 " " + MATCH_ARM_LIST@59..70 + L_CURLY@59..60 "{" + WHITESPACE@60..61 " " + MATCH_ARM@61..68 + PLACEHOLDER_PAT@61..62 + UNDERSCORE@61..62 "_" + WHITESPACE@62..63 " " + FAT_ARROW@63..65 "=>" + WHITESPACE@65..66 " " + TUPLE_EXPR@66..68 + L_PAREN@66..67 "(" + R_PAREN@67..68 ")" + WHITESPACE@68..69 " " + R_CURLY@69..70 "}" + SEMICOLON@70..71 ";" + WHITESPACE@71..76 "\n " + EXPR_STMT@76..94 + MATCH_EXPR@76..93 + MATCH_KW@76..81 "match" + WHITESPACE@81..82 " " + BLOCK_EXPR@82..90 + BLOCK@82..90 + L_CURLY@82..83 "{" + WHITESPACE@83..84 " " + RECORD_LIT@84..88 + PATH@84..85 + PATH_SEGMENT@84..85 + NAME_REF@84..85 + IDENT@84..85 "S" + WHITESPACE@85..86 " " + RECORD_FIELD_LIST@86..88 + L_CURLY@86..87 "{" + R_CURLY@87..88 "}" + WHITESPACE@88..89 " " + R_CURLY@89..90 "}" + WHITESPACE@90..91 " " + MATCH_ARM_LIST@91..93 + L_CURLY@91..92 "{" + R_CURLY@92..93 "}" + SEMICOLON@93..94 ";" + WHITESPACE@94..95 "\n" + R_CURLY@95..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 084efaee25..b8171dc9cd 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 @@ -1,29 +1,29 @@ -SOURCE_FILE@[0; 40) - FN_DEF@[0; 39) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 39) - BLOCK@[9; 39) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 22) - RETURN_EXPR@[15; 21) - RETURN_KW@[15; 21) "return" - SEMICOLON@[21; 22) ";" - WHITESPACE@[22; 27) "\n " - EXPR_STMT@[27; 37) - RETURN_EXPR@[27; 36) - RETURN_KW@[27; 33) "return" - WHITESPACE@[33; 34) " " - LITERAL@[34; 36) - INT_NUMBER@[34; 36) "92" - SEMICOLON@[36; 37) ";" - WHITESPACE@[37; 38) "\n" - R_CURLY@[38; 39) "}" - WHITESPACE@[39; 40) "\n" +SOURCE_FILE@0..40 + FN_DEF@0..39 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..39 + BLOCK@9..39 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..22 + RETURN_EXPR@15..21 + RETURN_KW@15..21 "return" + SEMICOLON@21..22 ";" + WHITESPACE@22..27 "\n " + EXPR_STMT@27..37 + RETURN_EXPR@27..36 + RETURN_KW@27..33 "return" + WHITESPACE@33..34 " " + LITERAL@34..36 + INT_NUMBER@34..36 "92" + SEMICOLON@36..37 ";" + WHITESPACE@37..38 "\n" + R_CURLY@38..39 "}" + 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 64150b7749..cc871ac0c9 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 @@ -1,20 +1,20 @@ -SOURCE_FILE@[0; 21) - TYPE_ALIAS_DEF@[0; 20) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 11) - IDENT@[5; 11) "Result" - TYPE_PARAM_LIST@[11; 14) - L_ANGLE@[11; 12) "<" - TYPE_PARAM@[12; 13) - NAME@[12; 13) - IDENT@[12; 13) "T" - R_ANGLE@[13; 14) ">" - WHITESPACE@[14; 15) " " - EQ@[15; 16) "=" - WHITESPACE@[16; 17) " " - TUPLE_TYPE@[17; 19) - L_PAREN@[17; 18) "(" - R_PAREN@[18; 19) ")" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 21) "\n" +SOURCE_FILE@0..21 + TYPE_ALIAS_DEF@0..20 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..11 + IDENT@5..11 "Result" + TYPE_PARAM_LIST@11..14 + L_ANGLE@11..12 "<" + TYPE_PARAM@12..13 + NAME@12..13 + IDENT@12..13 "T" + R_ANGLE@13..14 ">" + WHITESPACE@14..15 " " + EQ@15..16 "=" + WHITESPACE@16..17 " " + TUPLE_TYPE@17..19 + L_PAREN@17..18 "(" + R_PAREN@18..19 ")" + SEMICOLON@19..20 ";" + WHITESPACE@20..21 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast index cbd2d5fbf4..c2a73ef250 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0074_stmt_postfix_expr_ambiguity.rast @@ -1,63 +1,63 @@ -SOURCE_FILE@[0; 84) - FN_DEF@[0; 83) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 83) - BLOCK@[9; 83) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - MATCH_EXPR@[15; 81) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 81) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 41) - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - FAT_ARROW@[36; 38) "=>" - WHITESPACE@[38; 39) " " - BLOCK_EXPR@[39; 41) - BLOCK@[39; 41) - L_CURLY@[39; 40) "{" - R_CURLY@[40; 41) "}" - WHITESPACE@[41; 50) "\n " - MATCH_ARM@[50; 58) - TUPLE_PAT@[50; 52) - L_PAREN@[50; 51) "(" - R_PAREN@[51; 52) ")" - WHITESPACE@[52; 53) " " - FAT_ARROW@[53; 55) "=>" - WHITESPACE@[55; 56) " " - BLOCK_EXPR@[56; 58) - BLOCK@[56; 58) - L_CURLY@[56; 57) "{" - R_CURLY@[57; 58) "}" - WHITESPACE@[58; 67) "\n " - MATCH_ARM@[67; 75) - SLICE_PAT@[67; 69) - L_BRACK@[67; 68) "[" - R_BRACK@[68; 69) "]" - WHITESPACE@[69; 70) " " - FAT_ARROW@[70; 72) "=>" - WHITESPACE@[72; 73) " " - BLOCK_EXPR@[73; 75) - BLOCK@[73; 75) - L_CURLY@[73; 74) "{" - R_CURLY@[74; 75) "}" - WHITESPACE@[75; 80) "\n " - R_CURLY@[80; 81) "}" - WHITESPACE@[81; 82) "\n" - R_CURLY@[82; 83) "}" - WHITESPACE@[83; 84) "\n" +SOURCE_FILE@0..84 + FN_DEF@0..83 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..83 + BLOCK@9..83 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + MATCH_EXPR@15..81 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..81 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..41 + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + FAT_ARROW@36..38 "=>" + WHITESPACE@38..39 " " + BLOCK_EXPR@39..41 + BLOCK@39..41 + L_CURLY@39..40 "{" + R_CURLY@40..41 "}" + WHITESPACE@41..50 "\n " + MATCH_ARM@50..58 + TUPLE_PAT@50..52 + L_PAREN@50..51 "(" + R_PAREN@51..52 ")" + WHITESPACE@52..53 " " + FAT_ARROW@53..55 "=>" + WHITESPACE@55..56 " " + BLOCK_EXPR@56..58 + BLOCK@56..58 + L_CURLY@56..57 "{" + R_CURLY@57..58 "}" + WHITESPACE@58..67 "\n " + MATCH_ARM@67..75 + SLICE_PAT@67..69 + L_BRACK@67..68 "[" + R_BRACK@68..69 "]" + WHITESPACE@69..70 " " + FAT_ARROW@70..72 "=>" + WHITESPACE@72..73 " " + BLOCK_EXPR@73..75 + BLOCK@73..75 + L_CURLY@73..74 "{" + R_CURLY@74..75 "}" + WHITESPACE@75..80 "\n " + R_CURLY@80..81 "}" + WHITESPACE@81..82 "\n" + R_CURLY@82..83 "}" + WHITESPACE@83..84 "\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 5c7cb4a88a..39a86d0028 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 @@ -1,90 +1,90 @@ -SOURCE_FILE@[0; 65) - FN_DEF@[0; 9) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "a" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - BLOCK_EXPR@[7; 9) - BLOCK@[7; 9) - L_CURLY@[7; 8) "{" - R_CURLY@[8; 9) "}" - WHITESPACE@[9; 10) "\n" - FN_DEF@[10; 31) - FN_KW@[10; 12) "fn" - WHITESPACE@[12; 13) " " - NAME@[13; 14) - IDENT@[13; 14) "b" - PARAM_LIST@[14; 16) - L_PAREN@[14; 15) "(" - R_PAREN@[15; 16) ")" - WHITESPACE@[16; 17) " " - BLOCK_EXPR@[17; 31) - BLOCK@[17; 31) - L_CURLY@[17; 18) "{" - WHITESPACE@[18; 19) " " - LET_STMT@[19; 29) - LET_KW@[19; 22) "let" - WHITESPACE@[22; 23) " " - PLACEHOLDER_PAT@[23; 24) - UNDERSCORE@[23; 24) "_" - WHITESPACE@[24; 25) " " - EQ@[25; 26) "=" - WHITESPACE@[26; 27) " " - LITERAL@[27; 28) - INT_NUMBER@[27; 28) "1" - SEMICOLON@[28; 29) ";" - WHITESPACE@[29; 30) " " - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 32) "\n" - FN_DEF@[32; 48) - FN_KW@[32; 34) "fn" - WHITESPACE@[34; 35) " " - NAME@[35; 36) - IDENT@[35; 36) "c" - PARAM_LIST@[36; 38) - L_PAREN@[36; 37) "(" - R_PAREN@[37; 38) ")" - WHITESPACE@[38; 39) " " - BLOCK_EXPR@[39; 48) - BLOCK@[39; 48) - L_CURLY@[39; 40) "{" - WHITESPACE@[40; 41) " " - EXPR_STMT@[41; 43) - LITERAL@[41; 42) - INT_NUMBER@[41; 42) "1" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 44) " " - EXPR_STMT@[44; 46) - LITERAL@[44; 45) - INT_NUMBER@[44; 45) "2" - SEMICOLON@[45; 46) ";" - WHITESPACE@[46; 47) " " - R_CURLY@[47; 48) "}" - WHITESPACE@[48; 49) "\n" - FN_DEF@[49; 64) - FN_KW@[49; 51) "fn" - WHITESPACE@[51; 52) " " - NAME@[52; 53) - IDENT@[52; 53) "d" - PARAM_LIST@[53; 55) - L_PAREN@[53; 54) "(" - R_PAREN@[54; 55) ")" - WHITESPACE@[55; 56) " " - BLOCK_EXPR@[56; 64) - BLOCK@[56; 64) - L_CURLY@[56; 57) "{" - WHITESPACE@[57; 58) " " - EXPR_STMT@[58; 60) - LITERAL@[58; 59) - INT_NUMBER@[58; 59) "1" - SEMICOLON@[59; 60) ";" - WHITESPACE@[60; 61) " " - LITERAL@[61; 62) - INT_NUMBER@[61; 62) "2" - WHITESPACE@[62; 63) " " - R_CURLY@[63; 64) "}" - WHITESPACE@[64; 65) "\n" +SOURCE_FILE@0..65 + FN_DEF@0..9 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "a" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + BLOCK_EXPR@7..9 + BLOCK@7..9 + L_CURLY@7..8 "{" + R_CURLY@8..9 "}" + WHITESPACE@9..10 "\n" + FN_DEF@10..31 + FN_KW@10..12 "fn" + WHITESPACE@12..13 " " + NAME@13..14 + IDENT@13..14 "b" + PARAM_LIST@14..16 + L_PAREN@14..15 "(" + R_PAREN@15..16 ")" + WHITESPACE@16..17 " " + BLOCK_EXPR@17..31 + BLOCK@17..31 + L_CURLY@17..18 "{" + WHITESPACE@18..19 " " + LET_STMT@19..29 + LET_KW@19..22 "let" + WHITESPACE@22..23 " " + PLACEHOLDER_PAT@23..24 + UNDERSCORE@23..24 "_" + WHITESPACE@24..25 " " + EQ@25..26 "=" + WHITESPACE@26..27 " " + LITERAL@27..28 + INT_NUMBER@27..28 "1" + SEMICOLON@28..29 ";" + WHITESPACE@29..30 " " + R_CURLY@30..31 "}" + WHITESPACE@31..32 "\n" + FN_DEF@32..48 + FN_KW@32..34 "fn" + WHITESPACE@34..35 " " + NAME@35..36 + IDENT@35..36 "c" + PARAM_LIST@36..38 + L_PAREN@36..37 "(" + R_PAREN@37..38 ")" + WHITESPACE@38..39 " " + BLOCK_EXPR@39..48 + BLOCK@39..48 + L_CURLY@39..40 "{" + WHITESPACE@40..41 " " + EXPR_STMT@41..43 + LITERAL@41..42 + INT_NUMBER@41..42 "1" + SEMICOLON@42..43 ";" + WHITESPACE@43..44 " " + EXPR_STMT@44..46 + LITERAL@44..45 + INT_NUMBER@44..45 "2" + SEMICOLON@45..46 ";" + WHITESPACE@46..47 " " + R_CURLY@47..48 "}" + WHITESPACE@48..49 "\n" + FN_DEF@49..64 + FN_KW@49..51 "fn" + WHITESPACE@51..52 " " + NAME@52..53 + IDENT@52..53 "d" + PARAM_LIST@53..55 + L_PAREN@53..54 "(" + R_PAREN@54..55 ")" + WHITESPACE@55..56 " " + BLOCK_EXPR@56..64 + BLOCK@56..64 + L_CURLY@56..57 "{" + WHITESPACE@57..58 " " + EXPR_STMT@58..60 + LITERAL@58..59 + INT_NUMBER@58..59 "1" + SEMICOLON@59..60 ";" + WHITESPACE@60..61 " " + LITERAL@61..62 + INT_NUMBER@61..62 "2" + WHITESPACE@62..63 " " + R_CURLY@63..64 "}" + WHITESPACE@64..65 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast index 8e4b63f024..9621ba59eb 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0076_function_where_clause.rast @@ -1,40 +1,40 @@ -SOURCE_FILE@[0; 29) - FN_DEF@[0; 28) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - TYPE_PARAM_LIST@[6; 9) - L_ANGLE@[6; 7) "<" - TYPE_PARAM@[7; 8) - NAME@[7; 8) - IDENT@[7; 8) "T" - R_ANGLE@[8; 9) ">" - PARAM_LIST@[9; 11) - L_PAREN@[9; 10) "(" - R_PAREN@[10; 11) ")" - WHITESPACE@[11; 12) " " - WHERE_CLAUSE@[12; 25) - WHERE_KW@[12; 17) "where" - WHITESPACE@[17; 18) " " - WHERE_PRED@[18; 25) - PATH_TYPE@[18; 19) - PATH@[18; 19) - PATH_SEGMENT@[18; 19) - NAME_REF@[18; 19) - IDENT@[18; 19) "T" - COLON@[19; 20) ":" - WHITESPACE@[20; 21) " " - TYPE_BOUND_LIST@[21; 25) - TYPE_BOUND@[21; 25) - PATH_TYPE@[21; 25) - PATH@[21; 25) - PATH_SEGMENT@[21; 25) - NAME_REF@[21; 25) - IDENT@[21; 25) "Copy" - WHITESPACE@[25; 26) " " - BLOCK_EXPR@[26; 28) - BLOCK@[26; 28) - L_CURLY@[26; 27) "{" - R_CURLY@[27; 28) "}" - WHITESPACE@[28; 29) "\n" +SOURCE_FILE@0..29 + FN_DEF@0..28 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + TYPE_PARAM_LIST@6..9 + L_ANGLE@6..7 "<" + TYPE_PARAM@7..8 + NAME@7..8 + IDENT@7..8 "T" + R_ANGLE@8..9 ">" + PARAM_LIST@9..11 + L_PAREN@9..10 "(" + R_PAREN@10..11 ")" + WHITESPACE@11..12 " " + WHERE_CLAUSE@12..25 + WHERE_KW@12..17 "where" + WHITESPACE@17..18 " " + WHERE_PRED@18..25 + PATH_TYPE@18..19 + PATH@18..19 + PATH_SEGMENT@18..19 + NAME_REF@18..19 + IDENT@18..19 "T" + COLON@19..20 ":" + WHITESPACE@20..21 " " + TYPE_BOUND_LIST@21..25 + TYPE_BOUND@21..25 + PATH_TYPE@21..25 + PATH@21..25 + PATH_SEGMENT@21..25 + NAME_REF@21..25 + IDENT@21..25 "Copy" + WHITESPACE@25..26 " " + BLOCK_EXPR@26..28 + BLOCK@26..28 + L_CURLY@26..27 "{" + R_CURLY@27..28 "}" + WHITESPACE@28..29 "\n" 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 bb9f674e14..ed9d62c5fa 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 @@ -1,26 +1,26 @@ -SOURCE_FILE@[0; 21) - FN_DEF@[0; 20) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 20) - BLOCK@[9; 20) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 18) - TRY_EXPR@[15; 17) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "x" - QUESTION@[16; 17) "?" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" - R_CURLY@[19; 20) "}" - WHITESPACE@[20; 21) "\n" +SOURCE_FILE@0..21 + FN_DEF@0..20 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..20 + BLOCK@9..20 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..18 + TRY_EXPR@15..17 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "x" + QUESTION@16..17 "?" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" + R_CURLY@19..20 "}" + 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 9a38192d94..a08e16fab9 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 @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 16) - TYPE_ALIAS_DEF@[0; 15) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 8) - IDENT@[5; 8) "Foo" - WHITESPACE@[8; 9) " " - EQ@[9; 10) "=" - WHITESPACE@[10; 11) " " - PATH_TYPE@[11; 14) - PATH@[11; 14) - PATH_SEGMENT@[11; 14) - NAME_REF@[11; 14) - IDENT@[11; 14) "Bar" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" +SOURCE_FILE@0..16 + TYPE_ALIAS_DEF@0..15 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..8 + IDENT@5..8 "Foo" + WHITESPACE@8..9 " " + EQ@9..10 "=" + WHITESPACE@10..11 " " + PATH_TYPE@11..14 + PATH@11..14 + PATH_SEGMENT@11..14 + NAME_REF@11..14 + IDENT@11..14 "Bar" + SEMICOLON@14..15 ";" + WHITESPACE@15..16 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast index 4c2863ba72..a00ab40f93 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0079_impl_def.rast @@ -1,14 +1,14 @@ -SOURCE_FILE@[0; 12) - IMPL_DEF@[0; 11) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 8) - PATH@[5; 8) - PATH_SEGMENT@[5; 8) - NAME_REF@[5; 8) - IDENT@[5; 8) "Foo" - WHITESPACE@[8; 9) " " - ITEM_LIST@[9; 11) - L_CURLY@[9; 10) "{" - R_CURLY@[10; 11) "}" - WHITESPACE@[11; 12) "\n" +SOURCE_FILE@0..12 + IMPL_DEF@0..11 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..8 + PATH@5..8 + PATH_SEGMENT@5..8 + NAME_REF@5..8 + IDENT@5..8 "Foo" + WHITESPACE@8..9 " " + ITEM_LIST@9..11 + L_CURLY@9..10 "{" + R_CURLY@10..11 "}" + WHITESPACE@11..12 "\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 b8bafc2201..5141ce70db 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 @@ -1,96 +1,96 @@ -SOURCE_FILE@[0; 89) - FN_DEF@[0; 88) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 88) - BLOCK@[9; 88) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 27) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - BIND_PAT@[19; 20) - NAME@[19; 20) - IDENT@[19; 20) "x" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - RANGE_EXPR@[23; 26) - LITERAL@[23; 24) - INT_NUMBER@[23; 24) "1" - DOT2@[24; 26) ".." - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - EXPR_STMT@[32; 54) - MATCH_EXPR@[32; 53) - MATCH_KW@[32; 37) "match" - WHITESPACE@[37; 38) " " - RANGE_EXPR@[38; 41) - LITERAL@[38; 39) - INT_NUMBER@[38; 39) "1" - DOT2@[39; 41) ".." - WHITESPACE@[41; 42) " " - MATCH_ARM_LIST@[42; 53) - L_CURLY@[42; 43) "{" - WHITESPACE@[43; 44) " " - MATCH_ARM@[44; 51) - PLACEHOLDER_PAT@[44; 45) - UNDERSCORE@[44; 45) "_" - WHITESPACE@[45; 46) " " - FAT_ARROW@[46; 48) "=>" - WHITESPACE@[48; 49) " " - TUPLE_EXPR@[49; 51) - L_PAREN@[49; 50) "(" - R_PAREN@[50; 51) ")" - WHITESPACE@[51; 52) " " - R_CURLY@[52; 53) "}" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 59) "\n " - EXPR_STMT@[59; 86) - MATCH_EXPR@[59; 85) - MATCH_KW@[59; 64) "match" - WHITESPACE@[64; 65) " " - RANGE_EXPR@[65; 73) - METHOD_CALL_EXPR@[65; 70) - PATH_EXPR@[65; 66) - PATH@[65; 66) - PATH_SEGMENT@[65; 66) - NAME_REF@[65; 66) - IDENT@[65; 66) "a" - DOT@[66; 67) "." - NAME_REF@[67; 68) - IDENT@[67; 68) "b" - ARG_LIST@[68; 70) - L_PAREN@[68; 69) "(" - R_PAREN@[69; 70) ")" - DOT2@[70; 72) ".." - PATH_EXPR@[72; 73) - PATH@[72; 73) - PATH_SEGMENT@[72; 73) - NAME_REF@[72; 73) - IDENT@[72; 73) "S" - WHITESPACE@[73; 74) " " - MATCH_ARM_LIST@[74; 85) - L_CURLY@[74; 75) "{" - WHITESPACE@[75; 76) " " - MATCH_ARM@[76; 83) - PLACEHOLDER_PAT@[76; 77) - UNDERSCORE@[76; 77) "_" - WHITESPACE@[77; 78) " " - FAT_ARROW@[78; 80) "=>" - WHITESPACE@[80; 81) " " - TUPLE_EXPR@[81; 83) - L_PAREN@[81; 82) "(" - R_PAREN@[82; 83) ")" - WHITESPACE@[83; 84) " " - R_CURLY@[84; 85) "}" - SEMICOLON@[85; 86) ";" - WHITESPACE@[86; 87) "\n" - R_CURLY@[87; 88) "}" - WHITESPACE@[88; 89) "\n" +SOURCE_FILE@0..89 + FN_DEF@0..88 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..88 + BLOCK@9..88 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..27 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + BIND_PAT@19..20 + NAME@19..20 + IDENT@19..20 "x" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + RANGE_EXPR@23..26 + LITERAL@23..24 + INT_NUMBER@23..24 "1" + DOT2@24..26 ".." + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + EXPR_STMT@32..54 + MATCH_EXPR@32..53 + MATCH_KW@32..37 "match" + WHITESPACE@37..38 " " + RANGE_EXPR@38..41 + LITERAL@38..39 + INT_NUMBER@38..39 "1" + DOT2@39..41 ".." + WHITESPACE@41..42 " " + MATCH_ARM_LIST@42..53 + L_CURLY@42..43 "{" + WHITESPACE@43..44 " " + MATCH_ARM@44..51 + PLACEHOLDER_PAT@44..45 + UNDERSCORE@44..45 "_" + WHITESPACE@45..46 " " + FAT_ARROW@46..48 "=>" + WHITESPACE@48..49 " " + TUPLE_EXPR@49..51 + L_PAREN@49..50 "(" + R_PAREN@50..51 ")" + WHITESPACE@51..52 " " + R_CURLY@52..53 "}" + SEMICOLON@53..54 ";" + WHITESPACE@54..59 "\n " + EXPR_STMT@59..86 + MATCH_EXPR@59..85 + MATCH_KW@59..64 "match" + WHITESPACE@64..65 " " + RANGE_EXPR@65..73 + METHOD_CALL_EXPR@65..70 + PATH_EXPR@65..66 + PATH@65..66 + PATH_SEGMENT@65..66 + NAME_REF@65..66 + IDENT@65..66 "a" + DOT@66..67 "." + NAME_REF@67..68 + IDENT@67..68 "b" + ARG_LIST@68..70 + L_PAREN@68..69 "(" + R_PAREN@69..70 ")" + DOT2@70..72 ".." + PATH_EXPR@72..73 + PATH@72..73 + PATH_SEGMENT@72..73 + NAME_REF@72..73 + IDENT@72..73 "S" + WHITESPACE@73..74 " " + MATCH_ARM_LIST@74..85 + L_CURLY@74..75 "{" + WHITESPACE@75..76 " " + MATCH_ARM@76..83 + PLACEHOLDER_PAT@76..77 + UNDERSCORE@76..77 "_" + WHITESPACE@77..78 " " + FAT_ARROW@78..80 "=>" + WHITESPACE@80..81 " " + TUPLE_EXPR@81..83 + L_PAREN@81..82 "(" + R_PAREN@82..83 ")" + WHITESPACE@83..84 " " + R_CURLY@84..85 "}" + SEMICOLON@85..86 ";" + WHITESPACE@86..87 "\n" + R_CURLY@87..88 "}" + 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 00c4e42204..cdbe641806 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 @@ -1,243 +1,243 @@ -SOURCE_FILE@[0; 200) - TYPE_ALIAS_DEF@[0; 28) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - FOR_TYPE@[9; 27) - FOR_KW@[9; 12) "for" - TYPE_PARAM_LIST@[12; 16) - L_ANGLE@[12; 13) "<" - LIFETIME_PARAM@[13; 15) - LIFETIME@[13; 15) "\'a" - R_ANGLE@[15; 16) ">" - WHITESPACE@[16; 17) " " - FN_POINTER_TYPE@[17; 27) - FN_KW@[17; 19) "fn" - PARAM_LIST@[19; 21) - L_PAREN@[19; 20) "(" - R_PAREN@[20; 21) ")" - WHITESPACE@[21; 22) " " - RET_TYPE@[22; 27) - THIN_ARROW@[22; 24) "->" - WHITESPACE@[24; 25) " " - TUPLE_TYPE@[25; 27) - L_PAREN@[25; 26) "(" - R_PAREN@[26; 27) ")" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 29) "\n" - FN_DEF@[29; 79) - FN_KW@[29; 31) "fn" - WHITESPACE@[31; 32) " " - NAME@[32; 35) - IDENT@[32; 35) "foo" - TYPE_PARAM_LIST@[35; 38) - L_ANGLE@[35; 36) "<" - TYPE_PARAM@[36; 37) - NAME@[36; 37) - IDENT@[36; 37) "T" - R_ANGLE@[37; 38) ">" - PARAM_LIST@[38; 46) - L_PAREN@[38; 39) "(" - PARAM@[39; 45) - BIND_PAT@[39; 41) - NAME@[39; 41) - IDENT@[39; 41) "_t" - COLON@[41; 42) ":" - WHITESPACE@[42; 43) " " - REFERENCE_TYPE@[43; 45) - AMP@[43; 44) "&" - PATH_TYPE@[44; 45) - PATH@[44; 45) - PATH_SEGMENT@[44; 45) - NAME_REF@[44; 45) - IDENT@[44; 45) "T" - R_PAREN@[45; 46) ")" - WHITESPACE@[46; 47) " " - WHERE_CLAUSE@[47; 76) - WHERE_KW@[47; 52) "where" - WHITESPACE@[52; 53) " " - WHERE_PRED@[53; 76) - FOR_TYPE@[53; 66) - FOR_KW@[53; 56) "for" - TYPE_PARAM_LIST@[56; 60) - L_ANGLE@[56; 57) "<" - LIFETIME_PARAM@[57; 59) - LIFETIME@[57; 59) "\'a" - R_ANGLE@[59; 60) ">" - WHITESPACE@[60; 61) " " - REFERENCE_TYPE@[61; 66) - AMP@[61; 62) "&" - LIFETIME@[62; 64) "\'a" - WHITESPACE@[64; 65) " " - PATH_TYPE@[65; 66) - PATH@[65; 66) - PATH_SEGMENT@[65; 66) - NAME_REF@[65; 66) - IDENT@[65; 66) "T" - COLON@[66; 67) ":" - WHITESPACE@[67; 68) " " - TYPE_BOUND_LIST@[68; 76) - TYPE_BOUND@[68; 76) - PATH_TYPE@[68; 76) - PATH@[68; 76) - PATH_SEGMENT@[68; 76) - NAME_REF@[68; 76) - IDENT@[68; 76) "Iterator" - WHITESPACE@[76; 77) " " - BLOCK_EXPR@[77; 79) - BLOCK@[77; 79) - L_CURLY@[77; 78) "{" - R_CURLY@[78; 79) "}" - WHITESPACE@[79; 80) "\n" - FN_DEF@[80; 134) - FN_KW@[80; 82) "fn" - WHITESPACE@[82; 83) " " - NAME@[83; 86) - IDENT@[83; 86) "bar" - TYPE_PARAM_LIST@[86; 89) - L_ANGLE@[86; 87) "<" - TYPE_PARAM@[87; 88) - NAME@[87; 88) - IDENT@[87; 88) "T" - R_ANGLE@[88; 89) ">" - PARAM_LIST@[89; 97) - L_PAREN@[89; 90) "(" - PARAM@[90; 96) - BIND_PAT@[90; 92) - NAME@[90; 92) - IDENT@[90; 92) "_t" - COLON@[92; 93) ":" - WHITESPACE@[93; 94) " " - REFERENCE_TYPE@[94; 96) - AMP@[94; 95) "&" - PATH_TYPE@[95; 96) - PATH@[95; 96) - PATH_SEGMENT@[95; 96) - NAME_REF@[95; 96) - IDENT@[95; 96) "T" - R_PAREN@[96; 97) ")" - WHITESPACE@[97; 98) " " - WHERE_CLAUSE@[98; 131) - WHERE_KW@[98; 103) "where" - WHITESPACE@[103; 104) " " - WHERE_PRED@[104; 131) - FOR_TYPE@[104; 121) - FOR_KW@[104; 107) "for" - TYPE_PARAM_LIST@[107; 111) - L_ANGLE@[107; 108) "<" - LIFETIME_PARAM@[108; 110) - LIFETIME@[108; 110) "\'a" - R_ANGLE@[110; 111) ">" - WHITESPACE@[111; 112) " " - REFERENCE_TYPE@[112; 121) - AMP@[112; 113) "&" - LIFETIME@[113; 115) "\'a" - WHITESPACE@[115; 116) " " - MUT_KW@[116; 119) "mut" - WHITESPACE@[119; 120) " " - PATH_TYPE@[120; 121) - PATH@[120; 121) - PATH_SEGMENT@[120; 121) - NAME_REF@[120; 121) - IDENT@[120; 121) "T" - COLON@[121; 122) ":" - WHITESPACE@[122; 123) " " - TYPE_BOUND_LIST@[123; 131) - TYPE_BOUND@[123; 131) - PATH_TYPE@[123; 131) - PATH@[123; 131) - PATH_SEGMENT@[123; 131) - NAME_REF@[123; 131) - IDENT@[123; 131) "Iterator" - WHITESPACE@[131; 132) " " - BLOCK_EXPR@[132; 134) - BLOCK@[132; 134) - L_CURLY@[132; 133) "{" - R_CURLY@[133; 134) "}" - WHITESPACE@[134; 135) "\n" - FN_DEF@[135; 199) - FN_KW@[135; 137) "fn" - WHITESPACE@[137; 138) " " - NAME@[138; 141) - IDENT@[138; 141) "baz" - TYPE_PARAM_LIST@[141; 144) - L_ANGLE@[141; 142) "<" - TYPE_PARAM@[142; 143) - NAME@[142; 143) - IDENT@[142; 143) "T" - R_ANGLE@[143; 144) ">" - PARAM_LIST@[144; 152) - L_PAREN@[144; 145) "(" - PARAM@[145; 151) - BIND_PAT@[145; 147) - NAME@[145; 147) - IDENT@[145; 147) "_t" - COLON@[147; 148) ":" - WHITESPACE@[148; 149) " " - REFERENCE_TYPE@[149; 151) - AMP@[149; 150) "&" - PATH_TYPE@[150; 151) - PATH@[150; 151) - PATH_SEGMENT@[150; 151) - NAME_REF@[150; 151) - IDENT@[150; 151) "T" - R_PAREN@[151; 152) ")" - WHITESPACE@[152; 153) " " - WHERE_CLAUSE@[153; 196) - WHERE_KW@[153; 158) "where" - WHITESPACE@[158; 159) " " - WHERE_PRED@[159; 196) - FOR_TYPE@[159; 186) - FOR_KW@[159; 162) "for" - TYPE_PARAM_LIST@[162; 166) - L_ANGLE@[162; 163) "<" - LIFETIME_PARAM@[163; 165) - LIFETIME@[163; 165) "\'a" - R_ANGLE@[165; 166) ">" - WHITESPACE@[166; 167) " " - PATH_TYPE@[167; 186) - PATH@[167; 186) - PATH@[167; 181) - PATH_SEGMENT@[167; 181) - L_ANGLE@[167; 168) "<" - REFERENCE_TYPE@[168; 173) - AMP@[168; 169) "&" - LIFETIME@[169; 171) "\'a" - WHITESPACE@[171; 172) " " - PATH_TYPE@[172; 173) - PATH@[172; 173) - PATH_SEGMENT@[172; 173) - NAME_REF@[172; 173) - IDENT@[172; 173) "T" - WHITESPACE@[173; 174) " " - AS_KW@[174; 176) "as" - WHITESPACE@[176; 177) " " - PATH_TYPE@[177; 180) - PATH@[177; 180) - PATH_SEGMENT@[177; 180) - NAME_REF@[177; 180) - IDENT@[177; 180) "Baz" - R_ANGLE@[180; 181) ">" - COLON2@[181; 183) "::" - PATH_SEGMENT@[183; 186) - NAME_REF@[183; 186) - IDENT@[183; 186) "Foo" - COLON@[186; 187) ":" - WHITESPACE@[187; 188) " " - TYPE_BOUND_LIST@[188; 196) - TYPE_BOUND@[188; 196) - PATH_TYPE@[188; 196) - PATH@[188; 196) - PATH_SEGMENT@[188; 196) - NAME_REF@[188; 196) - IDENT@[188; 196) "Iterator" - WHITESPACE@[196; 197) " " - BLOCK_EXPR@[197; 199) - BLOCK@[197; 199) - L_CURLY@[197; 198) "{" - R_CURLY@[198; 199) "}" - WHITESPACE@[199; 200) "\n" +SOURCE_FILE@0..200 + TYPE_ALIAS_DEF@0..28 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + FOR_TYPE@9..27 + FOR_KW@9..12 "for" + TYPE_PARAM_LIST@12..16 + L_ANGLE@12..13 "<" + LIFETIME_PARAM@13..15 + LIFETIME@13..15 "\'a" + R_ANGLE@15..16 ">" + WHITESPACE@16..17 " " + FN_POINTER_TYPE@17..27 + FN_KW@17..19 "fn" + PARAM_LIST@19..21 + L_PAREN@19..20 "(" + R_PAREN@20..21 ")" + WHITESPACE@21..22 " " + RET_TYPE@22..27 + THIN_ARROW@22..24 "->" + WHITESPACE@24..25 " " + TUPLE_TYPE@25..27 + L_PAREN@25..26 "(" + R_PAREN@26..27 ")" + SEMICOLON@27..28 ";" + WHITESPACE@28..29 "\n" + FN_DEF@29..79 + FN_KW@29..31 "fn" + WHITESPACE@31..32 " " + NAME@32..35 + IDENT@32..35 "foo" + TYPE_PARAM_LIST@35..38 + L_ANGLE@35..36 "<" + TYPE_PARAM@36..37 + NAME@36..37 + IDENT@36..37 "T" + R_ANGLE@37..38 ">" + PARAM_LIST@38..46 + L_PAREN@38..39 "(" + PARAM@39..45 + BIND_PAT@39..41 + NAME@39..41 + IDENT@39..41 "_t" + COLON@41..42 ":" + WHITESPACE@42..43 " " + REFERENCE_TYPE@43..45 + AMP@43..44 "&" + PATH_TYPE@44..45 + PATH@44..45 + PATH_SEGMENT@44..45 + NAME_REF@44..45 + IDENT@44..45 "T" + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + WHERE_CLAUSE@47..76 + WHERE_KW@47..52 "where" + WHITESPACE@52..53 " " + WHERE_PRED@53..76 + FOR_TYPE@53..66 + FOR_KW@53..56 "for" + TYPE_PARAM_LIST@56..60 + L_ANGLE@56..57 "<" + LIFETIME_PARAM@57..59 + LIFETIME@57..59 "\'a" + R_ANGLE@59..60 ">" + WHITESPACE@60..61 " " + REFERENCE_TYPE@61..66 + AMP@61..62 "&" + LIFETIME@62..64 "\'a" + WHITESPACE@64..65 " " + PATH_TYPE@65..66 + PATH@65..66 + PATH_SEGMENT@65..66 + NAME_REF@65..66 + IDENT@65..66 "T" + COLON@66..67 ":" + WHITESPACE@67..68 " " + TYPE_BOUND_LIST@68..76 + TYPE_BOUND@68..76 + PATH_TYPE@68..76 + PATH@68..76 + PATH_SEGMENT@68..76 + NAME_REF@68..76 + IDENT@68..76 "Iterator" + WHITESPACE@76..77 " " + BLOCK_EXPR@77..79 + BLOCK@77..79 + L_CURLY@77..78 "{" + R_CURLY@78..79 "}" + WHITESPACE@79..80 "\n" + FN_DEF@80..134 + FN_KW@80..82 "fn" + WHITESPACE@82..83 " " + NAME@83..86 + IDENT@83..86 "bar" + TYPE_PARAM_LIST@86..89 + L_ANGLE@86..87 "<" + TYPE_PARAM@87..88 + NAME@87..88 + IDENT@87..88 "T" + R_ANGLE@88..89 ">" + PARAM_LIST@89..97 + L_PAREN@89..90 "(" + PARAM@90..96 + BIND_PAT@90..92 + NAME@90..92 + IDENT@90..92 "_t" + COLON@92..93 ":" + WHITESPACE@93..94 " " + REFERENCE_TYPE@94..96 + AMP@94..95 "&" + PATH_TYPE@95..96 + PATH@95..96 + PATH_SEGMENT@95..96 + NAME_REF@95..96 + IDENT@95..96 "T" + R_PAREN@96..97 ")" + WHITESPACE@97..98 " " + WHERE_CLAUSE@98..131 + WHERE_KW@98..103 "where" + WHITESPACE@103..104 " " + WHERE_PRED@104..131 + FOR_TYPE@104..121 + FOR_KW@104..107 "for" + TYPE_PARAM_LIST@107..111 + L_ANGLE@107..108 "<" + LIFETIME_PARAM@108..110 + LIFETIME@108..110 "\'a" + R_ANGLE@110..111 ">" + WHITESPACE@111..112 " " + REFERENCE_TYPE@112..121 + AMP@112..113 "&" + LIFETIME@113..115 "\'a" + WHITESPACE@115..116 " " + MUT_KW@116..119 "mut" + WHITESPACE@119..120 " " + PATH_TYPE@120..121 + PATH@120..121 + PATH_SEGMENT@120..121 + NAME_REF@120..121 + IDENT@120..121 "T" + COLON@121..122 ":" + WHITESPACE@122..123 " " + TYPE_BOUND_LIST@123..131 + TYPE_BOUND@123..131 + PATH_TYPE@123..131 + PATH@123..131 + PATH_SEGMENT@123..131 + NAME_REF@123..131 + IDENT@123..131 "Iterator" + WHITESPACE@131..132 " " + BLOCK_EXPR@132..134 + BLOCK@132..134 + L_CURLY@132..133 "{" + R_CURLY@133..134 "}" + WHITESPACE@134..135 "\n" + FN_DEF@135..199 + FN_KW@135..137 "fn" + WHITESPACE@137..138 " " + NAME@138..141 + IDENT@138..141 "baz" + TYPE_PARAM_LIST@141..144 + L_ANGLE@141..142 "<" + TYPE_PARAM@142..143 + NAME@142..143 + IDENT@142..143 "T" + R_ANGLE@143..144 ">" + PARAM_LIST@144..152 + L_PAREN@144..145 "(" + PARAM@145..151 + BIND_PAT@145..147 + NAME@145..147 + IDENT@145..147 "_t" + COLON@147..148 ":" + WHITESPACE@148..149 " " + REFERENCE_TYPE@149..151 + AMP@149..150 "&" + PATH_TYPE@150..151 + PATH@150..151 + PATH_SEGMENT@150..151 + NAME_REF@150..151 + IDENT@150..151 "T" + R_PAREN@151..152 ")" + WHITESPACE@152..153 " " + WHERE_CLAUSE@153..196 + WHERE_KW@153..158 "where" + WHITESPACE@158..159 " " + WHERE_PRED@159..196 + FOR_TYPE@159..186 + FOR_KW@159..162 "for" + TYPE_PARAM_LIST@162..166 + L_ANGLE@162..163 "<" + LIFETIME_PARAM@163..165 + LIFETIME@163..165 "\'a" + R_ANGLE@165..166 ">" + WHITESPACE@166..167 " " + PATH_TYPE@167..186 + PATH@167..186 + PATH@167..181 + PATH_SEGMENT@167..181 + L_ANGLE@167..168 "<" + REFERENCE_TYPE@168..173 + AMP@168..169 "&" + LIFETIME@169..171 "\'a" + WHITESPACE@171..172 " " + PATH_TYPE@172..173 + PATH@172..173 + PATH_SEGMENT@172..173 + NAME_REF@172..173 + IDENT@172..173 "T" + WHITESPACE@173..174 " " + AS_KW@174..176 "as" + WHITESPACE@176..177 " " + PATH_TYPE@177..180 + PATH@177..180 + PATH_SEGMENT@177..180 + NAME_REF@177..180 + IDENT@177..180 "Baz" + R_ANGLE@180..181 ">" + COLON2@181..183 "::" + PATH_SEGMENT@183..186 + NAME_REF@183..186 + IDENT@183..186 "Foo" + COLON@186..187 ":" + WHITESPACE@187..188 " " + TYPE_BOUND_LIST@188..196 + TYPE_BOUND@188..196 + PATH_TYPE@188..196 + PATH@188..196 + PATH_SEGMENT@188..196 + NAME_REF@188..196 + IDENT@188..196 "Iterator" + WHITESPACE@196..197 " " + BLOCK_EXPR@197..199 + BLOCK@197..199 + L_CURLY@197..198 "{" + R_CURLY@198..199 "}" + WHITESPACE@199..200 "\n" 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 2999977fc9..fbad333895 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 @@ -1,55 +1,55 @@ -SOURCE_FILE@[0; 52) - FN_DEF@[0; 51) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 51) - BLOCK@[9; 51) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 26) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - REF_EXPR@[23; 25) - AMP@[23; 24) "&" - LITERAL@[24; 25) - INT_NUMBER@[24; 25) "1" - SEMICOLON@[25; 26) ";" - WHITESPACE@[26; 31) "\n " - LET_STMT@[31; 49) - LET_KW@[31; 34) "let" - WHITESPACE@[34; 35) " " - PLACEHOLDER_PAT@[35; 36) - UNDERSCORE@[35; 36) "_" - WHITESPACE@[36; 37) " " - EQ@[37; 38) "=" - WHITESPACE@[38; 39) " " - REF_EXPR@[39; 48) - AMP@[39; 40) "&" - MUT_KW@[40; 43) "mut" - WHITESPACE@[43; 44) " " - REF_EXPR@[44; 48) - AMP@[44; 45) "&" - CALL_EXPR@[45; 48) - PATH_EXPR@[45; 46) - PATH@[45; 46) - PATH_SEGMENT@[45; 46) - NAME_REF@[45; 46) - IDENT@[45; 46) "f" - ARG_LIST@[46; 48) - L_PAREN@[46; 47) "(" - R_PAREN@[47; 48) ")" - SEMICOLON@[48; 49) ";" - WHITESPACE@[49; 50) "\n" - R_CURLY@[50; 51) "}" - WHITESPACE@[51; 52) "\n" +SOURCE_FILE@0..52 + FN_DEF@0..51 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..51 + BLOCK@9..51 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..26 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + REF_EXPR@23..25 + AMP@23..24 "&" + LITERAL@24..25 + INT_NUMBER@24..25 "1" + SEMICOLON@25..26 ";" + WHITESPACE@26..31 "\n " + LET_STMT@31..49 + LET_KW@31..34 "let" + WHITESPACE@34..35 " " + PLACEHOLDER_PAT@35..36 + UNDERSCORE@35..36 "_" + WHITESPACE@36..37 " " + EQ@37..38 "=" + WHITESPACE@38..39 " " + REF_EXPR@39..48 + AMP@39..40 "&" + MUT_KW@40..43 "mut" + WHITESPACE@43..44 " " + REF_EXPR@44..48 + AMP@44..45 "&" + CALL_EXPR@45..48 + PATH_EXPR@45..46 + PATH@45..46 + PATH_SEGMENT@45..46 + NAME_REF@45..46 + IDENT@45..46 "f" + ARG_LIST@46..48 + L_PAREN@46..47 "(" + R_PAREN@47..48 ")" + SEMICOLON@48..49 ";" + WHITESPACE@49..50 "\n" + R_CURLY@50..51 "}" + 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 13393e4b82..217b07e59c 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 @@ -1,87 +1,87 @@ -SOURCE_FILE@[0; 106) - STRUCT_DEF@[0; 11) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 10) - IDENT@[7; 10) "Foo" - SEMICOLON@[10; 11) ";" - WHITESPACE@[11; 12) "\n" - STRUCT_DEF@[12; 25) - STRUCT_KW@[12; 18) "struct" - WHITESPACE@[18; 19) " " - NAME@[19; 22) - IDENT@[19; 22) "Foo" - WHITESPACE@[22; 23) " " - RECORD_FIELD_DEF_LIST@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" - STRUCT_DEF@[26; 39) - STRUCT_KW@[26; 32) "struct" - WHITESPACE@[32; 33) " " - NAME@[33; 36) - IDENT@[33; 36) "Foo" - TUPLE_FIELD_DEF_LIST@[36; 38) - L_PAREN@[36; 37) "(" - R_PAREN@[37; 38) ")" - SEMICOLON@[38; 39) ";" - WHITESPACE@[39; 40) "\n" - STRUCT_DEF@[40; 66) - STRUCT_KW@[40; 46) "struct" - WHITESPACE@[46; 47) " " - NAME@[47; 50) - IDENT@[47; 50) "Foo" - TUPLE_FIELD_DEF_LIST@[50; 65) - L_PAREN@[50; 51) "(" - TUPLE_FIELD_DEF@[51; 57) - PATH_TYPE@[51; 57) - PATH@[51; 57) - PATH_SEGMENT@[51; 57) - NAME_REF@[51; 57) - IDENT@[51; 57) "String" - COMMA@[57; 58) "," - WHITESPACE@[58; 59) " " - TUPLE_FIELD_DEF@[59; 64) - PATH_TYPE@[59; 64) - PATH@[59; 64) - PATH_SEGMENT@[59; 64) - NAME_REF@[59; 64) - IDENT@[59; 64) "usize" - R_PAREN@[64; 65) ")" - SEMICOLON@[65; 66) ";" - WHITESPACE@[66; 67) "\n" - STRUCT_DEF@[67; 105) - STRUCT_KW@[67; 73) "struct" - WHITESPACE@[73; 74) " " - NAME@[74; 77) - IDENT@[74; 77) "Foo" - WHITESPACE@[77; 78) " " - RECORD_FIELD_DEF_LIST@[78; 105) - L_CURLY@[78; 79) "{" - WHITESPACE@[79; 84) "\n " - RECORD_FIELD_DEF@[84; 90) - NAME@[84; 85) - IDENT@[84; 85) "a" - COLON@[85; 86) ":" - WHITESPACE@[86; 87) " " - PATH_TYPE@[87; 90) - PATH@[87; 90) - PATH_SEGMENT@[87; 90) - NAME_REF@[87; 90) - IDENT@[87; 90) "i32" - COMMA@[90; 91) "," - WHITESPACE@[91; 96) "\n " - RECORD_FIELD_DEF@[96; 102) - NAME@[96; 97) - IDENT@[96; 97) "b" - COLON@[97; 98) ":" - WHITESPACE@[98; 99) " " - PATH_TYPE@[99; 102) - PATH@[99; 102) - PATH_SEGMENT@[99; 102) - NAME_REF@[99; 102) - IDENT@[99; 102) "f32" - COMMA@[102; 103) "," - WHITESPACE@[103; 104) "\n" - R_CURLY@[104; 105) "}" - WHITESPACE@[105; 106) "\n" +SOURCE_FILE@0..106 + STRUCT_DEF@0..11 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..10 + IDENT@7..10 "Foo" + SEMICOLON@10..11 ";" + WHITESPACE@11..12 "\n" + STRUCT_DEF@12..25 + STRUCT_KW@12..18 "struct" + WHITESPACE@18..19 " " + NAME@19..22 + IDENT@19..22 "Foo" + WHITESPACE@22..23 " " + RECORD_FIELD_DEF_LIST@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + WHITESPACE@25..26 "\n" + STRUCT_DEF@26..39 + STRUCT_KW@26..32 "struct" + WHITESPACE@32..33 " " + NAME@33..36 + IDENT@33..36 "Foo" + TUPLE_FIELD_DEF_LIST@36..38 + L_PAREN@36..37 "(" + R_PAREN@37..38 ")" + SEMICOLON@38..39 ";" + WHITESPACE@39..40 "\n" + STRUCT_DEF@40..66 + STRUCT_KW@40..46 "struct" + WHITESPACE@46..47 " " + NAME@47..50 + IDENT@47..50 "Foo" + TUPLE_FIELD_DEF_LIST@50..65 + L_PAREN@50..51 "(" + TUPLE_FIELD_DEF@51..57 + PATH_TYPE@51..57 + PATH@51..57 + PATH_SEGMENT@51..57 + NAME_REF@51..57 + IDENT@51..57 "String" + COMMA@57..58 "," + WHITESPACE@58..59 " " + TUPLE_FIELD_DEF@59..64 + PATH_TYPE@59..64 + PATH@59..64 + PATH_SEGMENT@59..64 + NAME_REF@59..64 + IDENT@59..64 "usize" + R_PAREN@64..65 ")" + SEMICOLON@65..66 ";" + WHITESPACE@66..67 "\n" + STRUCT_DEF@67..105 + STRUCT_KW@67..73 "struct" + WHITESPACE@73..74 " " + NAME@74..77 + IDENT@74..77 "Foo" + WHITESPACE@77..78 " " + RECORD_FIELD_DEF_LIST@78..105 + L_CURLY@78..79 "{" + WHITESPACE@79..84 "\n " + RECORD_FIELD_DEF@84..90 + NAME@84..85 + IDENT@84..85 "a" + COLON@85..86 ":" + WHITESPACE@86..87 " " + PATH_TYPE@87..90 + PATH@87..90 + PATH_SEGMENT@87..90 + NAME_REF@87..90 + IDENT@87..90 "i32" + COMMA@90..91 "," + WHITESPACE@91..96 "\n " + RECORD_FIELD_DEF@96..102 + NAME@96..97 + IDENT@96..97 "b" + COLON@97..98 ":" + WHITESPACE@98..99 " " + PATH_TYPE@99..102 + PATH@99..102 + PATH_SEGMENT@99..102 + NAME_REF@99..102 + IDENT@99..102 "f32" + COMMA@102..103 "," + WHITESPACE@103..104 "\n" + R_CURLY@104..105 "}" + WHITESPACE@105..106 "\n" 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 79d193616d..9cd8910d43 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 @@ -1,19 +1,19 @@ -SOURCE_FILE@[0; 16) - TYPE_ALIAS_DEF@[0; 15) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - PAREN_TYPE@[9; 14) - L_PAREN@[9; 10) "(" - PATH_TYPE@[10; 13) - PATH@[10; 13) - PATH_SEGMENT@[10; 13) - NAME_REF@[10; 13) - IDENT@[10; 13) "i32" - R_PAREN@[13; 14) ")" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" +SOURCE_FILE@0..16 + TYPE_ALIAS_DEF@0..15 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + PAREN_TYPE@9..14 + L_PAREN@9..10 "(" + PATH_TYPE@10..13 + PATH@10..13 + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "i32" + R_PAREN@13..14 ")" + SEMICOLON@14..15 ";" + 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 c2cec89b40..b165789fd2 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 @@ -1,136 +1,136 @@ -SOURCE_FILE@[0; 189) - FN_DEF@[0; 188) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 188) - BLOCK@[9; 188) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 28) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - LITERAL@[23; 27) - TRUE_KW@[23; 27) "true" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 33) "\n " - LET_STMT@[33; 47) - LET_KW@[33; 36) "let" - WHITESPACE@[36; 37) " " - PLACEHOLDER_PAT@[37; 38) - UNDERSCORE@[37; 38) "_" - WHITESPACE@[38; 39) " " - EQ@[39; 40) "=" - WHITESPACE@[40; 41) " " - LITERAL@[41; 46) - FALSE_KW@[41; 46) "false" - SEMICOLON@[46; 47) ";" - WHITESPACE@[47; 52) "\n " - LET_STMT@[52; 62) - LET_KW@[52; 55) "let" - WHITESPACE@[55; 56) " " - PLACEHOLDER_PAT@[56; 57) - UNDERSCORE@[56; 57) "_" - WHITESPACE@[57; 58) " " - EQ@[58; 59) "=" - WHITESPACE@[59; 60) " " - LITERAL@[60; 61) - INT_NUMBER@[60; 61) "1" - SEMICOLON@[61; 62) ";" - WHITESPACE@[62; 67) "\n " - LET_STMT@[67; 79) - LET_KW@[67; 70) "let" - WHITESPACE@[70; 71) " " - PLACEHOLDER_PAT@[71; 72) - UNDERSCORE@[71; 72) "_" - WHITESPACE@[72; 73) " " - EQ@[73; 74) "=" - WHITESPACE@[74; 75) " " - LITERAL@[75; 78) - FLOAT_NUMBER@[75; 78) "2.0" - SEMICOLON@[78; 79) ";" - WHITESPACE@[79; 84) "\n " - LET_STMT@[84; 97) - LET_KW@[84; 87) "let" - WHITESPACE@[87; 88) " " - PLACEHOLDER_PAT@[88; 89) - UNDERSCORE@[88; 89) "_" - WHITESPACE@[89; 90) " " - EQ@[90; 91) "=" - WHITESPACE@[91; 92) " " - LITERAL@[92; 96) - BYTE@[92; 96) "b\'a\'" - SEMICOLON@[96; 97) ";" - WHITESPACE@[97; 102) "\n " - LET_STMT@[102; 114) - LET_KW@[102; 105) "let" - WHITESPACE@[105; 106) " " - PLACEHOLDER_PAT@[106; 107) - UNDERSCORE@[106; 107) "_" - WHITESPACE@[107; 108) " " - EQ@[108; 109) "=" - WHITESPACE@[109; 110) " " - LITERAL@[110; 113) - CHAR@[110; 113) "\'b\'" - SEMICOLON@[113; 114) ";" - WHITESPACE@[114; 119) "\n " - LET_STMT@[119; 131) - LET_KW@[119; 122) "let" - WHITESPACE@[122; 123) " " - PLACEHOLDER_PAT@[123; 124) - UNDERSCORE@[123; 124) "_" - WHITESPACE@[124; 125) " " - EQ@[125; 126) "=" - WHITESPACE@[126; 127) " " - LITERAL@[127; 130) - STRING@[127; 130) "\"c\"" - SEMICOLON@[130; 131) ";" - WHITESPACE@[131; 136) "\n " - LET_STMT@[136; 149) - LET_KW@[136; 139) "let" - WHITESPACE@[139; 140) " " - PLACEHOLDER_PAT@[140; 141) - UNDERSCORE@[140; 141) "_" - WHITESPACE@[141; 142) " " - EQ@[142; 143) "=" - WHITESPACE@[143; 144) " " - LITERAL@[144; 148) - RAW_STRING@[144; 148) "r\"d\"" - SEMICOLON@[148; 149) ";" - WHITESPACE@[149; 154) "\n " - LET_STMT@[154; 167) - LET_KW@[154; 157) "let" - WHITESPACE@[157; 158) " " - PLACEHOLDER_PAT@[158; 159) - UNDERSCORE@[158; 159) "_" - WHITESPACE@[159; 160) " " - EQ@[160; 161) "=" - WHITESPACE@[161; 162) " " - LITERAL@[162; 166) - BYTE_STRING@[162; 166) "b\"e\"" - SEMICOLON@[166; 167) ";" - WHITESPACE@[167; 172) "\n " - LET_STMT@[172; 186) - LET_KW@[172; 175) "let" - WHITESPACE@[175; 176) " " - PLACEHOLDER_PAT@[176; 177) - UNDERSCORE@[176; 177) "_" - WHITESPACE@[177; 178) " " - EQ@[178; 179) "=" - WHITESPACE@[179; 180) " " - LITERAL@[180; 185) - RAW_BYTE_STRING@[180; 185) "br\"f\"" - SEMICOLON@[185; 186) ";" - WHITESPACE@[186; 187) "\n" - R_CURLY@[187; 188) "}" - WHITESPACE@[188; 189) "\n" +SOURCE_FILE@0..189 + FN_DEF@0..188 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..188 + BLOCK@9..188 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..28 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + LITERAL@23..27 + TRUE_KW@23..27 "true" + SEMICOLON@27..28 ";" + WHITESPACE@28..33 "\n " + LET_STMT@33..47 + LET_KW@33..36 "let" + WHITESPACE@36..37 " " + PLACEHOLDER_PAT@37..38 + UNDERSCORE@37..38 "_" + WHITESPACE@38..39 " " + EQ@39..40 "=" + WHITESPACE@40..41 " " + LITERAL@41..46 + FALSE_KW@41..46 "false" + SEMICOLON@46..47 ";" + WHITESPACE@47..52 "\n " + LET_STMT@52..62 + LET_KW@52..55 "let" + WHITESPACE@55..56 " " + PLACEHOLDER_PAT@56..57 + UNDERSCORE@56..57 "_" + WHITESPACE@57..58 " " + EQ@58..59 "=" + WHITESPACE@59..60 " " + LITERAL@60..61 + INT_NUMBER@60..61 "1" + SEMICOLON@61..62 ";" + WHITESPACE@62..67 "\n " + LET_STMT@67..79 + LET_KW@67..70 "let" + WHITESPACE@70..71 " " + PLACEHOLDER_PAT@71..72 + UNDERSCORE@71..72 "_" + WHITESPACE@72..73 " " + EQ@73..74 "=" + WHITESPACE@74..75 " " + LITERAL@75..78 + FLOAT_NUMBER@75..78 "2.0" + SEMICOLON@78..79 ";" + WHITESPACE@79..84 "\n " + LET_STMT@84..97 + LET_KW@84..87 "let" + WHITESPACE@87..88 " " + PLACEHOLDER_PAT@88..89 + UNDERSCORE@88..89 "_" + WHITESPACE@89..90 " " + EQ@90..91 "=" + WHITESPACE@91..92 " " + LITERAL@92..96 + BYTE@92..96 "b\'a\'" + SEMICOLON@96..97 ";" + WHITESPACE@97..102 "\n " + LET_STMT@102..114 + LET_KW@102..105 "let" + WHITESPACE@105..106 " " + PLACEHOLDER_PAT@106..107 + UNDERSCORE@106..107 "_" + WHITESPACE@107..108 " " + EQ@108..109 "=" + WHITESPACE@109..110 " " + LITERAL@110..113 + CHAR@110..113 "\'b\'" + SEMICOLON@113..114 ";" + WHITESPACE@114..119 "\n " + LET_STMT@119..131 + LET_KW@119..122 "let" + WHITESPACE@122..123 " " + PLACEHOLDER_PAT@123..124 + UNDERSCORE@123..124 "_" + WHITESPACE@124..125 " " + EQ@125..126 "=" + WHITESPACE@126..127 " " + LITERAL@127..130 + STRING@127..130 "\"c\"" + SEMICOLON@130..131 ";" + WHITESPACE@131..136 "\n " + LET_STMT@136..149 + LET_KW@136..139 "let" + WHITESPACE@139..140 " " + PLACEHOLDER_PAT@140..141 + UNDERSCORE@140..141 "_" + WHITESPACE@141..142 " " + EQ@142..143 "=" + WHITESPACE@143..144 " " + LITERAL@144..148 + RAW_STRING@144..148 "r\"d\"" + SEMICOLON@148..149 ";" + WHITESPACE@149..154 "\n " + LET_STMT@154..167 + LET_KW@154..157 "let" + WHITESPACE@157..158 " " + PLACEHOLDER_PAT@158..159 + UNDERSCORE@158..159 "_" + WHITESPACE@159..160 " " + EQ@160..161 "=" + WHITESPACE@161..162 " " + LITERAL@162..166 + BYTE_STRING@162..166 "b\"e\"" + SEMICOLON@166..167 ";" + WHITESPACE@167..172 "\n " + LET_STMT@172..186 + LET_KW@172..175 "let" + WHITESPACE@175..176 " " + PLACEHOLDER_PAT@176..177 + UNDERSCORE@176..177 "_" + WHITESPACE@177..178 " " + EQ@178..179 "=" + WHITESPACE@179..180 " " + LITERAL@180..185 + RAW_BYTE_STRING@180..185 "br\"f\"" + SEMICOLON@185..186 ";" + WHITESPACE@186..187 "\n" + R_CURLY@187..188 "}" + WHITESPACE@188..189 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast index ca1a97161f..36f17133d4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0086_function_ret_type.rast @@ -1,36 +1,36 @@ -SOURCE_FILE@[0; 30) - FN_DEF@[0; 11) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 11) - BLOCK@[9; 11) - L_CURLY@[9; 10) "{" - R_CURLY@[10; 11) "}" - WHITESPACE@[11; 12) "\n" - FN_DEF@[12; 29) - FN_KW@[12; 14) "fn" - WHITESPACE@[14; 15) " " - NAME@[15; 18) - IDENT@[15; 18) "bar" - PARAM_LIST@[18; 20) - L_PAREN@[18; 19) "(" - R_PAREN@[19; 20) ")" - WHITESPACE@[20; 21) " " - RET_TYPE@[21; 26) - THIN_ARROW@[21; 23) "->" - WHITESPACE@[23; 24) " " - TUPLE_TYPE@[24; 26) - L_PAREN@[24; 25) "(" - R_PAREN@[25; 26) ")" - WHITESPACE@[26; 27) " " - BLOCK_EXPR@[27; 29) - BLOCK@[27; 29) - L_CURLY@[27; 28) "{" - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) "\n" +SOURCE_FILE@0..30 + FN_DEF@0..11 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..11 + BLOCK@9..11 + L_CURLY@9..10 "{" + R_CURLY@10..11 "}" + WHITESPACE@11..12 "\n" + FN_DEF@12..29 + FN_KW@12..14 "fn" + WHITESPACE@14..15 " " + NAME@15..18 + IDENT@15..18 "bar" + PARAM_LIST@18..20 + L_PAREN@18..19 "(" + R_PAREN@19..20 ")" + WHITESPACE@20..21 " " + RET_TYPE@21..26 + THIN_ARROW@21..23 "->" + WHITESPACE@23..24 " " + TUPLE_TYPE@24..26 + L_PAREN@24..25 "(" + R_PAREN@25..26 ")" + WHITESPACE@26..27 " " + BLOCK_EXPR@27..29 + BLOCK@27..29 + L_CURLY@27..28 "{" + R_CURLY@28..29 "}" + WHITESPACE@29..30 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast index e614acc6fa..01ed3afca4 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0087_unsafe_impl.rast @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 19) - IMPL_DEF@[0; 18) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - IMPL_KW@[7; 11) "impl" - WHITESPACE@[11; 12) " " - PATH_TYPE@[12; 15) - PATH@[12; 15) - PATH_SEGMENT@[12; 15) - NAME_REF@[12; 15) - IDENT@[12; 15) "Foo" - WHITESPACE@[15; 16) " " - ITEM_LIST@[16; 18) - L_CURLY@[16; 17) "{" - R_CURLY@[17; 18) "}" - WHITESPACE@[18; 19) "\n" +SOURCE_FILE@0..19 + IMPL_DEF@0..18 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + IMPL_KW@7..11 "impl" + WHITESPACE@11..12 " " + PATH_TYPE@12..15 + PATH@12..15 + PATH_SEGMENT@12..15 + NAME_REF@12..15 + IDENT@12..15 "Foo" + WHITESPACE@15..16 " " + ITEM_LIST@16..18 + L_CURLY@16..17 "{" + R_CURLY@17..18 "}" + WHITESPACE@18..19 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast index b23f43b462..ca5aa007e6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0088_break_ambiguity.rast @@ -1,69 +1,69 @@ -SOURCE_FILE@[0; 88) - FN_DEF@[0; 87) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - BLOCK_EXPR@[8; 87) - BLOCK@[8; 87) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 14) "\n " - EXPR_STMT@[14; 25) - IF_EXPR@[14; 25) - IF_KW@[14; 16) "if" - WHITESPACE@[16; 17) " " - CONDITION@[17; 22) - BREAK_EXPR@[17; 22) - BREAK_KW@[17; 22) "break" - WHITESPACE@[22; 23) " " - BLOCK_EXPR@[23; 25) - BLOCK@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 30) "\n " - EXPR_STMT@[30; 44) - WHILE_EXPR@[30; 44) - WHILE_KW@[30; 35) "while" - WHITESPACE@[35; 36) " " - CONDITION@[36; 41) - BREAK_EXPR@[36; 41) - BREAK_KW@[36; 41) "break" - WHITESPACE@[41; 42) " " - BLOCK_EXPR@[42; 44) - BLOCK@[42; 44) - L_CURLY@[42; 43) "{" - R_CURLY@[43; 44) "}" - WHITESPACE@[44; 49) "\n " - EXPR_STMT@[49; 66) - FOR_EXPR@[49; 66) - FOR_KW@[49; 52) "for" - WHITESPACE@[52; 53) " " - BIND_PAT@[53; 54) - NAME@[53; 54) - IDENT@[53; 54) "i" - WHITESPACE@[54; 55) " " - IN_KW@[55; 57) "in" - WHITESPACE@[57; 58) " " - BREAK_EXPR@[58; 63) - BREAK_KW@[58; 63) "break" - WHITESPACE@[63; 64) " " - BLOCK_EXPR@[64; 66) - BLOCK@[64; 66) - L_CURLY@[64; 65) "{" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 71) "\n " - MATCH_EXPR@[71; 85) - MATCH_KW@[71; 76) "match" - WHITESPACE@[76; 77) " " - BREAK_EXPR@[77; 82) - BREAK_KW@[77; 82) "break" - WHITESPACE@[82; 83) " " - MATCH_ARM_LIST@[83; 85) - L_CURLY@[83; 84) "{" - R_CURLY@[84; 85) "}" - WHITESPACE@[85; 86) "\n" - R_CURLY@[86; 87) "}" - WHITESPACE@[87; 88) "\n" +SOURCE_FILE@0..88 + FN_DEF@0..87 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + BLOCK_EXPR@8..87 + BLOCK@8..87 + L_CURLY@8..9 "{" + WHITESPACE@9..14 "\n " + EXPR_STMT@14..25 + IF_EXPR@14..25 + IF_KW@14..16 "if" + WHITESPACE@16..17 " " + CONDITION@17..22 + BREAK_EXPR@17..22 + BREAK_KW@17..22 "break" + WHITESPACE@22..23 " " + BLOCK_EXPR@23..25 + BLOCK@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + WHITESPACE@25..30 "\n " + EXPR_STMT@30..44 + WHILE_EXPR@30..44 + WHILE_KW@30..35 "while" + WHITESPACE@35..36 " " + CONDITION@36..41 + BREAK_EXPR@36..41 + BREAK_KW@36..41 "break" + WHITESPACE@41..42 " " + BLOCK_EXPR@42..44 + BLOCK@42..44 + L_CURLY@42..43 "{" + R_CURLY@43..44 "}" + WHITESPACE@44..49 "\n " + EXPR_STMT@49..66 + FOR_EXPR@49..66 + FOR_KW@49..52 "for" + WHITESPACE@52..53 " " + BIND_PAT@53..54 + NAME@53..54 + IDENT@53..54 "i" + WHITESPACE@54..55 " " + IN_KW@55..57 "in" + WHITESPACE@57..58 " " + BREAK_EXPR@58..63 + BREAK_KW@58..63 "break" + WHITESPACE@63..64 " " + BLOCK_EXPR@64..66 + BLOCK@64..66 + L_CURLY@64..65 "{" + R_CURLY@65..66 "}" + WHITESPACE@66..71 "\n " + MATCH_EXPR@71..85 + MATCH_KW@71..76 "match" + WHITESPACE@76..77 " " + BREAK_EXPR@77..82 + BREAK_KW@77..82 "break" + WHITESPACE@82..83 " " + MATCH_ARM_LIST@83..85 + L_CURLY@83..84 "{" + R_CURLY@84..85 "}" + WHITESPACE@85..86 "\n" + R_CURLY@86..87 "}" + WHITESPACE@87..88 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast index b494f6c59b..1c1e349e14 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0089_extern_fn.rast @@ -1,18 +1,18 @@ -SOURCE_FILE@[0; 19) - FN_DEF@[0; 18) - ABI@[0; 6) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - FN_KW@[7; 9) "fn" - WHITESPACE@[9; 10) " " - NAME@[10; 13) - IDENT@[10; 13) "foo" - PARAM_LIST@[13; 15) - L_PAREN@[13; 14) "(" - R_PAREN@[14; 15) ")" - WHITESPACE@[15; 16) " " - BLOCK_EXPR@[16; 18) - BLOCK@[16; 18) - L_CURLY@[16; 17) "{" - R_CURLY@[17; 18) "}" - WHITESPACE@[18; 19) "\n" +SOURCE_FILE@0..19 + FN_DEF@0..18 + ABI@0..6 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + FN_KW@7..9 "fn" + WHITESPACE@9..10 " " + NAME@10..13 + IDENT@10..13 "foo" + PARAM_LIST@13..15 + L_PAREN@13..14 "(" + R_PAREN@14..15 ")" + WHITESPACE@15..16 " " + BLOCK_EXPR@16..18 + BLOCK@16..18 + L_CURLY@16..17 "{" + R_CURLY@17..18 "}" + WHITESPACE@18..19 "\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 1d77964496..cee2bc906a 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 @@ -1,22 +1,22 @@ -SOURCE_FILE@[0; 19) - STRUCT_DEF@[0; 18) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - TYPE_PARAM_LIST@[8; 17) - L_ANGLE@[8; 9) "<" - TYPE_PARAM@[9; 16) - NAME@[9; 10) - IDENT@[9; 10) "T" - WHITESPACE@[10; 11) " " - EQ@[11; 12) "=" - WHITESPACE@[12; 13) " " - PATH_TYPE@[13; 16) - PATH@[13; 16) - PATH_SEGMENT@[13; 16) - NAME_REF@[13; 16) - IDENT@[13; 16) "i32" - R_ANGLE@[16; 17) ">" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" +SOURCE_FILE@0..19 + STRUCT_DEF@0..18 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + TYPE_PARAM_LIST@8..17 + L_ANGLE@8..9 "<" + TYPE_PARAM@9..16 + NAME@9..10 + IDENT@9..10 "T" + WHITESPACE@10..11 " " + EQ@11..12 "=" + WHITESPACE@12..13 " " + PATH_TYPE@13..16 + PATH@13..16 + PATH_SEGMENT@13..16 + NAME_REF@13..16 + IDENT@13..16 "i32" + R_ANGLE@16..17 ">" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast index 7093c2b1f8..800412cef7 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0091_auto_trait.rast @@ -1,13 +1,13 @@ -SOURCE_FILE@[0; 16) - TRAIT_DEF@[0; 15) - AUTO_KW@[0; 4) "auto" - WHITESPACE@[4; 5) " " - TRAIT_KW@[5; 10) "trait" - WHITESPACE@[10; 11) " " - NAME@[11; 12) - IDENT@[11; 12) "T" - WHITESPACE@[12; 13) " " - ITEM_LIST@[13; 15) - L_CURLY@[13; 14) "{" - R_CURLY@[14; 15) "}" - WHITESPACE@[15; 16) "\n" +SOURCE_FILE@0..16 + TRAIT_DEF@0..15 + AUTO_KW@0..4 "auto" + WHITESPACE@4..5 " " + TRAIT_KW@5..10 "trait" + WHITESPACE@10..11 " " + NAME@11..12 + IDENT@11..12 "T" + WHITESPACE@12..13 " " + ITEM_LIST@13..15 + L_CURLY@13..14 "{" + R_CURLY@14..15 "}" + WHITESPACE@15..16 "\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 db6013c6f2..1e2d7db7c0 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 @@ -1,23 +1,23 @@ -SOURCE_FILE@[0; 21) - TYPE_ALIAS_DEF@[0; 20) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "F" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - FN_POINTER_TYPE@[9; 19) - FN_KW@[9; 11) "fn" - PARAM_LIST@[11; 13) - L_PAREN@[11; 12) "(" - R_PAREN@[12; 13) ")" - WHITESPACE@[13; 14) " " - RET_TYPE@[14; 19) - THIN_ARROW@[14; 16) "->" - WHITESPACE@[16; 17) " " - TUPLE_TYPE@[17; 19) - L_PAREN@[17; 18) "(" - R_PAREN@[18; 19) ")" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 21) "\n" +SOURCE_FILE@0..21 + TYPE_ALIAS_DEF@0..20 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "F" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + FN_POINTER_TYPE@9..19 + FN_KW@9..11 "fn" + PARAM_LIST@11..13 + L_PAREN@11..12 "(" + R_PAREN@12..13 ")" + WHITESPACE@13..14 " " + RET_TYPE@14..19 + THIN_ARROW@14..16 "->" + WHITESPACE@16..17 " " + TUPLE_TYPE@17..19 + L_PAREN@17..18 "(" + R_PAREN@18..19 ")" + SEMICOLON@19..20 ";" + 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 118cfc096a..c264dae5e4 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 @@ -1,34 +1,34 @@ -SOURCE_FILE@[0; 26) - FN_DEF@[0; 25) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 25) - BLOCK@[9; 25) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 23) - INDEX_EXPR@[15; 22) - INDEX_EXPR@[15; 19) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "x" - L_BRACK@[16; 17) "[" - LITERAL@[17; 18) - INT_NUMBER@[17; 18) "1" - R_BRACK@[18; 19) "]" - L_BRACK@[19; 20) "[" - LITERAL@[20; 21) - INT_NUMBER@[20; 21) "2" - R_BRACK@[21; 22) "]" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 24) "\n" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" +SOURCE_FILE@0..26 + FN_DEF@0..25 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..25 + BLOCK@9..25 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..23 + INDEX_EXPR@15..22 + INDEX_EXPR@15..19 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "x" + L_BRACK@16..17 "[" + LITERAL@17..18 + INT_NUMBER@17..18 "1" + R_BRACK@18..19 "]" + L_BRACK@19..20 "[" + LITERAL@20..21 + INT_NUMBER@20..21 "2" + R_BRACK@21..22 "]" + SEMICOLON@22..23 ";" + WHITESPACE@23..24 "\n" + R_CURLY@24..25 "}" + WHITESPACE@25..26 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast index 3da3beaf4a..9370f6ae77 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0094_unsafe_auto_trait.rast @@ -1,15 +1,15 @@ -SOURCE_FILE@[0; 23) - TRAIT_DEF@[0; 22) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - AUTO_KW@[7; 11) "auto" - WHITESPACE@[11; 12) " " - TRAIT_KW@[12; 17) "trait" - WHITESPACE@[17; 18) " " - NAME@[18; 19) - IDENT@[18; 19) "T" - WHITESPACE@[19; 20) " " - ITEM_LIST@[20; 22) - L_CURLY@[20; 21) "{" - R_CURLY@[21; 22) "}" - WHITESPACE@[22; 23) "\n" +SOURCE_FILE@0..23 + TRAIT_DEF@0..22 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + AUTO_KW@7..11 "auto" + WHITESPACE@11..12 " " + TRAIT_KW@12..17 "trait" + WHITESPACE@17..18 " " + NAME@18..19 + IDENT@18..19 "T" + WHITESPACE@19..20 " " + ITEM_LIST@20..22 + L_CURLY@20..21 "{" + R_CURLY@21..22 "}" + WHITESPACE@22..23 "\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 ebe7816a4f..24e1ba8a02 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 @@ -1,29 +1,29 @@ -SOURCE_FILE@[0; 26) - FN_DEF@[0; 25) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 25) - BLOCK@[10; 25) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 12) " " - LET_STMT@[12; 23) - LET_KW@[12; 15) "let" - WHITESPACE@[15; 16) " " - PLACEHOLDER_PAT@[16; 17) - UNDERSCORE@[16; 17) "_" - WHITESPACE@[17; 18) " " - EQ@[18; 19) "=" - WHITESPACE@[19; 20) " " - TUPLE_EXPR@[20; 22) - L_PAREN@[20; 21) "(" - R_PAREN@[21; 22) ")" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 24) " " - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" +SOURCE_FILE@0..26 + FN_DEF@0..25 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..25 + BLOCK@10..25 + L_CURLY@10..11 "{" + WHITESPACE@11..12 " " + LET_STMT@12..23 + LET_KW@12..15 "let" + WHITESPACE@15..16 " " + PLACEHOLDER_PAT@16..17 + UNDERSCORE@16..17 "_" + WHITESPACE@17..18 " " + EQ@18..19 "=" + WHITESPACE@19..20 " " + TUPLE_EXPR@20..22 + L_PAREN@20..21 "(" + R_PAREN@21..22 ")" + SEMICOLON@22..23 ";" + WHITESPACE@23..24 " " + R_CURLY@24..25 "}" + 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 6bd6f5a6b2..47462d44e6 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 @@ -1,130 +1,130 @@ -SOURCE_FILE@[0; 167) - FN_DEF@[0; 166) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 166) - BLOCK@[9; 166) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 25) - IF_EXPR@[15; 25) - IF_KW@[15; 17) "if" - WHITESPACE@[17; 18) " " - CONDITION@[18; 22) - LITERAL@[18; 22) - TRUE_KW@[18; 22) "true" - WHITESPACE@[22; 23) " " - BLOCK_EXPR@[23; 25) - BLOCK@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 30) "\n " - EXPR_STMT@[30; 37) - LOOP_EXPR@[30; 37) - LOOP_KW@[30; 34) "loop" - WHITESPACE@[34; 35) " " - BLOCK_EXPR@[35; 37) - BLOCK@[35; 37) - L_CURLY@[35; 36) "{" - R_CURLY@[36; 37) "}" - WHITESPACE@[37; 42) "\n " - EXPR_STMT@[42; 53) - MATCH_EXPR@[42; 53) - MATCH_KW@[42; 47) "match" - WHITESPACE@[47; 48) " " - TUPLE_EXPR@[48; 50) - L_PAREN@[48; 49) "(" - R_PAREN@[49; 50) ")" - WHITESPACE@[50; 51) " " - MATCH_ARM_LIST@[51; 53) - L_CURLY@[51; 52) "{" - R_CURLY@[52; 53) "}" - WHITESPACE@[53; 58) "\n " - EXPR_STMT@[58; 71) - WHILE_EXPR@[58; 71) - WHILE_KW@[58; 63) "while" - WHITESPACE@[63; 64) " " - CONDITION@[64; 68) - LITERAL@[64; 68) - TRUE_KW@[64; 68) "true" - WHITESPACE@[68; 69) " " - BLOCK_EXPR@[69; 71) - BLOCK@[69; 71) - L_CURLY@[69; 70) "{" - R_CURLY@[70; 71) "}" - WHITESPACE@[71; 76) "\n " - EXPR_STMT@[76; 90) - FOR_EXPR@[76; 90) - FOR_KW@[76; 79) "for" - WHITESPACE@[79; 80) " " - PLACEHOLDER_PAT@[80; 81) - UNDERSCORE@[80; 81) "_" - WHITESPACE@[81; 82) " " - IN_KW@[82; 84) "in" - WHITESPACE@[84; 85) " " - TUPLE_EXPR@[85; 87) - L_PAREN@[85; 86) "(" - R_PAREN@[86; 87) ")" - WHITESPACE@[87; 88) " " - BLOCK_EXPR@[88; 90) - BLOCK@[88; 90) - L_CURLY@[88; 89) "{" - R_CURLY@[89; 90) "}" - WHITESPACE@[90; 95) "\n " - EXPR_STMT@[95; 97) - BLOCK_EXPR@[95; 97) - BLOCK@[95; 97) - L_CURLY@[95; 96) "{" - R_CURLY@[96; 97) "}" - WHITESPACE@[97; 102) "\n " - EXPR_STMT@[102; 104) - BLOCK_EXPR@[102; 104) - BLOCK@[102; 104) - L_CURLY@[102; 103) "{" - R_CURLY@[103; 104) "}" - WHITESPACE@[104; 109) "\n " - EXPR_STMT@[109; 152) - MACRO_CALL@[109; 152) - PATH@[109; 120) - PATH_SEGMENT@[109; 120) - NAME_REF@[109; 120) - IDENT@[109; 120) "macro_rules" - BANG@[120; 121) "!" - WHITESPACE@[121; 122) " " - NAME@[122; 126) - IDENT@[122; 126) "test" - WHITESPACE@[126; 127) " " - TOKEN_TREE@[127; 152) - L_CURLY@[127; 128) "{" - WHITESPACE@[128; 138) "\n " - TOKEN_TREE@[138; 140) - L_PAREN@[138; 139) "(" - R_PAREN@[139; 140) ")" - WHITESPACE@[140; 141) " " - EQ@[141; 142) "=" - R_ANGLE@[142; 143) ">" - WHITESPACE@[143; 144) " " - TOKEN_TREE@[144; 146) - L_CURLY@[144; 145) "{" - R_CURLY@[145; 146) "}" - WHITESPACE@[146; 151) "\n " - R_CURLY@[151; 152) "}" - WHITESPACE@[152; 157) "\n " - MACRO_CALL@[157; 164) - PATH@[157; 161) - PATH_SEGMENT@[157; 161) - NAME_REF@[157; 161) - IDENT@[157; 161) "test" - BANG@[161; 162) "!" - TOKEN_TREE@[162; 164) - L_CURLY@[162; 163) "{" - R_CURLY@[163; 164) "}" - WHITESPACE@[164; 165) "\n" - R_CURLY@[165; 166) "}" - WHITESPACE@[166; 167) "\n" +SOURCE_FILE@0..167 + FN_DEF@0..166 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..166 + BLOCK@9..166 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..25 + IF_EXPR@15..25 + IF_KW@15..17 "if" + WHITESPACE@17..18 " " + CONDITION@18..22 + LITERAL@18..22 + TRUE_KW@18..22 "true" + WHITESPACE@22..23 " " + BLOCK_EXPR@23..25 + BLOCK@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + WHITESPACE@25..30 "\n " + EXPR_STMT@30..37 + LOOP_EXPR@30..37 + LOOP_KW@30..34 "loop" + WHITESPACE@34..35 " " + BLOCK_EXPR@35..37 + BLOCK@35..37 + L_CURLY@35..36 "{" + R_CURLY@36..37 "}" + WHITESPACE@37..42 "\n " + EXPR_STMT@42..53 + MATCH_EXPR@42..53 + MATCH_KW@42..47 "match" + WHITESPACE@47..48 " " + TUPLE_EXPR@48..50 + L_PAREN@48..49 "(" + R_PAREN@49..50 ")" + WHITESPACE@50..51 " " + MATCH_ARM_LIST@51..53 + L_CURLY@51..52 "{" + R_CURLY@52..53 "}" + WHITESPACE@53..58 "\n " + EXPR_STMT@58..71 + WHILE_EXPR@58..71 + WHILE_KW@58..63 "while" + WHITESPACE@63..64 " " + CONDITION@64..68 + LITERAL@64..68 + TRUE_KW@64..68 "true" + WHITESPACE@68..69 " " + BLOCK_EXPR@69..71 + BLOCK@69..71 + L_CURLY@69..70 "{" + R_CURLY@70..71 "}" + WHITESPACE@71..76 "\n " + EXPR_STMT@76..90 + FOR_EXPR@76..90 + FOR_KW@76..79 "for" + WHITESPACE@79..80 " " + PLACEHOLDER_PAT@80..81 + UNDERSCORE@80..81 "_" + WHITESPACE@81..82 " " + IN_KW@82..84 "in" + WHITESPACE@84..85 " " + TUPLE_EXPR@85..87 + L_PAREN@85..86 "(" + R_PAREN@86..87 ")" + WHITESPACE@87..88 " " + BLOCK_EXPR@88..90 + BLOCK@88..90 + L_CURLY@88..89 "{" + R_CURLY@89..90 "}" + WHITESPACE@90..95 "\n " + EXPR_STMT@95..97 + BLOCK_EXPR@95..97 + BLOCK@95..97 + L_CURLY@95..96 "{" + R_CURLY@96..97 "}" + WHITESPACE@97..102 "\n " + EXPR_STMT@102..104 + BLOCK_EXPR@102..104 + BLOCK@102..104 + L_CURLY@102..103 "{" + R_CURLY@103..104 "}" + WHITESPACE@104..109 "\n " + EXPR_STMT@109..152 + MACRO_CALL@109..152 + PATH@109..120 + PATH_SEGMENT@109..120 + NAME_REF@109..120 + IDENT@109..120 "macro_rules" + BANG@120..121 "!" + WHITESPACE@121..122 " " + NAME@122..126 + IDENT@122..126 "test" + WHITESPACE@126..127 " " + TOKEN_TREE@127..152 + L_CURLY@127..128 "{" + WHITESPACE@128..138 "\n " + TOKEN_TREE@138..140 + L_PAREN@138..139 "(" + R_PAREN@139..140 ")" + WHITESPACE@140..141 " " + EQ@141..142 "=" + R_ANGLE@142..143 ">" + WHITESPACE@143..144 " " + TOKEN_TREE@144..146 + L_CURLY@144..145 "{" + R_CURLY@145..146 "}" + WHITESPACE@146..151 "\n " + R_CURLY@151..152 "}" + WHITESPACE@152..157 "\n " + MACRO_CALL@157..164 + PATH@157..161 + PATH_SEGMENT@157..161 + NAME_REF@157..161 + IDENT@157..161 "test" + BANG@161..162 "!" + TOKEN_TREE@162..164 + L_CURLY@162..163 "{" + R_CURLY@163..164 "}" + WHITESPACE@164..165 "\n" + R_CURLY@165..166 "}" + WHITESPACE@166..167 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast index af90772701..80bda4ba7e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0097_default_impl.rast @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 20) - IMPL_DEF@[0; 19) - DEFAULT_KW@[0; 7) "default" - WHITESPACE@[7; 8) " " - IMPL_KW@[8; 12) "impl" - WHITESPACE@[12; 13) " " - PATH_TYPE@[13; 16) - PATH@[13; 16) - PATH_SEGMENT@[13; 16) - NAME_REF@[13; 16) - IDENT@[13; 16) "Foo" - WHITESPACE@[16; 17) " " - ITEM_LIST@[17; 19) - L_CURLY@[17; 18) "{" - R_CURLY@[18; 19) "}" - WHITESPACE@[19; 20) "\n" +SOURCE_FILE@0..20 + IMPL_DEF@0..19 + DEFAULT_KW@0..7 "default" + WHITESPACE@7..8 " " + IMPL_KW@8..12 "impl" + WHITESPACE@12..13 " " + PATH_TYPE@13..16 + PATH@13..16 + PATH_SEGMENT@13..16 + NAME_REF@13..16 + IDENT@13..16 "Foo" + WHITESPACE@16..17 " " + ITEM_LIST@17..19 + L_CURLY@17..18 "{" + R_CURLY@18..19 "}" + WHITESPACE@19..20 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast index 072dc9d168..a51fb55119 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0098_const_unsafe_fn.rast @@ -1,19 +1,19 @@ -SOURCE_FILE@[0; 25) - FN_DEF@[0; 24) - CONST_KW@[0; 5) "const" - WHITESPACE@[5; 6) " " - UNSAFE_KW@[6; 12) "unsafe" - WHITESPACE@[12; 13) " " - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 19) - IDENT@[16; 19) "foo" - PARAM_LIST@[19; 21) - L_PAREN@[19; 20) "(" - R_PAREN@[20; 21) ")" - WHITESPACE@[21; 22) " " - BLOCK_EXPR@[22; 24) - BLOCK@[22; 24) - L_CURLY@[22; 23) "{" - R_CURLY@[23; 24) "}" - WHITESPACE@[24; 25) "\n" +SOURCE_FILE@0..25 + FN_DEF@0..24 + CONST_KW@0..5 "const" + WHITESPACE@5..6 " " + UNSAFE_KW@6..12 "unsafe" + WHITESPACE@12..13 " " + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..19 + IDENT@16..19 "foo" + PARAM_LIST@19..21 + L_PAREN@19..20 "(" + R_PAREN@20..21 ")" + WHITESPACE@21..22 " " + BLOCK_EXPR@22..24 + BLOCK@22..24 + L_CURLY@22..23 "{" + R_CURLY@23..24 "}" + WHITESPACE@24..25 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast index ed57a9eea9..61b47bf35f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0099_param_list.rast @@ -1,103 +1,103 @@ -SOURCE_FILE@[0; 67) - FN_DEF@[0; 9) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "a" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - BLOCK_EXPR@[7; 9) - BLOCK@[7; 9) - L_CURLY@[7; 8) "{" - R_CURLY@[8; 9) "}" - WHITESPACE@[9; 10) "\n" - FN_DEF@[10; 25) - FN_KW@[10; 12) "fn" - WHITESPACE@[12; 13) " " - NAME@[13; 14) - IDENT@[13; 14) "b" - PARAM_LIST@[14; 22) - L_PAREN@[14; 15) "(" - PARAM@[15; 21) - BIND_PAT@[15; 16) - NAME@[15; 16) - IDENT@[15; 16) "x" - COLON@[16; 17) ":" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 21) - PATH@[18; 21) - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "i32" - R_PAREN@[21; 22) ")" - WHITESPACE@[22; 23) " " - BLOCK_EXPR@[23; 25) - BLOCK@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" - FN_DEF@[26; 43) - FN_KW@[26; 28) "fn" - WHITESPACE@[28; 29) " " - NAME@[29; 30) - IDENT@[29; 30) "c" - PARAM_LIST@[30; 40) - L_PAREN@[30; 31) "(" - PARAM@[31; 37) - BIND_PAT@[31; 32) - NAME@[31; 32) - IDENT@[31; 32) "x" - COLON@[32; 33) ":" - WHITESPACE@[33; 34) " " - PATH_TYPE@[34; 37) - PATH@[34; 37) - PATH_SEGMENT@[34; 37) - NAME_REF@[34; 37) - IDENT@[34; 37) "i32" - COMMA@[37; 38) "," - WHITESPACE@[38; 39) " " - R_PAREN@[39; 40) ")" - WHITESPACE@[40; 41) " " - BLOCK_EXPR@[41; 43) - BLOCK@[41; 43) - L_CURLY@[41; 42) "{" - R_CURLY@[42; 43) "}" - WHITESPACE@[43; 44) "\n" - FN_DEF@[44; 66) - FN_KW@[44; 46) "fn" - WHITESPACE@[46; 47) " " - NAME@[47; 48) - IDENT@[47; 48) "d" - PARAM_LIST@[48; 63) - L_PAREN@[48; 49) "(" - PARAM@[49; 55) - BIND_PAT@[49; 50) - NAME@[49; 50) - IDENT@[49; 50) "x" - COLON@[50; 51) ":" - WHITESPACE@[51; 52) " " - PATH_TYPE@[52; 55) - PATH@[52; 55) - PATH_SEGMENT@[52; 55) - NAME_REF@[52; 55) - IDENT@[52; 55) "i32" - COMMA@[55; 56) "," - WHITESPACE@[56; 57) " " - PARAM@[57; 62) - BIND_PAT@[57; 58) - NAME@[57; 58) - IDENT@[57; 58) "y" - COLON@[58; 59) ":" - WHITESPACE@[59; 60) " " - TUPLE_TYPE@[60; 62) - L_PAREN@[60; 61) "(" - R_PAREN@[61; 62) ")" - R_PAREN@[62; 63) ")" - WHITESPACE@[63; 64) " " - BLOCK_EXPR@[64; 66) - BLOCK@[64; 66) - L_CURLY@[64; 65) "{" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 67) "\n" +SOURCE_FILE@0..67 + FN_DEF@0..9 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "a" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + BLOCK_EXPR@7..9 + BLOCK@7..9 + L_CURLY@7..8 "{" + R_CURLY@8..9 "}" + WHITESPACE@9..10 "\n" + FN_DEF@10..25 + FN_KW@10..12 "fn" + WHITESPACE@12..13 " " + NAME@13..14 + IDENT@13..14 "b" + PARAM_LIST@14..22 + L_PAREN@14..15 "(" + PARAM@15..21 + BIND_PAT@15..16 + NAME@15..16 + IDENT@15..16 "x" + COLON@16..17 ":" + WHITESPACE@17..18 " " + PATH_TYPE@18..21 + PATH@18..21 + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "i32" + R_PAREN@21..22 ")" + WHITESPACE@22..23 " " + BLOCK_EXPR@23..25 + BLOCK@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + WHITESPACE@25..26 "\n" + FN_DEF@26..43 + FN_KW@26..28 "fn" + WHITESPACE@28..29 " " + NAME@29..30 + IDENT@29..30 "c" + PARAM_LIST@30..40 + L_PAREN@30..31 "(" + PARAM@31..37 + BIND_PAT@31..32 + NAME@31..32 + IDENT@31..32 "x" + COLON@32..33 ":" + WHITESPACE@33..34 " " + PATH_TYPE@34..37 + PATH@34..37 + PATH_SEGMENT@34..37 + NAME_REF@34..37 + IDENT@34..37 "i32" + COMMA@37..38 "," + WHITESPACE@38..39 " " + R_PAREN@39..40 ")" + WHITESPACE@40..41 " " + BLOCK_EXPR@41..43 + BLOCK@41..43 + L_CURLY@41..42 "{" + R_CURLY@42..43 "}" + WHITESPACE@43..44 "\n" + FN_DEF@44..66 + FN_KW@44..46 "fn" + WHITESPACE@46..47 " " + NAME@47..48 + IDENT@47..48 "d" + PARAM_LIST@48..63 + L_PAREN@48..49 "(" + PARAM@49..55 + BIND_PAT@49..50 + NAME@49..50 + IDENT@49..50 "x" + COLON@50..51 ":" + WHITESPACE@51..52 " " + PATH_TYPE@52..55 + PATH@52..55 + PATH_SEGMENT@52..55 + NAME_REF@52..55 + IDENT@52..55 "i32" + COMMA@55..56 "," + WHITESPACE@56..57 " " + PARAM@57..62 + BIND_PAT@57..58 + NAME@57..58 + IDENT@57..58 "y" + COLON@58..59 ":" + WHITESPACE@59..60 " " + TUPLE_TYPE@60..62 + L_PAREN@60..61 "(" + R_PAREN@61..62 ")" + R_PAREN@62..63 ")" + WHITESPACE@63..64 " " + BLOCK_EXPR@64..66 + BLOCK@64..66 + L_CURLY@64..65 "{" + R_CURLY@65..66 "}" + WHITESPACE@66..67 "\n" 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 d25f087a52..89d435d1f2 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 @@ -1,36 +1,36 @@ -SOURCE_FILE@[0; 33) - FN_DEF@[0; 32) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 32) - BLOCK@[9; 32) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 30) - FOR_EXPR@[15; 29) - FOR_KW@[15; 18) "for" - WHITESPACE@[18; 19) " " - BIND_PAT@[19; 20) - NAME@[19; 20) - IDENT@[19; 20) "x" - WHITESPACE@[20; 21) " " - IN_KW@[21; 23) "in" - WHITESPACE@[23; 24) " " - ARRAY_EXPR@[24; 26) - L_BRACK@[24; 25) "[" - R_BRACK@[25; 26) "]" - WHITESPACE@[26; 27) " " - BLOCK_EXPR@[27; 29) - BLOCK@[27; 29) - L_CURLY@[27; 28) "{" - R_CURLY@[28; 29) "}" - SEMICOLON@[29; 30) ";" - WHITESPACE@[30; 31) "\n" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" +SOURCE_FILE@0..33 + FN_DEF@0..32 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..32 + BLOCK@9..32 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..30 + FOR_EXPR@15..29 + FOR_KW@15..18 "for" + WHITESPACE@18..19 " " + BIND_PAT@19..20 + NAME@19..20 + IDENT@19..20 "x" + WHITESPACE@20..21 " " + IN_KW@21..23 "in" + WHITESPACE@23..24 " " + ARRAY_EXPR@24..26 + L_BRACK@24..25 "[" + R_BRACK@25..26 "]" + WHITESPACE@26..27 " " + BLOCK_EXPR@27..29 + BLOCK@27..29 + L_CURLY@27..28 "{" + R_CURLY@28..29 "}" + SEMICOLON@29..30 ";" + WHITESPACE@30..31 "\n" + R_CURLY@31..32 "}" + WHITESPACE@32..33 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast index b7979fbf5c..57b4d0c4f5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0101_unsafe_fn.rast @@ -1,17 +1,17 @@ -SOURCE_FILE@[0; 19) - FN_DEF@[0; 18) - UNSAFE_KW@[0; 6) "unsafe" - WHITESPACE@[6; 7) " " - FN_KW@[7; 9) "fn" - WHITESPACE@[9; 10) " " - NAME@[10; 13) - IDENT@[10; 13) "foo" - PARAM_LIST@[13; 15) - L_PAREN@[13; 14) "(" - R_PAREN@[14; 15) ")" - WHITESPACE@[15; 16) " " - BLOCK_EXPR@[16; 18) - BLOCK@[16; 18) - L_CURLY@[16; 17) "{" - R_CURLY@[17; 18) "}" - WHITESPACE@[18; 19) "\n" +SOURCE_FILE@0..19 + FN_DEF@0..18 + UNSAFE_KW@0..6 "unsafe" + WHITESPACE@6..7 " " + FN_KW@7..9 "fn" + WHITESPACE@9..10 " " + NAME@10..13 + IDENT@10..13 "foo" + PARAM_LIST@13..15 + L_PAREN@13..14 "(" + R_PAREN@14..15 ")" + WHITESPACE@15..16 " " + BLOCK_EXPR@16..18 + BLOCK@16..18 + L_CURLY@16..17 "{" + R_CURLY@17..18 "}" + WHITESPACE@18..19 "\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 fcd099de98..ed6f6f3263 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 @@ -1,133 +1,133 @@ -SOURCE_FILE@[0; 119) - FN_DEF@[0; 118) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 118) - BLOCK@[9; 118) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 29) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - RECORD_PAT@[19; 23) - PATH@[19; 20) - PATH_SEGMENT@[19; 20) - NAME_REF@[19; 20) - IDENT@[19; 20) "S" - WHITESPACE@[20; 21) " " - RECORD_FIELD_PAT_LIST@[21; 23) - L_CURLY@[21; 22) "{" - R_CURLY@[22; 23) "}" - WHITESPACE@[23; 24) " " - EQ@[24; 25) "=" - WHITESPACE@[25; 26) " " - TUPLE_EXPR@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - SEMICOLON@[28; 29) ";" - WHITESPACE@[29; 34) "\n " - LET_STMT@[34; 62) - LET_KW@[34; 37) "let" - WHITESPACE@[37; 38) " " - RECORD_PAT@[38; 56) - PATH@[38; 39) - PATH_SEGMENT@[38; 39) - NAME_REF@[38; 39) - IDENT@[38; 39) "S" - WHITESPACE@[39; 40) " " - RECORD_FIELD_PAT_LIST@[40; 56) - L_CURLY@[40; 41) "{" - WHITESPACE@[41; 42) " " - RECORD_FIELD_PAT@[42; 43) - BIND_PAT@[42; 43) - NAME@[42; 43) - IDENT@[42; 43) "f" - COMMA@[43; 44) "," - WHITESPACE@[44; 45) " " - RECORD_FIELD_PAT@[45; 54) - BIND_PAT@[45; 54) - REF_KW@[45; 48) "ref" - WHITESPACE@[48; 49) " " - MUT_KW@[49; 52) "mut" - WHITESPACE@[52; 53) " " - NAME@[53; 54) - IDENT@[53; 54) "g" - WHITESPACE@[54; 55) " " - R_CURLY@[55; 56) "}" - WHITESPACE@[56; 57) " " - EQ@[57; 58) "=" - WHITESPACE@[58; 59) " " - TUPLE_EXPR@[59; 61) - L_PAREN@[59; 60) "(" - R_PAREN@[60; 61) ")" - SEMICOLON@[61; 62) ";" - WHITESPACE@[62; 67) "\n " - LET_STMT@[67; 90) - LET_KW@[67; 70) "let" - WHITESPACE@[70; 71) " " - RECORD_PAT@[71; 84) - PATH@[71; 72) - PATH_SEGMENT@[71; 72) - NAME_REF@[71; 72) - IDENT@[71; 72) "S" - WHITESPACE@[72; 73) " " - RECORD_FIELD_PAT_LIST@[73; 84) - L_CURLY@[73; 74) "{" - WHITESPACE@[74; 75) " " - RECORD_FIELD_PAT@[75; 79) - NAME_REF@[75; 76) - IDENT@[75; 76) "h" - COLON@[76; 77) ":" - WHITESPACE@[77; 78) " " - PLACEHOLDER_PAT@[78; 79) - UNDERSCORE@[78; 79) "_" - COMMA@[79; 80) "," - WHITESPACE@[80; 81) " " - DOT2@[81; 83) ".." - R_CURLY@[83; 84) "}" - WHITESPACE@[84; 85) " " - EQ@[85; 86) "=" - WHITESPACE@[86; 87) " " - TUPLE_EXPR@[87; 89) - L_PAREN@[87; 88) "(" - R_PAREN@[88; 89) ")" - SEMICOLON@[89; 90) ";" - WHITESPACE@[90; 95) "\n " - LET_STMT@[95; 116) - LET_KW@[95; 98) "let" - WHITESPACE@[98; 99) " " - RECORD_PAT@[99; 110) - PATH@[99; 100) - PATH_SEGMENT@[99; 100) - NAME_REF@[99; 100) - IDENT@[99; 100) "S" - WHITESPACE@[100; 101) " " - RECORD_FIELD_PAT_LIST@[101; 110) - L_CURLY@[101; 102) "{" - WHITESPACE@[102; 103) " " - RECORD_FIELD_PAT@[103; 107) - NAME_REF@[103; 104) - IDENT@[103; 104) "h" - COLON@[104; 105) ":" - WHITESPACE@[105; 106) " " - PLACEHOLDER_PAT@[106; 107) - UNDERSCORE@[106; 107) "_" - COMMA@[107; 108) "," - WHITESPACE@[108; 109) " " - R_CURLY@[109; 110) "}" - WHITESPACE@[110; 111) " " - EQ@[111; 112) "=" - WHITESPACE@[112; 113) " " - TUPLE_EXPR@[113; 115) - L_PAREN@[113; 114) "(" - R_PAREN@[114; 115) ")" - SEMICOLON@[115; 116) ";" - WHITESPACE@[116; 117) "\n" - R_CURLY@[117; 118) "}" - WHITESPACE@[118; 119) "\n" +SOURCE_FILE@0..119 + FN_DEF@0..118 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..118 + BLOCK@9..118 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..29 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + RECORD_PAT@19..23 + PATH@19..20 + PATH_SEGMENT@19..20 + NAME_REF@19..20 + IDENT@19..20 "S" + WHITESPACE@20..21 " " + RECORD_FIELD_PAT_LIST@21..23 + L_CURLY@21..22 "{" + R_CURLY@22..23 "}" + WHITESPACE@23..24 " " + EQ@24..25 "=" + WHITESPACE@25..26 " " + TUPLE_EXPR@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + SEMICOLON@28..29 ";" + WHITESPACE@29..34 "\n " + LET_STMT@34..62 + LET_KW@34..37 "let" + WHITESPACE@37..38 " " + RECORD_PAT@38..56 + PATH@38..39 + PATH_SEGMENT@38..39 + NAME_REF@38..39 + IDENT@38..39 "S" + WHITESPACE@39..40 " " + RECORD_FIELD_PAT_LIST@40..56 + L_CURLY@40..41 "{" + WHITESPACE@41..42 " " + RECORD_FIELD_PAT@42..43 + BIND_PAT@42..43 + NAME@42..43 + IDENT@42..43 "f" + COMMA@43..44 "," + WHITESPACE@44..45 " " + RECORD_FIELD_PAT@45..54 + BIND_PAT@45..54 + REF_KW@45..48 "ref" + WHITESPACE@48..49 " " + MUT_KW@49..52 "mut" + WHITESPACE@52..53 " " + NAME@53..54 + IDENT@53..54 "g" + WHITESPACE@54..55 " " + R_CURLY@55..56 "}" + WHITESPACE@56..57 " " + EQ@57..58 "=" + WHITESPACE@58..59 " " + TUPLE_EXPR@59..61 + L_PAREN@59..60 "(" + R_PAREN@60..61 ")" + SEMICOLON@61..62 ";" + WHITESPACE@62..67 "\n " + LET_STMT@67..90 + LET_KW@67..70 "let" + WHITESPACE@70..71 " " + RECORD_PAT@71..84 + PATH@71..72 + PATH_SEGMENT@71..72 + NAME_REF@71..72 + IDENT@71..72 "S" + WHITESPACE@72..73 " " + RECORD_FIELD_PAT_LIST@73..84 + L_CURLY@73..74 "{" + WHITESPACE@74..75 " " + RECORD_FIELD_PAT@75..79 + NAME_REF@75..76 + IDENT@75..76 "h" + COLON@76..77 ":" + WHITESPACE@77..78 " " + PLACEHOLDER_PAT@78..79 + UNDERSCORE@78..79 "_" + COMMA@79..80 "," + WHITESPACE@80..81 " " + DOT2@81..83 ".." + R_CURLY@83..84 "}" + WHITESPACE@84..85 " " + EQ@85..86 "=" + WHITESPACE@86..87 " " + TUPLE_EXPR@87..89 + L_PAREN@87..88 "(" + R_PAREN@88..89 ")" + SEMICOLON@89..90 ";" + WHITESPACE@90..95 "\n " + LET_STMT@95..116 + LET_KW@95..98 "let" + WHITESPACE@98..99 " " + RECORD_PAT@99..110 + PATH@99..100 + PATH_SEGMENT@99..100 + NAME_REF@99..100 + IDENT@99..100 "S" + WHITESPACE@100..101 " " + RECORD_FIELD_PAT_LIST@101..110 + L_CURLY@101..102 "{" + WHITESPACE@102..103 " " + RECORD_FIELD_PAT@103..107 + NAME_REF@103..104 + IDENT@103..104 "h" + COLON@104..105 ":" + WHITESPACE@105..106 " " + PLACEHOLDER_PAT@106..107 + UNDERSCORE@106..107 "_" + COMMA@107..108 "," + WHITESPACE@108..109 " " + R_CURLY@109..110 "}" + WHITESPACE@110..111 " " + EQ@111..112 "=" + WHITESPACE@112..113 " " + TUPLE_EXPR@113..115 + L_PAREN@113..114 "(" + R_PAREN@114..115 ")" + SEMICOLON@115..116 ";" + WHITESPACE@116..117 "\n" + R_CURLY@117..118 "}" + 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 60fbf27713..461c61914c 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 @@ -1,55 +1,55 @@ -SOURCE_FILE@[0; 55) - FN_DEF@[0; 54) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 54) - BLOCK@[9; 54) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 18) - ARRAY_EXPR@[15; 17) - L_BRACK@[15; 16) "[" - R_BRACK@[16; 17) "]" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 23) "\n " - EXPR_STMT@[23; 27) - ARRAY_EXPR@[23; 26) - L_BRACK@[23; 24) "[" - LITERAL@[24; 25) - INT_NUMBER@[24; 25) "1" - R_BRACK@[25; 26) "]" - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - EXPR_STMT@[32; 40) - ARRAY_EXPR@[32; 39) - L_BRACK@[32; 33) "[" - LITERAL@[33; 34) - INT_NUMBER@[33; 34) "1" - COMMA@[34; 35) "," - WHITESPACE@[35; 36) " " - LITERAL@[36; 37) - INT_NUMBER@[36; 37) "2" - COMMA@[37; 38) "," - R_BRACK@[38; 39) "]" - SEMICOLON@[39; 40) ";" - WHITESPACE@[40; 45) "\n " - EXPR_STMT@[45; 52) - ARRAY_EXPR@[45; 51) - L_BRACK@[45; 46) "[" - LITERAL@[46; 47) - INT_NUMBER@[46; 47) "1" - SEMICOLON@[47; 48) ";" - WHITESPACE@[48; 49) " " - LITERAL@[49; 50) - INT_NUMBER@[49; 50) "2" - R_BRACK@[50; 51) "]" - SEMICOLON@[51; 52) ";" - WHITESPACE@[52; 53) "\n" - R_CURLY@[53; 54) "}" - WHITESPACE@[54; 55) "\n" +SOURCE_FILE@0..55 + FN_DEF@0..54 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..54 + BLOCK@9..54 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..18 + ARRAY_EXPR@15..17 + L_BRACK@15..16 "[" + R_BRACK@16..17 "]" + SEMICOLON@17..18 ";" + WHITESPACE@18..23 "\n " + EXPR_STMT@23..27 + ARRAY_EXPR@23..26 + L_BRACK@23..24 "[" + LITERAL@24..25 + INT_NUMBER@24..25 "1" + R_BRACK@25..26 "]" + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + EXPR_STMT@32..40 + ARRAY_EXPR@32..39 + L_BRACK@32..33 "[" + LITERAL@33..34 + INT_NUMBER@33..34 "1" + COMMA@34..35 "," + WHITESPACE@35..36 " " + LITERAL@36..37 + INT_NUMBER@36..37 "2" + COMMA@37..38 "," + R_BRACK@38..39 "]" + SEMICOLON@39..40 ";" + WHITESPACE@40..45 "\n " + EXPR_STMT@45..52 + ARRAY_EXPR@45..51 + L_BRACK@45..46 "[" + LITERAL@46..47 + INT_NUMBER@46..47 "1" + SEMICOLON@47..48 ";" + WHITESPACE@48..49 " " + LITERAL@49..50 + INT_NUMBER@49..50 "2" + R_BRACK@50..51 "]" + SEMICOLON@51..52 ";" + WHITESPACE@52..53 "\n" + R_CURLY@53..54 "}" + 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 d65c75c65a..e3c4cfeb39 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 @@ -1,41 +1,41 @@ -SOURCE_FILE@[0; 29) - TYPE_ALIAS_DEF@[0; 28) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "F" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - PATH_TYPE@[9; 27) - PATH@[9; 27) - PATH_SEGMENT@[9; 27) - NAME_REF@[9; 12) - IDENT@[9; 12) "Box" - TYPE_ARG_LIST@[12; 27) - L_ANGLE@[12; 13) "<" - TYPE_ARG@[13; 26) - PATH_TYPE@[13; 26) - PATH@[13; 26) - PATH_SEGMENT@[13; 26) - NAME_REF@[13; 15) - IDENT@[13; 15) "Fn" - PARAM_LIST@[15; 20) - L_PAREN@[15; 16) "(" - PARAM@[16; 19) - PATH_TYPE@[16; 19) - PATH@[16; 19) - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "i32" - R_PAREN@[19; 20) ")" - WHITESPACE@[20; 21) " " - RET_TYPE@[21; 26) - THIN_ARROW@[21; 23) "->" - WHITESPACE@[23; 24) " " - TUPLE_TYPE@[24; 26) - L_PAREN@[24; 25) "(" - R_PAREN@[25; 26) ")" - R_ANGLE@[26; 27) ">" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 29) "\n" +SOURCE_FILE@0..29 + TYPE_ALIAS_DEF@0..28 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "F" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + PATH_TYPE@9..27 + PATH@9..27 + PATH_SEGMENT@9..27 + NAME_REF@9..12 + IDENT@9..12 "Box" + TYPE_ARG_LIST@12..27 + L_ANGLE@12..13 "<" + TYPE_ARG@13..26 + PATH_TYPE@13..26 + PATH@13..26 + PATH_SEGMENT@13..26 + NAME_REF@13..15 + IDENT@13..15 "Fn" + PARAM_LIST@15..20 + L_PAREN@15..16 "(" + PARAM@16..19 + PATH_TYPE@16..19 + PATH@16..19 + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "i32" + R_PAREN@19..20 ")" + WHITESPACE@20..21 " " + RET_TYPE@21..26 + THIN_ARROW@21..23 "->" + WHITESPACE@23..24 " " + TUPLE_TYPE@24..26 + L_PAREN@24..25 "(" + R_PAREN@25..26 ")" + R_ANGLE@26..27 ">" + SEMICOLON@27..28 ";" + 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 5635cba9bc..8b2323cf27 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 @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 52) - FN_DEF@[0; 51) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 51) - BLOCK@[9; 51) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 18) - BLOCK_EXPR@[15; 17) - BLOCK@[15; 17) - L_CURLY@[15; 16) "{" - R_CURLY@[16; 17) "}" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 23) "\n " - EXPR_STMT@[23; 33) - BLOCK_EXPR@[23; 32) - UNSAFE_KW@[23; 29) "unsafe" - WHITESPACE@[29; 30) " " - BLOCK@[30; 32) - L_CURLY@[30; 31) "{" - R_CURLY@[31; 32) "}" - SEMICOLON@[32; 33) ";" - WHITESPACE@[33; 38) "\n " - EXPR_STMT@[38; 49) - BLOCK_EXPR@[38; 48) - LABEL@[38; 45) - LIFETIME@[38; 44) "\'label" - COLON@[44; 45) ":" - WHITESPACE@[45; 46) " " - BLOCK@[46; 48) - L_CURLY@[46; 47) "{" - R_CURLY@[47; 48) "}" - SEMICOLON@[48; 49) ";" - WHITESPACE@[49; 50) "\n" - R_CURLY@[50; 51) "}" - WHITESPACE@[51; 52) "\n" +SOURCE_FILE@0..52 + FN_DEF@0..51 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..51 + BLOCK@9..51 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..18 + BLOCK_EXPR@15..17 + BLOCK@15..17 + L_CURLY@15..16 "{" + R_CURLY@16..17 "}" + SEMICOLON@17..18 ";" + WHITESPACE@18..23 "\n " + EXPR_STMT@23..33 + BLOCK_EXPR@23..32 + UNSAFE_KW@23..29 "unsafe" + WHITESPACE@29..30 " " + BLOCK@30..32 + L_CURLY@30..31 "{" + R_CURLY@31..32 "}" + SEMICOLON@32..33 ";" + WHITESPACE@33..38 "\n " + EXPR_STMT@38..49 + BLOCK_EXPR@38..48 + LABEL@38..45 + LIFETIME@38..44 "\'label" + COLON@44..45 ":" + WHITESPACE@45..46 " " + BLOCK@46..48 + L_CURLY@46..47 "{" + R_CURLY@47..48 "}" + SEMICOLON@48..49 ";" + WHITESPACE@49..50 "\n" + R_CURLY@50..51 "}" + 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 157dfcdb83..73c314e078 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 @@ -1,140 +1,140 @@ -SOURCE_FILE@[0; 134) - FN_DEF@[0; 133) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 133) - BLOCK@[9; 133) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 21) - LAMBDA_EXPR@[15; 20) - PARAM_LIST@[15; 17) - PIPE@[15; 16) "|" - PIPE@[16; 17) "|" - WHITESPACE@[17; 18) " " - TUPLE_EXPR@[18; 20) - L_PAREN@[18; 19) "(" - R_PAREN@[19; 20) ")" - SEMICOLON@[20; 21) ";" - WHITESPACE@[21; 26) "\n " - EXPR_STMT@[26; 43) - LAMBDA_EXPR@[26; 42) - PARAM_LIST@[26; 28) - PIPE@[26; 27) "|" - PIPE@[27; 28) "|" - WHITESPACE@[28; 29) " " - RET_TYPE@[29; 35) - THIN_ARROW@[29; 31) "->" - WHITESPACE@[31; 32) " " - PATH_TYPE@[32; 35) - PATH@[32; 35) - PATH_SEGMENT@[32; 35) - NAME_REF@[32; 35) - IDENT@[32; 35) "i32" - WHITESPACE@[35; 36) " " - BLOCK_EXPR@[36; 42) - BLOCK@[36; 42) - L_CURLY@[36; 37) "{" - WHITESPACE@[37; 38) " " - LITERAL@[38; 40) - INT_NUMBER@[38; 40) "92" - WHITESPACE@[40; 41) " " - R_CURLY@[41; 42) "}" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 48) "\n " - EXPR_STMT@[48; 54) - LAMBDA_EXPR@[48; 53) - PARAM_LIST@[48; 51) - PIPE@[48; 49) "|" - PARAM@[49; 50) - BIND_PAT@[49; 50) - NAME@[49; 50) - IDENT@[49; 50) "x" - PIPE@[50; 51) "|" - WHITESPACE@[51; 52) " " - PATH_EXPR@[52; 53) - PATH@[52; 53) - PATH_SEGMENT@[52; 53) - NAME_REF@[52; 53) - IDENT@[52; 53) "x" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 59) "\n " - EXPR_STMT@[59; 76) - LAMBDA_EXPR@[59; 75) - MOVE_KW@[59; 63) "move" - WHITESPACE@[63; 64) " " - PARAM_LIST@[64; 73) - PIPE@[64; 65) "|" - PARAM@[65; 71) - BIND_PAT@[65; 66) - NAME@[65; 66) - IDENT@[65; 66) "x" - COLON@[66; 67) ":" - WHITESPACE@[67; 68) " " - PATH_TYPE@[68; 71) - PATH@[68; 71) - PATH_SEGMENT@[68; 71) - NAME_REF@[68; 71) - IDENT@[68; 71) "i32" - COMMA@[71; 72) "," - PIPE@[72; 73) "|" - WHITESPACE@[73; 74) " " - PATH_EXPR@[74; 75) - PATH@[74; 75) - PATH_SEGMENT@[74; 75) - NAME_REF@[74; 75) - IDENT@[74; 75) "x" - SEMICOLON@[75; 76) ";" - WHITESPACE@[76; 81) "\n " - EXPR_STMT@[81; 93) - LAMBDA_EXPR@[81; 92) - ASYNC_KW@[81; 86) "async" - WHITESPACE@[86; 87) " " - PARAM_LIST@[87; 89) - PIPE@[87; 88) "|" - PIPE@[88; 89) "|" - WHITESPACE@[89; 90) " " - BLOCK_EXPR@[90; 92) - BLOCK@[90; 92) - L_CURLY@[90; 91) "{" - R_CURLY@[91; 92) "}" - SEMICOLON@[92; 93) ";" - WHITESPACE@[93; 98) "\n " - EXPR_STMT@[98; 109) - LAMBDA_EXPR@[98; 108) - MOVE_KW@[98; 102) "move" - WHITESPACE@[102; 103) " " - PARAM_LIST@[103; 105) - PIPE@[103; 104) "|" - PIPE@[104; 105) "|" - WHITESPACE@[105; 106) " " - BLOCK_EXPR@[106; 108) - BLOCK@[106; 108) - L_CURLY@[106; 107) "{" - R_CURLY@[107; 108) "}" - SEMICOLON@[108; 109) ";" - WHITESPACE@[109; 114) "\n " - EXPR_STMT@[114; 131) - LAMBDA_EXPR@[114; 130) - ASYNC_KW@[114; 119) "async" - WHITESPACE@[119; 120) " " - MOVE_KW@[120; 124) "move" - WHITESPACE@[124; 125) " " - PARAM_LIST@[125; 127) - PIPE@[125; 126) "|" - PIPE@[126; 127) "|" - WHITESPACE@[127; 128) " " - BLOCK_EXPR@[128; 130) - BLOCK@[128; 130) - L_CURLY@[128; 129) "{" - R_CURLY@[129; 130) "}" - SEMICOLON@[130; 131) ";" - WHITESPACE@[131; 132) "\n" - R_CURLY@[132; 133) "}" - WHITESPACE@[133; 134) "\n" +SOURCE_FILE@0..134 + FN_DEF@0..133 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..133 + BLOCK@9..133 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..21 + LAMBDA_EXPR@15..20 + PARAM_LIST@15..17 + PIPE@15..16 "|" + PIPE@16..17 "|" + WHITESPACE@17..18 " " + TUPLE_EXPR@18..20 + L_PAREN@18..19 "(" + R_PAREN@19..20 ")" + SEMICOLON@20..21 ";" + WHITESPACE@21..26 "\n " + EXPR_STMT@26..43 + LAMBDA_EXPR@26..42 + PARAM_LIST@26..28 + PIPE@26..27 "|" + PIPE@27..28 "|" + WHITESPACE@28..29 " " + RET_TYPE@29..35 + THIN_ARROW@29..31 "->" + WHITESPACE@31..32 " " + PATH_TYPE@32..35 + PATH@32..35 + PATH_SEGMENT@32..35 + NAME_REF@32..35 + IDENT@32..35 "i32" + WHITESPACE@35..36 " " + BLOCK_EXPR@36..42 + BLOCK@36..42 + L_CURLY@36..37 "{" + WHITESPACE@37..38 " " + LITERAL@38..40 + INT_NUMBER@38..40 "92" + WHITESPACE@40..41 " " + R_CURLY@41..42 "}" + SEMICOLON@42..43 ";" + WHITESPACE@43..48 "\n " + EXPR_STMT@48..54 + LAMBDA_EXPR@48..53 + PARAM_LIST@48..51 + PIPE@48..49 "|" + PARAM@49..50 + BIND_PAT@49..50 + NAME@49..50 + IDENT@49..50 "x" + PIPE@50..51 "|" + WHITESPACE@51..52 " " + PATH_EXPR@52..53 + PATH@52..53 + PATH_SEGMENT@52..53 + NAME_REF@52..53 + IDENT@52..53 "x" + SEMICOLON@53..54 ";" + WHITESPACE@54..59 "\n " + EXPR_STMT@59..76 + LAMBDA_EXPR@59..75 + MOVE_KW@59..63 "move" + WHITESPACE@63..64 " " + PARAM_LIST@64..73 + PIPE@64..65 "|" + PARAM@65..71 + BIND_PAT@65..66 + NAME@65..66 + IDENT@65..66 "x" + COLON@66..67 ":" + WHITESPACE@67..68 " " + PATH_TYPE@68..71 + PATH@68..71 + PATH_SEGMENT@68..71 + NAME_REF@68..71 + IDENT@68..71 "i32" + COMMA@71..72 "," + PIPE@72..73 "|" + WHITESPACE@73..74 " " + PATH_EXPR@74..75 + PATH@74..75 + PATH_SEGMENT@74..75 + NAME_REF@74..75 + IDENT@74..75 "x" + SEMICOLON@75..76 ";" + WHITESPACE@76..81 "\n " + EXPR_STMT@81..93 + LAMBDA_EXPR@81..92 + ASYNC_KW@81..86 "async" + WHITESPACE@86..87 " " + PARAM_LIST@87..89 + PIPE@87..88 "|" + PIPE@88..89 "|" + WHITESPACE@89..90 " " + BLOCK_EXPR@90..92 + BLOCK@90..92 + L_CURLY@90..91 "{" + R_CURLY@91..92 "}" + SEMICOLON@92..93 ";" + WHITESPACE@93..98 "\n " + EXPR_STMT@98..109 + LAMBDA_EXPR@98..108 + MOVE_KW@98..102 "move" + WHITESPACE@102..103 " " + PARAM_LIST@103..105 + PIPE@103..104 "|" + PIPE@104..105 "|" + WHITESPACE@105..106 " " + BLOCK_EXPR@106..108 + BLOCK@106..108 + L_CURLY@106..107 "{" + R_CURLY@107..108 "}" + SEMICOLON@108..109 ";" + WHITESPACE@109..114 "\n " + EXPR_STMT@114..131 + LAMBDA_EXPR@114..130 + ASYNC_KW@114..119 "async" + WHITESPACE@119..120 " " + MOVE_KW@120..124 "move" + WHITESPACE@124..125 " " + PARAM_LIST@125..127 + PIPE@125..126 "|" + PIPE@126..127 "|" + WHITESPACE@127..128 " " + BLOCK_EXPR@128..130 + BLOCK@128..130 + L_CURLY@128..129 "{" + R_CURLY@129..130 "}" + SEMICOLON@130..131 ";" + WHITESPACE@131..132 "\n" + R_CURLY@132..133 "}" + 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 cc813038c2..5392b1a748 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 @@ -1,63 +1,63 @@ -SOURCE_FILE@[0; 49) - FN_DEF@[0; 48) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 48) - BLOCK@[9; 48) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 23) - METHOD_CALL_EXPR@[15; 22) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "x" - DOT@[16; 17) "." - NAME_REF@[17; 20) - IDENT@[17; 20) "foo" - ARG_LIST@[20; 22) - L_PAREN@[20; 21) "(" - R_PAREN@[21; 22) ")" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 28) "\n " - EXPR_STMT@[28; 46) - METHOD_CALL_EXPR@[28; 45) - PATH_EXPR@[28; 29) - PATH@[28; 29) - PATH_SEGMENT@[28; 29) - NAME_REF@[28; 29) - IDENT@[28; 29) "y" - DOT@[29; 30) "." - NAME_REF@[30; 33) - IDENT@[30; 33) "bar" - TYPE_ARG_LIST@[33; 38) - COLON2@[33; 35) "::" - L_ANGLE@[35; 36) "<" - TYPE_ARG@[36; 37) - PATH_TYPE@[36; 37) - PATH@[36; 37) - PATH_SEGMENT@[36; 37) - NAME_REF@[36; 37) - IDENT@[36; 37) "T" - R_ANGLE@[37; 38) ">" - ARG_LIST@[38; 45) - L_PAREN@[38; 39) "(" - LITERAL@[39; 40) - INT_NUMBER@[39; 40) "1" - COMMA@[40; 41) "," - WHITESPACE@[41; 42) " " - LITERAL@[42; 43) - INT_NUMBER@[42; 43) "2" - COMMA@[43; 44) "," - R_PAREN@[44; 45) ")" - SEMICOLON@[45; 46) ";" - WHITESPACE@[46; 47) "\n" - R_CURLY@[47; 48) "}" - WHITESPACE@[48; 49) "\n" +SOURCE_FILE@0..49 + FN_DEF@0..48 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..48 + BLOCK@9..48 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..23 + METHOD_CALL_EXPR@15..22 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "x" + DOT@16..17 "." + NAME_REF@17..20 + IDENT@17..20 "foo" + ARG_LIST@20..22 + L_PAREN@20..21 "(" + R_PAREN@21..22 ")" + SEMICOLON@22..23 ";" + WHITESPACE@23..28 "\n " + EXPR_STMT@28..46 + METHOD_CALL_EXPR@28..45 + PATH_EXPR@28..29 + PATH@28..29 + PATH_SEGMENT@28..29 + NAME_REF@28..29 + IDENT@28..29 "y" + DOT@29..30 "." + NAME_REF@30..33 + IDENT@30..33 "bar" + TYPE_ARG_LIST@33..38 + COLON2@33..35 "::" + L_ANGLE@35..36 "<" + TYPE_ARG@36..37 + PATH_TYPE@36..37 + PATH@36..37 + PATH_SEGMENT@36..37 + NAME_REF@36..37 + IDENT@36..37 "T" + R_ANGLE@37..38 ">" + ARG_LIST@38..45 + L_PAREN@38..39 "(" + LITERAL@39..40 + INT_NUMBER@39..40 "1" + COMMA@40..41 "," + WHITESPACE@41..42 " " + LITERAL@42..43 + INT_NUMBER@42..43 "2" + COMMA@43..44 "," + R_PAREN@44..45 ")" + SEMICOLON@45..46 ";" + WHITESPACE@46..47 "\n" + R_CURLY@47..48 "}" + 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 27c3f398ef..54f18adace 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 @@ -1,39 +1,39 @@ -SOURCE_FILE@[0; 40) - FN_DEF@[0; 39) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 39) - BLOCK@[9; 39) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 18) - TUPLE_EXPR@[15; 17) - L_PAREN@[15; 16) "(" - R_PAREN@[16; 17) ")" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 23) "\n " - EXPR_STMT@[23; 27) - PAREN_EXPR@[23; 26) - L_PAREN@[23; 24) "(" - LITERAL@[24; 25) - INT_NUMBER@[24; 25) "1" - R_PAREN@[25; 26) ")" - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - EXPR_STMT@[32; 37) - TUPLE_EXPR@[32; 36) - L_PAREN@[32; 33) "(" - LITERAL@[33; 34) - INT_NUMBER@[33; 34) "1" - COMMA@[34; 35) "," - R_PAREN@[35; 36) ")" - SEMICOLON@[36; 37) ";" - WHITESPACE@[37; 38) "\n" - R_CURLY@[38; 39) "}" - WHITESPACE@[39; 40) "\n" +SOURCE_FILE@0..40 + FN_DEF@0..39 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..39 + BLOCK@9..39 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..18 + TUPLE_EXPR@15..17 + L_PAREN@15..16 "(" + R_PAREN@16..17 ")" + SEMICOLON@17..18 ";" + WHITESPACE@18..23 "\n " + EXPR_STMT@23..27 + PAREN_EXPR@23..26 + L_PAREN@23..24 "(" + LITERAL@24..25 + INT_NUMBER@24..25 "1" + R_PAREN@25..26 ")" + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + EXPR_STMT@32..37 + TUPLE_EXPR@32..36 + L_PAREN@32..33 "(" + LITERAL@33..34 + INT_NUMBER@33..34 "1" + COMMA@34..35 "," + R_PAREN@35..36 ")" + SEMICOLON@36..37 ";" + WHITESPACE@37..38 "\n" + R_CURLY@38..39 "}" + WHITESPACE@39..40 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast index 3376a90cb9..6c9e45684f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0109_label.rast @@ -1,68 +1,68 @@ -SOURCE_FILE@[0; 74) - FN_DEF@[0; 73) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 73) - BLOCK@[9; 73) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 26) - LOOP_EXPR@[15; 26) - LABEL@[15; 18) - LIFETIME@[15; 17) "\'a" - COLON@[17; 18) ":" - WHITESPACE@[18; 19) " " - LOOP_KW@[19; 23) "loop" - WHITESPACE@[23; 24) " " - BLOCK_EXPR@[24; 26) - BLOCK@[24; 26) - L_CURLY@[24; 25) "{" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 31) "\n " - EXPR_STMT@[31; 48) - WHILE_EXPR@[31; 48) - LABEL@[31; 34) - LIFETIME@[31; 33) "\'b" - COLON@[33; 34) ":" - WHITESPACE@[34; 35) " " - WHILE_KW@[35; 40) "while" - WHITESPACE@[40; 41) " " - CONDITION@[41; 45) - LITERAL@[41; 45) - TRUE_KW@[41; 45) "true" - WHITESPACE@[45; 46) " " - BLOCK_EXPR@[46; 48) - BLOCK@[46; 48) - L_CURLY@[46; 47) "{" - R_CURLY@[47; 48) "}" - WHITESPACE@[48; 53) "\n " - FOR_EXPR@[53; 71) - LABEL@[53; 56) - LIFETIME@[53; 55) "\'c" - COLON@[55; 56) ":" - WHITESPACE@[56; 57) " " - FOR_KW@[57; 60) "for" - WHITESPACE@[60; 61) " " - BIND_PAT@[61; 62) - NAME@[61; 62) - IDENT@[61; 62) "x" - WHITESPACE@[62; 63) " " - IN_KW@[63; 65) "in" - WHITESPACE@[65; 66) " " - TUPLE_EXPR@[66; 68) - L_PAREN@[66; 67) "(" - R_PAREN@[67; 68) ")" - WHITESPACE@[68; 69) " " - BLOCK_EXPR@[69; 71) - BLOCK@[69; 71) - L_CURLY@[69; 70) "{" - R_CURLY@[70; 71) "}" - WHITESPACE@[71; 72) "\n" - R_CURLY@[72; 73) "}" - WHITESPACE@[73; 74) "\n" +SOURCE_FILE@0..74 + FN_DEF@0..73 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..73 + BLOCK@9..73 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..26 + LOOP_EXPR@15..26 + LABEL@15..18 + LIFETIME@15..17 "\'a" + COLON@17..18 ":" + WHITESPACE@18..19 " " + LOOP_KW@19..23 "loop" + WHITESPACE@23..24 " " + BLOCK_EXPR@24..26 + BLOCK@24..26 + L_CURLY@24..25 "{" + R_CURLY@25..26 "}" + WHITESPACE@26..31 "\n " + EXPR_STMT@31..48 + WHILE_EXPR@31..48 + LABEL@31..34 + LIFETIME@31..33 "\'b" + COLON@33..34 ":" + WHITESPACE@34..35 " " + WHILE_KW@35..40 "while" + WHITESPACE@40..41 " " + CONDITION@41..45 + LITERAL@41..45 + TRUE_KW@41..45 "true" + WHITESPACE@45..46 " " + BLOCK_EXPR@46..48 + BLOCK@46..48 + L_CURLY@46..47 "{" + R_CURLY@47..48 "}" + WHITESPACE@48..53 "\n " + FOR_EXPR@53..71 + LABEL@53..56 + LIFETIME@53..55 "\'c" + COLON@55..56 ":" + WHITESPACE@56..57 " " + FOR_KW@57..60 "for" + WHITESPACE@60..61 " " + BIND_PAT@61..62 + NAME@61..62 + IDENT@61..62 "x" + WHITESPACE@62..63 " " + IN_KW@63..65 "in" + WHITESPACE@65..66 " " + TUPLE_EXPR@66..68 + L_PAREN@66..67 "(" + R_PAREN@67..68 ")" + WHITESPACE@68..69 " " + BLOCK_EXPR@69..71 + BLOCK@69..71 + L_CURLY@69..70 "{" + R_CURLY@70..71 "}" + WHITESPACE@71..72 "\n" + R_CURLY@72..73 "}" + WHITESPACE@73..74 "\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 d4f5737d5a..015a7a7d22 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 @@ -1,38 +1,38 @@ -SOURCE_FILE@[0; 154) - USE_ITEM@[0; 17) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 16) - PATH@[4; 16) - PATH_SEGMENT@[4; 16) - COLON2@[4; 6) "::" - NAME_REF@[6; 16) - IDENT@[6; 16) "crate_name" - SEMICOLON@[16; 17) ";" - WHITESPACE@[17; 18) " " - COMMENT@[18; 45) "// Rust 2018 - All fl ..." - WHITESPACE@[45; 46) "\n" - USE_ITEM@[46; 61) - USE_KW@[46; 49) "use" - WHITESPACE@[49; 50) " " - USE_TREE@[50; 60) - PATH@[50; 60) - PATH_SEGMENT@[50; 60) - NAME_REF@[50; 60) - IDENT@[50; 60) "crate_name" - SEMICOLON@[60; 61) ";" - WHITESPACE@[61; 62) " " - COMMENT@[62; 91) "// Rust 2018 - Anchor ..." - WHITESPACE@[91; 92) "\n" - USE_ITEM@[92; 124) - USE_KW@[92; 95) "use" - WHITESPACE@[95; 96) " " - USE_TREE@[96; 123) - PATH@[96; 123) - PATH_SEGMENT@[96; 123) - NAME_REF@[96; 123) - IDENT@[96; 123) "item_in_scope_or_crat ..." - SEMICOLON@[123; 124) ";" - WHITESPACE@[124; 125) " " - COMMENT@[125; 153) "// Rust 2018 - Unifor ..." - WHITESPACE@[153; 154) "\n" +SOURCE_FILE@0..154 + USE_ITEM@0..17 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..16 + PATH@4..16 + PATH_SEGMENT@4..16 + COLON2@4..6 "::" + NAME_REF@6..16 + IDENT@6..16 "crate_name" + SEMICOLON@16..17 ";" + WHITESPACE@17..18 " " + COMMENT@18..45 "// Rust 2018 - All fl ..." + WHITESPACE@45..46 "\n" + USE_ITEM@46..61 + USE_KW@46..49 "use" + WHITESPACE@49..50 " " + USE_TREE@50..60 + PATH@50..60 + PATH_SEGMENT@50..60 + NAME_REF@50..60 + IDENT@50..60 "crate_name" + SEMICOLON@60..61 ";" + WHITESPACE@61..62 " " + COMMENT@62..91 "// Rust 2018 - Anchor ..." + WHITESPACE@91..92 "\n" + USE_ITEM@92..124 + USE_KW@92..95 "use" + WHITESPACE@95..96 " " + USE_TREE@96..123 + PATH@96..123 + PATH_SEGMENT@96..123 + NAME_REF@96..123 + IDENT@96..123 "item_in_scope_or_crat ..." + SEMICOLON@123..124 ";" + WHITESPACE@124..125 " " + COMMENT@125..153 "// Rust 2018 - Unifor ..." + 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 88e72d0571..a1c5475e72 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 @@ -1,90 +1,90 @@ -SOURCE_FILE@[0; 94) - FN_DEF@[0; 93) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 93) - BLOCK@[10; 93) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 36) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - TUPLE_PAT@[20; 30) - L_PAREN@[20; 21) "(" - BIND_PAT@[21; 22) - NAME@[21; 22) - IDENT@[21; 22) "a" - COMMA@[22; 23) "," - WHITESPACE@[23; 24) " " - BIND_PAT@[24; 25) - NAME@[24; 25) - IDENT@[24; 25) "b" - COMMA@[25; 26) "," - WHITESPACE@[26; 27) " " - DOT_DOT_PAT@[27; 29) - DOT2@[27; 29) ".." - R_PAREN@[29; 30) ")" - WHITESPACE@[30; 31) " " - EQ@[31; 32) "=" - WHITESPACE@[32; 33) " " - TUPLE_EXPR@[33; 35) - L_PAREN@[33; 34) "(" - R_PAREN@[34; 35) ")" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 41) "\n " - LET_STMT@[41; 55) - LET_KW@[41; 44) "let" - WHITESPACE@[44; 45) " " - TUPLE_PAT@[45; 49) - L_PAREN@[45; 46) "(" - BIND_PAT@[46; 47) - NAME@[46; 47) - IDENT@[46; 47) "a" - COMMA@[47; 48) "," - R_PAREN@[48; 49) ")" - WHITESPACE@[49; 50) " " - EQ@[50; 51) "=" - WHITESPACE@[51; 52) " " - TUPLE_EXPR@[52; 54) - L_PAREN@[52; 53) "(" - R_PAREN@[53; 54) ")" - SEMICOLON@[54; 55) ";" - WHITESPACE@[55; 60) "\n " - LET_STMT@[60; 74) - LET_KW@[60; 63) "let" - WHITESPACE@[63; 64) " " - TUPLE_PAT@[64; 68) - L_PAREN@[64; 65) "(" - DOT_DOT_PAT@[65; 67) - DOT2@[65; 67) ".." - R_PAREN@[67; 68) ")" - WHITESPACE@[68; 69) " " - EQ@[69; 70) "=" - WHITESPACE@[70; 71) " " - TUPLE_EXPR@[71; 73) - L_PAREN@[71; 72) "(" - R_PAREN@[72; 73) ")" - SEMICOLON@[73; 74) ";" - WHITESPACE@[74; 79) "\n " - LET_STMT@[79; 91) - LET_KW@[79; 82) "let" - WHITESPACE@[82; 83) " " - TUPLE_PAT@[83; 85) - L_PAREN@[83; 84) "(" - R_PAREN@[84; 85) ")" - WHITESPACE@[85; 86) " " - EQ@[86; 87) "=" - WHITESPACE@[87; 88) " " - TUPLE_EXPR@[88; 90) - L_PAREN@[88; 89) "(" - R_PAREN@[89; 90) ")" - SEMICOLON@[90; 91) ";" - WHITESPACE@[91; 92) "\n" - R_CURLY@[92; 93) "}" - WHITESPACE@[93; 94) "\n" +SOURCE_FILE@0..94 + FN_DEF@0..93 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..93 + BLOCK@10..93 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..36 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + TUPLE_PAT@20..30 + L_PAREN@20..21 "(" + BIND_PAT@21..22 + NAME@21..22 + IDENT@21..22 "a" + COMMA@22..23 "," + WHITESPACE@23..24 " " + BIND_PAT@24..25 + NAME@24..25 + IDENT@24..25 "b" + COMMA@25..26 "," + WHITESPACE@26..27 " " + DOT_DOT_PAT@27..29 + DOT2@27..29 ".." + R_PAREN@29..30 ")" + WHITESPACE@30..31 " " + EQ@31..32 "=" + WHITESPACE@32..33 " " + TUPLE_EXPR@33..35 + L_PAREN@33..34 "(" + R_PAREN@34..35 ")" + SEMICOLON@35..36 ";" + WHITESPACE@36..41 "\n " + LET_STMT@41..55 + LET_KW@41..44 "let" + WHITESPACE@44..45 " " + TUPLE_PAT@45..49 + L_PAREN@45..46 "(" + BIND_PAT@46..47 + NAME@46..47 + IDENT@46..47 "a" + COMMA@47..48 "," + R_PAREN@48..49 ")" + WHITESPACE@49..50 " " + EQ@50..51 "=" + WHITESPACE@51..52 " " + TUPLE_EXPR@52..54 + L_PAREN@52..53 "(" + R_PAREN@53..54 ")" + SEMICOLON@54..55 ";" + WHITESPACE@55..60 "\n " + LET_STMT@60..74 + LET_KW@60..63 "let" + WHITESPACE@63..64 " " + TUPLE_PAT@64..68 + L_PAREN@64..65 "(" + DOT_DOT_PAT@65..67 + DOT2@65..67 ".." + R_PAREN@67..68 ")" + WHITESPACE@68..69 " " + EQ@69..70 "=" + WHITESPACE@70..71 " " + TUPLE_EXPR@71..73 + L_PAREN@71..72 "(" + R_PAREN@72..73 ")" + SEMICOLON@73..74 ";" + WHITESPACE@74..79 "\n " + LET_STMT@79..91 + LET_KW@79..82 "let" + WHITESPACE@82..83 " " + TUPLE_PAT@83..85 + L_PAREN@83..84 "(" + R_PAREN@84..85 ")" + WHITESPACE@85..86 " " + EQ@86..87 "=" + WHITESPACE@87..88 " " + TUPLE_EXPR@88..90 + L_PAREN@88..89 "(" + R_PAREN@89..90 ")" + SEMICOLON@90..91 ";" + WHITESPACE@91..92 "\n" + R_CURLY@92..93 "}" + 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 5e8f625dcf..42a770a832 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 @@ -1,128 +1,128 @@ -SOURCE_FILE@[0; 146) - FN_DEF@[0; 145) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 145) - BLOCK@[10; 145) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 27) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - BIND_PAT@[20; 21) - NAME@[20; 21) - IDENT@[20; 21) "a" - WHITESPACE@[21; 22) " " - EQ@[22; 23) "=" - WHITESPACE@[23; 24) " " - TUPLE_EXPR@[24; 26) - L_PAREN@[24; 25) "(" - R_PAREN@[25; 26) ")" - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - LET_STMT@[32; 47) - LET_KW@[32; 35) "let" - WHITESPACE@[35; 36) " " - BIND_PAT@[36; 41) - MUT_KW@[36; 39) "mut" - WHITESPACE@[39; 40) " " - NAME@[40; 41) - IDENT@[40; 41) "b" - WHITESPACE@[41; 42) " " - EQ@[42; 43) "=" - WHITESPACE@[43; 44) " " - TUPLE_EXPR@[44; 46) - L_PAREN@[44; 45) "(" - R_PAREN@[45; 46) ")" - SEMICOLON@[46; 47) ";" - WHITESPACE@[47; 52) "\n " - LET_STMT@[52; 67) - LET_KW@[52; 55) "let" - WHITESPACE@[55; 56) " " - BIND_PAT@[56; 61) - REF_KW@[56; 59) "ref" - WHITESPACE@[59; 60) " " - NAME@[60; 61) - IDENT@[60; 61) "c" - WHITESPACE@[61; 62) " " - EQ@[62; 63) "=" - WHITESPACE@[63; 64) " " - TUPLE_EXPR@[64; 66) - L_PAREN@[64; 65) "(" - R_PAREN@[65; 66) ")" - SEMICOLON@[66; 67) ";" - WHITESPACE@[67; 72) "\n " - LET_STMT@[72; 91) - LET_KW@[72; 75) "let" - WHITESPACE@[75; 76) " " - BIND_PAT@[76; 85) - REF_KW@[76; 79) "ref" - WHITESPACE@[79; 80) " " - MUT_KW@[80; 83) "mut" - WHITESPACE@[83; 84) " " - NAME@[84; 85) - IDENT@[84; 85) "d" - WHITESPACE@[85; 86) " " - EQ@[86; 87) "=" - WHITESPACE@[87; 88) " " - TUPLE_EXPR@[88; 90) - L_PAREN@[88; 89) "(" - R_PAREN@[89; 90) ")" - SEMICOLON@[90; 91) ";" - WHITESPACE@[91; 96) "\n " - LET_STMT@[96; 111) - LET_KW@[96; 99) "let" - WHITESPACE@[99; 100) " " - BIND_PAT@[100; 105) - NAME@[100; 101) - IDENT@[100; 101) "e" - WHITESPACE@[101; 102) " " - AT@[102; 103) "@" - WHITESPACE@[103; 104) " " - PLACEHOLDER_PAT@[104; 105) - UNDERSCORE@[104; 105) "_" - WHITESPACE@[105; 106) " " - EQ@[106; 107) "=" - WHITESPACE@[107; 108) " " - TUPLE_EXPR@[108; 110) - L_PAREN@[108; 109) "(" - R_PAREN@[109; 110) ")" - SEMICOLON@[110; 111) ";" - WHITESPACE@[111; 116) "\n " - LET_STMT@[116; 143) - LET_KW@[116; 119) "let" - WHITESPACE@[119; 120) " " - BIND_PAT@[120; 137) - REF_KW@[120; 123) "ref" - WHITESPACE@[123; 124) " " - MUT_KW@[124; 127) "mut" - WHITESPACE@[127; 128) " " - NAME@[128; 129) - IDENT@[128; 129) "f" - WHITESPACE@[129; 130) " " - AT@[130; 131) "@" - WHITESPACE@[131; 132) " " - BIND_PAT@[132; 137) - NAME@[132; 133) - IDENT@[132; 133) "g" - WHITESPACE@[133; 134) " " - AT@[134; 135) "@" - WHITESPACE@[135; 136) " " - PLACEHOLDER_PAT@[136; 137) - UNDERSCORE@[136; 137) "_" - WHITESPACE@[137; 138) " " - EQ@[138; 139) "=" - WHITESPACE@[139; 140) " " - TUPLE_EXPR@[140; 142) - L_PAREN@[140; 141) "(" - R_PAREN@[141; 142) ")" - SEMICOLON@[142; 143) ";" - WHITESPACE@[143; 144) "\n" - R_CURLY@[144; 145) "}" - WHITESPACE@[145; 146) "\n" +SOURCE_FILE@0..146 + FN_DEF@0..145 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..145 + BLOCK@10..145 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..27 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + BIND_PAT@20..21 + NAME@20..21 + IDENT@20..21 "a" + WHITESPACE@21..22 " " + EQ@22..23 "=" + WHITESPACE@23..24 " " + TUPLE_EXPR@24..26 + L_PAREN@24..25 "(" + R_PAREN@25..26 ")" + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + LET_STMT@32..47 + LET_KW@32..35 "let" + WHITESPACE@35..36 " " + BIND_PAT@36..41 + MUT_KW@36..39 "mut" + WHITESPACE@39..40 " " + NAME@40..41 + IDENT@40..41 "b" + WHITESPACE@41..42 " " + EQ@42..43 "=" + WHITESPACE@43..44 " " + TUPLE_EXPR@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + SEMICOLON@46..47 ";" + WHITESPACE@47..52 "\n " + LET_STMT@52..67 + LET_KW@52..55 "let" + WHITESPACE@55..56 " " + BIND_PAT@56..61 + REF_KW@56..59 "ref" + WHITESPACE@59..60 " " + NAME@60..61 + IDENT@60..61 "c" + WHITESPACE@61..62 " " + EQ@62..63 "=" + WHITESPACE@63..64 " " + TUPLE_EXPR@64..66 + L_PAREN@64..65 "(" + R_PAREN@65..66 ")" + SEMICOLON@66..67 ";" + WHITESPACE@67..72 "\n " + LET_STMT@72..91 + LET_KW@72..75 "let" + WHITESPACE@75..76 " " + BIND_PAT@76..85 + REF_KW@76..79 "ref" + WHITESPACE@79..80 " " + MUT_KW@80..83 "mut" + WHITESPACE@83..84 " " + NAME@84..85 + IDENT@84..85 "d" + WHITESPACE@85..86 " " + EQ@86..87 "=" + WHITESPACE@87..88 " " + TUPLE_EXPR@88..90 + L_PAREN@88..89 "(" + R_PAREN@89..90 ")" + SEMICOLON@90..91 ";" + WHITESPACE@91..96 "\n " + LET_STMT@96..111 + LET_KW@96..99 "let" + WHITESPACE@99..100 " " + BIND_PAT@100..105 + NAME@100..101 + IDENT@100..101 "e" + WHITESPACE@101..102 " " + AT@102..103 "@" + WHITESPACE@103..104 " " + PLACEHOLDER_PAT@104..105 + UNDERSCORE@104..105 "_" + WHITESPACE@105..106 " " + EQ@106..107 "=" + WHITESPACE@107..108 " " + TUPLE_EXPR@108..110 + L_PAREN@108..109 "(" + R_PAREN@109..110 ")" + SEMICOLON@110..111 ";" + WHITESPACE@111..116 "\n " + LET_STMT@116..143 + LET_KW@116..119 "let" + WHITESPACE@119..120 " " + BIND_PAT@120..137 + REF_KW@120..123 "ref" + WHITESPACE@123..124 " " + MUT_KW@124..127 "mut" + WHITESPACE@127..128 " " + NAME@128..129 + IDENT@128..129 "f" + WHITESPACE@129..130 " " + AT@130..131 "@" + WHITESPACE@131..132 " " + BIND_PAT@132..137 + NAME@132..133 + IDENT@132..133 "g" + WHITESPACE@133..134 " " + AT@134..135 "@" + WHITESPACE@135..136 " " + PLACEHOLDER_PAT@136..137 + UNDERSCORE@136..137 "_" + WHITESPACE@137..138 " " + EQ@138..139 "=" + WHITESPACE@139..140 " " + TUPLE_EXPR@140..142 + L_PAREN@140..141 "(" + R_PAREN@141..142 ")" + SEMICOLON@142..143 ";" + WHITESPACE@143..144 "\n" + R_CURLY@144..145 "}" + 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 f2f649410f..5414c90b8c 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 @@ -1,57 +1,57 @@ -SOURCE_FILE@[0; 50) - FN_DEF@[0; 49) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - BLOCK_EXPR@[8; 49) - BLOCK@[8; 49) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 14) "\n " - SEMICOLON@[14; 15) ";" - SEMICOLON@[15; 16) ";" - SEMICOLON@[16; 17) ";" - EXPR_STMT@[17; 29) - CALL_EXPR@[17; 28) - PATH_EXPR@[17; 26) - PATH@[17; 26) - PATH_SEGMENT@[17; 26) - NAME_REF@[17; 26) - IDENT@[17; 26) "some_expr" - ARG_LIST@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - SEMICOLON@[28; 29) ";" - SEMICOLON@[29; 30) ";" - SEMICOLON@[30; 31) ";" - SEMICOLON@[31; 32) ";" - EXPR_STMT@[32; 38) - BLOCK_EXPR@[32; 37) - BLOCK@[32; 37) - L_CURLY@[32; 33) "{" - SEMICOLON@[33; 34) ";" - SEMICOLON@[34; 35) ";" - SEMICOLON@[35; 36) ";" - R_CURLY@[36; 37) "}" - SEMICOLON@[37; 38) ";" - SEMICOLON@[38; 39) ";" - SEMICOLON@[39; 40) ";" - SEMICOLON@[40; 41) ";" - CALL_EXPR@[41; 47) - PATH_EXPR@[41; 43) - PATH@[41; 43) - PATH_SEGMENT@[41; 43) - NAME_REF@[41; 43) - IDENT@[41; 43) "Ok" - ARG_LIST@[43; 47) - L_PAREN@[43; 44) "(" - TUPLE_EXPR@[44; 46) - L_PAREN@[44; 45) "(" - R_PAREN@[45; 46) ")" - R_PAREN@[46; 47) ")" - WHITESPACE@[47; 48) "\n" - R_CURLY@[48; 49) "}" - WHITESPACE@[49; 50) "\n" +SOURCE_FILE@0..50 + FN_DEF@0..49 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + BLOCK_EXPR@8..49 + BLOCK@8..49 + L_CURLY@8..9 "{" + WHITESPACE@9..14 "\n " + SEMICOLON@14..15 ";" + SEMICOLON@15..16 ";" + SEMICOLON@16..17 ";" + EXPR_STMT@17..29 + CALL_EXPR@17..28 + PATH_EXPR@17..26 + PATH@17..26 + PATH_SEGMENT@17..26 + NAME_REF@17..26 + IDENT@17..26 "some_expr" + ARG_LIST@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + SEMICOLON@28..29 ";" + SEMICOLON@29..30 ";" + SEMICOLON@30..31 ";" + SEMICOLON@31..32 ";" + EXPR_STMT@32..38 + BLOCK_EXPR@32..37 + BLOCK@32..37 + L_CURLY@32..33 "{" + SEMICOLON@33..34 ";" + SEMICOLON@34..35 ";" + SEMICOLON@35..36 ";" + R_CURLY@36..37 "}" + SEMICOLON@37..38 ";" + SEMICOLON@38..39 ";" + SEMICOLON@39..40 ";" + SEMICOLON@40..41 ";" + CALL_EXPR@41..47 + PATH_EXPR@41..43 + PATH@41..43 + PATH_SEGMENT@41..43 + NAME_REF@41..43 + IDENT@41..43 "Ok" + ARG_LIST@43..47 + L_PAREN@43..44 "(" + TUPLE_EXPR@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + R_PAREN@46..47 ")" + WHITESPACE@47..48 "\n" + R_CURLY@48..49 "}" + WHITESPACE@49..50 "\n" 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 457c82e743..01d717d6b7 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 @@ -1,64 +1,64 @@ -SOURCE_FILE@[0; 53) - STRUCT_DEF@[0; 33) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 11) - IDENT@[7; 11) "Test" - TYPE_PARAM_LIST@[11; 14) - L_ANGLE@[11; 12) "<" - TYPE_PARAM@[12; 13) - NAME@[12; 13) - IDENT@[12; 13) "T" - R_ANGLE@[13; 14) ">" - TUPLE_FIELD_DEF_LIST@[14; 17) - L_PAREN@[14; 15) "(" - TUPLE_FIELD_DEF@[15; 16) - PATH_TYPE@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "T" - R_PAREN@[16; 17) ")" - WHITESPACE@[17; 18) " " - WHERE_CLAUSE@[18; 32) - WHERE_KW@[18; 23) "where" - WHITESPACE@[23; 24) " " - WHERE_PRED@[24; 32) - PATH_TYPE@[24; 25) - PATH@[24; 25) - PATH_SEGMENT@[24; 25) - NAME_REF@[24; 25) - IDENT@[24; 25) "T" - COLON@[25; 26) ":" - WHITESPACE@[26; 27) " " - TYPE_BOUND_LIST@[27; 32) - TYPE_BOUND@[27; 32) - PATH_TYPE@[27; 32) - PATH@[27; 32) - PATH_SEGMENT@[27; 32) - NAME_REF@[27; 32) - IDENT@[27; 32) "Clone" - SEMICOLON@[32; 33) ";" - WHITESPACE@[33; 34) "\n" - STRUCT_DEF@[34; 52) - STRUCT_KW@[34; 40) "struct" - WHITESPACE@[40; 41) " " - NAME@[41; 45) - IDENT@[41; 45) "Test" - TYPE_PARAM_LIST@[45; 48) - L_ANGLE@[45; 46) "<" - TYPE_PARAM@[46; 47) - NAME@[46; 47) - IDENT@[46; 47) "T" - R_ANGLE@[47; 48) ">" - TUPLE_FIELD_DEF_LIST@[48; 51) - L_PAREN@[48; 49) "(" - TUPLE_FIELD_DEF@[49; 50) - PATH_TYPE@[49; 50) - PATH@[49; 50) - PATH_SEGMENT@[49; 50) - NAME_REF@[49; 50) - IDENT@[49; 50) "T" - R_PAREN@[50; 51) ")" - SEMICOLON@[51; 52) ";" - WHITESPACE@[52; 53) "\n" +SOURCE_FILE@0..53 + STRUCT_DEF@0..33 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..11 + IDENT@7..11 "Test" + TYPE_PARAM_LIST@11..14 + L_ANGLE@11..12 "<" + TYPE_PARAM@12..13 + NAME@12..13 + IDENT@12..13 "T" + R_ANGLE@13..14 ">" + TUPLE_FIELD_DEF_LIST@14..17 + L_PAREN@14..15 "(" + TUPLE_FIELD_DEF@15..16 + PATH_TYPE@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "T" + R_PAREN@16..17 ")" + WHITESPACE@17..18 " " + WHERE_CLAUSE@18..32 + WHERE_KW@18..23 "where" + WHITESPACE@23..24 " " + WHERE_PRED@24..32 + PATH_TYPE@24..25 + PATH@24..25 + PATH_SEGMENT@24..25 + NAME_REF@24..25 + IDENT@24..25 "T" + COLON@25..26 ":" + WHITESPACE@26..27 " " + TYPE_BOUND_LIST@27..32 + TYPE_BOUND@27..32 + PATH_TYPE@27..32 + PATH@27..32 + PATH_SEGMENT@27..32 + NAME_REF@27..32 + IDENT@27..32 "Clone" + SEMICOLON@32..33 ";" + WHITESPACE@33..34 "\n" + STRUCT_DEF@34..52 + STRUCT_KW@34..40 "struct" + WHITESPACE@40..41 " " + NAME@41..45 + IDENT@41..45 "Test" + TYPE_PARAM_LIST@45..48 + L_ANGLE@45..46 "<" + TYPE_PARAM@46..47 + NAME@46..47 + IDENT@46..47 "T" + R_ANGLE@47..48 ">" + TUPLE_FIELD_DEF_LIST@48..51 + L_PAREN@48..49 "(" + TUPLE_FIELD_DEF@49..50 + PATH_TYPE@49..50 + PATH@49..50 + PATH_SEGMENT@49..50 + NAME_REF@49..50 + IDENT@49..50 "T" + R_PAREN@50..51 ")" + SEMICOLON@51..52 ";" + 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 0b1552a9d8..3c0ef90058 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 @@ -1,41 +1,41 @@ -SOURCE_FILE@[0; 60) - STRUCT_DEF@[0; 59) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - TUPLE_FIELD_DEF_LIST@[9; 58) - L_PAREN@[9; 10) "(" - WHITESPACE@[10; 15) "\n " - TUPLE_FIELD_DEF@[15; 55) - ATTR@[15; 43) - POUND@[15; 16) "#" - L_BRACK@[16; 17) "[" - PATH@[17; 22) - PATH_SEGMENT@[17; 22) - NAME_REF@[17; 22) - IDENT@[17; 22) "serde" - TOKEN_TREE@[22; 42) - L_PAREN@[22; 23) "(" - IDENT@[23; 27) "with" - WHITESPACE@[27; 28) " " - EQ@[28; 29) "=" - WHITESPACE@[29; 30) " " - STRING@[30; 41) "\"url_serde\"" - R_PAREN@[41; 42) ")" - R_BRACK@[42; 43) "]" - WHITESPACE@[43; 48) "\n " - VISIBILITY@[48; 51) - PUB_KW@[48; 51) "pub" - WHITESPACE@[51; 52) " " - PATH_TYPE@[52; 55) - PATH@[52; 55) - PATH_SEGMENT@[52; 55) - NAME_REF@[52; 55) - IDENT@[52; 55) "Uri" - COMMA@[55; 56) "," - WHITESPACE@[56; 57) "\n" - R_PAREN@[57; 58) ")" - SEMICOLON@[58; 59) ";" - WHITESPACE@[59; 60) "\n" +SOURCE_FILE@0..60 + STRUCT_DEF@0..59 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + TUPLE_FIELD_DEF_LIST@9..58 + L_PAREN@9..10 "(" + WHITESPACE@10..15 "\n " + TUPLE_FIELD_DEF@15..55 + ATTR@15..43 + POUND@15..16 "#" + L_BRACK@16..17 "[" + PATH@17..22 + PATH_SEGMENT@17..22 + NAME_REF@17..22 + IDENT@17..22 "serde" + TOKEN_TREE@22..42 + L_PAREN@22..23 "(" + IDENT@23..27 "with" + WHITESPACE@27..28 " " + EQ@28..29 "=" + WHITESPACE@29..30 " " + STRING@30..41 "\"url_serde\"" + R_PAREN@41..42 ")" + R_BRACK@42..43 "]" + WHITESPACE@43..48 "\n " + VISIBILITY@48..51 + PUB_KW@48..51 "pub" + WHITESPACE@51..52 " " + PATH_TYPE@52..55 + PATH@52..55 + PATH_SEGMENT@52..55 + NAME_REF@52..55 + IDENT@52..55 "Uri" + COMMA@55..56 "," + WHITESPACE@56..57 "\n" + R_PAREN@57..58 ")" + SEMICOLON@58..59 ";" + 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 4f9e80e2eb..ddfcf974e8 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 @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 41) - TYPE_ALIAS_DEF@[0; 16) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "A" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - MACRO_CALL@[9; 15) - PATH@[9; 12) - PATH_SEGMENT@[9; 12) - NAME_REF@[9; 12) - IDENT@[9; 12) "foo" - BANG@[12; 13) "!" - TOKEN_TREE@[13; 15) - L_PAREN@[13; 14) "(" - R_PAREN@[14; 15) ")" - SEMICOLON@[15; 16) ";" - WHITESPACE@[16; 17) "\n" - TYPE_ALIAS_DEF@[17; 40) - TYPE_KW@[17; 21) "type" - WHITESPACE@[21; 22) " " - NAME@[22; 23) - IDENT@[22; 23) "B" - WHITESPACE@[23; 24) " " - EQ@[24; 25) "=" - WHITESPACE@[25; 26) " " - MACRO_CALL@[26; 39) - PATH@[26; 36) - PATH@[26; 31) - PATH_SEGMENT@[26; 31) - CRATE_KW@[26; 31) "crate" - COLON2@[31; 33) "::" - PATH_SEGMENT@[33; 36) - NAME_REF@[33; 36) - IDENT@[33; 36) "foo" - BANG@[36; 37) "!" - TOKEN_TREE@[37; 39) - L_PAREN@[37; 38) "(" - R_PAREN@[38; 39) ")" - SEMICOLON@[39; 40) ";" - WHITESPACE@[40; 41) "\n" +SOURCE_FILE@0..41 + TYPE_ALIAS_DEF@0..16 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + MACRO_CALL@9..15 + PATH@9..12 + PATH_SEGMENT@9..12 + NAME_REF@9..12 + IDENT@9..12 "foo" + BANG@12..13 "!" + TOKEN_TREE@13..15 + L_PAREN@13..14 "(" + R_PAREN@14..15 ")" + SEMICOLON@15..16 ";" + WHITESPACE@16..17 "\n" + TYPE_ALIAS_DEF@17..40 + TYPE_KW@17..21 "type" + WHITESPACE@21..22 " " + NAME@22..23 + IDENT@22..23 "B" + WHITESPACE@23..24 " " + EQ@24..25 "=" + WHITESPACE@25..26 " " + MACRO_CALL@26..39 + PATH@26..36 + PATH@26..31 + PATH_SEGMENT@26..31 + CRATE_KW@26..31 "crate" + COLON2@31..33 "::" + PATH_SEGMENT@33..36 + NAME_REF@33..36 + IDENT@33..36 "foo" + BANG@36..37 "!" + TOKEN_TREE@37..39 + L_PAREN@37..38 "(" + R_PAREN@38..39 ")" + SEMICOLON@39..40 ";" + 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 f9a4bc81b9..a65a5c85fc 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 @@ -1,40 +1,40 @@ -SOURCE_FILE@[0; 94) - ENUM_DEF@[0; 8) - ENUM_KW@[0; 4) "enum" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "F" - ENUM_VARIANT_LIST@[6; 8) - L_CURLY@[6; 7) "{" - R_CURLY@[7; 8) "}" - WHITESPACE@[8; 9) "\n" - IMPL_DEF@[9; 93) - IMPL_KW@[9; 13) "impl" - WHITESPACE@[13; 14) " " - PATH_TYPE@[14; 15) - PATH@[14; 15) - PATH_SEGMENT@[14; 15) - NAME_REF@[14; 15) - IDENT@[14; 15) "F" - WHITESPACE@[15; 16) " " - ITEM_LIST@[16; 93) - L_CURLY@[16; 17) "{" - WHITESPACE@[17; 23) "\n " - COMMENT@[23; 48) "//! This is a doc com ..." - WHITESPACE@[48; 54) "\n " - ATTR@[54; 91) - POUND@[54; 55) "#" - BANG@[55; 56) "!" - L_BRACK@[56; 57) "[" - PATH@[57; 60) - PATH_SEGMENT@[57; 60) - NAME_REF@[57; 60) - IDENT@[57; 60) "doc" - TOKEN_TREE@[60; 90) - L_PAREN@[60; 61) "(" - STRING@[61; 89) "\"This is also a doc c ..." - R_PAREN@[89; 90) ")" - R_BRACK@[90; 91) "]" - WHITESPACE@[91; 92) "\n" - R_CURLY@[92; 93) "}" - WHITESPACE@[93; 94) "\n" +SOURCE_FILE@0..94 + ENUM_DEF@0..8 + ENUM_KW@0..4 "enum" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "F" + ENUM_VARIANT_LIST@6..8 + L_CURLY@6..7 "{" + R_CURLY@7..8 "}" + WHITESPACE@8..9 "\n" + IMPL_DEF@9..93 + IMPL_KW@9..13 "impl" + WHITESPACE@13..14 " " + PATH_TYPE@14..15 + PATH@14..15 + PATH_SEGMENT@14..15 + NAME_REF@14..15 + IDENT@14..15 "F" + WHITESPACE@15..16 " " + ITEM_LIST@16..93 + L_CURLY@16..17 "{" + WHITESPACE@17..23 "\n " + COMMENT@23..48 "//! This is a doc com ..." + WHITESPACE@48..54 "\n " + ATTR@54..91 + POUND@54..55 "#" + BANG@55..56 "!" + L_BRACK@56..57 "[" + PATH@57..60 + PATH_SEGMENT@57..60 + NAME_REF@57..60 + IDENT@57..60 "doc" + TOKEN_TREE@60..90 + L_PAREN@60..61 "(" + STRING@61..89 "\"This is also a doc c ..." + R_PAREN@89..90 ")" + R_BRACK@90..91 "]" + WHITESPACE@91..92 "\n" + R_CURLY@92..93 "}" + WHITESPACE@93..94 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast index 852e4e489a..8e080fb603 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0118_match_guard.rast @@ -1,48 +1,48 @@ -SOURCE_FILE@[0; 58) - FN_DEF@[0; 57) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 57) - BLOCK@[9; 57) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - MATCH_EXPR@[15; 55) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 55) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 48) - PLACEHOLDER_PAT@[34; 35) - UNDERSCORE@[34; 35) "_" - WHITESPACE@[35; 36) " " - MATCH_GUARD@[36; 42) - IF_KW@[36; 38) "if" - WHITESPACE@[38; 39) " " - PATH_EXPR@[39; 42) - PATH@[39; 42) - PATH_SEGMENT@[39; 42) - NAME_REF@[39; 42) - IDENT@[39; 42) "foo" - WHITESPACE@[42; 43) " " - FAT_ARROW@[43; 45) "=>" - WHITESPACE@[45; 46) " " - TUPLE_EXPR@[46; 48) - L_PAREN@[46; 47) "(" - R_PAREN@[47; 48) ")" - COMMA@[48; 49) "," - WHITESPACE@[49; 54) "\n " - R_CURLY@[54; 55) "}" - WHITESPACE@[55; 56) "\n" - R_CURLY@[56; 57) "}" - WHITESPACE@[57; 58) "\n" +SOURCE_FILE@0..58 + FN_DEF@0..57 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..57 + BLOCK@9..57 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + MATCH_EXPR@15..55 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..55 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..48 + PLACEHOLDER_PAT@34..35 + UNDERSCORE@34..35 "_" + WHITESPACE@35..36 " " + MATCH_GUARD@36..42 + IF_KW@36..38 "if" + WHITESPACE@38..39 " " + PATH_EXPR@39..42 + PATH@39..42 + PATH_SEGMENT@39..42 + NAME_REF@39..42 + IDENT@39..42 "foo" + WHITESPACE@42..43 " " + FAT_ARROW@43..45 "=>" + WHITESPACE@45..46 " " + TUPLE_EXPR@46..48 + L_PAREN@46..47 "(" + R_PAREN@47..48 ")" + COMMA@48..49 "," + WHITESPACE@49..54 "\n " + R_CURLY@54..55 "}" + WHITESPACE@55..56 "\n" + R_CURLY@56..57 "}" + WHITESPACE@57..58 "\n" 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 7eec92e1bd..728164f8e5 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 @@ -1,81 +1,81 @@ -SOURCE_FILE@[0; 139) - FN_DEF@[0; 138) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 138) - BLOCK@[9; 138) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - MATCH_EXPR@[15; 136) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 136) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - ATTR@[34; 60) - POUND@[34; 35) "#" - BANG@[35; 36) "!" - L_BRACK@[36; 37) "[" - PATH@[37; 40) - PATH_SEGMENT@[37; 40) - NAME_REF@[37; 40) - IDENT@[37; 40) "doc" - TOKEN_TREE@[40; 59) - L_PAREN@[40; 41) "(" - STRING@[41; 58) "\"Inner attribute\"" - R_PAREN@[58; 59) ")" - R_BRACK@[59; 60) "]" - WHITESPACE@[60; 69) "\n " - ATTR@[69; 86) - POUND@[69; 70) "#" - BANG@[70; 71) "!" - L_BRACK@[71; 72) "[" - PATH@[72; 75) - PATH_SEGMENT@[72; 75) - NAME_REF@[72; 75) - IDENT@[72; 75) "doc" - TOKEN_TREE@[75; 85) - L_PAREN@[75; 76) "(" - STRING@[76; 84) "\"Can be\"" - R_PAREN@[84; 85) ")" - R_BRACK@[85; 86) "]" - WHITESPACE@[86; 95) "\n " - ATTR@[95; 113) - POUND@[95; 96) "#" - BANG@[96; 97) "!" - L_BRACK@[97; 98) "[" - PATH@[98; 101) - PATH_SEGMENT@[98; 101) - NAME_REF@[98; 101) - IDENT@[98; 101) "doc" - TOKEN_TREE@[101; 112) - L_PAREN@[101; 102) "(" - STRING@[102; 111) "\"Stacked\"" - R_PAREN@[111; 112) ")" - R_BRACK@[112; 113) "]" - WHITESPACE@[113; 122) "\n " - MATCH_ARM@[122; 129) - PLACEHOLDER_PAT@[122; 123) - UNDERSCORE@[122; 123) "_" - WHITESPACE@[123; 124) " " - FAT_ARROW@[124; 126) "=>" - WHITESPACE@[126; 127) " " - TUPLE_EXPR@[127; 129) - L_PAREN@[127; 128) "(" - R_PAREN@[128; 129) ")" - COMMA@[129; 130) "," - WHITESPACE@[130; 135) "\n " - R_CURLY@[135; 136) "}" - WHITESPACE@[136; 137) "\n" - R_CURLY@[137; 138) "}" - WHITESPACE@[138; 139) "\n" +SOURCE_FILE@0..139 + FN_DEF@0..138 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..138 + BLOCK@9..138 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + MATCH_EXPR@15..136 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..136 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + ATTR@34..60 + POUND@34..35 "#" + BANG@35..36 "!" + L_BRACK@36..37 "[" + PATH@37..40 + PATH_SEGMENT@37..40 + NAME_REF@37..40 + IDENT@37..40 "doc" + TOKEN_TREE@40..59 + L_PAREN@40..41 "(" + STRING@41..58 "\"Inner attribute\"" + R_PAREN@58..59 ")" + R_BRACK@59..60 "]" + WHITESPACE@60..69 "\n " + ATTR@69..86 + POUND@69..70 "#" + BANG@70..71 "!" + L_BRACK@71..72 "[" + PATH@72..75 + PATH_SEGMENT@72..75 + NAME_REF@72..75 + IDENT@72..75 "doc" + TOKEN_TREE@75..85 + L_PAREN@75..76 "(" + STRING@76..84 "\"Can be\"" + R_PAREN@84..85 ")" + R_BRACK@85..86 "]" + WHITESPACE@86..95 "\n " + ATTR@95..113 + POUND@95..96 "#" + BANG@96..97 "!" + L_BRACK@97..98 "[" + PATH@98..101 + PATH_SEGMENT@98..101 + NAME_REF@98..101 + IDENT@98..101 "doc" + TOKEN_TREE@101..112 + L_PAREN@101..102 "(" + STRING@102..111 "\"Stacked\"" + R_PAREN@111..112 ")" + R_BRACK@112..113 "]" + WHITESPACE@113..122 "\n " + MATCH_ARM@122..129 + PLACEHOLDER_PAT@122..123 + UNDERSCORE@122..123 "_" + WHITESPACE@123..124 " " + FAT_ARROW@124..126 "=>" + WHITESPACE@126..127 " " + TUPLE_EXPR@127..129 + L_PAREN@127..128 "(" + R_PAREN@128..129 ")" + COMMA@129..130 "," + WHITESPACE@130..135 "\n " + R_CURLY@135..136 "}" + WHITESPACE@136..137 "\n" + R_CURLY@137..138 "}" + WHITESPACE@138..139 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast index ff380b4486..6123885e3c 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0121_match_arms_outer_attributes.rast @@ -1,146 +1,146 @@ -SOURCE_FILE@[0; 259) - FN_DEF@[0; 258) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 258) - BLOCK@[9; 258) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - MATCH_EXPR@[15; 256) - MATCH_KW@[15; 20) "match" - WHITESPACE@[20; 21) " " - TUPLE_EXPR@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - MATCH_ARM_LIST@[24; 256) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 34) "\n " - MATCH_ARM@[34; 74) - ATTR@[34; 58) - POUND@[34; 35) "#" - L_BRACK@[35; 36) "[" - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "cfg" - TOKEN_TREE@[39; 57) - L_PAREN@[39; 40) "(" - IDENT@[40; 47) "feature" - WHITESPACE@[47; 48) " " - EQ@[48; 49) "=" - WHITESPACE@[49; 50) " " - STRING@[50; 56) "\"some\"" - R_PAREN@[56; 57) ")" - R_BRACK@[57; 58) "]" - WHITESPACE@[58; 67) "\n " - PLACEHOLDER_PAT@[67; 68) - UNDERSCORE@[67; 68) "_" - WHITESPACE@[68; 69) " " - FAT_ARROW@[69; 71) "=>" - WHITESPACE@[71; 72) " " - TUPLE_EXPR@[72; 74) - L_PAREN@[72; 73) "(" - R_PAREN@[73; 74) ")" - COMMA@[74; 75) "," - WHITESPACE@[75; 84) "\n " - MATCH_ARM@[84; 125) - ATTR@[84; 109) - POUND@[84; 85) "#" - L_BRACK@[85; 86) "[" - PATH@[86; 89) - PATH_SEGMENT@[86; 89) - NAME_REF@[86; 89) - IDENT@[86; 89) "cfg" - TOKEN_TREE@[89; 108) - L_PAREN@[89; 90) "(" - IDENT@[90; 97) "feature" - WHITESPACE@[97; 98) " " - EQ@[98; 99) "=" - WHITESPACE@[99; 100) " " - STRING@[100; 107) "\"other\"" - R_PAREN@[107; 108) ")" - R_BRACK@[108; 109) "]" - WHITESPACE@[109; 118) "\n " - PLACEHOLDER_PAT@[118; 119) - UNDERSCORE@[118; 119) "_" - WHITESPACE@[119; 120) " " - FAT_ARROW@[120; 122) "=>" - WHITESPACE@[122; 123) " " - TUPLE_EXPR@[123; 125) - L_PAREN@[123; 124) "(" - R_PAREN@[124; 125) ")" - COMMA@[125; 126) "," - WHITESPACE@[126; 135) "\n " - MATCH_ARM@[135; 249) - ATTR@[135; 159) - POUND@[135; 136) "#" - L_BRACK@[136; 137) "[" - PATH@[137; 140) - PATH_SEGMENT@[137; 140) - NAME_REF@[137; 140) - IDENT@[137; 140) "cfg" - TOKEN_TREE@[140; 158) - L_PAREN@[140; 141) "(" - IDENT@[141; 148) "feature" - WHITESPACE@[148; 149) " " - EQ@[149; 150) "=" - WHITESPACE@[150; 151) " " - STRING@[151; 157) "\"many\"" - R_PAREN@[157; 158) ")" - R_BRACK@[158; 159) "]" - WHITESPACE@[159; 168) "\n " - ATTR@[168; 198) - POUND@[168; 169) "#" - L_BRACK@[169; 170) "[" - PATH@[170; 173) - PATH_SEGMENT@[170; 173) - NAME_REF@[170; 173) - IDENT@[170; 173) "cfg" - TOKEN_TREE@[173; 197) - L_PAREN@[173; 174) "(" - IDENT@[174; 181) "feature" - WHITESPACE@[181; 182) " " - EQ@[182; 183) "=" - WHITESPACE@[183; 184) " " - STRING@[184; 196) "\"attributes\"" - R_PAREN@[196; 197) ")" - R_BRACK@[197; 198) "]" - WHITESPACE@[198; 207) "\n " - ATTR@[207; 233) - POUND@[207; 208) "#" - L_BRACK@[208; 209) "[" - PATH@[209; 212) - PATH_SEGMENT@[209; 212) - NAME_REF@[209; 212) - IDENT@[209; 212) "cfg" - TOKEN_TREE@[212; 232) - L_PAREN@[212; 213) "(" - IDENT@[213; 220) "feature" - WHITESPACE@[220; 221) " " - EQ@[221; 222) "=" - WHITESPACE@[222; 223) " " - STRING@[223; 231) "\"before\"" - R_PAREN@[231; 232) ")" - R_BRACK@[232; 233) "]" - WHITESPACE@[233; 242) "\n " - PLACEHOLDER_PAT@[242; 243) - UNDERSCORE@[242; 243) "_" - WHITESPACE@[243; 244) " " - FAT_ARROW@[244; 246) "=>" - WHITESPACE@[246; 247) " " - TUPLE_EXPR@[247; 249) - L_PAREN@[247; 248) "(" - R_PAREN@[248; 249) ")" - COMMA@[249; 250) "," - WHITESPACE@[250; 255) "\n " - R_CURLY@[255; 256) "}" - WHITESPACE@[256; 257) "\n" - R_CURLY@[257; 258) "}" - WHITESPACE@[258; 259) "\n" +SOURCE_FILE@0..259 + FN_DEF@0..258 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..258 + BLOCK@9..258 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + MATCH_EXPR@15..256 + MATCH_KW@15..20 "match" + WHITESPACE@20..21 " " + TUPLE_EXPR@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + MATCH_ARM_LIST@24..256 + L_CURLY@24..25 "{" + WHITESPACE@25..34 "\n " + MATCH_ARM@34..74 + ATTR@34..58 + POUND@34..35 "#" + L_BRACK@35..36 "[" + PATH@36..39 + PATH_SEGMENT@36..39 + NAME_REF@36..39 + IDENT@36..39 "cfg" + TOKEN_TREE@39..57 + L_PAREN@39..40 "(" + IDENT@40..47 "feature" + WHITESPACE@47..48 " " + EQ@48..49 "=" + WHITESPACE@49..50 " " + STRING@50..56 "\"some\"" + R_PAREN@56..57 ")" + R_BRACK@57..58 "]" + WHITESPACE@58..67 "\n " + PLACEHOLDER_PAT@67..68 + UNDERSCORE@67..68 "_" + WHITESPACE@68..69 " " + FAT_ARROW@69..71 "=>" + WHITESPACE@71..72 " " + TUPLE_EXPR@72..74 + L_PAREN@72..73 "(" + R_PAREN@73..74 ")" + COMMA@74..75 "," + WHITESPACE@75..84 "\n " + MATCH_ARM@84..125 + ATTR@84..109 + POUND@84..85 "#" + L_BRACK@85..86 "[" + PATH@86..89 + PATH_SEGMENT@86..89 + NAME_REF@86..89 + IDENT@86..89 "cfg" + TOKEN_TREE@89..108 + L_PAREN@89..90 "(" + IDENT@90..97 "feature" + WHITESPACE@97..98 " " + EQ@98..99 "=" + WHITESPACE@99..100 " " + STRING@100..107 "\"other\"" + R_PAREN@107..108 ")" + R_BRACK@108..109 "]" + WHITESPACE@109..118 "\n " + PLACEHOLDER_PAT@118..119 + UNDERSCORE@118..119 "_" + WHITESPACE@119..120 " " + FAT_ARROW@120..122 "=>" + WHITESPACE@122..123 " " + TUPLE_EXPR@123..125 + L_PAREN@123..124 "(" + R_PAREN@124..125 ")" + COMMA@125..126 "," + WHITESPACE@126..135 "\n " + MATCH_ARM@135..249 + ATTR@135..159 + POUND@135..136 "#" + L_BRACK@136..137 "[" + PATH@137..140 + PATH_SEGMENT@137..140 + NAME_REF@137..140 + IDENT@137..140 "cfg" + TOKEN_TREE@140..158 + L_PAREN@140..141 "(" + IDENT@141..148 "feature" + WHITESPACE@148..149 " " + EQ@149..150 "=" + WHITESPACE@150..151 " " + STRING@151..157 "\"many\"" + R_PAREN@157..158 ")" + R_BRACK@158..159 "]" + WHITESPACE@159..168 "\n " + ATTR@168..198 + POUND@168..169 "#" + L_BRACK@169..170 "[" + PATH@170..173 + PATH_SEGMENT@170..173 + NAME_REF@170..173 + IDENT@170..173 "cfg" + TOKEN_TREE@173..197 + L_PAREN@173..174 "(" + IDENT@174..181 "feature" + WHITESPACE@181..182 " " + EQ@182..183 "=" + WHITESPACE@183..184 " " + STRING@184..196 "\"attributes\"" + R_PAREN@196..197 ")" + R_BRACK@197..198 "]" + WHITESPACE@198..207 "\n " + ATTR@207..233 + POUND@207..208 "#" + L_BRACK@208..209 "[" + PATH@209..212 + PATH_SEGMENT@209..212 + NAME_REF@209..212 + IDENT@209..212 "cfg" + TOKEN_TREE@212..232 + L_PAREN@212..213 "(" + IDENT@213..220 "feature" + WHITESPACE@220..221 " " + EQ@221..222 "=" + WHITESPACE@222..223 " " + STRING@223..231 "\"before\"" + R_PAREN@231..232 ")" + R_BRACK@232..233 "]" + WHITESPACE@233..242 "\n " + PLACEHOLDER_PAT@242..243 + UNDERSCORE@242..243 "_" + WHITESPACE@243..244 " " + FAT_ARROW@244..246 "=>" + WHITESPACE@246..247 " " + TUPLE_EXPR@247..249 + L_PAREN@247..248 "(" + R_PAREN@248..249 ")" + COMMA@249..250 "," + WHITESPACE@250..255 "\n " + R_CURLY@255..256 "}" + WHITESPACE@256..257 "\n" + R_CURLY@257..258 "}" + WHITESPACE@258..259 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast index a73ff9c904..67b9c10d54 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0122_generic_lifetime_type_attribute.rast @@ -1,66 +1,66 @@ -SOURCE_FILE@[0; 64) - FN_DEF@[0; 63) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - TYPE_PARAM_LIST@[6; 49) - L_ANGLE@[6; 7) "<" - LIFETIME_PARAM@[7; 29) - ATTR@[7; 26) - POUND@[7; 8) "#" - L_BRACK@[8; 9) "[" - PATH@[9; 15) - PATH_SEGMENT@[9; 15) - NAME_REF@[9; 15) - IDENT@[9; 15) "derive" - TOKEN_TREE@[15; 25) - L_PAREN@[15; 16) "(" - IDENT@[16; 24) "Lifetime" - R_PAREN@[24; 25) ")" - R_BRACK@[25; 26) "]" - WHITESPACE@[26; 27) " " - LIFETIME@[27; 29) "\'a" - COMMA@[29; 30) "," - WHITESPACE@[30; 31) " " - TYPE_PARAM@[31; 48) - ATTR@[31; 46) - POUND@[31; 32) "#" - L_BRACK@[32; 33) "[" - PATH@[33; 39) - PATH_SEGMENT@[33; 39) - NAME_REF@[33; 39) - IDENT@[33; 39) "derive" - TOKEN_TREE@[39; 45) - L_PAREN@[39; 40) "(" - IDENT@[40; 44) "Type" - R_PAREN@[44; 45) ")" - R_BRACK@[45; 46) "]" - WHITESPACE@[46; 47) " " - NAME@[47; 48) - IDENT@[47; 48) "T" - R_ANGLE@[48; 49) ">" - PARAM_LIST@[49; 59) - L_PAREN@[49; 50) "(" - PARAM@[50; 58) - PLACEHOLDER_PAT@[50; 51) - UNDERSCORE@[50; 51) "_" - COLON@[51; 52) ":" - WHITESPACE@[52; 53) " " - REFERENCE_TYPE@[53; 58) - AMP@[53; 54) "&" - LIFETIME@[54; 56) "\'a" - WHITESPACE@[56; 57) " " - PATH_TYPE@[57; 58) - PATH@[57; 58) - PATH_SEGMENT@[57; 58) - NAME_REF@[57; 58) - IDENT@[57; 58) "T" - R_PAREN@[58; 59) ")" - WHITESPACE@[59; 60) " " - BLOCK_EXPR@[60; 63) - BLOCK@[60; 63) - L_CURLY@[60; 61) "{" - WHITESPACE@[61; 62) "\n" - R_CURLY@[62; 63) "}" - WHITESPACE@[63; 64) "\n" +SOURCE_FILE@0..64 + FN_DEF@0..63 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + TYPE_PARAM_LIST@6..49 + L_ANGLE@6..7 "<" + LIFETIME_PARAM@7..29 + ATTR@7..26 + POUND@7..8 "#" + L_BRACK@8..9 "[" + PATH@9..15 + PATH_SEGMENT@9..15 + NAME_REF@9..15 + IDENT@9..15 "derive" + TOKEN_TREE@15..25 + L_PAREN@15..16 "(" + IDENT@16..24 "Lifetime" + R_PAREN@24..25 ")" + R_BRACK@25..26 "]" + WHITESPACE@26..27 " " + LIFETIME@27..29 "\'a" + COMMA@29..30 "," + WHITESPACE@30..31 " " + TYPE_PARAM@31..48 + ATTR@31..46 + POUND@31..32 "#" + L_BRACK@32..33 "[" + PATH@33..39 + PATH_SEGMENT@33..39 + NAME_REF@33..39 + IDENT@33..39 "derive" + TOKEN_TREE@39..45 + L_PAREN@39..40 "(" + IDENT@40..44 "Type" + R_PAREN@44..45 ")" + R_BRACK@45..46 "]" + WHITESPACE@46..47 " " + NAME@47..48 + IDENT@47..48 "T" + R_ANGLE@48..49 ">" + PARAM_LIST@49..59 + L_PAREN@49..50 "(" + PARAM@50..58 + PLACEHOLDER_PAT@50..51 + UNDERSCORE@50..51 "_" + COLON@51..52 ":" + WHITESPACE@52..53 " " + REFERENCE_TYPE@53..58 + AMP@53..54 "&" + LIFETIME@54..56 "\'a" + WHITESPACE@56..57 " " + PATH_TYPE@57..58 + PATH@57..58 + PATH_SEGMENT@57..58 + NAME_REF@57..58 + IDENT@57..58 "T" + R_PAREN@58..59 ")" + WHITESPACE@59..60 " " + BLOCK_EXPR@60..63 + BLOCK@60..63 + L_CURLY@60..61 "{" + WHITESPACE@61..62 "\n" + R_CURLY@62..63 "}" + WHITESPACE@63..64 "\n" 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 af8067b128..b3a33c14df 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 @@ -1,50 +1,50 @@ -SOURCE_FILE@[0; 57) - EXTERN_BLOCK@[0; 56) - ABI@[0; 10) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - STRING@[7; 10) "\"C\"" - WHITESPACE@[10; 11) " " - EXTERN_ITEM_LIST@[11; 56) - L_CURLY@[11; 12) "{" - WHITESPACE@[12; 13) " " - FN_DEF@[13; 54) - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 22) - IDENT@[16; 22) "printf" - PARAM_LIST@[22; 46) - L_PAREN@[22; 23) "(" - PARAM@[23; 40) - BIND_PAT@[23; 29) - NAME@[23; 29) - IDENT@[23; 29) "format" - COLON@[29; 30) ":" - WHITESPACE@[30; 31) " " - POINTER_TYPE@[31; 40) - STAR@[31; 32) "*" - CONST_KW@[32; 37) "const" - WHITESPACE@[37; 38) " " - PATH_TYPE@[38; 40) - PATH@[38; 40) - PATH_SEGMENT@[38; 40) - NAME_REF@[38; 40) - IDENT@[38; 40) "i8" - COMMA@[40; 41) "," - WHITESPACE@[41; 42) " " - PARAM@[42; 45) - DOT3@[42; 45) "..." - R_PAREN@[45; 46) ")" - WHITESPACE@[46; 47) " " - RET_TYPE@[47; 53) - THIN_ARROW@[47; 49) "->" - WHITESPACE@[49; 50) " " - PATH_TYPE@[50; 53) - PATH@[50; 53) - PATH_SEGMENT@[50; 53) - NAME_REF@[50; 53) - IDENT@[50; 53) "i32" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 55) " " - R_CURLY@[55; 56) "}" - WHITESPACE@[56; 57) "\n" +SOURCE_FILE@0..57 + EXTERN_BLOCK@0..56 + ABI@0..10 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + STRING@7..10 "\"C\"" + WHITESPACE@10..11 " " + EXTERN_ITEM_LIST@11..56 + L_CURLY@11..12 "{" + WHITESPACE@12..13 " " + FN_DEF@13..54 + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..22 + IDENT@16..22 "printf" + PARAM_LIST@22..46 + L_PAREN@22..23 "(" + PARAM@23..40 + BIND_PAT@23..29 + NAME@23..29 + IDENT@23..29 "format" + COLON@29..30 ":" + WHITESPACE@30..31 " " + POINTER_TYPE@31..40 + STAR@31..32 "*" + CONST_KW@32..37 "const" + WHITESPACE@37..38 " " + PATH_TYPE@38..40 + PATH@38..40 + PATH_SEGMENT@38..40 + NAME_REF@38..40 + IDENT@38..40 "i8" + COMMA@40..41 "," + WHITESPACE@41..42 " " + PARAM@42..45 + DOT3@42..45 "..." + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + RET_TYPE@47..53 + THIN_ARROW@47..49 "->" + WHITESPACE@49..50 " " + PATH_TYPE@50..53 + PATH@50..53 + PATH_SEGMENT@50..53 + NAME_REF@50..53 + IDENT@50..53 "i32" + SEMICOLON@53..54 ";" + WHITESPACE@54..55 " " + R_CURLY@55..56 "}" + WHITESPACE@56..57 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast index 9c4bd7f11d..baf22a8d75 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0124_async_fn.rast @@ -1,17 +1,17 @@ -SOURCE_FILE@[0; 18) - FN_DEF@[0; 17) - ASYNC_KW@[0; 5) "async" - WHITESPACE@[5; 6) " " - FN_KW@[6; 8) "fn" - WHITESPACE@[8; 9) " " - NAME@[9; 12) - IDENT@[9; 12) "foo" - PARAM_LIST@[12; 14) - L_PAREN@[12; 13) "(" - R_PAREN@[13; 14) ")" - WHITESPACE@[14; 15) " " - BLOCK_EXPR@[15; 17) - BLOCK@[15; 17) - L_CURLY@[15; 16) "{" - R_CURLY@[16; 17) "}" - WHITESPACE@[17; 18) "\n" +SOURCE_FILE@0..18 + FN_DEF@0..17 + ASYNC_KW@0..5 "async" + WHITESPACE@5..6 " " + FN_KW@6..8 "fn" + WHITESPACE@8..9 " " + NAME@9..12 + IDENT@9..12 "foo" + PARAM_LIST@12..14 + L_PAREN@12..13 "(" + R_PAREN@13..14 ")" + WHITESPACE@14..15 " " + BLOCK_EXPR@15..17 + BLOCK@15..17 + L_CURLY@15..16 "{" + R_CURLY@16..17 "}" + WHITESPACE@17..18 "\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 f1f4de976f..16f5b90b6e 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 @@ -1,32 +1,32 @@ -SOURCE_FILE@[0; 27) - FN_DEF@[0; 26) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 26) - BLOCK@[9; 26) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) " " - EXPR_STMT@[11; 24) - CALL_EXPR@[11; 23) - PATH_EXPR@[11; 21) - PATH@[11; 21) - PATH@[11; 16) - PATH_SEGMENT@[11; 16) - CRATE_KW@[11; 16) "crate" - COLON2@[16; 18) "::" - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "foo" - ARG_LIST@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - SEMICOLON@[23; 24) ";" - WHITESPACE@[24; 25) " " - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 27) "\n" +SOURCE_FILE@0..27 + FN_DEF@0..26 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..26 + BLOCK@9..26 + L_CURLY@9..10 "{" + WHITESPACE@10..11 " " + EXPR_STMT@11..24 + CALL_EXPR@11..23 + PATH_EXPR@11..21 + PATH@11..21 + PATH@11..16 + PATH_SEGMENT@11..16 + CRATE_KW@11..16 "crate" + COLON2@16..18 "::" + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "foo" + ARG_LIST@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + SEMICOLON@23..24 ";" + WHITESPACE@24..25 " " + R_CURLY@25..26 "}" + WHITESPACE@26..27 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast index a36c3df0ef..07ed14773b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0125_record_literal_field_with_attr.rast @@ -1,48 +1,48 @@ -SOURCE_FILE@[0; 46) - FN_DEF@[0; 45) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 45) - BLOCK@[10; 45) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - RECORD_LIT@[16; 43) - PATH@[16; 17) - PATH_SEGMENT@[16; 17) - NAME_REF@[16; 17) - IDENT@[16; 17) "S" - WHITESPACE@[17; 18) " " - RECORD_FIELD_LIST@[18; 43) - L_CURLY@[18; 19) "{" - WHITESPACE@[19; 20) " " - RECORD_FIELD@[20; 41) - ATTR@[20; 32) - POUND@[20; 21) "#" - L_BRACK@[21; 22) "[" - PATH@[22; 25) - PATH_SEGMENT@[22; 25) - NAME_REF@[22; 25) - IDENT@[22; 25) "cfg" - TOKEN_TREE@[25; 31) - L_PAREN@[25; 26) "(" - IDENT@[26; 30) "test" - R_PAREN@[30; 31) ")" - R_BRACK@[31; 32) "]" - WHITESPACE@[32; 33) " " - NAME_REF@[33; 38) - IDENT@[33; 38) "field" - COLON@[38; 39) ":" - WHITESPACE@[39; 40) " " - LITERAL@[40; 41) - INT_NUMBER@[40; 41) "1" - WHITESPACE@[41; 42) " " - R_CURLY@[42; 43) "}" - WHITESPACE@[43; 44) "\n" - R_CURLY@[44; 45) "}" - WHITESPACE@[45; 46) "\n" +SOURCE_FILE@0..46 + FN_DEF@0..45 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..45 + BLOCK@10..45 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + RECORD_LIT@16..43 + PATH@16..17 + PATH_SEGMENT@16..17 + NAME_REF@16..17 + IDENT@16..17 "S" + WHITESPACE@17..18 " " + RECORD_FIELD_LIST@18..43 + L_CURLY@18..19 "{" + WHITESPACE@19..20 " " + RECORD_FIELD@20..41 + ATTR@20..32 + POUND@20..21 "#" + L_BRACK@21..22 "[" + PATH@22..25 + PATH_SEGMENT@22..25 + NAME_REF@22..25 + IDENT@22..25 "cfg" + TOKEN_TREE@25..31 + L_PAREN@25..26 "(" + IDENT@26..30 "test" + R_PAREN@30..31 ")" + R_BRACK@31..32 "]" + WHITESPACE@32..33 " " + NAME_REF@33..38 + IDENT@33..38 "field" + COLON@38..39 ":" + WHITESPACE@39..40 " " + LITERAL@40..41 + INT_NUMBER@40..41 "1" + WHITESPACE@41..42 " " + R_CURLY@42..43 "}" + WHITESPACE@43..44 "\n" + R_CURLY@44..45 "}" + WHITESPACE@45..46 "\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 3b462871ab..8307d4c15f 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 @@ -1,99 +1,99 @@ -SOURCE_FILE@[0; 82) - FN_DEF@[0; 81) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 81) - BLOCK@[9; 81) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 26) - ATTR@[15; 19) - POUND@[15; 16) "#" - L_BRACK@[16; 17) "[" - PATH@[17; 18) - PATH_SEGMENT@[17; 18) - NAME_REF@[17; 18) - IDENT@[17; 18) "A" - R_BRACK@[18; 19) "]" - WHITESPACE@[19; 20) " " - CALL_EXPR@[20; 25) - PATH_EXPR@[20; 23) - PATH@[20; 23) - PATH_SEGMENT@[20; 23) - NAME_REF@[20; 23) - IDENT@[20; 23) "foo" - ARG_LIST@[23; 25) - L_PAREN@[23; 24) "(" - R_PAREN@[24; 25) ")" - SEMICOLON@[25; 26) ";" - WHITESPACE@[26; 31) "\n " - EXPR_STMT@[31; 42) - ATTR@[31; 35) - POUND@[31; 32) "#" - L_BRACK@[32; 33) "[" - PATH@[33; 34) - PATH_SEGMENT@[33; 34) - NAME_REF@[33; 34) - IDENT@[33; 34) "B" - R_BRACK@[34; 35) "]" - WHITESPACE@[35; 36) " " - MACRO_CALL@[36; 42) - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "bar" - BANG@[39; 40) "!" - TOKEN_TREE@[40; 42) - L_CURLY@[40; 41) "{" - R_CURLY@[41; 42) "}" - WHITESPACE@[42; 47) "\n " - EXPR_STMT@[47; 59) - ATTR@[47; 51) - POUND@[47; 48) "#" - L_BRACK@[48; 49) "[" - PATH@[49; 50) - PATH_SEGMENT@[49; 50) - NAME_REF@[49; 50) - IDENT@[49; 50) "C" - R_BRACK@[50; 51) "]" - WHITESPACE@[51; 52) " " - ATTR@[52; 56) - POUND@[52; 53) "#" - L_BRACK@[53; 54) "[" - PATH@[54; 55) - PATH_SEGMENT@[54; 55) - NAME_REF@[54; 55) - IDENT@[54; 55) "D" - R_BRACK@[55; 56) "]" - WHITESPACE@[56; 57) " " - BLOCK_EXPR@[57; 59) - BLOCK@[57; 59) - L_CURLY@[57; 58) "{" - R_CURLY@[58; 59) "}" - WHITESPACE@[59; 64) "\n " - EXPR_STMT@[64; 79) - ATTR@[64; 68) - POUND@[64; 65) "#" - L_BRACK@[65; 66) "[" - PATH@[66; 67) - PATH_SEGMENT@[66; 67) - NAME_REF@[66; 67) - IDENT@[66; 67) "D" - R_BRACK@[67; 68) "]" - WHITESPACE@[68; 69) " " - RETURN_EXPR@[69; 78) - RETURN_KW@[69; 75) "return" - WHITESPACE@[75; 76) " " - TUPLE_EXPR@[76; 78) - L_PAREN@[76; 77) "(" - R_PAREN@[77; 78) ")" - SEMICOLON@[78; 79) ";" - WHITESPACE@[79; 80) "\n" - R_CURLY@[80; 81) "}" - WHITESPACE@[81; 82) "\n" +SOURCE_FILE@0..82 + FN_DEF@0..81 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..81 + BLOCK@9..81 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..26 + ATTR@15..19 + POUND@15..16 "#" + L_BRACK@16..17 "[" + PATH@17..18 + PATH_SEGMENT@17..18 + NAME_REF@17..18 + IDENT@17..18 "A" + R_BRACK@18..19 "]" + WHITESPACE@19..20 " " + CALL_EXPR@20..25 + PATH_EXPR@20..23 + PATH@20..23 + PATH_SEGMENT@20..23 + NAME_REF@20..23 + IDENT@20..23 "foo" + ARG_LIST@23..25 + L_PAREN@23..24 "(" + R_PAREN@24..25 ")" + SEMICOLON@25..26 ";" + WHITESPACE@26..31 "\n " + EXPR_STMT@31..42 + ATTR@31..35 + POUND@31..32 "#" + L_BRACK@32..33 "[" + PATH@33..34 + PATH_SEGMENT@33..34 + NAME_REF@33..34 + IDENT@33..34 "B" + R_BRACK@34..35 "]" + WHITESPACE@35..36 " " + MACRO_CALL@36..42 + PATH@36..39 + PATH_SEGMENT@36..39 + NAME_REF@36..39 + IDENT@36..39 "bar" + BANG@39..40 "!" + TOKEN_TREE@40..42 + L_CURLY@40..41 "{" + R_CURLY@41..42 "}" + WHITESPACE@42..47 "\n " + EXPR_STMT@47..59 + ATTR@47..51 + POUND@47..48 "#" + L_BRACK@48..49 "[" + PATH@49..50 + PATH_SEGMENT@49..50 + NAME_REF@49..50 + IDENT@49..50 "C" + R_BRACK@50..51 "]" + WHITESPACE@51..52 " " + ATTR@52..56 + POUND@52..53 "#" + L_BRACK@53..54 "[" + PATH@54..55 + PATH_SEGMENT@54..55 + NAME_REF@54..55 + IDENT@54..55 "D" + R_BRACK@55..56 "]" + WHITESPACE@56..57 " " + BLOCK_EXPR@57..59 + BLOCK@57..59 + L_CURLY@57..58 "{" + R_CURLY@58..59 "}" + WHITESPACE@59..64 "\n " + EXPR_STMT@64..79 + ATTR@64..68 + POUND@64..65 "#" + L_BRACK@65..66 "[" + PATH@66..67 + PATH_SEGMENT@66..67 + NAME_REF@66..67 + IDENT@66..67 "D" + R_BRACK@67..68 "]" + WHITESPACE@68..69 " " + RETURN_EXPR@69..78 + RETURN_KW@69..75 "return" + WHITESPACE@75..76 " " + TUPLE_EXPR@76..78 + L_PAREN@76..77 "(" + R_PAREN@77..78 ")" + SEMICOLON@78..79 ";" + WHITESPACE@79..80 "\n" + R_CURLY@80..81 "}" + 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 9bc6be62df..19c47ea25c 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 @@ -1,59 +1,59 @@ -SOURCE_FILE@[0; 47) - FN_DEF@[0; 46) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 46) - BLOCK@[9; 46) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 31) - BLOCK_EXPR@[15; 31) - BLOCK@[15; 31) - L_CURLY@[15; 16) "{" - WHITESPACE@[16; 17) " " - TRY_EXPR@[17; 29) - ATTR@[17; 21) - POUND@[17; 18) "#" - L_BRACK@[18; 19) "[" - PATH@[19; 20) - PATH_SEGMENT@[19; 20) - NAME_REF@[19; 20) - IDENT@[19; 20) "A" - R_BRACK@[20; 21) "]" - WHITESPACE@[21; 22) " " - MACRO_CALL@[22; 28) - PATH@[22; 25) - PATH_SEGMENT@[22; 25) - NAME_REF@[22; 25) - IDENT@[22; 25) "bar" - BANG@[25; 26) "!" - TOKEN_TREE@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - QUESTION@[28; 29) "?" - WHITESPACE@[29; 30) " " - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 36) "\n " - REF_EXPR@[36; 44) - ATTR@[36; 40) - POUND@[36; 37) "#" - L_BRACK@[37; 38) "[" - PATH@[38; 39) - PATH_SEGMENT@[38; 39) - NAME_REF@[38; 39) - IDENT@[38; 39) "B" - R_BRACK@[39; 40) "]" - WHITESPACE@[40; 41) " " - AMP@[41; 42) "&" - TUPLE_EXPR@[42; 44) - L_PAREN@[42; 43) "(" - R_PAREN@[43; 44) ")" - WHITESPACE@[44; 45) "\n" - R_CURLY@[45; 46) "}" - WHITESPACE@[46; 47) "\n" +SOURCE_FILE@0..47 + FN_DEF@0..46 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..46 + BLOCK@9..46 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..31 + BLOCK_EXPR@15..31 + BLOCK@15..31 + L_CURLY@15..16 "{" + WHITESPACE@16..17 " " + TRY_EXPR@17..29 + ATTR@17..21 + POUND@17..18 "#" + L_BRACK@18..19 "[" + PATH@19..20 + PATH_SEGMENT@19..20 + NAME_REF@19..20 + IDENT@19..20 "A" + R_BRACK@20..21 "]" + WHITESPACE@21..22 " " + MACRO_CALL@22..28 + PATH@22..25 + PATH_SEGMENT@22..25 + NAME_REF@22..25 + IDENT@22..25 "bar" + BANG@25..26 "!" + TOKEN_TREE@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + QUESTION@28..29 "?" + WHITESPACE@29..30 " " + R_CURLY@30..31 "}" + WHITESPACE@31..36 "\n " + REF_EXPR@36..44 + ATTR@36..40 + POUND@36..37 "#" + L_BRACK@37..38 "[" + PATH@38..39 + PATH_SEGMENT@38..39 + NAME_REF@38..39 + IDENT@38..39 "B" + R_BRACK@39..40 "]" + WHITESPACE@40..41 " " + AMP@41..42 "&" + TUPLE_EXPR@42..44 + L_PAREN@42..43 "(" + R_PAREN@43..44 ")" + WHITESPACE@44..45 "\n" + R_CURLY@45..46 "}" + WHITESPACE@46..47 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast index 8a972cdb25..5630b20af5 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0128_combined_fns.rast @@ -1,37 +1,37 @@ -SOURCE_FILE@[0; 50) - FN_DEF@[0; 24) - ASYNC_KW@[0; 5) "async" - WHITESPACE@[5; 6) " " - UNSAFE_KW@[6; 12) "unsafe" - WHITESPACE@[12; 13) " " - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 19) - IDENT@[16; 19) "foo" - PARAM_LIST@[19; 21) - L_PAREN@[19; 20) "(" - R_PAREN@[20; 21) ")" - WHITESPACE@[21; 22) " " - BLOCK_EXPR@[22; 24) - BLOCK@[22; 24) - L_CURLY@[22; 23) "{" - R_CURLY@[23; 24) "}" - WHITESPACE@[24; 25) "\n" - FN_DEF@[25; 49) - CONST_KW@[25; 30) "const" - WHITESPACE@[30; 31) " " - UNSAFE_KW@[31; 37) "unsafe" - WHITESPACE@[37; 38) " " - FN_KW@[38; 40) "fn" - WHITESPACE@[40; 41) " " - NAME@[41; 44) - IDENT@[41; 44) "bar" - PARAM_LIST@[44; 46) - L_PAREN@[44; 45) "(" - R_PAREN@[45; 46) ")" - WHITESPACE@[46; 47) " " - BLOCK_EXPR@[47; 49) - BLOCK@[47; 49) - L_CURLY@[47; 48) "{" - R_CURLY@[48; 49) "}" - WHITESPACE@[49; 50) "\n" +SOURCE_FILE@0..50 + FN_DEF@0..24 + ASYNC_KW@0..5 "async" + WHITESPACE@5..6 " " + UNSAFE_KW@6..12 "unsafe" + WHITESPACE@12..13 " " + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..19 + IDENT@16..19 "foo" + PARAM_LIST@19..21 + L_PAREN@19..20 "(" + R_PAREN@20..21 ")" + WHITESPACE@21..22 " " + BLOCK_EXPR@22..24 + BLOCK@22..24 + L_CURLY@22..23 "{" + R_CURLY@23..24 "}" + WHITESPACE@24..25 "\n" + FN_DEF@25..49 + CONST_KW@25..30 "const" + WHITESPACE@30..31 " " + UNSAFE_KW@31..37 "unsafe" + WHITESPACE@37..38 " " + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + NAME@41..44 + IDENT@41..44 "bar" + PARAM_LIST@44..46 + L_PAREN@44..45 "(" + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + BLOCK_EXPR@47..49 + BLOCK@47..49 + L_CURLY@47..48 "{" + R_CURLY@48..49 "}" + WHITESPACE@49..50 "\n" 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 31481d2f9e..4946ee050a 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 @@ -1,37 +1,37 @@ -SOURCE_FILE@[0; 33) - FN_DEF@[0; 32) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 32) - BLOCK@[10; 32) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 30) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - MACRO_PAT@[20; 25) - MACRO_CALL@[20; 25) - PATH@[20; 21) - PATH_SEGMENT@[20; 21) - NAME_REF@[20; 21) - IDENT@[20; 21) "m" - BANG@[21; 22) "!" - TOKEN_TREE@[22; 25) - L_PAREN@[22; 23) "(" - IDENT@[23; 24) "x" - R_PAREN@[24; 25) ")" - WHITESPACE@[25; 26) " " - EQ@[26; 27) "=" - WHITESPACE@[27; 28) " " - LITERAL@[28; 29) - INT_NUMBER@[28; 29) "0" - SEMICOLON@[29; 30) ";" - WHITESPACE@[30; 31) "\n" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" +SOURCE_FILE@0..33 + FN_DEF@0..32 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..32 + BLOCK@10..32 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..30 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + MACRO_PAT@20..25 + MACRO_CALL@20..25 + PATH@20..21 + PATH_SEGMENT@20..21 + NAME_REF@20..21 + IDENT@20..21 "m" + BANG@21..22 "!" + TOKEN_TREE@22..25 + L_PAREN@22..23 "(" + IDENT@23..24 "x" + R_PAREN@24..25 ")" + WHITESPACE@25..26 " " + EQ@26..27 "=" + WHITESPACE@27..28 " " + LITERAL@28..29 + INT_NUMBER@28..29 "0" + SEMICOLON@29..30 ";" + WHITESPACE@30..31 "\n" + R_CURLY@31..32 "}" + 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 1f2690c001..18fdd9dc91 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 @@ -1,129 +1,129 @@ -SOURCE_FILE@[0; 135) - FN_DEF@[0; 134) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 134) - BLOCK@[9; 134) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 21) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - BIND_PAT@[19; 20) - NAME@[19; 20) - IDENT@[19; 20) "a" - SEMICOLON@[20; 21) ";" - WHITESPACE@[21; 26) "\n " - LET_STMT@[26; 37) - LET_KW@[26; 29) "let" - WHITESPACE@[29; 30) " " - BIND_PAT@[30; 31) - NAME@[30; 31) - IDENT@[30; 31) "b" - COLON@[31; 32) ":" - WHITESPACE@[32; 33) " " - PATH_TYPE@[33; 36) - PATH@[33; 36) - PATH_SEGMENT@[33; 36) - NAME_REF@[33; 36) - IDENT@[33; 36) "i32" - SEMICOLON@[36; 37) ";" - WHITESPACE@[37; 42) "\n " - LET_STMT@[42; 53) - LET_KW@[42; 45) "let" - WHITESPACE@[45; 46) " " - BIND_PAT@[46; 47) - NAME@[46; 47) - IDENT@[46; 47) "c" - WHITESPACE@[47; 48) " " - EQ@[48; 49) "=" - WHITESPACE@[49; 50) " " - LITERAL@[50; 52) - INT_NUMBER@[50; 52) "92" - SEMICOLON@[52; 53) ";" - WHITESPACE@[53; 58) "\n " - LET_STMT@[58; 74) - LET_KW@[58; 61) "let" - WHITESPACE@[61; 62) " " - BIND_PAT@[62; 63) - NAME@[62; 63) - IDENT@[62; 63) "d" - COLON@[63; 64) ":" - WHITESPACE@[64; 65) " " - PATH_TYPE@[65; 68) - PATH@[65; 68) - PATH_SEGMENT@[65; 68) - NAME_REF@[65; 68) - IDENT@[65; 68) "i32" - WHITESPACE@[68; 69) " " - EQ@[69; 70) "=" - WHITESPACE@[70; 71) " " - LITERAL@[71; 73) - INT_NUMBER@[71; 73) "92" - SEMICOLON@[73; 74) ";" - WHITESPACE@[74; 79) "\n " - LET_STMT@[79; 88) - LET_KW@[79; 82) "let" - WHITESPACE@[82; 83) " " - BIND_PAT@[83; 84) - NAME@[83; 84) - IDENT@[83; 84) "e" - COLON@[84; 85) ":" - WHITESPACE@[85; 86) " " - NEVER_TYPE@[86; 87) - BANG@[86; 87) "!" - SEMICOLON@[87; 88) ";" - WHITESPACE@[88; 93) "\n " - LET_STMT@[93; 107) - LET_KW@[93; 96) "let" - WHITESPACE@[96; 97) " " - PLACEHOLDER_PAT@[97; 98) - UNDERSCORE@[97; 98) "_" - COLON@[98; 99) ":" - WHITESPACE@[99; 100) " " - NEVER_TYPE@[100; 101) - BANG@[100; 101) "!" - WHITESPACE@[101; 102) " " - EQ@[102; 103) "=" - WHITESPACE@[103; 104) " " - BLOCK_EXPR@[104; 106) - BLOCK@[104; 106) - L_CURLY@[104; 105) "{" - R_CURLY@[105; 106) "}" - SEMICOLON@[106; 107) ";" - WHITESPACE@[107; 112) "\n " - LET_STMT@[112; 132) - LET_KW@[112; 115) "let" - WHITESPACE@[115; 116) " " - BIND_PAT@[116; 117) - NAME@[116; 117) - IDENT@[116; 117) "f" - WHITESPACE@[117; 118) " " - EQ@[118; 119) "=" - WHITESPACE@[119; 120) " " - LAMBDA_EXPR@[120; 131) - ATTR@[120; 127) - POUND@[120; 121) "#" - L_BRACK@[121; 122) "[" - PATH@[122; 126) - PATH_SEGMENT@[122; 126) - NAME_REF@[122; 126) - IDENT@[122; 126) "attr" - R_BRACK@[126; 127) "]" - PARAM_LIST@[127; 129) - PIPE@[127; 128) "|" - PIPE@[128; 129) "|" - BLOCK_EXPR@[129; 131) - BLOCK@[129; 131) - L_CURLY@[129; 130) "{" - R_CURLY@[130; 131) "}" - SEMICOLON@[131; 132) ";" - WHITESPACE@[132; 133) "\n" - R_CURLY@[133; 134) "}" - WHITESPACE@[134; 135) "\n" +SOURCE_FILE@0..135 + FN_DEF@0..134 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..134 + BLOCK@9..134 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..21 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + BIND_PAT@19..20 + NAME@19..20 + IDENT@19..20 "a" + SEMICOLON@20..21 ";" + WHITESPACE@21..26 "\n " + LET_STMT@26..37 + LET_KW@26..29 "let" + WHITESPACE@29..30 " " + BIND_PAT@30..31 + NAME@30..31 + IDENT@30..31 "b" + COLON@31..32 ":" + WHITESPACE@32..33 " " + PATH_TYPE@33..36 + PATH@33..36 + PATH_SEGMENT@33..36 + NAME_REF@33..36 + IDENT@33..36 "i32" + SEMICOLON@36..37 ";" + WHITESPACE@37..42 "\n " + LET_STMT@42..53 + LET_KW@42..45 "let" + WHITESPACE@45..46 " " + BIND_PAT@46..47 + NAME@46..47 + IDENT@46..47 "c" + WHITESPACE@47..48 " " + EQ@48..49 "=" + WHITESPACE@49..50 " " + LITERAL@50..52 + INT_NUMBER@50..52 "92" + SEMICOLON@52..53 ";" + WHITESPACE@53..58 "\n " + LET_STMT@58..74 + LET_KW@58..61 "let" + WHITESPACE@61..62 " " + BIND_PAT@62..63 + NAME@62..63 + IDENT@62..63 "d" + COLON@63..64 ":" + WHITESPACE@64..65 " " + PATH_TYPE@65..68 + PATH@65..68 + PATH_SEGMENT@65..68 + NAME_REF@65..68 + IDENT@65..68 "i32" + WHITESPACE@68..69 " " + EQ@69..70 "=" + WHITESPACE@70..71 " " + LITERAL@71..73 + INT_NUMBER@71..73 "92" + SEMICOLON@73..74 ";" + WHITESPACE@74..79 "\n " + LET_STMT@79..88 + LET_KW@79..82 "let" + WHITESPACE@82..83 " " + BIND_PAT@83..84 + NAME@83..84 + IDENT@83..84 "e" + COLON@84..85 ":" + WHITESPACE@85..86 " " + NEVER_TYPE@86..87 + BANG@86..87 "!" + SEMICOLON@87..88 ";" + WHITESPACE@88..93 "\n " + LET_STMT@93..107 + LET_KW@93..96 "let" + WHITESPACE@96..97 " " + PLACEHOLDER_PAT@97..98 + UNDERSCORE@97..98 "_" + COLON@98..99 ":" + WHITESPACE@99..100 " " + NEVER_TYPE@100..101 + BANG@100..101 "!" + WHITESPACE@101..102 " " + EQ@102..103 "=" + WHITESPACE@103..104 " " + BLOCK_EXPR@104..106 + BLOCK@104..106 + L_CURLY@104..105 "{" + R_CURLY@105..106 "}" + SEMICOLON@106..107 ";" + WHITESPACE@107..112 "\n " + LET_STMT@112..132 + LET_KW@112..115 "let" + WHITESPACE@115..116 " " + BIND_PAT@116..117 + NAME@116..117 + IDENT@116..117 "f" + WHITESPACE@117..118 " " + EQ@118..119 "=" + WHITESPACE@119..120 " " + LAMBDA_EXPR@120..131 + ATTR@120..127 + POUND@120..121 "#" + L_BRACK@121..122 "[" + PATH@122..126 + PATH_SEGMENT@122..126 + NAME_REF@122..126 + IDENT@122..126 "attr" + R_BRACK@126..127 "]" + PARAM_LIST@127..129 + PIPE@127..128 "|" + PIPE@128..129 "|" + BLOCK_EXPR@129..131 + BLOCK@129..131 + L_CURLY@129..130 "{" + R_CURLY@130..131 "}" + SEMICOLON@131..132 ";" + WHITESPACE@132..133 "\n" + R_CURLY@133..134 "}" + 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 b96991035c..01fffd7b03 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 @@ -1,33 +1,33 @@ -SOURCE_FILE@[0; 33) - FN_DEF@[0; 32) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 32) - BLOCK@[9; 32) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 30) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - TRY_EXPR@[23; 29) - TRY_KW@[23; 26) "try" - WHITESPACE@[26; 27) " " - BLOCK_EXPR@[27; 29) - BLOCK@[27; 29) - L_CURLY@[27; 28) "{" - R_CURLY@[28; 29) "}" - SEMICOLON@[29; 30) ";" - WHITESPACE@[30; 31) "\n" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" +SOURCE_FILE@0..33 + FN_DEF@0..32 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..32 + BLOCK@9..32 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..30 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + TRY_EXPR@23..29 + TRY_KW@23..26 "try" + WHITESPACE@26..27 " " + BLOCK_EXPR@27..29 + BLOCK@27..29 + L_CURLY@27..28 "{" + R_CURLY@28..29 "}" + SEMICOLON@29..30 ";" + WHITESPACE@30..31 "\n" + R_CURLY@31..32 "}" + 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 ed3d8fb0b1..4a1c2b3a46 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 @@ -1,31 +1,31 @@ -SOURCE_FILE@[0; 37) - TYPE_ALIAS_DEF@[0; 36) - EXISTENTIAL_KW@[0; 11) "existential" - WHITESPACE@[11; 12) " " - TYPE_KW@[12; 16) "type" - WHITESPACE@[16; 17) " " - NAME@[17; 20) - IDENT@[17; 20) "Foo" - COLON@[20; 21) ":" - WHITESPACE@[21; 22) " " - TYPE_BOUND_LIST@[22; 35) - TYPE_BOUND@[22; 35) - PATH_TYPE@[22; 35) - PATH@[22; 35) - PATH_SEGMENT@[22; 35) - NAME_REF@[22; 24) - IDENT@[22; 24) "Fn" - PARAM_LIST@[24; 26) - L_PAREN@[24; 25) "(" - R_PAREN@[25; 26) ")" - WHITESPACE@[26; 27) " " - RET_TYPE@[27; 35) - THIN_ARROW@[27; 29) "->" - WHITESPACE@[29; 30) " " - PATH_TYPE@[30; 35) - PATH@[30; 35) - PATH_SEGMENT@[30; 35) - NAME_REF@[30; 35) - IDENT@[30; 35) "usize" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 37) "\n" +SOURCE_FILE@0..37 + TYPE_ALIAS_DEF@0..36 + EXISTENTIAL_KW@0..11 "existential" + WHITESPACE@11..12 " " + TYPE_KW@12..16 "type" + WHITESPACE@16..17 " " + NAME@17..20 + IDENT@17..20 "Foo" + COLON@20..21 ":" + WHITESPACE@21..22 " " + TYPE_BOUND_LIST@22..35 + TYPE_BOUND@22..35 + PATH_TYPE@22..35 + PATH@22..35 + PATH_SEGMENT@22..35 + NAME_REF@22..24 + IDENT@22..24 "Fn" + PARAM_LIST@24..26 + L_PAREN@24..25 "(" + R_PAREN@25..26 ")" + WHITESPACE@26..27 " " + RET_TYPE@27..35 + THIN_ARROW@27..29 "->" + WHITESPACE@29..30 " " + PATH_TYPE@30..35 + PATH@30..35 + PATH_SEGMENT@30..35 + NAME_REF@30..35 + IDENT@30..35 "usize" + SEMICOLON@35..36 ";" + 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 c392a7d84f..498b3121e6 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 @@ -1,90 +1,90 @@ -SOURCE_FILE@[0; 106) - FN_DEF@[0; 105) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 105) - BLOCK@[9; 105) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 32) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - BIND_PAT@[19; 20) - NAME@[19; 20) - IDENT@[19; 20) "x" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - BOX_EXPR@[23; 31) - BOX_KW@[23; 26) "box" - WHITESPACE@[26; 27) " " - LITERAL@[27; 31) - INT_NUMBER@[27; 31) "1i32" - SEMICOLON@[31; 32) ";" - WHITESPACE@[32; 37) "\n " - LET_STMT@[37; 66) - LET_KW@[37; 40) "let" - WHITESPACE@[40; 41) " " - BIND_PAT@[41; 42) - NAME@[41; 42) - IDENT@[41; 42) "y" - WHITESPACE@[42; 43) " " - EQ@[43; 44) "=" - WHITESPACE@[44; 45) " " - TUPLE_EXPR@[45; 65) - L_PAREN@[45; 46) "(" - BOX_EXPR@[46; 54) - BOX_KW@[46; 49) "box" - WHITESPACE@[49; 50) " " - LITERAL@[50; 54) - INT_NUMBER@[50; 54) "1i32" - COMMA@[54; 55) "," - WHITESPACE@[55; 56) " " - BOX_EXPR@[56; 64) - BOX_KW@[56; 59) "box" - WHITESPACE@[59; 60) " " - LITERAL@[60; 64) - INT_NUMBER@[60; 64) "2i32" - R_PAREN@[64; 65) ")" - SEMICOLON@[65; 66) ";" - WHITESPACE@[66; 71) "\n " - LET_STMT@[71; 103) - LET_KW@[71; 74) "let" - WHITESPACE@[74; 75) " " - BIND_PAT@[75; 76) - NAME@[75; 76) - IDENT@[75; 76) "z" - WHITESPACE@[76; 77) " " - EQ@[77; 78) "=" - WHITESPACE@[78; 79) " " - CALL_EXPR@[79; 102) - PATH_EXPR@[79; 82) - PATH@[79; 82) - PATH_SEGMENT@[79; 82) - NAME_REF@[79; 82) - IDENT@[79; 82) "Foo" - ARG_LIST@[82; 102) - L_PAREN@[82; 83) "(" - BOX_EXPR@[83; 91) - BOX_KW@[83; 86) "box" - WHITESPACE@[86; 87) " " - LITERAL@[87; 91) - INT_NUMBER@[87; 91) "1i32" - COMMA@[91; 92) "," - WHITESPACE@[92; 93) " " - BOX_EXPR@[93; 101) - BOX_KW@[93; 96) "box" - WHITESPACE@[96; 97) " " - LITERAL@[97; 101) - INT_NUMBER@[97; 101) "2i32" - R_PAREN@[101; 102) ")" - SEMICOLON@[102; 103) ";" - WHITESPACE@[103; 104) "\n" - R_CURLY@[104; 105) "}" - WHITESPACE@[105; 106) "\n" +SOURCE_FILE@0..106 + FN_DEF@0..105 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..105 + BLOCK@9..105 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..32 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + BIND_PAT@19..20 + NAME@19..20 + IDENT@19..20 "x" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + BOX_EXPR@23..31 + BOX_KW@23..26 "box" + WHITESPACE@26..27 " " + LITERAL@27..31 + INT_NUMBER@27..31 "1i32" + SEMICOLON@31..32 ";" + WHITESPACE@32..37 "\n " + LET_STMT@37..66 + LET_KW@37..40 "let" + WHITESPACE@40..41 " " + BIND_PAT@41..42 + NAME@41..42 + IDENT@41..42 "y" + WHITESPACE@42..43 " " + EQ@43..44 "=" + WHITESPACE@44..45 " " + TUPLE_EXPR@45..65 + L_PAREN@45..46 "(" + BOX_EXPR@46..54 + BOX_KW@46..49 "box" + WHITESPACE@49..50 " " + LITERAL@50..54 + INT_NUMBER@50..54 "1i32" + COMMA@54..55 "," + WHITESPACE@55..56 " " + BOX_EXPR@56..64 + BOX_KW@56..59 "box" + WHITESPACE@59..60 " " + LITERAL@60..64 + INT_NUMBER@60..64 "2i32" + R_PAREN@64..65 ")" + SEMICOLON@65..66 ";" + WHITESPACE@66..71 "\n " + LET_STMT@71..103 + LET_KW@71..74 "let" + WHITESPACE@74..75 " " + BIND_PAT@75..76 + NAME@75..76 + IDENT@75..76 "z" + WHITESPACE@76..77 " " + EQ@77..78 "=" + WHITESPACE@78..79 " " + CALL_EXPR@79..102 + PATH_EXPR@79..82 + PATH@79..82 + PATH_SEGMENT@79..82 + NAME_REF@79..82 + IDENT@79..82 "Foo" + ARG_LIST@82..102 + L_PAREN@82..83 "(" + BOX_EXPR@83..91 + BOX_KW@83..86 "box" + WHITESPACE@86..87 " " + LITERAL@87..91 + INT_NUMBER@87..91 "1i32" + COMMA@91..92 "," + WHITESPACE@92..93 " " + BOX_EXPR@93..101 + BOX_KW@93..96 "box" + WHITESPACE@96..97 " " + LITERAL@97..101 + INT_NUMBER@97..101 "2i32" + R_PAREN@101..102 ")" + SEMICOLON@102..103 ";" + WHITESPACE@103..104 "\n" + R_CURLY@104..105 "}" + 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 cff03fcf37..db58a928ec 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 @@ -1,56 +1,56 @@ -SOURCE_FILE@[0; 69) - IMPL_DEF@[0; 68) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "T" - WHITESPACE@[6; 7) " " - FOR_KW@[7; 10) "for" - WHITESPACE@[10; 11) " " - PATH_TYPE@[11; 14) - PATH@[11; 14) - PATH_SEGMENT@[11; 14) - NAME_REF@[11; 14) - IDENT@[11; 14) "Foo" - WHITESPACE@[14; 15) " " - ITEM_LIST@[15; 68) - L_CURLY@[15; 16) "{" - WHITESPACE@[16; 21) "\n " - TYPE_ALIAS_DEF@[21; 42) - DEFAULT_KW@[21; 28) "default" - WHITESPACE@[28; 29) " " - TYPE_KW@[29; 33) "type" - WHITESPACE@[33; 34) " " - NAME@[34; 35) - IDENT@[34; 35) "T" - WHITESPACE@[35; 36) " " - EQ@[36; 37) "=" - WHITESPACE@[37; 38) " " - PATH_TYPE@[38; 41) - PATH@[38; 41) - PATH_SEGMENT@[38; 41) - NAME_REF@[38; 41) - IDENT@[38; 41) "Bar" - SEMICOLON@[41; 42) ";" - WHITESPACE@[42; 47) "\n " - FN_DEF@[47; 66) - DEFAULT_KW@[47; 54) "default" - WHITESPACE@[54; 55) " " - FN_KW@[55; 57) "fn" - WHITESPACE@[57; 58) " " - NAME@[58; 61) - IDENT@[58; 61) "foo" - PARAM_LIST@[61; 63) - L_PAREN@[61; 62) "(" - R_PAREN@[62; 63) ")" - WHITESPACE@[63; 64) " " - BLOCK_EXPR@[64; 66) - BLOCK@[64; 66) - L_CURLY@[64; 65) "{" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 67) "\n" - R_CURLY@[67; 68) "}" - WHITESPACE@[68; 69) "\n" +SOURCE_FILE@0..69 + IMPL_DEF@0..68 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "T" + WHITESPACE@6..7 " " + FOR_KW@7..10 "for" + WHITESPACE@10..11 " " + PATH_TYPE@11..14 + PATH@11..14 + PATH_SEGMENT@11..14 + NAME_REF@11..14 + IDENT@11..14 "Foo" + WHITESPACE@14..15 " " + ITEM_LIST@15..68 + L_CURLY@15..16 "{" + WHITESPACE@16..21 "\n " + TYPE_ALIAS_DEF@21..42 + DEFAULT_KW@21..28 "default" + WHITESPACE@28..29 " " + TYPE_KW@29..33 "type" + WHITESPACE@33..34 " " + NAME@34..35 + IDENT@34..35 "T" + WHITESPACE@35..36 " " + EQ@36..37 "=" + WHITESPACE@37..38 " " + PATH_TYPE@38..41 + PATH@38..41 + PATH_SEGMENT@38..41 + NAME_REF@38..41 + IDENT@38..41 "Bar" + SEMICOLON@41..42 ";" + WHITESPACE@42..47 "\n " + FN_DEF@47..66 + DEFAULT_KW@47..54 "default" + WHITESPACE@54..55 " " + FN_KW@55..57 "fn" + WHITESPACE@57..58 " " + NAME@58..61 + IDENT@58..61 "foo" + PARAM_LIST@61..63 + L_PAREN@61..62 "(" + R_PAREN@62..63 ")" + WHITESPACE@63..64 " " + BLOCK_EXPR@64..66 + BLOCK@64..66 + L_CURLY@64..65 "{" + R_CURLY@65..66 "}" + WHITESPACE@66..67 "\n" + R_CURLY@67..68 "}" + WHITESPACE@68..69 "\n" 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 f66f32370b..4ca554ef82 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 @@ -1,64 +1,64 @@ -SOURCE_FILE@[0; 111) - FN_DEF@[0; 110) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 18) - IDENT@[3; 18) "simple_function" - PARAM_LIST@[18; 20) - L_PAREN@[18; 19) "(" - R_PAREN@[19; 20) ")" - WHITESPACE@[20; 21) " " - BLOCK_EXPR@[21; 110) - BLOCK@[21; 110) - L_CURLY@[21; 22) "{" - WHITESPACE@[22; 27) "\n " - ENUM_DEF@[27; 75) - ENUM_KW@[27; 31) "enum" - WHITESPACE@[31; 32) " " - NAME@[32; 41) - IDENT@[32; 41) "LocalEnum" - WHITESPACE@[41; 42) " " - ENUM_VARIANT_LIST@[42; 75) - L_CURLY@[42; 43) "{" - WHITESPACE@[43; 52) "\n " - ENUM_VARIANT@[52; 55) - NAME@[52; 55) - IDENT@[52; 55) "One" - COMMA@[55; 56) "," - WHITESPACE@[56; 65) "\n " - ENUM_VARIANT@[65; 68) - NAME@[65; 68) - IDENT@[65; 68) "Two" - COMMA@[68; 69) "," - WHITESPACE@[69; 74) "\n " - R_CURLY@[74; 75) "}" - SEMICOLON@[75; 76) ";" - WHITESPACE@[76; 81) "\n " - FN_DEF@[81; 90) - FN_KW@[81; 83) "fn" - WHITESPACE@[83; 84) " " - NAME@[84; 85) - IDENT@[84; 85) "f" - PARAM_LIST@[85; 87) - L_PAREN@[85; 86) "(" - R_PAREN@[86; 87) ")" - WHITESPACE@[87; 88) " " - BLOCK_EXPR@[88; 90) - BLOCK@[88; 90) - L_CURLY@[88; 89) "{" - R_CURLY@[89; 90) "}" - SEMICOLON@[90; 91) ";" - WHITESPACE@[91; 96) "\n " - STRUCT_DEF@[96; 107) - STRUCT_KW@[96; 102) "struct" - WHITESPACE@[102; 103) " " - NAME@[103; 104) - IDENT@[103; 104) "S" - WHITESPACE@[104; 105) " " - RECORD_FIELD_DEF_LIST@[105; 107) - L_CURLY@[105; 106) "{" - R_CURLY@[106; 107) "}" - SEMICOLON@[107; 108) ";" - WHITESPACE@[108; 109) "\n" - R_CURLY@[109; 110) "}" - WHITESPACE@[110; 111) "\n" +SOURCE_FILE@0..111 + FN_DEF@0..110 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..18 + IDENT@3..18 "simple_function" + PARAM_LIST@18..20 + L_PAREN@18..19 "(" + R_PAREN@19..20 ")" + WHITESPACE@20..21 " " + BLOCK_EXPR@21..110 + BLOCK@21..110 + L_CURLY@21..22 "{" + WHITESPACE@22..27 "\n " + ENUM_DEF@27..75 + ENUM_KW@27..31 "enum" + WHITESPACE@31..32 " " + NAME@32..41 + IDENT@32..41 "LocalEnum" + WHITESPACE@41..42 " " + ENUM_VARIANT_LIST@42..75 + L_CURLY@42..43 "{" + WHITESPACE@43..52 "\n " + ENUM_VARIANT@52..55 + NAME@52..55 + IDENT@52..55 "One" + COMMA@55..56 "," + WHITESPACE@56..65 "\n " + ENUM_VARIANT@65..68 + NAME@65..68 + IDENT@65..68 "Two" + COMMA@68..69 "," + WHITESPACE@69..74 "\n " + R_CURLY@74..75 "}" + SEMICOLON@75..76 ";" + WHITESPACE@76..81 "\n " + FN_DEF@81..90 + FN_KW@81..83 "fn" + WHITESPACE@83..84 " " + NAME@84..85 + IDENT@84..85 "f" + PARAM_LIST@85..87 + L_PAREN@85..86 "(" + R_PAREN@86..87 ")" + WHITESPACE@87..88 " " + BLOCK_EXPR@88..90 + BLOCK@88..90 + L_CURLY@88..89 "{" + R_CURLY@89..90 "}" + SEMICOLON@90..91 ";" + WHITESPACE@91..96 "\n " + STRUCT_DEF@96..107 + STRUCT_KW@96..102 "struct" + WHITESPACE@102..103 " " + NAME@103..104 + IDENT@103..104 "S" + WHITESPACE@104..105 " " + RECORD_FIELD_DEF_LIST@105..107 + L_CURLY@105..106 "{" + R_CURLY@106..107 "}" + SEMICOLON@107..108 ";" + WHITESPACE@108..109 "\n" + R_CURLY@109..110 "}" + 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 4946e6325f..7fa3b9f32f 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 @@ -1,70 +1,70 @@ -SOURCE_FILE@[0; 67) - FN_DEF@[0; 66) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 66) - BLOCK@[9; 66) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 23) - AWAIT_EXPR@[15; 22) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "x" - DOT@[16; 17) "." - AWAIT_KW@[17; 22) "await" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 28) "\n " - EXPR_STMT@[28; 38) - AWAIT_EXPR@[28; 37) - FIELD_EXPR@[28; 31) - PATH_EXPR@[28; 29) - PATH@[28; 29) - PATH_SEGMENT@[28; 29) - NAME_REF@[28; 29) - IDENT@[28; 29) "x" - DOT@[29; 30) "." - NAME_REF@[30; 31) - INT_NUMBER@[30; 31) "0" - DOT@[31; 32) "." - AWAIT_KW@[32; 37) "await" - SEMICOLON@[37; 38) ";" - WHITESPACE@[38; 43) "\n " - EXPR_STMT@[43; 64) - METHOD_CALL_EXPR@[43; 63) - TRY_EXPR@[43; 55) - AWAIT_EXPR@[43; 54) - CALL_EXPR@[43; 48) - FIELD_EXPR@[43; 46) - PATH_EXPR@[43; 44) - PATH@[43; 44) - PATH_SEGMENT@[43; 44) - NAME_REF@[43; 44) - IDENT@[43; 44) "x" - DOT@[44; 45) "." - NAME_REF@[45; 46) - INT_NUMBER@[45; 46) "0" - ARG_LIST@[46; 48) - L_PAREN@[46; 47) "(" - R_PAREN@[47; 48) ")" - DOT@[48; 49) "." - AWAIT_KW@[49; 54) "await" - QUESTION@[54; 55) "?" - DOT@[55; 56) "." - NAME_REF@[56; 61) - IDENT@[56; 61) "hello" - ARG_LIST@[61; 63) - L_PAREN@[61; 62) "(" - R_PAREN@[62; 63) ")" - SEMICOLON@[63; 64) ";" - WHITESPACE@[64; 65) "\n" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 67) "\n" +SOURCE_FILE@0..67 + FN_DEF@0..66 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..66 + BLOCK@9..66 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..23 + AWAIT_EXPR@15..22 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "x" + DOT@16..17 "." + AWAIT_KW@17..22 "await" + SEMICOLON@22..23 ";" + WHITESPACE@23..28 "\n " + EXPR_STMT@28..38 + AWAIT_EXPR@28..37 + FIELD_EXPR@28..31 + PATH_EXPR@28..29 + PATH@28..29 + PATH_SEGMENT@28..29 + NAME_REF@28..29 + IDENT@28..29 "x" + DOT@29..30 "." + NAME_REF@30..31 + INT_NUMBER@30..31 "0" + DOT@31..32 "." + AWAIT_KW@32..37 "await" + SEMICOLON@37..38 ";" + WHITESPACE@38..43 "\n " + EXPR_STMT@43..64 + METHOD_CALL_EXPR@43..63 + TRY_EXPR@43..55 + AWAIT_EXPR@43..54 + CALL_EXPR@43..48 + FIELD_EXPR@43..46 + PATH_EXPR@43..44 + PATH@43..44 + PATH_SEGMENT@43..44 + NAME_REF@43..44 + IDENT@43..44 "x" + DOT@44..45 "." + NAME_REF@45..46 + INT_NUMBER@45..46 "0" + ARG_LIST@46..48 + L_PAREN@46..47 "(" + R_PAREN@47..48 ")" + DOT@48..49 "." + AWAIT_KW@49..54 "await" + QUESTION@54..55 "?" + DOT@55..56 "." + NAME_REF@56..61 + IDENT@56..61 "hello" + ARG_LIST@61..63 + L_PAREN@61..62 "(" + R_PAREN@62..63 ")" + SEMICOLON@63..64 ";" + WHITESPACE@64..65 "\n" + R_CURLY@65..66 "}" + WHITESPACE@66..67 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast index d18096b47f..a32484f2c6 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_associated_type_bounds.rast @@ -1,56 +1,56 @@ -SOURCE_FILE@[0; 59) - FN_DEF@[0; 58) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 12) - IDENT@[3; 12) "print_all" - TYPE_PARAM_LIST@[12; 40) - L_ANGLE@[12; 13) "<" - TYPE_PARAM@[13; 39) - NAME@[13; 14) - IDENT@[13; 14) "T" - COLON@[14; 15) ":" - WHITESPACE@[15; 16) " " - TYPE_BOUND_LIST@[16; 39) - TYPE_BOUND@[16; 39) - PATH_TYPE@[16; 39) - PATH@[16; 39) - PATH_SEGMENT@[16; 39) - NAME_REF@[16; 24) - IDENT@[16; 24) "Iterator" - TYPE_ARG_LIST@[24; 39) - L_ANGLE@[24; 25) "<" - ASSOC_TYPE_ARG@[25; 38) - NAME_REF@[25; 29) - IDENT@[25; 29) "Item" - COLON@[29; 30) ":" - WHITESPACE@[30; 31) " " - TYPE_BOUND_LIST@[31; 38) - TYPE_BOUND@[31; 38) - PATH_TYPE@[31; 38) - PATH@[31; 38) - PATH_SEGMENT@[31; 38) - NAME_REF@[31; 38) - IDENT@[31; 38) "Display" - R_ANGLE@[38; 39) ">" - R_ANGLE@[39; 40) ">" - PARAM_LIST@[40; 55) - L_PAREN@[40; 41) "(" - PARAM@[41; 54) - BIND_PAT@[41; 51) - NAME@[41; 51) - IDENT@[41; 51) "printables" - COLON@[51; 52) ":" - WHITESPACE@[52; 53) " " - PATH_TYPE@[53; 54) - PATH@[53; 54) - PATH_SEGMENT@[53; 54) - NAME_REF@[53; 54) - IDENT@[53; 54) "T" - R_PAREN@[54; 55) ")" - WHITESPACE@[55; 56) " " - BLOCK_EXPR@[56; 58) - BLOCK@[56; 58) - L_CURLY@[56; 57) "{" - R_CURLY@[57; 58) "}" - WHITESPACE@[58; 59) "\n" +SOURCE_FILE@0..59 + FN_DEF@0..58 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..12 + IDENT@3..12 "print_all" + TYPE_PARAM_LIST@12..40 + L_ANGLE@12..13 "<" + TYPE_PARAM@13..39 + NAME@13..14 + IDENT@13..14 "T" + COLON@14..15 ":" + WHITESPACE@15..16 " " + TYPE_BOUND_LIST@16..39 + TYPE_BOUND@16..39 + PATH_TYPE@16..39 + PATH@16..39 + PATH_SEGMENT@16..39 + NAME_REF@16..24 + IDENT@16..24 "Iterator" + TYPE_ARG_LIST@24..39 + L_ANGLE@24..25 "<" + ASSOC_TYPE_ARG@25..38 + NAME_REF@25..29 + IDENT@25..29 "Item" + COLON@29..30 ":" + WHITESPACE@30..31 " " + TYPE_BOUND_LIST@31..38 + TYPE_BOUND@31..38 + PATH_TYPE@31..38 + PATH@31..38 + PATH_SEGMENT@31..38 + NAME_REF@31..38 + IDENT@31..38 "Display" + R_ANGLE@38..39 ">" + R_ANGLE@39..40 ">" + PARAM_LIST@40..55 + L_PAREN@40..41 "(" + PARAM@41..54 + BIND_PAT@41..51 + NAME@41..51 + IDENT@41..51 "printables" + COLON@51..52 ":" + WHITESPACE@52..53 " " + PATH_TYPE@53..54 + PATH@53..54 + PATH_SEGMENT@53..54 + NAME_REF@53..54 + IDENT@53..54 "T" + R_PAREN@54..55 ")" + WHITESPACE@55..56 " " + BLOCK_EXPR@56..58 + BLOCK@56..58 + L_CURLY@56..57 "{" + R_CURLY@57..58 "}" + WHITESPACE@58..59 "\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 ca1d69f647..9017236cce 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 @@ -1,66 +1,66 @@ -SOURCE_FILE@[0; 52) - FN_DEF@[0; 51) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 51) - BLOCK@[9; 51) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 14) "\n " - LET_STMT@[14; 34) - LET_KW@[14; 17) "let" - WHITESPACE@[17; 18) " " - BIND_PAT@[18; 23) - MUT_KW@[18; 21) "mut" - WHITESPACE@[21; 22) " " - NAME@[22; 23) - IDENT@[22; 23) "p" - WHITESPACE@[23; 24) " " - EQ@[24; 25) "=" - WHITESPACE@[25; 26) " " - RECORD_LIT@[26; 33) - PATH@[26; 27) - PATH_SEGMENT@[26; 27) - NAME_REF@[26; 27) - IDENT@[26; 27) "F" - RECORD_FIELD_LIST@[27; 33) - L_CURLY@[27; 28) "{" - RECORD_FIELD@[28; 32) - NAME_REF@[28; 29) - IDENT@[28; 29) "x" - COLON@[29; 30) ":" - WHITESPACE@[30; 31) " " - LITERAL@[31; 32) - INT_NUMBER@[31; 32) "5" - R_CURLY@[32; 33) "}" - SEMICOLON@[33; 34) ";" - WHITESPACE@[34; 38) "\n " - EXPR_STMT@[38; 49) - BIN_EXPR@[38; 48) - FIELD_EXPR@[38; 43) - BLOCK_EXPR@[38; 41) - BLOCK@[38; 41) - L_CURLY@[38; 39) "{" - PATH_EXPR@[39; 40) - PATH@[39; 40) - PATH_SEGMENT@[39; 40) - NAME_REF@[39; 40) - IDENT@[39; 40) "p" - R_CURLY@[40; 41) "}" - DOT@[41; 42) "." - NAME_REF@[42; 43) - IDENT@[42; 43) "x" - WHITESPACE@[43; 44) " " - EQ@[44; 45) "=" - WHITESPACE@[45; 46) " " - LITERAL@[46; 48) - INT_NUMBER@[46; 48) "10" - SEMICOLON@[48; 49) ";" - WHITESPACE@[49; 50) "\n" - R_CURLY@[50; 51) "}" - WHITESPACE@[51; 52) "\n" +SOURCE_FILE@0..52 + FN_DEF@0..51 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..51 + BLOCK@9..51 + L_CURLY@9..10 "{" + WHITESPACE@10..14 "\n " + LET_STMT@14..34 + LET_KW@14..17 "let" + WHITESPACE@17..18 " " + BIND_PAT@18..23 + MUT_KW@18..21 "mut" + WHITESPACE@21..22 " " + NAME@22..23 + IDENT@22..23 "p" + WHITESPACE@23..24 " " + EQ@24..25 "=" + WHITESPACE@25..26 " " + RECORD_LIT@26..33 + PATH@26..27 + PATH_SEGMENT@26..27 + NAME_REF@26..27 + IDENT@26..27 "F" + RECORD_FIELD_LIST@27..33 + L_CURLY@27..28 "{" + RECORD_FIELD@28..32 + NAME_REF@28..29 + IDENT@28..29 "x" + COLON@29..30 ":" + WHITESPACE@30..31 " " + LITERAL@31..32 + INT_NUMBER@31..32 "5" + R_CURLY@32..33 "}" + SEMICOLON@33..34 ";" + WHITESPACE@34..38 "\n " + EXPR_STMT@38..49 + BIN_EXPR@38..48 + FIELD_EXPR@38..43 + BLOCK_EXPR@38..41 + BLOCK@38..41 + L_CURLY@38..39 "{" + PATH_EXPR@39..40 + PATH@39..40 + PATH_SEGMENT@39..40 + NAME_REF@39..40 + IDENT@39..40 "p" + R_CURLY@40..41 "}" + DOT@41..42 "." + NAME_REF@42..43 + IDENT@42..43 "x" + WHITESPACE@43..44 " " + EQ@44..45 "=" + WHITESPACE@45..46 " " + LITERAL@46..48 + INT_NUMBER@46..48 "10" + SEMICOLON@48..49 ";" + WHITESPACE@49..50 "\n" + R_CURLY@50..51 "}" + WHITESPACE@51..52 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast index e627b9746e..2cb5b52f46 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0138_self_param_outer_attr.rast @@ -1,26 +1,26 @@ -SOURCE_FILE@[0; 26) - FN_DEF@[0; 25) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "f" - PARAM_LIST@[4; 22) - L_PAREN@[4; 5) "(" - ATTR@[5; 16) - POUND@[5; 6) "#" - L_BRACK@[6; 7) "[" - PATH@[7; 15) - PATH_SEGMENT@[7; 15) - NAME_REF@[7; 15) - IDENT@[7; 15) "must_use" - R_BRACK@[15; 16) "]" - WHITESPACE@[16; 17) " " - SELF_PARAM@[17; 21) - SELF_KW@[17; 21) "self" - R_PAREN@[21; 22) ")" - WHITESPACE@[22; 23) " " - BLOCK_EXPR@[23; 25) - BLOCK@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" +SOURCE_FILE@0..26 + FN_DEF@0..25 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "f" + PARAM_LIST@4..22 + L_PAREN@4..5 "(" + ATTR@5..16 + POUND@5..6 "#" + L_BRACK@6..7 "[" + PATH@7..15 + PATH_SEGMENT@7..15 + NAME_REF@7..15 + IDENT@7..15 "must_use" + R_BRACK@15..16 "]" + WHITESPACE@16..17 " " + SELF_PARAM@17..21 + SELF_KW@17..21 "self" + R_PAREN@21..22 ")" + WHITESPACE@22..23 " " + BLOCK_EXPR@23..25 + BLOCK@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + WHITESPACE@25..26 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast index cf202c94b7..ac3f4de265 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0139_param_outer_arg.rast @@ -1,35 +1,35 @@ -SOURCE_FILE@[0; 28) - FN_DEF@[0; 27) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "f" - PARAM_LIST@[4; 24) - L_PAREN@[4; 5) "(" - ATTR@[5; 13) - POUND@[5; 6) "#" - L_BRACK@[6; 7) "[" - PATH@[7; 12) - PATH_SEGMENT@[7; 12) - NAME_REF@[7; 12) - IDENT@[7; 12) "attr1" - R_BRACK@[12; 13) "]" - WHITESPACE@[13; 14) " " - PARAM@[14; 23) - BIND_PAT@[14; 17) - NAME@[14; 17) - IDENT@[14; 17) "pat" - COLON@[17; 18) ":" - WHITESPACE@[18; 19) " " - PATH_TYPE@[19; 23) - PATH@[19; 23) - PATH_SEGMENT@[19; 23) - NAME_REF@[19; 23) - IDENT@[19; 23) "Type" - R_PAREN@[23; 24) ")" - WHITESPACE@[24; 25) " " - BLOCK_EXPR@[25; 27) - BLOCK@[25; 27) - L_CURLY@[25; 26) "{" - R_CURLY@[26; 27) "}" - WHITESPACE@[27; 28) "\n" +SOURCE_FILE@0..28 + FN_DEF@0..27 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "f" + PARAM_LIST@4..24 + L_PAREN@4..5 "(" + ATTR@5..13 + POUND@5..6 "#" + L_BRACK@6..7 "[" + PATH@7..12 + PATH_SEGMENT@7..12 + NAME_REF@7..12 + IDENT@7..12 "attr1" + R_BRACK@12..13 "]" + WHITESPACE@13..14 " " + PARAM@14..23 + BIND_PAT@14..17 + NAME@14..17 + IDENT@14..17 "pat" + COLON@17..18 ":" + WHITESPACE@18..19 " " + PATH_TYPE@19..23 + PATH@19..23 + PATH_SEGMENT@19..23 + NAME_REF@19..23 + IDENT@19..23 "Type" + R_PAREN@23..24 ")" + WHITESPACE@24..25 " " + BLOCK_EXPR@25..27 + BLOCK@25..27 + L_CURLY@25..26 "{" + R_CURLY@26..27 "}" + WHITESPACE@27..28 "\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 6d01140d23..8d4919cbd0 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 @@ -1,42 +1,42 @@ -SOURCE_FILE@[0; 51) - FN_DEF@[0; 50) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 50) - BLOCK@[9; 50) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 14) "\n " - FOR_EXPR@[14; 48) - FOR_KW@[14; 17) "for" - WHITESPACE@[17; 18) " " - BIND_PAT@[18; 19) - NAME@[18; 19) - IDENT@[18; 19) "x" - WHITESPACE@[19; 20) " " - IN_KW@[20; 22) "in" - WHITESPACE@[22; 23) " " - RANGE_EXPR@[23; 27) - LITERAL@[23; 24) - INT_NUMBER@[23; 24) "0" - WHITESPACE@[24; 25) " " - DOT2@[25; 27) ".." - WHITESPACE@[27; 28) " " - BLOCK_EXPR@[28; 48) - BLOCK@[28; 48) - L_CURLY@[28; 29) "{" - WHITESPACE@[29; 37) "\n " - EXPR_STMT@[37; 43) - BREAK_EXPR@[37; 42) - BREAK_KW@[37; 42) "break" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 47) "\n " - R_CURLY@[47; 48) "}" - WHITESPACE@[48; 49) "\n" - R_CURLY@[49; 50) "}" - WHITESPACE@[50; 51) "\n" +SOURCE_FILE@0..51 + FN_DEF@0..50 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..50 + BLOCK@9..50 + L_CURLY@9..10 "{" + WHITESPACE@10..14 "\n " + FOR_EXPR@14..48 + FOR_KW@14..17 "for" + WHITESPACE@17..18 " " + BIND_PAT@18..19 + NAME@18..19 + IDENT@18..19 "x" + WHITESPACE@19..20 " " + IN_KW@20..22 "in" + WHITESPACE@22..23 " " + RANGE_EXPR@23..27 + LITERAL@23..24 + INT_NUMBER@23..24 "0" + WHITESPACE@24..25 " " + DOT2@25..27 ".." + WHITESPACE@27..28 " " + BLOCK_EXPR@28..48 + BLOCK@28..48 + L_CURLY@28..29 "{" + WHITESPACE@29..37 "\n " + EXPR_STMT@37..43 + BREAK_EXPR@37..42 + BREAK_KW@37..42 "break" + SEMICOLON@42..43 ";" + WHITESPACE@43..47 "\n " + R_CURLY@47..48 "}" + WHITESPACE@48..49 "\n" + R_CURLY@49..50 "}" + WHITESPACE@50..51 "\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 1d245f8f31..2c933fa76c 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 @@ -1,111 +1,111 @@ -SOURCE_FILE@[0; 118) - FN_DEF@[0; 117) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 117) - BLOCK@[10; 117) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 31) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - BOX_PAT@[20; 25) - BOX_KW@[20; 23) "box" - WHITESPACE@[23; 24) " " - BIND_PAT@[24; 25) - NAME@[24; 25) - IDENT@[24; 25) "i" - WHITESPACE@[25; 26) " " - EQ@[26; 27) "=" - WHITESPACE@[27; 28) " " - TUPLE_EXPR@[28; 30) - L_PAREN@[28; 29) "(" - R_PAREN@[29; 30) ")" - SEMICOLON@[30; 31) ";" - WHITESPACE@[31; 36) "\n " - LET_STMT@[36; 87) - LET_KW@[36; 39) "let" - WHITESPACE@[39; 40) " " - BOX_PAT@[40; 81) - BOX_KW@[40; 43) "box" - WHITESPACE@[43; 44) " " - RECORD_PAT@[44; 81) - PATH@[44; 49) - PATH_SEGMENT@[44; 49) - NAME_REF@[44; 49) - IDENT@[44; 49) "Outer" - WHITESPACE@[49; 50) " " - RECORD_FIELD_PAT_LIST@[50; 81) - L_CURLY@[50; 51) "{" - WHITESPACE@[51; 52) " " - RECORD_FIELD_PAT@[52; 57) - BOX_PAT@[52; 57) - BOX_KW@[52; 55) "box" - WHITESPACE@[55; 56) " " - BIND_PAT@[56; 57) - NAME@[56; 57) - IDENT@[56; 57) "i" - COMMA@[57; 58) "," - WHITESPACE@[58; 59) " " - RECORD_FIELD_PAT@[59; 79) - NAME_REF@[59; 60) - IDENT@[59; 60) "j" - COLON@[60; 61) ":" - WHITESPACE@[61; 62) " " - BOX_PAT@[62; 79) - BOX_KW@[62; 65) "box" - WHITESPACE@[65; 66) " " - TUPLE_STRUCT_PAT@[66; 79) - PATH@[66; 71) - PATH_SEGMENT@[66; 71) - NAME_REF@[66; 71) - IDENT@[66; 71) "Inner" - L_PAREN@[71; 72) "(" - BOX_PAT@[72; 78) - BOX_KW@[72; 75) "box" - WHITESPACE@[75; 76) " " - REF_PAT@[76; 78) - AMP@[76; 77) "&" - BIND_PAT@[77; 78) - NAME@[77; 78) - IDENT@[77; 78) "x" - R_PAREN@[78; 79) ")" - WHITESPACE@[79; 80) " " - R_CURLY@[80; 81) "}" - WHITESPACE@[81; 82) " " - EQ@[82; 83) "=" - WHITESPACE@[83; 84) " " - TUPLE_EXPR@[84; 86) - L_PAREN@[84; 85) "(" - R_PAREN@[85; 86) ")" - SEMICOLON@[86; 87) ";" - WHITESPACE@[87; 92) "\n " - LET_STMT@[92; 115) - LET_KW@[92; 95) "let" - WHITESPACE@[95; 96) " " - BOX_PAT@[96; 109) - BOX_KW@[96; 99) "box" - WHITESPACE@[99; 100) " " - BIND_PAT@[100; 109) - REF_KW@[100; 103) "ref" - WHITESPACE@[103; 104) " " - MUT_KW@[104; 107) "mut" - WHITESPACE@[107; 108) " " - NAME@[108; 109) - IDENT@[108; 109) "i" - WHITESPACE@[109; 110) " " - EQ@[110; 111) "=" - WHITESPACE@[111; 112) " " - TUPLE_EXPR@[112; 114) - L_PAREN@[112; 113) "(" - R_PAREN@[113; 114) ")" - SEMICOLON@[114; 115) ";" - WHITESPACE@[115; 116) "\n" - R_CURLY@[116; 117) "}" - WHITESPACE@[117; 118) "\n" +SOURCE_FILE@0..118 + FN_DEF@0..117 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..117 + BLOCK@10..117 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..31 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + BOX_PAT@20..25 + BOX_KW@20..23 "box" + WHITESPACE@23..24 " " + BIND_PAT@24..25 + NAME@24..25 + IDENT@24..25 "i" + WHITESPACE@25..26 " " + EQ@26..27 "=" + WHITESPACE@27..28 " " + TUPLE_EXPR@28..30 + L_PAREN@28..29 "(" + R_PAREN@29..30 ")" + SEMICOLON@30..31 ";" + WHITESPACE@31..36 "\n " + LET_STMT@36..87 + LET_KW@36..39 "let" + WHITESPACE@39..40 " " + BOX_PAT@40..81 + BOX_KW@40..43 "box" + WHITESPACE@43..44 " " + RECORD_PAT@44..81 + PATH@44..49 + PATH_SEGMENT@44..49 + NAME_REF@44..49 + IDENT@44..49 "Outer" + WHITESPACE@49..50 " " + RECORD_FIELD_PAT_LIST@50..81 + L_CURLY@50..51 "{" + WHITESPACE@51..52 " " + RECORD_FIELD_PAT@52..57 + BOX_PAT@52..57 + BOX_KW@52..55 "box" + WHITESPACE@55..56 " " + BIND_PAT@56..57 + NAME@56..57 + IDENT@56..57 "i" + COMMA@57..58 "," + WHITESPACE@58..59 " " + RECORD_FIELD_PAT@59..79 + NAME_REF@59..60 + IDENT@59..60 "j" + COLON@60..61 ":" + WHITESPACE@61..62 " " + BOX_PAT@62..79 + BOX_KW@62..65 "box" + WHITESPACE@65..66 " " + TUPLE_STRUCT_PAT@66..79 + PATH@66..71 + PATH_SEGMENT@66..71 + NAME_REF@66..71 + IDENT@66..71 "Inner" + L_PAREN@71..72 "(" + BOX_PAT@72..78 + BOX_KW@72..75 "box" + WHITESPACE@75..76 " " + REF_PAT@76..78 + AMP@76..77 "&" + BIND_PAT@77..78 + NAME@77..78 + IDENT@77..78 "x" + R_PAREN@78..79 ")" + WHITESPACE@79..80 " " + R_CURLY@80..81 "}" + WHITESPACE@81..82 " " + EQ@82..83 "=" + WHITESPACE@83..84 " " + TUPLE_EXPR@84..86 + L_PAREN@84..85 "(" + R_PAREN@85..86 ")" + SEMICOLON@86..87 ";" + WHITESPACE@87..92 "\n " + LET_STMT@92..115 + LET_KW@92..95 "let" + WHITESPACE@95..96 " " + BOX_PAT@96..109 + BOX_KW@96..99 "box" + WHITESPACE@99..100 " " + BIND_PAT@100..109 + REF_KW@100..103 "ref" + WHITESPACE@103..104 " " + MUT_KW@104..107 "mut" + WHITESPACE@107..108 " " + NAME@108..109 + IDENT@108..109 "i" + WHITESPACE@109..110 " " + EQ@110..111 "=" + WHITESPACE@111..112 " " + TUPLE_EXPR@112..114 + L_PAREN@112..113 "(" + R_PAREN@113..114 ")" + SEMICOLON@114..115 ";" + WHITESPACE@115..116 "\n" + R_CURLY@116..117 "}" + 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 60186a992b..e0b50d8be9 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 @@ -1,456 +1,456 @@ -SOURCE_FILE@[0; 555) - FN_DEF@[0; 554) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 554) - BLOCK@[10; 554) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 28) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - DOT_DOT_PAT@[20; 22) - DOT2@[20; 22) ".." - WHITESPACE@[22; 23) " " - EQ@[23; 24) "=" - WHITESPACE@[24; 25) " " - TUPLE_EXPR@[25; 27) - L_PAREN@[25; 26) "(" - R_PAREN@[26; 27) ")" - SEMICOLON@[27; 28) ";" - WHITESPACE@[28; 33) "\n " - COMMENT@[33; 35) "//" - WHITESPACE@[35; 40) "\n " - COMMENT@[40; 49) "// Tuples" - WHITESPACE@[49; 54) "\n " - COMMENT@[54; 56) "//" - WHITESPACE@[56; 61) "\n " - LET_STMT@[61; 78) - LET_KW@[61; 64) "let" - WHITESPACE@[64; 65) " " - TUPLE_PAT@[65; 72) - L_PAREN@[65; 66) "(" - BIND_PAT@[66; 67) - NAME@[66; 67) - IDENT@[66; 67) "a" - COMMA@[67; 68) "," - WHITESPACE@[68; 69) " " - DOT_DOT_PAT@[69; 71) - DOT2@[69; 71) ".." - R_PAREN@[71; 72) ")" - WHITESPACE@[72; 73) " " - EQ@[73; 74) "=" - WHITESPACE@[74; 75) " " - TUPLE_EXPR@[75; 77) - L_PAREN@[75; 76) "(" - R_PAREN@[76; 77) ")" - SEMICOLON@[77; 78) ";" - WHITESPACE@[78; 83) "\n " - LET_STMT@[83; 101) - LET_KW@[83; 86) "let" - WHITESPACE@[86; 87) " " - TUPLE_PAT@[87; 95) - L_PAREN@[87; 88) "(" - BIND_PAT@[88; 89) - NAME@[88; 89) - IDENT@[88; 89) "a" - COMMA@[89; 90) "," - WHITESPACE@[90; 91) " " - DOT_DOT_PAT@[91; 93) - DOT2@[91; 93) ".." - COMMA@[93; 94) "," - R_PAREN@[94; 95) ")" - WHITESPACE@[95; 96) " " - EQ@[96; 97) "=" - WHITESPACE@[97; 98) " " - TUPLE_EXPR@[98; 100) - L_PAREN@[98; 99) "(" - R_PAREN@[99; 100) ")" - SEMICOLON@[100; 101) ";" - WHITESPACE@[101; 106) "\n " - LET_STMT@[106; 128) - LET_KW@[106; 109) "let" - WHITESPACE@[109; 110) " " - TUPLE_STRUCT_PAT@[110; 122) - PATH@[110; 115) - PATH_SEGMENT@[110; 115) - NAME_REF@[110; 115) - IDENT@[110; 115) "Tuple" - L_PAREN@[115; 116) "(" - BIND_PAT@[116; 117) - NAME@[116; 117) - IDENT@[116; 117) "a" - COMMA@[117; 118) "," - WHITESPACE@[118; 119) " " - DOT_DOT_PAT@[119; 121) - DOT2@[119; 121) ".." - R_PAREN@[121; 122) ")" - WHITESPACE@[122; 123) " " - EQ@[123; 124) "=" - WHITESPACE@[124; 125) " " - TUPLE_EXPR@[125; 127) - L_PAREN@[125; 126) "(" - R_PAREN@[126; 127) ")" - SEMICOLON@[127; 128) ";" - WHITESPACE@[128; 133) "\n " - LET_STMT@[133; 156) - LET_KW@[133; 136) "let" - WHITESPACE@[136; 137) " " - TUPLE_STRUCT_PAT@[137; 150) - PATH@[137; 142) - PATH_SEGMENT@[137; 142) - NAME_REF@[137; 142) - IDENT@[137; 142) "Tuple" - L_PAREN@[142; 143) "(" - BIND_PAT@[143; 144) - NAME@[143; 144) - IDENT@[143; 144) "a" - COMMA@[144; 145) "," - WHITESPACE@[145; 146) " " - DOT_DOT_PAT@[146; 148) - DOT2@[146; 148) ".." - COMMA@[148; 149) "," - R_PAREN@[149; 150) ")" - WHITESPACE@[150; 151) " " - EQ@[151; 152) "=" - WHITESPACE@[152; 153) " " - TUPLE_EXPR@[153; 155) - L_PAREN@[153; 154) "(" - R_PAREN@[154; 155) ")" - SEMICOLON@[155; 156) ";" - WHITESPACE@[156; 161) "\n " - LET_STMT@[161; 179) - LET_KW@[161; 164) "let" - WHITESPACE@[164; 165) " " - TUPLE_PAT@[165; 173) - L_PAREN@[165; 166) "(" - DOT_DOT_PAT@[166; 168) - DOT2@[166; 168) ".." - COMMA@[168; 169) "," - WHITESPACE@[169; 170) " " - DOT_DOT_PAT@[170; 172) - DOT2@[170; 172) ".." - R_PAREN@[172; 173) ")" - WHITESPACE@[173; 174) " " - EQ@[174; 175) "=" - WHITESPACE@[175; 176) " " - TUPLE_EXPR@[176; 178) - L_PAREN@[176; 177) "(" - R_PAREN@[177; 178) ")" - SEMICOLON@[178; 179) ";" - WHITESPACE@[179; 184) "\n " - LET_STMT@[184; 207) - LET_KW@[184; 187) "let" - WHITESPACE@[187; 188) " " - TUPLE_STRUCT_PAT@[188; 201) - PATH@[188; 193) - PATH_SEGMENT@[188; 193) - NAME_REF@[188; 193) - IDENT@[188; 193) "Tuple" - L_PAREN@[193; 194) "(" - DOT_DOT_PAT@[194; 196) - DOT2@[194; 196) ".." - COMMA@[196; 197) "," - WHITESPACE@[197; 198) " " - DOT_DOT_PAT@[198; 200) - DOT2@[198; 200) ".." - R_PAREN@[200; 201) ")" - WHITESPACE@[201; 202) " " - EQ@[202; 203) "=" - WHITESPACE@[203; 204) " " - TUPLE_EXPR@[204; 206) - L_PAREN@[204; 205) "(" - R_PAREN@[205; 206) ")" - SEMICOLON@[206; 207) ";" - WHITESPACE@[207; 212) "\n " - LET_STMT@[212; 233) - LET_KW@[212; 215) "let" - WHITESPACE@[215; 216) " " - TUPLE_PAT@[216; 227) - L_PAREN@[216; 217) "(" - DOT_DOT_PAT@[217; 219) - DOT2@[217; 219) ".." - COMMA@[219; 220) "," - WHITESPACE@[220; 221) " " - BIND_PAT@[221; 222) - NAME@[221; 222) - IDENT@[221; 222) "a" - COMMA@[222; 223) "," - WHITESPACE@[223; 224) " " - DOT_DOT_PAT@[224; 226) - DOT2@[224; 226) ".." - R_PAREN@[226; 227) ")" - WHITESPACE@[227; 228) " " - EQ@[228; 229) "=" - WHITESPACE@[229; 230) " " - TUPLE_EXPR@[230; 232) - L_PAREN@[230; 231) "(" - R_PAREN@[231; 232) ")" - SEMICOLON@[232; 233) ";" - WHITESPACE@[233; 238) "\n " - LET_STMT@[238; 264) - LET_KW@[238; 241) "let" - WHITESPACE@[241; 242) " " - TUPLE_STRUCT_PAT@[242; 258) - PATH@[242; 247) - PATH_SEGMENT@[242; 247) - NAME_REF@[242; 247) - IDENT@[242; 247) "Tuple" - L_PAREN@[247; 248) "(" - DOT_DOT_PAT@[248; 250) - DOT2@[248; 250) ".." - COMMA@[250; 251) "," - WHITESPACE@[251; 252) " " - BIND_PAT@[252; 253) - NAME@[252; 253) - IDENT@[252; 253) "a" - COMMA@[253; 254) "," - WHITESPACE@[254; 255) " " - DOT_DOT_PAT@[255; 257) - DOT2@[255; 257) ".." - R_PAREN@[257; 258) ")" - WHITESPACE@[258; 259) " " - EQ@[259; 260) "=" - WHITESPACE@[260; 261) " " - TUPLE_EXPR@[261; 263) - L_PAREN@[261; 262) "(" - R_PAREN@[262; 263) ")" - SEMICOLON@[263; 264) ";" - WHITESPACE@[264; 269) "\n " - COMMENT@[269; 271) "//" - WHITESPACE@[271; 276) "\n " - COMMENT@[276; 285) "// Slices" - WHITESPACE@[285; 290) "\n " - COMMENT@[290; 292) "//" - WHITESPACE@[292; 297) "\n " - LET_STMT@[297; 311) - LET_KW@[297; 300) "let" - WHITESPACE@[300; 301) " " - SLICE_PAT@[301; 305) - L_BRACK@[301; 302) "[" - DOT_DOT_PAT@[302; 304) - DOT2@[302; 304) ".." - R_BRACK@[304; 305) "]" - WHITESPACE@[305; 306) " " - EQ@[306; 307) "=" - WHITESPACE@[307; 308) " " - TUPLE_EXPR@[308; 310) - L_PAREN@[308; 309) "(" - R_PAREN@[309; 310) ")" - SEMICOLON@[310; 311) ";" - WHITESPACE@[311; 316) "\n " - LET_STMT@[316; 336) - LET_KW@[316; 319) "let" - WHITESPACE@[319; 320) " " - SLICE_PAT@[320; 330) - L_BRACK@[320; 321) "[" - BIND_PAT@[321; 325) - NAME@[321; 325) - IDENT@[321; 325) "head" - COMMA@[325; 326) "," - WHITESPACE@[326; 327) " " - DOT_DOT_PAT@[327; 329) - DOT2@[327; 329) ".." - R_BRACK@[329; 330) "]" - WHITESPACE@[330; 331) " " - EQ@[331; 332) "=" - WHITESPACE@[332; 333) " " - TUPLE_EXPR@[333; 335) - L_PAREN@[333; 334) "(" - R_PAREN@[334; 335) ")" - SEMICOLON@[335; 336) ";" - WHITESPACE@[336; 341) "\n " - LET_STMT@[341; 368) - LET_KW@[341; 344) "let" - WHITESPACE@[344; 345) " " - SLICE_PAT@[345; 362) - L_BRACK@[345; 346) "[" - BIND_PAT@[346; 350) - NAME@[346; 350) - IDENT@[346; 350) "head" - COMMA@[350; 351) "," - WHITESPACE@[351; 352) " " - BIND_PAT@[352; 361) - NAME@[352; 356) - IDENT@[352; 356) "tail" - WHITESPACE@[356; 357) " " - AT@[357; 358) "@" - WHITESPACE@[358; 359) " " - DOT_DOT_PAT@[359; 361) - DOT2@[359; 361) ".." - R_BRACK@[361; 362) "]" - WHITESPACE@[362; 363) " " - EQ@[363; 364) "=" - WHITESPACE@[364; 365) " " - TUPLE_EXPR@[365; 367) - L_PAREN@[365; 366) "(" - R_PAREN@[366; 367) ")" - SEMICOLON@[367; 368) ";" - WHITESPACE@[368; 373) "\n " - LET_STMT@[373; 399) - LET_KW@[373; 376) "let" - WHITESPACE@[376; 377) " " - SLICE_PAT@[377; 393) - L_BRACK@[377; 378) "[" - BIND_PAT@[378; 382) - NAME@[378; 382) - IDENT@[378; 382) "head" - COMMA@[382; 383) "," - WHITESPACE@[383; 384) " " - DOT_DOT_PAT@[384; 386) - DOT2@[384; 386) ".." - COMMA@[386; 387) "," - WHITESPACE@[387; 388) " " - BIND_PAT@[388; 392) - NAME@[388; 392) - IDENT@[388; 392) "cons" - R_BRACK@[392; 393) "]" - WHITESPACE@[393; 394) " " - EQ@[394; 395) "=" - WHITESPACE@[395; 396) " " - TUPLE_EXPR@[396; 398) - L_PAREN@[396; 397) "(" - R_PAREN@[397; 398) ")" - SEMICOLON@[398; 399) ";" - WHITESPACE@[399; 404) "\n " - LET_STMT@[404; 436) - LET_KW@[404; 407) "let" - WHITESPACE@[407; 408) " " - SLICE_PAT@[408; 430) - L_BRACK@[408; 409) "[" - BIND_PAT@[409; 413) - NAME@[409; 413) - IDENT@[409; 413) "head" - COMMA@[413; 414) "," - WHITESPACE@[414; 415) " " - BIND_PAT@[415; 423) - NAME@[415; 418) - IDENT@[415; 418) "mid" - WHITESPACE@[418; 419) " " - AT@[419; 420) "@" - WHITESPACE@[420; 421) " " - DOT_DOT_PAT@[421; 423) - DOT2@[421; 423) ".." - COMMA@[423; 424) "," - WHITESPACE@[424; 425) " " - BIND_PAT@[425; 429) - NAME@[425; 429) - IDENT@[425; 429) "cons" - R_BRACK@[429; 430) "]" - WHITESPACE@[430; 431) " " - EQ@[431; 432) "=" - WHITESPACE@[432; 433) " " - TUPLE_EXPR@[433; 435) - L_PAREN@[433; 434) "(" - R_PAREN@[434; 435) ")" - SEMICOLON@[435; 436) ";" - WHITESPACE@[436; 441) "\n " - LET_STMT@[441; 471) - LET_KW@[441; 444) "let" - WHITESPACE@[444; 445) " " - SLICE_PAT@[445; 465) - L_BRACK@[445; 446) "[" - BIND_PAT@[446; 450) - NAME@[446; 450) - IDENT@[446; 450) "head" - COMMA@[450; 451) "," - WHITESPACE@[451; 452) " " - DOT_DOT_PAT@[452; 454) - DOT2@[452; 454) ".." - COMMA@[454; 455) "," - WHITESPACE@[455; 456) " " - DOT_DOT_PAT@[456; 458) - DOT2@[456; 458) ".." - COMMA@[458; 459) "," - WHITESPACE@[459; 460) " " - BIND_PAT@[460; 464) - NAME@[460; 464) - IDENT@[460; 464) "cons" - R_BRACK@[464; 465) "]" - WHITESPACE@[465; 466) " " - EQ@[466; 467) "=" - WHITESPACE@[467; 468) " " - TUPLE_EXPR@[468; 470) - L_PAREN@[468; 469) "(" - R_PAREN@[469; 470) ")" - SEMICOLON@[470; 471) ";" - WHITESPACE@[471; 476) "\n " - LET_STMT@[476; 512) - LET_KW@[476; 479) "let" - WHITESPACE@[479; 480) " " - SLICE_PAT@[480; 506) - L_BRACK@[480; 481) "[" - BIND_PAT@[481; 485) - NAME@[481; 485) - IDENT@[481; 485) "head" - COMMA@[485; 486) "," - WHITESPACE@[486; 487) " " - DOT_DOT_PAT@[487; 489) - DOT2@[487; 489) ".." - COMMA@[489; 490) "," - WHITESPACE@[490; 491) " " - BIND_PAT@[491; 494) - NAME@[491; 494) - IDENT@[491; 494) "mid" - COMMA@[494; 495) "," - WHITESPACE@[495; 496) " " - BIND_PAT@[496; 505) - NAME@[496; 500) - IDENT@[496; 500) "tail" - WHITESPACE@[500; 501) " " - AT@[501; 502) "@" - WHITESPACE@[502; 503) " " - DOT_DOT_PAT@[503; 505) - DOT2@[503; 505) ".." - R_BRACK@[505; 506) "]" - WHITESPACE@[506; 507) " " - EQ@[507; 508) "=" - WHITESPACE@[508; 509) " " - TUPLE_EXPR@[509; 511) - L_PAREN@[509; 510) "(" - R_PAREN@[510; 511) ")" - SEMICOLON@[511; 512) ";" - WHITESPACE@[512; 517) "\n " - LET_STMT@[517; 552) - LET_KW@[517; 520) "let" - WHITESPACE@[520; 521) " " - SLICE_PAT@[521; 546) - L_BRACK@[521; 522) "[" - BIND_PAT@[522; 526) - NAME@[522; 526) - IDENT@[522; 526) "head" - COMMA@[526; 527) "," - WHITESPACE@[527; 528) " " - DOT_DOT_PAT@[528; 530) - DOT2@[528; 530) ".." - COMMA@[530; 531) "," - WHITESPACE@[531; 532) " " - BIND_PAT@[532; 535) - NAME@[532; 535) - IDENT@[532; 535) "mid" - COMMA@[535; 536) "," - WHITESPACE@[536; 537) " " - DOT_DOT_PAT@[537; 539) - DOT2@[537; 539) ".." - COMMA@[539; 540) "," - WHITESPACE@[540; 541) " " - BIND_PAT@[541; 545) - NAME@[541; 545) - IDENT@[541; 545) "cons" - R_BRACK@[545; 546) "]" - WHITESPACE@[546; 547) " " - EQ@[547; 548) "=" - WHITESPACE@[548; 549) " " - TUPLE_EXPR@[549; 551) - L_PAREN@[549; 550) "(" - R_PAREN@[550; 551) ")" - SEMICOLON@[551; 552) ";" - WHITESPACE@[552; 553) "\n" - R_CURLY@[553; 554) "}" - WHITESPACE@[554; 555) "\n" +SOURCE_FILE@0..555 + FN_DEF@0..554 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..554 + BLOCK@10..554 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..28 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + DOT_DOT_PAT@20..22 + DOT2@20..22 ".." + WHITESPACE@22..23 " " + EQ@23..24 "=" + WHITESPACE@24..25 " " + TUPLE_EXPR@25..27 + L_PAREN@25..26 "(" + R_PAREN@26..27 ")" + SEMICOLON@27..28 ";" + WHITESPACE@28..33 "\n " + COMMENT@33..35 "//" + WHITESPACE@35..40 "\n " + COMMENT@40..49 "// Tuples" + WHITESPACE@49..54 "\n " + COMMENT@54..56 "//" + WHITESPACE@56..61 "\n " + LET_STMT@61..78 + LET_KW@61..64 "let" + WHITESPACE@64..65 " " + TUPLE_PAT@65..72 + L_PAREN@65..66 "(" + BIND_PAT@66..67 + NAME@66..67 + IDENT@66..67 "a" + COMMA@67..68 "," + WHITESPACE@68..69 " " + DOT_DOT_PAT@69..71 + DOT2@69..71 ".." + R_PAREN@71..72 ")" + WHITESPACE@72..73 " " + EQ@73..74 "=" + WHITESPACE@74..75 " " + TUPLE_EXPR@75..77 + L_PAREN@75..76 "(" + R_PAREN@76..77 ")" + SEMICOLON@77..78 ";" + WHITESPACE@78..83 "\n " + LET_STMT@83..101 + LET_KW@83..86 "let" + WHITESPACE@86..87 " " + TUPLE_PAT@87..95 + L_PAREN@87..88 "(" + BIND_PAT@88..89 + NAME@88..89 + IDENT@88..89 "a" + COMMA@89..90 "," + WHITESPACE@90..91 " " + DOT_DOT_PAT@91..93 + DOT2@91..93 ".." + COMMA@93..94 "," + R_PAREN@94..95 ")" + WHITESPACE@95..96 " " + EQ@96..97 "=" + WHITESPACE@97..98 " " + TUPLE_EXPR@98..100 + L_PAREN@98..99 "(" + R_PAREN@99..100 ")" + SEMICOLON@100..101 ";" + WHITESPACE@101..106 "\n " + LET_STMT@106..128 + LET_KW@106..109 "let" + WHITESPACE@109..110 " " + TUPLE_STRUCT_PAT@110..122 + PATH@110..115 + PATH_SEGMENT@110..115 + NAME_REF@110..115 + IDENT@110..115 "Tuple" + L_PAREN@115..116 "(" + BIND_PAT@116..117 + NAME@116..117 + IDENT@116..117 "a" + COMMA@117..118 "," + WHITESPACE@118..119 " " + DOT_DOT_PAT@119..121 + DOT2@119..121 ".." + R_PAREN@121..122 ")" + WHITESPACE@122..123 " " + EQ@123..124 "=" + WHITESPACE@124..125 " " + TUPLE_EXPR@125..127 + L_PAREN@125..126 "(" + R_PAREN@126..127 ")" + SEMICOLON@127..128 ";" + WHITESPACE@128..133 "\n " + LET_STMT@133..156 + LET_KW@133..136 "let" + WHITESPACE@136..137 " " + TUPLE_STRUCT_PAT@137..150 + PATH@137..142 + PATH_SEGMENT@137..142 + NAME_REF@137..142 + IDENT@137..142 "Tuple" + L_PAREN@142..143 "(" + BIND_PAT@143..144 + NAME@143..144 + IDENT@143..144 "a" + COMMA@144..145 "," + WHITESPACE@145..146 " " + DOT_DOT_PAT@146..148 + DOT2@146..148 ".." + COMMA@148..149 "," + R_PAREN@149..150 ")" + WHITESPACE@150..151 " " + EQ@151..152 "=" + WHITESPACE@152..153 " " + TUPLE_EXPR@153..155 + L_PAREN@153..154 "(" + R_PAREN@154..155 ")" + SEMICOLON@155..156 ";" + WHITESPACE@156..161 "\n " + LET_STMT@161..179 + LET_KW@161..164 "let" + WHITESPACE@164..165 " " + TUPLE_PAT@165..173 + L_PAREN@165..166 "(" + DOT_DOT_PAT@166..168 + DOT2@166..168 ".." + COMMA@168..169 "," + WHITESPACE@169..170 " " + DOT_DOT_PAT@170..172 + DOT2@170..172 ".." + R_PAREN@172..173 ")" + WHITESPACE@173..174 " " + EQ@174..175 "=" + WHITESPACE@175..176 " " + TUPLE_EXPR@176..178 + L_PAREN@176..177 "(" + R_PAREN@177..178 ")" + SEMICOLON@178..179 ";" + WHITESPACE@179..184 "\n " + LET_STMT@184..207 + LET_KW@184..187 "let" + WHITESPACE@187..188 " " + TUPLE_STRUCT_PAT@188..201 + PATH@188..193 + PATH_SEGMENT@188..193 + NAME_REF@188..193 + IDENT@188..193 "Tuple" + L_PAREN@193..194 "(" + DOT_DOT_PAT@194..196 + DOT2@194..196 ".." + COMMA@196..197 "," + WHITESPACE@197..198 " " + DOT_DOT_PAT@198..200 + DOT2@198..200 ".." + R_PAREN@200..201 ")" + WHITESPACE@201..202 " " + EQ@202..203 "=" + WHITESPACE@203..204 " " + TUPLE_EXPR@204..206 + L_PAREN@204..205 "(" + R_PAREN@205..206 ")" + SEMICOLON@206..207 ";" + WHITESPACE@207..212 "\n " + LET_STMT@212..233 + LET_KW@212..215 "let" + WHITESPACE@215..216 " " + TUPLE_PAT@216..227 + L_PAREN@216..217 "(" + DOT_DOT_PAT@217..219 + DOT2@217..219 ".." + COMMA@219..220 "," + WHITESPACE@220..221 " " + BIND_PAT@221..222 + NAME@221..222 + IDENT@221..222 "a" + COMMA@222..223 "," + WHITESPACE@223..224 " " + DOT_DOT_PAT@224..226 + DOT2@224..226 ".." + R_PAREN@226..227 ")" + WHITESPACE@227..228 " " + EQ@228..229 "=" + WHITESPACE@229..230 " " + TUPLE_EXPR@230..232 + L_PAREN@230..231 "(" + R_PAREN@231..232 ")" + SEMICOLON@232..233 ";" + WHITESPACE@233..238 "\n " + LET_STMT@238..264 + LET_KW@238..241 "let" + WHITESPACE@241..242 " " + TUPLE_STRUCT_PAT@242..258 + PATH@242..247 + PATH_SEGMENT@242..247 + NAME_REF@242..247 + IDENT@242..247 "Tuple" + L_PAREN@247..248 "(" + DOT_DOT_PAT@248..250 + DOT2@248..250 ".." + COMMA@250..251 "," + WHITESPACE@251..252 " " + BIND_PAT@252..253 + NAME@252..253 + IDENT@252..253 "a" + COMMA@253..254 "," + WHITESPACE@254..255 " " + DOT_DOT_PAT@255..257 + DOT2@255..257 ".." + R_PAREN@257..258 ")" + WHITESPACE@258..259 " " + EQ@259..260 "=" + WHITESPACE@260..261 " " + TUPLE_EXPR@261..263 + L_PAREN@261..262 "(" + R_PAREN@262..263 ")" + SEMICOLON@263..264 ";" + WHITESPACE@264..269 "\n " + COMMENT@269..271 "//" + WHITESPACE@271..276 "\n " + COMMENT@276..285 "// Slices" + WHITESPACE@285..290 "\n " + COMMENT@290..292 "//" + WHITESPACE@292..297 "\n " + LET_STMT@297..311 + LET_KW@297..300 "let" + WHITESPACE@300..301 " " + SLICE_PAT@301..305 + L_BRACK@301..302 "[" + DOT_DOT_PAT@302..304 + DOT2@302..304 ".." + R_BRACK@304..305 "]" + WHITESPACE@305..306 " " + EQ@306..307 "=" + WHITESPACE@307..308 " " + TUPLE_EXPR@308..310 + L_PAREN@308..309 "(" + R_PAREN@309..310 ")" + SEMICOLON@310..311 ";" + WHITESPACE@311..316 "\n " + LET_STMT@316..336 + LET_KW@316..319 "let" + WHITESPACE@319..320 " " + SLICE_PAT@320..330 + L_BRACK@320..321 "[" + BIND_PAT@321..325 + NAME@321..325 + IDENT@321..325 "head" + COMMA@325..326 "," + WHITESPACE@326..327 " " + DOT_DOT_PAT@327..329 + DOT2@327..329 ".." + R_BRACK@329..330 "]" + WHITESPACE@330..331 " " + EQ@331..332 "=" + WHITESPACE@332..333 " " + TUPLE_EXPR@333..335 + L_PAREN@333..334 "(" + R_PAREN@334..335 ")" + SEMICOLON@335..336 ";" + WHITESPACE@336..341 "\n " + LET_STMT@341..368 + LET_KW@341..344 "let" + WHITESPACE@344..345 " " + SLICE_PAT@345..362 + L_BRACK@345..346 "[" + BIND_PAT@346..350 + NAME@346..350 + IDENT@346..350 "head" + COMMA@350..351 "," + WHITESPACE@351..352 " " + BIND_PAT@352..361 + NAME@352..356 + IDENT@352..356 "tail" + WHITESPACE@356..357 " " + AT@357..358 "@" + WHITESPACE@358..359 " " + DOT_DOT_PAT@359..361 + DOT2@359..361 ".." + R_BRACK@361..362 "]" + WHITESPACE@362..363 " " + EQ@363..364 "=" + WHITESPACE@364..365 " " + TUPLE_EXPR@365..367 + L_PAREN@365..366 "(" + R_PAREN@366..367 ")" + SEMICOLON@367..368 ";" + WHITESPACE@368..373 "\n " + LET_STMT@373..399 + LET_KW@373..376 "let" + WHITESPACE@376..377 " " + SLICE_PAT@377..393 + L_BRACK@377..378 "[" + BIND_PAT@378..382 + NAME@378..382 + IDENT@378..382 "head" + COMMA@382..383 "," + WHITESPACE@383..384 " " + DOT_DOT_PAT@384..386 + DOT2@384..386 ".." + COMMA@386..387 "," + WHITESPACE@387..388 " " + BIND_PAT@388..392 + NAME@388..392 + IDENT@388..392 "cons" + R_BRACK@392..393 "]" + WHITESPACE@393..394 " " + EQ@394..395 "=" + WHITESPACE@395..396 " " + TUPLE_EXPR@396..398 + L_PAREN@396..397 "(" + R_PAREN@397..398 ")" + SEMICOLON@398..399 ";" + WHITESPACE@399..404 "\n " + LET_STMT@404..436 + LET_KW@404..407 "let" + WHITESPACE@407..408 " " + SLICE_PAT@408..430 + L_BRACK@408..409 "[" + BIND_PAT@409..413 + NAME@409..413 + IDENT@409..413 "head" + COMMA@413..414 "," + WHITESPACE@414..415 " " + BIND_PAT@415..423 + NAME@415..418 + IDENT@415..418 "mid" + WHITESPACE@418..419 " " + AT@419..420 "@" + WHITESPACE@420..421 " " + DOT_DOT_PAT@421..423 + DOT2@421..423 ".." + COMMA@423..424 "," + WHITESPACE@424..425 " " + BIND_PAT@425..429 + NAME@425..429 + IDENT@425..429 "cons" + R_BRACK@429..430 "]" + WHITESPACE@430..431 " " + EQ@431..432 "=" + WHITESPACE@432..433 " " + TUPLE_EXPR@433..435 + L_PAREN@433..434 "(" + R_PAREN@434..435 ")" + SEMICOLON@435..436 ";" + WHITESPACE@436..441 "\n " + LET_STMT@441..471 + LET_KW@441..444 "let" + WHITESPACE@444..445 " " + SLICE_PAT@445..465 + L_BRACK@445..446 "[" + BIND_PAT@446..450 + NAME@446..450 + IDENT@446..450 "head" + COMMA@450..451 "," + WHITESPACE@451..452 " " + DOT_DOT_PAT@452..454 + DOT2@452..454 ".." + COMMA@454..455 "," + WHITESPACE@455..456 " " + DOT_DOT_PAT@456..458 + DOT2@456..458 ".." + COMMA@458..459 "," + WHITESPACE@459..460 " " + BIND_PAT@460..464 + NAME@460..464 + IDENT@460..464 "cons" + R_BRACK@464..465 "]" + WHITESPACE@465..466 " " + EQ@466..467 "=" + WHITESPACE@467..468 " " + TUPLE_EXPR@468..470 + L_PAREN@468..469 "(" + R_PAREN@469..470 ")" + SEMICOLON@470..471 ";" + WHITESPACE@471..476 "\n " + LET_STMT@476..512 + LET_KW@476..479 "let" + WHITESPACE@479..480 " " + SLICE_PAT@480..506 + L_BRACK@480..481 "[" + BIND_PAT@481..485 + NAME@481..485 + IDENT@481..485 "head" + COMMA@485..486 "," + WHITESPACE@486..487 " " + DOT_DOT_PAT@487..489 + DOT2@487..489 ".." + COMMA@489..490 "," + WHITESPACE@490..491 " " + BIND_PAT@491..494 + NAME@491..494 + IDENT@491..494 "mid" + COMMA@494..495 "," + WHITESPACE@495..496 " " + BIND_PAT@496..505 + NAME@496..500 + IDENT@496..500 "tail" + WHITESPACE@500..501 " " + AT@501..502 "@" + WHITESPACE@502..503 " " + DOT_DOT_PAT@503..505 + DOT2@503..505 ".." + R_BRACK@505..506 "]" + WHITESPACE@506..507 " " + EQ@507..508 "=" + WHITESPACE@508..509 " " + TUPLE_EXPR@509..511 + L_PAREN@509..510 "(" + R_PAREN@510..511 ")" + SEMICOLON@511..512 ";" + WHITESPACE@512..517 "\n " + LET_STMT@517..552 + LET_KW@517..520 "let" + WHITESPACE@520..521 " " + SLICE_PAT@521..546 + L_BRACK@521..522 "[" + BIND_PAT@522..526 + NAME@522..526 + IDENT@522..526 "head" + COMMA@526..527 "," + WHITESPACE@527..528 " " + DOT_DOT_PAT@528..530 + DOT2@528..530 ".." + COMMA@530..531 "," + WHITESPACE@531..532 " " + BIND_PAT@532..535 + NAME@532..535 + IDENT@532..535 "mid" + COMMA@535..536 "," + WHITESPACE@536..537 " " + DOT_DOT_PAT@537..539 + DOT2@537..539 ".." + COMMA@539..540 "," + WHITESPACE@540..541 " " + BIND_PAT@541..545 + NAME@541..545 + IDENT@541..545 "cons" + R_BRACK@545..546 "]" + WHITESPACE@546..547 " " + EQ@547..548 "=" + WHITESPACE@548..549 " " + TUPLE_EXPR@549..551 + L_PAREN@549..550 "(" + R_PAREN@550..551 ")" + SEMICOLON@551..552 ";" + WHITESPACE@552..553 "\n" + R_CURLY@553..554 "}" + 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 cac2ffdcf8..10434b637e 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 @@ -1,76 +1,76 @@ -SOURCE_FILE@[0; 63) - FN_DEF@[0; 62) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 62) - BLOCK@[9; 62) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 35) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - RECORD_PAT@[19; 29) - PATH@[19; 20) - PATH_SEGMENT@[19; 20) - NAME_REF@[19; 20) - IDENT@[19; 20) "S" - WHITESPACE@[20; 21) " " - RECORD_FIELD_PAT_LIST@[21; 29) - L_CURLY@[21; 22) "{" - WHITESPACE@[22; 23) " " - RECORD_FIELD_PAT@[23; 27) - NAME_REF@[23; 24) - INT_NUMBER@[23; 24) "0" - COLON@[24; 25) ":" - WHITESPACE@[25; 26) " " - LITERAL_PAT@[26; 27) - LITERAL@[26; 27) - INT_NUMBER@[26; 27) "1" - WHITESPACE@[27; 28) " " - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) " " - EQ@[30; 31) "=" - WHITESPACE@[31; 32) " " - TUPLE_EXPR@[32; 34) - L_PAREN@[32; 33) "(" - R_PAREN@[33; 34) ")" - SEMICOLON@[34; 35) ";" - WHITESPACE@[35; 40) "\n " - LET_STMT@[40; 60) - LET_KW@[40; 43) "let" - WHITESPACE@[43; 44) " " - RECORD_PAT@[44; 54) - PATH@[44; 45) - PATH_SEGMENT@[44; 45) - NAME_REF@[44; 45) - IDENT@[44; 45) "S" - WHITESPACE@[45; 46) " " - RECORD_FIELD_PAT_LIST@[46; 54) - L_CURLY@[46; 47) "{" - WHITESPACE@[47; 48) " " - RECORD_FIELD_PAT@[48; 52) - NAME_REF@[48; 49) - IDENT@[48; 49) "x" - COLON@[49; 50) ":" - WHITESPACE@[50; 51) " " - LITERAL_PAT@[51; 52) - LITERAL@[51; 52) - INT_NUMBER@[51; 52) "1" - WHITESPACE@[52; 53) " " - R_CURLY@[53; 54) "}" - WHITESPACE@[54; 55) " " - EQ@[55; 56) "=" - WHITESPACE@[56; 57) " " - TUPLE_EXPR@[57; 59) - L_PAREN@[57; 58) "(" - R_PAREN@[58; 59) ")" - SEMICOLON@[59; 60) ";" - WHITESPACE@[60; 61) "\n" - R_CURLY@[61; 62) "}" - WHITESPACE@[62; 63) "\n" +SOURCE_FILE@0..63 + FN_DEF@0..62 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..62 + BLOCK@9..62 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..35 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + RECORD_PAT@19..29 + PATH@19..20 + PATH_SEGMENT@19..20 + NAME_REF@19..20 + IDENT@19..20 "S" + WHITESPACE@20..21 " " + RECORD_FIELD_PAT_LIST@21..29 + L_CURLY@21..22 "{" + WHITESPACE@22..23 " " + RECORD_FIELD_PAT@23..27 + NAME_REF@23..24 + INT_NUMBER@23..24 "0" + COLON@24..25 ":" + WHITESPACE@25..26 " " + LITERAL_PAT@26..27 + LITERAL@26..27 + INT_NUMBER@26..27 "1" + WHITESPACE@27..28 " " + R_CURLY@28..29 "}" + WHITESPACE@29..30 " " + EQ@30..31 "=" + WHITESPACE@31..32 " " + TUPLE_EXPR@32..34 + L_PAREN@32..33 "(" + R_PAREN@33..34 ")" + SEMICOLON@34..35 ";" + WHITESPACE@35..40 "\n " + LET_STMT@40..60 + LET_KW@40..43 "let" + WHITESPACE@43..44 " " + RECORD_PAT@44..54 + PATH@44..45 + PATH_SEGMENT@44..45 + NAME_REF@44..45 + IDENT@44..45 "S" + WHITESPACE@45..46 " " + RECORD_FIELD_PAT_LIST@46..54 + L_CURLY@46..47 "{" + WHITESPACE@47..48 " " + RECORD_FIELD_PAT@48..52 + NAME_REF@48..49 + IDENT@48..49 "x" + COLON@49..50 ":" + WHITESPACE@50..51 " " + LITERAL_PAT@51..52 + LITERAL@51..52 + INT_NUMBER@51..52 "1" + WHITESPACE@52..53 " " + R_CURLY@53..54 "}" + WHITESPACE@54..55 " " + EQ@55..56 "=" + WHITESPACE@56..57 " " + TUPLE_EXPR@57..59 + L_PAREN@57..58 "(" + R_PAREN@58..59 ")" + SEMICOLON@59..60 ";" + WHITESPACE@60..61 "\n" + R_CURLY@61..62 "}" + 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 d2f6d8fde6..66ad546b90 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 @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 43) - FN_DEF@[0; 42) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 42) - BLOCK@[9; 42) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - LET_STMT@[15; 40) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - PLACEHOLDER_PAT@[19; 20) - UNDERSCORE@[19; 20) "_" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - WHITESPACE@[22; 23) " " - CAST_EXPR@[23; 39) - REF_EXPR@[23; 25) - AMP@[23; 24) "&" - LITERAL@[24; 25) - INT_NUMBER@[24; 25) "1" - WHITESPACE@[25; 26) " " - AS_KW@[26; 28) "as" - WHITESPACE@[28; 29) " " - POINTER_TYPE@[29; 39) - STAR@[29; 30) "*" - CONST_KW@[30; 35) "const" - WHITESPACE@[35; 36) " " - PATH_TYPE@[36; 39) - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "i32" - SEMICOLON@[39; 40) ";" - WHITESPACE@[40; 41) "\n" - R_CURLY@[41; 42) "}" - WHITESPACE@[42; 43) "\n" +SOURCE_FILE@0..43 + FN_DEF@0..42 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..42 + BLOCK@9..42 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + LET_STMT@15..40 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + PLACEHOLDER_PAT@19..20 + UNDERSCORE@19..20 "_" + WHITESPACE@20..21 " " + EQ@21..22 "=" + WHITESPACE@22..23 " " + CAST_EXPR@23..39 + REF_EXPR@23..25 + AMP@23..24 "&" + LITERAL@24..25 + INT_NUMBER@24..25 "1" + WHITESPACE@25..26 " " + AS_KW@26..28 "as" + WHITESPACE@28..29 " " + POINTER_TYPE@29..39 + STAR@29..30 "*" + CONST_KW@30..35 "const" + WHITESPACE@35..36 " " + PATH_TYPE@36..39 + PATH@36..39 + PATH_SEGMENT@36..39 + NAME_REF@36..39 + IDENT@36..39 "i32" + SEMICOLON@39..40 ";" + WHITESPACE@40..41 "\n" + R_CURLY@41..42 "}" + 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 21161f7bf7..4b9b8e0aba 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 @@ -1,23 +1,23 @@ -SOURCE_FILE@[0; 24) - STRUCT_DEF@[0; 23) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - TYPE_PARAM_LIST@[8; 22) - L_ANGLE@[8; 9) "<" - CONST_PARAM@[9; 21) - CONST_KW@[9; 14) "const" - WHITESPACE@[14; 15) " " - NAME@[15; 16) - IDENT@[15; 16) "N" - COLON@[16; 17) ":" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 21) - PATH@[18; 21) - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "u32" - R_ANGLE@[21; 22) ">" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 24) "\n" +SOURCE_FILE@0..24 + STRUCT_DEF@0..23 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + TYPE_PARAM_LIST@8..22 + L_ANGLE@8..9 "<" + CONST_PARAM@9..21 + CONST_KW@9..14 "const" + WHITESPACE@14..15 " " + NAME@15..16 + IDENT@15..16 "N" + COLON@16..17 ":" + WHITESPACE@17..18 " " + PATH_TYPE@18..21 + PATH@18..21 + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "u32" + R_ANGLE@21..22 ">" + SEMICOLON@22..23 ";" + WHITESPACE@23..24 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rast b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rast index 3556099bd0..6655aeab13 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rast @@ -1,45 +1,45 @@ -SOURCE_FILE@[0; 50) - MACRO_DEF@[0; 28) - MACRO_KW@[0; 5) "macro" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "m" - WHITESPACE@[7; 8) " " - TOKEN_TREE@[8; 28) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 10) " " - TOKEN_TREE@[10; 20) - L_PAREN@[10; 11) "(" - DOLLAR@[11; 12) "$" - IDENT@[12; 13) "i" - COLON@[13; 14) ":" - IDENT@[14; 19) "ident" - R_PAREN@[19; 20) ")" - WHITESPACE@[20; 21) " " - EQ@[21; 22) "=" - R_ANGLE@[22; 23) ">" - WHITESPACE@[23; 24) " " - TOKEN_TREE@[24; 26) - L_CURLY@[24; 25) "{" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 27) " " - R_CURLY@[27; 28) "}" - WHITESPACE@[28; 29) "\n" - MACRO_DEF@[29; 49) - MACRO_KW@[29; 34) "macro" - WHITESPACE@[34; 35) " " - NAME@[35; 36) - IDENT@[35; 36) "m" - TOKEN_TREE@[36; 49) - TOKEN_TREE@[36; 46) - L_PAREN@[36; 37) "(" - DOLLAR@[37; 38) "$" - IDENT@[38; 39) "i" - COLON@[39; 40) ":" - IDENT@[40; 45) "ident" - R_PAREN@[45; 46) ")" - WHITESPACE@[46; 47) " " - TOKEN_TREE@[47; 49) - L_CURLY@[47; 48) "{" - R_CURLY@[48; 49) "}" - WHITESPACE@[49; 50) "\n" +SOURCE_FILE@0..50 + MACRO_DEF@0..28 + MACRO_KW@0..5 "macro" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "m" + WHITESPACE@7..8 " " + TOKEN_TREE@8..28 + L_CURLY@8..9 "{" + WHITESPACE@9..10 " " + TOKEN_TREE@10..20 + L_PAREN@10..11 "(" + DOLLAR@11..12 "$" + IDENT@12..13 "i" + COLON@13..14 ":" + IDENT@14..19 "ident" + R_PAREN@19..20 ")" + WHITESPACE@20..21 " " + EQ@21..22 "=" + R_ANGLE@22..23 ">" + WHITESPACE@23..24 " " + TOKEN_TREE@24..26 + L_CURLY@24..25 "{" + R_CURLY@25..26 "}" + WHITESPACE@26..27 " " + R_CURLY@27..28 "}" + WHITESPACE@28..29 "\n" + MACRO_DEF@29..49 + MACRO_KW@29..34 "macro" + WHITESPACE@34..35 " " + NAME@35..36 + IDENT@35..36 "m" + TOKEN_TREE@36..49 + TOKEN_TREE@36..46 + L_PAREN@36..37 "(" + DOLLAR@37..38 "$" + IDENT@38..39 "i" + COLON@39..40 ":" + IDENT@40..45 "ident" + R_PAREN@45..46 ")" + WHITESPACE@46..47 " " + TOKEN_TREE@47..49 + L_CURLY@47..48 "{" + R_CURLY@48..49 "}" + WHITESPACE@49..50 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rast b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rast index cfd79d9c26..1c527f60b9 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rast @@ -1,21 +1,21 @@ -SOURCE_FILE@[0; 24) - MACRO_DEF@[0; 23) - VISIBILITY@[0; 3) - PUB_KW@[0; 3) "pub" - WHITESPACE@[3; 4) " " - MACRO_KW@[4; 9) "macro" - WHITESPACE@[9; 10) " " - NAME@[10; 11) - IDENT@[10; 11) "m" - TOKEN_TREE@[11; 23) - TOKEN_TREE@[11; 20) - L_PAREN@[11; 12) "(" - DOLLAR@[12; 13) "$" - COLON@[13; 14) ":" - IDENT@[14; 19) "ident" - R_PAREN@[19; 20) ")" - WHITESPACE@[20; 21) " " - TOKEN_TREE@[21; 23) - L_CURLY@[21; 22) "{" - R_CURLY@[22; 23) "}" - WHITESPACE@[23; 24) "\n" +SOURCE_FILE@0..24 + MACRO_DEF@0..23 + VISIBILITY@0..3 + PUB_KW@0..3 "pub" + WHITESPACE@3..4 " " + MACRO_KW@4..9 "macro" + WHITESPACE@9..10 " " + NAME@10..11 + IDENT@10..11 "m" + TOKEN_TREE@11..23 + TOKEN_TREE@11..20 + L_PAREN@11..12 "(" + DOLLAR@12..13 "$" + COLON@13..14 ":" + IDENT@14..19 "ident" + R_PAREN@19..20 ")" + WHITESPACE@20..21 " " + TOKEN_TREE@21..23 + L_CURLY@21..22 "{" + R_CURLY@22..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 1f297e4791..3c00a26477 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 @@ -1,47 +1,47 @@ -SOURCE_FILE@[0; 40) - CONST_DEF@[0; 39) - CONST_KW@[0; 5) "const" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "A" - COLON@[7; 8) ":" - WHITESPACE@[8; 9) " " - REFERENCE_TYPE@[9; 15) - AMP@[9; 10) "&" - SLICE_TYPE@[10; 15) - L_BRACK@[10; 11) "[" - PATH_TYPE@[11; 14) - PATH@[11; 14) - PATH_SEGMENT@[11; 14) - NAME_REF@[11; 14) - IDENT@[11; 14) "i64" - R_BRACK@[14; 15) "]" - WHITESPACE@[15; 16) " " - EQ@[16; 17) "=" - WHITESPACE@[17; 18) " " - REF_EXPR@[18; 38) - AMP@[18; 19) "&" - ARRAY_EXPR@[19; 38) - L_BRACK@[19; 20) "[" - LITERAL@[20; 21) - INT_NUMBER@[20; 21) "1" - COMMA@[21; 22) "," - WHITESPACE@[22; 23) " " - LITERAL@[23; 37) - ATTR@[23; 35) - POUND@[23; 24) "#" - L_BRACK@[24; 25) "[" - PATH@[25; 28) - PATH_SEGMENT@[25; 28) - NAME_REF@[25; 28) - IDENT@[25; 28) "cfg" - TOKEN_TREE@[28; 34) - L_PAREN@[28; 29) "(" - IDENT@[29; 33) "test" - R_PAREN@[33; 34) ")" - R_BRACK@[34; 35) "]" - WHITESPACE@[35; 36) " " - INT_NUMBER@[36; 37) "2" - R_BRACK@[37; 38) "]" - SEMICOLON@[38; 39) ";" - WHITESPACE@[39; 40) "\n" +SOURCE_FILE@0..40 + CONST_DEF@0..39 + CONST_KW@0..5 "const" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "A" + COLON@7..8 ":" + WHITESPACE@8..9 " " + REFERENCE_TYPE@9..15 + AMP@9..10 "&" + SLICE_TYPE@10..15 + L_BRACK@10..11 "[" + PATH_TYPE@11..14 + PATH@11..14 + PATH_SEGMENT@11..14 + NAME_REF@11..14 + IDENT@11..14 "i64" + R_BRACK@14..15 "]" + WHITESPACE@15..16 " " + EQ@16..17 "=" + WHITESPACE@17..18 " " + REF_EXPR@18..38 + AMP@18..19 "&" + ARRAY_EXPR@19..38 + L_BRACK@19..20 "[" + LITERAL@20..21 + INT_NUMBER@20..21 "1" + COMMA@21..22 "," + WHITESPACE@22..23 " " + LITERAL@23..37 + ATTR@23..35 + POUND@23..24 "#" + L_BRACK@24..25 "[" + PATH@25..28 + PATH_SEGMENT@25..28 + NAME_REF@25..28 + IDENT@25..28 "cfg" + TOKEN_TREE@28..34 + L_PAREN@28..29 "(" + IDENT@29..33 "test" + R_PAREN@33..34 ")" + R_BRACK@34..35 "]" + WHITESPACE@35..36 " " + INT_NUMBER@36..37 "2" + R_BRACK@37..38 "]" + SEMICOLON@38..39 ";" + WHITESPACE@39..40 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast index 2d46eebb3d..e70c3b710f 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_impl_type_params.rast @@ -1,38 +1,38 @@ -SOURCE_FILE@[0; 29) - IMPL_DEF@[0; 28) - IMPL_KW@[0; 4) "impl" - TYPE_PARAM_LIST@[4; 18) - L_ANGLE@[4; 5) "<" - CONST_PARAM@[5; 17) - CONST_KW@[5; 10) "const" - WHITESPACE@[10; 11) " " - NAME@[11; 12) - IDENT@[11; 12) "N" - COLON@[12; 13) ":" - WHITESPACE@[13; 14) " " - PATH_TYPE@[14; 17) - PATH@[14; 17) - PATH_SEGMENT@[14; 17) - NAME_REF@[14; 17) - IDENT@[14; 17) "u32" - R_ANGLE@[17; 18) ">" - WHITESPACE@[18; 19) " " - PATH_TYPE@[19; 25) - PATH@[19; 25) - PATH_SEGMENT@[19; 25) - NAME_REF@[19; 22) - IDENT@[19; 22) "Bar" - TYPE_ARG_LIST@[22; 25) - L_ANGLE@[22; 23) "<" - TYPE_ARG@[23; 24) - PATH_TYPE@[23; 24) - PATH@[23; 24) - PATH_SEGMENT@[23; 24) - NAME_REF@[23; 24) - IDENT@[23; 24) "N" - R_ANGLE@[24; 25) ">" - WHITESPACE@[25; 26) " " - ITEM_LIST@[26; 28) - L_CURLY@[26; 27) "{" - R_CURLY@[27; 28) "}" - WHITESPACE@[28; 29) "\n" +SOURCE_FILE@0..29 + IMPL_DEF@0..28 + IMPL_KW@0..4 "impl" + TYPE_PARAM_LIST@4..18 + L_ANGLE@4..5 "<" + CONST_PARAM@5..17 + CONST_KW@5..10 "const" + WHITESPACE@10..11 " " + NAME@11..12 + IDENT@11..12 "N" + COLON@12..13 ":" + WHITESPACE@13..14 " " + PATH_TYPE@14..17 + PATH@14..17 + PATH_SEGMENT@14..17 + NAME_REF@14..17 + IDENT@14..17 "u32" + R_ANGLE@17..18 ">" + WHITESPACE@18..19 " " + PATH_TYPE@19..25 + PATH@19..25 + PATH_SEGMENT@19..25 + NAME_REF@19..22 + IDENT@19..22 "Bar" + TYPE_ARG_LIST@22..25 + L_ANGLE@22..23 "<" + TYPE_ARG@23..24 + PATH_TYPE@23..24 + PATH@23..24 + PATH_SEGMENT@23..24 + NAME_REF@23..24 + IDENT@23..24 "N" + R_ANGLE@24..25 ">" + WHITESPACE@25..26 " " + ITEM_LIST@26..28 + L_CURLY@26..27 "{" + R_CURLY@27..28 "}" + WHITESPACE@28..29 "\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 167c0fffab..48d73a4e75 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 @@ -1,128 +1,128 @@ -SOURCE_FILE@[0; 83) - TRAIT_DEF@[0; 18) - TRAIT_KW@[0; 5) "trait" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "Z" - TYPE_PARAM_LIST@[7; 10) - L_ANGLE@[7; 8) "<" - TYPE_PARAM@[8; 9) - NAME@[8; 9) - IDENT@[8; 9) "U" - R_ANGLE@[9; 10) ">" - WHITESPACE@[10; 11) " " - EQ@[11; 12) "=" - WHITESPACE@[12; 13) " " - TYPE_BOUND_LIST@[13; 17) - TYPE_BOUND@[13; 17) - PATH_TYPE@[13; 17) - PATH@[13; 17) - PATH_SEGMENT@[13; 17) - NAME_REF@[13; 14) - IDENT@[13; 14) "T" - TYPE_ARG_LIST@[14; 17) - L_ANGLE@[14; 15) "<" - TYPE_ARG@[15; 16) - PATH_TYPE@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "U" - R_ANGLE@[16; 17) ">" - SEMICOLON@[17; 18) ";" - WHITESPACE@[18; 19) "\n" - TRAIT_DEF@[19; 51) - TRAIT_KW@[19; 24) "trait" - WHITESPACE@[24; 25) " " - NAME@[25; 26) - IDENT@[25; 26) "Z" - TYPE_PARAM_LIST@[26; 29) - L_ANGLE@[26; 27) "<" - TYPE_PARAM@[27; 28) - NAME@[27; 28) - IDENT@[27; 28) "U" - R_ANGLE@[28; 29) ">" - WHITESPACE@[29; 30) " " - EQ@[30; 31) "=" - WHITESPACE@[31; 32) " " - TYPE_BOUND_LIST@[32; 36) - TYPE_BOUND@[32; 36) - PATH_TYPE@[32; 36) - PATH@[32; 36) - PATH_SEGMENT@[32; 36) - NAME_REF@[32; 33) - IDENT@[32; 33) "T" - TYPE_ARG_LIST@[33; 36) - L_ANGLE@[33; 34) "<" - TYPE_ARG@[34; 35) - PATH_TYPE@[34; 35) - PATH@[34; 35) - PATH_SEGMENT@[34; 35) - NAME_REF@[34; 35) - IDENT@[34; 35) "U" - R_ANGLE@[35; 36) ">" - WHITESPACE@[36; 37) " " - WHERE_CLAUSE@[37; 50) - WHERE_KW@[37; 42) "where" - WHITESPACE@[42; 43) " " - WHERE_PRED@[43; 50) - PATH_TYPE@[43; 44) - PATH@[43; 44) - PATH_SEGMENT@[43; 44) - NAME_REF@[43; 44) - IDENT@[43; 44) "U" - COLON@[44; 45) ":" - WHITESPACE@[45; 46) " " - TYPE_BOUND_LIST@[46; 50) - TYPE_BOUND@[46; 50) - PATH_TYPE@[46; 50) - PATH@[46; 50) - PATH_SEGMENT@[46; 50) - NAME_REF@[46; 50) - IDENT@[46; 50) "Copy" - SEMICOLON@[50; 51) ";" - WHITESPACE@[51; 52) "\n" - TRAIT_DEF@[52; 82) - TRAIT_KW@[52; 57) "trait" - WHITESPACE@[57; 58) " " - NAME@[58; 59) - IDENT@[58; 59) "Z" - TYPE_PARAM_LIST@[59; 62) - L_ANGLE@[59; 60) "<" - TYPE_PARAM@[60; 61) - NAME@[60; 61) - IDENT@[60; 61) "U" - R_ANGLE@[61; 62) ">" - WHITESPACE@[62; 63) " " - EQ@[63; 64) "=" - WHITESPACE@[64; 65) " " - TYPE_BOUND_LIST@[65; 65) - WHERE_CLAUSE@[65; 81) - WHERE_KW@[65; 70) "where" - WHITESPACE@[70; 71) " " - WHERE_PRED@[71; 81) - PATH_TYPE@[71; 75) - PATH@[71; 75) - PATH_SEGMENT@[71; 75) - NAME_REF@[71; 75) - IDENT@[71; 75) "Self" - COLON@[75; 76) ":" - WHITESPACE@[76; 77) " " - TYPE_BOUND_LIST@[77; 81) - TYPE_BOUND@[77; 81) - PATH_TYPE@[77; 81) - PATH@[77; 81) - PATH_SEGMENT@[77; 81) - NAME_REF@[77; 78) - IDENT@[77; 78) "T" - TYPE_ARG_LIST@[78; 81) - L_ANGLE@[78; 79) "<" - TYPE_ARG@[79; 80) - PATH_TYPE@[79; 80) - PATH@[79; 80) - PATH_SEGMENT@[79; 80) - NAME_REF@[79; 80) - IDENT@[79; 80) "U" - R_ANGLE@[80; 81) ">" - SEMICOLON@[81; 82) ";" - WHITESPACE@[82; 83) "\n" +SOURCE_FILE@0..83 + TRAIT_DEF@0..18 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "Z" + TYPE_PARAM_LIST@7..10 + L_ANGLE@7..8 "<" + TYPE_PARAM@8..9 + NAME@8..9 + IDENT@8..9 "U" + R_ANGLE@9..10 ">" + WHITESPACE@10..11 " " + EQ@11..12 "=" + WHITESPACE@12..13 " " + TYPE_BOUND_LIST@13..17 + TYPE_BOUND@13..17 + PATH_TYPE@13..17 + PATH@13..17 + PATH_SEGMENT@13..17 + NAME_REF@13..14 + IDENT@13..14 "T" + TYPE_ARG_LIST@14..17 + L_ANGLE@14..15 "<" + TYPE_ARG@15..16 + PATH_TYPE@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "U" + R_ANGLE@16..17 ">" + SEMICOLON@17..18 ";" + WHITESPACE@18..19 "\n" + TRAIT_DEF@19..51 + TRAIT_KW@19..24 "trait" + WHITESPACE@24..25 " " + NAME@25..26 + IDENT@25..26 "Z" + TYPE_PARAM_LIST@26..29 + L_ANGLE@26..27 "<" + TYPE_PARAM@27..28 + NAME@27..28 + IDENT@27..28 "U" + R_ANGLE@28..29 ">" + WHITESPACE@29..30 " " + EQ@30..31 "=" + WHITESPACE@31..32 " " + TYPE_BOUND_LIST@32..36 + TYPE_BOUND@32..36 + PATH_TYPE@32..36 + PATH@32..36 + PATH_SEGMENT@32..36 + NAME_REF@32..33 + IDENT@32..33 "T" + TYPE_ARG_LIST@33..36 + L_ANGLE@33..34 "<" + TYPE_ARG@34..35 + PATH_TYPE@34..35 + PATH@34..35 + PATH_SEGMENT@34..35 + NAME_REF@34..35 + IDENT@34..35 "U" + R_ANGLE@35..36 ">" + WHITESPACE@36..37 " " + WHERE_CLAUSE@37..50 + WHERE_KW@37..42 "where" + WHITESPACE@42..43 " " + WHERE_PRED@43..50 + PATH_TYPE@43..44 + PATH@43..44 + PATH_SEGMENT@43..44 + NAME_REF@43..44 + IDENT@43..44 "U" + COLON@44..45 ":" + WHITESPACE@45..46 " " + TYPE_BOUND_LIST@46..50 + TYPE_BOUND@46..50 + PATH_TYPE@46..50 + PATH@46..50 + PATH_SEGMENT@46..50 + NAME_REF@46..50 + IDENT@46..50 "Copy" + SEMICOLON@50..51 ";" + WHITESPACE@51..52 "\n" + TRAIT_DEF@52..82 + TRAIT_KW@52..57 "trait" + WHITESPACE@57..58 " " + NAME@58..59 + IDENT@58..59 "Z" + TYPE_PARAM_LIST@59..62 + L_ANGLE@59..60 "<" + TYPE_PARAM@60..61 + NAME@60..61 + IDENT@60..61 "U" + R_ANGLE@61..62 ">" + WHITESPACE@62..63 " " + EQ@63..64 "=" + WHITESPACE@64..65 " " + TYPE_BOUND_LIST@65..65 + WHERE_CLAUSE@65..81 + WHERE_KW@65..70 "where" + WHITESPACE@70..71 " " + WHERE_PRED@71..81 + PATH_TYPE@71..75 + PATH@71..75 + PATH_SEGMENT@71..75 + NAME_REF@71..75 + IDENT@71..75 "Self" + COLON@75..76 ":" + WHITESPACE@76..77 " " + TYPE_BOUND_LIST@77..81 + TYPE_BOUND@77..81 + PATH_TYPE@77..81 + PATH@77..81 + PATH_SEGMENT@77..81 + NAME_REF@77..78 + IDENT@77..78 "T" + TYPE_ARG_LIST@78..81 + L_ANGLE@78..79 "<" + TYPE_ARG@79..80 + PATH_TYPE@79..80 + PATH@79..80 + PATH_SEGMENT@79..80 + NAME_REF@79..80 + IDENT@79..80 "U" + R_ANGLE@80..81 ">" + SEMICOLON@81..82 ";" + WHITESPACE@82..83 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast b/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast index 8092d70099..c2e290a62b 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0152_arg_with_attr.rast @@ -1,37 +1,37 @@ -SOURCE_FILE@[0; 34) - FN_DEF@[0; 33) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 33) - BLOCK@[10; 33) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - CALL_EXPR@[16; 31) - PATH_EXPR@[16; 19) - PATH@[16; 19) - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "foo" - ARG_LIST@[19; 31) - L_PAREN@[19; 20) "(" - LITERAL@[20; 30) - ATTR@[20; 27) - POUND@[20; 21) "#" - L_BRACK@[21; 22) "[" - PATH@[22; 26) - PATH_SEGMENT@[22; 26) - NAME_REF@[22; 26) - IDENT@[22; 26) "attr" - R_BRACK@[26; 27) "]" - WHITESPACE@[27; 28) " " - INT_NUMBER@[28; 30) "92" - R_PAREN@[30; 31) ")" - WHITESPACE@[31; 32) "\n" - R_CURLY@[32; 33) "}" - WHITESPACE@[33; 34) "\n" +SOURCE_FILE@0..34 + FN_DEF@0..33 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..33 + BLOCK@10..33 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + CALL_EXPR@16..31 + PATH_EXPR@16..19 + PATH@16..19 + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "foo" + ARG_LIST@19..31 + L_PAREN@19..20 "(" + LITERAL@20..30 + ATTR@20..27 + POUND@20..21 "#" + L_BRACK@21..22 "[" + PATH@22..26 + PATH_SEGMENT@22..26 + NAME_REF@22..26 + IDENT@22..26 "attr" + R_BRACK@26..27 "]" + WHITESPACE@27..28 " " + INT_NUMBER@28..30 "92" + R_PAREN@30..31 ")" + WHITESPACE@31..32 "\n" + R_CURLY@32..33 "}" + WHITESPACE@33..34 "\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 ee1bd361dd..861065362a 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 @@ -1,58 +1,58 @@ -SOURCE_FILE@[0; 55) - TYPE_ALIAS_DEF@[0; 24) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 8) - IDENT@[5; 8) "Foo" - WHITESPACE@[8; 9) " " - EQ@[9; 10) "=" - WHITESPACE@[10; 11) " " - FN_POINTER_TYPE@[11; 23) - FN_KW@[11; 13) "fn" - PARAM_LIST@[13; 23) - L_PAREN@[13; 14) "(" - PARAM@[14; 22) - PATH_TYPE@[14; 22) - PATH@[14; 22) - PATH@[14; 17) - PATH_SEGMENT@[14; 17) - NAME_REF@[14; 17) - IDENT@[14; 17) "Bar" - COLON2@[17; 19) "::" - PATH_SEGMENT@[19; 22) - NAME_REF@[19; 22) - IDENT@[19; 22) "Baz" - R_PAREN@[22; 23) ")" - SEMICOLON@[23; 24) ";" - WHITESPACE@[24; 25) "\n" - TYPE_ALIAS_DEF@[25; 54) - TYPE_KW@[25; 29) "type" - WHITESPACE@[29; 30) " " - NAME@[30; 33) - IDENT@[30; 33) "Qux" - WHITESPACE@[33; 34) " " - EQ@[34; 35) "=" - WHITESPACE@[35; 36) " " - FN_POINTER_TYPE@[36; 53) - FN_KW@[36; 38) "fn" - PARAM_LIST@[38; 53) - L_PAREN@[38; 39) "(" - PARAM@[39; 52) - BIND_PAT@[39; 42) - NAME@[39; 42) - IDENT@[39; 42) "baz" - COLON@[42; 43) ":" - WHITESPACE@[43; 44) " " - PATH_TYPE@[44; 52) - PATH@[44; 52) - PATH@[44; 47) - PATH_SEGMENT@[44; 47) - NAME_REF@[44; 47) - IDENT@[44; 47) "Bar" - COLON2@[47; 49) "::" - PATH_SEGMENT@[49; 52) - NAME_REF@[49; 52) - IDENT@[49; 52) "Baz" - R_PAREN@[52; 53) ")" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 55) "\n" +SOURCE_FILE@0..55 + TYPE_ALIAS_DEF@0..24 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..8 + IDENT@5..8 "Foo" + WHITESPACE@8..9 " " + EQ@9..10 "=" + WHITESPACE@10..11 " " + FN_POINTER_TYPE@11..23 + FN_KW@11..13 "fn" + PARAM_LIST@13..23 + L_PAREN@13..14 "(" + PARAM@14..22 + PATH_TYPE@14..22 + PATH@14..22 + PATH@14..17 + PATH_SEGMENT@14..17 + NAME_REF@14..17 + IDENT@14..17 "Bar" + COLON2@17..19 "::" + PATH_SEGMENT@19..22 + NAME_REF@19..22 + IDENT@19..22 "Baz" + R_PAREN@22..23 ")" + SEMICOLON@23..24 ";" + WHITESPACE@24..25 "\n" + TYPE_ALIAS_DEF@25..54 + TYPE_KW@25..29 "type" + WHITESPACE@29..30 " " + NAME@30..33 + IDENT@30..33 "Qux" + WHITESPACE@33..34 " " + EQ@34..35 "=" + WHITESPACE@35..36 " " + FN_POINTER_TYPE@36..53 + FN_KW@36..38 "fn" + PARAM_LIST@38..53 + L_PAREN@38..39 "(" + PARAM@39..52 + BIND_PAT@39..42 + NAME@39..42 + IDENT@39..42 "baz" + COLON@42..43 ":" + WHITESPACE@43..44 " " + PATH_TYPE@44..52 + PATH@44..52 + PATH@44..47 + PATH_SEGMENT@44..47 + NAME_REF@44..47 + IDENT@44..47 "Bar" + COLON2@47..49 "::" + PATH_SEGMENT@49..52 + NAME_REF@49..52 + IDENT@49..52 "Baz" + R_PAREN@52..53 ")" + SEMICOLON@53..54 ";" + 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 a5f8b64802..dad3dfe4d0 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 @@ -1,70 +1,70 @@ -SOURCE_FILE@[0; 63) - FN_DEF@[0; 62) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 62) - BLOCK@[10; 62) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 15) "\n " - LET_STMT@[15; 60) - LET_KW@[15; 18) "let" - WHITESPACE@[18; 19) " " - BIND_PAT@[19; 22) - NAME@[19; 22) - IDENT@[19; 22) "foo" - WHITESPACE@[22; 23) " " - EQ@[23; 24) "=" - WHITESPACE@[24; 25) " " - LAMBDA_EXPR@[25; 59) - PARAM_LIST@[25; 56) - PIPE@[25; 26) "|" - PARAM@[26; 29) - BIND_PAT@[26; 29) - NAME@[26; 29) - IDENT@[26; 29) "bar" - COMMA@[29; 30) "," - WHITESPACE@[30; 31) " " - PARAM@[31; 39) - BIND_PAT@[31; 34) - NAME@[31; 34) - IDENT@[31; 34) "baz" - COLON@[34; 35) ":" - WHITESPACE@[35; 36) " " - PATH_TYPE@[36; 39) - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "Baz" - COMMA@[39; 40) "," - WHITESPACE@[40; 41) " " - PARAM@[41; 55) - BIND_PAT@[41; 44) - NAME@[41; 44) - IDENT@[41; 44) "qux" - COLON@[44; 45) ":" - WHITESPACE@[45; 46) " " - PATH_TYPE@[46; 55) - PATH@[46; 55) - PATH@[46; 49) - PATH_SEGMENT@[46; 49) - NAME_REF@[46; 49) - IDENT@[46; 49) "Qux" - COLON2@[49; 51) "::" - PATH_SEGMENT@[51; 55) - NAME_REF@[51; 55) - IDENT@[51; 55) "Quux" - PIPE@[55; 56) "|" - WHITESPACE@[56; 57) " " - TUPLE_EXPR@[57; 59) - L_PAREN@[57; 58) "(" - R_PAREN@[58; 59) ")" - SEMICOLON@[59; 60) ";" - WHITESPACE@[60; 61) "\n" - R_CURLY@[61; 62) "}" - WHITESPACE@[62; 63) "\n" +SOURCE_FILE@0..63 + FN_DEF@0..62 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..62 + BLOCK@10..62 + L_CURLY@10..11 "{" + WHITESPACE@11..15 "\n " + LET_STMT@15..60 + LET_KW@15..18 "let" + WHITESPACE@18..19 " " + BIND_PAT@19..22 + NAME@19..22 + IDENT@19..22 "foo" + WHITESPACE@22..23 " " + EQ@23..24 "=" + WHITESPACE@24..25 " " + LAMBDA_EXPR@25..59 + PARAM_LIST@25..56 + PIPE@25..26 "|" + PARAM@26..29 + BIND_PAT@26..29 + NAME@26..29 + IDENT@26..29 "bar" + COMMA@29..30 "," + WHITESPACE@30..31 " " + PARAM@31..39 + BIND_PAT@31..34 + NAME@31..34 + IDENT@31..34 "baz" + COLON@34..35 ":" + WHITESPACE@35..36 " " + PATH_TYPE@36..39 + PATH@36..39 + PATH_SEGMENT@36..39 + NAME_REF@36..39 + IDENT@36..39 "Baz" + COMMA@39..40 "," + WHITESPACE@40..41 " " + PARAM@41..55 + BIND_PAT@41..44 + NAME@41..44 + IDENT@41..44 "qux" + COLON@44..45 ":" + WHITESPACE@45..46 " " + PATH_TYPE@46..55 + PATH@46..55 + PATH@46..49 + PATH_SEGMENT@46..49 + NAME_REF@46..49 + IDENT@46..49 "Qux" + COLON2@49..51 "::" + PATH_SEGMENT@51..55 + NAME_REF@51..55 + IDENT@51..55 "Quux" + PIPE@55..56 "|" + WHITESPACE@56..57 " " + TUPLE_EXPR@57..59 + L_PAREN@57..58 "(" + R_PAREN@58..59 ")" + SEMICOLON@59..60 ";" + WHITESPACE@60..61 "\n" + R_CURLY@61..62 "}" + WHITESPACE@62..63 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast b/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast index 103e254a62..3110bf5c0e 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0156_fn_def_param.rast @@ -1,44 +1,44 @@ -SOURCE_FILE@[0; 30) - FN_DEF@[0; 29) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 26) - L_PAREN@[6; 7) "(" - PARAM@[7; 25) - TUPLE_PAT@[7; 13) - L_PAREN@[7; 8) "(" - BIND_PAT@[8; 9) - NAME@[8; 9) - IDENT@[8; 9) "x" - COMMA@[9; 10) "," - WHITESPACE@[10; 11) " " - BIND_PAT@[11; 12) - NAME@[11; 12) - IDENT@[11; 12) "y" - R_PAREN@[12; 13) ")" - COLON@[13; 14) ":" - WHITESPACE@[14; 15) " " - TUPLE_TYPE@[15; 25) - L_PAREN@[15; 16) "(" - PATH_TYPE@[16; 19) - PATH@[16; 19) - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "i32" - COMMA@[19; 20) "," - WHITESPACE@[20; 21) " " - PATH_TYPE@[21; 24) - PATH@[21; 24) - PATH_SEGMENT@[21; 24) - NAME_REF@[21; 24) - IDENT@[21; 24) "i32" - R_PAREN@[24; 25) ")" - R_PAREN@[25; 26) ")" - WHITESPACE@[26; 27) " " - BLOCK_EXPR@[27; 29) - BLOCK@[27; 29) - L_CURLY@[27; 28) "{" - R_CURLY@[28; 29) "}" - WHITESPACE@[29; 30) "\n" +SOURCE_FILE@0..30 + FN_DEF@0..29 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..26 + L_PAREN@6..7 "(" + PARAM@7..25 + TUPLE_PAT@7..13 + L_PAREN@7..8 "(" + BIND_PAT@8..9 + NAME@8..9 + IDENT@8..9 "x" + COMMA@9..10 "," + WHITESPACE@10..11 " " + BIND_PAT@11..12 + NAME@11..12 + IDENT@11..12 "y" + R_PAREN@12..13 ")" + COLON@13..14 ":" + WHITESPACE@14..15 " " + TUPLE_TYPE@15..25 + L_PAREN@15..16 "(" + PATH_TYPE@16..19 + PATH@16..19 + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "i32" + COMMA@19..20 "," + WHITESPACE@20..21 " " + PATH_TYPE@21..24 + PATH@21..24 + PATH_SEGMENT@21..24 + NAME_REF@21..24 + IDENT@21..24 "i32" + R_PAREN@24..25 ")" + R_PAREN@25..26 ")" + WHITESPACE@26..27 " " + BLOCK_EXPR@27..29 + BLOCK@27..29 + L_CURLY@27..28 "{" + R_CURLY@28..29 "}" + WHITESPACE@29..30 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast index 3a196d3c03..3f3e6a9a2a 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0156_or_pattern.rast @@ -1,112 +1,112 @@ -SOURCE_FILE@[0; 130) - FN_DEF@[0; 129) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 129) - BLOCK@[10; 129) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - MATCH_EXPR@[16; 127) - MATCH_KW@[16; 21) "match" - WHITESPACE@[21; 22) " " - TUPLE_EXPR@[22; 24) - L_PAREN@[22; 23) "(" - R_PAREN@[23; 24) ")" - WHITESPACE@[24; 25) " " - MATCH_ARM_LIST@[25; 127) - L_CURLY@[25; 26) "{" - WHITESPACE@[26; 35) "\n " - MATCH_ARM@[35; 48) - PAREN_PAT@[35; 42) - L_PAREN@[35; 36) "(" - OR_PAT@[36; 41) - PLACEHOLDER_PAT@[36; 37) - UNDERSCORE@[36; 37) "_" - WHITESPACE@[37; 38) " " - PIPE@[38; 39) "|" - WHITESPACE@[39; 40) " " - PLACEHOLDER_PAT@[40; 41) - UNDERSCORE@[40; 41) "_" - R_PAREN@[41; 42) ")" - WHITESPACE@[42; 43) " " - FAT_ARROW@[43; 45) "=>" - WHITESPACE@[45; 46) " " - TUPLE_EXPR@[46; 48) - L_PAREN@[46; 47) "(" - R_PAREN@[47; 48) ")" - COMMA@[48; 49) "," - WHITESPACE@[49; 58) "\n " - MATCH_ARM@[58; 72) - REF_PAT@[58; 66) - AMP@[58; 59) "&" - PAREN_PAT@[59; 66) - L_PAREN@[59; 60) "(" - OR_PAT@[60; 65) - PLACEHOLDER_PAT@[60; 61) - UNDERSCORE@[60; 61) "_" - WHITESPACE@[61; 62) " " - PIPE@[62; 63) "|" - WHITESPACE@[63; 64) " " - PLACEHOLDER_PAT@[64; 65) - UNDERSCORE@[64; 65) "_" - R_PAREN@[65; 66) ")" - WHITESPACE@[66; 67) " " - FAT_ARROW@[67; 69) "=>" - WHITESPACE@[69; 70) " " - TUPLE_EXPR@[70; 72) - L_PAREN@[70; 71) "(" - R_PAREN@[71; 72) ")" - COMMA@[72; 73) "," - WHITESPACE@[73; 82) "\n " - MATCH_ARM@[82; 96) - TUPLE_PAT@[82; 90) - L_PAREN@[82; 83) "(" - OR_PAT@[83; 88) - PLACEHOLDER_PAT@[83; 84) - UNDERSCORE@[83; 84) "_" - WHITESPACE@[84; 85) " " - PIPE@[85; 86) "|" - WHITESPACE@[86; 87) " " - PLACEHOLDER_PAT@[87; 88) - UNDERSCORE@[87; 88) "_" - COMMA@[88; 89) "," - R_PAREN@[89; 90) ")" - WHITESPACE@[90; 91) " " - FAT_ARROW@[91; 93) "=>" - WHITESPACE@[93; 94) " " - TUPLE_EXPR@[94; 96) - L_PAREN@[94; 95) "(" - R_PAREN@[95; 96) ")" - COMMA@[96; 97) "," - WHITESPACE@[97; 106) "\n " - MATCH_ARM@[106; 120) - SLICE_PAT@[106; 114) - L_BRACK@[106; 107) "[" - OR_PAT@[107; 112) - PLACEHOLDER_PAT@[107; 108) - UNDERSCORE@[107; 108) "_" - WHITESPACE@[108; 109) " " - PIPE@[109; 110) "|" - WHITESPACE@[110; 111) " " - PLACEHOLDER_PAT@[111; 112) - UNDERSCORE@[111; 112) "_" - COMMA@[112; 113) "," - R_BRACK@[113; 114) "]" - WHITESPACE@[114; 115) " " - FAT_ARROW@[115; 117) "=>" - WHITESPACE@[117; 118) " " - TUPLE_EXPR@[118; 120) - L_PAREN@[118; 119) "(" - R_PAREN@[119; 120) ")" - COMMA@[120; 121) "," - WHITESPACE@[121; 126) "\n " - R_CURLY@[126; 127) "}" - WHITESPACE@[127; 128) "\n" - R_CURLY@[128; 129) "}" - WHITESPACE@[129; 130) "\n" +SOURCE_FILE@0..130 + FN_DEF@0..129 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..129 + BLOCK@10..129 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + MATCH_EXPR@16..127 + MATCH_KW@16..21 "match" + WHITESPACE@21..22 " " + TUPLE_EXPR@22..24 + L_PAREN@22..23 "(" + R_PAREN@23..24 ")" + WHITESPACE@24..25 " " + MATCH_ARM_LIST@25..127 + L_CURLY@25..26 "{" + WHITESPACE@26..35 "\n " + MATCH_ARM@35..48 + PAREN_PAT@35..42 + L_PAREN@35..36 "(" + OR_PAT@36..41 + PLACEHOLDER_PAT@36..37 + UNDERSCORE@36..37 "_" + WHITESPACE@37..38 " " + PIPE@38..39 "|" + WHITESPACE@39..40 " " + PLACEHOLDER_PAT@40..41 + UNDERSCORE@40..41 "_" + R_PAREN@41..42 ")" + WHITESPACE@42..43 " " + FAT_ARROW@43..45 "=>" + WHITESPACE@45..46 " " + TUPLE_EXPR@46..48 + L_PAREN@46..47 "(" + R_PAREN@47..48 ")" + COMMA@48..49 "," + WHITESPACE@49..58 "\n " + MATCH_ARM@58..72 + REF_PAT@58..66 + AMP@58..59 "&" + PAREN_PAT@59..66 + L_PAREN@59..60 "(" + OR_PAT@60..65 + PLACEHOLDER_PAT@60..61 + UNDERSCORE@60..61 "_" + WHITESPACE@61..62 " " + PIPE@62..63 "|" + WHITESPACE@63..64 " " + PLACEHOLDER_PAT@64..65 + UNDERSCORE@64..65 "_" + R_PAREN@65..66 ")" + WHITESPACE@66..67 " " + FAT_ARROW@67..69 "=>" + WHITESPACE@69..70 " " + TUPLE_EXPR@70..72 + L_PAREN@70..71 "(" + R_PAREN@71..72 ")" + COMMA@72..73 "," + WHITESPACE@73..82 "\n " + MATCH_ARM@82..96 + TUPLE_PAT@82..90 + L_PAREN@82..83 "(" + OR_PAT@83..88 + PLACEHOLDER_PAT@83..84 + UNDERSCORE@83..84 "_" + WHITESPACE@84..85 " " + PIPE@85..86 "|" + WHITESPACE@86..87 " " + PLACEHOLDER_PAT@87..88 + UNDERSCORE@87..88 "_" + COMMA@88..89 "," + R_PAREN@89..90 ")" + WHITESPACE@90..91 " " + FAT_ARROW@91..93 "=>" + WHITESPACE@93..94 " " + TUPLE_EXPR@94..96 + L_PAREN@94..95 "(" + R_PAREN@95..96 ")" + COMMA@96..97 "," + WHITESPACE@97..106 "\n " + MATCH_ARM@106..120 + SLICE_PAT@106..114 + L_BRACK@106..107 "[" + OR_PAT@107..112 + PLACEHOLDER_PAT@107..108 + UNDERSCORE@107..108 "_" + WHITESPACE@108..109 " " + PIPE@109..110 "|" + WHITESPACE@110..111 " " + PLACEHOLDER_PAT@111..112 + UNDERSCORE@111..112 "_" + COMMA@112..113 "," + R_BRACK@113..114 "]" + WHITESPACE@114..115 " " + FAT_ARROW@115..117 "=>" + WHITESPACE@117..118 " " + TUPLE_EXPR@118..120 + L_PAREN@118..119 "(" + R_PAREN@119..120 ")" + COMMA@120..121 "," + WHITESPACE@121..126 "\n " + R_CURLY@126..127 "}" + WHITESPACE@127..128 "\n" + R_CURLY@128..129 "}" + WHITESPACE@129..130 "\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 e0081a9f24..fad9df0070 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 @@ -1,26 +1,26 @@ -SOURCE_FILE@[0; 23) - TYPE_ALIAS_DEF@[0; 22) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 8) - IDENT@[5; 8) "Foo" - WHITESPACE@[8; 9) " " - EQ@[9; 10) "=" - WHITESPACE@[10; 11) " " - FN_POINTER_TYPE@[11; 21) - FN_KW@[11; 13) "fn" - PARAM_LIST@[13; 21) - L_PAREN@[13; 14) "(" - PARAM@[14; 20) - PLACEHOLDER_PAT@[14; 15) - UNDERSCORE@[14; 15) "_" - COLON@[15; 16) ":" - WHITESPACE@[16; 17) " " - PATH_TYPE@[17; 20) - PATH@[17; 20) - PATH_SEGMENT@[17; 20) - NAME_REF@[17; 20) - IDENT@[17; 20) "bar" - R_PAREN@[20; 21) ")" - SEMICOLON@[21; 22) ";" - WHITESPACE@[22; 23) "\n" +SOURCE_FILE@0..23 + TYPE_ALIAS_DEF@0..22 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..8 + IDENT@5..8 "Foo" + WHITESPACE@8..9 " " + EQ@9..10 "=" + WHITESPACE@10..11 " " + FN_POINTER_TYPE@11..21 + FN_KW@11..13 "fn" + PARAM_LIST@13..21 + L_PAREN@13..14 "(" + PARAM@14..20 + PLACEHOLDER_PAT@14..15 + UNDERSCORE@14..15 "_" + COLON@15..16 ":" + WHITESPACE@16..17 " " + PATH_TYPE@17..20 + PATH@17..20 + PATH_SEGMENT@17..20 + NAME_REF@17..20 + IDENT@17..20 "bar" + R_PAREN@20..21 ")" + SEMICOLON@21..22 ";" + WHITESPACE@22..23 "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast index a378dd80b7..e8a0e9ddd2 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast +++ b/crates/ra_syntax/test_data/parser/inline/ok/0157_variant_discriminant.rast @@ -1,30 +1,30 @@ -SOURCE_FILE@[0; 23) - ENUM_DEF@[0; 22) - ENUM_KW@[0; 4) "enum" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "E" - WHITESPACE@[6; 7) " " - ENUM_VARIANT_LIST@[7; 22) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 9) " " - ENUM_VARIANT@[9; 20) - NAME@[9; 10) - IDENT@[9; 10) "X" - TUPLE_FIELD_DEF_LIST@[10; 15) - L_PAREN@[10; 11) "(" - TUPLE_FIELD_DEF@[11; 14) - PATH_TYPE@[11; 14) - PATH@[11; 14) - PATH_SEGMENT@[11; 14) - NAME_REF@[11; 14) - IDENT@[11; 14) "i32" - R_PAREN@[14; 15) ")" - WHITESPACE@[15; 16) " " - EQ@[16; 17) "=" - WHITESPACE@[17; 18) " " - LITERAL@[18; 20) - INT_NUMBER@[18; 20) "10" - WHITESPACE@[20; 21) " " - R_CURLY@[21; 22) "}" - WHITESPACE@[22; 23) "\n" +SOURCE_FILE@0..23 + ENUM_DEF@0..22 + ENUM_KW@0..4 "enum" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "E" + WHITESPACE@6..7 " " + ENUM_VARIANT_LIST@7..22 + L_CURLY@7..8 "{" + WHITESPACE@8..9 " " + ENUM_VARIANT@9..20 + NAME@9..10 + IDENT@9..10 "X" + TUPLE_FIELD_DEF_LIST@10..15 + L_PAREN@10..11 "(" + TUPLE_FIELD_DEF@11..14 + PATH_TYPE@11..14 + PATH@11..14 + PATH_SEGMENT@11..14 + NAME_REF@11..14 + IDENT@11..14 "i32" + R_PAREN@14..15 ")" + WHITESPACE@15..16 " " + EQ@16..17 "=" + WHITESPACE@17..18 " " + LITERAL@18..20 + INT_NUMBER@18..20 "10" + WHITESPACE@20..21 " " + R_CURLY@21..22 "}" + 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 548be26988..50db9e967b 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 @@ -1,38 +1,38 @@ -SOURCE_FILE@[0; 28) - FN_DEF@[0; 27) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 27) - BLOCK@[9; 27) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 25) - BIN_EXPR@[15; 24) - PATH_EXPR@[15; 16) - PATH@[15; 16) - PATH_SEGMENT@[15; 16) - NAME_REF@[15; 16) - IDENT@[15; 16) "v" - WHITESPACE@[16; 17) " " - EQ@[17; 18) "=" - WHITESPACE@[18; 19) " " - BIN_EXPR@[19; 24) - BLOCK_EXPR@[19; 22) - BLOCK@[19; 22) - L_CURLY@[19; 20) "{" - LITERAL@[20; 21) - INT_NUMBER@[20; 21) "1" - R_CURLY@[21; 22) "}" - AMP@[22; 23) "&" - LITERAL@[23; 24) - INT_NUMBER@[23; 24) "2" - SEMICOLON@[24; 25) ";" - WHITESPACE@[25; 26) "\n" - R_CURLY@[26; 27) "}" - WHITESPACE@[27; 28) "\n" +SOURCE_FILE@0..28 + FN_DEF@0..27 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..27 + BLOCK@9..27 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..25 + BIN_EXPR@15..24 + PATH_EXPR@15..16 + PATH@15..16 + PATH_SEGMENT@15..16 + NAME_REF@15..16 + IDENT@15..16 "v" + WHITESPACE@16..17 " " + EQ@17..18 "=" + WHITESPACE@18..19 " " + BIN_EXPR@19..24 + BLOCK_EXPR@19..22 + BLOCK@19..22 + L_CURLY@19..20 "{" + LITERAL@20..21 + INT_NUMBER@20..21 "1" + R_CURLY@21..22 "}" + AMP@22..23 "&" + LITERAL@23..24 + INT_NUMBER@23..24 "2" + SEMICOLON@24..25 ";" + WHITESPACE@25..26 "\n" + R_CURLY@26..27 "}" + 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 a7a547fcee..c05e05bf37 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 @@ -1,45 +1,45 @@ -SOURCE_FILE@[0; 34) - FN_DEF@[0; 33) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 33) - BLOCK@[10; 33) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 12) " " - EXPR_STMT@[12; 31) - CALL_EXPR@[12; 30) - LAMBDA_EXPR@[12; 28) - PARAM_LIST@[12; 14) - PIPE@[12; 13) "|" - PIPE@[13; 14) "|" - WHITESPACE@[14; 15) " " - RET_TYPE@[15; 21) - THIN_ARROW@[15; 17) "->" - WHITESPACE@[17; 18) " " - PATH_TYPE@[18; 21) - PATH@[18; 21) - PATH_SEGMENT@[18; 21) - NAME_REF@[18; 21) - IDENT@[18; 21) "i32" - WHITESPACE@[21; 22) " " - BLOCK_EXPR@[22; 28) - BLOCK@[22; 28) - L_CURLY@[22; 23) "{" - WHITESPACE@[23; 24) " " - LITERAL@[24; 26) - INT_NUMBER@[24; 26) "92" - WHITESPACE@[26; 27) " " - R_CURLY@[27; 28) "}" - ARG_LIST@[28; 30) - L_PAREN@[28; 29) "(" - R_PAREN@[29; 30) ")" - SEMICOLON@[30; 31) ";" - WHITESPACE@[31; 32) " " - R_CURLY@[32; 33) "}" - WHITESPACE@[33; 34) "\n" +SOURCE_FILE@0..34 + FN_DEF@0..33 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..33 + BLOCK@10..33 + L_CURLY@10..11 "{" + WHITESPACE@11..12 " " + EXPR_STMT@12..31 + CALL_EXPR@12..30 + LAMBDA_EXPR@12..28 + PARAM_LIST@12..14 + PIPE@12..13 "|" + PIPE@13..14 "|" + WHITESPACE@14..15 " " + RET_TYPE@15..21 + THIN_ARROW@15..17 "->" + WHITESPACE@17..18 " " + PATH_TYPE@18..21 + PATH@18..21 + PATH_SEGMENT@18..21 + NAME_REF@18..21 + IDENT@18..21 "i32" + WHITESPACE@21..22 " " + BLOCK_EXPR@22..28 + BLOCK@22..28 + L_CURLY@22..23 "{" + WHITESPACE@23..24 " " + LITERAL@24..26 + INT_NUMBER@24..26 "92" + WHITESPACE@26..27 " " + R_CURLY@27..28 "}" + ARG_LIST@28..30 + L_PAREN@28..29 "(" + R_PAREN@29..30 ")" + SEMICOLON@30..31 ";" + WHITESPACE@31..32 " " + R_CURLY@32..33 "}" + WHITESPACE@33..34 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0000_empty.rast b/crates/ra_syntax/test_data/parser/ok/0000_empty.rast index 08f5a942f7..6b234b0b24 100644 --- a/crates/ra_syntax/test_data/parser/ok/0000_empty.rast +++ b/crates/ra_syntax/test_data/parser/ok/0000_empty.rast @@ -1 +1 @@ -SOURCE_FILE@[0; 0) +SOURCE_FILE@0..0 diff --git a/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast b/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast index fdc2d67689..705f7e0016 100644 --- a/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0001_struct_item.rast @@ -1,39 +1,39 @@ -SOURCE_FILE@[0; 32) - STRUCT_DEF@[0; 31) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - TYPE_PARAM_LIST@[8; 17) - L_ANGLE@[8; 9) "<" - TYPE_PARAM@[9; 16) - NAME@[9; 10) - IDENT@[9; 10) "T" - COLON@[10; 11) ":" - WHITESPACE@[11; 12) " " - TYPE_BOUND_LIST@[12; 16) - TYPE_BOUND@[12; 16) - PATH_TYPE@[12; 16) - PATH@[12; 16) - PATH_SEGMENT@[12; 16) - NAME_REF@[12; 16) - IDENT@[12; 16) "Copy" - R_ANGLE@[16; 17) ">" - WHITESPACE@[17; 18) " " - RECORD_FIELD_DEF_LIST@[18; 31) - L_CURLY@[18; 19) "{" - WHITESPACE@[19; 24) "\n " - RECORD_FIELD_DEF@[24; 28) - NAME@[24; 25) - IDENT@[24; 25) "f" - COLON@[25; 26) ":" - WHITESPACE@[26; 27) " " - PATH_TYPE@[27; 28) - PATH@[27; 28) - PATH_SEGMENT@[27; 28) - NAME_REF@[27; 28) - IDENT@[27; 28) "T" - COMMA@[28; 29) "," - WHITESPACE@[29; 30) "\n" - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 32) "\n" +SOURCE_FILE@0..32 + STRUCT_DEF@0..31 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + TYPE_PARAM_LIST@8..17 + L_ANGLE@8..9 "<" + TYPE_PARAM@9..16 + NAME@9..10 + IDENT@9..10 "T" + COLON@10..11 ":" + WHITESPACE@11..12 " " + TYPE_BOUND_LIST@12..16 + TYPE_BOUND@12..16 + PATH_TYPE@12..16 + PATH@12..16 + PATH_SEGMENT@12..16 + NAME_REF@12..16 + IDENT@12..16 "Copy" + R_ANGLE@16..17 ">" + WHITESPACE@17..18 " " + RECORD_FIELD_DEF_LIST@18..31 + L_CURLY@18..19 "{" + WHITESPACE@19..24 "\n " + RECORD_FIELD_DEF@24..28 + NAME@24..25 + IDENT@24..25 "f" + COLON@25..26 ":" + WHITESPACE@26..27 " " + PATH_TYPE@27..28 + PATH@27..28 + PATH_SEGMENT@27..28 + NAME_REF@27..28 + IDENT@27..28 "T" + COMMA@28..29 "," + WHITESPACE@29..30 "\n" + R_CURLY@30..31 "}" + WHITESPACE@31..32 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast b/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast index ef34702fd0..a1d5464915 100644 --- a/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast +++ b/crates/ra_syntax/test_data/parser/ok/0002_struct_item_field.rast @@ -1,22 +1,22 @@ -SOURCE_FILE@[0; 25) - STRUCT_DEF@[0; 25) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - RECORD_FIELD_DEF_LIST@[9; 25) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - RECORD_FIELD_DEF@[15; 23) - NAME@[15; 18) - IDENT@[15; 18) "foo" - COLON@[18; 19) ":" - WHITESPACE@[19; 20) " " - PATH_TYPE@[20; 23) - PATH@[20; 23) - PATH_SEGMENT@[20; 23) - NAME_REF@[20; 23) - IDENT@[20; 23) "u32" - WHITESPACE@[23; 24) "\n" - R_CURLY@[24; 25) "}" +SOURCE_FILE@0..25 + STRUCT_DEF@0..25 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + RECORD_FIELD_DEF_LIST@9..25 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + RECORD_FIELD_DEF@15..23 + NAME@15..18 + IDENT@15..18 "foo" + COLON@18..19 ":" + WHITESPACE@19..20 " " + PATH_TYPE@20..23 + PATH@20..23 + PATH_SEGMENT@20..23 + NAME_REF@20..23 + IDENT@20..23 "u32" + WHITESPACE@23..24 "\n" + R_CURLY@24..25 "}" diff --git a/crates/ra_syntax/test_data/parser/ok/0004_file_shebang.rast b/crates/ra_syntax/test_data/parser/ok/0004_file_shebang.rast index e3915c2df9..67e21df13a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0004_file_shebang.rast +++ b/crates/ra_syntax/test_data/parser/ok/0004_file_shebang.rast @@ -1,2 +1,2 @@ -SOURCE_FILE@[0; 20) - SHEBANG@[0; 20) "#!/use/bin/env rusti" +SOURCE_FILE@0..20 + SHEBANG@0..20 "#!/use/bin/env rusti" diff --git a/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast b/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast index 955b789b50..993ba72b6e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0005_fn_item.rast @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 13) - FN_DEF@[0; 12) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 12) - BLOCK@[9; 12) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) "\n" - R_CURLY@[11; 12) "}" - WHITESPACE@[12; 13) "\n" +SOURCE_FILE@0..13 + FN_DEF@0..12 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..12 + BLOCK@9..12 + L_CURLY@9..10 "{" + WHITESPACE@10..11 "\n" + R_CURLY@11..12 "}" + WHITESPACE@12..13 "\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 308b5680f8..42587243a9 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,184 +1,184 @@ -SOURCE_FILE@[0; 236) - ATTR@[0; 8) - POUND@[0; 1) "#" - BANG@[1; 2) "!" - L_BRACK@[2; 3) "[" - PATH@[3; 7) - PATH_SEGMENT@[3; 7) - NAME_REF@[3; 7) - IDENT@[3; 7) "attr" - R_BRACK@[7; 8) "]" - WHITESPACE@[8; 9) "\n" - ATTR@[9; 23) - POUND@[9; 10) "#" - BANG@[10; 11) "!" - L_BRACK@[11; 12) "[" - PATH@[12; 16) - PATH_SEGMENT@[12; 16) - NAME_REF@[12; 16) - IDENT@[12; 16) "attr" - TOKEN_TREE@[16; 22) - L_PAREN@[16; 17) "(" - TRUE_KW@[17; 21) "true" - R_PAREN@[21; 22) ")" - R_BRACK@[22; 23) "]" - WHITESPACE@[23; 24) "\n" - ATTR@[24; 39) - POUND@[24; 25) "#" - BANG@[25; 26) "!" - L_BRACK@[26; 27) "[" - PATH@[27; 31) - PATH_SEGMENT@[27; 31) - NAME_REF@[27; 31) - IDENT@[27; 31) "attr" - TOKEN_TREE@[31; 38) - L_PAREN@[31; 32) "(" - IDENT@[32; 37) "ident" - R_PAREN@[37; 38) ")" - R_BRACK@[38; 39) "]" - WHITESPACE@[39; 40) "\n" - ATTR@[40; 116) - POUND@[40; 41) "#" - BANG@[41; 42) "!" - L_BRACK@[42; 43) "[" - PATH@[43; 47) - PATH_SEGMENT@[43; 47) - NAME_REF@[43; 47) - IDENT@[43; 47) "attr" - TOKEN_TREE@[47; 115) - L_PAREN@[47; 48) "(" - IDENT@[48; 53) "ident" - COMMA@[53; 54) "," - WHITESPACE@[54; 55) " " - INT_NUMBER@[55; 58) "100" - COMMA@[58; 59) "," - WHITESPACE@[59; 60) " " - TRUE_KW@[60; 64) "true" - COMMA@[64; 65) "," - WHITESPACE@[65; 66) " " - STRING@[66; 72) "\"true\"" - COMMA@[72; 73) "," - WHITESPACE@[73; 74) " " - IDENT@[74; 79) "ident" - WHITESPACE@[79; 80) " " - EQ@[80; 81) "=" - WHITESPACE@[81; 82) " " - INT_NUMBER@[82; 85) "100" - COMMA@[85; 86) "," - WHITESPACE@[86; 87) " " - IDENT@[87; 92) "ident" - WHITESPACE@[92; 93) " " - EQ@[93; 94) "=" - WHITESPACE@[94; 95) " " - STRING@[95; 102) "\"hello\"" - COMMA@[102; 103) "," - WHITESPACE@[103; 104) " " - IDENT@[104; 109) "ident" - TOKEN_TREE@[109; 114) - L_PAREN@[109; 110) "(" - INT_NUMBER@[110; 113) "100" - R_PAREN@[113; 114) ")" - R_PAREN@[114; 115) ")" - R_BRACK@[115; 116) "]" - WHITESPACE@[116; 117) "\n" - ATTR@[117; 130) - POUND@[117; 118) "#" - BANG@[118; 119) "!" - L_BRACK@[119; 120) "[" - PATH@[120; 124) - PATH_SEGMENT@[120; 124) - NAME_REF@[120; 124) - IDENT@[120; 124) "attr" - TOKEN_TREE@[124; 129) - L_PAREN@[124; 125) "(" - INT_NUMBER@[125; 128) "100" - R_PAREN@[128; 129) ")" - R_BRACK@[129; 130) "]" - WHITESPACE@[130; 131) "\n" - ATTR@[131; 155) - POUND@[131; 132) "#" - BANG@[132; 133) "!" - L_BRACK@[133; 134) "[" - PATH@[134; 138) - PATH_SEGMENT@[134; 138) - NAME_REF@[134; 138) - IDENT@[134; 138) "attr" - TOKEN_TREE@[138; 154) - L_PAREN@[138; 139) "(" - IDENT@[139; 146) "enabled" - WHITESPACE@[146; 147) " " - EQ@[147; 148) "=" - WHITESPACE@[148; 149) " " - TRUE_KW@[149; 153) "true" - R_PAREN@[153; 154) ")" - R_BRACK@[154; 155) "]" - WHITESPACE@[155; 156) "\n" - ATTR@[156; 173) - POUND@[156; 157) "#" - BANG@[157; 158) "!" - L_BRACK@[158; 159) "[" - PATH@[159; 166) - PATH_SEGMENT@[159; 166) - NAME_REF@[159; 166) - IDENT@[159; 166) "enabled" - TOKEN_TREE@[166; 172) - L_PAREN@[166; 167) "(" - TRUE_KW@[167; 171) "true" - R_PAREN@[171; 172) ")" - R_BRACK@[172; 173) "]" - WHITESPACE@[173; 174) "\n" - ATTR@[174; 191) - POUND@[174; 175) "#" - BANG@[175; 176) "!" - L_BRACK@[176; 177) "[" - PATH@[177; 181) - PATH_SEGMENT@[177; 181) - NAME_REF@[177; 181) - IDENT@[177; 181) "attr" - TOKEN_TREE@[181; 190) - L_PAREN@[181; 182) "(" - STRING@[182; 189) "\"hello\"" - R_PAREN@[189; 190) ")" - R_BRACK@[190; 191) "]" - WHITESPACE@[191; 192) "\n" - ATTR@[192; 214) - POUND@[192; 193) "#" - BANG@[193; 194) "!" - L_BRACK@[194; 195) "[" - PATH@[195; 199) - PATH_SEGMENT@[195; 199) - NAME_REF@[195; 199) - IDENT@[195; 199) "repr" - TOKEN_TREE@[199; 213) - L_PAREN@[199; 200) "(" - IDENT@[200; 201) "C" - COMMA@[201; 202) "," - WHITESPACE@[202; 203) " " - IDENT@[203; 208) "align" - WHITESPACE@[208; 209) " " - EQ@[209; 210) "=" - WHITESPACE@[210; 211) " " - INT_NUMBER@[211; 212) "4" - R_PAREN@[212; 213) ")" - R_BRACK@[213; 214) "]" - WHITESPACE@[214; 215) "\n" - ATTR@[215; 236) - POUND@[215; 216) "#" - BANG@[216; 217) "!" - L_BRACK@[217; 218) "[" - PATH@[218; 222) - PATH_SEGMENT@[218; 222) - NAME_REF@[218; 222) - IDENT@[218; 222) "repr" - TOKEN_TREE@[222; 235) - L_PAREN@[222; 223) "(" - IDENT@[223; 224) "C" - COMMA@[224; 225) "," - WHITESPACE@[225; 226) " " - IDENT@[226; 231) "align" - TOKEN_TREE@[231; 234) - L_PAREN@[231; 232) "(" - INT_NUMBER@[232; 233) "4" - R_PAREN@[233; 234) ")" - R_PAREN@[234; 235) ")" - R_BRACK@[235; 236) "]" +SOURCE_FILE@0..236 + ATTR@0..8 + POUND@0..1 "#" + BANG@1..2 "!" + L_BRACK@2..3 "[" + PATH@3..7 + PATH_SEGMENT@3..7 + NAME_REF@3..7 + IDENT@3..7 "attr" + R_BRACK@7..8 "]" + WHITESPACE@8..9 "\n" + ATTR@9..23 + POUND@9..10 "#" + BANG@10..11 "!" + L_BRACK@11..12 "[" + PATH@12..16 + PATH_SEGMENT@12..16 + NAME_REF@12..16 + IDENT@12..16 "attr" + TOKEN_TREE@16..22 + L_PAREN@16..17 "(" + TRUE_KW@17..21 "true" + R_PAREN@21..22 ")" + R_BRACK@22..23 "]" + WHITESPACE@23..24 "\n" + ATTR@24..39 + POUND@24..25 "#" + BANG@25..26 "!" + L_BRACK@26..27 "[" + PATH@27..31 + PATH_SEGMENT@27..31 + NAME_REF@27..31 + IDENT@27..31 "attr" + TOKEN_TREE@31..38 + L_PAREN@31..32 "(" + IDENT@32..37 "ident" + R_PAREN@37..38 ")" + R_BRACK@38..39 "]" + WHITESPACE@39..40 "\n" + ATTR@40..116 + POUND@40..41 "#" + BANG@41..42 "!" + L_BRACK@42..43 "[" + PATH@43..47 + PATH_SEGMENT@43..47 + NAME_REF@43..47 + IDENT@43..47 "attr" + TOKEN_TREE@47..115 + L_PAREN@47..48 "(" + IDENT@48..53 "ident" + COMMA@53..54 "," + WHITESPACE@54..55 " " + INT_NUMBER@55..58 "100" + COMMA@58..59 "," + WHITESPACE@59..60 " " + TRUE_KW@60..64 "true" + COMMA@64..65 "," + WHITESPACE@65..66 " " + STRING@66..72 "\"true\"" + COMMA@72..73 "," + WHITESPACE@73..74 " " + IDENT@74..79 "ident" + WHITESPACE@79..80 " " + EQ@80..81 "=" + WHITESPACE@81..82 " " + INT_NUMBER@82..85 "100" + COMMA@85..86 "," + WHITESPACE@86..87 " " + IDENT@87..92 "ident" + WHITESPACE@92..93 " " + EQ@93..94 "=" + WHITESPACE@94..95 " " + STRING@95..102 "\"hello\"" + COMMA@102..103 "," + WHITESPACE@103..104 " " + IDENT@104..109 "ident" + TOKEN_TREE@109..114 + L_PAREN@109..110 "(" + INT_NUMBER@110..113 "100" + R_PAREN@113..114 ")" + R_PAREN@114..115 ")" + R_BRACK@115..116 "]" + WHITESPACE@116..117 "\n" + ATTR@117..130 + POUND@117..118 "#" + BANG@118..119 "!" + L_BRACK@119..120 "[" + PATH@120..124 + PATH_SEGMENT@120..124 + NAME_REF@120..124 + IDENT@120..124 "attr" + TOKEN_TREE@124..129 + L_PAREN@124..125 "(" + INT_NUMBER@125..128 "100" + R_PAREN@128..129 ")" + R_BRACK@129..130 "]" + WHITESPACE@130..131 "\n" + ATTR@131..155 + POUND@131..132 "#" + BANG@132..133 "!" + L_BRACK@133..134 "[" + PATH@134..138 + PATH_SEGMENT@134..138 + NAME_REF@134..138 + IDENT@134..138 "attr" + TOKEN_TREE@138..154 + L_PAREN@138..139 "(" + IDENT@139..146 "enabled" + WHITESPACE@146..147 " " + EQ@147..148 "=" + WHITESPACE@148..149 " " + TRUE_KW@149..153 "true" + R_PAREN@153..154 ")" + R_BRACK@154..155 "]" + WHITESPACE@155..156 "\n" + ATTR@156..173 + POUND@156..157 "#" + BANG@157..158 "!" + L_BRACK@158..159 "[" + PATH@159..166 + PATH_SEGMENT@159..166 + NAME_REF@159..166 + IDENT@159..166 "enabled" + TOKEN_TREE@166..172 + L_PAREN@166..167 "(" + TRUE_KW@167..171 "true" + R_PAREN@171..172 ")" + R_BRACK@172..173 "]" + WHITESPACE@173..174 "\n" + ATTR@174..191 + POUND@174..175 "#" + BANG@175..176 "!" + L_BRACK@176..177 "[" + PATH@177..181 + PATH_SEGMENT@177..181 + NAME_REF@177..181 + IDENT@177..181 "attr" + TOKEN_TREE@181..190 + L_PAREN@181..182 "(" + STRING@182..189 "\"hello\"" + R_PAREN@189..190 ")" + R_BRACK@190..191 "]" + WHITESPACE@191..192 "\n" + ATTR@192..214 + POUND@192..193 "#" + BANG@193..194 "!" + L_BRACK@194..195 "[" + PATH@195..199 + PATH_SEGMENT@195..199 + NAME_REF@195..199 + IDENT@195..199 "repr" + TOKEN_TREE@199..213 + L_PAREN@199..200 "(" + IDENT@200..201 "C" + COMMA@201..202 "," + WHITESPACE@202..203 " " + IDENT@203..208 "align" + WHITESPACE@208..209 " " + EQ@209..210 "=" + WHITESPACE@210..211 " " + INT_NUMBER@211..212 "4" + R_PAREN@212..213 ")" + R_BRACK@213..214 "]" + WHITESPACE@214..215 "\n" + ATTR@215..236 + POUND@215..216 "#" + BANG@216..217 "!" + L_BRACK@217..218 "[" + PATH@218..222 + PATH_SEGMENT@218..222 + NAME_REF@218..222 + IDENT@218..222 "repr" + TOKEN_TREE@222..235 + L_PAREN@222..223 "(" + IDENT@223..224 "C" + COMMA@224..225 "," + WHITESPACE@225..226 " " + IDENT@226..231 "align" + TOKEN_TREE@231..234 + L_PAREN@231..232 "(" + INT_NUMBER@232..233 "4" + R_PAREN@233..234 ")" + R_PAREN@234..235 ")" + R_BRACK@235..236 "]" 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 4856b4f814..b5bdf0aa97 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 @@ -1,40 +1,40 @@ -SOURCE_FILE@[0; 69) - EXTERN_CRATE_ITEM@[0; 17) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - CRATE_KW@[7; 12) "crate" - WHITESPACE@[12; 13) " " - NAME_REF@[13; 16) - IDENT@[13; 16) "foo" - SEMICOLON@[16; 17) ";" - WHITESPACE@[17; 18) "\n" - EXTERN_CRATE_ITEM@[18; 42) - EXTERN_KW@[18; 24) "extern" - WHITESPACE@[24; 25) " " - CRATE_KW@[25; 30) "crate" - WHITESPACE@[30; 31) " " - NAME_REF@[31; 34) - IDENT@[31; 34) "foo" - WHITESPACE@[34; 35) " " - ALIAS@[35; 41) - AS_KW@[35; 37) "as" - WHITESPACE@[37; 38) " " - NAME@[38; 41) - IDENT@[38; 41) "bar" - SEMICOLON@[41; 42) ";" - WHITESPACE@[42; 43) "\n" - EXTERN_CRATE_ITEM@[43; 68) - EXTERN_KW@[43; 49) "extern" - WHITESPACE@[49; 50) " " - CRATE_KW@[50; 55) "crate" - WHITESPACE@[55; 56) " " - SELF_KW@[56; 60) - SELF_KW@[56; 60) "self" - WHITESPACE@[60; 61) " " - ALIAS@[61; 67) - AS_KW@[61; 63) "as" - WHITESPACE@[63; 64) " " - NAME@[64; 67) - IDENT@[64; 67) "baz" - SEMICOLON@[67; 68) ";" - WHITESPACE@[68; 69) "\n" +SOURCE_FILE@0..69 + EXTERN_CRATE_ITEM@0..17 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + CRATE_KW@7..12 "crate" + WHITESPACE@12..13 " " + NAME_REF@13..16 + IDENT@13..16 "foo" + SEMICOLON@16..17 ";" + WHITESPACE@17..18 "\n" + EXTERN_CRATE_ITEM@18..42 + EXTERN_KW@18..24 "extern" + WHITESPACE@24..25 " " + CRATE_KW@25..30 "crate" + WHITESPACE@30..31 " " + NAME_REF@31..34 + IDENT@31..34 "foo" + WHITESPACE@34..35 " " + ALIAS@35..41 + AS_KW@35..37 "as" + WHITESPACE@37..38 " " + NAME@38..41 + IDENT@38..41 "bar" + SEMICOLON@41..42 ";" + WHITESPACE@42..43 "\n" + EXTERN_CRATE_ITEM@43..68 + EXTERN_KW@43..49 "extern" + WHITESPACE@49..50 " " + CRATE_KW@50..55 "crate" + WHITESPACE@55..56 " " + SELF_KW@56..60 + SELF_KW@56..60 "self" + WHITESPACE@60..61 " " + ALIAS@61..67 + AS_KW@61..63 "as" + WHITESPACE@63..64 " " + NAME@64..67 + IDENT@64..67 "baz" + SEMICOLON@67..68 ";" + 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 1c18edd4e8..353bf2d2eb 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 @@ -1,93 +1,93 @@ -SOURCE_FILE@[0; 118) - MODULE@[0; 6) - MOD_KW@[0; 3) "mod" - WHITESPACE@[3; 4) " " - NAME@[4; 5) - IDENT@[4; 5) "a" - SEMICOLON@[5; 6) ";" - WHITESPACE@[6; 8) "\n\n" - MODULE@[8; 17) - MOD_KW@[8; 11) "mod" - WHITESPACE@[11; 12) " " - NAME@[12; 13) - IDENT@[12; 13) "b" - WHITESPACE@[13; 14) " " - ITEM_LIST@[14; 17) - L_CURLY@[14; 15) "{" - WHITESPACE@[15; 16) "\n" - R_CURLY@[16; 17) "}" - WHITESPACE@[17; 19) "\n\n" - MODULE@[19; 65) - MOD_KW@[19; 22) "mod" - WHITESPACE@[22; 23) " " - NAME@[23; 24) - IDENT@[23; 24) "c" - WHITESPACE@[24; 25) " " - ITEM_LIST@[25; 65) - L_CURLY@[25; 26) "{" - WHITESPACE@[26; 31) "\n " - FN_DEF@[31; 47) - FN_KW@[31; 33) "fn" - WHITESPACE@[33; 34) " " - NAME@[34; 37) - IDENT@[34; 37) "foo" - PARAM_LIST@[37; 39) - L_PAREN@[37; 38) "(" - R_PAREN@[38; 39) ")" - WHITESPACE@[39; 40) " " - BLOCK_EXPR@[40; 47) - BLOCK@[40; 47) - L_CURLY@[40; 41) "{" - WHITESPACE@[41; 46) "\n " - R_CURLY@[46; 47) "}" - WHITESPACE@[47; 52) "\n " - STRUCT_DEF@[52; 63) - STRUCT_KW@[52; 58) "struct" - WHITESPACE@[58; 59) " " - NAME@[59; 60) - IDENT@[59; 60) "S" - WHITESPACE@[60; 61) " " - RECORD_FIELD_DEF_LIST@[61; 63) - L_CURLY@[61; 62) "{" - R_CURLY@[62; 63) "}" - WHITESPACE@[63; 64) "\n" - R_CURLY@[64; 65) "}" - WHITESPACE@[65; 67) "\n\n" - MODULE@[67; 118) - MOD_KW@[67; 70) "mod" - WHITESPACE@[70; 71) " " - NAME@[71; 72) - IDENT@[71; 72) "d" - WHITESPACE@[72; 73) " " - ITEM_LIST@[73; 118) - L_CURLY@[73; 74) "{" - WHITESPACE@[74; 79) "\n " - ATTR@[79; 87) - POUND@[79; 80) "#" - BANG@[80; 81) "!" - L_BRACK@[81; 82) "[" - PATH@[82; 86) - PATH_SEGMENT@[82; 86) - NAME_REF@[82; 86) - IDENT@[82; 86) "attr" - R_BRACK@[86; 87) "]" - WHITESPACE@[87; 92) "\n " - MODULE@[92; 98) - MOD_KW@[92; 95) "mod" - WHITESPACE@[95; 96) " " - NAME@[96; 97) - IDENT@[96; 97) "e" - SEMICOLON@[97; 98) ";" - WHITESPACE@[98; 103) "\n " - MODULE@[103; 116) - MOD_KW@[103; 106) "mod" - WHITESPACE@[106; 107) " " - NAME@[107; 108) - IDENT@[107; 108) "f" - WHITESPACE@[108; 109) " " - ITEM_LIST@[109; 116) - L_CURLY@[109; 110) "{" - WHITESPACE@[110; 115) "\n " - R_CURLY@[115; 116) "}" - WHITESPACE@[116; 117) "\n" - R_CURLY@[117; 118) "}" +SOURCE_FILE@0..118 + MODULE@0..6 + MOD_KW@0..3 "mod" + WHITESPACE@3..4 " " + NAME@4..5 + IDENT@4..5 "a" + SEMICOLON@5..6 ";" + WHITESPACE@6..8 "\n\n" + MODULE@8..17 + MOD_KW@8..11 "mod" + WHITESPACE@11..12 " " + NAME@12..13 + IDENT@12..13 "b" + WHITESPACE@13..14 " " + ITEM_LIST@14..17 + L_CURLY@14..15 "{" + WHITESPACE@15..16 "\n" + R_CURLY@16..17 "}" + WHITESPACE@17..19 "\n\n" + MODULE@19..65 + MOD_KW@19..22 "mod" + WHITESPACE@22..23 " " + NAME@23..24 + IDENT@23..24 "c" + WHITESPACE@24..25 " " + ITEM_LIST@25..65 + L_CURLY@25..26 "{" + WHITESPACE@26..31 "\n " + FN_DEF@31..47 + FN_KW@31..33 "fn" + WHITESPACE@33..34 " " + NAME@34..37 + IDENT@34..37 "foo" + PARAM_LIST@37..39 + L_PAREN@37..38 "(" + R_PAREN@38..39 ")" + WHITESPACE@39..40 " " + BLOCK_EXPR@40..47 + BLOCK@40..47 + L_CURLY@40..41 "{" + WHITESPACE@41..46 "\n " + R_CURLY@46..47 "}" + WHITESPACE@47..52 "\n " + STRUCT_DEF@52..63 + STRUCT_KW@52..58 "struct" + WHITESPACE@58..59 " " + NAME@59..60 + IDENT@59..60 "S" + WHITESPACE@60..61 " " + RECORD_FIELD_DEF_LIST@61..63 + L_CURLY@61..62 "{" + R_CURLY@62..63 "}" + WHITESPACE@63..64 "\n" + R_CURLY@64..65 "}" + WHITESPACE@65..67 "\n\n" + MODULE@67..118 + MOD_KW@67..70 "mod" + WHITESPACE@70..71 " " + NAME@71..72 + IDENT@71..72 "d" + WHITESPACE@72..73 " " + ITEM_LIST@73..118 + L_CURLY@73..74 "{" + WHITESPACE@74..79 "\n " + ATTR@79..87 + POUND@79..80 "#" + BANG@80..81 "!" + L_BRACK@81..82 "[" + PATH@82..86 + PATH_SEGMENT@82..86 + NAME_REF@82..86 + IDENT@82..86 "attr" + R_BRACK@86..87 "]" + WHITESPACE@87..92 "\n " + MODULE@92..98 + MOD_KW@92..95 "mod" + WHITESPACE@95..96 " " + NAME@96..97 + IDENT@96..97 "e" + SEMICOLON@97..98 ";" + WHITESPACE@98..103 "\n " + MODULE@103..116 + MOD_KW@103..106 "mod" + WHITESPACE@106..107 " " + NAME@107..108 + IDENT@107..108 "f" + WHITESPACE@108..109 " " + ITEM_LIST@109..116 + L_CURLY@109..110 "{" + WHITESPACE@110..115 "\n " + R_CURLY@115..116 "}" + WHITESPACE@116..117 "\n" + R_CURLY@117..118 "}" 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 62a8ae4332..96b8a94fca 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 @@ -1,21 +1,21 @@ -SOURCE_FILE@[0; 19) - USE_ITEM@[0; 8) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 7) - PATH@[4; 7) - PATH_SEGMENT@[4; 7) - NAME_REF@[4; 7) - IDENT@[4; 7) "foo" - SEMICOLON@[7; 8) ";" - WHITESPACE@[8; 9) "\n" - USE_ITEM@[9; 19) - USE_KW@[9; 12) "use" - WHITESPACE@[12; 13) " " - USE_TREE@[13; 18) - PATH@[13; 18) - PATH_SEGMENT@[13; 18) - COLON2@[13; 15) "::" - NAME_REF@[15; 18) - IDENT@[15; 18) "bar" - SEMICOLON@[18; 19) ";" +SOURCE_FILE@0..19 + USE_ITEM@0..8 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..7 + PATH@4..7 + PATH_SEGMENT@4..7 + NAME_REF@4..7 + IDENT@4..7 "foo" + SEMICOLON@7..8 ";" + WHITESPACE@8..9 "\n" + USE_ITEM@9..19 + USE_KW@9..12 "use" + WHITESPACE@12..13 " " + USE_TREE@13..18 + PATH@13..18 + PATH_SEGMENT@13..18 + COLON2@13..15 "::" + NAME_REF@15..18 + IDENT@15..18 "bar" + 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 f2689e1ed6..07272dc3ce 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 @@ -1,42 +1,42 @@ -SOURCE_FILE@[0; 40) - USE_ITEM@[0; 20) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 19) - PATH@[4; 19) - PATH@[4; 14) - PATH@[4; 9) - PATH_SEGMENT@[4; 9) - COLON2@[4; 6) "::" - NAME_REF@[6; 9) - IDENT@[6; 9) "foo" - COLON2@[9; 11) "::" - PATH_SEGMENT@[11; 14) - NAME_REF@[11; 14) - IDENT@[11; 14) "bar" - COLON2@[14; 16) "::" - PATH_SEGMENT@[16; 19) - NAME_REF@[16; 19) - IDENT@[16; 19) "baz" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 21) "\n" - USE_ITEM@[21; 39) - USE_KW@[21; 24) "use" - WHITESPACE@[24; 25) " " - USE_TREE@[25; 38) - PATH@[25; 38) - PATH@[25; 33) - PATH@[25; 28) - PATH_SEGMENT@[25; 28) - NAME_REF@[25; 28) - IDENT@[25; 28) "foo" - COLON2@[28; 30) "::" - PATH_SEGMENT@[30; 33) - NAME_REF@[30; 33) - IDENT@[30; 33) "bar" - COLON2@[33; 35) "::" - PATH_SEGMENT@[35; 38) - NAME_REF@[35; 38) - IDENT@[35; 38) "baz" - SEMICOLON@[38; 39) ";" - WHITESPACE@[39; 40) "\n" +SOURCE_FILE@0..40 + USE_ITEM@0..20 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..19 + PATH@4..19 + PATH@4..14 + PATH@4..9 + PATH_SEGMENT@4..9 + COLON2@4..6 "::" + NAME_REF@6..9 + IDENT@6..9 "foo" + COLON2@9..11 "::" + PATH_SEGMENT@11..14 + NAME_REF@11..14 + IDENT@11..14 "bar" + COLON2@14..16 "::" + PATH_SEGMENT@16..19 + NAME_REF@16..19 + IDENT@16..19 "baz" + SEMICOLON@19..20 ";" + WHITESPACE@20..21 "\n" + USE_ITEM@21..39 + USE_KW@21..24 "use" + WHITESPACE@24..25 " " + USE_TREE@25..38 + PATH@25..38 + PATH@25..33 + PATH@25..28 + PATH_SEGMENT@25..28 + NAME_REF@25..28 + IDENT@25..28 "foo" + COLON2@28..30 "::" + PATH_SEGMENT@30..33 + NAME_REF@30..33 + IDENT@30..33 "bar" + COLON2@33..35 "::" + PATH_SEGMENT@35..38 + NAME_REF@35..38 + IDENT@35..38 "baz" + SEMICOLON@38..39 ";" + 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 4426d586ad..3919cc78b7 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 @@ -1,58 +1,58 @@ -SOURCE_FILE@[0; 60) - FN_DEF@[0; 34) - ATTR@[0; 12) - POUND@[0; 1) "#" - L_BRACK@[1; 2) "[" - PATH@[2; 5) - PATH_SEGMENT@[2; 5) - NAME_REF@[2; 5) - IDENT@[2; 5) "cfg" - TOKEN_TREE@[5; 11) - L_PAREN@[5; 6) "(" - IDENT@[6; 10) "test" - R_PAREN@[10; 11) ")" - R_BRACK@[11; 12) "]" - WHITESPACE@[12; 13) "\n" - ATTR@[13; 22) - POUND@[13; 14) "#" - L_BRACK@[14; 15) "[" - PATH@[15; 21) - PATH_SEGMENT@[15; 21) - NAME_REF@[15; 21) - IDENT@[15; 21) "ignore" - R_BRACK@[21; 22) "]" - WHITESPACE@[22; 23) "\n" - FN_KW@[23; 25) "fn" - WHITESPACE@[25; 26) " " - NAME@[26; 29) - IDENT@[26; 29) "foo" - PARAM_LIST@[29; 31) - L_PAREN@[29; 30) "(" - R_PAREN@[30; 31) ")" - WHITESPACE@[31; 32) " " - BLOCK_EXPR@[32; 34) - BLOCK@[32; 34) - L_CURLY@[32; 33) "{" - R_CURLY@[33; 34) "}" - WHITESPACE@[34; 36) "\n\n" - MODULE@[36; 59) - ATTR@[36; 52) - POUND@[36; 37) "#" - L_BRACK@[37; 38) "[" - PATH@[38; 42) - PATH_SEGMENT@[38; 42) - NAME_REF@[38; 42) - IDENT@[38; 42) "path" - WHITESPACE@[42; 43) " " - EQ@[43; 44) "=" - WHITESPACE@[44; 45) " " - LITERAL@[45; 51) - STRING@[45; 51) "\"a.rs\"" - R_BRACK@[51; 52) "]" - WHITESPACE@[52; 53) "\n" - MOD_KW@[53; 56) "mod" - WHITESPACE@[56; 57) " " - NAME@[57; 58) - IDENT@[57; 58) "b" - SEMICOLON@[58; 59) ";" - WHITESPACE@[59; 60) "\n" +SOURCE_FILE@0..60 + FN_DEF@0..34 + ATTR@0..12 + POUND@0..1 "#" + L_BRACK@1..2 "[" + PATH@2..5 + PATH_SEGMENT@2..5 + NAME_REF@2..5 + IDENT@2..5 "cfg" + TOKEN_TREE@5..11 + L_PAREN@5..6 "(" + IDENT@6..10 "test" + R_PAREN@10..11 ")" + R_BRACK@11..12 "]" + WHITESPACE@12..13 "\n" + ATTR@13..22 + POUND@13..14 "#" + L_BRACK@14..15 "[" + PATH@15..21 + PATH_SEGMENT@15..21 + NAME_REF@15..21 + IDENT@15..21 "ignore" + R_BRACK@21..22 "]" + WHITESPACE@22..23 "\n" + FN_KW@23..25 "fn" + WHITESPACE@25..26 " " + NAME@26..29 + IDENT@26..29 "foo" + PARAM_LIST@29..31 + L_PAREN@29..30 "(" + R_PAREN@30..31 ")" + WHITESPACE@31..32 " " + BLOCK_EXPR@32..34 + BLOCK@32..34 + L_CURLY@32..33 "{" + R_CURLY@33..34 "}" + WHITESPACE@34..36 "\n\n" + MODULE@36..59 + ATTR@36..52 + POUND@36..37 "#" + L_BRACK@37..38 "[" + PATH@38..42 + PATH_SEGMENT@38..42 + NAME_REF@38..42 + IDENT@38..42 "path" + WHITESPACE@42..43 " " + EQ@43..44 "=" + WHITESPACE@44..45 " " + LITERAL@45..51 + STRING@45..51 "\"a.rs\"" + R_BRACK@51..52 "]" + WHITESPACE@52..53 "\n" + MOD_KW@53..56 "mod" + WHITESPACE@56..57 " " + NAME@57..58 + IDENT@57..58 "b" + SEMICOLON@58..59 ";" + 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 c76cf9fe93..750a045efb 100644 --- a/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast +++ b/crates/ra_syntax/test_data/parser/ok/0012_visibility.rast @@ -1,107 +1,107 @@ -SOURCE_FILE@[0; 98) - FN_DEF@[0; 9) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "a" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - BLOCK_EXPR@[7; 9) - BLOCK@[7; 9) - L_CURLY@[7; 8) "{" - R_CURLY@[8; 9) "}" - WHITESPACE@[9; 10) "\n" - FN_DEF@[10; 23) - VISIBILITY@[10; 13) - PUB_KW@[10; 13) "pub" - WHITESPACE@[13; 14) " " - FN_KW@[14; 16) "fn" - WHITESPACE@[16; 17) " " - NAME@[17; 18) - IDENT@[17; 18) "b" - PARAM_LIST@[18; 20) - L_PAREN@[18; 19) "(" - R_PAREN@[19; 20) ")" - WHITESPACE@[20; 21) " " - BLOCK_EXPR@[21; 23) - BLOCK@[21; 23) - L_CURLY@[21; 22) "{" - R_CURLY@[22; 23) "}" - WHITESPACE@[23; 24) "\n" - FN_DEF@[24; 44) - VISIBILITY@[24; 34) - PUB_KW@[24; 27) "pub" - L_PAREN@[27; 28) "(" - CRATE_KW@[28; 33) "crate" - R_PAREN@[33; 34) ")" - WHITESPACE@[34; 35) " " - FN_KW@[35; 37) "fn" - WHITESPACE@[37; 38) " " - NAME@[38; 39) - IDENT@[38; 39) "c" - PARAM_LIST@[39; 41) - L_PAREN@[39; 40) "(" - R_PAREN@[40; 41) ")" - WHITESPACE@[41; 42) " " - BLOCK_EXPR@[42; 44) - BLOCK@[42; 44) - L_CURLY@[42; 43) "{" - R_CURLY@[43; 44) "}" - WHITESPACE@[44; 45) "\n" - FN_DEF@[45; 65) - VISIBILITY@[45; 55) - PUB_KW@[45; 48) "pub" - L_PAREN@[48; 49) "(" - SUPER_KW@[49; 54) "super" - R_PAREN@[54; 55) ")" - WHITESPACE@[55; 56) " " - FN_KW@[56; 58) "fn" - WHITESPACE@[58; 59) " " - NAME@[59; 60) - IDENT@[59; 60) "d" - PARAM_LIST@[60; 62) - L_PAREN@[60; 61) "(" - R_PAREN@[61; 62) ")" - WHITESPACE@[62; 63) " " - BLOCK_EXPR@[63; 65) - BLOCK@[63; 65) - L_CURLY@[63; 64) "{" - R_CURLY@[64; 65) "}" - WHITESPACE@[65; 66) "\n" - FN_DEF@[66; 97) - VISIBILITY@[66; 87) - PUB_KW@[66; 69) "pub" - L_PAREN@[69; 70) "(" - IN_KW@[70; 72) "in" - WHITESPACE@[72; 73) " " - PATH@[73; 86) - PATH@[73; 81) - PATH@[73; 76) - PATH_SEGMENT@[73; 76) - NAME_REF@[73; 76) - IDENT@[73; 76) "foo" - COLON2@[76; 78) "::" - PATH_SEGMENT@[78; 81) - NAME_REF@[78; 81) - IDENT@[78; 81) "bar" - COLON2@[81; 83) "::" - PATH_SEGMENT@[83; 86) - NAME_REF@[83; 86) - IDENT@[83; 86) "baz" - R_PAREN@[86; 87) ")" - WHITESPACE@[87; 88) " " - FN_KW@[88; 90) "fn" - WHITESPACE@[90; 91) " " - NAME@[91; 92) - IDENT@[91; 92) "e" - PARAM_LIST@[92; 94) - L_PAREN@[92; 93) "(" - R_PAREN@[93; 94) ")" - WHITESPACE@[94; 95) " " - BLOCK_EXPR@[95; 97) - BLOCK@[95; 97) - L_CURLY@[95; 96) "{" - R_CURLY@[96; 97) "}" - WHITESPACE@[97; 98) "\n" +SOURCE_FILE@0..98 + FN_DEF@0..9 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "a" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + BLOCK_EXPR@7..9 + BLOCK@7..9 + L_CURLY@7..8 "{" + R_CURLY@8..9 "}" + WHITESPACE@9..10 "\n" + FN_DEF@10..23 + VISIBILITY@10..13 + PUB_KW@10..13 "pub" + WHITESPACE@13..14 " " + FN_KW@14..16 "fn" + WHITESPACE@16..17 " " + NAME@17..18 + IDENT@17..18 "b" + PARAM_LIST@18..20 + L_PAREN@18..19 "(" + R_PAREN@19..20 ")" + WHITESPACE@20..21 " " + BLOCK_EXPR@21..23 + BLOCK@21..23 + L_CURLY@21..22 "{" + R_CURLY@22..23 "}" + WHITESPACE@23..24 "\n" + FN_DEF@24..44 + VISIBILITY@24..34 + PUB_KW@24..27 "pub" + L_PAREN@27..28 "(" + CRATE_KW@28..33 "crate" + R_PAREN@33..34 ")" + WHITESPACE@34..35 " " + FN_KW@35..37 "fn" + WHITESPACE@37..38 " " + NAME@38..39 + IDENT@38..39 "c" + PARAM_LIST@39..41 + L_PAREN@39..40 "(" + R_PAREN@40..41 ")" + WHITESPACE@41..42 " " + BLOCK_EXPR@42..44 + BLOCK@42..44 + L_CURLY@42..43 "{" + R_CURLY@43..44 "}" + WHITESPACE@44..45 "\n" + FN_DEF@45..65 + VISIBILITY@45..55 + PUB_KW@45..48 "pub" + L_PAREN@48..49 "(" + SUPER_KW@49..54 "super" + R_PAREN@54..55 ")" + WHITESPACE@55..56 " " + FN_KW@56..58 "fn" + WHITESPACE@58..59 " " + NAME@59..60 + IDENT@59..60 "d" + PARAM_LIST@60..62 + L_PAREN@60..61 "(" + R_PAREN@61..62 ")" + WHITESPACE@62..63 " " + BLOCK_EXPR@63..65 + BLOCK@63..65 + L_CURLY@63..64 "{" + R_CURLY@64..65 "}" + WHITESPACE@65..66 "\n" + FN_DEF@66..97 + VISIBILITY@66..87 + PUB_KW@66..69 "pub" + L_PAREN@69..70 "(" + IN_KW@70..72 "in" + WHITESPACE@72..73 " " + PATH@73..86 + PATH@73..81 + PATH@73..76 + PATH_SEGMENT@73..76 + NAME_REF@73..76 + IDENT@73..76 "foo" + COLON2@76..78 "::" + PATH_SEGMENT@78..81 + NAME_REF@78..81 + IDENT@78..81 "bar" + COLON2@81..83 "::" + PATH_SEGMENT@83..86 + NAME_REF@83..86 + IDENT@83..86 "baz" + R_PAREN@86..87 ")" + WHITESPACE@87..88 " " + FN_KW@88..90 "fn" + WHITESPACE@90..91 " " + NAME@91..92 + IDENT@91..92 "e" + PARAM_LIST@92..94 + L_PAREN@92..93 "(" + R_PAREN@93..94 ")" + WHITESPACE@94..95 " " + BLOCK_EXPR@95..97 + BLOCK@95..97 + L_CURLY@95..96 "{" + R_CURLY@96..97 "}" + WHITESPACE@97..98 "\n" 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 552cb3daf1..a5a90df7b2 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 @@ -1,57 +1,57 @@ -SOURCE_FILE@[0; 65) - USE_ITEM@[0; 14) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 13) - PATH@[4; 13) - PATH@[4; 8) - PATH_SEGMENT@[4; 8) - SELF_KW@[4; 8) "self" - COLON2@[8; 10) "::" - PATH_SEGMENT@[10; 13) - NAME_REF@[10; 13) - IDENT@[10; 13) "foo" - SEMICOLON@[13; 14) ";" - WHITESPACE@[14; 15) "\n" - USE_ITEM@[15; 37) - USE_KW@[15; 18) "use" - WHITESPACE@[18; 19) " " - USE_TREE@[19; 36) - PATH@[19; 36) - PATH@[19; 31) - PATH@[19; 24) - PATH_SEGMENT@[19; 24) - SUPER_KW@[19; 24) "super" - COLON2@[24; 26) "::" - PATH_SEGMENT@[26; 31) - SUPER_KW@[26; 31) "super" - COLON2@[31; 33) "::" - PATH_SEGMENT@[33; 36) - NAME_REF@[33; 36) - IDENT@[33; 36) "bar" - SEMICOLON@[36; 37) ";" - WHITESPACE@[37; 38) "\n" - USE_ITEM@[38; 64) - USE_KW@[38; 41) "use" - WHITESPACE@[41; 42) " " - USE_TREE@[42; 63) - PATH@[42; 63) - PATH@[42; 58) - PATH@[42; 51) - PATH@[42; 48) - PATH_SEGMENT@[42; 48) - COLON2@[42; 44) "::" - SELF_KW@[44; 48) "self" - COLON2@[48; 50) "::" - PATH_SEGMENT@[50; 51) - NAME_REF@[50; 51) - IDENT@[50; 51) "a" - COLON2@[51; 53) "::" - PATH_SEGMENT@[53; 58) - SUPER_KW@[53; 58) "super" - COLON2@[58; 60) "::" - PATH_SEGMENT@[60; 63) - NAME_REF@[60; 63) - IDENT@[60; 63) "bar" - SEMICOLON@[63; 64) ";" - WHITESPACE@[64; 65) "\n" +SOURCE_FILE@0..65 + USE_ITEM@0..14 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..13 + PATH@4..13 + PATH@4..8 + PATH_SEGMENT@4..8 + SELF_KW@4..8 "self" + COLON2@8..10 "::" + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "foo" + SEMICOLON@13..14 ";" + WHITESPACE@14..15 "\n" + USE_ITEM@15..37 + USE_KW@15..18 "use" + WHITESPACE@18..19 " " + USE_TREE@19..36 + PATH@19..36 + PATH@19..31 + PATH@19..24 + PATH_SEGMENT@19..24 + SUPER_KW@19..24 "super" + COLON2@24..26 "::" + PATH_SEGMENT@26..31 + SUPER_KW@26..31 "super" + COLON2@31..33 "::" + PATH_SEGMENT@33..36 + NAME_REF@33..36 + IDENT@33..36 "bar" + SEMICOLON@36..37 ";" + WHITESPACE@37..38 "\n" + USE_ITEM@38..64 + USE_KW@38..41 "use" + WHITESPACE@41..42 " " + USE_TREE@42..63 + PATH@42..63 + PATH@42..58 + PATH@42..51 + PATH@42..48 + PATH_SEGMENT@42..48 + COLON2@42..44 "::" + SELF_KW@44..48 "self" + COLON2@48..50 "::" + PATH_SEGMENT@50..51 + NAME_REF@50..51 + IDENT@50..51 "a" + COLON2@51..53 "::" + PATH_SEGMENT@53..58 + SUPER_KW@53..58 "super" + COLON2@58..60 "::" + PATH_SEGMENT@60..63 + NAME_REF@60..63 + IDENT@60..63 "bar" + SEMICOLON@63..64 ";" + 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 49a68e8811..3642c107bb 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 @@ -1,95 +1,95 @@ -SOURCE_FILE@[0; 81) - USE_ITEM@[0; 6) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 5) - STAR@[4; 5) "*" - SEMICOLON@[5; 6) ";" - WHITESPACE@[6; 7) "\n" - USE_ITEM@[7; 15) - USE_KW@[7; 10) "use" - WHITESPACE@[10; 11) " " - USE_TREE@[11; 14) - COLON2@[11; 13) "::" - STAR@[13; 14) "*" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" - USE_ITEM@[16; 25) - USE_KW@[16; 19) "use" - WHITESPACE@[19; 20) " " - USE_TREE@[20; 24) - COLON2@[20; 22) "::" - USE_TREE_LIST@[22; 24) - L_CURLY@[22; 23) "{" - R_CURLY@[23; 24) "}" - SEMICOLON@[24; 25) ";" - WHITESPACE@[25; 26) "\n" - USE_ITEM@[26; 33) - USE_KW@[26; 29) "use" - WHITESPACE@[29; 30) " " - USE_TREE@[30; 32) - USE_TREE_LIST@[30; 32) - L_CURLY@[30; 31) "{" - R_CURLY@[31; 32) "}" - SEMICOLON@[32; 33) ";" - WHITESPACE@[33; 34) "\n" - USE_ITEM@[34; 45) - USE_KW@[34; 37) "use" - WHITESPACE@[37; 38) " " - USE_TREE@[38; 44) - PATH@[38; 41) - PATH_SEGMENT@[38; 41) - NAME_REF@[38; 41) - IDENT@[38; 41) "foo" - COLON2@[41; 43) "::" - STAR@[43; 44) "*" - SEMICOLON@[44; 45) ";" - WHITESPACE@[45; 46) "\n" - USE_ITEM@[46; 58) - USE_KW@[46; 49) "use" - WHITESPACE@[49; 50) " " - USE_TREE@[50; 57) - PATH@[50; 53) - PATH_SEGMENT@[50; 53) - NAME_REF@[50; 53) - IDENT@[50; 53) "foo" - COLON2@[53; 55) "::" - USE_TREE_LIST@[55; 57) - L_CURLY@[55; 56) "{" - R_CURLY@[56; 57) "}" - SEMICOLON@[57; 58) ";" - WHITESPACE@[58; 59) "\n" - USE_ITEM@[59; 80) - USE_KW@[59; 62) "use" - WHITESPACE@[62; 63) " " - USE_TREE@[63; 79) - PATH@[63; 68) - PATH_SEGMENT@[63; 68) - COLON2@[63; 65) "::" - NAME_REF@[65; 68) - IDENT@[65; 68) "foo" - COLON2@[68; 70) "::" - USE_TREE_LIST@[70; 79) - L_CURLY@[70; 71) "{" - USE_TREE@[71; 72) - PATH@[71; 72) - PATH_SEGMENT@[71; 72) - NAME_REF@[71; 72) - IDENT@[71; 72) "a" - COMMA@[72; 73) "," - WHITESPACE@[73; 74) " " - USE_TREE@[74; 75) - PATH@[74; 75) - PATH_SEGMENT@[74; 75) - NAME_REF@[74; 75) - IDENT@[74; 75) "b" - COMMA@[75; 76) "," - WHITESPACE@[76; 77) " " - USE_TREE@[77; 78) - PATH@[77; 78) - PATH_SEGMENT@[77; 78) - NAME_REF@[77; 78) - IDENT@[77; 78) "c" - R_CURLY@[78; 79) "}" - SEMICOLON@[79; 80) ";" - WHITESPACE@[80; 81) "\n" +SOURCE_FILE@0..81 + USE_ITEM@0..6 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..5 + STAR@4..5 "*" + SEMICOLON@5..6 ";" + WHITESPACE@6..7 "\n" + USE_ITEM@7..15 + USE_KW@7..10 "use" + WHITESPACE@10..11 " " + USE_TREE@11..14 + COLON2@11..13 "::" + STAR@13..14 "*" + SEMICOLON@14..15 ";" + WHITESPACE@15..16 "\n" + USE_ITEM@16..25 + USE_KW@16..19 "use" + WHITESPACE@19..20 " " + USE_TREE@20..24 + COLON2@20..22 "::" + USE_TREE_LIST@22..24 + L_CURLY@22..23 "{" + R_CURLY@23..24 "}" + SEMICOLON@24..25 ";" + WHITESPACE@25..26 "\n" + USE_ITEM@26..33 + USE_KW@26..29 "use" + WHITESPACE@29..30 " " + USE_TREE@30..32 + USE_TREE_LIST@30..32 + L_CURLY@30..31 "{" + R_CURLY@31..32 "}" + SEMICOLON@32..33 ";" + WHITESPACE@33..34 "\n" + USE_ITEM@34..45 + USE_KW@34..37 "use" + WHITESPACE@37..38 " " + USE_TREE@38..44 + PATH@38..41 + PATH_SEGMENT@38..41 + NAME_REF@38..41 + IDENT@38..41 "foo" + COLON2@41..43 "::" + STAR@43..44 "*" + SEMICOLON@44..45 ";" + WHITESPACE@45..46 "\n" + USE_ITEM@46..58 + USE_KW@46..49 "use" + WHITESPACE@49..50 " " + USE_TREE@50..57 + PATH@50..53 + PATH_SEGMENT@50..53 + NAME_REF@50..53 + IDENT@50..53 "foo" + COLON2@53..55 "::" + USE_TREE_LIST@55..57 + L_CURLY@55..56 "{" + R_CURLY@56..57 "}" + SEMICOLON@57..58 ";" + WHITESPACE@58..59 "\n" + USE_ITEM@59..80 + USE_KW@59..62 "use" + WHITESPACE@62..63 " " + USE_TREE@63..79 + PATH@63..68 + PATH_SEGMENT@63..68 + COLON2@63..65 "::" + NAME_REF@65..68 + IDENT@65..68 "foo" + COLON2@68..70 "::" + USE_TREE_LIST@70..79 + L_CURLY@70..71 "{" + USE_TREE@71..72 + PATH@71..72 + PATH_SEGMENT@71..72 + NAME_REF@71..72 + IDENT@71..72 "a" + COMMA@72..73 "," + WHITESPACE@73..74 " " + USE_TREE@74..75 + PATH@74..75 + PATH_SEGMENT@74..75 + NAME_REF@74..75 + IDENT@74..75 "b" + COMMA@75..76 "," + WHITESPACE@76..77 " " + USE_TREE@77..78 + PATH@77..78 + PATH_SEGMENT@77..78 + NAME_REF@77..78 + IDENT@77..78 "c" + R_CURLY@78..79 "}" + SEMICOLON@79..80 ";" + 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 719ac98ef9..09e0050f0b 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 @@ -1,65 +1,65 @@ -SOURCE_FILE@[0; 55) - USE_ITEM@[0; 15) - USE_KW@[0; 3) "use" - WHITESPACE@[3; 4) " " - USE_TREE@[4; 14) - PATH@[4; 7) - PATH_SEGMENT@[4; 7) - NAME_REF@[4; 7) - IDENT@[4; 7) "foo" - WHITESPACE@[7; 8) " " - ALIAS@[8; 14) - AS_KW@[8; 10) "as" - WHITESPACE@[10; 11) " " - NAME@[11; 14) - IDENT@[11; 14) "bar" - SEMICOLON@[14; 15) ";" - WHITESPACE@[15; 16) "\n" - USE_ITEM@[16; 54) - USE_KW@[16; 19) "use" - WHITESPACE@[19; 20) " " - USE_TREE@[20; 53) - PATH@[20; 23) - PATH_SEGMENT@[20; 23) - NAME_REF@[20; 23) - IDENT@[20; 23) "foo" - COLON2@[23; 25) "::" - USE_TREE_LIST@[25; 53) - L_CURLY@[25; 26) "{" - USE_TREE@[26; 32) - PATH@[26; 27) - PATH_SEGMENT@[26; 27) - NAME_REF@[26; 27) - IDENT@[26; 27) "a" - WHITESPACE@[27; 28) " " - ALIAS@[28; 32) - AS_KW@[28; 30) "as" - WHITESPACE@[30; 31) " " - NAME@[31; 32) - IDENT@[31; 32) "b" - COMMA@[32; 33) "," - WHITESPACE@[33; 34) " " - USE_TREE@[34; 35) - STAR@[34; 35) "*" - COMMA@[35; 36) "," - WHITESPACE@[36; 37) " " - USE_TREE@[37; 40) - COLON2@[37; 39) "::" - STAR@[39; 40) "*" - COMMA@[40; 41) "," - WHITESPACE@[41; 42) " " - USE_TREE@[42; 52) - PATH@[42; 47) - PATH_SEGMENT@[42; 47) - COLON2@[42; 44) "::" - NAME_REF@[44; 47) - IDENT@[44; 47) "foo" - WHITESPACE@[47; 48) " " - ALIAS@[48; 52) - AS_KW@[48; 50) "as" - WHITESPACE@[50; 51) " " - NAME@[51; 52) - IDENT@[51; 52) "x" - R_CURLY@[52; 53) "}" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 55) "\n" +SOURCE_FILE@0..55 + USE_ITEM@0..15 + USE_KW@0..3 "use" + WHITESPACE@3..4 " " + USE_TREE@4..14 + PATH@4..7 + PATH_SEGMENT@4..7 + NAME_REF@4..7 + IDENT@4..7 "foo" + WHITESPACE@7..8 " " + ALIAS@8..14 + AS_KW@8..10 "as" + WHITESPACE@10..11 " " + NAME@11..14 + IDENT@11..14 "bar" + SEMICOLON@14..15 ";" + WHITESPACE@15..16 "\n" + USE_ITEM@16..54 + USE_KW@16..19 "use" + WHITESPACE@19..20 " " + USE_TREE@20..53 + PATH@20..23 + PATH_SEGMENT@20..23 + NAME_REF@20..23 + IDENT@20..23 "foo" + COLON2@23..25 "::" + USE_TREE_LIST@25..53 + L_CURLY@25..26 "{" + USE_TREE@26..32 + PATH@26..27 + PATH_SEGMENT@26..27 + NAME_REF@26..27 + IDENT@26..27 "a" + WHITESPACE@27..28 " " + ALIAS@28..32 + AS_KW@28..30 "as" + WHITESPACE@30..31 " " + NAME@31..32 + IDENT@31..32 "b" + COMMA@32..33 "," + WHITESPACE@33..34 " " + USE_TREE@34..35 + STAR@34..35 "*" + COMMA@35..36 "," + WHITESPACE@36..37 " " + USE_TREE@37..40 + COLON2@37..39 "::" + STAR@39..40 "*" + COMMA@40..41 "," + WHITESPACE@41..42 " " + USE_TREE@42..52 + PATH@42..47 + PATH_SEGMENT@42..47 + COLON2@42..44 "::" + NAME_REF@44..47 + IDENT@44..47 "foo" + WHITESPACE@47..48 " " + ALIAS@48..52 + AS_KW@48..50 "as" + WHITESPACE@50..51 " " + NAME@51..52 + IDENT@51..52 "x" + R_CURLY@52..53 "}" + SEMICOLON@53..54 ";" + 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 f4739451e5..95656d19bd 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 @@ -1,93 +1,93 @@ -SOURCE_FILE@[0; 97) - STRUCT_DEF@[0; 9) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "A" - SEMICOLON@[8; 9) ";" - WHITESPACE@[9; 10) "\n" - STRUCT_DEF@[10; 21) - STRUCT_KW@[10; 16) "struct" - WHITESPACE@[16; 17) " " - NAME@[17; 18) - IDENT@[17; 18) "B" - WHITESPACE@[18; 19) " " - RECORD_FIELD_DEF_LIST@[19; 21) - L_CURLY@[19; 20) "{" - R_CURLY@[20; 21) "}" - WHITESPACE@[21; 22) "\n" - STRUCT_DEF@[22; 33) - STRUCT_KW@[22; 28) "struct" - WHITESPACE@[28; 29) " " - NAME@[29; 30) - IDENT@[29; 30) "C" - TUPLE_FIELD_DEF_LIST@[30; 32) - L_PAREN@[30; 31) "(" - R_PAREN@[31; 32) ")" - SEMICOLON@[32; 33) ";" - WHITESPACE@[33; 35) "\n\n" - STRUCT_DEF@[35; 74) - STRUCT_KW@[35; 41) "struct" - WHITESPACE@[41; 42) " " - NAME@[42; 43) - IDENT@[42; 43) "D" - WHITESPACE@[43; 44) " " - RECORD_FIELD_DEF_LIST@[44; 74) - L_CURLY@[44; 45) "{" - WHITESPACE@[45; 50) "\n " - RECORD_FIELD_DEF@[50; 56) - NAME@[50; 51) - IDENT@[50; 51) "a" - COLON@[51; 52) ":" - WHITESPACE@[52; 53) " " - PATH_TYPE@[53; 56) - PATH@[53; 56) - PATH_SEGMENT@[53; 56) - NAME_REF@[53; 56) - IDENT@[53; 56) "u32" - COMMA@[56; 57) "," - WHITESPACE@[57; 62) "\n " - RECORD_FIELD_DEF@[62; 72) - VISIBILITY@[62; 65) - PUB_KW@[62; 65) "pub" - WHITESPACE@[65; 66) " " - NAME@[66; 67) - IDENT@[66; 67) "b" - COLON@[67; 68) ":" - WHITESPACE@[68; 69) " " - PATH_TYPE@[69; 72) - PATH@[69; 72) - PATH_SEGMENT@[69; 72) - NAME_REF@[69; 72) - IDENT@[69; 72) "u32" - WHITESPACE@[72; 73) "\n" - R_CURLY@[73; 74) "}" - WHITESPACE@[74; 76) "\n\n" - STRUCT_DEF@[76; 96) - STRUCT_KW@[76; 82) "struct" - WHITESPACE@[82; 83) " " - NAME@[83; 84) - IDENT@[83; 84) "E" - TUPLE_FIELD_DEF_LIST@[84; 95) - L_PAREN@[84; 85) "(" - TUPLE_FIELD_DEF@[85; 90) - VISIBILITY@[85; 88) - PUB_KW@[85; 88) "pub" - WHITESPACE@[88; 89) " " - PATH_TYPE@[89; 90) - PATH@[89; 90) - PATH_SEGMENT@[89; 90) - NAME_REF@[89; 90) - IDENT@[89; 90) "x" - COMMA@[90; 91) "," - WHITESPACE@[91; 92) " " - TUPLE_FIELD_DEF@[92; 93) - PATH_TYPE@[92; 93) - PATH@[92; 93) - PATH_SEGMENT@[92; 93) - NAME_REF@[92; 93) - IDENT@[92; 93) "y" - COMMA@[93; 94) "," - R_PAREN@[94; 95) ")" - SEMICOLON@[95; 96) ";" - WHITESPACE@[96; 97) "\n" +SOURCE_FILE@0..97 + STRUCT_DEF@0..9 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "A" + SEMICOLON@8..9 ";" + WHITESPACE@9..10 "\n" + STRUCT_DEF@10..21 + STRUCT_KW@10..16 "struct" + WHITESPACE@16..17 " " + NAME@17..18 + IDENT@17..18 "B" + WHITESPACE@18..19 " " + RECORD_FIELD_DEF_LIST@19..21 + L_CURLY@19..20 "{" + R_CURLY@20..21 "}" + WHITESPACE@21..22 "\n" + STRUCT_DEF@22..33 + STRUCT_KW@22..28 "struct" + WHITESPACE@28..29 " " + NAME@29..30 + IDENT@29..30 "C" + TUPLE_FIELD_DEF_LIST@30..32 + L_PAREN@30..31 "(" + R_PAREN@31..32 ")" + SEMICOLON@32..33 ";" + WHITESPACE@33..35 "\n\n" + STRUCT_DEF@35..74 + STRUCT_KW@35..41 "struct" + WHITESPACE@41..42 " " + NAME@42..43 + IDENT@42..43 "D" + WHITESPACE@43..44 " " + RECORD_FIELD_DEF_LIST@44..74 + L_CURLY@44..45 "{" + WHITESPACE@45..50 "\n " + RECORD_FIELD_DEF@50..56 + NAME@50..51 + IDENT@50..51 "a" + COLON@51..52 ":" + WHITESPACE@52..53 " " + PATH_TYPE@53..56 + PATH@53..56 + PATH_SEGMENT@53..56 + NAME_REF@53..56 + IDENT@53..56 "u32" + COMMA@56..57 "," + WHITESPACE@57..62 "\n " + RECORD_FIELD_DEF@62..72 + VISIBILITY@62..65 + PUB_KW@62..65 "pub" + WHITESPACE@65..66 " " + NAME@66..67 + IDENT@66..67 "b" + COLON@67..68 ":" + WHITESPACE@68..69 " " + PATH_TYPE@69..72 + PATH@69..72 + PATH_SEGMENT@69..72 + NAME_REF@69..72 + IDENT@69..72 "u32" + WHITESPACE@72..73 "\n" + R_CURLY@73..74 "}" + WHITESPACE@74..76 "\n\n" + STRUCT_DEF@76..96 + STRUCT_KW@76..82 "struct" + WHITESPACE@82..83 " " + NAME@83..84 + IDENT@83..84 "E" + TUPLE_FIELD_DEF_LIST@84..95 + L_PAREN@84..85 "(" + TUPLE_FIELD_DEF@85..90 + VISIBILITY@85..88 + PUB_KW@85..88 "pub" + WHITESPACE@88..89 " " + PATH_TYPE@89..90 + PATH@89..90 + PATH_SEGMENT@89..90 + NAME_REF@89..90 + IDENT@89..90 "x" + COMMA@90..91 "," + WHITESPACE@91..92 " " + TUPLE_FIELD_DEF@92..93 + PATH_TYPE@92..93 + PATH@92..93 + PATH_SEGMENT@92..93 + NAME_REF@92..93 + IDENT@92..93 "y" + COMMA@93..94 "," + R_PAREN@94..95 ")" + SEMICOLON@95..96 ";" + WHITESPACE@96..97 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast b/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast index 1d65b0d6e0..b5747aacd4 100644 --- a/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast +++ b/crates/ra_syntax/test_data/parser/ok/0017_attr_trailing_comma.rast @@ -1,29 +1,29 @@ -SOURCE_FILE@[0; 23) - FN_DEF@[0; 22) - ATTR@[0; 10) - POUND@[0; 1) "#" - L_BRACK@[1; 2) "[" - PATH@[2; 5) - PATH_SEGMENT@[2; 5) - NAME_REF@[2; 5) - IDENT@[2; 5) "foo" - TOKEN_TREE@[5; 9) - L_PAREN@[5; 6) "(" - IDENT@[6; 7) "a" - COMMA@[7; 8) "," - R_PAREN@[8; 9) ")" - R_BRACK@[9; 10) "]" - WHITESPACE@[10; 11) "\n" - FN_KW@[11; 13) "fn" - WHITESPACE@[13; 14) " " - NAME@[14; 17) - IDENT@[14; 17) "foo" - PARAM_LIST@[17; 19) - L_PAREN@[17; 18) "(" - R_PAREN@[18; 19) ")" - WHITESPACE@[19; 20) " " - BLOCK_EXPR@[20; 22) - BLOCK@[20; 22) - L_CURLY@[20; 21) "{" - R_CURLY@[21; 22) "}" - WHITESPACE@[22; 23) "\n" +SOURCE_FILE@0..23 + FN_DEF@0..22 + ATTR@0..10 + POUND@0..1 "#" + L_BRACK@1..2 "[" + PATH@2..5 + PATH_SEGMENT@2..5 + NAME_REF@2..5 + IDENT@2..5 "foo" + TOKEN_TREE@5..9 + L_PAREN@5..6 "(" + IDENT@6..7 "a" + COMMA@7..8 "," + R_PAREN@8..9 ")" + R_BRACK@9..10 "]" + WHITESPACE@10..11 "\n" + FN_KW@11..13 "fn" + WHITESPACE@13..14 " " + NAME@14..17 + IDENT@14..17 "foo" + PARAM_LIST@17..19 + L_PAREN@17..18 "(" + R_PAREN@18..19 ")" + WHITESPACE@19..20 " " + BLOCK_EXPR@20..22 + BLOCK@20..22 + L_CURLY@20..21 "{" + R_CURLY@21..22 "}" + WHITESPACE@22..23 "\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 5e859ef296..451634e3f9 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 @@ -1,257 +1,257 @@ -SOURCE_FILE@[0; 290) - STRUCT_DEF@[0; 13) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 9) - IDENT@[7; 9) "S1" - TYPE_PARAM_LIST@[9; 12) - L_ANGLE@[9; 10) "<" - TYPE_PARAM@[10; 11) - NAME@[10; 11) - IDENT@[10; 11) "T" - R_ANGLE@[11; 12) ">" - SEMICOLON@[12; 13) ";" - WHITESPACE@[13; 14) "\n" - STRUCT_DEF@[14; 32) - STRUCT_KW@[14; 20) "struct" - WHITESPACE@[20; 21) " " - NAME@[21; 23) - IDENT@[21; 23) "S2" - TYPE_PARAM_LIST@[23; 26) - L_ANGLE@[23; 24) "<" - TYPE_PARAM@[24; 25) - NAME@[24; 25) - IDENT@[24; 25) "T" - R_ANGLE@[25; 26) ">" - TUPLE_FIELD_DEF_LIST@[26; 31) - L_PAREN@[26; 27) "(" - TUPLE_FIELD_DEF@[27; 30) - PATH_TYPE@[27; 30) - PATH@[27; 30) - PATH_SEGMENT@[27; 30) - NAME_REF@[27; 30) - IDENT@[27; 30) "u32" - R_PAREN@[30; 31) ")" - SEMICOLON@[31; 32) ";" - WHITESPACE@[32; 33) "\n" - STRUCT_DEF@[33; 56) - STRUCT_KW@[33; 39) "struct" - WHITESPACE@[39; 40) " " - NAME@[40; 42) - IDENT@[40; 42) "S3" - TYPE_PARAM_LIST@[42; 45) - L_ANGLE@[42; 43) "<" - TYPE_PARAM@[43; 44) - NAME@[43; 44) - IDENT@[43; 44) "T" - R_ANGLE@[44; 45) ">" - WHITESPACE@[45; 46) " " - RECORD_FIELD_DEF_LIST@[46; 56) - L_CURLY@[46; 47) "{" - WHITESPACE@[47; 48) " " - RECORD_FIELD_DEF@[48; 54) - NAME@[48; 49) - IDENT@[48; 49) "u" - COLON@[49; 50) ":" - WHITESPACE@[50; 51) " " - PATH_TYPE@[51; 54) - PATH@[51; 54) - PATH_SEGMENT@[51; 54) - NAME_REF@[51; 54) - IDENT@[51; 54) "u32" - WHITESPACE@[54; 55) " " - R_CURLY@[55; 56) "}" - WHITESPACE@[56; 58) "\n\n" - STRUCT_DEF@[58; 70) - STRUCT_KW@[58; 64) "struct" - WHITESPACE@[64; 65) " " - NAME@[65; 67) - IDENT@[65; 67) "S4" - TYPE_PARAM_LIST@[67; 69) - L_ANGLE@[67; 68) "<" - R_ANGLE@[68; 69) ">" - SEMICOLON@[69; 70) ";" - WHITESPACE@[70; 71) "\n" - STRUCT_DEF@[71; 85) - STRUCT_KW@[71; 77) "struct" - WHITESPACE@[77; 78) " " - NAME@[78; 80) - IDENT@[78; 80) "S5" - TYPE_PARAM_LIST@[80; 84) - L_ANGLE@[80; 81) "<" - LIFETIME_PARAM@[81; 83) - LIFETIME@[81; 83) "\'a" - R_ANGLE@[83; 84) ">" - SEMICOLON@[84; 85) ";" - WHITESPACE@[85; 86) "\n" - STRUCT_DEF@[86; 101) - STRUCT_KW@[86; 92) "struct" - WHITESPACE@[92; 93) " " - NAME@[93; 95) - IDENT@[93; 95) "S6" - TYPE_PARAM_LIST@[95; 100) - L_ANGLE@[95; 96) "<" - LIFETIME_PARAM@[96; 99) - LIFETIME@[96; 98) "\'a" - COLON@[98; 99) ":" - R_ANGLE@[99; 100) ">" - SEMICOLON@[100; 101) ";" - WHITESPACE@[101; 102) "\n" - STRUCT_DEF@[102; 120) - STRUCT_KW@[102; 108) "struct" - WHITESPACE@[108; 109) " " - NAME@[109; 111) - IDENT@[109; 111) "S7" - TYPE_PARAM_LIST@[111; 119) - L_ANGLE@[111; 112) "<" - LIFETIME_PARAM@[112; 118) - LIFETIME@[112; 114) "\'a" - COLON@[114; 115) ":" - WHITESPACE@[115; 116) " " - LIFETIME@[116; 118) "\'b" - R_ANGLE@[118; 119) ">" - SEMICOLON@[119; 120) ";" - WHITESPACE@[120; 121) "\n" - STRUCT_DEF@[121; 142) - STRUCT_KW@[121; 127) "struct" - WHITESPACE@[127; 128) " " - NAME@[128; 130) - IDENT@[128; 130) "S8" - TYPE_PARAM_LIST@[130; 141) - L_ANGLE@[130; 131) "<" - LIFETIME_PARAM@[131; 139) - LIFETIME@[131; 133) "\'a" - COLON@[133; 134) ":" - WHITESPACE@[134; 135) " " - LIFETIME@[135; 137) "\'b" - WHITESPACE@[137; 138) " " - PLUS@[138; 139) "+" - WHITESPACE@[139; 140) " " - R_ANGLE@[140; 141) ">" - SEMICOLON@[141; 142) ";" - WHITESPACE@[142; 143) "\n" - STRUCT_DEF@[143; 166) - STRUCT_KW@[143; 149) "struct" - WHITESPACE@[149; 150) " " - NAME@[150; 152) - IDENT@[150; 152) "S9" - TYPE_PARAM_LIST@[152; 165) - L_ANGLE@[152; 153) "<" - LIFETIME_PARAM@[153; 164) - LIFETIME@[153; 155) "\'a" - COLON@[155; 156) ":" - WHITESPACE@[156; 157) " " - LIFETIME@[157; 159) "\'b" - WHITESPACE@[159; 160) " " - PLUS@[160; 161) "+" - WHITESPACE@[161; 162) " " - LIFETIME@[162; 164) "\'c" - R_ANGLE@[164; 165) ">" - SEMICOLON@[165; 166) ";" - WHITESPACE@[166; 167) "\n" - STRUCT_DEF@[167; 183) - STRUCT_KW@[167; 173) "struct" - WHITESPACE@[173; 174) " " - NAME@[174; 177) - IDENT@[174; 177) "S10" - TYPE_PARAM_LIST@[177; 182) - L_ANGLE@[177; 178) "<" - LIFETIME_PARAM@[178; 180) - LIFETIME@[178; 180) "\'a" - COMMA@[180; 181) "," - R_ANGLE@[181; 182) ">" - SEMICOLON@[182; 183) ";" - WHITESPACE@[183; 184) "\n" - STRUCT_DEF@[184; 203) - STRUCT_KW@[184; 190) "struct" - WHITESPACE@[190; 191) " " - NAME@[191; 194) - IDENT@[191; 194) "S11" - TYPE_PARAM_LIST@[194; 202) - L_ANGLE@[194; 195) "<" - LIFETIME_PARAM@[195; 197) - LIFETIME@[195; 197) "\'a" - COMMA@[197; 198) "," - WHITESPACE@[198; 199) " " - LIFETIME_PARAM@[199; 201) - LIFETIME@[199; 201) "\'b" - R_ANGLE@[201; 202) ">" - SEMICOLON@[202; 203) ";" - WHITESPACE@[203; 204) "\n" - STRUCT_DEF@[204; 233) - STRUCT_KW@[204; 210) "struct" - WHITESPACE@[210; 211) " " - NAME@[211; 214) - IDENT@[211; 214) "S12" - TYPE_PARAM_LIST@[214; 232) - L_ANGLE@[214; 215) "<" - LIFETIME_PARAM@[215; 222) - LIFETIME@[215; 217) "\'a" - COLON@[217; 218) ":" - WHITESPACE@[218; 219) " " - LIFETIME@[219; 221) "\'b" - PLUS@[221; 222) "+" - COMMA@[222; 223) "," - WHITESPACE@[223; 224) " " - LIFETIME_PARAM@[224; 230) - LIFETIME@[224; 226) "\'b" - COLON@[226; 227) ":" - WHITESPACE@[227; 228) " " - LIFETIME@[228; 230) "\'c" - COMMA@[230; 231) "," - R_ANGLE@[231; 232) ">" - SEMICOLON@[232; 233) ";" - WHITESPACE@[233; 235) "\n\n" - STRUCT_DEF@[235; 249) - STRUCT_KW@[235; 241) "struct" - WHITESPACE@[241; 242) " " - NAME@[242; 245) - IDENT@[242; 245) "S13" - TYPE_PARAM_LIST@[245; 248) - L_ANGLE@[245; 246) "<" - TYPE_PARAM@[246; 247) - NAME@[246; 247) - IDENT@[246; 247) "T" - R_ANGLE@[247; 248) ">" - SEMICOLON@[248; 249) ";" - WHITESPACE@[249; 250) "\n" - STRUCT_DEF@[250; 267) - STRUCT_KW@[250; 256) "struct" - WHITESPACE@[256; 257) " " - NAME@[257; 260) - IDENT@[257; 260) "S14" - TYPE_PARAM_LIST@[260; 266) - L_ANGLE@[260; 261) "<" - TYPE_PARAM@[261; 262) - NAME@[261; 262) - IDENT@[261; 262) "T" - COMMA@[262; 263) "," - WHITESPACE@[263; 264) " " - TYPE_PARAM@[264; 265) - NAME@[264; 265) - IDENT@[264; 265) "U" - R_ANGLE@[265; 266) ">" - SEMICOLON@[266; 267) ";" - WHITESPACE@[267; 268) "\n" - STRUCT_DEF@[268; 289) - STRUCT_KW@[268; 274) "struct" - WHITESPACE@[274; 275) " " - NAME@[275; 278) - IDENT@[275; 278) "S15" - TYPE_PARAM_LIST@[278; 288) - L_ANGLE@[278; 279) "<" - LIFETIME_PARAM@[279; 281) - LIFETIME@[279; 281) "\'a" - COMMA@[281; 282) "," - WHITESPACE@[282; 283) " " - TYPE_PARAM@[283; 284) - NAME@[283; 284) - IDENT@[283; 284) "T" - COMMA@[284; 285) "," - WHITESPACE@[285; 286) " " - TYPE_PARAM@[286; 287) - NAME@[286; 287) - IDENT@[286; 287) "U" - R_ANGLE@[287; 288) ">" - SEMICOLON@[288; 289) ";" - WHITESPACE@[289; 290) "\n" +SOURCE_FILE@0..290 + STRUCT_DEF@0..13 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..9 + IDENT@7..9 "S1" + TYPE_PARAM_LIST@9..12 + L_ANGLE@9..10 "<" + TYPE_PARAM@10..11 + NAME@10..11 + IDENT@10..11 "T" + R_ANGLE@11..12 ">" + SEMICOLON@12..13 ";" + WHITESPACE@13..14 "\n" + STRUCT_DEF@14..32 + STRUCT_KW@14..20 "struct" + WHITESPACE@20..21 " " + NAME@21..23 + IDENT@21..23 "S2" + TYPE_PARAM_LIST@23..26 + L_ANGLE@23..24 "<" + TYPE_PARAM@24..25 + NAME@24..25 + IDENT@24..25 "T" + R_ANGLE@25..26 ">" + TUPLE_FIELD_DEF_LIST@26..31 + L_PAREN@26..27 "(" + TUPLE_FIELD_DEF@27..30 + PATH_TYPE@27..30 + PATH@27..30 + PATH_SEGMENT@27..30 + NAME_REF@27..30 + IDENT@27..30 "u32" + R_PAREN@30..31 ")" + SEMICOLON@31..32 ";" + WHITESPACE@32..33 "\n" + STRUCT_DEF@33..56 + STRUCT_KW@33..39 "struct" + WHITESPACE@39..40 " " + NAME@40..42 + IDENT@40..42 "S3" + TYPE_PARAM_LIST@42..45 + L_ANGLE@42..43 "<" + TYPE_PARAM@43..44 + NAME@43..44 + IDENT@43..44 "T" + R_ANGLE@44..45 ">" + WHITESPACE@45..46 " " + RECORD_FIELD_DEF_LIST@46..56 + L_CURLY@46..47 "{" + WHITESPACE@47..48 " " + RECORD_FIELD_DEF@48..54 + NAME@48..49 + IDENT@48..49 "u" + COLON@49..50 ":" + WHITESPACE@50..51 " " + PATH_TYPE@51..54 + PATH@51..54 + PATH_SEGMENT@51..54 + NAME_REF@51..54 + IDENT@51..54 "u32" + WHITESPACE@54..55 " " + R_CURLY@55..56 "}" + WHITESPACE@56..58 "\n\n" + STRUCT_DEF@58..70 + STRUCT_KW@58..64 "struct" + WHITESPACE@64..65 " " + NAME@65..67 + IDENT@65..67 "S4" + TYPE_PARAM_LIST@67..69 + L_ANGLE@67..68 "<" + R_ANGLE@68..69 ">" + SEMICOLON@69..70 ";" + WHITESPACE@70..71 "\n" + STRUCT_DEF@71..85 + STRUCT_KW@71..77 "struct" + WHITESPACE@77..78 " " + NAME@78..80 + IDENT@78..80 "S5" + TYPE_PARAM_LIST@80..84 + L_ANGLE@80..81 "<" + LIFETIME_PARAM@81..83 + LIFETIME@81..83 "\'a" + R_ANGLE@83..84 ">" + SEMICOLON@84..85 ";" + WHITESPACE@85..86 "\n" + STRUCT_DEF@86..101 + STRUCT_KW@86..92 "struct" + WHITESPACE@92..93 " " + NAME@93..95 + IDENT@93..95 "S6" + TYPE_PARAM_LIST@95..100 + L_ANGLE@95..96 "<" + LIFETIME_PARAM@96..99 + LIFETIME@96..98 "\'a" + COLON@98..99 ":" + R_ANGLE@99..100 ">" + SEMICOLON@100..101 ";" + WHITESPACE@101..102 "\n" + STRUCT_DEF@102..120 + STRUCT_KW@102..108 "struct" + WHITESPACE@108..109 " " + NAME@109..111 + IDENT@109..111 "S7" + TYPE_PARAM_LIST@111..119 + L_ANGLE@111..112 "<" + LIFETIME_PARAM@112..118 + LIFETIME@112..114 "\'a" + COLON@114..115 ":" + WHITESPACE@115..116 " " + LIFETIME@116..118 "\'b" + R_ANGLE@118..119 ">" + SEMICOLON@119..120 ";" + WHITESPACE@120..121 "\n" + STRUCT_DEF@121..142 + STRUCT_KW@121..127 "struct" + WHITESPACE@127..128 " " + NAME@128..130 + IDENT@128..130 "S8" + TYPE_PARAM_LIST@130..141 + L_ANGLE@130..131 "<" + LIFETIME_PARAM@131..139 + LIFETIME@131..133 "\'a" + COLON@133..134 ":" + WHITESPACE@134..135 " " + LIFETIME@135..137 "\'b" + WHITESPACE@137..138 " " + PLUS@138..139 "+" + WHITESPACE@139..140 " " + R_ANGLE@140..141 ">" + SEMICOLON@141..142 ";" + WHITESPACE@142..143 "\n" + STRUCT_DEF@143..166 + STRUCT_KW@143..149 "struct" + WHITESPACE@149..150 " " + NAME@150..152 + IDENT@150..152 "S9" + TYPE_PARAM_LIST@152..165 + L_ANGLE@152..153 "<" + LIFETIME_PARAM@153..164 + LIFETIME@153..155 "\'a" + COLON@155..156 ":" + WHITESPACE@156..157 " " + LIFETIME@157..159 "\'b" + WHITESPACE@159..160 " " + PLUS@160..161 "+" + WHITESPACE@161..162 " " + LIFETIME@162..164 "\'c" + R_ANGLE@164..165 ">" + SEMICOLON@165..166 ";" + WHITESPACE@166..167 "\n" + STRUCT_DEF@167..183 + STRUCT_KW@167..173 "struct" + WHITESPACE@173..174 " " + NAME@174..177 + IDENT@174..177 "S10" + TYPE_PARAM_LIST@177..182 + L_ANGLE@177..178 "<" + LIFETIME_PARAM@178..180 + LIFETIME@178..180 "\'a" + COMMA@180..181 "," + R_ANGLE@181..182 ">" + SEMICOLON@182..183 ";" + WHITESPACE@183..184 "\n" + STRUCT_DEF@184..203 + STRUCT_KW@184..190 "struct" + WHITESPACE@190..191 " " + NAME@191..194 + IDENT@191..194 "S11" + TYPE_PARAM_LIST@194..202 + L_ANGLE@194..195 "<" + LIFETIME_PARAM@195..197 + LIFETIME@195..197 "\'a" + COMMA@197..198 "," + WHITESPACE@198..199 " " + LIFETIME_PARAM@199..201 + LIFETIME@199..201 "\'b" + R_ANGLE@201..202 ">" + SEMICOLON@202..203 ";" + WHITESPACE@203..204 "\n" + STRUCT_DEF@204..233 + STRUCT_KW@204..210 "struct" + WHITESPACE@210..211 " " + NAME@211..214 + IDENT@211..214 "S12" + TYPE_PARAM_LIST@214..232 + L_ANGLE@214..215 "<" + LIFETIME_PARAM@215..222 + LIFETIME@215..217 "\'a" + COLON@217..218 ":" + WHITESPACE@218..219 " " + LIFETIME@219..221 "\'b" + PLUS@221..222 "+" + COMMA@222..223 "," + WHITESPACE@223..224 " " + LIFETIME_PARAM@224..230 + LIFETIME@224..226 "\'b" + COLON@226..227 ":" + WHITESPACE@227..228 " " + LIFETIME@228..230 "\'c" + COMMA@230..231 "," + R_ANGLE@231..232 ">" + SEMICOLON@232..233 ";" + WHITESPACE@233..235 "\n\n" + STRUCT_DEF@235..249 + STRUCT_KW@235..241 "struct" + WHITESPACE@241..242 " " + NAME@242..245 + IDENT@242..245 "S13" + TYPE_PARAM_LIST@245..248 + L_ANGLE@245..246 "<" + TYPE_PARAM@246..247 + NAME@246..247 + IDENT@246..247 "T" + R_ANGLE@247..248 ">" + SEMICOLON@248..249 ";" + WHITESPACE@249..250 "\n" + STRUCT_DEF@250..267 + STRUCT_KW@250..256 "struct" + WHITESPACE@256..257 " " + NAME@257..260 + IDENT@257..260 "S14" + TYPE_PARAM_LIST@260..266 + L_ANGLE@260..261 "<" + TYPE_PARAM@261..262 + NAME@261..262 + IDENT@261..262 "T" + COMMA@262..263 "," + WHITESPACE@263..264 " " + TYPE_PARAM@264..265 + NAME@264..265 + IDENT@264..265 "U" + R_ANGLE@265..266 ">" + SEMICOLON@266..267 ";" + WHITESPACE@267..268 "\n" + STRUCT_DEF@268..289 + STRUCT_KW@268..274 "struct" + WHITESPACE@274..275 " " + NAME@275..278 + IDENT@275..278 "S15" + TYPE_PARAM_LIST@278..288 + L_ANGLE@278..279 "<" + LIFETIME_PARAM@279..281 + LIFETIME@279..281 "\'a" + COMMA@281..282 "," + WHITESPACE@282..283 " " + TYPE_PARAM@283..284 + NAME@283..284 + IDENT@283..284 "T" + COMMA@284..285 "," + WHITESPACE@285..286 " " + TYPE_PARAM@286..287 + NAME@286..287 + IDENT@286..287 "U" + R_ANGLE@287..288 ">" + SEMICOLON@288..289 ";" + WHITESPACE@289..290 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast index 9d4a47a51b..f767e9e19f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0019_enums.rast +++ b/crates/ra_syntax/test_data/parser/ok/0019_enums.rast @@ -1,155 +1,155 @@ -SOURCE_FILE@[0; 182) - ENUM_DEF@[0; 11) - ENUM_KW@[0; 4) "enum" - WHITESPACE@[4; 5) " " - NAME@[5; 7) - IDENT@[5; 7) "E1" - WHITESPACE@[7; 8) " " - ENUM_VARIANT_LIST@[8; 11) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 10) "\n" - R_CURLY@[10; 11) "}" - WHITESPACE@[11; 13) "\n\n" - ENUM_DEF@[13; 27) - ENUM_KW@[13; 17) "enum" - WHITESPACE@[17; 18) " " - NAME@[18; 20) - IDENT@[18; 20) "E2" - TYPE_PARAM_LIST@[20; 23) - L_ANGLE@[20; 21) "<" - TYPE_PARAM@[21; 22) - NAME@[21; 22) - IDENT@[21; 22) "T" - R_ANGLE@[22; 23) ">" - WHITESPACE@[23; 24) " " - ENUM_VARIANT_LIST@[24; 27) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 26) "\n" - R_CURLY@[26; 27) "}" - WHITESPACE@[27; 29) "\n\n" - ENUM_DEF@[29; 46) - ENUM_KW@[29; 33) "enum" - WHITESPACE@[33; 34) " " - NAME@[34; 36) - IDENT@[34; 36) "E3" - WHITESPACE@[36; 37) " " - ENUM_VARIANT_LIST@[37; 46) - L_CURLY@[37; 38) "{" - WHITESPACE@[38; 43) "\n " - ENUM_VARIANT@[43; 44) - NAME@[43; 44) - IDENT@[43; 44) "X" - WHITESPACE@[44; 45) "\n" - R_CURLY@[45; 46) "}" - WHITESPACE@[46; 48) "\n\n" - ENUM_DEF@[48; 66) - ENUM_KW@[48; 52) "enum" - WHITESPACE@[52; 53) " " - NAME@[53; 55) - IDENT@[53; 55) "E4" - WHITESPACE@[55; 56) " " - ENUM_VARIANT_LIST@[56; 66) - L_CURLY@[56; 57) "{" - WHITESPACE@[57; 62) "\n " - ENUM_VARIANT@[62; 63) - NAME@[62; 63) - IDENT@[62; 63) "X" - COMMA@[63; 64) "," - WHITESPACE@[64; 65) "\n" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 68) "\n\n" - ENUM_DEF@[68; 181) - ENUM_KW@[68; 72) "enum" - WHITESPACE@[72; 73) " " - NAME@[73; 75) - IDENT@[73; 75) "E5" - WHITESPACE@[75; 76) " " - ENUM_VARIANT_LIST@[76; 181) - L_CURLY@[76; 77) "{" - WHITESPACE@[77; 82) "\n " - ENUM_VARIANT@[82; 83) - NAME@[82; 83) - IDENT@[82; 83) "A" - COMMA@[83; 84) "," - WHITESPACE@[84; 89) "\n " - ENUM_VARIANT@[89; 95) - NAME@[89; 90) - IDENT@[89; 90) "B" - WHITESPACE@[90; 91) " " - EQ@[91; 92) "=" - WHITESPACE@[92; 93) " " - LITERAL@[93; 95) - INT_NUMBER@[93; 95) "92" - COMMA@[95; 96) "," - WHITESPACE@[96; 101) "\n " - ENUM_VARIANT@[101; 146) - NAME@[101; 102) - IDENT@[101; 102) "C" - WHITESPACE@[102; 103) " " - RECORD_FIELD_DEF_LIST@[103; 146) - L_CURLY@[103; 104) "{" - WHITESPACE@[104; 113) "\n " - RECORD_FIELD_DEF@[113; 119) - NAME@[113; 114) - IDENT@[113; 114) "a" - COLON@[114; 115) ":" - WHITESPACE@[115; 116) " " - PATH_TYPE@[116; 119) - PATH@[116; 119) - PATH_SEGMENT@[116; 119) - NAME_REF@[116; 119) - IDENT@[116; 119) "u32" - COMMA@[119; 120) "," - WHITESPACE@[120; 129) "\n " - RECORD_FIELD_DEF@[129; 139) - VISIBILITY@[129; 132) - PUB_KW@[129; 132) "pub" - WHITESPACE@[132; 133) " " - NAME@[133; 134) - IDENT@[133; 134) "b" - COLON@[134; 135) ":" - WHITESPACE@[135; 136) " " - PATH_TYPE@[136; 139) - PATH@[136; 139) - PATH_SEGMENT@[136; 139) - NAME_REF@[136; 139) - IDENT@[136; 139) "f64" - COMMA@[139; 140) "," - WHITESPACE@[140; 145) "\n " - R_CURLY@[145; 146) "}" - COMMA@[146; 147) "," - WHITESPACE@[147; 152) "\n " - ENUM_VARIANT@[152; 156) - NAME@[152; 153) - IDENT@[152; 153) "F" - WHITESPACE@[153; 154) " " - RECORD_FIELD_DEF_LIST@[154; 156) - L_CURLY@[154; 155) "{" - R_CURLY@[155; 156) "}" - COMMA@[156; 157) "," - WHITESPACE@[157; 162) "\n " - ENUM_VARIANT@[162; 169) - NAME@[162; 163) - IDENT@[162; 163) "D" - TUPLE_FIELD_DEF_LIST@[163; 169) - L_PAREN@[163; 164) "(" - TUPLE_FIELD_DEF@[164; 167) - PATH_TYPE@[164; 167) - PATH@[164; 167) - PATH_SEGMENT@[164; 167) - NAME_REF@[164; 167) - IDENT@[164; 167) "u32" - COMMA@[167; 168) "," - R_PAREN@[168; 169) ")" - COMMA@[169; 170) "," - WHITESPACE@[170; 175) "\n " - ENUM_VARIANT@[175; 178) - NAME@[175; 176) - IDENT@[175; 176) "E" - TUPLE_FIELD_DEF_LIST@[176; 178) - L_PAREN@[176; 177) "(" - R_PAREN@[177; 178) ")" - COMMA@[178; 179) "," - WHITESPACE@[179; 180) "\n" - R_CURLY@[180; 181) "}" - WHITESPACE@[181; 182) "\n" +SOURCE_FILE@0..182 + ENUM_DEF@0..11 + ENUM_KW@0..4 "enum" + WHITESPACE@4..5 " " + NAME@5..7 + IDENT@5..7 "E1" + WHITESPACE@7..8 " " + ENUM_VARIANT_LIST@8..11 + L_CURLY@8..9 "{" + WHITESPACE@9..10 "\n" + R_CURLY@10..11 "}" + WHITESPACE@11..13 "\n\n" + ENUM_DEF@13..27 + ENUM_KW@13..17 "enum" + WHITESPACE@17..18 " " + NAME@18..20 + IDENT@18..20 "E2" + TYPE_PARAM_LIST@20..23 + L_ANGLE@20..21 "<" + TYPE_PARAM@21..22 + NAME@21..22 + IDENT@21..22 "T" + R_ANGLE@22..23 ">" + WHITESPACE@23..24 " " + ENUM_VARIANT_LIST@24..27 + L_CURLY@24..25 "{" + WHITESPACE@25..26 "\n" + R_CURLY@26..27 "}" + WHITESPACE@27..29 "\n\n" + ENUM_DEF@29..46 + ENUM_KW@29..33 "enum" + WHITESPACE@33..34 " " + NAME@34..36 + IDENT@34..36 "E3" + WHITESPACE@36..37 " " + ENUM_VARIANT_LIST@37..46 + L_CURLY@37..38 "{" + WHITESPACE@38..43 "\n " + ENUM_VARIANT@43..44 + NAME@43..44 + IDENT@43..44 "X" + WHITESPACE@44..45 "\n" + R_CURLY@45..46 "}" + WHITESPACE@46..48 "\n\n" + ENUM_DEF@48..66 + ENUM_KW@48..52 "enum" + WHITESPACE@52..53 " " + NAME@53..55 + IDENT@53..55 "E4" + WHITESPACE@55..56 " " + ENUM_VARIANT_LIST@56..66 + L_CURLY@56..57 "{" + WHITESPACE@57..62 "\n " + ENUM_VARIANT@62..63 + NAME@62..63 + IDENT@62..63 "X" + COMMA@63..64 "," + WHITESPACE@64..65 "\n" + R_CURLY@65..66 "}" + WHITESPACE@66..68 "\n\n" + ENUM_DEF@68..181 + ENUM_KW@68..72 "enum" + WHITESPACE@72..73 " " + NAME@73..75 + IDENT@73..75 "E5" + WHITESPACE@75..76 " " + ENUM_VARIANT_LIST@76..181 + L_CURLY@76..77 "{" + WHITESPACE@77..82 "\n " + ENUM_VARIANT@82..83 + NAME@82..83 + IDENT@82..83 "A" + COMMA@83..84 "," + WHITESPACE@84..89 "\n " + ENUM_VARIANT@89..95 + NAME@89..90 + IDENT@89..90 "B" + WHITESPACE@90..91 " " + EQ@91..92 "=" + WHITESPACE@92..93 " " + LITERAL@93..95 + INT_NUMBER@93..95 "92" + COMMA@95..96 "," + WHITESPACE@96..101 "\n " + ENUM_VARIANT@101..146 + NAME@101..102 + IDENT@101..102 "C" + WHITESPACE@102..103 " " + RECORD_FIELD_DEF_LIST@103..146 + L_CURLY@103..104 "{" + WHITESPACE@104..113 "\n " + RECORD_FIELD_DEF@113..119 + NAME@113..114 + IDENT@113..114 "a" + COLON@114..115 ":" + WHITESPACE@115..116 " " + PATH_TYPE@116..119 + PATH@116..119 + PATH_SEGMENT@116..119 + NAME_REF@116..119 + IDENT@116..119 "u32" + COMMA@119..120 "," + WHITESPACE@120..129 "\n " + RECORD_FIELD_DEF@129..139 + VISIBILITY@129..132 + PUB_KW@129..132 "pub" + WHITESPACE@132..133 " " + NAME@133..134 + IDENT@133..134 "b" + COLON@134..135 ":" + WHITESPACE@135..136 " " + PATH_TYPE@136..139 + PATH@136..139 + PATH_SEGMENT@136..139 + NAME_REF@136..139 + IDENT@136..139 "f64" + COMMA@139..140 "," + WHITESPACE@140..145 "\n " + R_CURLY@145..146 "}" + COMMA@146..147 "," + WHITESPACE@147..152 "\n " + ENUM_VARIANT@152..156 + NAME@152..153 + IDENT@152..153 "F" + WHITESPACE@153..154 " " + RECORD_FIELD_DEF_LIST@154..156 + L_CURLY@154..155 "{" + R_CURLY@155..156 "}" + COMMA@156..157 "," + WHITESPACE@157..162 "\n " + ENUM_VARIANT@162..169 + NAME@162..163 + IDENT@162..163 "D" + TUPLE_FIELD_DEF_LIST@163..169 + L_PAREN@163..164 "(" + TUPLE_FIELD_DEF@164..167 + PATH_TYPE@164..167 + PATH@164..167 + PATH_SEGMENT@164..167 + NAME_REF@164..167 + IDENT@164..167 "u32" + COMMA@167..168 "," + R_PAREN@168..169 ")" + COMMA@169..170 "," + WHITESPACE@170..175 "\n " + ENUM_VARIANT@175..178 + NAME@175..176 + IDENT@175..176 "E" + TUPLE_FIELD_DEF_LIST@176..178 + L_PAREN@176..177 "(" + R_PAREN@177..178 ")" + COMMA@178..179 "," + WHITESPACE@179..180 "\n" + R_CURLY@180..181 "}" + WHITESPACE@181..182 "\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 edacc4bd98..4fb4baf56c 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 @@ -1,268 +1,268 @@ -SOURCE_FILE@[0; 250) - STRUCT_DEF@[0; 12) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "A" - TYPE_PARAM_LIST@[8; 11) - L_ANGLE@[8; 9) "<" - TYPE_PARAM@[9; 10) - NAME@[9; 10) - IDENT@[9; 10) "T" - R_ANGLE@[10; 11) ">" - SEMICOLON@[11; 12) ";" - WHITESPACE@[12; 13) "\n" - STRUCT_DEF@[13; 26) - STRUCT_KW@[13; 19) "struct" - WHITESPACE@[19; 20) " " - NAME@[20; 21) - IDENT@[20; 21) "B" - TYPE_PARAM_LIST@[21; 25) - L_ANGLE@[21; 22) "<" - TYPE_PARAM@[22; 24) - NAME@[22; 23) - IDENT@[22; 23) "T" - COLON@[23; 24) ":" - TYPE_BOUND_LIST@[24; 24) - R_ANGLE@[24; 25) ">" - SEMICOLON@[25; 26) ";" - WHITESPACE@[26; 27) "\n" - STRUCT_DEF@[27; 43) - STRUCT_KW@[27; 33) "struct" - WHITESPACE@[33; 34) " " - NAME@[34; 35) - IDENT@[34; 35) "C" - TYPE_PARAM_LIST@[35; 42) - L_ANGLE@[35; 36) "<" - TYPE_PARAM@[36; 41) - NAME@[36; 37) - IDENT@[36; 37) "T" - COLON@[37; 38) ":" - WHITESPACE@[38; 39) " " - TYPE_BOUND_LIST@[39; 41) - TYPE_BOUND@[39; 41) - LIFETIME@[39; 41) "\'a" - R_ANGLE@[41; 42) ">" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 44) "\n" - STRUCT_DEF@[44; 63) - STRUCT_KW@[44; 50) "struct" - WHITESPACE@[50; 51) " " - NAME@[51; 52) - IDENT@[51; 52) "D" - TYPE_PARAM_LIST@[52; 62) - L_ANGLE@[52; 53) "<" - TYPE_PARAM@[53; 60) - NAME@[53; 54) - IDENT@[53; 54) "T" - COLON@[54; 55) ":" - WHITESPACE@[55; 56) " " - TYPE_BOUND_LIST@[56; 60) - TYPE_BOUND@[56; 58) - LIFETIME@[56; 58) "\'a" - WHITESPACE@[58; 59) " " - PLUS@[59; 60) "+" - WHITESPACE@[60; 61) " " - R_ANGLE@[61; 62) ">" - SEMICOLON@[62; 63) ";" - WHITESPACE@[63; 64) "\n" - STRUCT_DEF@[64; 86) - STRUCT_KW@[64; 70) "struct" - WHITESPACE@[70; 71) " " - NAME@[71; 72) - IDENT@[71; 72) "E" - TYPE_PARAM_LIST@[72; 85) - L_ANGLE@[72; 73) "<" - TYPE_PARAM@[73; 83) - NAME@[73; 74) - IDENT@[73; 74) "T" - COLON@[74; 75) ":" - WHITESPACE@[75; 76) " " - TYPE_BOUND_LIST@[76; 83) - TYPE_BOUND@[76; 78) - LIFETIME@[76; 78) "\'a" - WHITESPACE@[78; 79) " " - PLUS@[79; 80) "+" - WHITESPACE@[80; 81) " " - TYPE_BOUND@[81; 83) - LIFETIME@[81; 83) "\'d" - WHITESPACE@[83; 84) " " - R_ANGLE@[84; 85) ">" - SEMICOLON@[85; 86) ";" - WHITESPACE@[86; 87) "\n" - STRUCT_DEF@[87; 116) - STRUCT_KW@[87; 93) "struct" - WHITESPACE@[93; 94) " " - NAME@[94; 95) - IDENT@[94; 95) "F" - TYPE_PARAM_LIST@[95; 115) - L_ANGLE@[95; 96) "<" - TYPE_PARAM@[96; 114) - NAME@[96; 97) - IDENT@[96; 97) "T" - COLON@[97; 98) ":" - WHITESPACE@[98; 99) " " - TYPE_BOUND_LIST@[99; 114) - TYPE_BOUND@[99; 101) - LIFETIME@[99; 101) "\'a" - WHITESPACE@[101; 102) " " - PLUS@[102; 103) "+" - WHITESPACE@[103; 104) " " - TYPE_BOUND@[104; 106) - LIFETIME@[104; 106) "\'d" - WHITESPACE@[106; 107) " " - PLUS@[107; 108) "+" - WHITESPACE@[108; 109) " " - TYPE_BOUND@[109; 114) - PATH_TYPE@[109; 114) - PATH@[109; 114) - PATH_SEGMENT@[109; 114) - NAME_REF@[109; 114) - IDENT@[109; 114) "Clone" - R_ANGLE@[114; 115) ">" - SEMICOLON@[115; 116) ";" - WHITESPACE@[116; 117) "\n" - STRUCT_DEF@[117; 143) - STRUCT_KW@[117; 123) "struct" - WHITESPACE@[123; 124) " " - NAME@[124; 125) - IDENT@[124; 125) "G" - TYPE_PARAM_LIST@[125; 142) - L_ANGLE@[125; 126) "<" - TYPE_PARAM@[126; 141) - NAME@[126; 127) - IDENT@[126; 127) "T" - COLON@[127; 128) ":" - WHITESPACE@[128; 129) " " - TYPE_BOUND_LIST@[129; 141) - TYPE_BOUND@[129; 134) - PATH_TYPE@[129; 134) - PATH@[129; 134) - PATH_SEGMENT@[129; 134) - NAME_REF@[129; 134) - IDENT@[129; 134) "Clone" - WHITESPACE@[134; 135) " " - PLUS@[135; 136) "+" - WHITESPACE@[136; 137) " " - TYPE_BOUND@[137; 141) - PATH_TYPE@[137; 141) - PATH@[137; 141) - PATH_SEGMENT@[137; 141) - NAME_REF@[137; 141) - IDENT@[137; 141) "Copy" - R_ANGLE@[141; 142) ">" - SEMICOLON@[142; 143) ";" - WHITESPACE@[143; 144) "\n" - STRUCT_DEF@[144; 180) - STRUCT_KW@[144; 150) "struct" - WHITESPACE@[150; 151) " " - NAME@[151; 152) - IDENT@[151; 152) "H" - TYPE_PARAM_LIST@[152; 179) - L_ANGLE@[152; 153) "<" - TYPE_PARAM@[153; 178) - NAME@[153; 154) - IDENT@[153; 154) "T" - COLON@[154; 155) ":" - WHITESPACE@[155; 156) " " - TYPE_BOUND_LIST@[156; 178) - TYPE_BOUND@[156; 161) - PATH_TYPE@[156; 161) - PATH@[156; 161) - PATH_SEGMENT@[156; 161) - COLON2@[156; 158) "::" - NAME_REF@[158; 161) - IDENT@[158; 161) "Foo" - WHITESPACE@[161; 162) " " - PLUS@[162; 163) "+" - WHITESPACE@[163; 164) " " - TYPE_BOUND@[164; 173) - PATH_TYPE@[164; 173) - PATH@[164; 173) - PATH@[164; 168) - PATH_SEGMENT@[164; 168) - SELF_KW@[164; 168) "self" - COLON2@[168; 170) "::" - PATH_SEGMENT@[170; 173) - NAME_REF@[170; 173) - IDENT@[170; 173) "Bar" - WHITESPACE@[173; 174) " " - PLUS@[174; 175) "+" - WHITESPACE@[175; 176) " " - TYPE_BOUND@[176; 178) - LIFETIME@[176; 178) "\'a" - R_ANGLE@[178; 179) ">" - SEMICOLON@[179; 180) ";" - WHITESPACE@[180; 181) "\n" - STRUCT_DEF@[181; 199) - STRUCT_KW@[181; 187) "struct" - WHITESPACE@[187; 188) " " - NAME@[188; 189) - IDENT@[188; 189) "I" - TYPE_PARAM_LIST@[189; 198) - L_ANGLE@[189; 190) "<" - TYPE_PARAM@[190; 192) - NAME@[190; 191) - IDENT@[190; 191) "T" - COLON@[191; 192) ":" - TYPE_BOUND_LIST@[192; 192) - COMMA@[192; 193) "," - WHITESPACE@[193; 194) " " - TYPE_PARAM@[194; 196) - NAME@[194; 195) - IDENT@[194; 195) "U" - COLON@[195; 196) ":" - TYPE_BOUND_LIST@[196; 196) - COMMA@[196; 197) "," - R_ANGLE@[197; 198) ">" - SEMICOLON@[198; 199) ";" - WHITESPACE@[199; 200) "\n" - STRUCT_DEF@[200; 250) - STRUCT_KW@[200; 206) "struct" - WHITESPACE@[206; 207) " " - NAME@[207; 208) - IDENT@[207; 208) "K" - TYPE_PARAM_LIST@[208; 249) - L_ANGLE@[208; 209) "<" - LIFETIME_PARAM@[209; 215) - LIFETIME@[209; 211) "\'a" - COLON@[211; 212) ":" - WHITESPACE@[212; 213) " " - LIFETIME@[213; 215) "\'d" - COMMA@[215; 216) "," - WHITESPACE@[216; 217) " " - LIFETIME_PARAM@[217; 228) - LIFETIME@[217; 219) "\'d" - COLON@[219; 220) ":" - WHITESPACE@[220; 221) " " - LIFETIME@[221; 223) "\'a" - WHITESPACE@[223; 224) " " - PLUS@[224; 225) "+" - WHITESPACE@[225; 226) " " - LIFETIME@[226; 228) "\'b" - COMMA@[228; 229) "," - WHITESPACE@[229; 230) " " - TYPE_PARAM@[230; 248) - NAME@[230; 231) - IDENT@[230; 231) "T" - COLON@[231; 232) ":" - WHITESPACE@[232; 233) " " - TYPE_BOUND_LIST@[233; 248) - TYPE_BOUND@[233; 235) - LIFETIME@[233; 235) "\'a" - WHITESPACE@[235; 236) " " - PLUS@[236; 237) "+" - WHITESPACE@[237; 238) " " - TYPE_BOUND@[238; 240) - LIFETIME@[238; 240) "\'d" - WHITESPACE@[240; 241) " " - PLUS@[241; 242) "+" - WHITESPACE@[242; 243) " " - TYPE_BOUND@[243; 248) - PATH_TYPE@[243; 248) - PATH@[243; 248) - PATH_SEGMENT@[243; 248) - NAME_REF@[243; 248) - IDENT@[243; 248) "Clone" - R_ANGLE@[248; 249) ">" - SEMICOLON@[249; 250) ";" +SOURCE_FILE@0..250 + STRUCT_DEF@0..12 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "A" + TYPE_PARAM_LIST@8..11 + L_ANGLE@8..9 "<" + TYPE_PARAM@9..10 + NAME@9..10 + IDENT@9..10 "T" + R_ANGLE@10..11 ">" + SEMICOLON@11..12 ";" + WHITESPACE@12..13 "\n" + STRUCT_DEF@13..26 + STRUCT_KW@13..19 "struct" + WHITESPACE@19..20 " " + NAME@20..21 + IDENT@20..21 "B" + TYPE_PARAM_LIST@21..25 + L_ANGLE@21..22 "<" + TYPE_PARAM@22..24 + NAME@22..23 + IDENT@22..23 "T" + COLON@23..24 ":" + TYPE_BOUND_LIST@24..24 + R_ANGLE@24..25 ">" + SEMICOLON@25..26 ";" + WHITESPACE@26..27 "\n" + STRUCT_DEF@27..43 + STRUCT_KW@27..33 "struct" + WHITESPACE@33..34 " " + NAME@34..35 + IDENT@34..35 "C" + TYPE_PARAM_LIST@35..42 + L_ANGLE@35..36 "<" + TYPE_PARAM@36..41 + NAME@36..37 + IDENT@36..37 "T" + COLON@37..38 ":" + WHITESPACE@38..39 " " + TYPE_BOUND_LIST@39..41 + TYPE_BOUND@39..41 + LIFETIME@39..41 "\'a" + R_ANGLE@41..42 ">" + SEMICOLON@42..43 ";" + WHITESPACE@43..44 "\n" + STRUCT_DEF@44..63 + STRUCT_KW@44..50 "struct" + WHITESPACE@50..51 " " + NAME@51..52 + IDENT@51..52 "D" + TYPE_PARAM_LIST@52..62 + L_ANGLE@52..53 "<" + TYPE_PARAM@53..60 + NAME@53..54 + IDENT@53..54 "T" + COLON@54..55 ":" + WHITESPACE@55..56 " " + TYPE_BOUND_LIST@56..60 + TYPE_BOUND@56..58 + LIFETIME@56..58 "\'a" + WHITESPACE@58..59 " " + PLUS@59..60 "+" + WHITESPACE@60..61 " " + R_ANGLE@61..62 ">" + SEMICOLON@62..63 ";" + WHITESPACE@63..64 "\n" + STRUCT_DEF@64..86 + STRUCT_KW@64..70 "struct" + WHITESPACE@70..71 " " + NAME@71..72 + IDENT@71..72 "E" + TYPE_PARAM_LIST@72..85 + L_ANGLE@72..73 "<" + TYPE_PARAM@73..83 + NAME@73..74 + IDENT@73..74 "T" + COLON@74..75 ":" + WHITESPACE@75..76 " " + TYPE_BOUND_LIST@76..83 + TYPE_BOUND@76..78 + LIFETIME@76..78 "\'a" + WHITESPACE@78..79 " " + PLUS@79..80 "+" + WHITESPACE@80..81 " " + TYPE_BOUND@81..83 + LIFETIME@81..83 "\'d" + WHITESPACE@83..84 " " + R_ANGLE@84..85 ">" + SEMICOLON@85..86 ";" + WHITESPACE@86..87 "\n" + STRUCT_DEF@87..116 + STRUCT_KW@87..93 "struct" + WHITESPACE@93..94 " " + NAME@94..95 + IDENT@94..95 "F" + TYPE_PARAM_LIST@95..115 + L_ANGLE@95..96 "<" + TYPE_PARAM@96..114 + NAME@96..97 + IDENT@96..97 "T" + COLON@97..98 ":" + WHITESPACE@98..99 " " + TYPE_BOUND_LIST@99..114 + TYPE_BOUND@99..101 + LIFETIME@99..101 "\'a" + WHITESPACE@101..102 " " + PLUS@102..103 "+" + WHITESPACE@103..104 " " + TYPE_BOUND@104..106 + LIFETIME@104..106 "\'d" + WHITESPACE@106..107 " " + PLUS@107..108 "+" + WHITESPACE@108..109 " " + TYPE_BOUND@109..114 + PATH_TYPE@109..114 + PATH@109..114 + PATH_SEGMENT@109..114 + NAME_REF@109..114 + IDENT@109..114 "Clone" + R_ANGLE@114..115 ">" + SEMICOLON@115..116 ";" + WHITESPACE@116..117 "\n" + STRUCT_DEF@117..143 + STRUCT_KW@117..123 "struct" + WHITESPACE@123..124 " " + NAME@124..125 + IDENT@124..125 "G" + TYPE_PARAM_LIST@125..142 + L_ANGLE@125..126 "<" + TYPE_PARAM@126..141 + NAME@126..127 + IDENT@126..127 "T" + COLON@127..128 ":" + WHITESPACE@128..129 " " + TYPE_BOUND_LIST@129..141 + TYPE_BOUND@129..134 + PATH_TYPE@129..134 + PATH@129..134 + PATH_SEGMENT@129..134 + NAME_REF@129..134 + IDENT@129..134 "Clone" + WHITESPACE@134..135 " " + PLUS@135..136 "+" + WHITESPACE@136..137 " " + TYPE_BOUND@137..141 + PATH_TYPE@137..141 + PATH@137..141 + PATH_SEGMENT@137..141 + NAME_REF@137..141 + IDENT@137..141 "Copy" + R_ANGLE@141..142 ">" + SEMICOLON@142..143 ";" + WHITESPACE@143..144 "\n" + STRUCT_DEF@144..180 + STRUCT_KW@144..150 "struct" + WHITESPACE@150..151 " " + NAME@151..152 + IDENT@151..152 "H" + TYPE_PARAM_LIST@152..179 + L_ANGLE@152..153 "<" + TYPE_PARAM@153..178 + NAME@153..154 + IDENT@153..154 "T" + COLON@154..155 ":" + WHITESPACE@155..156 " " + TYPE_BOUND_LIST@156..178 + TYPE_BOUND@156..161 + PATH_TYPE@156..161 + PATH@156..161 + PATH_SEGMENT@156..161 + COLON2@156..158 "::" + NAME_REF@158..161 + IDENT@158..161 "Foo" + WHITESPACE@161..162 " " + PLUS@162..163 "+" + WHITESPACE@163..164 " " + TYPE_BOUND@164..173 + PATH_TYPE@164..173 + PATH@164..173 + PATH@164..168 + PATH_SEGMENT@164..168 + SELF_KW@164..168 "self" + COLON2@168..170 "::" + PATH_SEGMENT@170..173 + NAME_REF@170..173 + IDENT@170..173 "Bar" + WHITESPACE@173..174 " " + PLUS@174..175 "+" + WHITESPACE@175..176 " " + TYPE_BOUND@176..178 + LIFETIME@176..178 "\'a" + R_ANGLE@178..179 ">" + SEMICOLON@179..180 ";" + WHITESPACE@180..181 "\n" + STRUCT_DEF@181..199 + STRUCT_KW@181..187 "struct" + WHITESPACE@187..188 " " + NAME@188..189 + IDENT@188..189 "I" + TYPE_PARAM_LIST@189..198 + L_ANGLE@189..190 "<" + TYPE_PARAM@190..192 + NAME@190..191 + IDENT@190..191 "T" + COLON@191..192 ":" + TYPE_BOUND_LIST@192..192 + COMMA@192..193 "," + WHITESPACE@193..194 " " + TYPE_PARAM@194..196 + NAME@194..195 + IDENT@194..195 "U" + COLON@195..196 ":" + TYPE_BOUND_LIST@196..196 + COMMA@196..197 "," + R_ANGLE@197..198 ">" + SEMICOLON@198..199 ";" + WHITESPACE@199..200 "\n" + STRUCT_DEF@200..250 + STRUCT_KW@200..206 "struct" + WHITESPACE@206..207 " " + NAME@207..208 + IDENT@207..208 "K" + TYPE_PARAM_LIST@208..249 + L_ANGLE@208..209 "<" + LIFETIME_PARAM@209..215 + LIFETIME@209..211 "\'a" + COLON@211..212 ":" + WHITESPACE@212..213 " " + LIFETIME@213..215 "\'d" + COMMA@215..216 "," + WHITESPACE@216..217 " " + LIFETIME_PARAM@217..228 + LIFETIME@217..219 "\'d" + COLON@219..220 ":" + WHITESPACE@220..221 " " + LIFETIME@221..223 "\'a" + WHITESPACE@223..224 " " + PLUS@224..225 "+" + WHITESPACE@225..226 " " + LIFETIME@226..228 "\'b" + COMMA@228..229 "," + WHITESPACE@229..230 " " + TYPE_PARAM@230..248 + NAME@230..231 + IDENT@230..231 "T" + COLON@231..232 ":" + WHITESPACE@232..233 " " + TYPE_BOUND_LIST@233..248 + TYPE_BOUND@233..235 + LIFETIME@233..235 "\'a" + WHITESPACE@235..236 " " + PLUS@236..237 "+" + WHITESPACE@237..238 " " + TYPE_BOUND@238..240 + LIFETIME@238..240 "\'d" + WHITESPACE@240..241 " " + PLUS@241..242 "+" + WHITESPACE@242..243 " " + TYPE_BOUND@243..248 + PATH_TYPE@243..248 + PATH@243..248 + PATH_SEGMENT@243..248 + NAME_REF@243..248 + IDENT@243..248 "Clone" + R_ANGLE@248..249 ">" + SEMICOLON@249..250 ";" diff --git a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast index 974fb9c444..643a1d16c8 100644 --- a/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast +++ b/crates/ra_syntax/test_data/parser/ok/0021_extern_fn.rast @@ -1,59 +1,59 @@ -SOURCE_FILE@[0; 71) - FN_DEF@[0; 19) - ABI@[0; 6) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - FN_KW@[7; 9) "fn" - WHITESPACE@[9; 10) " " - NAME@[10; 13) - IDENT@[10; 13) "foo" - PARAM_LIST@[13; 15) - L_PAREN@[13; 14) "(" - R_PAREN@[14; 15) ")" - WHITESPACE@[15; 16) " " - BLOCK_EXPR@[16; 19) - BLOCK@[16; 19) - L_CURLY@[16; 17) "{" - WHITESPACE@[17; 18) "\n" - R_CURLY@[18; 19) "}" - WHITESPACE@[19; 21) "\n\n" - FN_DEF@[21; 44) - ABI@[21; 31) - EXTERN_KW@[21; 27) "extern" - WHITESPACE@[27; 28) " " - STRING@[28; 31) "\"C\"" - WHITESPACE@[31; 32) " " - FN_KW@[32; 34) "fn" - WHITESPACE@[34; 35) " " - NAME@[35; 38) - IDENT@[35; 38) "bar" - PARAM_LIST@[38; 40) - L_PAREN@[38; 39) "(" - R_PAREN@[39; 40) ")" - WHITESPACE@[40; 41) " " - BLOCK_EXPR@[41; 44) - BLOCK@[41; 44) - L_CURLY@[41; 42) "{" - WHITESPACE@[42; 43) "\n" - R_CURLY@[43; 44) "}" - WHITESPACE@[44; 46) "\n\n" - FN_DEF@[46; 70) - ABI@[46; 57) - EXTERN_KW@[46; 52) "extern" - WHITESPACE@[52; 53) " " - RAW_STRING@[53; 57) "r\"D\"" - WHITESPACE@[57; 58) " " - FN_KW@[58; 60) "fn" - WHITESPACE@[60; 61) " " - NAME@[61; 64) - IDENT@[61; 64) "baz" - PARAM_LIST@[64; 66) - L_PAREN@[64; 65) "(" - R_PAREN@[65; 66) ")" - WHITESPACE@[66; 67) " " - BLOCK_EXPR@[67; 70) - BLOCK@[67; 70) - L_CURLY@[67; 68) "{" - WHITESPACE@[68; 69) "\n" - R_CURLY@[69; 70) "}" - WHITESPACE@[70; 71) "\n" +SOURCE_FILE@0..71 + FN_DEF@0..19 + ABI@0..6 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + FN_KW@7..9 "fn" + WHITESPACE@9..10 " " + NAME@10..13 + IDENT@10..13 "foo" + PARAM_LIST@13..15 + L_PAREN@13..14 "(" + R_PAREN@14..15 ")" + WHITESPACE@15..16 " " + BLOCK_EXPR@16..19 + BLOCK@16..19 + L_CURLY@16..17 "{" + WHITESPACE@17..18 "\n" + R_CURLY@18..19 "}" + WHITESPACE@19..21 "\n\n" + FN_DEF@21..44 + ABI@21..31 + EXTERN_KW@21..27 "extern" + WHITESPACE@27..28 " " + STRING@28..31 "\"C\"" + WHITESPACE@31..32 " " + FN_KW@32..34 "fn" + WHITESPACE@34..35 " " + NAME@35..38 + IDENT@35..38 "bar" + PARAM_LIST@38..40 + L_PAREN@38..39 "(" + R_PAREN@39..40 ")" + WHITESPACE@40..41 " " + BLOCK_EXPR@41..44 + BLOCK@41..44 + L_CURLY@41..42 "{" + WHITESPACE@42..43 "\n" + R_CURLY@43..44 "}" + WHITESPACE@44..46 "\n\n" + FN_DEF@46..70 + ABI@46..57 + EXTERN_KW@46..52 "extern" + WHITESPACE@52..53 " " + RAW_STRING@53..57 "r\"D\"" + WHITESPACE@57..58 " " + FN_KW@58..60 "fn" + WHITESPACE@60..61 " " + NAME@61..64 + IDENT@61..64 "baz" + PARAM_LIST@64..66 + L_PAREN@64..65 "(" + R_PAREN@65..66 ")" + WHITESPACE@66..67 " " + BLOCK_EXPR@67..70 + BLOCK@67..70 + L_CURLY@67..68 "{" + WHITESPACE@68..69 "\n" + R_CURLY@69..70 "}" + WHITESPACE@70..71 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0022_empty_extern_block.rast b/crates/ra_syntax/test_data/parser/ok/0022_empty_extern_block.rast index bbbd95fd95..26abae3b29 100644 --- a/crates/ra_syntax/test_data/parser/ok/0022_empty_extern_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0022_empty_extern_block.rast @@ -1,21 +1,21 @@ -SOURCE_FILE@[0; 27) - EXTERN_BLOCK@[0; 10) - ABI@[0; 6) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - EXTERN_ITEM_LIST@[7; 10) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 9) "\n" - R_CURLY@[9; 10) "}" - WHITESPACE@[10; 12) "\n\n" - EXTERN_BLOCK@[12; 26) - ABI@[12; 22) - EXTERN_KW@[12; 18) "extern" - WHITESPACE@[18; 19) " " - STRING@[19; 22) "\"C\"" - WHITESPACE@[22; 23) " " - EXTERN_ITEM_LIST@[23; 26) - L_CURLY@[23; 24) "{" - WHITESPACE@[24; 25) "\n" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 27) "\n" +SOURCE_FILE@0..27 + EXTERN_BLOCK@0..10 + ABI@0..6 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + EXTERN_ITEM_LIST@7..10 + L_CURLY@7..8 "{" + WHITESPACE@8..9 "\n" + R_CURLY@9..10 "}" + WHITESPACE@10..12 "\n\n" + EXTERN_BLOCK@12..26 + ABI@12..22 + EXTERN_KW@12..18 "extern" + WHITESPACE@18..19 " " + STRING@19..22 "\"C\"" + WHITESPACE@22..23 " " + EXTERN_ITEM_LIST@23..26 + L_CURLY@23..24 "{" + WHITESPACE@24..25 "\n" + R_CURLY@25..26 "}" + WHITESPACE@26..27 "\n" 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 dadf24fa68..97d90dc756 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 @@ -1,41 +1,41 @@ -SOURCE_FILE@[0; 47) - STATIC_DEF@[0; 20) - STATIC_KW@[0; 6) "static" - WHITESPACE@[6; 7) " " - NAME@[7; 10) - IDENT@[7; 10) "FOO" - COLON@[10; 11) ":" - WHITESPACE@[11; 12) " " - PATH_TYPE@[12; 15) - PATH@[12; 15) - PATH_SEGMENT@[12; 15) - NAME_REF@[12; 15) - IDENT@[12; 15) "u32" - WHITESPACE@[15; 16) " " - EQ@[16; 17) "=" - WHITESPACE@[17; 18) " " - LITERAL@[18; 19) - INT_NUMBER@[18; 19) "1" - SEMICOLON@[19; 20) ";" - WHITESPACE@[20; 21) "\n" - STATIC_DEF@[21; 46) - STATIC_KW@[21; 27) "static" - WHITESPACE@[27; 28) " " - MUT_KW@[28; 31) "mut" - WHITESPACE@[31; 32) " " - NAME@[32; 35) - IDENT@[32; 35) "BAR" - COLON@[35; 36) ":" - WHITESPACE@[36; 37) " " - PATH_TYPE@[37; 40) - PATH@[37; 40) - PATH_SEGMENT@[37; 40) - NAME_REF@[37; 40) - IDENT@[37; 40) "i32" - WHITESPACE@[40; 41) " " - EQ@[41; 42) "=" - WHITESPACE@[42; 43) " " - LITERAL@[43; 45) - INT_NUMBER@[43; 45) "92" - SEMICOLON@[45; 46) ";" - WHITESPACE@[46; 47) "\n" +SOURCE_FILE@0..47 + STATIC_DEF@0..20 + STATIC_KW@0..6 "static" + WHITESPACE@6..7 " " + NAME@7..10 + IDENT@7..10 "FOO" + COLON@10..11 ":" + WHITESPACE@11..12 " " + PATH_TYPE@12..15 + PATH@12..15 + PATH_SEGMENT@12..15 + NAME_REF@12..15 + IDENT@12..15 "u32" + WHITESPACE@15..16 " " + EQ@16..17 "=" + WHITESPACE@17..18 " " + LITERAL@18..19 + INT_NUMBER@18..19 "1" + SEMICOLON@19..20 ";" + WHITESPACE@20..21 "\n" + STATIC_DEF@21..46 + STATIC_KW@21..27 "static" + WHITESPACE@27..28 " " + MUT_KW@28..31 "mut" + WHITESPACE@31..32 " " + NAME@32..35 + IDENT@32..35 "BAR" + COLON@35..36 ":" + WHITESPACE@36..37 " " + PATH_TYPE@37..40 + PATH@37..40 + PATH_SEGMENT@37..40 + NAME_REF@37..40 + IDENT@37..40 "i32" + WHITESPACE@40..41 " " + EQ@41..42 "=" + WHITESPACE@42..43 " " + LITERAL@43..45 + INT_NUMBER@43..45 "92" + SEMICOLON@45..46 ";" + 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 262e31f7f7..d241f034c7 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 @@ -1,59 +1,59 @@ -SOURCE_FILE@[0; 64) - CONST_DEF@[0; 17) - CONST_KW@[0; 5) "const" - WHITESPACE@[5; 6) " " - UNDERSCORE@[6; 7) "_" - COLON@[7; 8) ":" - WHITESPACE@[8; 9) " " - PATH_TYPE@[9; 12) - PATH@[9; 12) - PATH_SEGMENT@[9; 12) - NAME_REF@[9; 12) - IDENT@[9; 12) "u32" - WHITESPACE@[12; 13) " " - EQ@[13; 14) "=" - WHITESPACE@[14; 15) " " - LITERAL@[15; 16) - INT_NUMBER@[15; 16) "0" - SEMICOLON@[16; 17) ";" - WHITESPACE@[17; 18) "\n" - CONST_DEF@[18; 38) - CONST_KW@[18; 23) "const" - WHITESPACE@[23; 24) " " - NAME@[24; 27) - IDENT@[24; 27) "FOO" - COLON@[27; 28) ":" - WHITESPACE@[28; 29) " " - PATH_TYPE@[29; 32) - PATH@[29; 32) - PATH_SEGMENT@[29; 32) - NAME_REF@[29; 32) - IDENT@[29; 32) "u32" - WHITESPACE@[32; 33) " " - EQ@[33; 34) "=" - WHITESPACE@[34; 35) " " - LITERAL@[35; 37) - INT_NUMBER@[35; 37) "92" - SEMICOLON@[37; 38) ";" - WHITESPACE@[38; 39) "\n" - CONST_DEF@[39; 63) - CONST_KW@[39; 44) "const" - WHITESPACE@[44; 45) " " - MUT_KW@[45; 48) "mut" - WHITESPACE@[48; 49) " " - NAME@[49; 52) - IDENT@[49; 52) "BAR" - COLON@[52; 53) ":" - WHITESPACE@[53; 54) " " - PATH_TYPE@[54; 57) - PATH@[54; 57) - PATH_SEGMENT@[54; 57) - NAME_REF@[54; 57) - IDENT@[54; 57) "u32" - WHITESPACE@[57; 58) " " - EQ@[58; 59) "=" - WHITESPACE@[59; 60) " " - LITERAL@[60; 62) - INT_NUMBER@[60; 62) "62" - SEMICOLON@[62; 63) ";" - WHITESPACE@[63; 64) "\n" +SOURCE_FILE@0..64 + CONST_DEF@0..17 + CONST_KW@0..5 "const" + WHITESPACE@5..6 " " + UNDERSCORE@6..7 "_" + COLON@7..8 ":" + WHITESPACE@8..9 " " + PATH_TYPE@9..12 + PATH@9..12 + PATH_SEGMENT@9..12 + NAME_REF@9..12 + IDENT@9..12 "u32" + WHITESPACE@12..13 " " + EQ@13..14 "=" + WHITESPACE@14..15 " " + LITERAL@15..16 + INT_NUMBER@15..16 "0" + SEMICOLON@16..17 ";" + WHITESPACE@17..18 "\n" + CONST_DEF@18..38 + CONST_KW@18..23 "const" + WHITESPACE@23..24 " " + NAME@24..27 + IDENT@24..27 "FOO" + COLON@27..28 ":" + WHITESPACE@28..29 " " + PATH_TYPE@29..32 + PATH@29..32 + PATH_SEGMENT@29..32 + NAME_REF@29..32 + IDENT@29..32 "u32" + WHITESPACE@32..33 " " + EQ@33..34 "=" + WHITESPACE@34..35 " " + LITERAL@35..37 + INT_NUMBER@35..37 "92" + SEMICOLON@37..38 ";" + WHITESPACE@38..39 "\n" + CONST_DEF@39..63 + CONST_KW@39..44 "const" + WHITESPACE@44..45 " " + MUT_KW@45..48 "mut" + WHITESPACE@48..49 " " + NAME@49..52 + IDENT@49..52 "BAR" + COLON@52..53 ":" + WHITESPACE@53..54 " " + PATH_TYPE@54..57 + PATH@54..57 + PATH_SEGMENT@54..57 + NAME_REF@54..57 + IDENT@54..57 "u32" + WHITESPACE@57..58 " " + EQ@58..59 "=" + WHITESPACE@59..60 " " + LITERAL@60..62 + INT_NUMBER@60..62 "62" + SEMICOLON@62..63 ";" + WHITESPACE@63..64 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast b/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast index f5a7a1a5ad..60af558376 100644 --- a/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0025_extern_fn_in_block.rast @@ -1,33 +1,33 @@ -SOURCE_FILE@[0; 35) - FN_DEF@[0; 34) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 34) - BLOCK@[10; 34) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - FN_DEF@[16; 32) - ABI@[16; 22) - EXTERN_KW@[16; 22) "extern" - WHITESPACE@[22; 23) " " - FN_KW@[23; 25) "fn" - WHITESPACE@[25; 26) " " - NAME@[26; 27) - IDENT@[26; 27) "f" - PARAM_LIST@[27; 29) - L_PAREN@[27; 28) "(" - R_PAREN@[28; 29) ")" - WHITESPACE@[29; 30) " " - BLOCK_EXPR@[30; 32) - BLOCK@[30; 32) - L_CURLY@[30; 31) "{" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" - R_CURLY@[33; 34) "}" - WHITESPACE@[34; 35) "\n" +SOURCE_FILE@0..35 + FN_DEF@0..34 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..34 + BLOCK@10..34 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + FN_DEF@16..32 + ABI@16..22 + EXTERN_KW@16..22 "extern" + WHITESPACE@22..23 " " + FN_KW@23..25 "fn" + WHITESPACE@25..26 " " + NAME@26..27 + IDENT@26..27 "f" + PARAM_LIST@27..29 + L_PAREN@27..28 "(" + R_PAREN@28..29 ")" + WHITESPACE@29..30 " " + BLOCK_EXPR@30..32 + BLOCK@30..32 + L_CURLY@30..31 "{" + R_CURLY@31..32 "}" + WHITESPACE@32..33 "\n" + R_CURLY@33..34 "}" + WHITESPACE@34..35 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast b/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast index f9b1dcf1ab..4432c01633 100644 --- a/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0026_const_fn_in_block.rast @@ -1,32 +1,32 @@ -SOURCE_FILE@[0; 34) - FN_DEF@[0; 33) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 33) - BLOCK@[10; 33) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - FN_DEF@[16; 31) - CONST_KW@[16; 21) "const" - WHITESPACE@[21; 22) " " - FN_KW@[22; 24) "fn" - WHITESPACE@[24; 25) " " - NAME@[25; 26) - IDENT@[25; 26) "f" - PARAM_LIST@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - WHITESPACE@[28; 29) " " - BLOCK_EXPR@[29; 31) - BLOCK@[29; 31) - L_CURLY@[29; 30) "{" - R_CURLY@[30; 31) "}" - WHITESPACE@[31; 32) "\n" - R_CURLY@[32; 33) "}" - WHITESPACE@[33; 34) "\n" +SOURCE_FILE@0..34 + FN_DEF@0..33 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..33 + BLOCK@10..33 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + FN_DEF@16..31 + CONST_KW@16..21 "const" + WHITESPACE@21..22 " " + FN_KW@22..24 "fn" + WHITESPACE@24..25 " " + NAME@25..26 + IDENT@25..26 "f" + PARAM_LIST@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + WHITESPACE@28..29 " " + BLOCK_EXPR@29..31 + BLOCK@29..31 + L_CURLY@29..30 "{" + R_CURLY@30..31 "}" + WHITESPACE@31..32 "\n" + R_CURLY@32..33 "}" + WHITESPACE@33..34 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast b/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast index 9fb7b70a05..c0162c609d 100644 --- a/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast +++ b/crates/ra_syntax/test_data/parser/ok/0027_unsafe_fn_in_block.rast @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 53) - FN_DEF@[0; 52) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 52) - BLOCK@[10; 52) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - FN_DEF@[16; 32) - UNSAFE_KW@[16; 22) "unsafe" - WHITESPACE@[22; 23) " " - FN_KW@[23; 25) "fn" - WHITESPACE@[25; 26) " " - NAME@[26; 27) - IDENT@[26; 27) "f" - PARAM_LIST@[27; 29) - L_PAREN@[27; 28) "(" - R_PAREN@[28; 29) ")" - WHITESPACE@[29; 30) " " - BLOCK_EXPR@[30; 32) - BLOCK@[30; 32) - L_CURLY@[30; 31) "{" - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 37) "\n " - BLOCK_EXPR@[37; 50) - UNSAFE_KW@[37; 43) "unsafe" - WHITESPACE@[43; 44) " " - BLOCK@[44; 50) - L_CURLY@[44; 45) "{" - WHITESPACE@[45; 46) " " - LITERAL@[46; 48) - INT_NUMBER@[46; 48) "92" - WHITESPACE@[48; 49) " " - R_CURLY@[49; 50) "}" - WHITESPACE@[50; 51) "\n" - R_CURLY@[51; 52) "}" - WHITESPACE@[52; 53) "\n" +SOURCE_FILE@0..53 + FN_DEF@0..52 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..52 + BLOCK@10..52 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + FN_DEF@16..32 + UNSAFE_KW@16..22 "unsafe" + WHITESPACE@22..23 " " + FN_KW@23..25 "fn" + WHITESPACE@25..26 " " + NAME@26..27 + IDENT@26..27 "f" + PARAM_LIST@27..29 + L_PAREN@27..28 "(" + R_PAREN@28..29 ")" + WHITESPACE@29..30 " " + BLOCK_EXPR@30..32 + BLOCK@30..32 + L_CURLY@30..31 "{" + R_CURLY@31..32 "}" + WHITESPACE@32..37 "\n " + BLOCK_EXPR@37..50 + UNSAFE_KW@37..43 "unsafe" + WHITESPACE@43..44 " " + BLOCK@44..50 + L_CURLY@44..45 "{" + WHITESPACE@45..46 " " + LITERAL@46..48 + INT_NUMBER@46..48 "92" + WHITESPACE@48..49 " " + R_CURLY@49..50 "}" + WHITESPACE@50..51 "\n" + R_CURLY@51..52 "}" + WHITESPACE@52..53 "\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 5542f7701b..6c0daef528 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 @@ -1,186 +1,186 @@ -SOURCE_FILE@[0; 248) - FN_DEF@[0; 247) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 16) - IDENT@[3; 16) "binding_power" - PARAM_LIST@[16; 18) - L_PAREN@[16; 17) "(" - R_PAREN@[17; 18) ")" - WHITESPACE@[18; 19) " " - BLOCK_EXPR@[19; 247) - BLOCK@[19; 247) - L_CURLY@[19; 20) "{" - WHITESPACE@[20; 25) "\n " - LET_STMT@[25; 55) - LET_KW@[25; 28) "let" - WHITESPACE@[28; 29) " " - BIND_PAT@[29; 30) - NAME@[29; 30) - IDENT@[29; 30) "x" - WHITESPACE@[30; 31) " " - EQ@[31; 32) "=" - WHITESPACE@[32; 33) " " - BIN_EXPR@[33; 54) - BIN_EXPR@[33; 46) - LITERAL@[33; 34) - INT_NUMBER@[33; 34) "1" - WHITESPACE@[34; 35) " " - PLUS@[35; 36) "+" - WHITESPACE@[36; 37) " " - BIN_EXPR@[37; 46) - BIN_EXPR@[37; 42) - LITERAL@[37; 38) - INT_NUMBER@[37; 38) "2" - WHITESPACE@[38; 39) " " - STAR@[39; 40) "*" - WHITESPACE@[40; 41) " " - LITERAL@[41; 42) - INT_NUMBER@[41; 42) "3" - WHITESPACE@[42; 43) " " - PERCENT@[43; 44) "%" - WHITESPACE@[44; 45) " " - LITERAL@[45; 46) - INT_NUMBER@[45; 46) "4" - WHITESPACE@[46; 47) " " - MINUS@[47; 48) "-" - WHITESPACE@[48; 49) " " - BIN_EXPR@[49; 54) - LITERAL@[49; 50) - INT_NUMBER@[49; 50) "5" - WHITESPACE@[50; 51) " " - SLASH@[51; 52) "/" - WHITESPACE@[52; 53) " " - LITERAL@[53; 54) - INT_NUMBER@[53; 54) "6" - SEMICOLON@[54; 55) ";" - WHITESPACE@[55; 60) "\n " - EXPR_STMT@[60; 70) - BIN_EXPR@[60; 69) - LITERAL@[60; 61) - INT_NUMBER@[60; 61) "1" - WHITESPACE@[61; 62) " " - PLUS@[62; 63) "+" - WHITESPACE@[63; 64) " " - BIN_EXPR@[64; 69) - LITERAL@[64; 65) - INT_NUMBER@[64; 65) "2" - WHITESPACE@[65; 66) " " - STAR@[66; 67) "*" - WHITESPACE@[67; 68) " " - LITERAL@[68; 69) - INT_NUMBER@[68; 69) "3" - SEMICOLON@[69; 70) ";" - WHITESPACE@[70; 75) "\n " - EXPR_STMT@[75; 86) - BIN_EXPR@[75; 85) - LITERAL@[75; 76) - INT_NUMBER@[75; 76) "1" - WHITESPACE@[76; 77) " " - SHL@[77; 79) "<<" - WHITESPACE@[79; 80) " " - BIN_EXPR@[80; 85) - LITERAL@[80; 81) - INT_NUMBER@[80; 81) "2" - WHITESPACE@[81; 82) " " - PLUS@[82; 83) "+" - WHITESPACE@[83; 84) " " - LITERAL@[84; 85) - INT_NUMBER@[84; 85) "3" - SEMICOLON@[85; 86) ";" - WHITESPACE@[86; 91) "\n " - EXPR_STMT@[91; 102) - BIN_EXPR@[91; 101) - LITERAL@[91; 92) - INT_NUMBER@[91; 92) "1" - WHITESPACE@[92; 93) " " - AMP@[93; 94) "&" - WHITESPACE@[94; 95) " " - BIN_EXPR@[95; 101) - LITERAL@[95; 96) - INT_NUMBER@[95; 96) "2" - WHITESPACE@[96; 97) " " - SHR@[97; 99) ">>" - WHITESPACE@[99; 100) " " - LITERAL@[100; 101) - INT_NUMBER@[100; 101) "3" - SEMICOLON@[101; 102) ";" - WHITESPACE@[102; 107) "\n " - EXPR_STMT@[107; 117) - BIN_EXPR@[107; 116) - LITERAL@[107; 108) - INT_NUMBER@[107; 108) "1" - WHITESPACE@[108; 109) " " - CARET@[109; 110) "^" - WHITESPACE@[110; 111) " " - BIN_EXPR@[111; 116) - LITERAL@[111; 112) - INT_NUMBER@[111; 112) "2" - WHITESPACE@[112; 113) " " - AMP@[113; 114) "&" - WHITESPACE@[114; 115) " " - LITERAL@[115; 116) - INT_NUMBER@[115; 116) "3" - SEMICOLON@[116; 117) ";" - WHITESPACE@[117; 122) "\n " - EXPR_STMT@[122; 132) - BIN_EXPR@[122; 131) - LITERAL@[122; 123) - INT_NUMBER@[122; 123) "1" - WHITESPACE@[123; 124) " " - PIPE@[124; 125) "|" - WHITESPACE@[125; 126) " " - BIN_EXPR@[126; 131) - LITERAL@[126; 127) - INT_NUMBER@[126; 127) "2" - WHITESPACE@[127; 128) " " - CARET@[128; 129) "^" - WHITESPACE@[129; 130) " " - LITERAL@[130; 131) - INT_NUMBER@[130; 131) "3" - SEMICOLON@[131; 132) ";" - WHITESPACE@[132; 137) "\n " - EXPR_STMT@[137; 148) - BIN_EXPR@[137; 147) - LITERAL@[137; 138) - INT_NUMBER@[137; 138) "1" - WHITESPACE@[138; 139) " " - EQ2@[139; 141) "==" - WHITESPACE@[141; 142) " " - BIN_EXPR@[142; 147) - LITERAL@[142; 143) - INT_NUMBER@[142; 143) "2" - WHITESPACE@[143; 144) " " - PIPE@[144; 145) "|" - WHITESPACE@[145; 146) " " - LITERAL@[146; 147) - INT_NUMBER@[146; 147) "3" - SEMICOLON@[147; 148) ";" - WHITESPACE@[148; 153) "\n " - EXPR_STMT@[153; 165) - BIN_EXPR@[153; 164) - LITERAL@[153; 154) - INT_NUMBER@[153; 154) "1" - WHITESPACE@[154; 155) " " - AMP2@[155; 157) "&&" - WHITESPACE@[157; 158) " " - BIN_EXPR@[158; 164) - LITERAL@[158; 159) - INT_NUMBER@[158; 159) "2" - WHITESPACE@[159; 160) " " - EQ2@[160; 162) "==" - WHITESPACE@[162; 163) " " - LITERAL@[163; 164) - INT_NUMBER@[163; 164) "3" - SEMICOLON@[164; 165) ";" - WHITESPACE@[165; 170) "\n " - COMMENT@[170; 184) "//1 || 2 && 2;" - WHITESPACE@[184; 189) "\n " - COMMENT@[189; 203) "//1 .. 2 || 3;" - WHITESPACE@[203; 208) "\n " - COMMENT@[208; 221) "//1 = 2 .. 3;" - WHITESPACE@[221; 226) "\n " - COMMENT@[226; 245) "//---&*1 - --2 * 9;" - WHITESPACE@[245; 246) "\n" - R_CURLY@[246; 247) "}" - WHITESPACE@[247; 248) "\n" +SOURCE_FILE@0..248 + FN_DEF@0..247 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..16 + IDENT@3..16 "binding_power" + PARAM_LIST@16..18 + L_PAREN@16..17 "(" + R_PAREN@17..18 ")" + WHITESPACE@18..19 " " + BLOCK_EXPR@19..247 + BLOCK@19..247 + L_CURLY@19..20 "{" + WHITESPACE@20..25 "\n " + LET_STMT@25..55 + LET_KW@25..28 "let" + WHITESPACE@28..29 " " + BIND_PAT@29..30 + NAME@29..30 + IDENT@29..30 "x" + WHITESPACE@30..31 " " + EQ@31..32 "=" + WHITESPACE@32..33 " " + BIN_EXPR@33..54 + BIN_EXPR@33..46 + LITERAL@33..34 + INT_NUMBER@33..34 "1" + WHITESPACE@34..35 " " + PLUS@35..36 "+" + WHITESPACE@36..37 " " + BIN_EXPR@37..46 + BIN_EXPR@37..42 + LITERAL@37..38 + INT_NUMBER@37..38 "2" + WHITESPACE@38..39 " " + STAR@39..40 "*" + WHITESPACE@40..41 " " + LITERAL@41..42 + INT_NUMBER@41..42 "3" + WHITESPACE@42..43 " " + PERCENT@43..44 "%" + WHITESPACE@44..45 " " + LITERAL@45..46 + INT_NUMBER@45..46 "4" + WHITESPACE@46..47 " " + MINUS@47..48 "-" + WHITESPACE@48..49 " " + BIN_EXPR@49..54 + LITERAL@49..50 + INT_NUMBER@49..50 "5" + WHITESPACE@50..51 " " + SLASH@51..52 "/" + WHITESPACE@52..53 " " + LITERAL@53..54 + INT_NUMBER@53..54 "6" + SEMICOLON@54..55 ";" + WHITESPACE@55..60 "\n " + EXPR_STMT@60..70 + BIN_EXPR@60..69 + LITERAL@60..61 + INT_NUMBER@60..61 "1" + WHITESPACE@61..62 " " + PLUS@62..63 "+" + WHITESPACE@63..64 " " + BIN_EXPR@64..69 + LITERAL@64..65 + INT_NUMBER@64..65 "2" + WHITESPACE@65..66 " " + STAR@66..67 "*" + WHITESPACE@67..68 " " + LITERAL@68..69 + INT_NUMBER@68..69 "3" + SEMICOLON@69..70 ";" + WHITESPACE@70..75 "\n " + EXPR_STMT@75..86 + BIN_EXPR@75..85 + LITERAL@75..76 + INT_NUMBER@75..76 "1" + WHITESPACE@76..77 " " + SHL@77..79 "<<" + WHITESPACE@79..80 " " + BIN_EXPR@80..85 + LITERAL@80..81 + INT_NUMBER@80..81 "2" + WHITESPACE@81..82 " " + PLUS@82..83 "+" + WHITESPACE@83..84 " " + LITERAL@84..85 + INT_NUMBER@84..85 "3" + SEMICOLON@85..86 ";" + WHITESPACE@86..91 "\n " + EXPR_STMT@91..102 + BIN_EXPR@91..101 + LITERAL@91..92 + INT_NUMBER@91..92 "1" + WHITESPACE@92..93 " " + AMP@93..94 "&" + WHITESPACE@94..95 " " + BIN_EXPR@95..101 + LITERAL@95..96 + INT_NUMBER@95..96 "2" + WHITESPACE@96..97 " " + SHR@97..99 ">>" + WHITESPACE@99..100 " " + LITERAL@100..101 + INT_NUMBER@100..101 "3" + SEMICOLON@101..102 ";" + WHITESPACE@102..107 "\n " + EXPR_STMT@107..117 + BIN_EXPR@107..116 + LITERAL@107..108 + INT_NUMBER@107..108 "1" + WHITESPACE@108..109 " " + CARET@109..110 "^" + WHITESPACE@110..111 " " + BIN_EXPR@111..116 + LITERAL@111..112 + INT_NUMBER@111..112 "2" + WHITESPACE@112..113 " " + AMP@113..114 "&" + WHITESPACE@114..115 " " + LITERAL@115..116 + INT_NUMBER@115..116 "3" + SEMICOLON@116..117 ";" + WHITESPACE@117..122 "\n " + EXPR_STMT@122..132 + BIN_EXPR@122..131 + LITERAL@122..123 + INT_NUMBER@122..123 "1" + WHITESPACE@123..124 " " + PIPE@124..125 "|" + WHITESPACE@125..126 " " + BIN_EXPR@126..131 + LITERAL@126..127 + INT_NUMBER@126..127 "2" + WHITESPACE@127..128 " " + CARET@128..129 "^" + WHITESPACE@129..130 " " + LITERAL@130..131 + INT_NUMBER@130..131 "3" + SEMICOLON@131..132 ";" + WHITESPACE@132..137 "\n " + EXPR_STMT@137..148 + BIN_EXPR@137..147 + LITERAL@137..138 + INT_NUMBER@137..138 "1" + WHITESPACE@138..139 " " + EQ2@139..141 "==" + WHITESPACE@141..142 " " + BIN_EXPR@142..147 + LITERAL@142..143 + INT_NUMBER@142..143 "2" + WHITESPACE@143..144 " " + PIPE@144..145 "|" + WHITESPACE@145..146 " " + LITERAL@146..147 + INT_NUMBER@146..147 "3" + SEMICOLON@147..148 ";" + WHITESPACE@148..153 "\n " + EXPR_STMT@153..165 + BIN_EXPR@153..164 + LITERAL@153..154 + INT_NUMBER@153..154 "1" + WHITESPACE@154..155 " " + AMP2@155..157 "&&" + WHITESPACE@157..158 " " + BIN_EXPR@158..164 + LITERAL@158..159 + INT_NUMBER@158..159 "2" + WHITESPACE@159..160 " " + EQ2@160..162 "==" + WHITESPACE@162..163 " " + LITERAL@163..164 + INT_NUMBER@163..164 "3" + SEMICOLON@164..165 ";" + WHITESPACE@165..170 "\n " + COMMENT@170..184 "//1 || 2 && 2;" + WHITESPACE@184..189 "\n " + COMMENT@189..203 "//1 .. 2 || 3;" + WHITESPACE@203..208 "\n " + COMMENT@208..221 "//1 = 2 .. 3;" + WHITESPACE@221..226 "\n " + COMMENT@226..245 "//---&*1 - --2 * 9;" + WHITESPACE@245..246 "\n" + R_CURLY@246..247 "}" + WHITESPACE@247..248 "\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 78056aa953..8177bd89b4 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 @@ -1,152 +1,152 @@ -SOURCE_FILE@[0; 153) - FN_DEF@[0; 152) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 152) - BLOCK@[9; 152) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 23) - RANGE_EXPR@[15; 22) - DOT2@[15; 17) ".." - BIN_EXPR@[17; 22) - LITERAL@[17; 18) - INT_NUMBER@[17; 18) "1" - WHITESPACE@[18; 19) " " - PLUS@[19; 20) "+" - WHITESPACE@[20; 21) " " - LITERAL@[21; 22) - INT_NUMBER@[21; 22) "1" - SEMICOLON@[22; 23) ";" - WHITESPACE@[23; 28) "\n " - EXPR_STMT@[28; 36) - BIN_EXPR@[28; 35) - RANGE_EXPR@[28; 31) - DOT2@[28; 30) ".." - PATH_EXPR@[30; 31) - PATH@[30; 31) - PATH_SEGMENT@[30; 31) - NAME_REF@[30; 31) - IDENT@[30; 31) "z" - WHITESPACE@[31; 32) " " - EQ@[32; 33) "=" - WHITESPACE@[33; 34) " " - LITERAL@[34; 35) - INT_NUMBER@[34; 35) "2" - SEMICOLON@[35; 36) ";" - WHITESPACE@[36; 41) "\n " - EXPR_STMT@[41; 59) - BIN_EXPR@[41; 58) - PATH_EXPR@[41; 42) - PATH@[41; 42) - PATH_SEGMENT@[41; 42) - NAME_REF@[41; 42) - IDENT@[41; 42) "x" - WHITESPACE@[42; 43) " " - EQ@[43; 44) "=" - WHITESPACE@[44; 45) " " - RANGE_EXPR@[45; 58) - LITERAL@[45; 50) - FALSE_KW@[45; 50) "false" - DOT2@[50; 52) ".." - BIN_EXPR@[52; 58) - LITERAL@[52; 53) - INT_NUMBER@[52; 53) "1" - WHITESPACE@[53; 54) " " - EQ2@[54; 56) "==" - WHITESPACE@[56; 57) " " - LITERAL@[57; 58) - INT_NUMBER@[57; 58) "1" - SEMICOLON@[58; 59) ";" - WHITESPACE@[59; 64) "\n " - LET_STMT@[64; 76) - LET_KW@[64; 67) "let" - WHITESPACE@[67; 68) " " - BIND_PAT@[68; 69) - NAME@[68; 69) - IDENT@[68; 69) "x" - WHITESPACE@[69; 70) " " - EQ@[70; 71) "=" - WHITESPACE@[71; 72) " " - RANGE_EXPR@[72; 75) - LITERAL@[72; 73) - INT_NUMBER@[72; 73) "1" - DOT2@[73; 75) ".." - SEMICOLON@[75; 76) ";" - WHITESPACE@[76; 86) "\n \n " - EXPR_STMT@[86; 95) - RANGE_EXPR@[86; 94) - DOT2EQ@[86; 89) "..=" - BIN_EXPR@[89; 94) - LITERAL@[89; 90) - INT_NUMBER@[89; 90) "1" - WHITESPACE@[90; 91) " " - PLUS@[91; 92) "+" - WHITESPACE@[92; 93) " " - LITERAL@[93; 94) - INT_NUMBER@[93; 94) "1" - SEMICOLON@[94; 95) ";" - WHITESPACE@[95; 100) "\n " - EXPR_STMT@[100; 109) - BIN_EXPR@[100; 108) - RANGE_EXPR@[100; 104) - DOT2EQ@[100; 103) "..=" - PATH_EXPR@[103; 104) - PATH@[103; 104) - PATH_SEGMENT@[103; 104) - NAME_REF@[103; 104) - IDENT@[103; 104) "z" - WHITESPACE@[104; 105) " " - EQ@[105; 106) "=" - WHITESPACE@[106; 107) " " - LITERAL@[107; 108) - INT_NUMBER@[107; 108) "2" - SEMICOLON@[108; 109) ";" - WHITESPACE@[109; 114) "\n " - EXPR_STMT@[114; 133) - BIN_EXPR@[114; 132) - PATH_EXPR@[114; 115) - PATH@[114; 115) - PATH_SEGMENT@[114; 115) - NAME_REF@[114; 115) - IDENT@[114; 115) "x" - WHITESPACE@[115; 116) " " - EQ@[116; 117) "=" - WHITESPACE@[117; 118) " " - RANGE_EXPR@[118; 132) - LITERAL@[118; 123) - FALSE_KW@[118; 123) "false" - DOT2EQ@[123; 126) "..=" - BIN_EXPR@[126; 132) - LITERAL@[126; 127) - INT_NUMBER@[126; 127) "1" - WHITESPACE@[127; 128) " " - EQ2@[128; 130) "==" - WHITESPACE@[130; 131) " " - LITERAL@[131; 132) - INT_NUMBER@[131; 132) "1" - SEMICOLON@[132; 133) ";" - WHITESPACE@[133; 138) "\n " - LET_STMT@[138; 150) - LET_KW@[138; 141) "let" - WHITESPACE@[141; 142) " " - BIND_PAT@[142; 143) - NAME@[142; 143) - IDENT@[142; 143) "x" - WHITESPACE@[143; 144) " " - EQ@[144; 145) "=" - WHITESPACE@[145; 146) " " - RANGE_EXPR@[146; 149) - LITERAL@[146; 147) - INT_NUMBER@[146; 147) "1" - DOT2@[147; 149) ".." - SEMICOLON@[149; 150) ";" - WHITESPACE@[150; 151) "\n" - R_CURLY@[151; 152) "}" - WHITESPACE@[152; 153) "\n" +SOURCE_FILE@0..153 + FN_DEF@0..152 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..152 + BLOCK@9..152 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..23 + RANGE_EXPR@15..22 + DOT2@15..17 ".." + BIN_EXPR@17..22 + LITERAL@17..18 + INT_NUMBER@17..18 "1" + WHITESPACE@18..19 " " + PLUS@19..20 "+" + WHITESPACE@20..21 " " + LITERAL@21..22 + INT_NUMBER@21..22 "1" + SEMICOLON@22..23 ";" + WHITESPACE@23..28 "\n " + EXPR_STMT@28..36 + BIN_EXPR@28..35 + RANGE_EXPR@28..31 + DOT2@28..30 ".." + PATH_EXPR@30..31 + PATH@30..31 + PATH_SEGMENT@30..31 + NAME_REF@30..31 + IDENT@30..31 "z" + WHITESPACE@31..32 " " + EQ@32..33 "=" + WHITESPACE@33..34 " " + LITERAL@34..35 + INT_NUMBER@34..35 "2" + SEMICOLON@35..36 ";" + WHITESPACE@36..41 "\n " + EXPR_STMT@41..59 + BIN_EXPR@41..58 + PATH_EXPR@41..42 + PATH@41..42 + PATH_SEGMENT@41..42 + NAME_REF@41..42 + IDENT@41..42 "x" + WHITESPACE@42..43 " " + EQ@43..44 "=" + WHITESPACE@44..45 " " + RANGE_EXPR@45..58 + LITERAL@45..50 + FALSE_KW@45..50 "false" + DOT2@50..52 ".." + BIN_EXPR@52..58 + LITERAL@52..53 + INT_NUMBER@52..53 "1" + WHITESPACE@53..54 " " + EQ2@54..56 "==" + WHITESPACE@56..57 " " + LITERAL@57..58 + INT_NUMBER@57..58 "1" + SEMICOLON@58..59 ";" + WHITESPACE@59..64 "\n " + LET_STMT@64..76 + LET_KW@64..67 "let" + WHITESPACE@67..68 " " + BIND_PAT@68..69 + NAME@68..69 + IDENT@68..69 "x" + WHITESPACE@69..70 " " + EQ@70..71 "=" + WHITESPACE@71..72 " " + RANGE_EXPR@72..75 + LITERAL@72..73 + INT_NUMBER@72..73 "1" + DOT2@73..75 ".." + SEMICOLON@75..76 ";" + WHITESPACE@76..86 "\n \n " + EXPR_STMT@86..95 + RANGE_EXPR@86..94 + DOT2EQ@86..89 "..=" + BIN_EXPR@89..94 + LITERAL@89..90 + INT_NUMBER@89..90 "1" + WHITESPACE@90..91 " " + PLUS@91..92 "+" + WHITESPACE@92..93 " " + LITERAL@93..94 + INT_NUMBER@93..94 "1" + SEMICOLON@94..95 ";" + WHITESPACE@95..100 "\n " + EXPR_STMT@100..109 + BIN_EXPR@100..108 + RANGE_EXPR@100..104 + DOT2EQ@100..103 "..=" + PATH_EXPR@103..104 + PATH@103..104 + PATH_SEGMENT@103..104 + NAME_REF@103..104 + IDENT@103..104 "z" + WHITESPACE@104..105 " " + EQ@105..106 "=" + WHITESPACE@106..107 " " + LITERAL@107..108 + INT_NUMBER@107..108 "2" + SEMICOLON@108..109 ";" + WHITESPACE@109..114 "\n " + EXPR_STMT@114..133 + BIN_EXPR@114..132 + PATH_EXPR@114..115 + PATH@114..115 + PATH_SEGMENT@114..115 + NAME_REF@114..115 + IDENT@114..115 "x" + WHITESPACE@115..116 " " + EQ@116..117 "=" + WHITESPACE@117..118 " " + RANGE_EXPR@118..132 + LITERAL@118..123 + FALSE_KW@118..123 "false" + DOT2EQ@123..126 "..=" + BIN_EXPR@126..132 + LITERAL@126..127 + INT_NUMBER@126..127 "1" + WHITESPACE@127..128 " " + EQ2@128..130 "==" + WHITESPACE@130..131 " " + LITERAL@131..132 + INT_NUMBER@131..132 "1" + SEMICOLON@132..133 ";" + WHITESPACE@133..138 "\n " + LET_STMT@138..150 + LET_KW@138..141 "let" + WHITESPACE@141..142 " " + BIND_PAT@142..143 + NAME@142..143 + IDENT@142..143 "x" + WHITESPACE@143..144 " " + EQ@144..145 "=" + WHITESPACE@145..146 " " + RANGE_EXPR@146..149 + LITERAL@146..147 + INT_NUMBER@146..147 "1" + DOT2@147..149 ".." + SEMICOLON@149..150 ";" + WHITESPACE@150..151 "\n" + R_CURLY@151..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 4e583c6e8f..953930f6c8 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 @@ -1,64 +1,64 @@ -SOURCE_FILE@[0; 112) - FN_DEF@[0; 111) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 111) - BLOCK@[10; 111) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - LET_STMT@[16; 31) - LET_KW@[16; 19) "let" - WHITESPACE@[19; 20) " " - PLACEHOLDER_PAT@[20; 21) - UNDERSCORE@[20; 21) "_" - WHITESPACE@[21; 22) " " - EQ@[22; 23) "=" - WHITESPACE@[23; 24) " " - LITERAL@[24; 30) - CHAR@[24; 30) "\'c\'u32" - SEMICOLON@[30; 31) ";" - WHITESPACE@[31; 36) "\n " - LET_STMT@[36; 60) - LET_KW@[36; 39) "let" - WHITESPACE@[39; 40) " " - PLACEHOLDER_PAT@[40; 41) - UNDERSCORE@[40; 41) "_" - WHITESPACE@[41; 42) " " - EQ@[42; 43) "=" - WHITESPACE@[43; 44) " " - LITERAL@[44; 59) - STRING@[44; 59) "\"string\"invalid" - SEMICOLON@[59; 60) ";" - WHITESPACE@[60; 65) "\n " - LET_STMT@[65; 83) - LET_KW@[65; 68) "let" - WHITESPACE@[68; 69) " " - PLACEHOLDER_PAT@[69; 70) - UNDERSCORE@[69; 70) "_" - WHITESPACE@[70; 71) " " - EQ@[71; 72) "=" - WHITESPACE@[72; 73) " " - LITERAL@[73; 82) - BYTE@[73; 82) "b\'b\'_suff" - SEMICOLON@[82; 83) ";" - WHITESPACE@[83; 88) "\n " - LET_STMT@[88; 109) - LET_KW@[88; 91) "let" - WHITESPACE@[91; 92) " " - PLACEHOLDER_PAT@[92; 93) - UNDERSCORE@[92; 93) "_" - WHITESPACE@[93; 94) " " - EQ@[94; 95) "=" - WHITESPACE@[95; 96) " " - LITERAL@[96; 108) - BYTE_STRING@[96; 108) "b\"bs\"invalid" - SEMICOLON@[108; 109) ";" - WHITESPACE@[109; 110) "\n" - R_CURLY@[110; 111) "}" - WHITESPACE@[111; 112) "\n" +SOURCE_FILE@0..112 + FN_DEF@0..111 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..111 + BLOCK@10..111 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + LET_STMT@16..31 + LET_KW@16..19 "let" + WHITESPACE@19..20 " " + PLACEHOLDER_PAT@20..21 + UNDERSCORE@20..21 "_" + WHITESPACE@21..22 " " + EQ@22..23 "=" + WHITESPACE@23..24 " " + LITERAL@24..30 + CHAR@24..30 "\'c\'u32" + SEMICOLON@30..31 ";" + WHITESPACE@31..36 "\n " + LET_STMT@36..60 + LET_KW@36..39 "let" + WHITESPACE@39..40 " " + PLACEHOLDER_PAT@40..41 + UNDERSCORE@40..41 "_" + WHITESPACE@41..42 " " + EQ@42..43 "=" + WHITESPACE@43..44 " " + LITERAL@44..59 + STRING@44..59 "\"string\"invalid" + SEMICOLON@59..60 ";" + WHITESPACE@60..65 "\n " + LET_STMT@65..83 + LET_KW@65..68 "let" + WHITESPACE@68..69 " " + PLACEHOLDER_PAT@69..70 + UNDERSCORE@69..70 "_" + WHITESPACE@70..71 " " + EQ@71..72 "=" + WHITESPACE@72..73 " " + LITERAL@73..82 + BYTE@73..82 "b\'b\'_suff" + SEMICOLON@82..83 ";" + WHITESPACE@83..88 "\n " + LET_STMT@88..109 + LET_KW@88..91 "let" + WHITESPACE@91..92 " " + PLACEHOLDER_PAT@92..93 + UNDERSCORE@92..93 "_" + WHITESPACE@93..94 " " + EQ@94..95 "=" + WHITESPACE@95..96 " " + LITERAL@96..108 + BYTE_STRING@96..108 "b\"bs\"invalid" + SEMICOLON@108..109 ";" + WHITESPACE@109..110 "\n" + R_CURLY@110..111 "}" + 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 4131cd81a8..0aadc11a49 100644 --- a/crates/ra_syntax/test_data/parser/ok/0030_traits.rast +++ b/crates/ra_syntax/test_data/parser/ok/0030_traits.rast @@ -1,61 +1,61 @@ -SOURCE_FILE@[0; 96) - TRAIT_DEF@[0; 36) - TRAIT_KW@[0; 5) "trait" - WHITESPACE@[5; 6) " " - NAME@[6; 14) - IDENT@[6; 14) "Runnable" - WHITESPACE@[14; 15) " " - ITEM_LIST@[15; 36) - L_CURLY@[15; 16) "{" - WHITESPACE@[16; 21) "\n " - FN_DEF@[21; 34) - FN_KW@[21; 23) "fn" - WHITESPACE@[23; 24) " " - NAME@[24; 31) - IDENT@[24; 31) "handler" - PARAM_LIST@[31; 33) - L_PAREN@[31; 32) "(" - R_PAREN@[32; 33) ")" - SEMICOLON@[33; 34) ";" - WHITESPACE@[34; 35) "\n" - R_CURLY@[35; 36) "}" - WHITESPACE@[36; 38) "\n\n" - TRAIT_DEF@[38; 95) - TRAIT_KW@[38; 43) "trait" - WHITESPACE@[43; 44) " " - NAME@[44; 57) - IDENT@[44; 57) "TraitWithExpr" - WHITESPACE@[57; 58) " " - ITEM_LIST@[58; 95) - L_CURLY@[58; 59) "{" - WHITESPACE@[59; 64) "\n " - FN_DEF@[64; 93) - FN_KW@[64; 66) "fn" - WHITESPACE@[66; 67) " " - NAME@[67; 79) - IDENT@[67; 79) "fn_with_expr" - PARAM_LIST@[79; 92) - L_PAREN@[79; 80) "(" - PARAM@[80; 91) - BIND_PAT@[80; 81) - NAME@[80; 81) - IDENT@[80; 81) "x" - COLON@[81; 82) ":" - WHITESPACE@[82; 83) " " - ARRAY_TYPE@[83; 91) - L_BRACK@[83; 84) "[" - PATH_TYPE@[84; 87) - PATH@[84; 87) - PATH_SEGMENT@[84; 87) - NAME_REF@[84; 87) - IDENT@[84; 87) "i32" - SEMICOLON@[87; 88) ";" - WHITESPACE@[88; 89) " " - LITERAL@[89; 90) - INT_NUMBER@[89; 90) "1" - R_BRACK@[90; 91) "]" - R_PAREN@[91; 92) ")" - SEMICOLON@[92; 93) ";" - WHITESPACE@[93; 94) "\n" - R_CURLY@[94; 95) "}" - WHITESPACE@[95; 96) "\n" +SOURCE_FILE@0..96 + TRAIT_DEF@0..36 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..14 + IDENT@6..14 "Runnable" + WHITESPACE@14..15 " " + ITEM_LIST@15..36 + L_CURLY@15..16 "{" + WHITESPACE@16..21 "\n " + FN_DEF@21..34 + FN_KW@21..23 "fn" + WHITESPACE@23..24 " " + NAME@24..31 + IDENT@24..31 "handler" + PARAM_LIST@31..33 + L_PAREN@31..32 "(" + R_PAREN@32..33 ")" + SEMICOLON@33..34 ";" + WHITESPACE@34..35 "\n" + R_CURLY@35..36 "}" + WHITESPACE@36..38 "\n\n" + TRAIT_DEF@38..95 + TRAIT_KW@38..43 "trait" + WHITESPACE@43..44 " " + NAME@44..57 + IDENT@44..57 "TraitWithExpr" + WHITESPACE@57..58 " " + ITEM_LIST@58..95 + L_CURLY@58..59 "{" + WHITESPACE@59..64 "\n " + FN_DEF@64..93 + FN_KW@64..66 "fn" + WHITESPACE@66..67 " " + NAME@67..79 + IDENT@67..79 "fn_with_expr" + PARAM_LIST@79..92 + L_PAREN@79..80 "(" + PARAM@80..91 + BIND_PAT@80..81 + NAME@80..81 + IDENT@80..81 "x" + COLON@81..82 ":" + WHITESPACE@82..83 " " + ARRAY_TYPE@83..91 + L_BRACK@83..84 "[" + PATH_TYPE@84..87 + PATH@84..87 + PATH_SEGMENT@84..87 + NAME_REF@84..87 + IDENT@84..87 "i32" + SEMICOLON@87..88 ";" + WHITESPACE@88..89 " " + LITERAL@89..90 + INT_NUMBER@89..90 "1" + R_BRACK@90..91 "]" + R_PAREN@91..92 ")" + SEMICOLON@92..93 ";" + WHITESPACE@93..94 "\n" + R_CURLY@94..95 "}" + 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 23757df52b..ea285f52f6 100644 --- a/crates/ra_syntax/test_data/parser/ok/0031_extern.rast +++ b/crates/ra_syntax/test_data/parser/ok/0031_extern.rast @@ -1,973 +1,973 @@ -SOURCE_FILE@[0; 1598) - EXTERN_BLOCK@[0; 1597) - ABI@[0; 6) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - EXTERN_ITEM_LIST@[7; 1597) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 13) "\n " - FN_DEF@[13; 87) - VISIBILITY@[13; 16) - PUB_KW@[13; 16) "pub" - WHITESPACE@[16; 17) " " - FN_KW@[17; 19) "fn" - WHITESPACE@[19; 20) " " - NAME@[20; 26) - IDENT@[20; 26) "socket" - PARAM_LIST@[26; 75) - L_PAREN@[26; 27) "(" - PARAM@[27; 42) - BIND_PAT@[27; 33) - NAME@[27; 33) - IDENT@[27; 33) "domain" - COLON@[33; 34) ":" - WHITESPACE@[34; 35) " " - PATH_TYPE@[35; 42) - PATH@[35; 42) - PATH_SEGMENT@[35; 42) - COLON2@[35; 37) "::" - NAME_REF@[37; 42) - IDENT@[37; 42) "c_int" - COMMA@[42; 43) "," - WHITESPACE@[43; 44) " " - PARAM@[44; 55) - BIND_PAT@[44; 46) - NAME@[44; 46) - IDENT@[44; 46) "ty" - COLON@[46; 47) ":" - WHITESPACE@[47; 48) " " - PATH_TYPE@[48; 55) - PATH@[48; 55) - PATH_SEGMENT@[48; 55) - COLON2@[48; 50) "::" - NAME_REF@[50; 55) - IDENT@[50; 55) "c_int" - COMMA@[55; 56) "," - WHITESPACE@[56; 57) " " - PARAM@[57; 74) - BIND_PAT@[57; 65) - NAME@[57; 65) - IDENT@[57; 65) "protocol" - COLON@[65; 66) ":" - WHITESPACE@[66; 67) " " - PATH_TYPE@[67; 74) - PATH@[67; 74) - PATH_SEGMENT@[67; 74) - COLON2@[67; 69) "::" - NAME_REF@[69; 74) - IDENT@[69; 74) "c_int" - R_PAREN@[74; 75) ")" - WHITESPACE@[75; 76) " " - RET_TYPE@[76; 86) - THIN_ARROW@[76; 78) "->" - WHITESPACE@[78; 79) " " - PATH_TYPE@[79; 86) - PATH@[79; 86) - PATH_SEGMENT@[79; 86) - COLON2@[79; 81) "::" - NAME_REF@[81; 86) - IDENT@[81; 86) "c_int" - SEMICOLON@[86; 87) ";" - WHITESPACE@[87; 92) "\n " - FN_DEF@[92; 167) - VISIBILITY@[92; 95) - PUB_KW@[92; 95) "pub" - WHITESPACE@[95; 96) " " - FN_KW@[96; 98) "fn" - WHITESPACE@[98; 99) " " - NAME@[99; 103) - IDENT@[99; 103) "bind" - PARAM_LIST@[103; 155) - L_PAREN@[103; 104) "(" - PARAM@[104; 115) - BIND_PAT@[104; 106) - NAME@[104; 106) - IDENT@[104; 106) "fd" - COLON@[106; 107) ":" - WHITESPACE@[107; 108) " " - PATH_TYPE@[108; 115) - PATH@[108; 115) - PATH_SEGMENT@[108; 115) - COLON2@[108; 110) "::" - NAME_REF@[110; 115) - IDENT@[110; 115) "c_int" - COMMA@[115; 116) "," - WHITESPACE@[116; 117) " " - PARAM@[117; 138) - BIND_PAT@[117; 121) - NAME@[117; 121) - IDENT@[117; 121) "addr" - COLON@[121; 122) ":" - WHITESPACE@[122; 123) " " - POINTER_TYPE@[123; 138) - STAR@[123; 124) "*" - CONST_KW@[124; 129) "const" - WHITESPACE@[129; 130) " " - PATH_TYPE@[130; 138) - PATH@[130; 138) - PATH_SEGMENT@[130; 138) - NAME_REF@[130; 138) - IDENT@[130; 138) "sockaddr" - COMMA@[138; 139) "," - WHITESPACE@[139; 140) " " - PARAM@[140; 154) - BIND_PAT@[140; 143) - NAME@[140; 143) - IDENT@[140; 143) "len" - COLON@[143; 144) ":" - WHITESPACE@[144; 145) " " - PATH_TYPE@[145; 154) - PATH@[145; 154) - PATH_SEGMENT@[145; 154) - NAME_REF@[145; 154) - IDENT@[145; 154) "socklen_t" - R_PAREN@[154; 155) ")" - WHITESPACE@[155; 156) " " - RET_TYPE@[156; 166) - THIN_ARROW@[156; 158) "->" - WHITESPACE@[158; 159) " " - PATH_TYPE@[159; 166) - PATH@[159; 166) - PATH_SEGMENT@[159; 166) - COLON2@[159; 161) "::" - NAME_REF@[161; 166) - IDENT@[161; 166) "c_int" - SEMICOLON@[166; 167) ";" - WHITESPACE@[167; 172) "\n " - FN_DEF@[172; 276) - VISIBILITY@[172; 175) - PUB_KW@[172; 175) "pub" - WHITESPACE@[175; 176) " " - FN_KW@[176; 178) "fn" - WHITESPACE@[178; 179) " " - NAME@[179; 186) - IDENT@[179; 186) "connect" - PARAM_LIST@[186; 264) - L_PAREN@[186; 187) "(" - PARAM@[187; 202) - BIND_PAT@[187; 193) - NAME@[187; 193) - IDENT@[187; 193) "socket" - COLON@[193; 194) ":" - WHITESPACE@[194; 195) " " - PATH_TYPE@[195; 202) - PATH@[195; 202) - PATH_SEGMENT@[195; 202) - COLON2@[195; 197) "::" - NAME_REF@[197; 202) - IDENT@[197; 202) "c_int" - COMMA@[202; 203) "," - WHITESPACE@[203; 204) " " - PARAM@[204; 228) - BIND_PAT@[204; 211) - NAME@[204; 211) - IDENT@[204; 211) "address" - COLON@[211; 212) ":" - WHITESPACE@[212; 213) " " - POINTER_TYPE@[213; 228) - STAR@[213; 214) "*" - CONST_KW@[214; 219) "const" - WHITESPACE@[219; 220) " " - PATH_TYPE@[220; 228) - PATH@[220; 228) - PATH_SEGMENT@[220; 228) - NAME_REF@[220; 228) - IDENT@[220; 228) "sockaddr" - COMMA@[228; 229) "," - WHITESPACE@[229; 249) "\n " - PARAM@[249; 263) - BIND_PAT@[249; 252) - NAME@[249; 252) - IDENT@[249; 252) "len" - COLON@[252; 253) ":" - WHITESPACE@[253; 254) " " - PATH_TYPE@[254; 263) - PATH@[254; 263) - PATH_SEGMENT@[254; 263) - NAME_REF@[254; 263) - IDENT@[254; 263) "socklen_t" - R_PAREN@[263; 264) ")" - WHITESPACE@[264; 265) " " - RET_TYPE@[265; 275) - THIN_ARROW@[265; 267) "->" - WHITESPACE@[267; 268) " " - PATH_TYPE@[268; 275) - PATH@[268; 275) - PATH_SEGMENT@[268; 275) - COLON2@[268; 270) "::" - NAME_REF@[270; 275) - IDENT@[270; 275) "c_int" - SEMICOLON@[275; 276) ";" - WHITESPACE@[276; 281) "\n " - FN_DEF@[281; 341) - VISIBILITY@[281; 284) - PUB_KW@[281; 284) "pub" - WHITESPACE@[284; 285) " " - FN_KW@[285; 287) "fn" - WHITESPACE@[287; 288) " " - NAME@[288; 294) - IDENT@[288; 294) "listen" - PARAM_LIST@[294; 329) - L_PAREN@[294; 295) "(" - PARAM@[295; 310) - BIND_PAT@[295; 301) - NAME@[295; 301) - IDENT@[295; 301) "socket" - COLON@[301; 302) ":" - WHITESPACE@[302; 303) " " - PATH_TYPE@[303; 310) - PATH@[303; 310) - PATH_SEGMENT@[303; 310) - COLON2@[303; 305) "::" - NAME_REF@[305; 310) - IDENT@[305; 310) "c_int" - COMMA@[310; 311) "," - WHITESPACE@[311; 312) " " - PARAM@[312; 328) - BIND_PAT@[312; 319) - NAME@[312; 319) - IDENT@[312; 319) "backlog" - COLON@[319; 320) ":" - WHITESPACE@[320; 321) " " - PATH_TYPE@[321; 328) - PATH@[321; 328) - PATH_SEGMENT@[321; 328) - COLON2@[321; 323) "::" - NAME_REF@[323; 328) - IDENT@[323; 328) "c_int" - R_PAREN@[328; 329) ")" - WHITESPACE@[329; 330) " " - RET_TYPE@[330; 340) - THIN_ARROW@[330; 332) "->" - WHITESPACE@[332; 333) " " - PATH_TYPE@[333; 340) - PATH@[333; 340) - PATH_SEGMENT@[333; 340) - COLON2@[333; 335) "::" - NAME_REF@[335; 340) - IDENT@[335; 340) "c_int" - SEMICOLON@[340; 341) ";" - WHITESPACE@[341; 346) "\n " - FN_DEF@[346; 469) - VISIBILITY@[346; 349) - PUB_KW@[346; 349) "pub" - WHITESPACE@[349; 350) " " - FN_KW@[350; 352) "fn" - WHITESPACE@[352; 353) " " - NAME@[353; 364) - IDENT@[353; 364) "getsockname" - PARAM_LIST@[364; 457) - L_PAREN@[364; 365) "(" - PARAM@[365; 380) - BIND_PAT@[365; 371) - NAME@[365; 371) - IDENT@[365; 371) "socket" - COLON@[371; 372) ":" - WHITESPACE@[372; 373) " " - PATH_TYPE@[373; 380) - PATH@[373; 380) - PATH_SEGMENT@[373; 380) - COLON2@[373; 375) "::" - NAME_REF@[375; 380) - IDENT@[375; 380) "c_int" - COMMA@[380; 381) "," - WHITESPACE@[381; 382) " " - PARAM@[382; 404) - BIND_PAT@[382; 389) - NAME@[382; 389) - IDENT@[382; 389) "address" - COLON@[389; 390) ":" - WHITESPACE@[390; 391) " " - POINTER_TYPE@[391; 404) - STAR@[391; 392) "*" - MUT_KW@[392; 395) "mut" - WHITESPACE@[395; 396) " " - PATH_TYPE@[396; 404) - PATH@[396; 404) - PATH_SEGMENT@[396; 404) - NAME_REF@[396; 404) - IDENT@[396; 404) "sockaddr" - COMMA@[404; 405) "," - WHITESPACE@[405; 429) "\n " - PARAM@[429; 456) - BIND_PAT@[429; 440) - NAME@[429; 440) - IDENT@[429; 440) "address_len" - COLON@[440; 441) ":" - WHITESPACE@[441; 442) " " - POINTER_TYPE@[442; 456) - STAR@[442; 443) "*" - MUT_KW@[443; 446) "mut" - WHITESPACE@[446; 447) " " - PATH_TYPE@[447; 456) - PATH@[447; 456) - PATH_SEGMENT@[447; 456) - NAME_REF@[447; 456) - IDENT@[447; 456) "socklen_t" - R_PAREN@[456; 457) ")" - WHITESPACE@[457; 458) " " - RET_TYPE@[458; 468) - THIN_ARROW@[458; 460) "->" - WHITESPACE@[460; 461) " " - PATH_TYPE@[461; 468) - PATH@[461; 468) - PATH_SEGMENT@[461; 468) - COLON2@[461; 463) "::" - NAME_REF@[463; 468) - IDENT@[463; 468) "c_int" - SEMICOLON@[468; 469) ";" - WHITESPACE@[469; 474) "\n " - FN_DEF@[474; 691) - VISIBILITY@[474; 477) - PUB_KW@[474; 477) "pub" - WHITESPACE@[477; 478) " " - FN_KW@[478; 480) "fn" - WHITESPACE@[480; 481) " " - NAME@[481; 491) - IDENT@[481; 491) "getsockopt" - PARAM_LIST@[491; 679) - L_PAREN@[491; 492) "(" - PARAM@[492; 507) - BIND_PAT@[492; 498) - NAME@[492; 498) - IDENT@[492; 498) "sockfd" - COLON@[498; 499) ":" - WHITESPACE@[499; 500) " " - PATH_TYPE@[500; 507) - PATH@[500; 507) - PATH_SEGMENT@[500; 507) - COLON2@[500; 502) "::" - NAME_REF@[502; 507) - IDENT@[502; 507) "c_int" - COMMA@[507; 508) "," - WHITESPACE@[508; 531) "\n " - PARAM@[531; 545) - BIND_PAT@[531; 536) - NAME@[531; 536) - IDENT@[531; 536) "level" - COLON@[536; 537) ":" - WHITESPACE@[537; 538) " " - PATH_TYPE@[538; 545) - PATH@[538; 545) - PATH_SEGMENT@[538; 545) - COLON2@[538; 540) "::" - NAME_REF@[540; 545) - IDENT@[540; 545) "c_int" - COMMA@[545; 546) "," - WHITESPACE@[546; 569) "\n " - PARAM@[569; 585) - BIND_PAT@[569; 576) - NAME@[569; 576) - IDENT@[569; 576) "optname" - COLON@[576; 577) ":" - WHITESPACE@[577; 578) " " - PATH_TYPE@[578; 585) - PATH@[578; 585) - PATH_SEGMENT@[578; 585) - COLON2@[578; 580) "::" - NAME_REF@[580; 585) - IDENT@[580; 585) "c_int" - COMMA@[585; 586) "," - WHITESPACE@[586; 609) "\n " - PARAM@[609; 630) - BIND_PAT@[609; 615) - NAME@[609; 615) - IDENT@[609; 615) "optval" - COLON@[615; 616) ":" - WHITESPACE@[616; 617) " " - POINTER_TYPE@[617; 630) - STAR@[617; 618) "*" - MUT_KW@[618; 621) "mut" - WHITESPACE@[621; 622) " " - PATH_TYPE@[622; 630) - PATH@[622; 630) - PATH_SEGMENT@[622; 630) - COLON2@[622; 624) "::" - NAME_REF@[624; 630) - IDENT@[624; 630) "c_void" - COMMA@[630; 631) "," - WHITESPACE@[631; 654) "\n " - PARAM@[654; 678) - BIND_PAT@[654; 660) - NAME@[654; 660) - IDENT@[654; 660) "optlen" - COLON@[660; 661) ":" - WHITESPACE@[661; 662) " " - POINTER_TYPE@[662; 678) - STAR@[662; 663) "*" - MUT_KW@[663; 666) "mut" - WHITESPACE@[666; 667) " " - PATH_TYPE@[667; 678) - PATH@[667; 678) - PATH_SEGMENT@[667; 678) - COLON2@[667; 669) "::" - NAME_REF@[669; 678) - IDENT@[669; 678) "socklen_t" - R_PAREN@[678; 679) ")" - WHITESPACE@[679; 680) " " - RET_TYPE@[680; 690) - THIN_ARROW@[680; 682) "->" - WHITESPACE@[682; 683) " " - PATH_TYPE@[683; 690) - PATH@[683; 690) - PATH_SEGMENT@[683; 690) - COLON2@[683; 685) "::" - NAME_REF@[685; 690) - IDENT@[685; 690) "c_int" - SEMICOLON@[690; 691) ";" - WHITESPACE@[691; 696) "\n " - FN_DEF@[696; 864) - VISIBILITY@[696; 699) - PUB_KW@[696; 699) "pub" - WHITESPACE@[699; 700) " " - FN_KW@[700; 702) "fn" - WHITESPACE@[702; 703) " " - NAME@[703; 713) - IDENT@[703; 713) "setsockopt" - PARAM_LIST@[713; 852) - L_PAREN@[713; 714) "(" - PARAM@[714; 729) - BIND_PAT@[714; 720) - NAME@[714; 720) - IDENT@[714; 720) "socket" - COLON@[720; 721) ":" - WHITESPACE@[721; 722) " " - PATH_TYPE@[722; 729) - PATH@[722; 729) - PATH_SEGMENT@[722; 729) - COLON2@[722; 724) "::" - NAME_REF@[724; 729) - IDENT@[724; 729) "c_int" - COMMA@[729; 730) "," - WHITESPACE@[730; 731) " " - PARAM@[731; 745) - BIND_PAT@[731; 736) - NAME@[731; 736) - IDENT@[731; 736) "level" - COLON@[736; 737) ":" - WHITESPACE@[737; 738) " " - PATH_TYPE@[738; 745) - PATH@[738; 745) - PATH_SEGMENT@[738; 745) - COLON2@[738; 740) "::" - NAME_REF@[740; 745) - IDENT@[740; 745) "c_int" - COMMA@[745; 746) "," - WHITESPACE@[746; 747) " " - PARAM@[747; 760) - BIND_PAT@[747; 751) - NAME@[747; 751) - IDENT@[747; 751) "name" - COLON@[751; 752) ":" - WHITESPACE@[752; 753) " " - PATH_TYPE@[753; 760) - PATH@[753; 760) - PATH_SEGMENT@[753; 760) - COLON2@[753; 755) "::" - NAME_REF@[755; 760) - IDENT@[755; 760) "c_int" - COMMA@[760; 761) "," - WHITESPACE@[761; 784) "\n " - PARAM@[784; 806) - BIND_PAT@[784; 789) - NAME@[784; 789) - IDENT@[784; 789) "value" - COLON@[789; 790) ":" - WHITESPACE@[790; 791) " " - POINTER_TYPE@[791; 806) - STAR@[791; 792) "*" - CONST_KW@[792; 797) "const" - WHITESPACE@[797; 798) " " - PATH_TYPE@[798; 806) - PATH@[798; 806) - PATH_SEGMENT@[798; 806) - COLON2@[798; 800) "::" - NAME_REF@[800; 806) - IDENT@[800; 806) "c_void" - COMMA@[806; 807) "," - WHITESPACE@[807; 830) "\n " - PARAM@[830; 851) - BIND_PAT@[830; 840) - NAME@[830; 840) - IDENT@[830; 840) "option_len" - COLON@[840; 841) ":" - WHITESPACE@[841; 842) " " - PATH_TYPE@[842; 851) - PATH@[842; 851) - PATH_SEGMENT@[842; 851) - NAME_REF@[842; 851) - IDENT@[842; 851) "socklen_t" - R_PAREN@[851; 852) ")" - WHITESPACE@[852; 853) " " - RET_TYPE@[853; 863) - THIN_ARROW@[853; 855) "->" - WHITESPACE@[855; 856) " " - PATH_TYPE@[856; 863) - PATH@[856; 863) - PATH_SEGMENT@[856; 863) - COLON2@[856; 858) "::" - NAME_REF@[858; 863) - IDENT@[858; 863) "c_int" - SEMICOLON@[863; 864) ";" - WHITESPACE@[864; 869) "\n " - FN_DEF@[869; 992) - VISIBILITY@[869; 872) - PUB_KW@[869; 872) "pub" - WHITESPACE@[872; 873) " " - FN_KW@[873; 875) "fn" - WHITESPACE@[875; 876) " " - NAME@[876; 887) - IDENT@[876; 887) "getpeername" - PARAM_LIST@[887; 980) - L_PAREN@[887; 888) "(" - PARAM@[888; 903) - BIND_PAT@[888; 894) - NAME@[888; 894) - IDENT@[888; 894) "socket" - COLON@[894; 895) ":" - WHITESPACE@[895; 896) " " - PATH_TYPE@[896; 903) - PATH@[896; 903) - PATH_SEGMENT@[896; 903) - COLON2@[896; 898) "::" - NAME_REF@[898; 903) - IDENT@[898; 903) "c_int" - COMMA@[903; 904) "," - WHITESPACE@[904; 905) " " - PARAM@[905; 927) - BIND_PAT@[905; 912) - NAME@[905; 912) - IDENT@[905; 912) "address" - COLON@[912; 913) ":" - WHITESPACE@[913; 914) " " - POINTER_TYPE@[914; 927) - STAR@[914; 915) "*" - MUT_KW@[915; 918) "mut" - WHITESPACE@[918; 919) " " - PATH_TYPE@[919; 927) - PATH@[919; 927) - PATH_SEGMENT@[919; 927) - NAME_REF@[919; 927) - IDENT@[919; 927) "sockaddr" - COMMA@[927; 928) "," - WHITESPACE@[928; 952) "\n " - PARAM@[952; 979) - BIND_PAT@[952; 963) - NAME@[952; 963) - IDENT@[952; 963) "address_len" - COLON@[963; 964) ":" - WHITESPACE@[964; 965) " " - POINTER_TYPE@[965; 979) - STAR@[965; 966) "*" - MUT_KW@[966; 969) "mut" - WHITESPACE@[969; 970) " " - PATH_TYPE@[970; 979) - PATH@[970; 979) - PATH_SEGMENT@[970; 979) - NAME_REF@[970; 979) - IDENT@[970; 979) "socklen_t" - R_PAREN@[979; 980) ")" - WHITESPACE@[980; 981) " " - RET_TYPE@[981; 991) - THIN_ARROW@[981; 983) "->" - WHITESPACE@[983; 984) " " - PATH_TYPE@[984; 991) - PATH@[984; 991) - PATH_SEGMENT@[984; 991) - COLON2@[984; 986) "::" - NAME_REF@[986; 991) - IDENT@[986; 991) "c_int" - SEMICOLON@[991; 992) ";" - WHITESPACE@[992; 997) "\n " - FN_DEF@[997; 1173) - VISIBILITY@[997; 1000) - PUB_KW@[997; 1000) "pub" - WHITESPACE@[1000; 1001) " " - FN_KW@[1001; 1003) "fn" - WHITESPACE@[1003; 1004) " " - NAME@[1004; 1010) - IDENT@[1004; 1010) "sendto" - PARAM_LIST@[1010; 1159) - L_PAREN@[1010; 1011) "(" - PARAM@[1011; 1026) - BIND_PAT@[1011; 1017) - NAME@[1011; 1017) - IDENT@[1011; 1017) "socket" - COLON@[1017; 1018) ":" - WHITESPACE@[1018; 1019) " " - PATH_TYPE@[1019; 1026) - PATH@[1019; 1026) - PATH_SEGMENT@[1019; 1026) - COLON2@[1019; 1021) "::" - NAME_REF@[1021; 1026) - IDENT@[1021; 1026) "c_int" - COMMA@[1026; 1027) "," - WHITESPACE@[1027; 1028) " " - PARAM@[1028; 1048) - BIND_PAT@[1028; 1031) - NAME@[1028; 1031) - IDENT@[1028; 1031) "buf" - COLON@[1031; 1032) ":" - WHITESPACE@[1032; 1033) " " - POINTER_TYPE@[1033; 1048) - STAR@[1033; 1034) "*" - CONST_KW@[1034; 1039) "const" - WHITESPACE@[1039; 1040) " " - PATH_TYPE@[1040; 1048) - PATH@[1040; 1048) - PATH_SEGMENT@[1040; 1048) - COLON2@[1040; 1042) "::" - NAME_REF@[1042; 1048) - IDENT@[1042; 1048) "c_void" - COMMA@[1048; 1049) "," - WHITESPACE@[1049; 1050) " " - PARAM@[1050; 1063) - BIND_PAT@[1050; 1053) - NAME@[1050; 1053) - IDENT@[1050; 1053) "len" - COLON@[1053; 1054) ":" - WHITESPACE@[1054; 1055) " " - PATH_TYPE@[1055; 1063) - PATH@[1055; 1063) - PATH_SEGMENT@[1055; 1063) - COLON2@[1055; 1057) "::" - NAME_REF@[1057; 1063) - IDENT@[1057; 1063) "size_t" - COMMA@[1063; 1064) "," - WHITESPACE@[1064; 1083) "\n " - PARAM@[1083; 1097) - BIND_PAT@[1083; 1088) - NAME@[1083; 1088) - IDENT@[1083; 1088) "flags" - COLON@[1088; 1089) ":" - WHITESPACE@[1089; 1090) " " - PATH_TYPE@[1090; 1097) - PATH@[1090; 1097) - PATH_SEGMENT@[1090; 1097) - COLON2@[1090; 1092) "::" - NAME_REF@[1092; 1097) - IDENT@[1092; 1097) "c_int" - COMMA@[1097; 1098) "," - WHITESPACE@[1098; 1099) " " - PARAM@[1099; 1120) - BIND_PAT@[1099; 1103) - NAME@[1099; 1103) - IDENT@[1099; 1103) "addr" - COLON@[1103; 1104) ":" - WHITESPACE@[1104; 1105) " " - POINTER_TYPE@[1105; 1120) - STAR@[1105; 1106) "*" - CONST_KW@[1106; 1111) "const" - WHITESPACE@[1111; 1112) " " - PATH_TYPE@[1112; 1120) - PATH@[1112; 1120) - PATH_SEGMENT@[1112; 1120) - NAME_REF@[1112; 1120) - IDENT@[1112; 1120) "sockaddr" - COMMA@[1120; 1121) "," - WHITESPACE@[1121; 1140) "\n " - PARAM@[1140; 1158) - BIND_PAT@[1140; 1147) - NAME@[1140; 1147) - IDENT@[1140; 1147) "addrlen" - COLON@[1147; 1148) ":" - WHITESPACE@[1148; 1149) " " - PATH_TYPE@[1149; 1158) - PATH@[1149; 1158) - PATH_SEGMENT@[1149; 1158) - NAME_REF@[1149; 1158) - IDENT@[1149; 1158) "socklen_t" - R_PAREN@[1158; 1159) ")" - WHITESPACE@[1159; 1160) " " - RET_TYPE@[1160; 1172) - THIN_ARROW@[1160; 1162) "->" - WHITESPACE@[1162; 1163) " " - PATH_TYPE@[1163; 1172) - PATH@[1163; 1172) - PATH_SEGMENT@[1163; 1172) - COLON2@[1163; 1165) "::" - NAME_REF@[1165; 1172) - IDENT@[1165; 1172) "ssize_t" - SEMICOLON@[1172; 1173) ";" - WHITESPACE@[1173; 1178) "\n " - FN_DEF@[1178; 1289) - VISIBILITY@[1178; 1181) - PUB_KW@[1178; 1181) "pub" - WHITESPACE@[1181; 1182) " " - FN_KW@[1182; 1184) "fn" - WHITESPACE@[1184; 1185) " " - NAME@[1185; 1189) - IDENT@[1185; 1189) "send" - PARAM_LIST@[1189; 1275) - L_PAREN@[1189; 1190) "(" - PARAM@[1190; 1205) - BIND_PAT@[1190; 1196) - NAME@[1190; 1196) - IDENT@[1190; 1196) "socket" - COLON@[1196; 1197) ":" - WHITESPACE@[1197; 1198) " " - PATH_TYPE@[1198; 1205) - PATH@[1198; 1205) - PATH_SEGMENT@[1198; 1205) - COLON2@[1198; 1200) "::" - NAME_REF@[1200; 1205) - IDENT@[1200; 1205) "c_int" - COMMA@[1205; 1206) "," - WHITESPACE@[1206; 1207) " " - PARAM@[1207; 1227) - BIND_PAT@[1207; 1210) - NAME@[1207; 1210) - IDENT@[1207; 1210) "buf" - COLON@[1210; 1211) ":" - WHITESPACE@[1211; 1212) " " - POINTER_TYPE@[1212; 1227) - STAR@[1212; 1213) "*" - CONST_KW@[1213; 1218) "const" - WHITESPACE@[1218; 1219) " " - PATH_TYPE@[1219; 1227) - PATH@[1219; 1227) - PATH_SEGMENT@[1219; 1227) - COLON2@[1219; 1221) "::" - NAME_REF@[1221; 1227) - IDENT@[1221; 1227) "c_void" - COMMA@[1227; 1228) "," - WHITESPACE@[1228; 1229) " " - PARAM@[1229; 1242) - BIND_PAT@[1229; 1232) - NAME@[1229; 1232) - IDENT@[1229; 1232) "len" - COLON@[1232; 1233) ":" - WHITESPACE@[1233; 1234) " " - PATH_TYPE@[1234; 1242) - PATH@[1234; 1242) - PATH_SEGMENT@[1234; 1242) - COLON2@[1234; 1236) "::" - NAME_REF@[1236; 1242) - IDENT@[1236; 1242) "size_t" - COMMA@[1242; 1243) "," - WHITESPACE@[1243; 1260) "\n " - PARAM@[1260; 1274) - BIND_PAT@[1260; 1265) - NAME@[1260; 1265) - IDENT@[1260; 1265) "flags" - COLON@[1265; 1266) ":" - WHITESPACE@[1266; 1267) " " - PATH_TYPE@[1267; 1274) - PATH@[1267; 1274) - PATH_SEGMENT@[1267; 1274) - COLON2@[1267; 1269) "::" - NAME_REF@[1269; 1274) - IDENT@[1269; 1274) "c_int" - R_PAREN@[1274; 1275) ")" - WHITESPACE@[1275; 1276) " " - RET_TYPE@[1276; 1288) - THIN_ARROW@[1276; 1278) "->" - WHITESPACE@[1278; 1279) " " - PATH_TYPE@[1279; 1288) - PATH@[1279; 1288) - PATH_SEGMENT@[1279; 1288) - COLON2@[1279; 1281) "::" - NAME_REF@[1281; 1288) - IDENT@[1281; 1288) "ssize_t" - SEMICOLON@[1288; 1289) ";" - WHITESPACE@[1289; 1294) "\n " - FN_DEF@[1294; 1481) - VISIBILITY@[1294; 1297) - PUB_KW@[1294; 1297) "pub" - WHITESPACE@[1297; 1298) " " - FN_KW@[1298; 1300) "fn" - WHITESPACE@[1300; 1301) " " - NAME@[1301; 1309) - IDENT@[1301; 1309) "recvfrom" - PARAM_LIST@[1309; 1467) - L_PAREN@[1309; 1310) "(" - PARAM@[1310; 1325) - BIND_PAT@[1310; 1316) - NAME@[1310; 1316) - IDENT@[1310; 1316) "socket" - COLON@[1316; 1317) ":" - WHITESPACE@[1317; 1318) " " - PATH_TYPE@[1318; 1325) - PATH@[1318; 1325) - PATH_SEGMENT@[1318; 1325) - COLON2@[1318; 1320) "::" - NAME_REF@[1320; 1325) - IDENT@[1320; 1325) "c_int" - COMMA@[1325; 1326) "," - WHITESPACE@[1326; 1327) " " - PARAM@[1327; 1345) - BIND_PAT@[1327; 1330) - NAME@[1327; 1330) - IDENT@[1327; 1330) "buf" - COLON@[1330; 1331) ":" - WHITESPACE@[1331; 1332) " " - POINTER_TYPE@[1332; 1345) - STAR@[1332; 1333) "*" - MUT_KW@[1333; 1336) "mut" - WHITESPACE@[1336; 1337) " " - PATH_TYPE@[1337; 1345) - PATH@[1337; 1345) - PATH_SEGMENT@[1337; 1345) - COLON2@[1337; 1339) "::" - NAME_REF@[1339; 1345) - IDENT@[1339; 1345) "c_void" - COMMA@[1345; 1346) "," - WHITESPACE@[1346; 1347) " " - PARAM@[1347; 1360) - BIND_PAT@[1347; 1350) - NAME@[1347; 1350) - IDENT@[1347; 1350) "len" - COLON@[1350; 1351) ":" - WHITESPACE@[1351; 1352) " " - PATH_TYPE@[1352; 1360) - PATH@[1352; 1360) - PATH_SEGMENT@[1352; 1360) - COLON2@[1352; 1354) "::" - NAME_REF@[1354; 1360) - IDENT@[1354; 1360) "size_t" - COMMA@[1360; 1361) "," - WHITESPACE@[1361; 1382) "\n " - PARAM@[1382; 1396) - BIND_PAT@[1382; 1387) - NAME@[1382; 1387) - IDENT@[1382; 1387) "flags" - COLON@[1387; 1388) ":" - WHITESPACE@[1388; 1389) " " - PATH_TYPE@[1389; 1396) - PATH@[1389; 1396) - PATH_SEGMENT@[1389; 1396) - COLON2@[1389; 1391) "::" - NAME_REF@[1391; 1396) - IDENT@[1391; 1396) "c_int" - COMMA@[1396; 1397) "," - WHITESPACE@[1397; 1398) " " - PARAM@[1398; 1419) - BIND_PAT@[1398; 1402) - NAME@[1398; 1402) - IDENT@[1398; 1402) "addr" - COLON@[1402; 1403) ":" - WHITESPACE@[1403; 1404) " " - POINTER_TYPE@[1404; 1419) - STAR@[1404; 1405) "*" - MUT_KW@[1405; 1408) "mut" - WHITESPACE@[1408; 1409) " " - PATH_TYPE@[1409; 1419) - PATH@[1409; 1419) - PATH_SEGMENT@[1409; 1419) - COLON2@[1409; 1411) "::" - NAME_REF@[1411; 1419) - IDENT@[1411; 1419) "sockaddr" - COMMA@[1419; 1420) "," - WHITESPACE@[1420; 1441) "\n " - PARAM@[1441; 1466) - BIND_PAT@[1441; 1448) - NAME@[1441; 1448) - IDENT@[1441; 1448) "addrlen" - COLON@[1448; 1449) ":" - WHITESPACE@[1449; 1450) " " - POINTER_TYPE@[1450; 1466) - STAR@[1450; 1451) "*" - MUT_KW@[1451; 1454) "mut" - WHITESPACE@[1454; 1455) " " - PATH_TYPE@[1455; 1466) - PATH@[1455; 1466) - PATH_SEGMENT@[1455; 1466) - COLON2@[1455; 1457) "::" - NAME_REF@[1457; 1466) - IDENT@[1457; 1466) "socklen_t" - R_PAREN@[1466; 1467) ")" - WHITESPACE@[1467; 1468) " " - RET_TYPE@[1468; 1480) - THIN_ARROW@[1468; 1470) "->" - WHITESPACE@[1470; 1471) " " - PATH_TYPE@[1471; 1480) - PATH@[1471; 1480) - PATH_SEGMENT@[1471; 1480) - COLON2@[1471; 1473) "::" - NAME_REF@[1473; 1480) - IDENT@[1473; 1480) "ssize_t" - SEMICOLON@[1480; 1481) ";" - WHITESPACE@[1481; 1486) "\n " - FN_DEF@[1486; 1595) - VISIBILITY@[1486; 1489) - PUB_KW@[1486; 1489) "pub" - WHITESPACE@[1489; 1490) " " - FN_KW@[1490; 1492) "fn" - WHITESPACE@[1492; 1493) " " - NAME@[1493; 1497) - IDENT@[1493; 1497) "recv" - PARAM_LIST@[1497; 1581) - L_PAREN@[1497; 1498) "(" - PARAM@[1498; 1513) - BIND_PAT@[1498; 1504) - NAME@[1498; 1504) - IDENT@[1498; 1504) "socket" - COLON@[1504; 1505) ":" - WHITESPACE@[1505; 1506) " " - PATH_TYPE@[1506; 1513) - PATH@[1506; 1513) - PATH_SEGMENT@[1506; 1513) - COLON2@[1506; 1508) "::" - NAME_REF@[1508; 1513) - IDENT@[1508; 1513) "c_int" - COMMA@[1513; 1514) "," - WHITESPACE@[1514; 1515) " " - PARAM@[1515; 1533) - BIND_PAT@[1515; 1518) - NAME@[1515; 1518) - IDENT@[1515; 1518) "buf" - COLON@[1518; 1519) ":" - WHITESPACE@[1519; 1520) " " - POINTER_TYPE@[1520; 1533) - STAR@[1520; 1521) "*" - MUT_KW@[1521; 1524) "mut" - WHITESPACE@[1524; 1525) " " - PATH_TYPE@[1525; 1533) - PATH@[1525; 1533) - PATH_SEGMENT@[1525; 1533) - COLON2@[1525; 1527) "::" - NAME_REF@[1527; 1533) - IDENT@[1527; 1533) "c_void" - COMMA@[1533; 1534) "," - WHITESPACE@[1534; 1535) " " - PARAM@[1535; 1548) - BIND_PAT@[1535; 1538) - NAME@[1535; 1538) - IDENT@[1535; 1538) "len" - COLON@[1538; 1539) ":" - WHITESPACE@[1539; 1540) " " - PATH_TYPE@[1540; 1548) - PATH@[1540; 1548) - PATH_SEGMENT@[1540; 1548) - COLON2@[1540; 1542) "::" - NAME_REF@[1542; 1548) - IDENT@[1542; 1548) "size_t" - COMMA@[1548; 1549) "," - WHITESPACE@[1549; 1566) "\n " - PARAM@[1566; 1580) - BIND_PAT@[1566; 1571) - NAME@[1566; 1571) - IDENT@[1566; 1571) "flags" - COLON@[1571; 1572) ":" - WHITESPACE@[1572; 1573) " " - PATH_TYPE@[1573; 1580) - PATH@[1573; 1580) - PATH_SEGMENT@[1573; 1580) - COLON2@[1573; 1575) "::" - NAME_REF@[1575; 1580) - IDENT@[1575; 1580) "c_int" - R_PAREN@[1580; 1581) ")" - WHITESPACE@[1581; 1582) " " - RET_TYPE@[1582; 1594) - THIN_ARROW@[1582; 1584) "->" - WHITESPACE@[1584; 1585) " " - PATH_TYPE@[1585; 1594) - PATH@[1585; 1594) - PATH_SEGMENT@[1585; 1594) - COLON2@[1585; 1587) "::" - NAME_REF@[1587; 1594) - IDENT@[1587; 1594) "ssize_t" - SEMICOLON@[1594; 1595) ";" - WHITESPACE@[1595; 1596) "\n" - R_CURLY@[1596; 1597) "}" - WHITESPACE@[1597; 1598) "\n" +SOURCE_FILE@0..1598 + EXTERN_BLOCK@0..1597 + ABI@0..6 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + EXTERN_ITEM_LIST@7..1597 + L_CURLY@7..8 "{" + WHITESPACE@8..13 "\n " + FN_DEF@13..87 + VISIBILITY@13..16 + PUB_KW@13..16 "pub" + WHITESPACE@16..17 " " + FN_KW@17..19 "fn" + WHITESPACE@19..20 " " + NAME@20..26 + IDENT@20..26 "socket" + PARAM_LIST@26..75 + L_PAREN@26..27 "(" + PARAM@27..42 + BIND_PAT@27..33 + NAME@27..33 + IDENT@27..33 "domain" + COLON@33..34 ":" + WHITESPACE@34..35 " " + PATH_TYPE@35..42 + PATH@35..42 + PATH_SEGMENT@35..42 + COLON2@35..37 "::" + NAME_REF@37..42 + IDENT@37..42 "c_int" + COMMA@42..43 "," + WHITESPACE@43..44 " " + PARAM@44..55 + BIND_PAT@44..46 + NAME@44..46 + IDENT@44..46 "ty" + COLON@46..47 ":" + WHITESPACE@47..48 " " + PATH_TYPE@48..55 + PATH@48..55 + PATH_SEGMENT@48..55 + COLON2@48..50 "::" + NAME_REF@50..55 + IDENT@50..55 "c_int" + COMMA@55..56 "," + WHITESPACE@56..57 " " + PARAM@57..74 + BIND_PAT@57..65 + NAME@57..65 + IDENT@57..65 "protocol" + COLON@65..66 ":" + WHITESPACE@66..67 " " + PATH_TYPE@67..74 + PATH@67..74 + PATH_SEGMENT@67..74 + COLON2@67..69 "::" + NAME_REF@69..74 + IDENT@69..74 "c_int" + R_PAREN@74..75 ")" + WHITESPACE@75..76 " " + RET_TYPE@76..86 + THIN_ARROW@76..78 "->" + WHITESPACE@78..79 " " + PATH_TYPE@79..86 + PATH@79..86 + PATH_SEGMENT@79..86 + COLON2@79..81 "::" + NAME_REF@81..86 + IDENT@81..86 "c_int" + SEMICOLON@86..87 ";" + WHITESPACE@87..92 "\n " + FN_DEF@92..167 + VISIBILITY@92..95 + PUB_KW@92..95 "pub" + WHITESPACE@95..96 " " + FN_KW@96..98 "fn" + WHITESPACE@98..99 " " + NAME@99..103 + IDENT@99..103 "bind" + PARAM_LIST@103..155 + L_PAREN@103..104 "(" + PARAM@104..115 + BIND_PAT@104..106 + NAME@104..106 + IDENT@104..106 "fd" + COLON@106..107 ":" + WHITESPACE@107..108 " " + PATH_TYPE@108..115 + PATH@108..115 + PATH_SEGMENT@108..115 + COLON2@108..110 "::" + NAME_REF@110..115 + IDENT@110..115 "c_int" + COMMA@115..116 "," + WHITESPACE@116..117 " " + PARAM@117..138 + BIND_PAT@117..121 + NAME@117..121 + IDENT@117..121 "addr" + COLON@121..122 ":" + WHITESPACE@122..123 " " + POINTER_TYPE@123..138 + STAR@123..124 "*" + CONST_KW@124..129 "const" + WHITESPACE@129..130 " " + PATH_TYPE@130..138 + PATH@130..138 + PATH_SEGMENT@130..138 + NAME_REF@130..138 + IDENT@130..138 "sockaddr" + COMMA@138..139 "," + WHITESPACE@139..140 " " + PARAM@140..154 + BIND_PAT@140..143 + NAME@140..143 + IDENT@140..143 "len" + COLON@143..144 ":" + WHITESPACE@144..145 " " + PATH_TYPE@145..154 + PATH@145..154 + PATH_SEGMENT@145..154 + NAME_REF@145..154 + IDENT@145..154 "socklen_t" + R_PAREN@154..155 ")" + WHITESPACE@155..156 " " + RET_TYPE@156..166 + THIN_ARROW@156..158 "->" + WHITESPACE@158..159 " " + PATH_TYPE@159..166 + PATH@159..166 + PATH_SEGMENT@159..166 + COLON2@159..161 "::" + NAME_REF@161..166 + IDENT@161..166 "c_int" + SEMICOLON@166..167 ";" + WHITESPACE@167..172 "\n " + FN_DEF@172..276 + VISIBILITY@172..175 + PUB_KW@172..175 "pub" + WHITESPACE@175..176 " " + FN_KW@176..178 "fn" + WHITESPACE@178..179 " " + NAME@179..186 + IDENT@179..186 "connect" + PARAM_LIST@186..264 + L_PAREN@186..187 "(" + PARAM@187..202 + BIND_PAT@187..193 + NAME@187..193 + IDENT@187..193 "socket" + COLON@193..194 ":" + WHITESPACE@194..195 " " + PATH_TYPE@195..202 + PATH@195..202 + PATH_SEGMENT@195..202 + COLON2@195..197 "::" + NAME_REF@197..202 + IDENT@197..202 "c_int" + COMMA@202..203 "," + WHITESPACE@203..204 " " + PARAM@204..228 + BIND_PAT@204..211 + NAME@204..211 + IDENT@204..211 "address" + COLON@211..212 ":" + WHITESPACE@212..213 " " + POINTER_TYPE@213..228 + STAR@213..214 "*" + CONST_KW@214..219 "const" + WHITESPACE@219..220 " " + PATH_TYPE@220..228 + PATH@220..228 + PATH_SEGMENT@220..228 + NAME_REF@220..228 + IDENT@220..228 "sockaddr" + COMMA@228..229 "," + WHITESPACE@229..249 "\n " + PARAM@249..263 + BIND_PAT@249..252 + NAME@249..252 + IDENT@249..252 "len" + COLON@252..253 ":" + WHITESPACE@253..254 " " + PATH_TYPE@254..263 + PATH@254..263 + PATH_SEGMENT@254..263 + NAME_REF@254..263 + IDENT@254..263 "socklen_t" + R_PAREN@263..264 ")" + WHITESPACE@264..265 " " + RET_TYPE@265..275 + THIN_ARROW@265..267 "->" + WHITESPACE@267..268 " " + PATH_TYPE@268..275 + PATH@268..275 + PATH_SEGMENT@268..275 + COLON2@268..270 "::" + NAME_REF@270..275 + IDENT@270..275 "c_int" + SEMICOLON@275..276 ";" + WHITESPACE@276..281 "\n " + FN_DEF@281..341 + VISIBILITY@281..284 + PUB_KW@281..284 "pub" + WHITESPACE@284..285 " " + FN_KW@285..287 "fn" + WHITESPACE@287..288 " " + NAME@288..294 + IDENT@288..294 "listen" + PARAM_LIST@294..329 + L_PAREN@294..295 "(" + PARAM@295..310 + BIND_PAT@295..301 + NAME@295..301 + IDENT@295..301 "socket" + COLON@301..302 ":" + WHITESPACE@302..303 " " + PATH_TYPE@303..310 + PATH@303..310 + PATH_SEGMENT@303..310 + COLON2@303..305 "::" + NAME_REF@305..310 + IDENT@305..310 "c_int" + COMMA@310..311 "," + WHITESPACE@311..312 " " + PARAM@312..328 + BIND_PAT@312..319 + NAME@312..319 + IDENT@312..319 "backlog" + COLON@319..320 ":" + WHITESPACE@320..321 " " + PATH_TYPE@321..328 + PATH@321..328 + PATH_SEGMENT@321..328 + COLON2@321..323 "::" + NAME_REF@323..328 + IDENT@323..328 "c_int" + R_PAREN@328..329 ")" + WHITESPACE@329..330 " " + RET_TYPE@330..340 + THIN_ARROW@330..332 "->" + WHITESPACE@332..333 " " + PATH_TYPE@333..340 + PATH@333..340 + PATH_SEGMENT@333..340 + COLON2@333..335 "::" + NAME_REF@335..340 + IDENT@335..340 "c_int" + SEMICOLON@340..341 ";" + WHITESPACE@341..346 "\n " + FN_DEF@346..469 + VISIBILITY@346..349 + PUB_KW@346..349 "pub" + WHITESPACE@349..350 " " + FN_KW@350..352 "fn" + WHITESPACE@352..353 " " + NAME@353..364 + IDENT@353..364 "getsockname" + PARAM_LIST@364..457 + L_PAREN@364..365 "(" + PARAM@365..380 + BIND_PAT@365..371 + NAME@365..371 + IDENT@365..371 "socket" + COLON@371..372 ":" + WHITESPACE@372..373 " " + PATH_TYPE@373..380 + PATH@373..380 + PATH_SEGMENT@373..380 + COLON2@373..375 "::" + NAME_REF@375..380 + IDENT@375..380 "c_int" + COMMA@380..381 "," + WHITESPACE@381..382 " " + PARAM@382..404 + BIND_PAT@382..389 + NAME@382..389 + IDENT@382..389 "address" + COLON@389..390 ":" + WHITESPACE@390..391 " " + POINTER_TYPE@391..404 + STAR@391..392 "*" + MUT_KW@392..395 "mut" + WHITESPACE@395..396 " " + PATH_TYPE@396..404 + PATH@396..404 + PATH_SEGMENT@396..404 + NAME_REF@396..404 + IDENT@396..404 "sockaddr" + COMMA@404..405 "," + WHITESPACE@405..429 "\n " + PARAM@429..456 + BIND_PAT@429..440 + NAME@429..440 + IDENT@429..440 "address_len" + COLON@440..441 ":" + WHITESPACE@441..442 " " + POINTER_TYPE@442..456 + STAR@442..443 "*" + MUT_KW@443..446 "mut" + WHITESPACE@446..447 " " + PATH_TYPE@447..456 + PATH@447..456 + PATH_SEGMENT@447..456 + NAME_REF@447..456 + IDENT@447..456 "socklen_t" + R_PAREN@456..457 ")" + WHITESPACE@457..458 " " + RET_TYPE@458..468 + THIN_ARROW@458..460 "->" + WHITESPACE@460..461 " " + PATH_TYPE@461..468 + PATH@461..468 + PATH_SEGMENT@461..468 + COLON2@461..463 "::" + NAME_REF@463..468 + IDENT@463..468 "c_int" + SEMICOLON@468..469 ";" + WHITESPACE@469..474 "\n " + FN_DEF@474..691 + VISIBILITY@474..477 + PUB_KW@474..477 "pub" + WHITESPACE@477..478 " " + FN_KW@478..480 "fn" + WHITESPACE@480..481 " " + NAME@481..491 + IDENT@481..491 "getsockopt" + PARAM_LIST@491..679 + L_PAREN@491..492 "(" + PARAM@492..507 + BIND_PAT@492..498 + NAME@492..498 + IDENT@492..498 "sockfd" + COLON@498..499 ":" + WHITESPACE@499..500 " " + PATH_TYPE@500..507 + PATH@500..507 + PATH_SEGMENT@500..507 + COLON2@500..502 "::" + NAME_REF@502..507 + IDENT@502..507 "c_int" + COMMA@507..508 "," + WHITESPACE@508..531 "\n " + PARAM@531..545 + BIND_PAT@531..536 + NAME@531..536 + IDENT@531..536 "level" + COLON@536..537 ":" + WHITESPACE@537..538 " " + PATH_TYPE@538..545 + PATH@538..545 + PATH_SEGMENT@538..545 + COLON2@538..540 "::" + NAME_REF@540..545 + IDENT@540..545 "c_int" + COMMA@545..546 "," + WHITESPACE@546..569 "\n " + PARAM@569..585 + BIND_PAT@569..576 + NAME@569..576 + IDENT@569..576 "optname" + COLON@576..577 ":" + WHITESPACE@577..578 " " + PATH_TYPE@578..585 + PATH@578..585 + PATH_SEGMENT@578..585 + COLON2@578..580 "::" + NAME_REF@580..585 + IDENT@580..585 "c_int" + COMMA@585..586 "," + WHITESPACE@586..609 "\n " + PARAM@609..630 + BIND_PAT@609..615 + NAME@609..615 + IDENT@609..615 "optval" + COLON@615..616 ":" + WHITESPACE@616..617 " " + POINTER_TYPE@617..630 + STAR@617..618 "*" + MUT_KW@618..621 "mut" + WHITESPACE@621..622 " " + PATH_TYPE@622..630 + PATH@622..630 + PATH_SEGMENT@622..630 + COLON2@622..624 "::" + NAME_REF@624..630 + IDENT@624..630 "c_void" + COMMA@630..631 "," + WHITESPACE@631..654 "\n " + PARAM@654..678 + BIND_PAT@654..660 + NAME@654..660 + IDENT@654..660 "optlen" + COLON@660..661 ":" + WHITESPACE@661..662 " " + POINTER_TYPE@662..678 + STAR@662..663 "*" + MUT_KW@663..666 "mut" + WHITESPACE@666..667 " " + PATH_TYPE@667..678 + PATH@667..678 + PATH_SEGMENT@667..678 + COLON2@667..669 "::" + NAME_REF@669..678 + IDENT@669..678 "socklen_t" + R_PAREN@678..679 ")" + WHITESPACE@679..680 " " + RET_TYPE@680..690 + THIN_ARROW@680..682 "->" + WHITESPACE@682..683 " " + PATH_TYPE@683..690 + PATH@683..690 + PATH_SEGMENT@683..690 + COLON2@683..685 "::" + NAME_REF@685..690 + IDENT@685..690 "c_int" + SEMICOLON@690..691 ";" + WHITESPACE@691..696 "\n " + FN_DEF@696..864 + VISIBILITY@696..699 + PUB_KW@696..699 "pub" + WHITESPACE@699..700 " " + FN_KW@700..702 "fn" + WHITESPACE@702..703 " " + NAME@703..713 + IDENT@703..713 "setsockopt" + PARAM_LIST@713..852 + L_PAREN@713..714 "(" + PARAM@714..729 + BIND_PAT@714..720 + NAME@714..720 + IDENT@714..720 "socket" + COLON@720..721 ":" + WHITESPACE@721..722 " " + PATH_TYPE@722..729 + PATH@722..729 + PATH_SEGMENT@722..729 + COLON2@722..724 "::" + NAME_REF@724..729 + IDENT@724..729 "c_int" + COMMA@729..730 "," + WHITESPACE@730..731 " " + PARAM@731..745 + BIND_PAT@731..736 + NAME@731..736 + IDENT@731..736 "level" + COLON@736..737 ":" + WHITESPACE@737..738 " " + PATH_TYPE@738..745 + PATH@738..745 + PATH_SEGMENT@738..745 + COLON2@738..740 "::" + NAME_REF@740..745 + IDENT@740..745 "c_int" + COMMA@745..746 "," + WHITESPACE@746..747 " " + PARAM@747..760 + BIND_PAT@747..751 + NAME@747..751 + IDENT@747..751 "name" + COLON@751..752 ":" + WHITESPACE@752..753 " " + PATH_TYPE@753..760 + PATH@753..760 + PATH_SEGMENT@753..760 + COLON2@753..755 "::" + NAME_REF@755..760 + IDENT@755..760 "c_int" + COMMA@760..761 "," + WHITESPACE@761..784 "\n " + PARAM@784..806 + BIND_PAT@784..789 + NAME@784..789 + IDENT@784..789 "value" + COLON@789..790 ":" + WHITESPACE@790..791 " " + POINTER_TYPE@791..806 + STAR@791..792 "*" + CONST_KW@792..797 "const" + WHITESPACE@797..798 " " + PATH_TYPE@798..806 + PATH@798..806 + PATH_SEGMENT@798..806 + COLON2@798..800 "::" + NAME_REF@800..806 + IDENT@800..806 "c_void" + COMMA@806..807 "," + WHITESPACE@807..830 "\n " + PARAM@830..851 + BIND_PAT@830..840 + NAME@830..840 + IDENT@830..840 "option_len" + COLON@840..841 ":" + WHITESPACE@841..842 " " + PATH_TYPE@842..851 + PATH@842..851 + PATH_SEGMENT@842..851 + NAME_REF@842..851 + IDENT@842..851 "socklen_t" + R_PAREN@851..852 ")" + WHITESPACE@852..853 " " + RET_TYPE@853..863 + THIN_ARROW@853..855 "->" + WHITESPACE@855..856 " " + PATH_TYPE@856..863 + PATH@856..863 + PATH_SEGMENT@856..863 + COLON2@856..858 "::" + NAME_REF@858..863 + IDENT@858..863 "c_int" + SEMICOLON@863..864 ";" + WHITESPACE@864..869 "\n " + FN_DEF@869..992 + VISIBILITY@869..872 + PUB_KW@869..872 "pub" + WHITESPACE@872..873 " " + FN_KW@873..875 "fn" + WHITESPACE@875..876 " " + NAME@876..887 + IDENT@876..887 "getpeername" + PARAM_LIST@887..980 + L_PAREN@887..888 "(" + PARAM@888..903 + BIND_PAT@888..894 + NAME@888..894 + IDENT@888..894 "socket" + COLON@894..895 ":" + WHITESPACE@895..896 " " + PATH_TYPE@896..903 + PATH@896..903 + PATH_SEGMENT@896..903 + COLON2@896..898 "::" + NAME_REF@898..903 + IDENT@898..903 "c_int" + COMMA@903..904 "," + WHITESPACE@904..905 " " + PARAM@905..927 + BIND_PAT@905..912 + NAME@905..912 + IDENT@905..912 "address" + COLON@912..913 ":" + WHITESPACE@913..914 " " + POINTER_TYPE@914..927 + STAR@914..915 "*" + MUT_KW@915..918 "mut" + WHITESPACE@918..919 " " + PATH_TYPE@919..927 + PATH@919..927 + PATH_SEGMENT@919..927 + NAME_REF@919..927 + IDENT@919..927 "sockaddr" + COMMA@927..928 "," + WHITESPACE@928..952 "\n " + PARAM@952..979 + BIND_PAT@952..963 + NAME@952..963 + IDENT@952..963 "address_len" + COLON@963..964 ":" + WHITESPACE@964..965 " " + POINTER_TYPE@965..979 + STAR@965..966 "*" + MUT_KW@966..969 "mut" + WHITESPACE@969..970 " " + PATH_TYPE@970..979 + PATH@970..979 + PATH_SEGMENT@970..979 + NAME_REF@970..979 + IDENT@970..979 "socklen_t" + R_PAREN@979..980 ")" + WHITESPACE@980..981 " " + RET_TYPE@981..991 + THIN_ARROW@981..983 "->" + WHITESPACE@983..984 " " + PATH_TYPE@984..991 + PATH@984..991 + PATH_SEGMENT@984..991 + COLON2@984..986 "::" + NAME_REF@986..991 + IDENT@986..991 "c_int" + SEMICOLON@991..992 ";" + WHITESPACE@992..997 "\n " + FN_DEF@997..1173 + VISIBILITY@997..1000 + PUB_KW@997..1000 "pub" + WHITESPACE@1000..1001 " " + FN_KW@1001..1003 "fn" + WHITESPACE@1003..1004 " " + NAME@1004..1010 + IDENT@1004..1010 "sendto" + PARAM_LIST@1010..1159 + L_PAREN@1010..1011 "(" + PARAM@1011..1026 + BIND_PAT@1011..1017 + NAME@1011..1017 + IDENT@1011..1017 "socket" + COLON@1017..1018 ":" + WHITESPACE@1018..1019 " " + PATH_TYPE@1019..1026 + PATH@1019..1026 + PATH_SEGMENT@1019..1026 + COLON2@1019..1021 "::" + NAME_REF@1021..1026 + IDENT@1021..1026 "c_int" + COMMA@1026..1027 "," + WHITESPACE@1027..1028 " " + PARAM@1028..1048 + BIND_PAT@1028..1031 + NAME@1028..1031 + IDENT@1028..1031 "buf" + COLON@1031..1032 ":" + WHITESPACE@1032..1033 " " + POINTER_TYPE@1033..1048 + STAR@1033..1034 "*" + CONST_KW@1034..1039 "const" + WHITESPACE@1039..1040 " " + PATH_TYPE@1040..1048 + PATH@1040..1048 + PATH_SEGMENT@1040..1048 + COLON2@1040..1042 "::" + NAME_REF@1042..1048 + IDENT@1042..1048 "c_void" + COMMA@1048..1049 "," + WHITESPACE@1049..1050 " " + PARAM@1050..1063 + BIND_PAT@1050..1053 + NAME@1050..1053 + IDENT@1050..1053 "len" + COLON@1053..1054 ":" + WHITESPACE@1054..1055 " " + PATH_TYPE@1055..1063 + PATH@1055..1063 + PATH_SEGMENT@1055..1063 + COLON2@1055..1057 "::" + NAME_REF@1057..1063 + IDENT@1057..1063 "size_t" + COMMA@1063..1064 "," + WHITESPACE@1064..1083 "\n " + PARAM@1083..1097 + BIND_PAT@1083..1088 + NAME@1083..1088 + IDENT@1083..1088 "flags" + COLON@1088..1089 ":" + WHITESPACE@1089..1090 " " + PATH_TYPE@1090..1097 + PATH@1090..1097 + PATH_SEGMENT@1090..1097 + COLON2@1090..1092 "::" + NAME_REF@1092..1097 + IDENT@1092..1097 "c_int" + COMMA@1097..1098 "," + WHITESPACE@1098..1099 " " + PARAM@1099..1120 + BIND_PAT@1099..1103 + NAME@1099..1103 + IDENT@1099..1103 "addr" + COLON@1103..1104 ":" + WHITESPACE@1104..1105 " " + POINTER_TYPE@1105..1120 + STAR@1105..1106 "*" + CONST_KW@1106..1111 "const" + WHITESPACE@1111..1112 " " + PATH_TYPE@1112..1120 + PATH@1112..1120 + PATH_SEGMENT@1112..1120 + NAME_REF@1112..1120 + IDENT@1112..1120 "sockaddr" + COMMA@1120..1121 "," + WHITESPACE@1121..1140 "\n " + PARAM@1140..1158 + BIND_PAT@1140..1147 + NAME@1140..1147 + IDENT@1140..1147 "addrlen" + COLON@1147..1148 ":" + WHITESPACE@1148..1149 " " + PATH_TYPE@1149..1158 + PATH@1149..1158 + PATH_SEGMENT@1149..1158 + NAME_REF@1149..1158 + IDENT@1149..1158 "socklen_t" + R_PAREN@1158..1159 ")" + WHITESPACE@1159..1160 " " + RET_TYPE@1160..1172 + THIN_ARROW@1160..1162 "->" + WHITESPACE@1162..1163 " " + PATH_TYPE@1163..1172 + PATH@1163..1172 + PATH_SEGMENT@1163..1172 + COLON2@1163..1165 "::" + NAME_REF@1165..1172 + IDENT@1165..1172 "ssize_t" + SEMICOLON@1172..1173 ";" + WHITESPACE@1173..1178 "\n " + FN_DEF@1178..1289 + VISIBILITY@1178..1181 + PUB_KW@1178..1181 "pub" + WHITESPACE@1181..1182 " " + FN_KW@1182..1184 "fn" + WHITESPACE@1184..1185 " " + NAME@1185..1189 + IDENT@1185..1189 "send" + PARAM_LIST@1189..1275 + L_PAREN@1189..1190 "(" + PARAM@1190..1205 + BIND_PAT@1190..1196 + NAME@1190..1196 + IDENT@1190..1196 "socket" + COLON@1196..1197 ":" + WHITESPACE@1197..1198 " " + PATH_TYPE@1198..1205 + PATH@1198..1205 + PATH_SEGMENT@1198..1205 + COLON2@1198..1200 "::" + NAME_REF@1200..1205 + IDENT@1200..1205 "c_int" + COMMA@1205..1206 "," + WHITESPACE@1206..1207 " " + PARAM@1207..1227 + BIND_PAT@1207..1210 + NAME@1207..1210 + IDENT@1207..1210 "buf" + COLON@1210..1211 ":" + WHITESPACE@1211..1212 " " + POINTER_TYPE@1212..1227 + STAR@1212..1213 "*" + CONST_KW@1213..1218 "const" + WHITESPACE@1218..1219 " " + PATH_TYPE@1219..1227 + PATH@1219..1227 + PATH_SEGMENT@1219..1227 + COLON2@1219..1221 "::" + NAME_REF@1221..1227 + IDENT@1221..1227 "c_void" + COMMA@1227..1228 "," + WHITESPACE@1228..1229 " " + PARAM@1229..1242 + BIND_PAT@1229..1232 + NAME@1229..1232 + IDENT@1229..1232 "len" + COLON@1232..1233 ":" + WHITESPACE@1233..1234 " " + PATH_TYPE@1234..1242 + PATH@1234..1242 + PATH_SEGMENT@1234..1242 + COLON2@1234..1236 "::" + NAME_REF@1236..1242 + IDENT@1236..1242 "size_t" + COMMA@1242..1243 "," + WHITESPACE@1243..1260 "\n " + PARAM@1260..1274 + BIND_PAT@1260..1265 + NAME@1260..1265 + IDENT@1260..1265 "flags" + COLON@1265..1266 ":" + WHITESPACE@1266..1267 " " + PATH_TYPE@1267..1274 + PATH@1267..1274 + PATH_SEGMENT@1267..1274 + COLON2@1267..1269 "::" + NAME_REF@1269..1274 + IDENT@1269..1274 "c_int" + R_PAREN@1274..1275 ")" + WHITESPACE@1275..1276 " " + RET_TYPE@1276..1288 + THIN_ARROW@1276..1278 "->" + WHITESPACE@1278..1279 " " + PATH_TYPE@1279..1288 + PATH@1279..1288 + PATH_SEGMENT@1279..1288 + COLON2@1279..1281 "::" + NAME_REF@1281..1288 + IDENT@1281..1288 "ssize_t" + SEMICOLON@1288..1289 ";" + WHITESPACE@1289..1294 "\n " + FN_DEF@1294..1481 + VISIBILITY@1294..1297 + PUB_KW@1294..1297 "pub" + WHITESPACE@1297..1298 " " + FN_KW@1298..1300 "fn" + WHITESPACE@1300..1301 " " + NAME@1301..1309 + IDENT@1301..1309 "recvfrom" + PARAM_LIST@1309..1467 + L_PAREN@1309..1310 "(" + PARAM@1310..1325 + BIND_PAT@1310..1316 + NAME@1310..1316 + IDENT@1310..1316 "socket" + COLON@1316..1317 ":" + WHITESPACE@1317..1318 " " + PATH_TYPE@1318..1325 + PATH@1318..1325 + PATH_SEGMENT@1318..1325 + COLON2@1318..1320 "::" + NAME_REF@1320..1325 + IDENT@1320..1325 "c_int" + COMMA@1325..1326 "," + WHITESPACE@1326..1327 " " + PARAM@1327..1345 + BIND_PAT@1327..1330 + NAME@1327..1330 + IDENT@1327..1330 "buf" + COLON@1330..1331 ":" + WHITESPACE@1331..1332 " " + POINTER_TYPE@1332..1345 + STAR@1332..1333 "*" + MUT_KW@1333..1336 "mut" + WHITESPACE@1336..1337 " " + PATH_TYPE@1337..1345 + PATH@1337..1345 + PATH_SEGMENT@1337..1345 + COLON2@1337..1339 "::" + NAME_REF@1339..1345 + IDENT@1339..1345 "c_void" + COMMA@1345..1346 "," + WHITESPACE@1346..1347 " " + PARAM@1347..1360 + BIND_PAT@1347..1350 + NAME@1347..1350 + IDENT@1347..1350 "len" + COLON@1350..1351 ":" + WHITESPACE@1351..1352 " " + PATH_TYPE@1352..1360 + PATH@1352..1360 + PATH_SEGMENT@1352..1360 + COLON2@1352..1354 "::" + NAME_REF@1354..1360 + IDENT@1354..1360 "size_t" + COMMA@1360..1361 "," + WHITESPACE@1361..1382 "\n " + PARAM@1382..1396 + BIND_PAT@1382..1387 + NAME@1382..1387 + IDENT@1382..1387 "flags" + COLON@1387..1388 ":" + WHITESPACE@1388..1389 " " + PATH_TYPE@1389..1396 + PATH@1389..1396 + PATH_SEGMENT@1389..1396 + COLON2@1389..1391 "::" + NAME_REF@1391..1396 + IDENT@1391..1396 "c_int" + COMMA@1396..1397 "," + WHITESPACE@1397..1398 " " + PARAM@1398..1419 + BIND_PAT@1398..1402 + NAME@1398..1402 + IDENT@1398..1402 "addr" + COLON@1402..1403 ":" + WHITESPACE@1403..1404 " " + POINTER_TYPE@1404..1419 + STAR@1404..1405 "*" + MUT_KW@1405..1408 "mut" + WHITESPACE@1408..1409 " " + PATH_TYPE@1409..1419 + PATH@1409..1419 + PATH_SEGMENT@1409..1419 + COLON2@1409..1411 "::" + NAME_REF@1411..1419 + IDENT@1411..1419 "sockaddr" + COMMA@1419..1420 "," + WHITESPACE@1420..1441 "\n " + PARAM@1441..1466 + BIND_PAT@1441..1448 + NAME@1441..1448 + IDENT@1441..1448 "addrlen" + COLON@1448..1449 ":" + WHITESPACE@1449..1450 " " + POINTER_TYPE@1450..1466 + STAR@1450..1451 "*" + MUT_KW@1451..1454 "mut" + WHITESPACE@1454..1455 " " + PATH_TYPE@1455..1466 + PATH@1455..1466 + PATH_SEGMENT@1455..1466 + COLON2@1455..1457 "::" + NAME_REF@1457..1466 + IDENT@1457..1466 "socklen_t" + R_PAREN@1466..1467 ")" + WHITESPACE@1467..1468 " " + RET_TYPE@1468..1480 + THIN_ARROW@1468..1470 "->" + WHITESPACE@1470..1471 " " + PATH_TYPE@1471..1480 + PATH@1471..1480 + PATH_SEGMENT@1471..1480 + COLON2@1471..1473 "::" + NAME_REF@1473..1480 + IDENT@1473..1480 "ssize_t" + SEMICOLON@1480..1481 ";" + WHITESPACE@1481..1486 "\n " + FN_DEF@1486..1595 + VISIBILITY@1486..1489 + PUB_KW@1486..1489 "pub" + WHITESPACE@1489..1490 " " + FN_KW@1490..1492 "fn" + WHITESPACE@1492..1493 " " + NAME@1493..1497 + IDENT@1493..1497 "recv" + PARAM_LIST@1497..1581 + L_PAREN@1497..1498 "(" + PARAM@1498..1513 + BIND_PAT@1498..1504 + NAME@1498..1504 + IDENT@1498..1504 "socket" + COLON@1504..1505 ":" + WHITESPACE@1505..1506 " " + PATH_TYPE@1506..1513 + PATH@1506..1513 + PATH_SEGMENT@1506..1513 + COLON2@1506..1508 "::" + NAME_REF@1508..1513 + IDENT@1508..1513 "c_int" + COMMA@1513..1514 "," + WHITESPACE@1514..1515 " " + PARAM@1515..1533 + BIND_PAT@1515..1518 + NAME@1515..1518 + IDENT@1515..1518 "buf" + COLON@1518..1519 ":" + WHITESPACE@1519..1520 " " + POINTER_TYPE@1520..1533 + STAR@1520..1521 "*" + MUT_KW@1521..1524 "mut" + WHITESPACE@1524..1525 " " + PATH_TYPE@1525..1533 + PATH@1525..1533 + PATH_SEGMENT@1525..1533 + COLON2@1525..1527 "::" + NAME_REF@1527..1533 + IDENT@1527..1533 "c_void" + COMMA@1533..1534 "," + WHITESPACE@1534..1535 " " + PARAM@1535..1548 + BIND_PAT@1535..1538 + NAME@1535..1538 + IDENT@1535..1538 "len" + COLON@1538..1539 ":" + WHITESPACE@1539..1540 " " + PATH_TYPE@1540..1548 + PATH@1540..1548 + PATH_SEGMENT@1540..1548 + COLON2@1540..1542 "::" + NAME_REF@1542..1548 + IDENT@1542..1548 "size_t" + COMMA@1548..1549 "," + WHITESPACE@1549..1566 "\n " + PARAM@1566..1580 + BIND_PAT@1566..1571 + NAME@1566..1571 + IDENT@1566..1571 "flags" + COLON@1571..1572 ":" + WHITESPACE@1572..1573 " " + PATH_TYPE@1573..1580 + PATH@1573..1580 + PATH_SEGMENT@1573..1580 + COLON2@1573..1575 "::" + NAME_REF@1575..1580 + IDENT@1575..1580 "c_int" + R_PAREN@1580..1581 ")" + WHITESPACE@1581..1582 " " + RET_TYPE@1582..1594 + THIN_ARROW@1582..1584 "->" + WHITESPACE@1584..1585 " " + PATH_TYPE@1585..1594 + PATH@1585..1594 + PATH_SEGMENT@1585..1594 + COLON2@1585..1587 "::" + NAME_REF@1587..1594 + IDENT@1587..1594 "ssize_t" + SEMICOLON@1594..1595 ";" + WHITESPACE@1595..1596 "\n" + R_CURLY@1596..1597 "}" + 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 f71cf5b6c3..68eb16bbd4 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 @@ -1,91 +1,91 @@ -SOURCE_FILE@[0; 116) - FN_DEF@[0; 115) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 21) - IDENT@[3; 21) "test_serialization" - TYPE_PARAM_LIST@[21; 26) - L_ANGLE@[21; 22) "<" - TYPE_PARAM@[22; 25) - NAME@[22; 25) - IDENT@[22; 25) "SER" - R_ANGLE@[25; 26) ">" - PARAM_LIST@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - WHITESPACE@[28; 29) "\n" - WHERE_CLAUSE@[29; 112) - WHERE_KW@[29; 34) "where" - WHITESPACE@[34; 39) "\n " - WHERE_PRED@[39; 111) - PATH_TYPE@[39; 42) - PATH@[39; 42) - PATH_SEGMENT@[39; 42) - NAME_REF@[39; 42) - IDENT@[39; 42) "SER" - COLON@[42; 43) ":" - WHITESPACE@[43; 44) " " - TYPE_BOUND_LIST@[44; 111) - TYPE_BOUND@[44; 53) - PATH_TYPE@[44; 53) - PATH@[44; 53) - PATH_SEGMENT@[44; 53) - NAME_REF@[44; 53) - IDENT@[44; 53) "Serialize" - WHITESPACE@[53; 54) " " - PLUS@[54; 55) "+" - WHITESPACE@[55; 56) " " - TYPE_BOUND@[56; 81) - FOR_TYPE@[56; 81) - FOR_KW@[56; 59) "for" - TYPE_PARAM_LIST@[59; 64) - L_ANGLE@[59; 60) "<" - LIFETIME_PARAM@[60; 63) - LIFETIME@[60; 63) "\'de" - R_ANGLE@[63; 64) ">" - WHITESPACE@[64; 65) " " - PATH_TYPE@[65; 81) - PATH@[65; 81) - PATH_SEGMENT@[65; 81) - NAME_REF@[65; 76) - IDENT@[65; 76) "Deserialize" - TYPE_ARG_LIST@[76; 81) - L_ANGLE@[76; 77) "<" - LIFETIME_ARG@[77; 80) - LIFETIME@[77; 80) "\'de" - R_ANGLE@[80; 81) ">" - WHITESPACE@[81; 82) " " - PLUS@[82; 83) "+" - WHITESPACE@[83; 84) " " - TYPE_BOUND@[84; 93) - PATH_TYPE@[84; 93) - PATH@[84; 93) - PATH_SEGMENT@[84; 93) - NAME_REF@[84; 93) - IDENT@[84; 93) "PartialEq" - WHITESPACE@[93; 94) " " - PLUS@[94; 95) "+" - WHITESPACE@[95; 96) " " - TYPE_BOUND@[96; 111) - PATH_TYPE@[96; 111) - PATH@[96; 111) - PATH@[96; 104) - PATH@[96; 99) - PATH_SEGMENT@[96; 99) - NAME_REF@[96; 99) - IDENT@[96; 99) "std" - COLON2@[99; 101) "::" - PATH_SEGMENT@[101; 104) - NAME_REF@[101; 104) - IDENT@[101; 104) "fmt" - COLON2@[104; 106) "::" - PATH_SEGMENT@[106; 111) - NAME_REF@[106; 111) - IDENT@[106; 111) "Debug" - COMMA@[111; 112) "," - WHITESPACE@[112; 113) "\n" - BLOCK_EXPR@[113; 115) - BLOCK@[113; 115) - L_CURLY@[113; 114) "{" - R_CURLY@[114; 115) "}" - WHITESPACE@[115; 116) "\n" +SOURCE_FILE@0..116 + FN_DEF@0..115 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..21 + IDENT@3..21 "test_serialization" + TYPE_PARAM_LIST@21..26 + L_ANGLE@21..22 "<" + TYPE_PARAM@22..25 + NAME@22..25 + IDENT@22..25 "SER" + R_ANGLE@25..26 ">" + PARAM_LIST@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + WHITESPACE@28..29 "\n" + WHERE_CLAUSE@29..112 + WHERE_KW@29..34 "where" + WHITESPACE@34..39 "\n " + WHERE_PRED@39..111 + PATH_TYPE@39..42 + PATH@39..42 + PATH_SEGMENT@39..42 + NAME_REF@39..42 + IDENT@39..42 "SER" + COLON@42..43 ":" + WHITESPACE@43..44 " " + TYPE_BOUND_LIST@44..111 + TYPE_BOUND@44..53 + PATH_TYPE@44..53 + PATH@44..53 + PATH_SEGMENT@44..53 + NAME_REF@44..53 + IDENT@44..53 "Serialize" + WHITESPACE@53..54 " " + PLUS@54..55 "+" + WHITESPACE@55..56 " " + TYPE_BOUND@56..81 + FOR_TYPE@56..81 + FOR_KW@56..59 "for" + TYPE_PARAM_LIST@59..64 + L_ANGLE@59..60 "<" + LIFETIME_PARAM@60..63 + LIFETIME@60..63 "\'de" + R_ANGLE@63..64 ">" + WHITESPACE@64..65 " " + PATH_TYPE@65..81 + PATH@65..81 + PATH_SEGMENT@65..81 + NAME_REF@65..76 + IDENT@65..76 "Deserialize" + TYPE_ARG_LIST@76..81 + L_ANGLE@76..77 "<" + LIFETIME_ARG@77..80 + LIFETIME@77..80 "\'de" + R_ANGLE@80..81 ">" + WHITESPACE@81..82 " " + PLUS@82..83 "+" + WHITESPACE@83..84 " " + TYPE_BOUND@84..93 + PATH_TYPE@84..93 + PATH@84..93 + PATH_SEGMENT@84..93 + NAME_REF@84..93 + IDENT@84..93 "PartialEq" + WHITESPACE@93..94 " " + PLUS@94..95 "+" + WHITESPACE@95..96 " " + TYPE_BOUND@96..111 + PATH_TYPE@96..111 + PATH@96..111 + PATH@96..104 + PATH@96..99 + PATH_SEGMENT@96..99 + NAME_REF@96..99 + IDENT@96..99 "std" + COLON2@99..101 "::" + PATH_SEGMENT@101..104 + NAME_REF@101..104 + IDENT@101..104 "fmt" + COLON2@104..106 "::" + PATH_SEGMENT@106..111 + NAME_REF@106..111 + IDENT@106..111 "Debug" + COMMA@111..112 "," + WHITESPACE@112..113 "\n" + BLOCK_EXPR@113..115 + BLOCK@113..115 + L_CURLY@113..114 "{" + R_CURLY@114..115 "}" + WHITESPACE@115..116 "\n" 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 8af41caa0f..3977faa608 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 @@ -1,220 +1,220 @@ -SOURCE_FILE@[0; 506) - FN_DEF@[0; 505) - COMMENT@[0; 33) "// format with label ..." - WHITESPACE@[33; 34) "\n" - FN_KW@[34; 36) "fn" - WHITESPACE@[36; 37) " " - NAME@[37; 41) - IDENT@[37; 41) "main" - PARAM_LIST@[41; 43) - L_PAREN@[41; 42) "(" - R_PAREN@[42; 43) ")" - WHITESPACE@[43; 44) " " - BLOCK_EXPR@[44; 505) - BLOCK@[44; 505) - L_CURLY@[44; 45) "{" - WHITESPACE@[45; 50) "\n " - EXPR_STMT@[50; 66) - BLOCK_EXPR@[50; 66) - LABEL@[50; 63) - LIFETIME@[50; 62) "\'empty_block" - COLON@[62; 63) ":" - WHITESPACE@[63; 64) " " - BLOCK@[64; 66) - L_CURLY@[64; 65) "{" - R_CURLY@[65; 66) "}" - WHITESPACE@[66; 72) "\n\n " - EXPR_STMT@[72; 295) - BLOCK_EXPR@[72; 295) - LABEL@[72; 79) - LIFETIME@[72; 78) "\'block" - COLON@[78; 79) ":" - WHITESPACE@[79; 80) " " - BLOCK@[80; 295) - L_CURLY@[80; 81) "{" - WHITESPACE@[81; 90) "\n " - EXPR_STMT@[90; 101) - CALL_EXPR@[90; 100) - PATH_EXPR@[90; 98) - PATH@[90; 98) - PATH_SEGMENT@[90; 98) - NAME_REF@[90; 98) - IDENT@[90; 98) "do_thing" - ARG_LIST@[98; 100) - L_PAREN@[98; 99) "(" - R_PAREN@[99; 100) ")" - SEMICOLON@[100; 101) ";" - WHITESPACE@[101; 110) "\n " - EXPR_STMT@[110; 170) - IF_EXPR@[110; 170) - IF_KW@[110; 112) "if" - WHITESPACE@[112; 113) " " - CONDITION@[113; 132) - CALL_EXPR@[113; 132) - PATH_EXPR@[113; 130) - PATH@[113; 130) - PATH_SEGMENT@[113; 130) - NAME_REF@[113; 130) - IDENT@[113; 130) "condition_not_met" - ARG_LIST@[130; 132) - L_PAREN@[130; 131) "(" - R_PAREN@[131; 132) ")" - WHITESPACE@[132; 133) " " - BLOCK_EXPR@[133; 170) - BLOCK@[133; 170) - L_CURLY@[133; 134) "{" - WHITESPACE@[134; 147) "\n " - EXPR_STMT@[147; 160) - BREAK_EXPR@[147; 159) - BREAK_KW@[147; 152) "break" - WHITESPACE@[152; 153) " " - LIFETIME@[153; 159) "\'block" - SEMICOLON@[159; 160) ";" - WHITESPACE@[160; 169) "\n " - R_CURLY@[169; 170) "}" - WHITESPACE@[170; 179) "\n " - EXPR_STMT@[179; 195) - CALL_EXPR@[179; 194) - PATH_EXPR@[179; 192) - PATH@[179; 192) - PATH_SEGMENT@[179; 192) - NAME_REF@[179; 192) - IDENT@[179; 192) "do_next_thing" - ARG_LIST@[192; 194) - L_PAREN@[192; 193) "(" - R_PAREN@[193; 194) ")" - SEMICOLON@[194; 195) ";" - WHITESPACE@[195; 204) "\n " - EXPR_STMT@[204; 264) - IF_EXPR@[204; 264) - IF_KW@[204; 206) "if" - WHITESPACE@[206; 207) " " - CONDITION@[207; 226) - CALL_EXPR@[207; 226) - PATH_EXPR@[207; 224) - PATH@[207; 224) - PATH_SEGMENT@[207; 224) - NAME_REF@[207; 224) - IDENT@[207; 224) "condition_not_met" - ARG_LIST@[224; 226) - L_PAREN@[224; 225) "(" - R_PAREN@[225; 226) ")" - WHITESPACE@[226; 227) " " - BLOCK_EXPR@[227; 264) - BLOCK@[227; 264) - L_CURLY@[227; 228) "{" - WHITESPACE@[228; 241) "\n " - EXPR_STMT@[241; 254) - BREAK_EXPR@[241; 253) - BREAK_KW@[241; 246) "break" - WHITESPACE@[246; 247) " " - LIFETIME@[247; 253) "\'block" - SEMICOLON@[253; 254) ";" - WHITESPACE@[254; 263) "\n " - R_CURLY@[263; 264) "}" - WHITESPACE@[264; 273) "\n " - EXPR_STMT@[273; 289) - CALL_EXPR@[273; 288) - PATH_EXPR@[273; 286) - PATH@[273; 286) - PATH_SEGMENT@[273; 286) - NAME_REF@[273; 286) - IDENT@[273; 286) "do_last_thing" - ARG_LIST@[286; 288) - L_PAREN@[286; 287) "(" - R_PAREN@[287; 288) ")" - SEMICOLON@[288; 289) ";" - WHITESPACE@[289; 294) "\n " - R_CURLY@[294; 295) "}" - WHITESPACE@[295; 301) "\n\n " - LET_STMT@[301; 503) - LET_KW@[301; 304) "let" - WHITESPACE@[304; 305) " " - BIND_PAT@[305; 311) - NAME@[305; 311) - IDENT@[305; 311) "result" - WHITESPACE@[311; 312) " " - EQ@[312; 313) "=" - WHITESPACE@[313; 314) " " - BLOCK_EXPR@[314; 502) - LABEL@[314; 321) - LIFETIME@[314; 320) "\'block" - COLON@[320; 321) ":" - WHITESPACE@[321; 322) " " - BLOCK@[322; 502) - L_CURLY@[322; 323) "{" - WHITESPACE@[323; 332) "\n " - EXPR_STMT@[332; 403) - IF_EXPR@[332; 403) - IF_KW@[332; 334) "if" - WHITESPACE@[334; 335) " " - CONDITION@[335; 340) - CALL_EXPR@[335; 340) - PATH_EXPR@[335; 338) - PATH@[335; 338) - PATH_SEGMENT@[335; 338) - NAME_REF@[335; 338) - IDENT@[335; 338) "foo" - ARG_LIST@[338; 340) - L_PAREN@[338; 339) "(" - R_PAREN@[339; 340) ")" - WHITESPACE@[340; 341) " " - BLOCK_EXPR@[341; 403) - BLOCK@[341; 403) - L_CURLY@[341; 342) "{" - WHITESPACE@[342; 355) "\n " - COMMENT@[355; 365) "// comment" - WHITESPACE@[365; 378) "\n " - EXPR_STMT@[378; 393) - BREAK_EXPR@[378; 392) - BREAK_KW@[378; 383) "break" - WHITESPACE@[383; 384) " " - LIFETIME@[384; 390) "\'block" - WHITESPACE@[390; 391) " " - LITERAL@[391; 392) - INT_NUMBER@[391; 392) "1" - SEMICOLON@[392; 393) ";" - WHITESPACE@[393; 402) "\n " - R_CURLY@[402; 403) "}" - WHITESPACE@[403; 412) "\n " - EXPR_STMT@[412; 486) - IF_EXPR@[412; 486) - IF_KW@[412; 414) "if" - WHITESPACE@[414; 415) " " - CONDITION@[415; 420) - CALL_EXPR@[415; 420) - PATH_EXPR@[415; 418) - PATH@[415; 418) - PATH_SEGMENT@[415; 418) - NAME_REF@[415; 418) - IDENT@[415; 418) "bar" - ARG_LIST@[418; 420) - L_PAREN@[418; 419) "(" - R_PAREN@[419; 420) ")" - WHITESPACE@[420; 421) " " - BLOCK_EXPR@[421; 486) - BLOCK@[421; 486) - L_CURLY@[421; 422) "{" - WHITESPACE@[422; 435) "\n " - COMMENT@[435; 448) "/* comment */" - WHITESPACE@[448; 461) "\n " - EXPR_STMT@[461; 476) - BREAK_EXPR@[461; 475) - BREAK_KW@[461; 466) "break" - WHITESPACE@[466; 467) " " - LIFETIME@[467; 473) "\'block" - WHITESPACE@[473; 474) " " - LITERAL@[474; 475) - INT_NUMBER@[474; 475) "2" - SEMICOLON@[475; 476) ";" - WHITESPACE@[476; 485) "\n " - R_CURLY@[485; 486) "}" - WHITESPACE@[486; 495) "\n " - LITERAL@[495; 496) - INT_NUMBER@[495; 496) "3" - WHITESPACE@[496; 501) "\n " - R_CURLY@[501; 502) "}" - SEMICOLON@[502; 503) ";" - WHITESPACE@[503; 504) "\n" - R_CURLY@[504; 505) "}" - WHITESPACE@[505; 506) "\n" +SOURCE_FILE@0..506 + FN_DEF@0..505 + COMMENT@0..33 "// format with label ..." + WHITESPACE@33..34 "\n" + FN_KW@34..36 "fn" + WHITESPACE@36..37 " " + NAME@37..41 + IDENT@37..41 "main" + PARAM_LIST@41..43 + L_PAREN@41..42 "(" + R_PAREN@42..43 ")" + WHITESPACE@43..44 " " + BLOCK_EXPR@44..505 + BLOCK@44..505 + L_CURLY@44..45 "{" + WHITESPACE@45..50 "\n " + EXPR_STMT@50..66 + BLOCK_EXPR@50..66 + LABEL@50..63 + LIFETIME@50..62 "\'empty_block" + COLON@62..63 ":" + WHITESPACE@63..64 " " + BLOCK@64..66 + L_CURLY@64..65 "{" + R_CURLY@65..66 "}" + WHITESPACE@66..72 "\n\n " + EXPR_STMT@72..295 + BLOCK_EXPR@72..295 + LABEL@72..79 + LIFETIME@72..78 "\'block" + COLON@78..79 ":" + WHITESPACE@79..80 " " + BLOCK@80..295 + L_CURLY@80..81 "{" + WHITESPACE@81..90 "\n " + EXPR_STMT@90..101 + CALL_EXPR@90..100 + PATH_EXPR@90..98 + PATH@90..98 + PATH_SEGMENT@90..98 + NAME_REF@90..98 + IDENT@90..98 "do_thing" + ARG_LIST@98..100 + L_PAREN@98..99 "(" + R_PAREN@99..100 ")" + SEMICOLON@100..101 ";" + WHITESPACE@101..110 "\n " + EXPR_STMT@110..170 + IF_EXPR@110..170 + IF_KW@110..112 "if" + WHITESPACE@112..113 " " + CONDITION@113..132 + CALL_EXPR@113..132 + PATH_EXPR@113..130 + PATH@113..130 + PATH_SEGMENT@113..130 + NAME_REF@113..130 + IDENT@113..130 "condition_not_met" + ARG_LIST@130..132 + L_PAREN@130..131 "(" + R_PAREN@131..132 ")" + WHITESPACE@132..133 " " + BLOCK_EXPR@133..170 + BLOCK@133..170 + L_CURLY@133..134 "{" + WHITESPACE@134..147 "\n " + EXPR_STMT@147..160 + BREAK_EXPR@147..159 + BREAK_KW@147..152 "break" + WHITESPACE@152..153 " " + LIFETIME@153..159 "\'block" + SEMICOLON@159..160 ";" + WHITESPACE@160..169 "\n " + R_CURLY@169..170 "}" + WHITESPACE@170..179 "\n " + EXPR_STMT@179..195 + CALL_EXPR@179..194 + PATH_EXPR@179..192 + PATH@179..192 + PATH_SEGMENT@179..192 + NAME_REF@179..192 + IDENT@179..192 "do_next_thing" + ARG_LIST@192..194 + L_PAREN@192..193 "(" + R_PAREN@193..194 ")" + SEMICOLON@194..195 ";" + WHITESPACE@195..204 "\n " + EXPR_STMT@204..264 + IF_EXPR@204..264 + IF_KW@204..206 "if" + WHITESPACE@206..207 " " + CONDITION@207..226 + CALL_EXPR@207..226 + PATH_EXPR@207..224 + PATH@207..224 + PATH_SEGMENT@207..224 + NAME_REF@207..224 + IDENT@207..224 "condition_not_met" + ARG_LIST@224..226 + L_PAREN@224..225 "(" + R_PAREN@225..226 ")" + WHITESPACE@226..227 " " + BLOCK_EXPR@227..264 + BLOCK@227..264 + L_CURLY@227..228 "{" + WHITESPACE@228..241 "\n " + EXPR_STMT@241..254 + BREAK_EXPR@241..253 + BREAK_KW@241..246 "break" + WHITESPACE@246..247 " " + LIFETIME@247..253 "\'block" + SEMICOLON@253..254 ";" + WHITESPACE@254..263 "\n " + R_CURLY@263..264 "}" + WHITESPACE@264..273 "\n " + EXPR_STMT@273..289 + CALL_EXPR@273..288 + PATH_EXPR@273..286 + PATH@273..286 + PATH_SEGMENT@273..286 + NAME_REF@273..286 + IDENT@273..286 "do_last_thing" + ARG_LIST@286..288 + L_PAREN@286..287 "(" + R_PAREN@287..288 ")" + SEMICOLON@288..289 ";" + WHITESPACE@289..294 "\n " + R_CURLY@294..295 "}" + WHITESPACE@295..301 "\n\n " + LET_STMT@301..503 + LET_KW@301..304 "let" + WHITESPACE@304..305 " " + BIND_PAT@305..311 + NAME@305..311 + IDENT@305..311 "result" + WHITESPACE@311..312 " " + EQ@312..313 "=" + WHITESPACE@313..314 " " + BLOCK_EXPR@314..502 + LABEL@314..321 + LIFETIME@314..320 "\'block" + COLON@320..321 ":" + WHITESPACE@321..322 " " + BLOCK@322..502 + L_CURLY@322..323 "{" + WHITESPACE@323..332 "\n " + EXPR_STMT@332..403 + IF_EXPR@332..403 + IF_KW@332..334 "if" + WHITESPACE@334..335 " " + CONDITION@335..340 + CALL_EXPR@335..340 + PATH_EXPR@335..338 + PATH@335..338 + PATH_SEGMENT@335..338 + NAME_REF@335..338 + IDENT@335..338 "foo" + ARG_LIST@338..340 + L_PAREN@338..339 "(" + R_PAREN@339..340 ")" + WHITESPACE@340..341 " " + BLOCK_EXPR@341..403 + BLOCK@341..403 + L_CURLY@341..342 "{" + WHITESPACE@342..355 "\n " + COMMENT@355..365 "// comment" + WHITESPACE@365..378 "\n " + EXPR_STMT@378..393 + BREAK_EXPR@378..392 + BREAK_KW@378..383 "break" + WHITESPACE@383..384 " " + LIFETIME@384..390 "\'block" + WHITESPACE@390..391 " " + LITERAL@391..392 + INT_NUMBER@391..392 "1" + SEMICOLON@392..393 ";" + WHITESPACE@393..402 "\n " + R_CURLY@402..403 "}" + WHITESPACE@403..412 "\n " + EXPR_STMT@412..486 + IF_EXPR@412..486 + IF_KW@412..414 "if" + WHITESPACE@414..415 " " + CONDITION@415..420 + CALL_EXPR@415..420 + PATH_EXPR@415..418 + PATH@415..418 + PATH_SEGMENT@415..418 + NAME_REF@415..418 + IDENT@415..418 "bar" + ARG_LIST@418..420 + L_PAREN@418..419 "(" + R_PAREN@419..420 ")" + WHITESPACE@420..421 " " + BLOCK_EXPR@421..486 + BLOCK@421..486 + L_CURLY@421..422 "{" + WHITESPACE@422..435 "\n " + COMMENT@435..448 "/* comment */" + WHITESPACE@448..461 "\n " + EXPR_STMT@461..476 + BREAK_EXPR@461..475 + BREAK_KW@461..466 "break" + WHITESPACE@466..467 " " + LIFETIME@467..473 "\'block" + WHITESPACE@473..474 " " + LITERAL@474..475 + INT_NUMBER@474..475 "2" + SEMICOLON@475..476 ";" + WHITESPACE@476..485 "\n " + R_CURLY@485..486 "}" + WHITESPACE@486..495 "\n " + LITERAL@495..496 + INT_NUMBER@495..496 "3" + WHITESPACE@496..501 "\n " + R_CURLY@501..502 "}" + SEMICOLON@502..503 ";" + WHITESPACE@503..504 "\n" + R_CURLY@504..505 "}" + 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 beaa963883..3b9e8c71ca 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 @@ -1,42 +1,42 @@ -SOURCE_FILE@[0; 62) - FN_DEF@[0; 61) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 61) - BLOCK@[10; 61) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - EXPR_STMT@[16; 59) - CALL_EXPR@[16; 58) - PATH_EXPR@[16; 26) - PATH@[16; 26) - PATH_SEGMENT@[16; 26) - NAME_REF@[16; 26) - IDENT@[16; 26) "make_query" - ARG_LIST@[26; 58) - L_PAREN@[26; 27) "(" - PATH_EXPR@[27; 57) - PATH@[27; 57) - PATH@[27; 44) - PATH@[27; 32) - PATH_SEGMENT@[27; 32) - CRATE_KW@[27; 32) "crate" - COLON2@[32; 34) "::" - PATH_SEGMENT@[34; 44) - NAME_REF@[34; 44) - IDENT@[34; 44) "module_map" - COLON2@[44; 46) "::" - PATH_SEGMENT@[46; 57) - NAME_REF@[46; 57) - IDENT@[46; 57) "module_tree" - R_PAREN@[57; 58) ")" - SEMICOLON@[58; 59) ";" - WHITESPACE@[59; 60) "\n" - R_CURLY@[60; 61) "}" - WHITESPACE@[61; 62) "\n" +SOURCE_FILE@0..62 + FN_DEF@0..61 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..61 + BLOCK@10..61 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..59 + CALL_EXPR@16..58 + PATH_EXPR@16..26 + PATH@16..26 + PATH_SEGMENT@16..26 + NAME_REF@16..26 + IDENT@16..26 "make_query" + ARG_LIST@26..58 + L_PAREN@26..27 "(" + PATH_EXPR@27..57 + PATH@27..57 + PATH@27..44 + PATH@27..32 + PATH_SEGMENT@27..32 + CRATE_KW@27..32 "crate" + COLON2@32..34 "::" + PATH_SEGMENT@34..44 + NAME_REF@34..44 + IDENT@34..44 "module_map" + COLON2@44..46 "::" + PATH_SEGMENT@46..57 + NAME_REF@46..57 + IDENT@46..57 "module_tree" + R_PAREN@57..58 ")" + SEMICOLON@58..59 ";" + WHITESPACE@59..60 "\n" + R_CURLY@60..61 "}" + 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 7143a31a5c..9af6896358 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 @@ -1,2329 +1,2329 @@ -SOURCE_FILE@[0; 3813) - COMMENT@[0; 55) "//! Adapted from a `r ..." - WHITESPACE@[55; 56) "\n" - COMMENT@[56; 173) "//! https://github.co ..." - WHITESPACE@[173; 174) "\n" - COMMENT@[174; 178) "//! " - WHITESPACE@[178; 179) "\n" - COMMENT@[179; 269) "//! Reported to rust- ..." - WHITESPACE@[269; 271) "\n\n" - ATTR@[271; 302) - POUND@[271; 272) "#" - BANG@[272; 273) "!" - L_BRACK@[273; 274) "[" - PATH@[274; 279) - PATH_SEGMENT@[274; 279) - NAME_REF@[274; 279) - IDENT@[274; 279) "allow" - TOKEN_TREE@[279; 301) - L_PAREN@[279; 280) "(" - IDENT@[280; 300) "non_camel_case_types" - R_PAREN@[300; 301) ")" - R_BRACK@[301; 302) "]" - WHITESPACE@[302; 303) "\n" - ATTR@[303; 323) - POUND@[303; 304) "#" - BANG@[304; 305) "!" - L_BRACK@[305; 306) "[" - PATH@[306; 311) - PATH_SEGMENT@[306; 311) - NAME_REF@[306; 311) - IDENT@[306; 311) "allow" - TOKEN_TREE@[311; 322) - L_PAREN@[311; 312) "(" - IDENT@[312; 321) "dead_code" - R_PAREN@[321; 322) ")" - R_BRACK@[322; 323) "]" - WHITESPACE@[323; 324) "\n" - ATTR@[324; 351) - POUND@[324; 325) "#" - BANG@[325; 326) "!" - L_BRACK@[326; 327) "[" - PATH@[327; 332) - PATH_SEGMENT@[327; 332) - NAME_REF@[327; 332) - IDENT@[327; 332) "allow" - TOKEN_TREE@[332; 350) - L_PAREN@[332; 333) "(" - IDENT@[333; 349) "unreachable_code" - R_PAREN@[349; 350) ")" - R_BRACK@[350; 351) "]" - WHITESPACE@[351; 352) "\n" - ATTR@[352; 376) - POUND@[352; 353) "#" - BANG@[353; 354) "!" - L_BRACK@[354; 355) "[" - PATH@[355; 360) - PATH_SEGMENT@[355; 360) - NAME_REF@[355; 360) - IDENT@[355; 360) "allow" - TOKEN_TREE@[360; 375) - L_PAREN@[360; 361) "(" - IDENT@[361; 374) "unused_parens" - R_PAREN@[374; 375) ")" - R_BRACK@[375; 376) "]" - WHITESPACE@[376; 378) "\n\n" - ATTR@[378; 405) - POUND@[378; 379) "#" - BANG@[379; 380) "!" - L_BRACK@[380; 381) "[" - PATH@[381; 396) - PATH_SEGMENT@[381; 396) - NAME_REF@[381; 396) - IDENT@[381; 396) "recursion_limit" - WHITESPACE@[396; 397) " " - EQ@[397; 398) "=" - WHITESPACE@[398; 399) " " - LITERAL@[399; 404) - STRING@[399; 404) "\"128\"" - R_BRACK@[404; 405) "]" - WHITESPACE@[405; 407) "\n\n" - USE_ITEM@[407; 427) - USE_KW@[407; 410) "use" - WHITESPACE@[410; 411) " " - USE_TREE@[411; 426) - PATH@[411; 426) - PATH@[411; 420) - PATH@[411; 414) - PATH_SEGMENT@[411; 414) - NAME_REF@[411; 414) - IDENT@[411; 414) "std" - COLON2@[414; 416) "::" - PATH_SEGMENT@[416; 420) - NAME_REF@[416; 420) - IDENT@[416; 420) "cell" - COLON2@[420; 422) "::" - PATH_SEGMENT@[422; 426) - NAME_REF@[422; 426) - IDENT@[422; 426) "Cell" - SEMICOLON@[426; 427) ";" - WHITESPACE@[427; 428) "\n" - USE_ITEM@[428; 447) - USE_KW@[428; 431) "use" - WHITESPACE@[431; 432) " " - USE_TREE@[432; 446) - PATH@[432; 446) - PATH@[432; 440) - PATH@[432; 435) - PATH_SEGMENT@[432; 435) - NAME_REF@[432; 435) - IDENT@[432; 435) "std" - COLON2@[435; 437) "::" - PATH_SEGMENT@[437; 440) - NAME_REF@[437; 440) - IDENT@[437; 440) "mem" - COLON2@[440; 442) "::" - PATH_SEGMENT@[442; 446) - NAME_REF@[442; 446) - IDENT@[442; 446) "swap" - SEMICOLON@[446; 447) ";" - WHITESPACE@[447; 449) "\n\n" - COMMENT@[449; 518) "// Just a grab bag of ..." - WHITESPACE@[518; 520) "\n\n" - FN_DEF@[520; 572) - FN_KW@[520; 522) "fn" - WHITESPACE@[522; 523) " " - NAME@[523; 530) - IDENT@[523; 530) "strange" - PARAM_LIST@[530; 532) - L_PAREN@[530; 531) "(" - R_PAREN@[531; 532) ")" - WHITESPACE@[532; 533) " " - RET_TYPE@[533; 540) - THIN_ARROW@[533; 535) "->" - WHITESPACE@[535; 536) " " - PATH_TYPE@[536; 540) - PATH@[536; 540) - PATH_SEGMENT@[536; 540) - NAME_REF@[536; 540) - IDENT@[536; 540) "bool" - WHITESPACE@[540; 541) " " - BLOCK_EXPR@[541; 572) - BLOCK@[541; 572) - L_CURLY@[541; 542) "{" - WHITESPACE@[542; 543) " " - LET_STMT@[543; 570) - LET_KW@[543; 546) "let" - WHITESPACE@[546; 547) " " - BIND_PAT@[547; 549) - NAME@[547; 549) - IDENT@[547; 549) "_x" - COLON@[549; 550) ":" - WHITESPACE@[550; 551) " " - PATH_TYPE@[551; 555) - PATH@[551; 555) - PATH_SEGMENT@[551; 555) - NAME_REF@[551; 555) - IDENT@[551; 555) "bool" - WHITESPACE@[555; 556) " " - EQ@[556; 557) "=" - WHITESPACE@[557; 558) " " - RETURN_EXPR@[558; 569) - RETURN_KW@[558; 564) "return" - WHITESPACE@[564; 565) " " - LITERAL@[565; 569) - TRUE_KW@[565; 569) "true" - SEMICOLON@[569; 570) ";" - WHITESPACE@[570; 571) " " - R_CURLY@[571; 572) "}" - WHITESPACE@[572; 574) "\n\n" - FN_DEF@[574; 624) - FN_KW@[574; 576) "fn" - WHITESPACE@[576; 577) " " - NAME@[577; 582) - IDENT@[577; 582) "funny" - PARAM_LIST@[582; 584) - L_PAREN@[582; 583) "(" - R_PAREN@[583; 584) ")" - WHITESPACE@[584; 585) " " - BLOCK_EXPR@[585; 624) - BLOCK@[585; 624) - L_CURLY@[585; 586) "{" - WHITESPACE@[586; 591) "\n " - FN_DEF@[591; 607) - FN_KW@[591; 593) "fn" - WHITESPACE@[593; 594) " " - NAME@[594; 595) - IDENT@[594; 595) "f" - PARAM_LIST@[595; 603) - L_PAREN@[595; 596) "(" - PARAM@[596; 602) - BIND_PAT@[596; 598) - NAME@[596; 598) - IDENT@[596; 598) "_x" - COLON@[598; 599) ":" - WHITESPACE@[599; 600) " " - TUPLE_TYPE@[600; 602) - L_PAREN@[600; 601) "(" - R_PAREN@[601; 602) ")" - R_PAREN@[602; 603) ")" - WHITESPACE@[603; 604) " " - BLOCK_EXPR@[604; 607) - BLOCK@[604; 607) - L_CURLY@[604; 605) "{" - WHITESPACE@[605; 606) " " - R_CURLY@[606; 607) "}" - WHITESPACE@[607; 612) "\n " - EXPR_STMT@[612; 622) - CALL_EXPR@[612; 621) - PATH_EXPR@[612; 613) - PATH@[612; 613) - PATH_SEGMENT@[612; 613) - NAME_REF@[612; 613) - IDENT@[612; 613) "f" - ARG_LIST@[613; 621) - L_PAREN@[613; 614) "(" - RETURN_EXPR@[614; 620) - RETURN_KW@[614; 620) "return" - R_PAREN@[620; 621) ")" - SEMICOLON@[621; 622) ";" - WHITESPACE@[622; 623) "\n" - R_CURLY@[623; 624) "}" - WHITESPACE@[624; 626) "\n\n" - FN_DEF@[626; 816) - FN_KW@[626; 628) "fn" - WHITESPACE@[628; 629) " " - NAME@[629; 633) - IDENT@[629; 633) "what" - PARAM_LIST@[633; 635) - L_PAREN@[633; 634) "(" - R_PAREN@[634; 635) ")" - WHITESPACE@[635; 636) " " - BLOCK_EXPR@[636; 816) - BLOCK@[636; 816) - L_CURLY@[636; 637) "{" - WHITESPACE@[637; 642) "\n " - FN_DEF@[642; 720) - FN_KW@[642; 644) "fn" - WHITESPACE@[644; 645) " " - NAME@[645; 648) - IDENT@[645; 648) "the" - PARAM_LIST@[648; 664) - L_PAREN@[648; 649) "(" - PARAM@[649; 663) - BIND_PAT@[649; 650) - NAME@[649; 650) - IDENT@[649; 650) "x" - COLON@[650; 651) ":" - WHITESPACE@[651; 652) " " - REFERENCE_TYPE@[652; 663) - AMP@[652; 653) "&" - PATH_TYPE@[653; 663) - PATH@[653; 663) - PATH_SEGMENT@[653; 663) - NAME_REF@[653; 657) - IDENT@[653; 657) "Cell" - TYPE_ARG_LIST@[657; 663) - L_ANGLE@[657; 658) "<" - TYPE_ARG@[658; 662) - PATH_TYPE@[658; 662) - PATH@[658; 662) - PATH_SEGMENT@[658; 662) - NAME_REF@[658; 662) - IDENT@[658; 662) "bool" - R_ANGLE@[662; 663) ">" - R_PAREN@[663; 664) ")" - WHITESPACE@[664; 665) " " - BLOCK_EXPR@[665; 720) - BLOCK@[665; 720) - L_CURLY@[665; 666) "{" - WHITESPACE@[666; 675) "\n " - EXPR_STMT@[675; 714) - RETURN_EXPR@[675; 713) - RETURN_KW@[675; 681) "return" - WHITESPACE@[681; 682) " " - WHILE_EXPR@[682; 713) - WHILE_KW@[682; 687) "while" - WHITESPACE@[687; 688) " " - CONDITION@[688; 696) - PREFIX_EXPR@[688; 696) - BANG@[688; 689) "!" - METHOD_CALL_EXPR@[689; 696) - PATH_EXPR@[689; 690) - PATH@[689; 690) - PATH_SEGMENT@[689; 690) - NAME_REF@[689; 690) - IDENT@[689; 690) "x" - DOT@[690; 691) "." - NAME_REF@[691; 694) - IDENT@[691; 694) "get" - ARG_LIST@[694; 696) - L_PAREN@[694; 695) "(" - R_PAREN@[695; 696) ")" - WHITESPACE@[696; 697) " " - BLOCK_EXPR@[697; 713) - BLOCK@[697; 713) - L_CURLY@[697; 698) "{" - WHITESPACE@[698; 699) " " - EXPR_STMT@[699; 711) - METHOD_CALL_EXPR@[699; 710) - PATH_EXPR@[699; 700) - PATH@[699; 700) - PATH_SEGMENT@[699; 700) - NAME_REF@[699; 700) - IDENT@[699; 700) "x" - DOT@[700; 701) "." - NAME_REF@[701; 704) - IDENT@[701; 704) "set" - ARG_LIST@[704; 710) - L_PAREN@[704; 705) "(" - LITERAL@[705; 709) - TRUE_KW@[705; 709) "true" - R_PAREN@[709; 710) ")" - SEMICOLON@[710; 711) ";" - WHITESPACE@[711; 712) " " - R_CURLY@[712; 713) "}" - SEMICOLON@[713; 714) ";" - WHITESPACE@[714; 719) "\n " - R_CURLY@[719; 720) "}" - WHITESPACE@[720; 725) "\n " - LET_STMT@[725; 751) - LET_KW@[725; 728) "let" - WHITESPACE@[728; 729) " " - BIND_PAT@[729; 730) - NAME@[729; 730) - IDENT@[729; 730) "i" - WHITESPACE@[730; 731) " " - EQ@[731; 732) "=" - WHITESPACE@[732; 733) " " - REF_EXPR@[733; 750) - AMP@[733; 734) "&" - CALL_EXPR@[734; 750) - PATH_EXPR@[734; 743) - PATH@[734; 743) - PATH@[734; 738) - PATH_SEGMENT@[734; 738) - NAME_REF@[734; 738) - IDENT@[734; 738) "Cell" - COLON2@[738; 740) "::" - PATH_SEGMENT@[740; 743) - NAME_REF@[740; 743) - IDENT@[740; 743) "new" - ARG_LIST@[743; 750) - L_PAREN@[743; 744) "(" - LITERAL@[744; 749) - FALSE_KW@[744; 749) "false" - R_PAREN@[749; 750) ")" - SEMICOLON@[750; 751) ";" - WHITESPACE@[751; 756) "\n " - LET_STMT@[756; 778) - LET_KW@[756; 759) "let" - WHITESPACE@[759; 760) " " - BIND_PAT@[760; 764) - NAME@[760; 764) - IDENT@[760; 764) "dont" - WHITESPACE@[764; 765) " " - EQ@[765; 766) "=" - WHITESPACE@[766; 767) " " - BLOCK_EXPR@[767; 777) - BLOCK@[767; 777) - L_CURLY@[767; 768) "{" - LAMBDA_EXPR@[768; 776) - PARAM_LIST@[768; 770) - PIPE@[768; 769) "|" - PIPE@[769; 770) "|" - CALL_EXPR@[770; 776) - PATH_EXPR@[770; 773) - PATH@[770; 773) - PATH_SEGMENT@[770; 773) - NAME_REF@[770; 773) - IDENT@[770; 773) "the" - ARG_LIST@[773; 776) - L_PAREN@[773; 774) "(" - PATH_EXPR@[774; 775) - PATH@[774; 775) - PATH_SEGMENT@[774; 775) - NAME_REF@[774; 775) - IDENT@[774; 775) "i" - R_PAREN@[775; 776) ")" - R_CURLY@[776; 777) "}" - SEMICOLON@[777; 778) ";" - WHITESPACE@[778; 783) "\n " - EXPR_STMT@[783; 790) - CALL_EXPR@[783; 789) - PATH_EXPR@[783; 787) - PATH@[783; 787) - PATH_SEGMENT@[783; 787) - NAME_REF@[783; 787) - IDENT@[783; 787) "dont" - ARG_LIST@[787; 789) - L_PAREN@[787; 788) "(" - R_PAREN@[788; 789) ")" - SEMICOLON@[789; 790) ";" - WHITESPACE@[790; 795) "\n " - EXPR_STMT@[795; 814) - MACRO_CALL@[795; 813) - PATH@[795; 801) - PATH_SEGMENT@[795; 801) - NAME_REF@[795; 801) - IDENT@[795; 801) "assert" - BANG@[801; 802) "!" - TOKEN_TREE@[802; 813) - L_PAREN@[802; 803) "(" - TOKEN_TREE@[803; 812) - L_PAREN@[803; 804) "(" - IDENT@[804; 805) "i" - DOT@[805; 806) "." - IDENT@[806; 809) "get" - TOKEN_TREE@[809; 811) - L_PAREN@[809; 810) "(" - R_PAREN@[810; 811) ")" - R_PAREN@[811; 812) ")" - R_PAREN@[812; 813) ")" - SEMICOLON@[813; 814) ";" - WHITESPACE@[814; 815) "\n" - R_CURLY@[815; 816) "}" - WHITESPACE@[816; 818) "\n\n" - FN_DEF@[818; 1322) - FN_KW@[818; 820) "fn" - WHITESPACE@[820; 821) " " - NAME@[821; 832) - IDENT@[821; 832) "zombiejesus" - PARAM_LIST@[832; 834) - L_PAREN@[832; 833) "(" - R_PAREN@[833; 834) ")" - WHITESPACE@[834; 835) " " - BLOCK_EXPR@[835; 1322) - BLOCK@[835; 1322) - L_CURLY@[835; 836) "{" - WHITESPACE@[836; 841) "\n " - LOOP_EXPR@[841; 1320) - LOOP_KW@[841; 845) "loop" - WHITESPACE@[845; 846) " " - BLOCK_EXPR@[846; 1320) - BLOCK@[846; 1320) - L_CURLY@[846; 847) "{" - WHITESPACE@[847; 856) "\n " - EXPR_STMT@[856; 1283) - WHILE_EXPR@[856; 1283) - WHILE_KW@[856; 861) "while" - WHITESPACE@[861; 862) " " - CONDITION@[862; 870) - PAREN_EXPR@[862; 870) - L_PAREN@[862; 863) "(" - RETURN_EXPR@[863; 869) - RETURN_KW@[863; 869) "return" - R_PAREN@[869; 870) ")" - WHITESPACE@[870; 871) " " - BLOCK_EXPR@[871; 1283) - BLOCK@[871; 1283) - L_CURLY@[871; 872) "{" - WHITESPACE@[872; 885) "\n " - IF_EXPR@[885; 1273) - IF_KW@[885; 887) "if" - WHITESPACE@[887; 888) " " - CONDITION@[888; 896) - PAREN_EXPR@[888; 896) - L_PAREN@[888; 889) "(" - RETURN_EXPR@[889; 895) - RETURN_KW@[889; 895) "return" - R_PAREN@[895; 896) ")" - WHITESPACE@[896; 897) " " - BLOCK_EXPR@[897; 1216) - BLOCK@[897; 1216) - L_CURLY@[897; 898) "{" - WHITESPACE@[898; 915) "\n " - EXPR_STMT@[915; 1202) - MATCH_EXPR@[915; 1201) - MATCH_KW@[915; 920) "match" - WHITESPACE@[920; 921) " " - PAREN_EXPR@[921; 929) - L_PAREN@[921; 922) "(" - RETURN_EXPR@[922; 928) - RETURN_KW@[922; 928) "return" - R_PAREN@[928; 929) ")" - WHITESPACE@[929; 930) " " - MATCH_ARM_LIST@[930; 1201) - L_CURLY@[930; 931) "{" - WHITESPACE@[931; 952) "\n " - MATCH_ARM@[952; 1147) - LITERAL_PAT@[952; 953) - LITERAL@[952; 953) - INT_NUMBER@[952; 953) "1" - WHITESPACE@[953; 954) " " - FAT_ARROW@[954; 956) "=>" - WHITESPACE@[956; 957) " " - BLOCK_EXPR@[957; 1147) - BLOCK@[957; 1147) - L_CURLY@[957; 958) "{" - WHITESPACE@[958; 983) "\n ..." - IF_EXPR@[983; 1125) - IF_KW@[983; 985) "if" - WHITESPACE@[985; 986) " " - CONDITION@[986; 994) - PAREN_EXPR@[986; 994) - L_PAREN@[986; 987) "(" - RETURN_EXPR@[987; 993) - RETURN_KW@[987; 993) "return" - R_PAREN@[993; 994) ")" - WHITESPACE@[994; 995) " " - BLOCK_EXPR@[995; 1057) - BLOCK@[995; 1057) - L_CURLY@[995; 996) "{" - WHITESPACE@[996; 1025) "\n ..." - RETURN_EXPR@[1025; 1031) - RETURN_KW@[1025; 1031) "return" - WHITESPACE@[1031; 1056) "\n ..." - R_CURLY@[1056; 1057) "}" - WHITESPACE@[1057; 1058) " " - ELSE_KW@[1058; 1062) "else" - WHITESPACE@[1062; 1063) " " - BLOCK_EXPR@[1063; 1125) - BLOCK@[1063; 1125) - L_CURLY@[1063; 1064) "{" - WHITESPACE@[1064; 1093) "\n ..." - RETURN_EXPR@[1093; 1099) - RETURN_KW@[1093; 1099) "return" - WHITESPACE@[1099; 1124) "\n ..." - R_CURLY@[1124; 1125) "}" - WHITESPACE@[1125; 1146) "\n " - R_CURLY@[1146; 1147) "}" - WHITESPACE@[1147; 1168) "\n " - MATCH_ARM@[1168; 1183) - PLACEHOLDER_PAT@[1168; 1169) - UNDERSCORE@[1168; 1169) "_" - WHITESPACE@[1169; 1170) " " - FAT_ARROW@[1170; 1172) "=>" - WHITESPACE@[1172; 1173) " " - BLOCK_EXPR@[1173; 1183) - BLOCK@[1173; 1183) - L_CURLY@[1173; 1174) "{" - WHITESPACE@[1174; 1175) " " - RETURN_EXPR@[1175; 1181) - RETURN_KW@[1175; 1181) "return" - WHITESPACE@[1181; 1182) " " - R_CURLY@[1182; 1183) "}" - WHITESPACE@[1183; 1200) "\n " - R_CURLY@[1200; 1201) "}" - SEMICOLON@[1201; 1202) ";" - WHITESPACE@[1202; 1215) "\n " - R_CURLY@[1215; 1216) "}" - WHITESPACE@[1216; 1217) " " - ELSE_KW@[1217; 1221) "else" - WHITESPACE@[1221; 1222) " " - IF_EXPR@[1222; 1273) - IF_KW@[1222; 1224) "if" - WHITESPACE@[1224; 1225) " " - CONDITION@[1225; 1233) - PAREN_EXPR@[1225; 1233) - L_PAREN@[1225; 1226) "(" - RETURN_EXPR@[1226; 1232) - RETURN_KW@[1226; 1232) "return" - R_PAREN@[1232; 1233) ")" - WHITESPACE@[1233; 1234) " " - BLOCK_EXPR@[1234; 1273) - BLOCK@[1234; 1273) - L_CURLY@[1234; 1235) "{" - WHITESPACE@[1235; 1252) "\n " - EXPR_STMT@[1252; 1259) - RETURN_EXPR@[1252; 1258) - RETURN_KW@[1252; 1258) "return" - SEMICOLON@[1258; 1259) ";" - WHITESPACE@[1259; 1272) "\n " - R_CURLY@[1272; 1273) "}" - WHITESPACE@[1273; 1282) "\n " - R_CURLY@[1282; 1283) "}" - WHITESPACE@[1283; 1292) "\n " - IF_EXPR@[1292; 1314) - IF_KW@[1292; 1294) "if" - WHITESPACE@[1294; 1295) " " - CONDITION@[1295; 1303) - PAREN_EXPR@[1295; 1303) - L_PAREN@[1295; 1296) "(" - RETURN_EXPR@[1296; 1302) - RETURN_KW@[1296; 1302) "return" - R_PAREN@[1302; 1303) ")" - WHITESPACE@[1303; 1304) " " - BLOCK_EXPR@[1304; 1314) - BLOCK@[1304; 1314) - L_CURLY@[1304; 1305) "{" - WHITESPACE@[1305; 1306) " " - EXPR_STMT@[1306; 1312) - BREAK_EXPR@[1306; 1311) - BREAK_KW@[1306; 1311) "break" - SEMICOLON@[1311; 1312) ";" - WHITESPACE@[1312; 1313) " " - R_CURLY@[1313; 1314) "}" - WHITESPACE@[1314; 1319) "\n " - R_CURLY@[1319; 1320) "}" - WHITESPACE@[1320; 1321) "\n" - R_CURLY@[1321; 1322) "}" - WHITESPACE@[1322; 1324) "\n\n" - FN_DEF@[1324; 1539) - FN_KW@[1324; 1326) "fn" - WHITESPACE@[1326; 1327) " " - NAME@[1327; 1334) - IDENT@[1327; 1334) "notsure" - PARAM_LIST@[1334; 1336) - L_PAREN@[1334; 1335) "(" - R_PAREN@[1335; 1336) ")" - WHITESPACE@[1336; 1337) " " - BLOCK_EXPR@[1337; 1539) - BLOCK@[1337; 1539) - L_CURLY@[1337; 1338) "{" - WHITESPACE@[1338; 1343) "\n " - LET_STMT@[1343; 1361) - LET_KW@[1343; 1346) "let" - WHITESPACE@[1346; 1347) " " - BIND_PAT@[1347; 1353) - MUT_KW@[1347; 1350) "mut" - WHITESPACE@[1350; 1351) " " - NAME@[1351; 1353) - IDENT@[1351; 1353) "_x" - COLON@[1353; 1354) ":" - WHITESPACE@[1354; 1355) " " - PATH_TYPE@[1355; 1360) - PATH@[1355; 1360) - PATH_SEGMENT@[1355; 1360) - NAME_REF@[1355; 1360) - IDENT@[1355; 1360) "isize" - SEMICOLON@[1360; 1361) ";" - WHITESPACE@[1361; 1366) "\n " - LET_STMT@[1366; 1400) - LET_KW@[1366; 1369) "let" - WHITESPACE@[1369; 1370) " " - BIND_PAT@[1370; 1376) - MUT_KW@[1370; 1373) "mut" - WHITESPACE@[1373; 1374) " " - NAME@[1374; 1376) - IDENT@[1374; 1376) "_y" - WHITESPACE@[1376; 1377) " " - EQ@[1377; 1378) "=" - WHITESPACE@[1378; 1379) " " - BIN_EXPR@[1379; 1399) - PAREN_EXPR@[1379; 1387) - L_PAREN@[1379; 1380) "(" - BIN_EXPR@[1380; 1386) - PATH_EXPR@[1380; 1382) - PATH@[1380; 1382) - PATH_SEGMENT@[1380; 1382) - NAME_REF@[1380; 1382) - IDENT@[1380; 1382) "_x" - WHITESPACE@[1382; 1383) " " - EQ@[1383; 1384) "=" - WHITESPACE@[1384; 1385) " " - LITERAL@[1385; 1386) - INT_NUMBER@[1385; 1386) "0" - R_PAREN@[1386; 1387) ")" - WHITESPACE@[1387; 1388) " " - EQ2@[1388; 1390) "==" - WHITESPACE@[1390; 1391) " " - PAREN_EXPR@[1391; 1399) - L_PAREN@[1391; 1392) "(" - BIN_EXPR@[1392; 1398) - PATH_EXPR@[1392; 1394) - PATH@[1392; 1394) - PATH_SEGMENT@[1392; 1394) - NAME_REF@[1392; 1394) - IDENT@[1392; 1394) "_x" - WHITESPACE@[1394; 1395) " " - EQ@[1395; 1396) "=" - WHITESPACE@[1396; 1397) " " - LITERAL@[1397; 1398) - INT_NUMBER@[1397; 1398) "0" - R_PAREN@[1398; 1399) ")" - SEMICOLON@[1399; 1400) ";" - WHITESPACE@[1400; 1405) "\n " - LET_STMT@[1405; 1438) - LET_KW@[1405; 1408) "let" - WHITESPACE@[1408; 1409) " " - BIND_PAT@[1409; 1415) - MUT_KW@[1409; 1412) "mut" - WHITESPACE@[1412; 1413) " " - NAME@[1413; 1415) - IDENT@[1413; 1415) "_z" - WHITESPACE@[1415; 1416) " " - EQ@[1416; 1417) "=" - WHITESPACE@[1417; 1418) " " - BIN_EXPR@[1418; 1437) - PAREN_EXPR@[1418; 1426) - L_PAREN@[1418; 1419) "(" - BIN_EXPR@[1419; 1425) - PATH_EXPR@[1419; 1421) - PATH@[1419; 1421) - PATH_SEGMENT@[1419; 1421) - NAME_REF@[1419; 1421) - IDENT@[1419; 1421) "_x" - WHITESPACE@[1421; 1422) " " - EQ@[1422; 1423) "=" - WHITESPACE@[1423; 1424) " " - LITERAL@[1424; 1425) - INT_NUMBER@[1424; 1425) "0" - R_PAREN@[1425; 1426) ")" - WHITESPACE@[1426; 1427) " " - L_ANGLE@[1427; 1428) "<" - WHITESPACE@[1428; 1429) " " - PAREN_EXPR@[1429; 1437) - L_PAREN@[1429; 1430) "(" - BIN_EXPR@[1430; 1436) - PATH_EXPR@[1430; 1432) - PATH@[1430; 1432) - PATH_SEGMENT@[1430; 1432) - NAME_REF@[1430; 1432) - IDENT@[1430; 1432) "_x" - WHITESPACE@[1432; 1433) " " - EQ@[1433; 1434) "=" - WHITESPACE@[1434; 1435) " " - LITERAL@[1435; 1436) - INT_NUMBER@[1435; 1436) "0" - R_PAREN@[1436; 1437) ")" - SEMICOLON@[1437; 1438) ";" - WHITESPACE@[1438; 1443) "\n " - LET_STMT@[1443; 1474) - LET_KW@[1443; 1446) "let" - WHITESPACE@[1446; 1447) " " - BIND_PAT@[1447; 1449) - NAME@[1447; 1449) - IDENT@[1447; 1449) "_a" - WHITESPACE@[1449; 1450) " " - EQ@[1450; 1451) "=" - WHITESPACE@[1451; 1452) " " - BIN_EXPR@[1452; 1473) - PAREN_EXPR@[1452; 1461) - L_PAREN@[1452; 1453) "(" - BIN_EXPR@[1453; 1460) - PATH_EXPR@[1453; 1455) - PATH@[1453; 1455) - PATH_SEGMENT@[1453; 1455) - NAME_REF@[1453; 1455) - IDENT@[1453; 1455) "_x" - WHITESPACE@[1455; 1456) " " - PLUSEQ@[1456; 1458) "+=" - WHITESPACE@[1458; 1459) " " - LITERAL@[1459; 1460) - INT_NUMBER@[1459; 1460) "0" - R_PAREN@[1460; 1461) ")" - WHITESPACE@[1461; 1462) " " - EQ2@[1462; 1464) "==" - WHITESPACE@[1464; 1465) " " - PAREN_EXPR@[1465; 1473) - L_PAREN@[1465; 1466) "(" - BIN_EXPR@[1466; 1472) - PATH_EXPR@[1466; 1468) - PATH@[1466; 1468) - PATH_SEGMENT@[1466; 1468) - NAME_REF@[1466; 1468) - IDENT@[1466; 1468) "_x" - WHITESPACE@[1468; 1469) " " - EQ@[1469; 1470) "=" - WHITESPACE@[1470; 1471) " " - LITERAL@[1471; 1472) - INT_NUMBER@[1471; 1472) "0" - R_PAREN@[1472; 1473) ")" - SEMICOLON@[1473; 1474) ";" - WHITESPACE@[1474; 1479) "\n " - LET_STMT@[1479; 1537) - LET_KW@[1479; 1482) "let" - WHITESPACE@[1482; 1483) " " - BIND_PAT@[1483; 1485) - NAME@[1483; 1485) - IDENT@[1483; 1485) "_b" - WHITESPACE@[1485; 1486) " " - EQ@[1486; 1487) "=" - WHITESPACE@[1487; 1488) " " - BIN_EXPR@[1488; 1536) - CALL_EXPR@[1488; 1510) - PATH_EXPR@[1488; 1492) - PATH@[1488; 1492) - PATH_SEGMENT@[1488; 1492) - NAME_REF@[1488; 1492) - IDENT@[1488; 1492) "swap" - ARG_LIST@[1492; 1510) - L_PAREN@[1492; 1493) "(" - REF_EXPR@[1493; 1500) - AMP@[1493; 1494) "&" - MUT_KW@[1494; 1497) "mut" - WHITESPACE@[1497; 1498) " " - PATH_EXPR@[1498; 1500) - PATH@[1498; 1500) - PATH_SEGMENT@[1498; 1500) - NAME_REF@[1498; 1500) - IDENT@[1498; 1500) "_y" - COMMA@[1500; 1501) "," - WHITESPACE@[1501; 1502) " " - REF_EXPR@[1502; 1509) - AMP@[1502; 1503) "&" - MUT_KW@[1503; 1506) "mut" - WHITESPACE@[1506; 1507) " " - PATH_EXPR@[1507; 1509) - PATH@[1507; 1509) - PATH_SEGMENT@[1507; 1509) - NAME_REF@[1507; 1509) - IDENT@[1507; 1509) "_z" - R_PAREN@[1509; 1510) ")" - WHITESPACE@[1510; 1511) " " - EQ2@[1511; 1513) "==" - WHITESPACE@[1513; 1514) " " - CALL_EXPR@[1514; 1536) - PATH_EXPR@[1514; 1518) - PATH@[1514; 1518) - PATH_SEGMENT@[1514; 1518) - NAME_REF@[1514; 1518) - IDENT@[1514; 1518) "swap" - ARG_LIST@[1518; 1536) - L_PAREN@[1518; 1519) "(" - REF_EXPR@[1519; 1526) - AMP@[1519; 1520) "&" - MUT_KW@[1520; 1523) "mut" - WHITESPACE@[1523; 1524) " " - PATH_EXPR@[1524; 1526) - PATH@[1524; 1526) - PATH_SEGMENT@[1524; 1526) - NAME_REF@[1524; 1526) - IDENT@[1524; 1526) "_y" - COMMA@[1526; 1527) "," - WHITESPACE@[1527; 1528) " " - REF_EXPR@[1528; 1535) - AMP@[1528; 1529) "&" - MUT_KW@[1529; 1532) "mut" - WHITESPACE@[1532; 1533) " " - PATH_EXPR@[1533; 1535) - PATH@[1533; 1535) - PATH_SEGMENT@[1533; 1535) - NAME_REF@[1533; 1535) - IDENT@[1533; 1535) "_z" - R_PAREN@[1535; 1536) ")" - SEMICOLON@[1536; 1537) ";" - WHITESPACE@[1537; 1538) "\n" - R_CURLY@[1538; 1539) "}" - WHITESPACE@[1539; 1541) "\n\n" - FN_DEF@[1541; 1741) - FN_KW@[1541; 1543) "fn" - WHITESPACE@[1543; 1544) " " - NAME@[1544; 1557) - IDENT@[1544; 1557) "canttouchthis" - PARAM_LIST@[1557; 1559) - L_PAREN@[1557; 1558) "(" - R_PAREN@[1558; 1559) ")" - WHITESPACE@[1559; 1560) " " - RET_TYPE@[1560; 1568) - THIN_ARROW@[1560; 1562) "->" - WHITESPACE@[1562; 1563) " " - PATH_TYPE@[1563; 1568) - PATH@[1563; 1568) - PATH_SEGMENT@[1563; 1568) - NAME_REF@[1563; 1568) - IDENT@[1563; 1568) "usize" - WHITESPACE@[1568; 1569) " " - BLOCK_EXPR@[1569; 1741) - BLOCK@[1569; 1741) - L_CURLY@[1569; 1570) "{" - WHITESPACE@[1570; 1575) "\n " - FN_DEF@[1575; 1598) - FN_KW@[1575; 1577) "fn" - WHITESPACE@[1577; 1578) " " - NAME@[1578; 1579) - IDENT@[1578; 1579) "p" - PARAM_LIST@[1579; 1581) - L_PAREN@[1579; 1580) "(" - R_PAREN@[1580; 1581) ")" - WHITESPACE@[1581; 1582) " " - RET_TYPE@[1582; 1589) - THIN_ARROW@[1582; 1584) "->" - WHITESPACE@[1584; 1585) " " - PATH_TYPE@[1585; 1589) - PATH@[1585; 1589) - PATH_SEGMENT@[1585; 1589) - NAME_REF@[1585; 1589) - IDENT@[1585; 1589) "bool" - WHITESPACE@[1589; 1590) " " - BLOCK_EXPR@[1590; 1598) - BLOCK@[1590; 1598) - L_CURLY@[1590; 1591) "{" - WHITESPACE@[1591; 1592) " " - LITERAL@[1592; 1596) - TRUE_KW@[1592; 1596) "true" - WHITESPACE@[1596; 1597) " " - R_CURLY@[1597; 1598) "}" - WHITESPACE@[1598; 1603) "\n " - LET_STMT@[1603; 1648) - LET_KW@[1603; 1606) "let" - WHITESPACE@[1606; 1607) " " - BIND_PAT@[1607; 1609) - NAME@[1607; 1609) - IDENT@[1607; 1609) "_a" - WHITESPACE@[1609; 1610) " " - EQ@[1610; 1611) "=" - WHITESPACE@[1611; 1612) " " - PAREN_EXPR@[1612; 1647) - L_PAREN@[1612; 1613) "(" - BIN_EXPR@[1613; 1646) - MACRO_CALL@[1613; 1628) - PATH@[1613; 1619) - PATH_SEGMENT@[1613; 1619) - NAME_REF@[1613; 1619) - IDENT@[1613; 1619) "assert" - BANG@[1619; 1620) "!" - TOKEN_TREE@[1620; 1628) - L_PAREN@[1620; 1621) "(" - TOKEN_TREE@[1621; 1627) - L_PAREN@[1621; 1622) "(" - TRUE_KW@[1622; 1626) "true" - R_PAREN@[1626; 1627) ")" - R_PAREN@[1627; 1628) ")" - WHITESPACE@[1628; 1629) " " - EQ2@[1629; 1631) "==" - WHITESPACE@[1631; 1632) " " - PAREN_EXPR@[1632; 1646) - L_PAREN@[1632; 1633) "(" - MACRO_CALL@[1633; 1645) - PATH@[1633; 1639) - PATH_SEGMENT@[1633; 1639) - NAME_REF@[1633; 1639) - IDENT@[1633; 1639) "assert" - BANG@[1639; 1640) "!" - TOKEN_TREE@[1640; 1645) - L_PAREN@[1640; 1641) "(" - IDENT@[1641; 1642) "p" - TOKEN_TREE@[1642; 1644) - L_PAREN@[1642; 1643) "(" - R_PAREN@[1643; 1644) ")" - R_PAREN@[1644; 1645) ")" - R_PAREN@[1645; 1646) ")" - R_PAREN@[1646; 1647) ")" - SEMICOLON@[1647; 1648) ";" - WHITESPACE@[1648; 1653) "\n " - LET_STMT@[1653; 1685) - LET_KW@[1653; 1656) "let" - WHITESPACE@[1656; 1657) " " - BIND_PAT@[1657; 1659) - NAME@[1657; 1659) - IDENT@[1657; 1659) "_c" - WHITESPACE@[1659; 1660) " " - EQ@[1660; 1661) "=" - WHITESPACE@[1661; 1662) " " - PAREN_EXPR@[1662; 1684) - L_PAREN@[1662; 1663) "(" - BIN_EXPR@[1663; 1683) - MACRO_CALL@[1663; 1677) - PATH@[1663; 1669) - PATH_SEGMENT@[1663; 1669) - NAME_REF@[1663; 1669) - IDENT@[1663; 1669) "assert" - BANG@[1669; 1670) "!" - TOKEN_TREE@[1670; 1677) - L_PAREN@[1670; 1671) "(" - TOKEN_TREE@[1671; 1676) - L_PAREN@[1671; 1672) "(" - IDENT@[1672; 1673) "p" - TOKEN_TREE@[1673; 1675) - L_PAREN@[1673; 1674) "(" - R_PAREN@[1674; 1675) ")" - R_PAREN@[1675; 1676) ")" - R_PAREN@[1676; 1677) ")" - WHITESPACE@[1677; 1678) " " - EQ2@[1678; 1680) "==" - WHITESPACE@[1680; 1681) " " - TUPLE_EXPR@[1681; 1683) - L_PAREN@[1681; 1682) "(" - R_PAREN@[1682; 1683) ")" - R_PAREN@[1683; 1684) ")" - SEMICOLON@[1684; 1685) ";" - WHITESPACE@[1685; 1690) "\n " - LET_STMT@[1690; 1739) - LET_KW@[1690; 1693) "let" - WHITESPACE@[1693; 1694) " " - BIND_PAT@[1694; 1696) - NAME@[1694; 1696) - IDENT@[1694; 1696) "_b" - COLON@[1696; 1697) ":" - WHITESPACE@[1697; 1698) " " - PATH_TYPE@[1698; 1702) - PATH@[1698; 1702) - PATH_SEGMENT@[1698; 1702) - NAME_REF@[1698; 1702) - IDENT@[1698; 1702) "bool" - WHITESPACE@[1702; 1703) " " - EQ@[1703; 1704) "=" - WHITESPACE@[1704; 1705) " " - PAREN_EXPR@[1705; 1738) - L_PAREN@[1705; 1706) "(" - BIN_EXPR@[1706; 1737) - MACRO_CALL@[1706; 1723) - PATH@[1706; 1713) - PATH_SEGMENT@[1706; 1713) - NAME_REF@[1706; 1713) - IDENT@[1706; 1713) "println" - BANG@[1713; 1714) "!" - TOKEN_TREE@[1714; 1723) - L_PAREN@[1714; 1715) "(" - STRING@[1715; 1719) "\"{}\"" - COMMA@[1719; 1720) "," - WHITESPACE@[1720; 1721) " " - INT_NUMBER@[1721; 1722) "0" - R_PAREN@[1722; 1723) ")" - WHITESPACE@[1723; 1724) " " - EQ2@[1724; 1726) "==" - WHITESPACE@[1726; 1727) " " - PAREN_EXPR@[1727; 1737) - L_PAREN@[1727; 1728) "(" - RETURN_EXPR@[1728; 1736) - RETURN_KW@[1728; 1734) "return" - WHITESPACE@[1734; 1735) " " - LITERAL@[1735; 1736) - INT_NUMBER@[1735; 1736) "0" - R_PAREN@[1736; 1737) ")" - R_PAREN@[1737; 1738) ")" - SEMICOLON@[1738; 1739) ";" - WHITESPACE@[1739; 1740) "\n" - R_CURLY@[1740; 1741) "}" - WHITESPACE@[1741; 1743) "\n\n" - FN_DEF@[1743; 1904) - FN_KW@[1743; 1745) "fn" - WHITESPACE@[1745; 1746) " " - NAME@[1746; 1755) - IDENT@[1746; 1755) "angrydome" - PARAM_LIST@[1755; 1757) - L_PAREN@[1755; 1756) "(" - R_PAREN@[1756; 1757) ")" - WHITESPACE@[1757; 1758) " " - BLOCK_EXPR@[1758; 1904) - BLOCK@[1758; 1904) - L_CURLY@[1758; 1759) "{" - WHITESPACE@[1759; 1764) "\n " - EXPR_STMT@[1764; 1785) - LOOP_EXPR@[1764; 1785) - LOOP_KW@[1764; 1768) "loop" - WHITESPACE@[1768; 1769) " " - BLOCK_EXPR@[1769; 1785) - BLOCK@[1769; 1785) - L_CURLY@[1769; 1770) "{" - WHITESPACE@[1770; 1771) " " - IF_EXPR@[1771; 1783) - IF_KW@[1771; 1773) "if" - WHITESPACE@[1773; 1774) " " - CONDITION@[1774; 1779) - BREAK_EXPR@[1774; 1779) - BREAK_KW@[1774; 1779) "break" - WHITESPACE@[1779; 1780) " " - BLOCK_EXPR@[1780; 1783) - BLOCK@[1780; 1783) - L_CURLY@[1780; 1781) "{" - WHITESPACE@[1781; 1782) " " - R_CURLY@[1782; 1783) "}" - WHITESPACE@[1783; 1784) " " - R_CURLY@[1784; 1785) "}" - WHITESPACE@[1785; 1790) "\n " - LET_STMT@[1790; 1804) - LET_KW@[1790; 1793) "let" - WHITESPACE@[1793; 1794) " " - BIND_PAT@[1794; 1799) - MUT_KW@[1794; 1797) "mut" - WHITESPACE@[1797; 1798) " " - NAME@[1798; 1799) - IDENT@[1798; 1799) "i" - WHITESPACE@[1799; 1800) " " - EQ@[1800; 1801) "=" - WHITESPACE@[1801; 1802) " " - LITERAL@[1802; 1803) - INT_NUMBER@[1802; 1803) "0" - SEMICOLON@[1803; 1804) ";" - WHITESPACE@[1804; 1809) "\n " - LOOP_EXPR@[1809; 1902) - LOOP_KW@[1809; 1813) "loop" - WHITESPACE@[1813; 1814) " " - BLOCK_EXPR@[1814; 1902) - BLOCK@[1814; 1902) - L_CURLY@[1814; 1815) "{" - WHITESPACE@[1815; 1816) " " - EXPR_STMT@[1816; 1823) - BIN_EXPR@[1816; 1822) - PATH_EXPR@[1816; 1817) - PATH@[1816; 1817) - PATH_SEGMENT@[1816; 1817) - NAME_REF@[1816; 1817) - IDENT@[1816; 1817) "i" - WHITESPACE@[1817; 1818) " " - PLUSEQ@[1818; 1820) "+=" - WHITESPACE@[1820; 1821) " " - LITERAL@[1821; 1822) - INT_NUMBER@[1821; 1822) "1" - SEMICOLON@[1822; 1823) ";" - WHITESPACE@[1823; 1824) " " - EXPR_STMT@[1824; 1887) - IF_EXPR@[1824; 1887) - IF_KW@[1824; 1826) "if" - WHITESPACE@[1826; 1827) " " - CONDITION@[1827; 1833) - BIN_EXPR@[1827; 1833) - PATH_EXPR@[1827; 1828) - PATH@[1827; 1828) - PATH_SEGMENT@[1827; 1828) - NAME_REF@[1827; 1828) - IDENT@[1827; 1828) "i" - WHITESPACE@[1828; 1829) " " - EQ2@[1829; 1831) "==" - WHITESPACE@[1831; 1832) " " - LITERAL@[1832; 1833) - INT_NUMBER@[1832; 1833) "1" - WHITESPACE@[1833; 1834) " " - BLOCK_EXPR@[1834; 1887) - BLOCK@[1834; 1887) - L_CURLY@[1834; 1835) "{" - WHITESPACE@[1835; 1836) " " - MATCH_EXPR@[1836; 1885) - MATCH_KW@[1836; 1841) "match" - WHITESPACE@[1841; 1842) " " - PAREN_EXPR@[1842; 1852) - L_PAREN@[1842; 1843) "(" - CONTINUE_EXPR@[1843; 1851) - CONTINUE_KW@[1843; 1851) "continue" - R_PAREN@[1851; 1852) ")" - WHITESPACE@[1852; 1853) " " - MATCH_ARM_LIST@[1853; 1885) - L_CURLY@[1853; 1854) "{" - WHITESPACE@[1854; 1855) " " - MATCH_ARM@[1855; 1863) - LITERAL_PAT@[1855; 1856) - LITERAL@[1855; 1856) - INT_NUMBER@[1855; 1856) "1" - WHITESPACE@[1856; 1857) " " - FAT_ARROW@[1857; 1859) "=>" - WHITESPACE@[1859; 1860) " " - BLOCK_EXPR@[1860; 1863) - BLOCK@[1860; 1863) - L_CURLY@[1860; 1861) "{" - WHITESPACE@[1861; 1862) " " - R_CURLY@[1862; 1863) "}" - COMMA@[1863; 1864) "," - WHITESPACE@[1864; 1865) " " - MATCH_ARM@[1865; 1883) - PLACEHOLDER_PAT@[1865; 1866) - UNDERSCORE@[1865; 1866) "_" - WHITESPACE@[1866; 1867) " " - FAT_ARROW@[1867; 1869) "=>" - WHITESPACE@[1869; 1870) " " - MACRO_CALL@[1870; 1883) - PATH@[1870; 1875) - PATH_SEGMENT@[1870; 1875) - NAME_REF@[1870; 1875) - IDENT@[1870; 1875) "panic" - BANG@[1875; 1876) "!" - TOKEN_TREE@[1876; 1883) - L_PAREN@[1876; 1877) "(" - STRING@[1877; 1882) "\"wat\"" - R_PAREN@[1882; 1883) ")" - WHITESPACE@[1883; 1884) " " - R_CURLY@[1884; 1885) "}" - WHITESPACE@[1885; 1886) " " - R_CURLY@[1886; 1887) "}" - WHITESPACE@[1887; 1894) "\n " - EXPR_STMT@[1894; 1900) - BREAK_EXPR@[1894; 1899) - BREAK_KW@[1894; 1899) "break" - SEMICOLON@[1899; 1900) ";" - WHITESPACE@[1900; 1901) " " - R_CURLY@[1901; 1902) "}" - WHITESPACE@[1902; 1903) "\n" - R_CURLY@[1903; 1904) "}" - WHITESPACE@[1904; 1906) "\n\n" - FN_DEF@[1906; 1960) - FN_KW@[1906; 1908) "fn" - WHITESPACE@[1908; 1909) " " - NAME@[1909; 1921) - IDENT@[1909; 1921) "evil_lincoln" - PARAM_LIST@[1921; 1923) - L_PAREN@[1921; 1922) "(" - R_PAREN@[1922; 1923) ")" - WHITESPACE@[1923; 1924) " " - BLOCK_EXPR@[1924; 1960) - BLOCK@[1924; 1960) - L_CURLY@[1924; 1925) "{" - WHITESPACE@[1925; 1926) " " - LET_STMT@[1926; 1958) - LET_KW@[1926; 1929) "let" - WHITESPACE@[1929; 1930) " " - BIND_PAT@[1930; 1935) - NAME@[1930; 1935) - IDENT@[1930; 1935) "_evil" - WHITESPACE@[1935; 1936) " " - EQ@[1936; 1937) "=" - WHITESPACE@[1937; 1938) " " - MACRO_CALL@[1938; 1957) - PATH@[1938; 1945) - PATH_SEGMENT@[1938; 1945) - NAME_REF@[1938; 1945) - IDENT@[1938; 1945) "println" - BANG@[1945; 1946) "!" - TOKEN_TREE@[1946; 1957) - L_PAREN@[1946; 1947) "(" - STRING@[1947; 1956) "\"lincoln\"" - R_PAREN@[1956; 1957) ")" - SEMICOLON@[1957; 1958) ";" - WHITESPACE@[1958; 1959) " " - R_CURLY@[1959; 1960) "}" - WHITESPACE@[1960; 1962) "\n\n" - FN_DEF@[1962; 2198) - FN_KW@[1962; 1964) "fn" - WHITESPACE@[1964; 1965) " " - NAME@[1965; 1969) - IDENT@[1965; 1969) "dots" - PARAM_LIST@[1969; 1971) - L_PAREN@[1969; 1970) "(" - R_PAREN@[1970; 1971) ")" - WHITESPACE@[1971; 1972) " " - BLOCK_EXPR@[1972; 2198) - BLOCK@[1972; 2198) - L_CURLY@[1972; 1973) "{" - WHITESPACE@[1973; 1978) "\n " - EXPR_STMT@[1978; 2196) - MACRO_CALL@[1978; 2195) - PATH@[1978; 1987) - PATH_SEGMENT@[1978; 1987) - NAME_REF@[1978; 1987) - IDENT@[1978; 1987) "assert_eq" - BANG@[1987; 1988) "!" - TOKEN_TREE@[1988; 2195) - L_PAREN@[1988; 1989) "(" - IDENT@[1989; 1995) "String" - COLON@[1995; 1996) ":" - COLON@[1996; 1997) ":" - IDENT@[1997; 2001) "from" - TOKEN_TREE@[2001; 2055) - L_PAREN@[2001; 2002) "(" - STRING@[2002; 2054) "\".................... ..." - R_PAREN@[2054; 2055) ")" - COMMA@[2055; 2056) "," - WHITESPACE@[2056; 2072) "\n " - IDENT@[2072; 2078) "format" - BANG@[2078; 2079) "!" - TOKEN_TREE@[2079; 2194) - L_PAREN@[2079; 2080) "(" - STRING@[2080; 2086) "\"{:?}\"" - COMMA@[2086; 2087) "," - WHITESPACE@[2087; 2088) " " - DOT@[2088; 2089) "." - DOT@[2089; 2090) "." - WHITESPACE@[2090; 2091) " " - DOT@[2091; 2092) "." - DOT@[2092; 2093) "." - WHITESPACE@[2093; 2094) " " - DOT@[2094; 2095) "." - DOT@[2095; 2096) "." - WHITESPACE@[2096; 2097) " " - DOT@[2097; 2098) "." - DOT@[2098; 2099) "." - WHITESPACE@[2099; 2100) " " - DOT@[2100; 2101) "." - DOT@[2101; 2102) "." - WHITESPACE@[2102; 2103) " " - DOT@[2103; 2104) "." - DOT@[2104; 2105) "." - WHITESPACE@[2105; 2106) " " - DOT@[2106; 2107) "." - DOT@[2107; 2108) "." - WHITESPACE@[2108; 2109) " " - DOT@[2109; 2110) "." - DOT@[2110; 2111) "." - WHITESPACE@[2111; 2112) " " - DOT@[2112; 2113) "." - DOT@[2113; 2114) "." - WHITESPACE@[2114; 2115) " " - DOT@[2115; 2116) "." - DOT@[2116; 2117) "." - WHITESPACE@[2117; 2118) " " - DOT@[2118; 2119) "." - DOT@[2119; 2120) "." - WHITESPACE@[2120; 2121) " " - DOT@[2121; 2122) "." - DOT@[2122; 2123) "." - WHITESPACE@[2123; 2124) " " - DOT@[2124; 2125) "." - DOT@[2125; 2126) "." - WHITESPACE@[2126; 2158) "\n ..." - DOT@[2158; 2159) "." - DOT@[2159; 2160) "." - WHITESPACE@[2160; 2161) " " - DOT@[2161; 2162) "." - DOT@[2162; 2163) "." - WHITESPACE@[2163; 2164) " " - DOT@[2164; 2165) "." - DOT@[2165; 2166) "." - WHITESPACE@[2166; 2167) " " - DOT@[2167; 2168) "." - DOT@[2168; 2169) "." - WHITESPACE@[2169; 2170) " " - DOT@[2170; 2171) "." - DOT@[2171; 2172) "." - WHITESPACE@[2172; 2173) " " - DOT@[2173; 2174) "." - DOT@[2174; 2175) "." - WHITESPACE@[2175; 2176) " " - DOT@[2176; 2177) "." - DOT@[2177; 2178) "." - WHITESPACE@[2178; 2179) " " - DOT@[2179; 2180) "." - DOT@[2180; 2181) "." - WHITESPACE@[2181; 2182) " " - DOT@[2182; 2183) "." - DOT@[2183; 2184) "." - WHITESPACE@[2184; 2185) " " - DOT@[2185; 2186) "." - DOT@[2186; 2187) "." - WHITESPACE@[2187; 2188) " " - DOT@[2188; 2189) "." - DOT@[2189; 2190) "." - WHITESPACE@[2190; 2191) " " - DOT@[2191; 2192) "." - DOT@[2192; 2193) "." - R_PAREN@[2193; 2194) ")" - R_PAREN@[2194; 2195) ")" - SEMICOLON@[2195; 2196) ";" - WHITESPACE@[2196; 2197) "\n" - R_CURLY@[2197; 2198) "}" - WHITESPACE@[2198; 2200) "\n\n" - FN_DEF@[2200; 2693) - FN_KW@[2200; 2202) "fn" - WHITESPACE@[2202; 2203) " " - NAME@[2203; 2205) - IDENT@[2203; 2205) "u8" - PARAM_LIST@[2205; 2213) - L_PAREN@[2205; 2206) "(" - PARAM@[2206; 2212) - BIND_PAT@[2206; 2208) - NAME@[2206; 2208) - IDENT@[2206; 2208) "u8" - COLON@[2208; 2209) ":" - WHITESPACE@[2209; 2210) " " - PATH_TYPE@[2210; 2212) - PATH@[2210; 2212) - PATH_SEGMENT@[2210; 2212) - NAME_REF@[2210; 2212) - IDENT@[2210; 2212) "u8" - R_PAREN@[2212; 2213) ")" - WHITESPACE@[2213; 2214) " " - BLOCK_EXPR@[2214; 2693) - BLOCK@[2214; 2693) - L_CURLY@[2214; 2215) "{" - WHITESPACE@[2215; 2220) "\n " - IF_EXPR@[2220; 2691) - IF_KW@[2220; 2222) "if" - WHITESPACE@[2222; 2223) " " - CONDITION@[2223; 2232) - BIN_EXPR@[2223; 2232) - PATH_EXPR@[2223; 2225) - PATH@[2223; 2225) - PATH_SEGMENT@[2223; 2225) - NAME_REF@[2223; 2225) - IDENT@[2223; 2225) "u8" - WHITESPACE@[2225; 2226) " " - NEQ@[2226; 2228) "!=" - WHITESPACE@[2228; 2229) " " - LITERAL@[2229; 2232) - INT_NUMBER@[2229; 2232) "0u8" - WHITESPACE@[2232; 2233) " " - BLOCK_EXPR@[2233; 2691) - BLOCK@[2233; 2691) - L_CURLY@[2233; 2234) "{" - WHITESPACE@[2234; 2243) "\n " - EXPR_STMT@[2243; 2685) - MACRO_CALL@[2243; 2684) - PATH@[2243; 2252) - PATH_SEGMENT@[2243; 2252) - NAME_REF@[2243; 2252) - IDENT@[2243; 2252) "assert_eq" - BANG@[2252; 2253) "!" - TOKEN_TREE@[2253; 2684) - L_PAREN@[2253; 2254) "(" - INT_NUMBER@[2254; 2257) "8u8" - COMMA@[2257; 2258) "," - WHITESPACE@[2258; 2259) " " - TOKEN_TREE@[2259; 2683) - L_CURLY@[2259; 2260) "{" - WHITESPACE@[2260; 2273) "\n " - IDENT@[2273; 2284) "macro_rules" - BANG@[2284; 2285) "!" - WHITESPACE@[2285; 2286) " " - IDENT@[2286; 2288) "u8" - WHITESPACE@[2288; 2289) " " - TOKEN_TREE@[2289; 2567) - L_CURLY@[2289; 2290) "{" - WHITESPACE@[2290; 2307) "\n " - TOKEN_TREE@[2307; 2311) - L_PAREN@[2307; 2308) "(" - IDENT@[2308; 2310) "u8" - R_PAREN@[2310; 2311) ")" - WHITESPACE@[2311; 2312) " " - EQ@[2312; 2313) "=" - R_ANGLE@[2313; 2314) ">" - WHITESPACE@[2314; 2315) " " - TOKEN_TREE@[2315; 2552) - L_CURLY@[2315; 2316) "{" - WHITESPACE@[2316; 2337) "\n " - MOD_KW@[2337; 2340) "mod" - WHITESPACE@[2340; 2341) " " - IDENT@[2341; 2343) "u8" - WHITESPACE@[2343; 2344) " " - TOKEN_TREE@[2344; 2534) - L_CURLY@[2344; 2345) "{" - WHITESPACE@[2345; 2370) "\n ..." - PUB_KW@[2370; 2373) "pub" - WHITESPACE@[2373; 2374) " " - FN_KW@[2374; 2376) "fn" - WHITESPACE@[2376; 2377) " " - IDENT@[2377; 2379) "u8" - L_ANGLE@[2379; 2380) "<" - LIFETIME@[2380; 2383) "\'u8" - COLON@[2383; 2384) ":" - WHITESPACE@[2384; 2385) " " - LIFETIME@[2385; 2388) "\'u8" - WHITESPACE@[2388; 2389) " " - PLUS@[2389; 2390) "+" - WHITESPACE@[2390; 2391) " " - LIFETIME@[2391; 2394) "\'u8" - R_ANGLE@[2394; 2395) ">" - TOKEN_TREE@[2395; 2408) - L_PAREN@[2395; 2396) "(" - IDENT@[2396; 2398) "u8" - COLON@[2398; 2399) ":" - WHITESPACE@[2399; 2400) " " - AMP@[2400; 2401) "&" - LIFETIME@[2401; 2404) "\'u8" - WHITESPACE@[2404; 2405) " " - IDENT@[2405; 2407) "u8" - R_PAREN@[2407; 2408) ")" - WHITESPACE@[2408; 2409) " " - MINUS@[2409; 2410) "-" - R_ANGLE@[2410; 2411) ">" - WHITESPACE@[2411; 2412) " " - AMP@[2412; 2413) "&" - LIFETIME@[2413; 2416) "\'u8" - WHITESPACE@[2416; 2417) " " - IDENT@[2417; 2419) "u8" - WHITESPACE@[2419; 2420) " " - TOKEN_TREE@[2420; 2512) - L_CURLY@[2420; 2421) "{" - WHITESPACE@[2421; 2450) "\n ..." - STRING@[2450; 2454) "\"u8\"" - SEMICOLON@[2454; 2455) ";" - WHITESPACE@[2455; 2484) "\n ..." - IDENT@[2484; 2486) "u8" - WHITESPACE@[2486; 2511) "\n ..." - R_CURLY@[2511; 2512) "}" - WHITESPACE@[2512; 2533) "\n " - R_CURLY@[2533; 2534) "}" - WHITESPACE@[2534; 2551) "\n " - R_CURLY@[2551; 2552) "}" - SEMICOLON@[2552; 2553) ";" - WHITESPACE@[2553; 2566) "\n " - R_CURLY@[2566; 2567) "}" - WHITESPACE@[2567; 2581) "\n\n " - IDENT@[2581; 2583) "u8" - BANG@[2583; 2584) "!" - TOKEN_TREE@[2584; 2588) - L_PAREN@[2584; 2585) "(" - IDENT@[2585; 2587) "u8" - R_PAREN@[2587; 2588) ")" - SEMICOLON@[2588; 2589) ";" - WHITESPACE@[2589; 2602) "\n " - LET_KW@[2602; 2605) "let" - WHITESPACE@[2605; 2606) " " - AMP@[2606; 2607) "&" - IDENT@[2607; 2609) "u8" - COLON@[2609; 2610) ":" - WHITESPACE@[2610; 2611) " " - AMP@[2611; 2612) "&" - IDENT@[2612; 2614) "u8" - WHITESPACE@[2614; 2615) " " - EQ@[2615; 2616) "=" - WHITESPACE@[2616; 2617) " " - IDENT@[2617; 2619) "u8" - COLON@[2619; 2620) ":" - COLON@[2620; 2621) ":" - IDENT@[2621; 2623) "u8" - TOKEN_TREE@[2623; 2629) - L_PAREN@[2623; 2624) "(" - AMP@[2624; 2625) "&" - INT_NUMBER@[2625; 2628) "8u8" - R_PAREN@[2628; 2629) ")" - SEMICOLON@[2629; 2630) ";" - WHITESPACE@[2630; 2643) "\n " - CRATE_KW@[2643; 2648) "crate" - COLON@[2648; 2649) ":" - COLON@[2649; 2650) ":" - IDENT@[2650; 2652) "u8" - TOKEN_TREE@[2652; 2657) - L_PAREN@[2652; 2653) "(" - INT_NUMBER@[2653; 2656) "0u8" - R_PAREN@[2656; 2657) ")" - SEMICOLON@[2657; 2658) ";" - WHITESPACE@[2658; 2671) "\n " - IDENT@[2671; 2673) "u8" - WHITESPACE@[2673; 2682) "\n " - R_CURLY@[2682; 2683) "}" - R_PAREN@[2683; 2684) ")" - SEMICOLON@[2684; 2685) ";" - WHITESPACE@[2685; 2690) "\n " - R_CURLY@[2690; 2691) "}" - WHITESPACE@[2691; 2692) "\n" - R_CURLY@[2692; 2693) "}" - WHITESPACE@[2693; 2695) "\n\n" - FN_DEF@[2695; 2832) - FN_KW@[2695; 2697) "fn" - WHITESPACE@[2697; 2698) " " - NAME@[2698; 2703) - IDENT@[2698; 2703) "fishy" - PARAM_LIST@[2703; 2705) - L_PAREN@[2703; 2704) "(" - R_PAREN@[2704; 2705) ")" - WHITESPACE@[2705; 2706) " " - BLOCK_EXPR@[2706; 2832) - BLOCK@[2706; 2832) - L_CURLY@[2706; 2707) "{" - WHITESPACE@[2707; 2712) "\n " - EXPR_STMT@[2712; 2830) - MACRO_CALL@[2712; 2829) - PATH@[2712; 2721) - PATH_SEGMENT@[2712; 2721) - NAME_REF@[2712; 2721) - IDENT@[2712; 2721) "assert_eq" - BANG@[2721; 2722) "!" - TOKEN_TREE@[2722; 2829) - L_PAREN@[2722; 2723) "(" - IDENT@[2723; 2729) "String" - COLON@[2729; 2730) ":" - COLON@[2730; 2731) ":" - IDENT@[2731; 2735) "from" - TOKEN_TREE@[2735; 2742) - L_PAREN@[2735; 2736) "(" - STRING@[2736; 2741) "\"><>\"" - R_PAREN@[2741; 2742) ")" - COMMA@[2742; 2743) "," - WHITESPACE@[2743; 2759) "\n " - IDENT@[2759; 2765) "String" - COLON@[2765; 2766) ":" - COLON@[2766; 2767) ":" - L_ANGLE@[2767; 2768) "<" - R_ANGLE@[2768; 2769) ">" - COLON@[2769; 2770) ":" - COLON@[2770; 2771) ":" - IDENT@[2771; 2775) "from" - COLON@[2775; 2776) ":" - COLON@[2776; 2777) ":" - L_ANGLE@[2777; 2778) "<" - R_ANGLE@[2778; 2779) ">" - TOKEN_TREE@[2779; 2786) - L_PAREN@[2779; 2780) "(" - STRING@[2780; 2785) "\"><>\"" - R_PAREN@[2785; 2786) ")" - DOT@[2786; 2787) "." - IDENT@[2787; 2792) "chars" - COLON@[2792; 2793) ":" - COLON@[2793; 2794) ":" - L_ANGLE@[2794; 2795) "<" - R_ANGLE@[2795; 2796) ">" - TOKEN_TREE@[2796; 2798) - L_PAREN@[2796; 2797) "(" - R_PAREN@[2797; 2798) ")" - DOT@[2798; 2799) "." - IDENT@[2799; 2802) "rev" - COLON@[2802; 2803) ":" - COLON@[2803; 2804) ":" - L_ANGLE@[2804; 2805) "<" - R_ANGLE@[2805; 2806) ">" - TOKEN_TREE@[2806; 2808) - L_PAREN@[2806; 2807) "(" - R_PAREN@[2807; 2808) ")" - DOT@[2808; 2809) "." - IDENT@[2809; 2816) "collect" - COLON@[2816; 2817) ":" - COLON@[2817; 2818) ":" - L_ANGLE@[2818; 2819) "<" - IDENT@[2819; 2825) "String" - R_ANGLE@[2825; 2826) ">" - TOKEN_TREE@[2826; 2828) - L_PAREN@[2826; 2827) "(" - R_PAREN@[2827; 2828) ")" - R_PAREN@[2828; 2829) ")" - SEMICOLON@[2829; 2830) ";" - WHITESPACE@[2830; 2831) "\n" - R_CURLY@[2831; 2832) "}" - WHITESPACE@[2832; 2834) "\n\n" - FN_DEF@[2834; 2906) - FN_KW@[2834; 2836) "fn" - WHITESPACE@[2836; 2837) " " - NAME@[2837; 2842) - IDENT@[2837; 2842) "union" - PARAM_LIST@[2842; 2844) - L_PAREN@[2842; 2843) "(" - R_PAREN@[2843; 2844) ")" - WHITESPACE@[2844; 2845) " " - BLOCK_EXPR@[2845; 2906) - BLOCK@[2845; 2906) - L_CURLY@[2845; 2846) "{" - WHITESPACE@[2846; 2851) "\n " - UNION_DEF@[2851; 2904) - UNION_KW@[2851; 2856) "union" - WHITESPACE@[2856; 2857) " " - NAME@[2857; 2862) - IDENT@[2857; 2862) "union" - TYPE_PARAM_LIST@[2862; 2870) - L_ANGLE@[2862; 2863) "<" - LIFETIME_PARAM@[2863; 2869) - LIFETIME@[2863; 2869) "\'union" - R_ANGLE@[2869; 2870) ">" - WHITESPACE@[2870; 2871) " " - RECORD_FIELD_DEF_LIST@[2871; 2904) - L_CURLY@[2871; 2872) "{" - WHITESPACE@[2872; 2873) " " - RECORD_FIELD_DEF@[2873; 2901) - NAME@[2873; 2878) - IDENT@[2873; 2878) "union" - COLON@[2878; 2879) ":" - WHITESPACE@[2879; 2880) " " - REFERENCE_TYPE@[2880; 2901) - AMP@[2880; 2881) "&" - LIFETIME@[2881; 2887) "\'union" - WHITESPACE@[2887; 2888) " " - PATH_TYPE@[2888; 2901) - PATH@[2888; 2901) - PATH_SEGMENT@[2888; 2901) - NAME_REF@[2888; 2893) - IDENT@[2888; 2893) "union" - TYPE_ARG_LIST@[2893; 2901) - L_ANGLE@[2893; 2894) "<" - LIFETIME_ARG@[2894; 2900) - LIFETIME@[2894; 2900) "\'union" - R_ANGLE@[2900; 2901) ">" - COMMA@[2901; 2902) "," - WHITESPACE@[2902; 2903) " " - R_CURLY@[2903; 2904) "}" - WHITESPACE@[2904; 2905) "\n" - R_CURLY@[2905; 2906) "}" - WHITESPACE@[2906; 2908) "\n\n" - FN_DEF@[2908; 3042) - FN_KW@[2908; 2910) "fn" - WHITESPACE@[2910; 2911) " " - NAME@[2911; 2929) - IDENT@[2911; 2929) "special_characters" - PARAM_LIST@[2929; 2931) - L_PAREN@[2929; 2930) "(" - R_PAREN@[2930; 2931) ")" - WHITESPACE@[2931; 2932) " " - BLOCK_EXPR@[2932; 3042) - BLOCK@[2932; 3042) - L_CURLY@[2932; 2933) "{" - WHITESPACE@[2933; 2938) "\n " - LET_STMT@[2938; 3021) - LET_KW@[2938; 2941) "let" - WHITESPACE@[2941; 2942) " " - BIND_PAT@[2942; 2945) - NAME@[2942; 2945) - IDENT@[2942; 2945) "val" - WHITESPACE@[2945; 2946) " " - EQ@[2946; 2947) "=" - WHITESPACE@[2947; 2948) " " - PREFIX_EXPR@[2948; 3013) - BANG@[2948; 2949) "!" - PAREN_EXPR@[2949; 3013) - L_PAREN@[2949; 2950) "(" - BIN_EXPR@[2950; 3012) - CALL_EXPR@[2950; 2995) - PAREN_EXPR@[2950; 2971) - L_PAREN@[2950; 2951) "(" - LAMBDA_EXPR@[2951; 2970) - PARAM_LIST@[2951; 2968) - PIPE@[2951; 2952) "|" - PARAM@[2952; 2962) - TUPLE_PAT@[2952; 2956) - L_PAREN@[2952; 2953) "(" - DOT_DOT_PAT@[2953; 2955) - DOT2@[2953; 2955) ".." - R_PAREN@[2955; 2956) ")" - COLON@[2956; 2957) ":" - TUPLE_TYPE@[2957; 2962) - L_PAREN@[2957; 2958) "(" - PLACEHOLDER_TYPE@[2958; 2959) - UNDERSCORE@[2958; 2959) "_" - COMMA@[2959; 2960) "," - PLACEHOLDER_TYPE@[2960; 2961) - UNDERSCORE@[2960; 2961) "_" - R_PAREN@[2961; 2962) ")" - COMMA@[2962; 2963) "," - PARAM@[2963; 2967) - BIND_PAT@[2963; 2967) - NAME@[2963; 2965) - IDENT@[2963; 2965) "__" - AT@[2965; 2966) "@" - PLACEHOLDER_PAT@[2966; 2967) - UNDERSCORE@[2966; 2967) "_" - PIPE@[2967; 2968) "|" - PATH_EXPR@[2968; 2970) - PATH@[2968; 2970) - PATH_SEGMENT@[2968; 2970) - NAME_REF@[2968; 2970) - IDENT@[2968; 2970) "__" - R_PAREN@[2970; 2971) ")" - ARG_LIST@[2971; 2995) - L_PAREN@[2971; 2972) "(" - TUPLE_EXPR@[2972; 2987) - L_PAREN@[2972; 2973) "(" - REF_EXPR@[2973; 2979) - AMP@[2973; 2974) "&" - PREFIX_EXPR@[2974; 2979) - STAR@[2974; 2975) "*" - LITERAL@[2975; 2979) - STRING@[2975; 2979) "\"\\\\\"" - COMMA@[2979; 2980) "," - LITERAL@[2980; 2986) - CHAR@[2980; 2986) "\'🤔\'" - R_PAREN@[2986; 2987) ")" - COMMENT@[2987; 2991) "/**/" - COMMA@[2991; 2992) "," - BLOCK_EXPR@[2992; 2994) - BLOCK@[2992; 2994) - L_CURLY@[2992; 2993) "{" - R_CURLY@[2993; 2994) "}" - R_PAREN@[2994; 2995) ")" - EQ2@[2995; 2997) "==" - BLOCK_EXPR@[2997; 3012) - BLOCK@[2997; 3012) - L_CURLY@[2997; 2998) "{" - EXPR_STMT@[2998; 3011) - REF_EXPR@[2998; 3010) - AMP@[2998; 2999) "&" - INDEX_EXPR@[2999; 3010) - ARRAY_EXPR@[2999; 3006) - L_BRACK@[2999; 3000) "[" - RANGE_EXPR@[3000; 3005) - DOT2EQ@[3000; 3003) "..=" - RANGE_EXPR@[3003; 3005) - DOT2@[3003; 3005) ".." - R_BRACK@[3005; 3006) "]" - L_BRACK@[3006; 3007) "[" - RANGE_EXPR@[3007; 3009) - DOT2@[3007; 3009) ".." - R_BRACK@[3009; 3010) "]" - SEMICOLON@[3010; 3011) ";" - R_CURLY@[3011; 3012) "}" - R_PAREN@[3012; 3013) ")" - COMMENT@[3013; 3015) "//" - WHITESPACE@[3015; 3020) "\n " - SEMICOLON@[3020; 3021) ";" - WHITESPACE@[3021; 3026) "\n " - EXPR_STMT@[3026; 3040) - MACRO_CALL@[3026; 3039) - PATH@[3026; 3032) - PATH_SEGMENT@[3026; 3032) - NAME_REF@[3026; 3032) - IDENT@[3026; 3032) "assert" - BANG@[3032; 3033) "!" - TOKEN_TREE@[3033; 3039) - L_PAREN@[3033; 3034) "(" - BANG@[3034; 3035) "!" - IDENT@[3035; 3038) "val" - R_PAREN@[3038; 3039) ")" - SEMICOLON@[3039; 3040) ";" - WHITESPACE@[3040; 3041) "\n" - R_CURLY@[3041; 3042) "}" - WHITESPACE@[3042; 3044) "\n\n" - FN_DEF@[3044; 3514) - FN_KW@[3044; 3046) "fn" - WHITESPACE@[3046; 3047) " " - NAME@[3047; 3057) - IDENT@[3047; 3057) "punch_card" - PARAM_LIST@[3057; 3059) - L_PAREN@[3057; 3058) "(" - R_PAREN@[3058; 3059) ")" - WHITESPACE@[3059; 3060) " " - RET_TYPE@[3060; 3083) - THIN_ARROW@[3060; 3062) "->" - WHITESPACE@[3062; 3063) " " - IMPL_TRAIT_TYPE@[3063; 3083) - IMPL_KW@[3063; 3067) "impl" - WHITESPACE@[3067; 3068) " " - TYPE_BOUND_LIST@[3068; 3083) - TYPE_BOUND@[3068; 3083) - PATH_TYPE@[3068; 3083) - PATH@[3068; 3083) - PATH@[3068; 3076) - PATH@[3068; 3071) - PATH_SEGMENT@[3068; 3071) - NAME_REF@[3068; 3071) - IDENT@[3068; 3071) "std" - COLON2@[3071; 3073) "::" - PATH_SEGMENT@[3073; 3076) - NAME_REF@[3073; 3076) - IDENT@[3073; 3076) "fmt" - COLON2@[3076; 3078) "::" - PATH_SEGMENT@[3078; 3083) - NAME_REF@[3078; 3083) - IDENT@[3078; 3083) "Debug" - WHITESPACE@[3083; 3084) " " - BLOCK_EXPR@[3084; 3514) - BLOCK@[3084; 3514) - L_CURLY@[3084; 3085) "{" - WHITESPACE@[3085; 3090) "\n " - RANGE_EXPR@[3090; 3512) - DOT2EQ@[3090; 3093) "..=" - RANGE_EXPR@[3093; 3512) - DOT2EQ@[3093; 3096) "..=" - RANGE_EXPR@[3096; 3512) - DOT2@[3096; 3098) ".." - WHITESPACE@[3098; 3099) " " - RANGE_EXPR@[3099; 3512) - DOT2@[3099; 3101) ".." - WHITESPACE@[3101; 3105) " " - RANGE_EXPR@[3105; 3512) - DOT2@[3105; 3107) ".." - WHITESPACE@[3107; 3108) " " - RANGE_EXPR@[3108; 3512) - DOT2@[3108; 3110) ".." - WHITESPACE@[3110; 3111) " " - RANGE_EXPR@[3111; 3512) - DOT2@[3111; 3113) ".." - WHITESPACE@[3113; 3114) " " - RANGE_EXPR@[3114; 3512) - DOT2@[3114; 3116) ".." - WHITESPACE@[3116; 3120) " " - RANGE_EXPR@[3120; 3512) - DOT2@[3120; 3122) ".." - WHITESPACE@[3122; 3123) " " - RANGE_EXPR@[3123; 3512) - DOT2@[3123; 3125) ".." - WHITESPACE@[3125; 3126) " " - RANGE_EXPR@[3126; 3512) - DOT2@[3126; 3128) ".." - WHITESPACE@[3128; 3129) " " - RANGE_EXPR@[3129; 3512) - DOT2@[3129; 3131) ".." - WHITESPACE@[3131; 3135) " " - RANGE_EXPR@[3135; 3512) - DOT2@[3135; 3137) ".." - WHITESPACE@[3137; 3138) " " - RANGE_EXPR@[3138; 3512) - DOT2EQ@[3138; 3141) "..=" - RANGE_EXPR@[3141; 3512) - DOT2@[3141; 3143) ".." - WHITESPACE@[3143; 3144) " " - RANGE_EXPR@[3144; 3512) - DOT2@[3144; 3146) ".." - WHITESPACE@[3146; 3151) "\n " - RANGE_EXPR@[3151; 3512) - DOT2EQ@[3151; 3154) "..=" - RANGE_EXPR@[3154; 3512) - DOT2@[3154; 3156) ".." - WHITESPACE@[3156; 3157) " " - RANGE_EXPR@[3157; 3512) - DOT2EQ@[3157; 3160) "..=" - RANGE_EXPR@[3160; 3512) - DOT2@[3160; 3162) ".." - WHITESPACE@[3162; 3166) " " - RANGE_EXPR@[3166; 3512) - DOT2@[3166; 3168) ".." - WHITESPACE@[3168; 3169) " " - RANGE_EXPR@[3169; 3512) - DOT2@[3169; 3171) ".." - WHITESPACE@[3171; 3172) " " - RANGE_EXPR@[3172; 3512) - DOT2@[3172; 3174) ".." - WHITESPACE@[3174; 3175) " " - RANGE_EXPR@[3175; 3512) - DOT2@[3175; 3177) ".." - WHITESPACE@[3177; 3181) " " - RANGE_EXPR@[3181; 3512) - DOT2@[3181; 3183) ".." - WHITESPACE@[3183; 3184) " " - RANGE_EXPR@[3184; 3512) - DOT2@[3184; 3186) ".." - WHITESPACE@[3186; 3187) " " - RANGE_EXPR@[3187; 3512) - DOT2@[3187; 3189) ".." - WHITESPACE@[3189; 3190) " " - RANGE_EXPR@[3190; 3512) - DOT2@[3190; 3192) ".." - WHITESPACE@[3192; 3196) " " - RANGE_EXPR@[3196; 3512) - DOT2EQ@[3196; 3199) "..=" - RANGE_EXPR@[3199; 3512) - DOT2EQ@[3199; 3202) "..=" - RANGE_EXPR@[3202; 3512) - DOT2EQ@[3202; 3205) "..=" - RANGE_EXPR@[3205; 3512) - DOT2@[3205; 3207) ".." - WHITESPACE@[3207; 3212) "\n " - RANGE_EXPR@[3212; 3512) - DOT2EQ@[3212; 3215) "..=" - RANGE_EXPR@[3215; 3512) - DOT2@[3215; 3217) ".." - WHITESPACE@[3217; 3218) " " - RANGE_EXPR@[3218; 3512) - DOT2EQ@[3218; 3221) "..=" - RANGE_EXPR@[3221; 3512) - DOT2@[3221; 3223) ".." - WHITESPACE@[3223; 3227) " " - RANGE_EXPR@[3227; 3512) - DOT2EQ@[3227; 3230) "..=" - RANGE_EXPR@[3230; 3512) - DOT2@[3230; 3232) ".." - WHITESPACE@[3232; 3233) " " - RANGE_EXPR@[3233; 3512) - DOT2EQ@[3233; 3236) "..=" - RANGE_EXPR@[3236; 3512) - DOT2@[3236; 3238) ".." - WHITESPACE@[3238; 3242) " " - RANGE_EXPR@[3242; 3512) - DOT2@[3242; 3244) ".." - WHITESPACE@[3244; 3245) " " - RANGE_EXPR@[3245; 3512) - DOT2EQ@[3245; 3248) "..=" - RANGE_EXPR@[3248; 3512) - DOT2EQ@[3248; 3251) "..=" - RANGE_EXPR@[3251; 3512) - DOT2@[3251; 3253) ".." - WHITESPACE@[3253; 3257) " " - RANGE_EXPR@[3257; 3512) - DOT2@[3257; 3259) ".." - WHITESPACE@[3259; 3260) " " - RANGE_EXPR@[3260; 3512) - DOT2EQ@[3260; 3263) "..=" - RANGE_EXPR@[3263; 3512) - DOT2@[3263; 3265) ".." - WHITESPACE@[3265; 3266) " " - RANGE_EXPR@[3266; 3512) - DOT2@[3266; 3268) ".." - WHITESPACE@[3268; 3273) "\n " - RANGE_EXPR@[3273; 3512) - DOT2EQ@[3273; 3276) "..=" - RANGE_EXPR@[3276; 3512) - DOT2EQ@[3276; 3279) "..=" - RANGE_EXPR@[3279; 3512) - DOT2@[3279; 3281) ".." - WHITESPACE@[3281; 3282) " " - RANGE_EXPR@[3282; 3512) - DOT2@[3282; 3284) ".." - WHITESPACE@[3284; 3288) " " - RANGE_EXPR@[3288; 3512) - DOT2EQ@[3288; 3291) "..=" - RANGE_EXPR@[3291; 3512) - DOT2@[3291; 3293) ".." - WHITESPACE@[3293; 3294) " " - RANGE_EXPR@[3294; 3512) - DOT2EQ@[3294; 3297) "..=" - RANGE_EXPR@[3297; 3512) - DOT2@[3297; 3299) ".." - WHITESPACE@[3299; 3303) " " - RANGE_EXPR@[3303; 3512) - DOT2EQ@[3303; 3306) "..=" - RANGE_EXPR@[3306; 3512) - DOT2@[3306; 3308) ".." - WHITESPACE@[3308; 3309) " " - RANGE_EXPR@[3309; 3512) - DOT2@[3309; 3311) ".." - WHITESPACE@[3311; 3312) " " - RANGE_EXPR@[3312; 3512) - DOT2@[3312; 3314) ".." - WHITESPACE@[3314; 3318) " " - RANGE_EXPR@[3318; 3512) - DOT2@[3318; 3320) ".." - WHITESPACE@[3320; 3321) " " - RANGE_EXPR@[3321; 3512) - DOT2EQ@[3321; 3324) "..=" - RANGE_EXPR@[3324; 3512) - DOT2@[3324; 3326) ".." - WHITESPACE@[3326; 3327) " " - RANGE_EXPR@[3327; 3512) - DOT2@[3327; 3329) ".." - WHITESPACE@[3329; 3334) "\n " - RANGE_EXPR@[3334; 3512) - DOT2EQ@[3334; 3337) "..=" - RANGE_EXPR@[3337; 3512) - DOT2@[3337; 3339) ".." - WHITESPACE@[3339; 3340) " " - RANGE_EXPR@[3340; 3512) - DOT2EQ@[3340; 3343) "..=" - RANGE_EXPR@[3343; 3512) - DOT2@[3343; 3345) ".." - WHITESPACE@[3345; 3349) " " - RANGE_EXPR@[3349; 3512) - DOT2EQ@[3349; 3352) "..=" - RANGE_EXPR@[3352; 3512) - DOT2@[3352; 3354) ".." - WHITESPACE@[3354; 3355) " " - RANGE_EXPR@[3355; 3512) - DOT2EQ@[3355; 3358) "..=" - RANGE_EXPR@[3358; 3512) - DOT2@[3358; 3360) ".." - WHITESPACE@[3360; 3364) " " - RANGE_EXPR@[3364; 3512) - DOT2@[3364; 3366) ".." - WHITESPACE@[3366; 3367) " " - RANGE_EXPR@[3367; 3512) - DOT2EQ@[3367; 3370) "..=" - RANGE_EXPR@[3370; 3512) - DOT2@[3370; 3372) ".." - WHITESPACE@[3372; 3373) " " - RANGE_EXPR@[3373; 3512) - DOT2@[3373; 3375) ".." - WHITESPACE@[3375; 3379) " " - RANGE_EXPR@[3379; 3512) - DOT2@[3379; 3381) ".." - WHITESPACE@[3381; 3382) " " - RANGE_EXPR@[3382; 3512) - DOT2EQ@[3382; 3385) "..=" - RANGE_EXPR@[3385; 3512) - DOT2@[3385; 3387) ".." - WHITESPACE@[3387; 3388) " " - RANGE_EXPR@[3388; 3512) - DOT2@[3388; 3390) ".." - WHITESPACE@[3390; 3395) "\n " - RANGE_EXPR@[3395; 3512) - DOT2EQ@[3395; 3398) "..=" - RANGE_EXPR@[3398; 3512) - DOT2@[3398; 3400) ".." - WHITESPACE@[3400; 3401) " " - RANGE_EXPR@[3401; 3512) - DOT2EQ@[3401; 3404) "..=" - RANGE_EXPR@[3404; 3512) - DOT2@[3404; 3406) ".." - WHITESPACE@[3406; 3410) " " - RANGE_EXPR@[3410; 3512) - DOT2EQ@[3410; 3413) "..=" - RANGE_EXPR@[3413; 3512) - DOT2@[3413; 3415) ".." - WHITESPACE@[3415; 3416) " " - RANGE_EXPR@[3416; 3512) - DOT2EQ@[3416; 3419) "..=" - RANGE_EXPR@[3419; 3512) - DOT2@[3419; 3421) ".." - WHITESPACE@[3421; 3425) " " - RANGE_EXPR@[3425; 3512) - DOT2@[3425; 3427) ".." - WHITESPACE@[3427; 3428) " " - RANGE_EXPR@[3428; 3512) - DOT2@[3428; 3430) ".." - WHITESPACE@[3430; 3431) " " - RANGE_EXPR@[3431; 3512) - DOT2EQ@[3431; 3434) "..=" - RANGE_EXPR@[3434; 3512) - DOT2@[3434; 3436) ".." - WHITESPACE@[3436; 3440) " " - RANGE_EXPR@[3440; 3512) - DOT2@[3440; 3442) ".." - WHITESPACE@[3442; 3443) " " - RANGE_EXPR@[3443; 3512) - DOT2EQ@[3443; 3446) "..=" - RANGE_EXPR@[3446; 3512) - DOT2@[3446; 3448) ".." - WHITESPACE@[3448; 3449) " " - RANGE_EXPR@[3449; 3512) - DOT2@[3449; 3451) ".." - WHITESPACE@[3451; 3456) "\n " - RANGE_EXPR@[3456; 3512) - DOT2EQ@[3456; 3459) "..=" - RANGE_EXPR@[3459; 3512) - DOT2@[3459; 3461) ".." - WHITESPACE@[3461; 3462) " " - RANGE_EXPR@[3462; 3512) - DOT2EQ@[3462; 3465) "..=" - RANGE_EXPR@[3465; 3512) - DOT2@[3465; 3467) ".." - WHITESPACE@[3467; 3471) " " - RANGE_EXPR@[3471; 3512) - DOT2@[3471; 3473) ".." - WHITESPACE@[3473; 3474) " " - RANGE_EXPR@[3474; 3512) - DOT2EQ@[3474; 3477) "..=" - RANGE_EXPR@[3477; 3512) - DOT2EQ@[3477; 3480) "..=" - RANGE_EXPR@[3480; 3512) - DOT2@[3480; 3482) ".." - WHITESPACE@[3482; 3486) " " - RANGE_EXPR@[3486; 3512) - DOT2EQ@[3486; 3489) "..=" - RANGE_EXPR@[3489; 3512) - DOT2EQ@[3489; 3492) "..=" - RANGE_EXPR@[3492; 3512) - DOT2@[3492; 3494) ".." - WHITESPACE@[3494; 3495) " " - RANGE_EXPR@[3495; 3512) - DOT2@[3495; 3497) ".." - WHITESPACE@[3497; 3501) " " - RANGE_EXPR@[3501; 3512) - DOT2@[3501; 3503) ".." - WHITESPACE@[3503; 3504) " " - RANGE_EXPR@[3504; 3512) - DOT2EQ@[3504; 3507) "..=" - RANGE_EXPR@[3507; 3512) - DOT2@[3507; 3509) ".." - WHITESPACE@[3509; 3510) " " - RANGE_EXPR@[3510; 3512) - DOT2@[3510; 3512) ".." - WHITESPACE@[3512; 3513) "\n" - R_CURLY@[3513; 3514) "}" - WHITESPACE@[3514; 3516) "\n\n" - FN_DEF@[3516; 3552) - FN_KW@[3516; 3518) "fn" - WHITESPACE@[3518; 3519) " " - NAME@[3519; 3525) - IDENT@[3519; 3525) "ktulhu" - PARAM_LIST@[3525; 3527) - L_PAREN@[3525; 3526) "(" - R_PAREN@[3526; 3527) ")" - WHITESPACE@[3527; 3528) " " - BLOCK_EXPR@[3528; 3552) - BLOCK@[3528; 3552) - L_CURLY@[3528; 3529) "{" - WHITESPACE@[3529; 3534) "\n " - SEMICOLON@[3534; 3535) ";" - SEMICOLON@[3535; 3536) ";" - SEMICOLON@[3536; 3537) ";" - EXPR_STMT@[3537; 3540) - TUPLE_EXPR@[3537; 3539) - L_PAREN@[3537; 3538) "(" - R_PAREN@[3538; 3539) ")" - SEMICOLON@[3539; 3540) ";" - SEMICOLON@[3540; 3541) ";" - SEMICOLON@[3541; 3542) ";" - SEMICOLON@[3542; 3543) ";" - SEMICOLON@[3543; 3544) ";" - SEMICOLON@[3544; 3545) ";" - SEMICOLON@[3545; 3546) ";" - SEMICOLON@[3546; 3547) ";" - SEMICOLON@[3547; 3548) ";" - TUPLE_EXPR@[3548; 3550) - L_PAREN@[3548; 3549) "(" - R_PAREN@[3549; 3550) ")" - WHITESPACE@[3550; 3551) "\n" - R_CURLY@[3551; 3552) "}" - WHITESPACE@[3552; 3554) "\n\n" - FN_DEF@[3554; 3812) - VISIBILITY@[3554; 3557) - PUB_KW@[3554; 3557) "pub" - WHITESPACE@[3557; 3558) " " - FN_KW@[3558; 3560) "fn" - WHITESPACE@[3560; 3561) " " - NAME@[3561; 3565) - IDENT@[3561; 3565) "main" - PARAM_LIST@[3565; 3567) - L_PAREN@[3565; 3566) "(" - R_PAREN@[3566; 3567) ")" - WHITESPACE@[3567; 3568) " " - BLOCK_EXPR@[3568; 3812) - BLOCK@[3568; 3812) - L_CURLY@[3568; 3569) "{" - WHITESPACE@[3569; 3574) "\n " - EXPR_STMT@[3574; 3584) - CALL_EXPR@[3574; 3583) - PATH_EXPR@[3574; 3581) - PATH@[3574; 3581) - PATH_SEGMENT@[3574; 3581) - NAME_REF@[3574; 3581) - IDENT@[3574; 3581) "strange" - ARG_LIST@[3581; 3583) - L_PAREN@[3581; 3582) "(" - R_PAREN@[3582; 3583) ")" - SEMICOLON@[3583; 3584) ";" - WHITESPACE@[3584; 3589) "\n " - EXPR_STMT@[3589; 3597) - CALL_EXPR@[3589; 3596) - PATH_EXPR@[3589; 3594) - PATH@[3589; 3594) - PATH_SEGMENT@[3589; 3594) - NAME_REF@[3589; 3594) - IDENT@[3589; 3594) "funny" - ARG_LIST@[3594; 3596) - L_PAREN@[3594; 3595) "(" - R_PAREN@[3595; 3596) ")" - SEMICOLON@[3596; 3597) ";" - WHITESPACE@[3597; 3602) "\n " - EXPR_STMT@[3602; 3609) - CALL_EXPR@[3602; 3608) - PATH_EXPR@[3602; 3606) - PATH@[3602; 3606) - PATH_SEGMENT@[3602; 3606) - NAME_REF@[3602; 3606) - IDENT@[3602; 3606) "what" - ARG_LIST@[3606; 3608) - L_PAREN@[3606; 3607) "(" - R_PAREN@[3607; 3608) ")" - SEMICOLON@[3608; 3609) ";" - WHITESPACE@[3609; 3614) "\n " - EXPR_STMT@[3614; 3628) - CALL_EXPR@[3614; 3627) - PATH_EXPR@[3614; 3625) - PATH@[3614; 3625) - PATH_SEGMENT@[3614; 3625) - NAME_REF@[3614; 3625) - IDENT@[3614; 3625) "zombiejesus" - ARG_LIST@[3625; 3627) - L_PAREN@[3625; 3626) "(" - R_PAREN@[3626; 3627) ")" - SEMICOLON@[3627; 3628) ";" - WHITESPACE@[3628; 3633) "\n " - EXPR_STMT@[3633; 3643) - CALL_EXPR@[3633; 3642) - PATH_EXPR@[3633; 3640) - PATH@[3633; 3640) - PATH_SEGMENT@[3633; 3640) - NAME_REF@[3633; 3640) - IDENT@[3633; 3640) "notsure" - ARG_LIST@[3640; 3642) - L_PAREN@[3640; 3641) "(" - R_PAREN@[3641; 3642) ")" - SEMICOLON@[3642; 3643) ";" - WHITESPACE@[3643; 3648) "\n " - EXPR_STMT@[3648; 3664) - CALL_EXPR@[3648; 3663) - PATH_EXPR@[3648; 3661) - PATH@[3648; 3661) - PATH_SEGMENT@[3648; 3661) - NAME_REF@[3648; 3661) - IDENT@[3648; 3661) "canttouchthis" - ARG_LIST@[3661; 3663) - L_PAREN@[3661; 3662) "(" - R_PAREN@[3662; 3663) ")" - SEMICOLON@[3663; 3664) ";" - WHITESPACE@[3664; 3669) "\n " - EXPR_STMT@[3669; 3681) - CALL_EXPR@[3669; 3680) - PATH_EXPR@[3669; 3678) - PATH@[3669; 3678) - PATH_SEGMENT@[3669; 3678) - NAME_REF@[3669; 3678) - IDENT@[3669; 3678) "angrydome" - ARG_LIST@[3678; 3680) - L_PAREN@[3678; 3679) "(" - R_PAREN@[3679; 3680) ")" - SEMICOLON@[3680; 3681) ";" - WHITESPACE@[3681; 3686) "\n " - EXPR_STMT@[3686; 3701) - CALL_EXPR@[3686; 3700) - PATH_EXPR@[3686; 3698) - PATH@[3686; 3698) - PATH_SEGMENT@[3686; 3698) - NAME_REF@[3686; 3698) - IDENT@[3686; 3698) "evil_lincoln" - ARG_LIST@[3698; 3700) - L_PAREN@[3698; 3699) "(" - R_PAREN@[3699; 3700) ")" - SEMICOLON@[3700; 3701) ";" - WHITESPACE@[3701; 3706) "\n " - EXPR_STMT@[3706; 3713) - CALL_EXPR@[3706; 3712) - PATH_EXPR@[3706; 3710) - PATH@[3706; 3710) - PATH_SEGMENT@[3706; 3710) - NAME_REF@[3706; 3710) - IDENT@[3706; 3710) "dots" - ARG_LIST@[3710; 3712) - L_PAREN@[3710; 3711) "(" - R_PAREN@[3711; 3712) ")" - SEMICOLON@[3712; 3713) ";" - WHITESPACE@[3713; 3718) "\n " - EXPR_STMT@[3718; 3726) - CALL_EXPR@[3718; 3725) - PATH_EXPR@[3718; 3720) - PATH@[3718; 3720) - PATH_SEGMENT@[3718; 3720) - NAME_REF@[3718; 3720) - IDENT@[3718; 3720) "u8" - ARG_LIST@[3720; 3725) - L_PAREN@[3720; 3721) "(" - LITERAL@[3721; 3724) - INT_NUMBER@[3721; 3724) "8u8" - R_PAREN@[3724; 3725) ")" - SEMICOLON@[3725; 3726) ";" - WHITESPACE@[3726; 3731) "\n " - EXPR_STMT@[3731; 3739) - CALL_EXPR@[3731; 3738) - PATH_EXPR@[3731; 3736) - PATH@[3731; 3736) - PATH_SEGMENT@[3731; 3736) - NAME_REF@[3731; 3736) - IDENT@[3731; 3736) "fishy" - ARG_LIST@[3736; 3738) - L_PAREN@[3736; 3737) "(" - R_PAREN@[3737; 3738) ")" - SEMICOLON@[3738; 3739) ";" - WHITESPACE@[3739; 3744) "\n " - EXPR_STMT@[3744; 3752) - CALL_EXPR@[3744; 3751) - PATH_EXPR@[3744; 3749) - PATH@[3744; 3749) - PATH_SEGMENT@[3744; 3749) - NAME_REF@[3744; 3749) - IDENT@[3744; 3749) "union" - ARG_LIST@[3749; 3751) - L_PAREN@[3749; 3750) "(" - R_PAREN@[3750; 3751) ")" - SEMICOLON@[3751; 3752) ";" - WHITESPACE@[3752; 3757) "\n " - EXPR_STMT@[3757; 3778) - CALL_EXPR@[3757; 3777) - PATH_EXPR@[3757; 3775) - PATH@[3757; 3775) - PATH_SEGMENT@[3757; 3775) - NAME_REF@[3757; 3775) - IDENT@[3757; 3775) "special_characters" - ARG_LIST@[3775; 3777) - L_PAREN@[3775; 3776) "(" - R_PAREN@[3776; 3777) ")" - SEMICOLON@[3777; 3778) ";" - WHITESPACE@[3778; 3783) "\n " - EXPR_STMT@[3783; 3796) - CALL_EXPR@[3783; 3795) - PATH_EXPR@[3783; 3793) - PATH@[3783; 3793) - PATH_SEGMENT@[3783; 3793) - NAME_REF@[3783; 3793) - IDENT@[3783; 3793) "punch_card" - ARG_LIST@[3793; 3795) - L_PAREN@[3793; 3794) "(" - R_PAREN@[3794; 3795) ")" - SEMICOLON@[3795; 3796) ";" - WHITESPACE@[3796; 3801) "\n " - EXPR_STMT@[3801; 3810) - CALL_EXPR@[3801; 3809) - PATH_EXPR@[3801; 3807) - PATH@[3801; 3807) - PATH_SEGMENT@[3801; 3807) - NAME_REF@[3801; 3807) - IDENT@[3801; 3807) "ktulhu" - ARG_LIST@[3807; 3809) - L_PAREN@[3807; 3808) "(" - R_PAREN@[3808; 3809) ")" - SEMICOLON@[3809; 3810) ";" - WHITESPACE@[3810; 3811) "\n" - R_CURLY@[3811; 3812) "}" - WHITESPACE@[3812; 3813) "\n" +SOURCE_FILE@0..3813 + COMMENT@0..55 "//! Adapted from a `r ..." + WHITESPACE@55..56 "\n" + COMMENT@56..173 "//! https://github.co ..." + WHITESPACE@173..174 "\n" + COMMENT@174..178 "//! " + WHITESPACE@178..179 "\n" + COMMENT@179..269 "//! Reported to rust- ..." + WHITESPACE@269..271 "\n\n" + ATTR@271..302 + POUND@271..272 "#" + BANG@272..273 "!" + L_BRACK@273..274 "[" + PATH@274..279 + PATH_SEGMENT@274..279 + NAME_REF@274..279 + IDENT@274..279 "allow" + TOKEN_TREE@279..301 + L_PAREN@279..280 "(" + IDENT@280..300 "non_camel_case_types" + R_PAREN@300..301 ")" + R_BRACK@301..302 "]" + WHITESPACE@302..303 "\n" + ATTR@303..323 + POUND@303..304 "#" + BANG@304..305 "!" + L_BRACK@305..306 "[" + PATH@306..311 + PATH_SEGMENT@306..311 + NAME_REF@306..311 + IDENT@306..311 "allow" + TOKEN_TREE@311..322 + L_PAREN@311..312 "(" + IDENT@312..321 "dead_code" + R_PAREN@321..322 ")" + R_BRACK@322..323 "]" + WHITESPACE@323..324 "\n" + ATTR@324..351 + POUND@324..325 "#" + BANG@325..326 "!" + L_BRACK@326..327 "[" + PATH@327..332 + PATH_SEGMENT@327..332 + NAME_REF@327..332 + IDENT@327..332 "allow" + TOKEN_TREE@332..350 + L_PAREN@332..333 "(" + IDENT@333..349 "unreachable_code" + R_PAREN@349..350 ")" + R_BRACK@350..351 "]" + WHITESPACE@351..352 "\n" + ATTR@352..376 + POUND@352..353 "#" + BANG@353..354 "!" + L_BRACK@354..355 "[" + PATH@355..360 + PATH_SEGMENT@355..360 + NAME_REF@355..360 + IDENT@355..360 "allow" + TOKEN_TREE@360..375 + L_PAREN@360..361 "(" + IDENT@361..374 "unused_parens" + R_PAREN@374..375 ")" + R_BRACK@375..376 "]" + WHITESPACE@376..378 "\n\n" + ATTR@378..405 + POUND@378..379 "#" + BANG@379..380 "!" + L_BRACK@380..381 "[" + PATH@381..396 + PATH_SEGMENT@381..396 + NAME_REF@381..396 + IDENT@381..396 "recursion_limit" + WHITESPACE@396..397 " " + EQ@397..398 "=" + WHITESPACE@398..399 " " + LITERAL@399..404 + STRING@399..404 "\"128\"" + R_BRACK@404..405 "]" + WHITESPACE@405..407 "\n\n" + USE_ITEM@407..427 + USE_KW@407..410 "use" + WHITESPACE@410..411 " " + USE_TREE@411..426 + PATH@411..426 + PATH@411..420 + PATH@411..414 + PATH_SEGMENT@411..414 + NAME_REF@411..414 + IDENT@411..414 "std" + COLON2@414..416 "::" + PATH_SEGMENT@416..420 + NAME_REF@416..420 + IDENT@416..420 "cell" + COLON2@420..422 "::" + PATH_SEGMENT@422..426 + NAME_REF@422..426 + IDENT@422..426 "Cell" + SEMICOLON@426..427 ";" + WHITESPACE@427..428 "\n" + USE_ITEM@428..447 + USE_KW@428..431 "use" + WHITESPACE@431..432 " " + USE_TREE@432..446 + PATH@432..446 + PATH@432..440 + PATH@432..435 + PATH_SEGMENT@432..435 + NAME_REF@432..435 + IDENT@432..435 "std" + COLON2@435..437 "::" + PATH_SEGMENT@437..440 + NAME_REF@437..440 + IDENT@437..440 "mem" + COLON2@440..442 "::" + PATH_SEGMENT@442..446 + NAME_REF@442..446 + IDENT@442..446 "swap" + SEMICOLON@446..447 ";" + WHITESPACE@447..449 "\n\n" + COMMENT@449..518 "// Just a grab bag of ..." + WHITESPACE@518..520 "\n\n" + FN_DEF@520..572 + FN_KW@520..522 "fn" + WHITESPACE@522..523 " " + NAME@523..530 + IDENT@523..530 "strange" + PARAM_LIST@530..532 + L_PAREN@530..531 "(" + R_PAREN@531..532 ")" + WHITESPACE@532..533 " " + RET_TYPE@533..540 + THIN_ARROW@533..535 "->" + WHITESPACE@535..536 " " + PATH_TYPE@536..540 + PATH@536..540 + PATH_SEGMENT@536..540 + NAME_REF@536..540 + IDENT@536..540 "bool" + WHITESPACE@540..541 " " + BLOCK_EXPR@541..572 + BLOCK@541..572 + L_CURLY@541..542 "{" + WHITESPACE@542..543 " " + LET_STMT@543..570 + LET_KW@543..546 "let" + WHITESPACE@546..547 " " + BIND_PAT@547..549 + NAME@547..549 + IDENT@547..549 "_x" + COLON@549..550 ":" + WHITESPACE@550..551 " " + PATH_TYPE@551..555 + PATH@551..555 + PATH_SEGMENT@551..555 + NAME_REF@551..555 + IDENT@551..555 "bool" + WHITESPACE@555..556 " " + EQ@556..557 "=" + WHITESPACE@557..558 " " + RETURN_EXPR@558..569 + RETURN_KW@558..564 "return" + WHITESPACE@564..565 " " + LITERAL@565..569 + TRUE_KW@565..569 "true" + SEMICOLON@569..570 ";" + WHITESPACE@570..571 " " + R_CURLY@571..572 "}" + WHITESPACE@572..574 "\n\n" + FN_DEF@574..624 + FN_KW@574..576 "fn" + WHITESPACE@576..577 " " + NAME@577..582 + IDENT@577..582 "funny" + PARAM_LIST@582..584 + L_PAREN@582..583 "(" + R_PAREN@583..584 ")" + WHITESPACE@584..585 " " + BLOCK_EXPR@585..624 + BLOCK@585..624 + L_CURLY@585..586 "{" + WHITESPACE@586..591 "\n " + FN_DEF@591..607 + FN_KW@591..593 "fn" + WHITESPACE@593..594 " " + NAME@594..595 + IDENT@594..595 "f" + PARAM_LIST@595..603 + L_PAREN@595..596 "(" + PARAM@596..602 + BIND_PAT@596..598 + NAME@596..598 + IDENT@596..598 "_x" + COLON@598..599 ":" + WHITESPACE@599..600 " " + TUPLE_TYPE@600..602 + L_PAREN@600..601 "(" + R_PAREN@601..602 ")" + R_PAREN@602..603 ")" + WHITESPACE@603..604 " " + BLOCK_EXPR@604..607 + BLOCK@604..607 + L_CURLY@604..605 "{" + WHITESPACE@605..606 " " + R_CURLY@606..607 "}" + WHITESPACE@607..612 "\n " + EXPR_STMT@612..622 + CALL_EXPR@612..621 + PATH_EXPR@612..613 + PATH@612..613 + PATH_SEGMENT@612..613 + NAME_REF@612..613 + IDENT@612..613 "f" + ARG_LIST@613..621 + L_PAREN@613..614 "(" + RETURN_EXPR@614..620 + RETURN_KW@614..620 "return" + R_PAREN@620..621 ")" + SEMICOLON@621..622 ";" + WHITESPACE@622..623 "\n" + R_CURLY@623..624 "}" + WHITESPACE@624..626 "\n\n" + FN_DEF@626..816 + FN_KW@626..628 "fn" + WHITESPACE@628..629 " " + NAME@629..633 + IDENT@629..633 "what" + PARAM_LIST@633..635 + L_PAREN@633..634 "(" + R_PAREN@634..635 ")" + WHITESPACE@635..636 " " + BLOCK_EXPR@636..816 + BLOCK@636..816 + L_CURLY@636..637 "{" + WHITESPACE@637..642 "\n " + FN_DEF@642..720 + FN_KW@642..644 "fn" + WHITESPACE@644..645 " " + NAME@645..648 + IDENT@645..648 "the" + PARAM_LIST@648..664 + L_PAREN@648..649 "(" + PARAM@649..663 + BIND_PAT@649..650 + NAME@649..650 + IDENT@649..650 "x" + COLON@650..651 ":" + WHITESPACE@651..652 " " + REFERENCE_TYPE@652..663 + AMP@652..653 "&" + PATH_TYPE@653..663 + PATH@653..663 + PATH_SEGMENT@653..663 + NAME_REF@653..657 + IDENT@653..657 "Cell" + TYPE_ARG_LIST@657..663 + L_ANGLE@657..658 "<" + TYPE_ARG@658..662 + PATH_TYPE@658..662 + PATH@658..662 + PATH_SEGMENT@658..662 + NAME_REF@658..662 + IDENT@658..662 "bool" + R_ANGLE@662..663 ">" + R_PAREN@663..664 ")" + WHITESPACE@664..665 " " + BLOCK_EXPR@665..720 + BLOCK@665..720 + L_CURLY@665..666 "{" + WHITESPACE@666..675 "\n " + EXPR_STMT@675..714 + RETURN_EXPR@675..713 + RETURN_KW@675..681 "return" + WHITESPACE@681..682 " " + WHILE_EXPR@682..713 + WHILE_KW@682..687 "while" + WHITESPACE@687..688 " " + CONDITION@688..696 + PREFIX_EXPR@688..696 + BANG@688..689 "!" + METHOD_CALL_EXPR@689..696 + PATH_EXPR@689..690 + PATH@689..690 + PATH_SEGMENT@689..690 + NAME_REF@689..690 + IDENT@689..690 "x" + DOT@690..691 "." + NAME_REF@691..694 + IDENT@691..694 "get" + ARG_LIST@694..696 + L_PAREN@694..695 "(" + R_PAREN@695..696 ")" + WHITESPACE@696..697 " " + BLOCK_EXPR@697..713 + BLOCK@697..713 + L_CURLY@697..698 "{" + WHITESPACE@698..699 " " + EXPR_STMT@699..711 + METHOD_CALL_EXPR@699..710 + PATH_EXPR@699..700 + PATH@699..700 + PATH_SEGMENT@699..700 + NAME_REF@699..700 + IDENT@699..700 "x" + DOT@700..701 "." + NAME_REF@701..704 + IDENT@701..704 "set" + ARG_LIST@704..710 + L_PAREN@704..705 "(" + LITERAL@705..709 + TRUE_KW@705..709 "true" + R_PAREN@709..710 ")" + SEMICOLON@710..711 ";" + WHITESPACE@711..712 " " + R_CURLY@712..713 "}" + SEMICOLON@713..714 ";" + WHITESPACE@714..719 "\n " + R_CURLY@719..720 "}" + WHITESPACE@720..725 "\n " + LET_STMT@725..751 + LET_KW@725..728 "let" + WHITESPACE@728..729 " " + BIND_PAT@729..730 + NAME@729..730 + IDENT@729..730 "i" + WHITESPACE@730..731 " " + EQ@731..732 "=" + WHITESPACE@732..733 " " + REF_EXPR@733..750 + AMP@733..734 "&" + CALL_EXPR@734..750 + PATH_EXPR@734..743 + PATH@734..743 + PATH@734..738 + PATH_SEGMENT@734..738 + NAME_REF@734..738 + IDENT@734..738 "Cell" + COLON2@738..740 "::" + PATH_SEGMENT@740..743 + NAME_REF@740..743 + IDENT@740..743 "new" + ARG_LIST@743..750 + L_PAREN@743..744 "(" + LITERAL@744..749 + FALSE_KW@744..749 "false" + R_PAREN@749..750 ")" + SEMICOLON@750..751 ";" + WHITESPACE@751..756 "\n " + LET_STMT@756..778 + LET_KW@756..759 "let" + WHITESPACE@759..760 " " + BIND_PAT@760..764 + NAME@760..764 + IDENT@760..764 "dont" + WHITESPACE@764..765 " " + EQ@765..766 "=" + WHITESPACE@766..767 " " + BLOCK_EXPR@767..777 + BLOCK@767..777 + L_CURLY@767..768 "{" + LAMBDA_EXPR@768..776 + PARAM_LIST@768..770 + PIPE@768..769 "|" + PIPE@769..770 "|" + CALL_EXPR@770..776 + PATH_EXPR@770..773 + PATH@770..773 + PATH_SEGMENT@770..773 + NAME_REF@770..773 + IDENT@770..773 "the" + ARG_LIST@773..776 + L_PAREN@773..774 "(" + PATH_EXPR@774..775 + PATH@774..775 + PATH_SEGMENT@774..775 + NAME_REF@774..775 + IDENT@774..775 "i" + R_PAREN@775..776 ")" + R_CURLY@776..777 "}" + SEMICOLON@777..778 ";" + WHITESPACE@778..783 "\n " + EXPR_STMT@783..790 + CALL_EXPR@783..789 + PATH_EXPR@783..787 + PATH@783..787 + PATH_SEGMENT@783..787 + NAME_REF@783..787 + IDENT@783..787 "dont" + ARG_LIST@787..789 + L_PAREN@787..788 "(" + R_PAREN@788..789 ")" + SEMICOLON@789..790 ";" + WHITESPACE@790..795 "\n " + EXPR_STMT@795..814 + MACRO_CALL@795..813 + PATH@795..801 + PATH_SEGMENT@795..801 + NAME_REF@795..801 + IDENT@795..801 "assert" + BANG@801..802 "!" + TOKEN_TREE@802..813 + L_PAREN@802..803 "(" + TOKEN_TREE@803..812 + L_PAREN@803..804 "(" + IDENT@804..805 "i" + DOT@805..806 "." + IDENT@806..809 "get" + TOKEN_TREE@809..811 + L_PAREN@809..810 "(" + R_PAREN@810..811 ")" + R_PAREN@811..812 ")" + R_PAREN@812..813 ")" + SEMICOLON@813..814 ";" + WHITESPACE@814..815 "\n" + R_CURLY@815..816 "}" + WHITESPACE@816..818 "\n\n" + FN_DEF@818..1322 + FN_KW@818..820 "fn" + WHITESPACE@820..821 " " + NAME@821..832 + IDENT@821..832 "zombiejesus" + PARAM_LIST@832..834 + L_PAREN@832..833 "(" + R_PAREN@833..834 ")" + WHITESPACE@834..835 " " + BLOCK_EXPR@835..1322 + BLOCK@835..1322 + L_CURLY@835..836 "{" + WHITESPACE@836..841 "\n " + LOOP_EXPR@841..1320 + LOOP_KW@841..845 "loop" + WHITESPACE@845..846 " " + BLOCK_EXPR@846..1320 + BLOCK@846..1320 + L_CURLY@846..847 "{" + WHITESPACE@847..856 "\n " + EXPR_STMT@856..1283 + WHILE_EXPR@856..1283 + WHILE_KW@856..861 "while" + WHITESPACE@861..862 " " + CONDITION@862..870 + PAREN_EXPR@862..870 + L_PAREN@862..863 "(" + RETURN_EXPR@863..869 + RETURN_KW@863..869 "return" + R_PAREN@869..870 ")" + WHITESPACE@870..871 " " + BLOCK_EXPR@871..1283 + BLOCK@871..1283 + L_CURLY@871..872 "{" + WHITESPACE@872..885 "\n " + IF_EXPR@885..1273 + IF_KW@885..887 "if" + WHITESPACE@887..888 " " + CONDITION@888..896 + PAREN_EXPR@888..896 + L_PAREN@888..889 "(" + RETURN_EXPR@889..895 + RETURN_KW@889..895 "return" + R_PAREN@895..896 ")" + WHITESPACE@896..897 " " + BLOCK_EXPR@897..1216 + BLOCK@897..1216 + L_CURLY@897..898 "{" + WHITESPACE@898..915 "\n " + EXPR_STMT@915..1202 + MATCH_EXPR@915..1201 + MATCH_KW@915..920 "match" + WHITESPACE@920..921 " " + PAREN_EXPR@921..929 + L_PAREN@921..922 "(" + RETURN_EXPR@922..928 + RETURN_KW@922..928 "return" + R_PAREN@928..929 ")" + WHITESPACE@929..930 " " + MATCH_ARM_LIST@930..1201 + L_CURLY@930..931 "{" + WHITESPACE@931..952 "\n " + MATCH_ARM@952..1147 + LITERAL_PAT@952..953 + LITERAL@952..953 + INT_NUMBER@952..953 "1" + WHITESPACE@953..954 " " + FAT_ARROW@954..956 "=>" + WHITESPACE@956..957 " " + BLOCK_EXPR@957..1147 + BLOCK@957..1147 + L_CURLY@957..958 "{" + WHITESPACE@958..983 "\n ..." + IF_EXPR@983..1125 + IF_KW@983..985 "if" + WHITESPACE@985..986 " " + CONDITION@986..994 + PAREN_EXPR@986..994 + L_PAREN@986..987 "(" + RETURN_EXPR@987..993 + RETURN_KW@987..993 "return" + R_PAREN@993..994 ")" + WHITESPACE@994..995 " " + BLOCK_EXPR@995..1057 + BLOCK@995..1057 + L_CURLY@995..996 "{" + WHITESPACE@996..1025 "\n ..." + RETURN_EXPR@1025..1031 + RETURN_KW@1025..1031 "return" + WHITESPACE@1031..1056 "\n ..." + R_CURLY@1056..1057 "}" + WHITESPACE@1057..1058 " " + ELSE_KW@1058..1062 "else" + WHITESPACE@1062..1063 " " + BLOCK_EXPR@1063..1125 + BLOCK@1063..1125 + L_CURLY@1063..1064 "{" + WHITESPACE@1064..1093 "\n ..." + RETURN_EXPR@1093..1099 + RETURN_KW@1093..1099 "return" + WHITESPACE@1099..1124 "\n ..." + R_CURLY@1124..1125 "}" + WHITESPACE@1125..1146 "\n " + R_CURLY@1146..1147 "}" + WHITESPACE@1147..1168 "\n " + MATCH_ARM@1168..1183 + PLACEHOLDER_PAT@1168..1169 + UNDERSCORE@1168..1169 "_" + WHITESPACE@1169..1170 " " + FAT_ARROW@1170..1172 "=>" + WHITESPACE@1172..1173 " " + BLOCK_EXPR@1173..1183 + BLOCK@1173..1183 + L_CURLY@1173..1174 "{" + WHITESPACE@1174..1175 " " + RETURN_EXPR@1175..1181 + RETURN_KW@1175..1181 "return" + WHITESPACE@1181..1182 " " + R_CURLY@1182..1183 "}" + WHITESPACE@1183..1200 "\n " + R_CURLY@1200..1201 "}" + SEMICOLON@1201..1202 ";" + WHITESPACE@1202..1215 "\n " + R_CURLY@1215..1216 "}" + WHITESPACE@1216..1217 " " + ELSE_KW@1217..1221 "else" + WHITESPACE@1221..1222 " " + IF_EXPR@1222..1273 + IF_KW@1222..1224 "if" + WHITESPACE@1224..1225 " " + CONDITION@1225..1233 + PAREN_EXPR@1225..1233 + L_PAREN@1225..1226 "(" + RETURN_EXPR@1226..1232 + RETURN_KW@1226..1232 "return" + R_PAREN@1232..1233 ")" + WHITESPACE@1233..1234 " " + BLOCK_EXPR@1234..1273 + BLOCK@1234..1273 + L_CURLY@1234..1235 "{" + WHITESPACE@1235..1252 "\n " + EXPR_STMT@1252..1259 + RETURN_EXPR@1252..1258 + RETURN_KW@1252..1258 "return" + SEMICOLON@1258..1259 ";" + WHITESPACE@1259..1272 "\n " + R_CURLY@1272..1273 "}" + WHITESPACE@1273..1282 "\n " + R_CURLY@1282..1283 "}" + WHITESPACE@1283..1292 "\n " + IF_EXPR@1292..1314 + IF_KW@1292..1294 "if" + WHITESPACE@1294..1295 " " + CONDITION@1295..1303 + PAREN_EXPR@1295..1303 + L_PAREN@1295..1296 "(" + RETURN_EXPR@1296..1302 + RETURN_KW@1296..1302 "return" + R_PAREN@1302..1303 ")" + WHITESPACE@1303..1304 " " + BLOCK_EXPR@1304..1314 + BLOCK@1304..1314 + L_CURLY@1304..1305 "{" + WHITESPACE@1305..1306 " " + EXPR_STMT@1306..1312 + BREAK_EXPR@1306..1311 + BREAK_KW@1306..1311 "break" + SEMICOLON@1311..1312 ";" + WHITESPACE@1312..1313 " " + R_CURLY@1313..1314 "}" + WHITESPACE@1314..1319 "\n " + R_CURLY@1319..1320 "}" + WHITESPACE@1320..1321 "\n" + R_CURLY@1321..1322 "}" + WHITESPACE@1322..1324 "\n\n" + FN_DEF@1324..1539 + FN_KW@1324..1326 "fn" + WHITESPACE@1326..1327 " " + NAME@1327..1334 + IDENT@1327..1334 "notsure" + PARAM_LIST@1334..1336 + L_PAREN@1334..1335 "(" + R_PAREN@1335..1336 ")" + WHITESPACE@1336..1337 " " + BLOCK_EXPR@1337..1539 + BLOCK@1337..1539 + L_CURLY@1337..1338 "{" + WHITESPACE@1338..1343 "\n " + LET_STMT@1343..1361 + LET_KW@1343..1346 "let" + WHITESPACE@1346..1347 " " + BIND_PAT@1347..1353 + MUT_KW@1347..1350 "mut" + WHITESPACE@1350..1351 " " + NAME@1351..1353 + IDENT@1351..1353 "_x" + COLON@1353..1354 ":" + WHITESPACE@1354..1355 " " + PATH_TYPE@1355..1360 + PATH@1355..1360 + PATH_SEGMENT@1355..1360 + NAME_REF@1355..1360 + IDENT@1355..1360 "isize" + SEMICOLON@1360..1361 ";" + WHITESPACE@1361..1366 "\n " + LET_STMT@1366..1400 + LET_KW@1366..1369 "let" + WHITESPACE@1369..1370 " " + BIND_PAT@1370..1376 + MUT_KW@1370..1373 "mut" + WHITESPACE@1373..1374 " " + NAME@1374..1376 + IDENT@1374..1376 "_y" + WHITESPACE@1376..1377 " " + EQ@1377..1378 "=" + WHITESPACE@1378..1379 " " + BIN_EXPR@1379..1399 + PAREN_EXPR@1379..1387 + L_PAREN@1379..1380 "(" + BIN_EXPR@1380..1386 + PATH_EXPR@1380..1382 + PATH@1380..1382 + PATH_SEGMENT@1380..1382 + NAME_REF@1380..1382 + IDENT@1380..1382 "_x" + WHITESPACE@1382..1383 " " + EQ@1383..1384 "=" + WHITESPACE@1384..1385 " " + LITERAL@1385..1386 + INT_NUMBER@1385..1386 "0" + R_PAREN@1386..1387 ")" + WHITESPACE@1387..1388 " " + EQ2@1388..1390 "==" + WHITESPACE@1390..1391 " " + PAREN_EXPR@1391..1399 + L_PAREN@1391..1392 "(" + BIN_EXPR@1392..1398 + PATH_EXPR@1392..1394 + PATH@1392..1394 + PATH_SEGMENT@1392..1394 + NAME_REF@1392..1394 + IDENT@1392..1394 "_x" + WHITESPACE@1394..1395 " " + EQ@1395..1396 "=" + WHITESPACE@1396..1397 " " + LITERAL@1397..1398 + INT_NUMBER@1397..1398 "0" + R_PAREN@1398..1399 ")" + SEMICOLON@1399..1400 ";" + WHITESPACE@1400..1405 "\n " + LET_STMT@1405..1438 + LET_KW@1405..1408 "let" + WHITESPACE@1408..1409 " " + BIND_PAT@1409..1415 + MUT_KW@1409..1412 "mut" + WHITESPACE@1412..1413 " " + NAME@1413..1415 + IDENT@1413..1415 "_z" + WHITESPACE@1415..1416 " " + EQ@1416..1417 "=" + WHITESPACE@1417..1418 " " + BIN_EXPR@1418..1437 + PAREN_EXPR@1418..1426 + L_PAREN@1418..1419 "(" + BIN_EXPR@1419..1425 + PATH_EXPR@1419..1421 + PATH@1419..1421 + PATH_SEGMENT@1419..1421 + NAME_REF@1419..1421 + IDENT@1419..1421 "_x" + WHITESPACE@1421..1422 " " + EQ@1422..1423 "=" + WHITESPACE@1423..1424 " " + LITERAL@1424..1425 + INT_NUMBER@1424..1425 "0" + R_PAREN@1425..1426 ")" + WHITESPACE@1426..1427 " " + L_ANGLE@1427..1428 "<" + WHITESPACE@1428..1429 " " + PAREN_EXPR@1429..1437 + L_PAREN@1429..1430 "(" + BIN_EXPR@1430..1436 + PATH_EXPR@1430..1432 + PATH@1430..1432 + PATH_SEGMENT@1430..1432 + NAME_REF@1430..1432 + IDENT@1430..1432 "_x" + WHITESPACE@1432..1433 " " + EQ@1433..1434 "=" + WHITESPACE@1434..1435 " " + LITERAL@1435..1436 + INT_NUMBER@1435..1436 "0" + R_PAREN@1436..1437 ")" + SEMICOLON@1437..1438 ";" + WHITESPACE@1438..1443 "\n " + LET_STMT@1443..1474 + LET_KW@1443..1446 "let" + WHITESPACE@1446..1447 " " + BIND_PAT@1447..1449 + NAME@1447..1449 + IDENT@1447..1449 "_a" + WHITESPACE@1449..1450 " " + EQ@1450..1451 "=" + WHITESPACE@1451..1452 " " + BIN_EXPR@1452..1473 + PAREN_EXPR@1452..1461 + L_PAREN@1452..1453 "(" + BIN_EXPR@1453..1460 + PATH_EXPR@1453..1455 + PATH@1453..1455 + PATH_SEGMENT@1453..1455 + NAME_REF@1453..1455 + IDENT@1453..1455 "_x" + WHITESPACE@1455..1456 " " + PLUSEQ@1456..1458 "+=" + WHITESPACE@1458..1459 " " + LITERAL@1459..1460 + INT_NUMBER@1459..1460 "0" + R_PAREN@1460..1461 ")" + WHITESPACE@1461..1462 " " + EQ2@1462..1464 "==" + WHITESPACE@1464..1465 " " + PAREN_EXPR@1465..1473 + L_PAREN@1465..1466 "(" + BIN_EXPR@1466..1472 + PATH_EXPR@1466..1468 + PATH@1466..1468 + PATH_SEGMENT@1466..1468 + NAME_REF@1466..1468 + IDENT@1466..1468 "_x" + WHITESPACE@1468..1469 " " + EQ@1469..1470 "=" + WHITESPACE@1470..1471 " " + LITERAL@1471..1472 + INT_NUMBER@1471..1472 "0" + R_PAREN@1472..1473 ")" + SEMICOLON@1473..1474 ";" + WHITESPACE@1474..1479 "\n " + LET_STMT@1479..1537 + LET_KW@1479..1482 "let" + WHITESPACE@1482..1483 " " + BIND_PAT@1483..1485 + NAME@1483..1485 + IDENT@1483..1485 "_b" + WHITESPACE@1485..1486 " " + EQ@1486..1487 "=" + WHITESPACE@1487..1488 " " + BIN_EXPR@1488..1536 + CALL_EXPR@1488..1510 + PATH_EXPR@1488..1492 + PATH@1488..1492 + PATH_SEGMENT@1488..1492 + NAME_REF@1488..1492 + IDENT@1488..1492 "swap" + ARG_LIST@1492..1510 + L_PAREN@1492..1493 "(" + REF_EXPR@1493..1500 + AMP@1493..1494 "&" + MUT_KW@1494..1497 "mut" + WHITESPACE@1497..1498 " " + PATH_EXPR@1498..1500 + PATH@1498..1500 + PATH_SEGMENT@1498..1500 + NAME_REF@1498..1500 + IDENT@1498..1500 "_y" + COMMA@1500..1501 "," + WHITESPACE@1501..1502 " " + REF_EXPR@1502..1509 + AMP@1502..1503 "&" + MUT_KW@1503..1506 "mut" + WHITESPACE@1506..1507 " " + PATH_EXPR@1507..1509 + PATH@1507..1509 + PATH_SEGMENT@1507..1509 + NAME_REF@1507..1509 + IDENT@1507..1509 "_z" + R_PAREN@1509..1510 ")" + WHITESPACE@1510..1511 " " + EQ2@1511..1513 "==" + WHITESPACE@1513..1514 " " + CALL_EXPR@1514..1536 + PATH_EXPR@1514..1518 + PATH@1514..1518 + PATH_SEGMENT@1514..1518 + NAME_REF@1514..1518 + IDENT@1514..1518 "swap" + ARG_LIST@1518..1536 + L_PAREN@1518..1519 "(" + REF_EXPR@1519..1526 + AMP@1519..1520 "&" + MUT_KW@1520..1523 "mut" + WHITESPACE@1523..1524 " " + PATH_EXPR@1524..1526 + PATH@1524..1526 + PATH_SEGMENT@1524..1526 + NAME_REF@1524..1526 + IDENT@1524..1526 "_y" + COMMA@1526..1527 "," + WHITESPACE@1527..1528 " " + REF_EXPR@1528..1535 + AMP@1528..1529 "&" + MUT_KW@1529..1532 "mut" + WHITESPACE@1532..1533 " " + PATH_EXPR@1533..1535 + PATH@1533..1535 + PATH_SEGMENT@1533..1535 + NAME_REF@1533..1535 + IDENT@1533..1535 "_z" + R_PAREN@1535..1536 ")" + SEMICOLON@1536..1537 ";" + WHITESPACE@1537..1538 "\n" + R_CURLY@1538..1539 "}" + WHITESPACE@1539..1541 "\n\n" + FN_DEF@1541..1741 + FN_KW@1541..1543 "fn" + WHITESPACE@1543..1544 " " + NAME@1544..1557 + IDENT@1544..1557 "canttouchthis" + PARAM_LIST@1557..1559 + L_PAREN@1557..1558 "(" + R_PAREN@1558..1559 ")" + WHITESPACE@1559..1560 " " + RET_TYPE@1560..1568 + THIN_ARROW@1560..1562 "->" + WHITESPACE@1562..1563 " " + PATH_TYPE@1563..1568 + PATH@1563..1568 + PATH_SEGMENT@1563..1568 + NAME_REF@1563..1568 + IDENT@1563..1568 "usize" + WHITESPACE@1568..1569 " " + BLOCK_EXPR@1569..1741 + BLOCK@1569..1741 + L_CURLY@1569..1570 "{" + WHITESPACE@1570..1575 "\n " + FN_DEF@1575..1598 + FN_KW@1575..1577 "fn" + WHITESPACE@1577..1578 " " + NAME@1578..1579 + IDENT@1578..1579 "p" + PARAM_LIST@1579..1581 + L_PAREN@1579..1580 "(" + R_PAREN@1580..1581 ")" + WHITESPACE@1581..1582 " " + RET_TYPE@1582..1589 + THIN_ARROW@1582..1584 "->" + WHITESPACE@1584..1585 " " + PATH_TYPE@1585..1589 + PATH@1585..1589 + PATH_SEGMENT@1585..1589 + NAME_REF@1585..1589 + IDENT@1585..1589 "bool" + WHITESPACE@1589..1590 " " + BLOCK_EXPR@1590..1598 + BLOCK@1590..1598 + L_CURLY@1590..1591 "{" + WHITESPACE@1591..1592 " " + LITERAL@1592..1596 + TRUE_KW@1592..1596 "true" + WHITESPACE@1596..1597 " " + R_CURLY@1597..1598 "}" + WHITESPACE@1598..1603 "\n " + LET_STMT@1603..1648 + LET_KW@1603..1606 "let" + WHITESPACE@1606..1607 " " + BIND_PAT@1607..1609 + NAME@1607..1609 + IDENT@1607..1609 "_a" + WHITESPACE@1609..1610 " " + EQ@1610..1611 "=" + WHITESPACE@1611..1612 " " + PAREN_EXPR@1612..1647 + L_PAREN@1612..1613 "(" + BIN_EXPR@1613..1646 + MACRO_CALL@1613..1628 + PATH@1613..1619 + PATH_SEGMENT@1613..1619 + NAME_REF@1613..1619 + IDENT@1613..1619 "assert" + BANG@1619..1620 "!" + TOKEN_TREE@1620..1628 + L_PAREN@1620..1621 "(" + TOKEN_TREE@1621..1627 + L_PAREN@1621..1622 "(" + TRUE_KW@1622..1626 "true" + R_PAREN@1626..1627 ")" + R_PAREN@1627..1628 ")" + WHITESPACE@1628..1629 " " + EQ2@1629..1631 "==" + WHITESPACE@1631..1632 " " + PAREN_EXPR@1632..1646 + L_PAREN@1632..1633 "(" + MACRO_CALL@1633..1645 + PATH@1633..1639 + PATH_SEGMENT@1633..1639 + NAME_REF@1633..1639 + IDENT@1633..1639 "assert" + BANG@1639..1640 "!" + TOKEN_TREE@1640..1645 + L_PAREN@1640..1641 "(" + IDENT@1641..1642 "p" + TOKEN_TREE@1642..1644 + L_PAREN@1642..1643 "(" + R_PAREN@1643..1644 ")" + R_PAREN@1644..1645 ")" + R_PAREN@1645..1646 ")" + R_PAREN@1646..1647 ")" + SEMICOLON@1647..1648 ";" + WHITESPACE@1648..1653 "\n " + LET_STMT@1653..1685 + LET_KW@1653..1656 "let" + WHITESPACE@1656..1657 " " + BIND_PAT@1657..1659 + NAME@1657..1659 + IDENT@1657..1659 "_c" + WHITESPACE@1659..1660 " " + EQ@1660..1661 "=" + WHITESPACE@1661..1662 " " + PAREN_EXPR@1662..1684 + L_PAREN@1662..1663 "(" + BIN_EXPR@1663..1683 + MACRO_CALL@1663..1677 + PATH@1663..1669 + PATH_SEGMENT@1663..1669 + NAME_REF@1663..1669 + IDENT@1663..1669 "assert" + BANG@1669..1670 "!" + TOKEN_TREE@1670..1677 + L_PAREN@1670..1671 "(" + TOKEN_TREE@1671..1676 + L_PAREN@1671..1672 "(" + IDENT@1672..1673 "p" + TOKEN_TREE@1673..1675 + L_PAREN@1673..1674 "(" + R_PAREN@1674..1675 ")" + R_PAREN@1675..1676 ")" + R_PAREN@1676..1677 ")" + WHITESPACE@1677..1678 " " + EQ2@1678..1680 "==" + WHITESPACE@1680..1681 " " + TUPLE_EXPR@1681..1683 + L_PAREN@1681..1682 "(" + R_PAREN@1682..1683 ")" + R_PAREN@1683..1684 ")" + SEMICOLON@1684..1685 ";" + WHITESPACE@1685..1690 "\n " + LET_STMT@1690..1739 + LET_KW@1690..1693 "let" + WHITESPACE@1693..1694 " " + BIND_PAT@1694..1696 + NAME@1694..1696 + IDENT@1694..1696 "_b" + COLON@1696..1697 ":" + WHITESPACE@1697..1698 " " + PATH_TYPE@1698..1702 + PATH@1698..1702 + PATH_SEGMENT@1698..1702 + NAME_REF@1698..1702 + IDENT@1698..1702 "bool" + WHITESPACE@1702..1703 " " + EQ@1703..1704 "=" + WHITESPACE@1704..1705 " " + PAREN_EXPR@1705..1738 + L_PAREN@1705..1706 "(" + BIN_EXPR@1706..1737 + MACRO_CALL@1706..1723 + PATH@1706..1713 + PATH_SEGMENT@1706..1713 + NAME_REF@1706..1713 + IDENT@1706..1713 "println" + BANG@1713..1714 "!" + TOKEN_TREE@1714..1723 + L_PAREN@1714..1715 "(" + STRING@1715..1719 "\"{}\"" + COMMA@1719..1720 "," + WHITESPACE@1720..1721 " " + INT_NUMBER@1721..1722 "0" + R_PAREN@1722..1723 ")" + WHITESPACE@1723..1724 " " + EQ2@1724..1726 "==" + WHITESPACE@1726..1727 " " + PAREN_EXPR@1727..1737 + L_PAREN@1727..1728 "(" + RETURN_EXPR@1728..1736 + RETURN_KW@1728..1734 "return" + WHITESPACE@1734..1735 " " + LITERAL@1735..1736 + INT_NUMBER@1735..1736 "0" + R_PAREN@1736..1737 ")" + R_PAREN@1737..1738 ")" + SEMICOLON@1738..1739 ";" + WHITESPACE@1739..1740 "\n" + R_CURLY@1740..1741 "}" + WHITESPACE@1741..1743 "\n\n" + FN_DEF@1743..1904 + FN_KW@1743..1745 "fn" + WHITESPACE@1745..1746 " " + NAME@1746..1755 + IDENT@1746..1755 "angrydome" + PARAM_LIST@1755..1757 + L_PAREN@1755..1756 "(" + R_PAREN@1756..1757 ")" + WHITESPACE@1757..1758 " " + BLOCK_EXPR@1758..1904 + BLOCK@1758..1904 + L_CURLY@1758..1759 "{" + WHITESPACE@1759..1764 "\n " + EXPR_STMT@1764..1785 + LOOP_EXPR@1764..1785 + LOOP_KW@1764..1768 "loop" + WHITESPACE@1768..1769 " " + BLOCK_EXPR@1769..1785 + BLOCK@1769..1785 + L_CURLY@1769..1770 "{" + WHITESPACE@1770..1771 " " + IF_EXPR@1771..1783 + IF_KW@1771..1773 "if" + WHITESPACE@1773..1774 " " + CONDITION@1774..1779 + BREAK_EXPR@1774..1779 + BREAK_KW@1774..1779 "break" + WHITESPACE@1779..1780 " " + BLOCK_EXPR@1780..1783 + BLOCK@1780..1783 + L_CURLY@1780..1781 "{" + WHITESPACE@1781..1782 " " + R_CURLY@1782..1783 "}" + WHITESPACE@1783..1784 " " + R_CURLY@1784..1785 "}" + WHITESPACE@1785..1790 "\n " + LET_STMT@1790..1804 + LET_KW@1790..1793 "let" + WHITESPACE@1793..1794 " " + BIND_PAT@1794..1799 + MUT_KW@1794..1797 "mut" + WHITESPACE@1797..1798 " " + NAME@1798..1799 + IDENT@1798..1799 "i" + WHITESPACE@1799..1800 " " + EQ@1800..1801 "=" + WHITESPACE@1801..1802 " " + LITERAL@1802..1803 + INT_NUMBER@1802..1803 "0" + SEMICOLON@1803..1804 ";" + WHITESPACE@1804..1809 "\n " + LOOP_EXPR@1809..1902 + LOOP_KW@1809..1813 "loop" + WHITESPACE@1813..1814 " " + BLOCK_EXPR@1814..1902 + BLOCK@1814..1902 + L_CURLY@1814..1815 "{" + WHITESPACE@1815..1816 " " + EXPR_STMT@1816..1823 + BIN_EXPR@1816..1822 + PATH_EXPR@1816..1817 + PATH@1816..1817 + PATH_SEGMENT@1816..1817 + NAME_REF@1816..1817 + IDENT@1816..1817 "i" + WHITESPACE@1817..1818 " " + PLUSEQ@1818..1820 "+=" + WHITESPACE@1820..1821 " " + LITERAL@1821..1822 + INT_NUMBER@1821..1822 "1" + SEMICOLON@1822..1823 ";" + WHITESPACE@1823..1824 " " + EXPR_STMT@1824..1887 + IF_EXPR@1824..1887 + IF_KW@1824..1826 "if" + WHITESPACE@1826..1827 " " + CONDITION@1827..1833 + BIN_EXPR@1827..1833 + PATH_EXPR@1827..1828 + PATH@1827..1828 + PATH_SEGMENT@1827..1828 + NAME_REF@1827..1828 + IDENT@1827..1828 "i" + WHITESPACE@1828..1829 " " + EQ2@1829..1831 "==" + WHITESPACE@1831..1832 " " + LITERAL@1832..1833 + INT_NUMBER@1832..1833 "1" + WHITESPACE@1833..1834 " " + BLOCK_EXPR@1834..1887 + BLOCK@1834..1887 + L_CURLY@1834..1835 "{" + WHITESPACE@1835..1836 " " + MATCH_EXPR@1836..1885 + MATCH_KW@1836..1841 "match" + WHITESPACE@1841..1842 " " + PAREN_EXPR@1842..1852 + L_PAREN@1842..1843 "(" + CONTINUE_EXPR@1843..1851 + CONTINUE_KW@1843..1851 "continue" + R_PAREN@1851..1852 ")" + WHITESPACE@1852..1853 " " + MATCH_ARM_LIST@1853..1885 + L_CURLY@1853..1854 "{" + WHITESPACE@1854..1855 " " + MATCH_ARM@1855..1863 + LITERAL_PAT@1855..1856 + LITERAL@1855..1856 + INT_NUMBER@1855..1856 "1" + WHITESPACE@1856..1857 " " + FAT_ARROW@1857..1859 "=>" + WHITESPACE@1859..1860 " " + BLOCK_EXPR@1860..1863 + BLOCK@1860..1863 + L_CURLY@1860..1861 "{" + WHITESPACE@1861..1862 " " + R_CURLY@1862..1863 "}" + COMMA@1863..1864 "," + WHITESPACE@1864..1865 " " + MATCH_ARM@1865..1883 + PLACEHOLDER_PAT@1865..1866 + UNDERSCORE@1865..1866 "_" + WHITESPACE@1866..1867 " " + FAT_ARROW@1867..1869 "=>" + WHITESPACE@1869..1870 " " + MACRO_CALL@1870..1883 + PATH@1870..1875 + PATH_SEGMENT@1870..1875 + NAME_REF@1870..1875 + IDENT@1870..1875 "panic" + BANG@1875..1876 "!" + TOKEN_TREE@1876..1883 + L_PAREN@1876..1877 "(" + STRING@1877..1882 "\"wat\"" + R_PAREN@1882..1883 ")" + WHITESPACE@1883..1884 " " + R_CURLY@1884..1885 "}" + WHITESPACE@1885..1886 " " + R_CURLY@1886..1887 "}" + WHITESPACE@1887..1894 "\n " + EXPR_STMT@1894..1900 + BREAK_EXPR@1894..1899 + BREAK_KW@1894..1899 "break" + SEMICOLON@1899..1900 ";" + WHITESPACE@1900..1901 " " + R_CURLY@1901..1902 "}" + WHITESPACE@1902..1903 "\n" + R_CURLY@1903..1904 "}" + WHITESPACE@1904..1906 "\n\n" + FN_DEF@1906..1960 + FN_KW@1906..1908 "fn" + WHITESPACE@1908..1909 " " + NAME@1909..1921 + IDENT@1909..1921 "evil_lincoln" + PARAM_LIST@1921..1923 + L_PAREN@1921..1922 "(" + R_PAREN@1922..1923 ")" + WHITESPACE@1923..1924 " " + BLOCK_EXPR@1924..1960 + BLOCK@1924..1960 + L_CURLY@1924..1925 "{" + WHITESPACE@1925..1926 " " + LET_STMT@1926..1958 + LET_KW@1926..1929 "let" + WHITESPACE@1929..1930 " " + BIND_PAT@1930..1935 + NAME@1930..1935 + IDENT@1930..1935 "_evil" + WHITESPACE@1935..1936 " " + EQ@1936..1937 "=" + WHITESPACE@1937..1938 " " + MACRO_CALL@1938..1957 + PATH@1938..1945 + PATH_SEGMENT@1938..1945 + NAME_REF@1938..1945 + IDENT@1938..1945 "println" + BANG@1945..1946 "!" + TOKEN_TREE@1946..1957 + L_PAREN@1946..1947 "(" + STRING@1947..1956 "\"lincoln\"" + R_PAREN@1956..1957 ")" + SEMICOLON@1957..1958 ";" + WHITESPACE@1958..1959 " " + R_CURLY@1959..1960 "}" + WHITESPACE@1960..1962 "\n\n" + FN_DEF@1962..2198 + FN_KW@1962..1964 "fn" + WHITESPACE@1964..1965 " " + NAME@1965..1969 + IDENT@1965..1969 "dots" + PARAM_LIST@1969..1971 + L_PAREN@1969..1970 "(" + R_PAREN@1970..1971 ")" + WHITESPACE@1971..1972 " " + BLOCK_EXPR@1972..2198 + BLOCK@1972..2198 + L_CURLY@1972..1973 "{" + WHITESPACE@1973..1978 "\n " + EXPR_STMT@1978..2196 + MACRO_CALL@1978..2195 + PATH@1978..1987 + PATH_SEGMENT@1978..1987 + NAME_REF@1978..1987 + IDENT@1978..1987 "assert_eq" + BANG@1987..1988 "!" + TOKEN_TREE@1988..2195 + L_PAREN@1988..1989 "(" + IDENT@1989..1995 "String" + COLON@1995..1996 ":" + COLON@1996..1997 ":" + IDENT@1997..2001 "from" + TOKEN_TREE@2001..2055 + L_PAREN@2001..2002 "(" + STRING@2002..2054 "\".................... ..." + R_PAREN@2054..2055 ")" + COMMA@2055..2056 "," + WHITESPACE@2056..2072 "\n " + IDENT@2072..2078 "format" + BANG@2078..2079 "!" + TOKEN_TREE@2079..2194 + L_PAREN@2079..2080 "(" + STRING@2080..2086 "\"{:?}\"" + COMMA@2086..2087 "," + WHITESPACE@2087..2088 " " + DOT@2088..2089 "." + DOT@2089..2090 "." + WHITESPACE@2090..2091 " " + DOT@2091..2092 "." + DOT@2092..2093 "." + WHITESPACE@2093..2094 " " + DOT@2094..2095 "." + DOT@2095..2096 "." + WHITESPACE@2096..2097 " " + DOT@2097..2098 "." + DOT@2098..2099 "." + WHITESPACE@2099..2100 " " + DOT@2100..2101 "." + DOT@2101..2102 "." + WHITESPACE@2102..2103 " " + DOT@2103..2104 "." + DOT@2104..2105 "." + WHITESPACE@2105..2106 " " + DOT@2106..2107 "." + DOT@2107..2108 "." + WHITESPACE@2108..2109 " " + DOT@2109..2110 "." + DOT@2110..2111 "." + WHITESPACE@2111..2112 " " + DOT@2112..2113 "." + DOT@2113..2114 "." + WHITESPACE@2114..2115 " " + DOT@2115..2116 "." + DOT@2116..2117 "." + WHITESPACE@2117..2118 " " + DOT@2118..2119 "." + DOT@2119..2120 "." + WHITESPACE@2120..2121 " " + DOT@2121..2122 "." + DOT@2122..2123 "." + WHITESPACE@2123..2124 " " + DOT@2124..2125 "." + DOT@2125..2126 "." + WHITESPACE@2126..2158 "\n ..." + DOT@2158..2159 "." + DOT@2159..2160 "." + WHITESPACE@2160..2161 " " + DOT@2161..2162 "." + DOT@2162..2163 "." + WHITESPACE@2163..2164 " " + DOT@2164..2165 "." + DOT@2165..2166 "." + WHITESPACE@2166..2167 " " + DOT@2167..2168 "." + DOT@2168..2169 "." + WHITESPACE@2169..2170 " " + DOT@2170..2171 "." + DOT@2171..2172 "." + WHITESPACE@2172..2173 " " + DOT@2173..2174 "." + DOT@2174..2175 "." + WHITESPACE@2175..2176 " " + DOT@2176..2177 "." + DOT@2177..2178 "." + WHITESPACE@2178..2179 " " + DOT@2179..2180 "." + DOT@2180..2181 "." + WHITESPACE@2181..2182 " " + DOT@2182..2183 "." + DOT@2183..2184 "." + WHITESPACE@2184..2185 " " + DOT@2185..2186 "." + DOT@2186..2187 "." + WHITESPACE@2187..2188 " " + DOT@2188..2189 "." + DOT@2189..2190 "." + WHITESPACE@2190..2191 " " + DOT@2191..2192 "." + DOT@2192..2193 "." + R_PAREN@2193..2194 ")" + R_PAREN@2194..2195 ")" + SEMICOLON@2195..2196 ";" + WHITESPACE@2196..2197 "\n" + R_CURLY@2197..2198 "}" + WHITESPACE@2198..2200 "\n\n" + FN_DEF@2200..2693 + FN_KW@2200..2202 "fn" + WHITESPACE@2202..2203 " " + NAME@2203..2205 + IDENT@2203..2205 "u8" + PARAM_LIST@2205..2213 + L_PAREN@2205..2206 "(" + PARAM@2206..2212 + BIND_PAT@2206..2208 + NAME@2206..2208 + IDENT@2206..2208 "u8" + COLON@2208..2209 ":" + WHITESPACE@2209..2210 " " + PATH_TYPE@2210..2212 + PATH@2210..2212 + PATH_SEGMENT@2210..2212 + NAME_REF@2210..2212 + IDENT@2210..2212 "u8" + R_PAREN@2212..2213 ")" + WHITESPACE@2213..2214 " " + BLOCK_EXPR@2214..2693 + BLOCK@2214..2693 + L_CURLY@2214..2215 "{" + WHITESPACE@2215..2220 "\n " + IF_EXPR@2220..2691 + IF_KW@2220..2222 "if" + WHITESPACE@2222..2223 " " + CONDITION@2223..2232 + BIN_EXPR@2223..2232 + PATH_EXPR@2223..2225 + PATH@2223..2225 + PATH_SEGMENT@2223..2225 + NAME_REF@2223..2225 + IDENT@2223..2225 "u8" + WHITESPACE@2225..2226 " " + NEQ@2226..2228 "!=" + WHITESPACE@2228..2229 " " + LITERAL@2229..2232 + INT_NUMBER@2229..2232 "0u8" + WHITESPACE@2232..2233 " " + BLOCK_EXPR@2233..2691 + BLOCK@2233..2691 + L_CURLY@2233..2234 "{" + WHITESPACE@2234..2243 "\n " + EXPR_STMT@2243..2685 + MACRO_CALL@2243..2684 + PATH@2243..2252 + PATH_SEGMENT@2243..2252 + NAME_REF@2243..2252 + IDENT@2243..2252 "assert_eq" + BANG@2252..2253 "!" + TOKEN_TREE@2253..2684 + L_PAREN@2253..2254 "(" + INT_NUMBER@2254..2257 "8u8" + COMMA@2257..2258 "," + WHITESPACE@2258..2259 " " + TOKEN_TREE@2259..2683 + L_CURLY@2259..2260 "{" + WHITESPACE@2260..2273 "\n " + IDENT@2273..2284 "macro_rules" + BANG@2284..2285 "!" + WHITESPACE@2285..2286 " " + IDENT@2286..2288 "u8" + WHITESPACE@2288..2289 " " + TOKEN_TREE@2289..2567 + L_CURLY@2289..2290 "{" + WHITESPACE@2290..2307 "\n " + TOKEN_TREE@2307..2311 + L_PAREN@2307..2308 "(" + IDENT@2308..2310 "u8" + R_PAREN@2310..2311 ")" + WHITESPACE@2311..2312 " " + EQ@2312..2313 "=" + R_ANGLE@2313..2314 ">" + WHITESPACE@2314..2315 " " + TOKEN_TREE@2315..2552 + L_CURLY@2315..2316 "{" + WHITESPACE@2316..2337 "\n " + MOD_KW@2337..2340 "mod" + WHITESPACE@2340..2341 " " + IDENT@2341..2343 "u8" + WHITESPACE@2343..2344 " " + TOKEN_TREE@2344..2534 + L_CURLY@2344..2345 "{" + WHITESPACE@2345..2370 "\n ..." + PUB_KW@2370..2373 "pub" + WHITESPACE@2373..2374 " " + FN_KW@2374..2376 "fn" + WHITESPACE@2376..2377 " " + IDENT@2377..2379 "u8" + L_ANGLE@2379..2380 "<" + LIFETIME@2380..2383 "\'u8" + COLON@2383..2384 ":" + WHITESPACE@2384..2385 " " + LIFETIME@2385..2388 "\'u8" + WHITESPACE@2388..2389 " " + PLUS@2389..2390 "+" + WHITESPACE@2390..2391 " " + LIFETIME@2391..2394 "\'u8" + R_ANGLE@2394..2395 ">" + TOKEN_TREE@2395..2408 + L_PAREN@2395..2396 "(" + IDENT@2396..2398 "u8" + COLON@2398..2399 ":" + WHITESPACE@2399..2400 " " + AMP@2400..2401 "&" + LIFETIME@2401..2404 "\'u8" + WHITESPACE@2404..2405 " " + IDENT@2405..2407 "u8" + R_PAREN@2407..2408 ")" + WHITESPACE@2408..2409 " " + MINUS@2409..2410 "-" + R_ANGLE@2410..2411 ">" + WHITESPACE@2411..2412 " " + AMP@2412..2413 "&" + LIFETIME@2413..2416 "\'u8" + WHITESPACE@2416..2417 " " + IDENT@2417..2419 "u8" + WHITESPACE@2419..2420 " " + TOKEN_TREE@2420..2512 + L_CURLY@2420..2421 "{" + WHITESPACE@2421..2450 "\n ..." + STRING@2450..2454 "\"u8\"" + SEMICOLON@2454..2455 ";" + WHITESPACE@2455..2484 "\n ..." + IDENT@2484..2486 "u8" + WHITESPACE@2486..2511 "\n ..." + R_CURLY@2511..2512 "}" + WHITESPACE@2512..2533 "\n " + R_CURLY@2533..2534 "}" + WHITESPACE@2534..2551 "\n " + R_CURLY@2551..2552 "}" + SEMICOLON@2552..2553 ";" + WHITESPACE@2553..2566 "\n " + R_CURLY@2566..2567 "}" + WHITESPACE@2567..2581 "\n\n " + IDENT@2581..2583 "u8" + BANG@2583..2584 "!" + TOKEN_TREE@2584..2588 + L_PAREN@2584..2585 "(" + IDENT@2585..2587 "u8" + R_PAREN@2587..2588 ")" + SEMICOLON@2588..2589 ";" + WHITESPACE@2589..2602 "\n " + LET_KW@2602..2605 "let" + WHITESPACE@2605..2606 " " + AMP@2606..2607 "&" + IDENT@2607..2609 "u8" + COLON@2609..2610 ":" + WHITESPACE@2610..2611 " " + AMP@2611..2612 "&" + IDENT@2612..2614 "u8" + WHITESPACE@2614..2615 " " + EQ@2615..2616 "=" + WHITESPACE@2616..2617 " " + IDENT@2617..2619 "u8" + COLON@2619..2620 ":" + COLON@2620..2621 ":" + IDENT@2621..2623 "u8" + TOKEN_TREE@2623..2629 + L_PAREN@2623..2624 "(" + AMP@2624..2625 "&" + INT_NUMBER@2625..2628 "8u8" + R_PAREN@2628..2629 ")" + SEMICOLON@2629..2630 ";" + WHITESPACE@2630..2643 "\n " + CRATE_KW@2643..2648 "crate" + COLON@2648..2649 ":" + COLON@2649..2650 ":" + IDENT@2650..2652 "u8" + TOKEN_TREE@2652..2657 + L_PAREN@2652..2653 "(" + INT_NUMBER@2653..2656 "0u8" + R_PAREN@2656..2657 ")" + SEMICOLON@2657..2658 ";" + WHITESPACE@2658..2671 "\n " + IDENT@2671..2673 "u8" + WHITESPACE@2673..2682 "\n " + R_CURLY@2682..2683 "}" + R_PAREN@2683..2684 ")" + SEMICOLON@2684..2685 ";" + WHITESPACE@2685..2690 "\n " + R_CURLY@2690..2691 "}" + WHITESPACE@2691..2692 "\n" + R_CURLY@2692..2693 "}" + WHITESPACE@2693..2695 "\n\n" + FN_DEF@2695..2832 + FN_KW@2695..2697 "fn" + WHITESPACE@2697..2698 " " + NAME@2698..2703 + IDENT@2698..2703 "fishy" + PARAM_LIST@2703..2705 + L_PAREN@2703..2704 "(" + R_PAREN@2704..2705 ")" + WHITESPACE@2705..2706 " " + BLOCK_EXPR@2706..2832 + BLOCK@2706..2832 + L_CURLY@2706..2707 "{" + WHITESPACE@2707..2712 "\n " + EXPR_STMT@2712..2830 + MACRO_CALL@2712..2829 + PATH@2712..2721 + PATH_SEGMENT@2712..2721 + NAME_REF@2712..2721 + IDENT@2712..2721 "assert_eq" + BANG@2721..2722 "!" + TOKEN_TREE@2722..2829 + L_PAREN@2722..2723 "(" + IDENT@2723..2729 "String" + COLON@2729..2730 ":" + COLON@2730..2731 ":" + IDENT@2731..2735 "from" + TOKEN_TREE@2735..2742 + L_PAREN@2735..2736 "(" + STRING@2736..2741 "\"><>\"" + R_PAREN@2741..2742 ")" + COMMA@2742..2743 "," + WHITESPACE@2743..2759 "\n " + IDENT@2759..2765 "String" + COLON@2765..2766 ":" + COLON@2766..2767 ":" + L_ANGLE@2767..2768 "<" + R_ANGLE@2768..2769 ">" + COLON@2769..2770 ":" + COLON@2770..2771 ":" + IDENT@2771..2775 "from" + COLON@2775..2776 ":" + COLON@2776..2777 ":" + L_ANGLE@2777..2778 "<" + R_ANGLE@2778..2779 ">" + TOKEN_TREE@2779..2786 + L_PAREN@2779..2780 "(" + STRING@2780..2785 "\"><>\"" + R_PAREN@2785..2786 ")" + DOT@2786..2787 "." + IDENT@2787..2792 "chars" + COLON@2792..2793 ":" + COLON@2793..2794 ":" + L_ANGLE@2794..2795 "<" + R_ANGLE@2795..2796 ">" + TOKEN_TREE@2796..2798 + L_PAREN@2796..2797 "(" + R_PAREN@2797..2798 ")" + DOT@2798..2799 "." + IDENT@2799..2802 "rev" + COLON@2802..2803 ":" + COLON@2803..2804 ":" + L_ANGLE@2804..2805 "<" + R_ANGLE@2805..2806 ">" + TOKEN_TREE@2806..2808 + L_PAREN@2806..2807 "(" + R_PAREN@2807..2808 ")" + DOT@2808..2809 "." + IDENT@2809..2816 "collect" + COLON@2816..2817 ":" + COLON@2817..2818 ":" + L_ANGLE@2818..2819 "<" + IDENT@2819..2825 "String" + R_ANGLE@2825..2826 ">" + TOKEN_TREE@2826..2828 + L_PAREN@2826..2827 "(" + R_PAREN@2827..2828 ")" + R_PAREN@2828..2829 ")" + SEMICOLON@2829..2830 ";" + WHITESPACE@2830..2831 "\n" + R_CURLY@2831..2832 "}" + WHITESPACE@2832..2834 "\n\n" + FN_DEF@2834..2906 + FN_KW@2834..2836 "fn" + WHITESPACE@2836..2837 " " + NAME@2837..2842 + IDENT@2837..2842 "union" + PARAM_LIST@2842..2844 + L_PAREN@2842..2843 "(" + R_PAREN@2843..2844 ")" + WHITESPACE@2844..2845 " " + BLOCK_EXPR@2845..2906 + BLOCK@2845..2906 + L_CURLY@2845..2846 "{" + WHITESPACE@2846..2851 "\n " + UNION_DEF@2851..2904 + UNION_KW@2851..2856 "union" + WHITESPACE@2856..2857 " " + NAME@2857..2862 + IDENT@2857..2862 "union" + TYPE_PARAM_LIST@2862..2870 + L_ANGLE@2862..2863 "<" + LIFETIME_PARAM@2863..2869 + LIFETIME@2863..2869 "\'union" + R_ANGLE@2869..2870 ">" + WHITESPACE@2870..2871 " " + RECORD_FIELD_DEF_LIST@2871..2904 + L_CURLY@2871..2872 "{" + WHITESPACE@2872..2873 " " + RECORD_FIELD_DEF@2873..2901 + NAME@2873..2878 + IDENT@2873..2878 "union" + COLON@2878..2879 ":" + WHITESPACE@2879..2880 " " + REFERENCE_TYPE@2880..2901 + AMP@2880..2881 "&" + LIFETIME@2881..2887 "\'union" + WHITESPACE@2887..2888 " " + PATH_TYPE@2888..2901 + PATH@2888..2901 + PATH_SEGMENT@2888..2901 + NAME_REF@2888..2893 + IDENT@2888..2893 "union" + TYPE_ARG_LIST@2893..2901 + L_ANGLE@2893..2894 "<" + LIFETIME_ARG@2894..2900 + LIFETIME@2894..2900 "\'union" + R_ANGLE@2900..2901 ">" + COMMA@2901..2902 "," + WHITESPACE@2902..2903 " " + R_CURLY@2903..2904 "}" + WHITESPACE@2904..2905 "\n" + R_CURLY@2905..2906 "}" + WHITESPACE@2906..2908 "\n\n" + FN_DEF@2908..3042 + FN_KW@2908..2910 "fn" + WHITESPACE@2910..2911 " " + NAME@2911..2929 + IDENT@2911..2929 "special_characters" + PARAM_LIST@2929..2931 + L_PAREN@2929..2930 "(" + R_PAREN@2930..2931 ")" + WHITESPACE@2931..2932 " " + BLOCK_EXPR@2932..3042 + BLOCK@2932..3042 + L_CURLY@2932..2933 "{" + WHITESPACE@2933..2938 "\n " + LET_STMT@2938..3021 + LET_KW@2938..2941 "let" + WHITESPACE@2941..2942 " " + BIND_PAT@2942..2945 + NAME@2942..2945 + IDENT@2942..2945 "val" + WHITESPACE@2945..2946 " " + EQ@2946..2947 "=" + WHITESPACE@2947..2948 " " + PREFIX_EXPR@2948..3013 + BANG@2948..2949 "!" + PAREN_EXPR@2949..3013 + L_PAREN@2949..2950 "(" + BIN_EXPR@2950..3012 + CALL_EXPR@2950..2995 + PAREN_EXPR@2950..2971 + L_PAREN@2950..2951 "(" + LAMBDA_EXPR@2951..2970 + PARAM_LIST@2951..2968 + PIPE@2951..2952 "|" + PARAM@2952..2962 + TUPLE_PAT@2952..2956 + L_PAREN@2952..2953 "(" + DOT_DOT_PAT@2953..2955 + DOT2@2953..2955 ".." + R_PAREN@2955..2956 ")" + COLON@2956..2957 ":" + TUPLE_TYPE@2957..2962 + L_PAREN@2957..2958 "(" + PLACEHOLDER_TYPE@2958..2959 + UNDERSCORE@2958..2959 "_" + COMMA@2959..2960 "," + PLACEHOLDER_TYPE@2960..2961 + UNDERSCORE@2960..2961 "_" + R_PAREN@2961..2962 ")" + COMMA@2962..2963 "," + PARAM@2963..2967 + BIND_PAT@2963..2967 + NAME@2963..2965 + IDENT@2963..2965 "__" + AT@2965..2966 "@" + PLACEHOLDER_PAT@2966..2967 + UNDERSCORE@2966..2967 "_" + PIPE@2967..2968 "|" + PATH_EXPR@2968..2970 + PATH@2968..2970 + PATH_SEGMENT@2968..2970 + NAME_REF@2968..2970 + IDENT@2968..2970 "__" + R_PAREN@2970..2971 ")" + ARG_LIST@2971..2995 + L_PAREN@2971..2972 "(" + TUPLE_EXPR@2972..2987 + L_PAREN@2972..2973 "(" + REF_EXPR@2973..2979 + AMP@2973..2974 "&" + PREFIX_EXPR@2974..2979 + STAR@2974..2975 "*" + LITERAL@2975..2979 + STRING@2975..2979 "\"\\\\\"" + COMMA@2979..2980 "," + LITERAL@2980..2986 + CHAR@2980..2986 "\'🤔\'" + R_PAREN@2986..2987 ")" + COMMENT@2987..2991 "/**/" + COMMA@2991..2992 "," + BLOCK_EXPR@2992..2994 + BLOCK@2992..2994 + L_CURLY@2992..2993 "{" + R_CURLY@2993..2994 "}" + R_PAREN@2994..2995 ")" + EQ2@2995..2997 "==" + BLOCK_EXPR@2997..3012 + BLOCK@2997..3012 + L_CURLY@2997..2998 "{" + EXPR_STMT@2998..3011 + REF_EXPR@2998..3010 + AMP@2998..2999 "&" + INDEX_EXPR@2999..3010 + ARRAY_EXPR@2999..3006 + L_BRACK@2999..3000 "[" + RANGE_EXPR@3000..3005 + DOT2EQ@3000..3003 "..=" + RANGE_EXPR@3003..3005 + DOT2@3003..3005 ".." + R_BRACK@3005..3006 "]" + L_BRACK@3006..3007 "[" + RANGE_EXPR@3007..3009 + DOT2@3007..3009 ".." + R_BRACK@3009..3010 "]" + SEMICOLON@3010..3011 ";" + R_CURLY@3011..3012 "}" + R_PAREN@3012..3013 ")" + COMMENT@3013..3015 "//" + WHITESPACE@3015..3020 "\n " + SEMICOLON@3020..3021 ";" + WHITESPACE@3021..3026 "\n " + EXPR_STMT@3026..3040 + MACRO_CALL@3026..3039 + PATH@3026..3032 + PATH_SEGMENT@3026..3032 + NAME_REF@3026..3032 + IDENT@3026..3032 "assert" + BANG@3032..3033 "!" + TOKEN_TREE@3033..3039 + L_PAREN@3033..3034 "(" + BANG@3034..3035 "!" + IDENT@3035..3038 "val" + R_PAREN@3038..3039 ")" + SEMICOLON@3039..3040 ";" + WHITESPACE@3040..3041 "\n" + R_CURLY@3041..3042 "}" + WHITESPACE@3042..3044 "\n\n" + FN_DEF@3044..3514 + FN_KW@3044..3046 "fn" + WHITESPACE@3046..3047 " " + NAME@3047..3057 + IDENT@3047..3057 "punch_card" + PARAM_LIST@3057..3059 + L_PAREN@3057..3058 "(" + R_PAREN@3058..3059 ")" + WHITESPACE@3059..3060 " " + RET_TYPE@3060..3083 + THIN_ARROW@3060..3062 "->" + WHITESPACE@3062..3063 " " + IMPL_TRAIT_TYPE@3063..3083 + IMPL_KW@3063..3067 "impl" + WHITESPACE@3067..3068 " " + TYPE_BOUND_LIST@3068..3083 + TYPE_BOUND@3068..3083 + PATH_TYPE@3068..3083 + PATH@3068..3083 + PATH@3068..3076 + PATH@3068..3071 + PATH_SEGMENT@3068..3071 + NAME_REF@3068..3071 + IDENT@3068..3071 "std" + COLON2@3071..3073 "::" + PATH_SEGMENT@3073..3076 + NAME_REF@3073..3076 + IDENT@3073..3076 "fmt" + COLON2@3076..3078 "::" + PATH_SEGMENT@3078..3083 + NAME_REF@3078..3083 + IDENT@3078..3083 "Debug" + WHITESPACE@3083..3084 " " + BLOCK_EXPR@3084..3514 + BLOCK@3084..3514 + L_CURLY@3084..3085 "{" + WHITESPACE@3085..3090 "\n " + RANGE_EXPR@3090..3512 + DOT2EQ@3090..3093 "..=" + RANGE_EXPR@3093..3512 + DOT2EQ@3093..3096 "..=" + RANGE_EXPR@3096..3512 + DOT2@3096..3098 ".." + WHITESPACE@3098..3099 " " + RANGE_EXPR@3099..3512 + DOT2@3099..3101 ".." + WHITESPACE@3101..3105 " " + RANGE_EXPR@3105..3512 + DOT2@3105..3107 ".." + WHITESPACE@3107..3108 " " + RANGE_EXPR@3108..3512 + DOT2@3108..3110 ".." + WHITESPACE@3110..3111 " " + RANGE_EXPR@3111..3512 + DOT2@3111..3113 ".." + WHITESPACE@3113..3114 " " + RANGE_EXPR@3114..3512 + DOT2@3114..3116 ".." + WHITESPACE@3116..3120 " " + RANGE_EXPR@3120..3512 + DOT2@3120..3122 ".." + WHITESPACE@3122..3123 " " + RANGE_EXPR@3123..3512 + DOT2@3123..3125 ".." + WHITESPACE@3125..3126 " " + RANGE_EXPR@3126..3512 + DOT2@3126..3128 ".." + WHITESPACE@3128..3129 " " + RANGE_EXPR@3129..3512 + DOT2@3129..3131 ".." + WHITESPACE@3131..3135 " " + RANGE_EXPR@3135..3512 + DOT2@3135..3137 ".." + WHITESPACE@3137..3138 " " + RANGE_EXPR@3138..3512 + DOT2EQ@3138..3141 "..=" + RANGE_EXPR@3141..3512 + DOT2@3141..3143 ".." + WHITESPACE@3143..3144 " " + RANGE_EXPR@3144..3512 + DOT2@3144..3146 ".." + WHITESPACE@3146..3151 "\n " + RANGE_EXPR@3151..3512 + DOT2EQ@3151..3154 "..=" + RANGE_EXPR@3154..3512 + DOT2@3154..3156 ".." + WHITESPACE@3156..3157 " " + RANGE_EXPR@3157..3512 + DOT2EQ@3157..3160 "..=" + RANGE_EXPR@3160..3512 + DOT2@3160..3162 ".." + WHITESPACE@3162..3166 " " + RANGE_EXPR@3166..3512 + DOT2@3166..3168 ".." + WHITESPACE@3168..3169 " " + RANGE_EXPR@3169..3512 + DOT2@3169..3171 ".." + WHITESPACE@3171..3172 " " + RANGE_EXPR@3172..3512 + DOT2@3172..3174 ".." + WHITESPACE@3174..3175 " " + RANGE_EXPR@3175..3512 + DOT2@3175..3177 ".." + WHITESPACE@3177..3181 " " + RANGE_EXPR@3181..3512 + DOT2@3181..3183 ".." + WHITESPACE@3183..3184 " " + RANGE_EXPR@3184..3512 + DOT2@3184..3186 ".." + WHITESPACE@3186..3187 " " + RANGE_EXPR@3187..3512 + DOT2@3187..3189 ".." + WHITESPACE@3189..3190 " " + RANGE_EXPR@3190..3512 + DOT2@3190..3192 ".." + WHITESPACE@3192..3196 " " + RANGE_EXPR@3196..3512 + DOT2EQ@3196..3199 "..=" + RANGE_EXPR@3199..3512 + DOT2EQ@3199..3202 "..=" + RANGE_EXPR@3202..3512 + DOT2EQ@3202..3205 "..=" + RANGE_EXPR@3205..3512 + DOT2@3205..3207 ".." + WHITESPACE@3207..3212 "\n " + RANGE_EXPR@3212..3512 + DOT2EQ@3212..3215 "..=" + RANGE_EXPR@3215..3512 + DOT2@3215..3217 ".." + WHITESPACE@3217..3218 " " + RANGE_EXPR@3218..3512 + DOT2EQ@3218..3221 "..=" + RANGE_EXPR@3221..3512 + DOT2@3221..3223 ".." + WHITESPACE@3223..3227 " " + RANGE_EXPR@3227..3512 + DOT2EQ@3227..3230 "..=" + RANGE_EXPR@3230..3512 + DOT2@3230..3232 ".." + WHITESPACE@3232..3233 " " + RANGE_EXPR@3233..3512 + DOT2EQ@3233..3236 "..=" + RANGE_EXPR@3236..3512 + DOT2@3236..3238 ".." + WHITESPACE@3238..3242 " " + RANGE_EXPR@3242..3512 + DOT2@3242..3244 ".." + WHITESPACE@3244..3245 " " + RANGE_EXPR@3245..3512 + DOT2EQ@3245..3248 "..=" + RANGE_EXPR@3248..3512 + DOT2EQ@3248..3251 "..=" + RANGE_EXPR@3251..3512 + DOT2@3251..3253 ".." + WHITESPACE@3253..3257 " " + RANGE_EXPR@3257..3512 + DOT2@3257..3259 ".." + WHITESPACE@3259..3260 " " + RANGE_EXPR@3260..3512 + DOT2EQ@3260..3263 "..=" + RANGE_EXPR@3263..3512 + DOT2@3263..3265 ".." + WHITESPACE@3265..3266 " " + RANGE_EXPR@3266..3512 + DOT2@3266..3268 ".." + WHITESPACE@3268..3273 "\n " + RANGE_EXPR@3273..3512 + DOT2EQ@3273..3276 "..=" + RANGE_EXPR@3276..3512 + DOT2EQ@3276..3279 "..=" + RANGE_EXPR@3279..3512 + DOT2@3279..3281 ".." + WHITESPACE@3281..3282 " " + RANGE_EXPR@3282..3512 + DOT2@3282..3284 ".." + WHITESPACE@3284..3288 " " + RANGE_EXPR@3288..3512 + DOT2EQ@3288..3291 "..=" + RANGE_EXPR@3291..3512 + DOT2@3291..3293 ".." + WHITESPACE@3293..3294 " " + RANGE_EXPR@3294..3512 + DOT2EQ@3294..3297 "..=" + RANGE_EXPR@3297..3512 + DOT2@3297..3299 ".." + WHITESPACE@3299..3303 " " + RANGE_EXPR@3303..3512 + DOT2EQ@3303..3306 "..=" + RANGE_EXPR@3306..3512 + DOT2@3306..3308 ".." + WHITESPACE@3308..3309 " " + RANGE_EXPR@3309..3512 + DOT2@3309..3311 ".." + WHITESPACE@3311..3312 " " + RANGE_EXPR@3312..3512 + DOT2@3312..3314 ".." + WHITESPACE@3314..3318 " " + RANGE_EXPR@3318..3512 + DOT2@3318..3320 ".." + WHITESPACE@3320..3321 " " + RANGE_EXPR@3321..3512 + DOT2EQ@3321..3324 "..=" + RANGE_EXPR@3324..3512 + DOT2@3324..3326 ".." + WHITESPACE@3326..3327 " " + RANGE_EXPR@3327..3512 + DOT2@3327..3329 ".." + WHITESPACE@3329..3334 "\n " + RANGE_EXPR@3334..3512 + DOT2EQ@3334..3337 "..=" + RANGE_EXPR@3337..3512 + DOT2@3337..3339 ".." + WHITESPACE@3339..3340 " " + RANGE_EXPR@3340..3512 + DOT2EQ@3340..3343 "..=" + RANGE_EXPR@3343..3512 + DOT2@3343..3345 ".." + WHITESPACE@3345..3349 " " + RANGE_EXPR@3349..3512 + DOT2EQ@3349..3352 "..=" + RANGE_EXPR@3352..3512 + DOT2@3352..3354 ".." + WHITESPACE@3354..3355 " " + RANGE_EXPR@3355..3512 + DOT2EQ@3355..3358 "..=" + RANGE_EXPR@3358..3512 + DOT2@3358..3360 ".." + WHITESPACE@3360..3364 " " + RANGE_EXPR@3364..3512 + DOT2@3364..3366 ".." + WHITESPACE@3366..3367 " " + RANGE_EXPR@3367..3512 + DOT2EQ@3367..3370 "..=" + RANGE_EXPR@3370..3512 + DOT2@3370..3372 ".." + WHITESPACE@3372..3373 " " + RANGE_EXPR@3373..3512 + DOT2@3373..3375 ".." + WHITESPACE@3375..3379 " " + RANGE_EXPR@3379..3512 + DOT2@3379..3381 ".." + WHITESPACE@3381..3382 " " + RANGE_EXPR@3382..3512 + DOT2EQ@3382..3385 "..=" + RANGE_EXPR@3385..3512 + DOT2@3385..3387 ".." + WHITESPACE@3387..3388 " " + RANGE_EXPR@3388..3512 + DOT2@3388..3390 ".." + WHITESPACE@3390..3395 "\n " + RANGE_EXPR@3395..3512 + DOT2EQ@3395..3398 "..=" + RANGE_EXPR@3398..3512 + DOT2@3398..3400 ".." + WHITESPACE@3400..3401 " " + RANGE_EXPR@3401..3512 + DOT2EQ@3401..3404 "..=" + RANGE_EXPR@3404..3512 + DOT2@3404..3406 ".." + WHITESPACE@3406..3410 " " + RANGE_EXPR@3410..3512 + DOT2EQ@3410..3413 "..=" + RANGE_EXPR@3413..3512 + DOT2@3413..3415 ".." + WHITESPACE@3415..3416 " " + RANGE_EXPR@3416..3512 + DOT2EQ@3416..3419 "..=" + RANGE_EXPR@3419..3512 + DOT2@3419..3421 ".." + WHITESPACE@3421..3425 " " + RANGE_EXPR@3425..3512 + DOT2@3425..3427 ".." + WHITESPACE@3427..3428 " " + RANGE_EXPR@3428..3512 + DOT2@3428..3430 ".." + WHITESPACE@3430..3431 " " + RANGE_EXPR@3431..3512 + DOT2EQ@3431..3434 "..=" + RANGE_EXPR@3434..3512 + DOT2@3434..3436 ".." + WHITESPACE@3436..3440 " " + RANGE_EXPR@3440..3512 + DOT2@3440..3442 ".." + WHITESPACE@3442..3443 " " + RANGE_EXPR@3443..3512 + DOT2EQ@3443..3446 "..=" + RANGE_EXPR@3446..3512 + DOT2@3446..3448 ".." + WHITESPACE@3448..3449 " " + RANGE_EXPR@3449..3512 + DOT2@3449..3451 ".." + WHITESPACE@3451..3456 "\n " + RANGE_EXPR@3456..3512 + DOT2EQ@3456..3459 "..=" + RANGE_EXPR@3459..3512 + DOT2@3459..3461 ".." + WHITESPACE@3461..3462 " " + RANGE_EXPR@3462..3512 + DOT2EQ@3462..3465 "..=" + RANGE_EXPR@3465..3512 + DOT2@3465..3467 ".." + WHITESPACE@3467..3471 " " + RANGE_EXPR@3471..3512 + DOT2@3471..3473 ".." + WHITESPACE@3473..3474 " " + RANGE_EXPR@3474..3512 + DOT2EQ@3474..3477 "..=" + RANGE_EXPR@3477..3512 + DOT2EQ@3477..3480 "..=" + RANGE_EXPR@3480..3512 + DOT2@3480..3482 ".." + WHITESPACE@3482..3486 " " + RANGE_EXPR@3486..3512 + DOT2EQ@3486..3489 "..=" + RANGE_EXPR@3489..3512 + DOT2EQ@3489..3492 "..=" + RANGE_EXPR@3492..3512 + DOT2@3492..3494 ".." + WHITESPACE@3494..3495 " " + RANGE_EXPR@3495..3512 + DOT2@3495..3497 ".." + WHITESPACE@3497..3501 " " + RANGE_EXPR@3501..3512 + DOT2@3501..3503 ".." + WHITESPACE@3503..3504 " " + RANGE_EXPR@3504..3512 + DOT2EQ@3504..3507 "..=" + RANGE_EXPR@3507..3512 + DOT2@3507..3509 ".." + WHITESPACE@3509..3510 " " + RANGE_EXPR@3510..3512 + DOT2@3510..3512 ".." + WHITESPACE@3512..3513 "\n" + R_CURLY@3513..3514 "}" + WHITESPACE@3514..3516 "\n\n" + FN_DEF@3516..3552 + FN_KW@3516..3518 "fn" + WHITESPACE@3518..3519 " " + NAME@3519..3525 + IDENT@3519..3525 "ktulhu" + PARAM_LIST@3525..3527 + L_PAREN@3525..3526 "(" + R_PAREN@3526..3527 ")" + WHITESPACE@3527..3528 " " + BLOCK_EXPR@3528..3552 + BLOCK@3528..3552 + L_CURLY@3528..3529 "{" + WHITESPACE@3529..3534 "\n " + SEMICOLON@3534..3535 ";" + SEMICOLON@3535..3536 ";" + SEMICOLON@3536..3537 ";" + EXPR_STMT@3537..3540 + TUPLE_EXPR@3537..3539 + L_PAREN@3537..3538 "(" + R_PAREN@3538..3539 ")" + SEMICOLON@3539..3540 ";" + SEMICOLON@3540..3541 ";" + SEMICOLON@3541..3542 ";" + SEMICOLON@3542..3543 ";" + SEMICOLON@3543..3544 ";" + SEMICOLON@3544..3545 ";" + SEMICOLON@3545..3546 ";" + SEMICOLON@3546..3547 ";" + SEMICOLON@3547..3548 ";" + TUPLE_EXPR@3548..3550 + L_PAREN@3548..3549 "(" + R_PAREN@3549..3550 ")" + WHITESPACE@3550..3551 "\n" + R_CURLY@3551..3552 "}" + WHITESPACE@3552..3554 "\n\n" + FN_DEF@3554..3812 + VISIBILITY@3554..3557 + PUB_KW@3554..3557 "pub" + WHITESPACE@3557..3558 " " + FN_KW@3558..3560 "fn" + WHITESPACE@3560..3561 " " + NAME@3561..3565 + IDENT@3561..3565 "main" + PARAM_LIST@3565..3567 + L_PAREN@3565..3566 "(" + R_PAREN@3566..3567 ")" + WHITESPACE@3567..3568 " " + BLOCK_EXPR@3568..3812 + BLOCK@3568..3812 + L_CURLY@3568..3569 "{" + WHITESPACE@3569..3574 "\n " + EXPR_STMT@3574..3584 + CALL_EXPR@3574..3583 + PATH_EXPR@3574..3581 + PATH@3574..3581 + PATH_SEGMENT@3574..3581 + NAME_REF@3574..3581 + IDENT@3574..3581 "strange" + ARG_LIST@3581..3583 + L_PAREN@3581..3582 "(" + R_PAREN@3582..3583 ")" + SEMICOLON@3583..3584 ";" + WHITESPACE@3584..3589 "\n " + EXPR_STMT@3589..3597 + CALL_EXPR@3589..3596 + PATH_EXPR@3589..3594 + PATH@3589..3594 + PATH_SEGMENT@3589..3594 + NAME_REF@3589..3594 + IDENT@3589..3594 "funny" + ARG_LIST@3594..3596 + L_PAREN@3594..3595 "(" + R_PAREN@3595..3596 ")" + SEMICOLON@3596..3597 ";" + WHITESPACE@3597..3602 "\n " + EXPR_STMT@3602..3609 + CALL_EXPR@3602..3608 + PATH_EXPR@3602..3606 + PATH@3602..3606 + PATH_SEGMENT@3602..3606 + NAME_REF@3602..3606 + IDENT@3602..3606 "what" + ARG_LIST@3606..3608 + L_PAREN@3606..3607 "(" + R_PAREN@3607..3608 ")" + SEMICOLON@3608..3609 ";" + WHITESPACE@3609..3614 "\n " + EXPR_STMT@3614..3628 + CALL_EXPR@3614..3627 + PATH_EXPR@3614..3625 + PATH@3614..3625 + PATH_SEGMENT@3614..3625 + NAME_REF@3614..3625 + IDENT@3614..3625 "zombiejesus" + ARG_LIST@3625..3627 + L_PAREN@3625..3626 "(" + R_PAREN@3626..3627 ")" + SEMICOLON@3627..3628 ";" + WHITESPACE@3628..3633 "\n " + EXPR_STMT@3633..3643 + CALL_EXPR@3633..3642 + PATH_EXPR@3633..3640 + PATH@3633..3640 + PATH_SEGMENT@3633..3640 + NAME_REF@3633..3640 + IDENT@3633..3640 "notsure" + ARG_LIST@3640..3642 + L_PAREN@3640..3641 "(" + R_PAREN@3641..3642 ")" + SEMICOLON@3642..3643 ";" + WHITESPACE@3643..3648 "\n " + EXPR_STMT@3648..3664 + CALL_EXPR@3648..3663 + PATH_EXPR@3648..3661 + PATH@3648..3661 + PATH_SEGMENT@3648..3661 + NAME_REF@3648..3661 + IDENT@3648..3661 "canttouchthis" + ARG_LIST@3661..3663 + L_PAREN@3661..3662 "(" + R_PAREN@3662..3663 ")" + SEMICOLON@3663..3664 ";" + WHITESPACE@3664..3669 "\n " + EXPR_STMT@3669..3681 + CALL_EXPR@3669..3680 + PATH_EXPR@3669..3678 + PATH@3669..3678 + PATH_SEGMENT@3669..3678 + NAME_REF@3669..3678 + IDENT@3669..3678 "angrydome" + ARG_LIST@3678..3680 + L_PAREN@3678..3679 "(" + R_PAREN@3679..3680 ")" + SEMICOLON@3680..3681 ";" + WHITESPACE@3681..3686 "\n " + EXPR_STMT@3686..3701 + CALL_EXPR@3686..3700 + PATH_EXPR@3686..3698 + PATH@3686..3698 + PATH_SEGMENT@3686..3698 + NAME_REF@3686..3698 + IDENT@3686..3698 "evil_lincoln" + ARG_LIST@3698..3700 + L_PAREN@3698..3699 "(" + R_PAREN@3699..3700 ")" + SEMICOLON@3700..3701 ";" + WHITESPACE@3701..3706 "\n " + EXPR_STMT@3706..3713 + CALL_EXPR@3706..3712 + PATH_EXPR@3706..3710 + PATH@3706..3710 + PATH_SEGMENT@3706..3710 + NAME_REF@3706..3710 + IDENT@3706..3710 "dots" + ARG_LIST@3710..3712 + L_PAREN@3710..3711 "(" + R_PAREN@3711..3712 ")" + SEMICOLON@3712..3713 ";" + WHITESPACE@3713..3718 "\n " + EXPR_STMT@3718..3726 + CALL_EXPR@3718..3725 + PATH_EXPR@3718..3720 + PATH@3718..3720 + PATH_SEGMENT@3718..3720 + NAME_REF@3718..3720 + IDENT@3718..3720 "u8" + ARG_LIST@3720..3725 + L_PAREN@3720..3721 "(" + LITERAL@3721..3724 + INT_NUMBER@3721..3724 "8u8" + R_PAREN@3724..3725 ")" + SEMICOLON@3725..3726 ";" + WHITESPACE@3726..3731 "\n " + EXPR_STMT@3731..3739 + CALL_EXPR@3731..3738 + PATH_EXPR@3731..3736 + PATH@3731..3736 + PATH_SEGMENT@3731..3736 + NAME_REF@3731..3736 + IDENT@3731..3736 "fishy" + ARG_LIST@3736..3738 + L_PAREN@3736..3737 "(" + R_PAREN@3737..3738 ")" + SEMICOLON@3738..3739 ";" + WHITESPACE@3739..3744 "\n " + EXPR_STMT@3744..3752 + CALL_EXPR@3744..3751 + PATH_EXPR@3744..3749 + PATH@3744..3749 + PATH_SEGMENT@3744..3749 + NAME_REF@3744..3749 + IDENT@3744..3749 "union" + ARG_LIST@3749..3751 + L_PAREN@3749..3750 "(" + R_PAREN@3750..3751 ")" + SEMICOLON@3751..3752 ";" + WHITESPACE@3752..3757 "\n " + EXPR_STMT@3757..3778 + CALL_EXPR@3757..3777 + PATH_EXPR@3757..3775 + PATH@3757..3775 + PATH_SEGMENT@3757..3775 + NAME_REF@3757..3775 + IDENT@3757..3775 "special_characters" + ARG_LIST@3775..3777 + L_PAREN@3775..3776 "(" + R_PAREN@3776..3777 ")" + SEMICOLON@3777..3778 ";" + WHITESPACE@3778..3783 "\n " + EXPR_STMT@3783..3796 + CALL_EXPR@3783..3795 + PATH_EXPR@3783..3793 + PATH@3783..3793 + PATH_SEGMENT@3783..3793 + NAME_REF@3783..3793 + IDENT@3783..3793 "punch_card" + ARG_LIST@3793..3795 + L_PAREN@3793..3794 "(" + R_PAREN@3794..3795 ")" + SEMICOLON@3795..3796 ";" + WHITESPACE@3796..3801 "\n " + EXPR_STMT@3801..3810 + CALL_EXPR@3801..3809 + PATH_EXPR@3801..3807 + PATH@3801..3807 + PATH_SEGMENT@3801..3807 + NAME_REF@3801..3807 + IDENT@3801..3807 "ktulhu" + ARG_LIST@3807..3809 + L_PAREN@3807..3808 "(" + R_PAREN@3808..3809 ")" + SEMICOLON@3809..3810 ";" + WHITESPACE@3810..3811 "\n" + R_CURLY@3811..3812 "}" + 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 4df6703f40..8f616623bd 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 @@ -1,93 +1,93 @@ -SOURCE_FILE@[0; 157) - COMMENT@[0; 60) "// https://github.com ..." - WHITESPACE@[60; 62) "\n\n" - FN_DEF@[62; 156) - VISIBILITY@[62; 65) - PUB_KW@[62; 65) "pub" - WHITESPACE@[65; 66) " " - FN_KW@[66; 68) "fn" - WHITESPACE@[68; 69) " " - NAME@[69; 72) - IDENT@[69; 72) "foo" - TYPE_PARAM_LIST@[72; 85) - L_ANGLE@[72; 73) "<" - TYPE_PARAM@[73; 84) - NAME@[73; 74) - IDENT@[73; 74) "S" - COLON@[74; 75) ":" - WHITESPACE@[75; 76) " " - TYPE_BOUND_LIST@[76; 84) - TYPE_BOUND@[76; 84) - PATH_TYPE@[76; 84) - PATH@[76; 84) - PATH_SEGMENT@[76; 84) - NAME_REF@[76; 84) - IDENT@[76; 84) "Iterator" - R_ANGLE@[84; 85) ">" - PARAM_LIST@[85; 87) - L_PAREN@[85; 86) "(" - R_PAREN@[86; 87) ")" - WHITESPACE@[87; 88) " " - RET_TYPE@[88; 97) - THIN_ARROW@[88; 90) "->" - WHITESPACE@[90; 91) " " - PATH_TYPE@[91; 97) - PATH@[91; 97) - PATH_SEGMENT@[91; 97) - NAME_REF@[91; 97) - IDENT@[91; 97) "String" - WHITESPACE@[97; 98) "\n" - WHERE_CLAUSE@[98; 134) - WHERE_KW@[98; 103) "where" - WHITESPACE@[103; 108) "\n " - WHERE_PRED@[108; 133) - PATH_TYPE@[108; 129) - PATH@[108; 129) - PATH@[108; 123) - PATH_SEGMENT@[108; 123) - L_ANGLE@[108; 109) "<" - PATH_TYPE@[109; 110) - PATH@[109; 110) - PATH_SEGMENT@[109; 110) - NAME_REF@[109; 110) - IDENT@[109; 110) "S" - WHITESPACE@[110; 111) " " - AS_KW@[111; 113) "as" - WHITESPACE@[113; 114) " " - PATH_TYPE@[114; 122) - PATH@[114; 122) - PATH_SEGMENT@[114; 122) - NAME_REF@[114; 122) - IDENT@[114; 122) "Iterator" - R_ANGLE@[122; 123) ">" - COLON2@[123; 125) "::" - PATH_SEGMENT@[125; 129) - NAME_REF@[125; 129) - IDENT@[125; 129) "Item" - COLON@[129; 130) ":" - WHITESPACE@[130; 131) " " - TYPE_BOUND_LIST@[131; 133) - TYPE_BOUND@[131; 133) - PATH_TYPE@[131; 133) - PATH@[131; 133) - PATH_SEGMENT@[131; 133) - NAME_REF@[131; 133) - IDENT@[131; 133) "Eq" - COMMA@[133; 134) "," - WHITESPACE@[134; 135) "\n" - BLOCK_EXPR@[135; 156) - BLOCK@[135; 156) - L_CURLY@[135; 136) "{" - WHITESPACE@[136; 141) "\n " - METHOD_CALL_EXPR@[141; 154) - LITERAL@[141; 143) - STRING@[141; 143) "\"\"" - DOT@[143; 144) "." - NAME_REF@[144; 152) - IDENT@[144; 152) "to_owned" - ARG_LIST@[152; 154) - L_PAREN@[152; 153) "(" - R_PAREN@[153; 154) ")" - WHITESPACE@[154; 155) "\n" - R_CURLY@[155; 156) "}" - WHITESPACE@[156; 157) "\n" +SOURCE_FILE@0..157 + COMMENT@0..60 "// https://github.com ..." + WHITESPACE@60..62 "\n\n" + FN_DEF@62..156 + VISIBILITY@62..65 + PUB_KW@62..65 "pub" + WHITESPACE@65..66 " " + FN_KW@66..68 "fn" + WHITESPACE@68..69 " " + NAME@69..72 + IDENT@69..72 "foo" + TYPE_PARAM_LIST@72..85 + L_ANGLE@72..73 "<" + TYPE_PARAM@73..84 + NAME@73..74 + IDENT@73..74 "S" + COLON@74..75 ":" + WHITESPACE@75..76 " " + TYPE_BOUND_LIST@76..84 + TYPE_BOUND@76..84 + PATH_TYPE@76..84 + PATH@76..84 + PATH_SEGMENT@76..84 + NAME_REF@76..84 + IDENT@76..84 "Iterator" + R_ANGLE@84..85 ">" + PARAM_LIST@85..87 + L_PAREN@85..86 "(" + R_PAREN@86..87 ")" + WHITESPACE@87..88 " " + RET_TYPE@88..97 + THIN_ARROW@88..90 "->" + WHITESPACE@90..91 " " + PATH_TYPE@91..97 + PATH@91..97 + PATH_SEGMENT@91..97 + NAME_REF@91..97 + IDENT@91..97 "String" + WHITESPACE@97..98 "\n" + WHERE_CLAUSE@98..134 + WHERE_KW@98..103 "where" + WHITESPACE@103..108 "\n " + WHERE_PRED@108..133 + PATH_TYPE@108..129 + PATH@108..129 + PATH@108..123 + PATH_SEGMENT@108..123 + L_ANGLE@108..109 "<" + PATH_TYPE@109..110 + PATH@109..110 + PATH_SEGMENT@109..110 + NAME_REF@109..110 + IDENT@109..110 "S" + WHITESPACE@110..111 " " + AS_KW@111..113 "as" + WHITESPACE@113..114 " " + PATH_TYPE@114..122 + PATH@114..122 + PATH_SEGMENT@114..122 + NAME_REF@114..122 + IDENT@114..122 "Iterator" + R_ANGLE@122..123 ">" + COLON2@123..125 "::" + PATH_SEGMENT@125..129 + NAME_REF@125..129 + IDENT@125..129 "Item" + COLON@129..130 ":" + WHITESPACE@130..131 " " + TYPE_BOUND_LIST@131..133 + TYPE_BOUND@131..133 + PATH_TYPE@131..133 + PATH@131..133 + PATH_SEGMENT@131..133 + NAME_REF@131..133 + IDENT@131..133 "Eq" + COMMA@133..134 "," + WHITESPACE@134..135 "\n" + BLOCK_EXPR@135..156 + BLOCK@135..156 + L_CURLY@135..136 "{" + WHITESPACE@136..141 "\n " + METHOD_CALL_EXPR@141..154 + LITERAL@141..143 + STRING@141..143 "\"\"" + DOT@143..144 "." + NAME_REF@144..152 + IDENT@144..152 "to_owned" + ARG_LIST@152..154 + L_PAREN@152..153 "(" + R_PAREN@153..154 ")" + WHITESPACE@154..155 "\n" + R_CURLY@155..156 "}" + WHITESPACE@156..157 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0037_mod.rast b/crates/ra_syntax/test_data/parser/ok/0037_mod.rast index 3af40a104a..1d5d94bdea 100644 --- a/crates/ra_syntax/test_data/parser/ok/0037_mod.rast +++ b/crates/ra_syntax/test_data/parser/ok/0037_mod.rast @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 93) - COMMENT@[0; 60) "// https://github.com ..." - WHITESPACE@[60; 62) "\n\n" - MODULE@[62; 93) - COMMENT@[62; 70) "//! docs" - WHITESPACE@[70; 71) "\n" - COMMENT@[71; 82) "// non-docs" - WHITESPACE@[82; 83) "\n" - MOD_KW@[83; 86) "mod" - WHITESPACE@[86; 87) " " - NAME@[87; 90) - IDENT@[87; 90) "foo" - WHITESPACE@[90; 91) " " - ITEM_LIST@[91; 93) - L_CURLY@[91; 92) "{" - R_CURLY@[92; 93) "}" +SOURCE_FILE@0..93 + COMMENT@0..60 "// https://github.com ..." + WHITESPACE@60..62 "\n\n" + MODULE@62..93 + COMMENT@62..70 "//! docs" + WHITESPACE@70..71 "\n" + COMMENT@71..82 "// non-docs" + WHITESPACE@82..83 "\n" + MOD_KW@83..86 "mod" + WHITESPACE@86..87 " " + NAME@87..90 + IDENT@87..90 "foo" + WHITESPACE@90..91 " " + ITEM_LIST@91..93 + L_CURLY@91..92 "{" + R_CURLY@92..93 "}" diff --git a/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast b/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast index 3773679144..14d82feb07 100644 --- a/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast +++ b/crates/ra_syntax/test_data/parser/ok/0038_where_pred_type.rast @@ -1,43 +1,43 @@ -SOURCE_FILE@[0; 34) - FN_DEF@[0; 34) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "test" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - WHERE_CLAUSE@[10; 31) - WHERE_KW@[10; 15) "where" - WHITESPACE@[15; 16) " " - WHERE_PRED@[16; 31) - TUPLE_TYPE@[16; 26) - L_PAREN@[16; 17) "(" - PATH_TYPE@[17; 20) - PATH@[17; 20) - PATH_SEGMENT@[17; 20) - NAME_REF@[17; 20) - IDENT@[17; 20) "u64" - COMMA@[20; 21) "," - WHITESPACE@[21; 22) " " - PATH_TYPE@[22; 25) - PATH@[22; 25) - PATH_SEGMENT@[22; 25) - NAME_REF@[22; 25) - IDENT@[22; 25) "u64" - R_PAREN@[25; 26) ")" - COLON@[26; 27) ":" - WHITESPACE@[27; 28) " " - TYPE_BOUND_LIST@[28; 31) - TYPE_BOUND@[28; 31) - PATH_TYPE@[28; 31) - PATH@[28; 31) - PATH_SEGMENT@[28; 31) - NAME_REF@[28; 31) - IDENT@[28; 31) "Foo" - WHITESPACE@[31; 32) " " - BLOCK_EXPR@[32; 34) - BLOCK@[32; 34) - L_CURLY@[32; 33) "{" - R_CURLY@[33; 34) "}" +SOURCE_FILE@0..34 + FN_DEF@0..34 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "test" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + WHERE_CLAUSE@10..31 + WHERE_KW@10..15 "where" + WHITESPACE@15..16 " " + WHERE_PRED@16..31 + TUPLE_TYPE@16..26 + L_PAREN@16..17 "(" + PATH_TYPE@17..20 + PATH@17..20 + PATH_SEGMENT@17..20 + NAME_REF@17..20 + IDENT@17..20 "u64" + COMMA@20..21 "," + WHITESPACE@21..22 " " + PATH_TYPE@22..25 + PATH@22..25 + PATH_SEGMENT@22..25 + NAME_REF@22..25 + IDENT@22..25 "u64" + R_PAREN@25..26 ")" + COLON@26..27 ":" + WHITESPACE@27..28 " " + TYPE_BOUND_LIST@28..31 + TYPE_BOUND@28..31 + PATH_TYPE@28..31 + PATH@28..31 + PATH_SEGMENT@28..31 + NAME_REF@28..31 + IDENT@28..31 "Foo" + WHITESPACE@31..32 " " + BLOCK_EXPR@32..34 + BLOCK@32..34 + L_CURLY@32..33 "{" + R_CURLY@33..34 "}" diff --git a/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast b/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast index 9936892e93..d38a60665a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast +++ b/crates/ra_syntax/test_data/parser/ok/0039_raw_fn_item.rast @@ -1,16 +1,16 @@ -SOURCE_FILE@[0; 15) - FN_DEF@[0; 14) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 8) - IDENT@[3; 8) "r#foo" - PARAM_LIST@[8; 10) - L_PAREN@[8; 9) "(" - R_PAREN@[9; 10) ")" - WHITESPACE@[10; 11) " " - BLOCK_EXPR@[11; 14) - BLOCK@[11; 14) - L_CURLY@[11; 12) "{" - WHITESPACE@[12; 13) "\n" - R_CURLY@[13; 14) "}" - WHITESPACE@[14; 15) "\n" +SOURCE_FILE@0..15 + FN_DEF@0..14 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..8 + IDENT@3..8 "r#foo" + PARAM_LIST@8..10 + L_PAREN@8..9 "(" + R_PAREN@9..10 ")" + WHITESPACE@10..11 " " + BLOCK_EXPR@11..14 + BLOCK@11..14 + L_CURLY@11..12 "{" + WHITESPACE@12..13 "\n" + R_CURLY@13..14 "}" + WHITESPACE@14..15 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast b/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast index 05f2c656f5..5640bae0a1 100644 --- a/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast +++ b/crates/ra_syntax/test_data/parser/ok/0040_raw_struct_item_field.rast @@ -1,22 +1,22 @@ -SOURCE_FILE@[0; 27) - STRUCT_DEF@[0; 27) - STRUCT_KW@[0; 6) "struct" - WHITESPACE@[6; 7) " " - NAME@[7; 8) - IDENT@[7; 8) "S" - WHITESPACE@[8; 9) " " - RECORD_FIELD_DEF_LIST@[9; 27) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - RECORD_FIELD_DEF@[15; 25) - NAME@[15; 20) - IDENT@[15; 20) "r#foo" - COLON@[20; 21) ":" - WHITESPACE@[21; 22) " " - PATH_TYPE@[22; 25) - PATH@[22; 25) - PATH_SEGMENT@[22; 25) - NAME_REF@[22; 25) - IDENT@[22; 25) "u32" - WHITESPACE@[25; 26) "\n" - R_CURLY@[26; 27) "}" +SOURCE_FILE@0..27 + STRUCT_DEF@0..27 + STRUCT_KW@0..6 "struct" + WHITESPACE@6..7 " " + NAME@7..8 + IDENT@7..8 "S" + WHITESPACE@8..9 " " + RECORD_FIELD_DEF_LIST@9..27 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + RECORD_FIELD_DEF@15..25 + NAME@15..20 + IDENT@15..20 "r#foo" + COLON@20..21 ":" + WHITESPACE@21..22 " " + PATH_TYPE@22..25 + PATH@22..25 + PATH_SEGMENT@22..25 + NAME_REF@22..25 + IDENT@22..25 "u32" + WHITESPACE@25..26 "\n" + R_CURLY@26..27 "}" 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 825518eda2..db25bc2b85 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 @@ -1,50 +1,50 @@ -SOURCE_FILE@[0; 59) - FN_DEF@[0; 59) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 59) - BLOCK@[9; 59) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 11) " " - LET_STMT@[11; 29) - LET_KW@[11; 14) "let" - WHITESPACE@[14; 15) " " - BIND_PAT@[15; 23) - NAME@[15; 23) - IDENT@[15; 23) "r#struct" - WHITESPACE@[23; 24) " " - EQ@[24; 25) "=" - WHITESPACE@[25; 26) " " - LITERAL@[26; 28) - INT_NUMBER@[26; 28) "92" - SEMICOLON@[28; 29) ";" - WHITESPACE@[29; 30) " " - LET_STMT@[30; 57) - LET_KW@[30; 33) "let" - WHITESPACE@[33; 34) " " - BIND_PAT@[34; 41) - NAME@[34; 41) - IDENT@[34; 41) "r#trait" - WHITESPACE@[41; 42) " " - EQ@[42; 43) "=" - WHITESPACE@[43; 44) " " - BIN_EXPR@[44; 56) - PATH_EXPR@[44; 52) - PATH@[44; 52) - PATH_SEGMENT@[44; 52) - NAME_REF@[44; 52) - IDENT@[44; 52) "r#struct" - WHITESPACE@[52; 53) " " - STAR@[53; 54) "*" - WHITESPACE@[54; 55) " " - LITERAL@[55; 56) - INT_NUMBER@[55; 56) "2" - SEMICOLON@[56; 57) ";" - WHITESPACE@[57; 58) " " - R_CURLY@[58; 59) "}" +SOURCE_FILE@0..59 + FN_DEF@0..59 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..59 + BLOCK@9..59 + L_CURLY@9..10 "{" + WHITESPACE@10..11 " " + LET_STMT@11..29 + LET_KW@11..14 "let" + WHITESPACE@14..15 " " + BIND_PAT@15..23 + NAME@15..23 + IDENT@15..23 "r#struct" + WHITESPACE@23..24 " " + EQ@24..25 "=" + WHITESPACE@25..26 " " + LITERAL@26..28 + INT_NUMBER@26..28 "92" + SEMICOLON@28..29 ";" + WHITESPACE@29..30 " " + LET_STMT@30..57 + LET_KW@30..33 "let" + WHITESPACE@33..34 " " + BIND_PAT@34..41 + NAME@34..41 + IDENT@34..41 "r#trait" + WHITESPACE@41..42 " " + EQ@42..43 "=" + WHITESPACE@43..44 " " + BIN_EXPR@44..56 + PATH_EXPR@44..52 + PATH@44..52 + PATH_SEGMENT@44..52 + NAME_REF@44..52 + IDENT@44..52 "r#struct" + WHITESPACE@52..53 " " + STAR@53..54 "*" + WHITESPACE@54..55 " " + LITERAL@55..56 + INT_NUMBER@55..56 "2" + SEMICOLON@56..57 ";" + WHITESPACE@57..58 " " + 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 420a62639e..9704bea957 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 @@ -1,126 +1,126 @@ -SOURCE_FILE@[0; 199) - COMMENT@[0; 60) "// https://github.com ..." - WHITESPACE@[60; 62) "\n\n" - STRUCT_DEF@[62; 73) - STRUCT_KW@[62; 68) "struct" - WHITESPACE@[68; 69) " " - NAME@[69; 72) - IDENT@[69; 72) "Foo" - SEMICOLON@[72; 73) ";" - WHITESPACE@[73; 75) "\n\n" - IMPL_DEF@[75; 141) - IMPL_KW@[75; 79) "impl" - WHITESPACE@[79; 80) " " - PATH_TYPE@[80; 83) - PATH@[80; 83) - PATH_SEGMENT@[80; 83) - NAME_REF@[80; 83) - IDENT@[80; 83) "Foo" - WHITESPACE@[83; 84) " " - ITEM_LIST@[84; 141) - L_CURLY@[84; 85) "{" - WHITESPACE@[85; 90) "\n " - FN_DEF@[90; 139) - FN_KW@[90; 92) "fn" - WHITESPACE@[92; 93) " " - NAME@[93; 96) - IDENT@[93; 96) "bar" - PARAM_LIST@[96; 98) - L_PAREN@[96; 97) "(" - R_PAREN@[97; 98) ")" - WHITESPACE@[98; 99) " " - RET_TYPE@[99; 106) - THIN_ARROW@[99; 101) "->" - WHITESPACE@[101; 102) " " - PATH_TYPE@[102; 106) - PATH@[102; 106) - PATH_SEGMENT@[102; 106) - NAME_REF@[102; 106) - IDENT@[102; 106) "bool" - WHITESPACE@[106; 107) " " - BLOCK_EXPR@[107; 139) - BLOCK@[107; 139) - L_CURLY@[107; 108) "{" - WHITESPACE@[108; 117) "\n " - MACRO_CALL@[117; 133) - PATH@[117; 130) - PATH_SEGMENT@[117; 130) - NAME_REF@[117; 130) - IDENT@[117; 130) "unimplemented" - BANG@[130; 131) "!" - TOKEN_TREE@[131; 133) - L_PAREN@[131; 132) "(" - R_PAREN@[132; 133) ")" - WHITESPACE@[133; 138) "\n " - R_CURLY@[138; 139) "}" - WHITESPACE@[139; 140) "\n" - R_CURLY@[140; 141) "}" - WHITESPACE@[141; 143) "\n\n" - FN_DEF@[143; 161) - FN_KW@[143; 145) "fn" - WHITESPACE@[145; 146) " " - NAME@[146; 149) - IDENT@[146; 149) "baz" - PARAM_LIST@[149; 158) - L_PAREN@[149; 150) "(" - PARAM@[150; 157) - PLACEHOLDER_PAT@[150; 151) - UNDERSCORE@[150; 151) "_" - COLON@[151; 152) ":" - WHITESPACE@[152; 153) " " - PATH_TYPE@[153; 157) - PATH@[153; 157) - PATH_SEGMENT@[153; 157) - NAME_REF@[153; 157) - IDENT@[153; 157) "bool" - R_PAREN@[157; 158) ")" - WHITESPACE@[158; 159) " " - BLOCK_EXPR@[159; 161) - BLOCK@[159; 161) - L_CURLY@[159; 160) "{" - R_CURLY@[160; 161) "}" - WHITESPACE@[161; 163) "\n\n" - FN_DEF@[163; 198) - FN_KW@[163; 165) "fn" - WHITESPACE@[165; 166) " " - NAME@[166; 170) - IDENT@[166; 170) "main" - PARAM_LIST@[170; 172) - L_PAREN@[170; 171) "(" - R_PAREN@[171; 172) ")" - WHITESPACE@[172; 173) " " - BLOCK_EXPR@[173; 198) - BLOCK@[173; 198) - L_CURLY@[173; 174) "{" - WHITESPACE@[174; 179) "\n " - CALL_EXPR@[179; 196) - PATH_EXPR@[179; 182) - PATH@[179; 182) - PATH_SEGMENT@[179; 182) - NAME_REF@[179; 182) - IDENT@[179; 182) "baz" - ARG_LIST@[182; 196) - L_PAREN@[182; 183) "(" - CALL_EXPR@[183; 195) - PATH_EXPR@[183; 193) - PATH@[183; 193) - PATH@[183; 188) - PATH_SEGMENT@[183; 188) - L_ANGLE@[183; 184) "<" - PATH_TYPE@[184; 187) - PATH@[184; 187) - PATH_SEGMENT@[184; 187) - NAME_REF@[184; 187) - IDENT@[184; 187) "Foo" - R_ANGLE@[187; 188) ">" - COLON2@[188; 190) "::" - PATH_SEGMENT@[190; 193) - NAME_REF@[190; 193) - IDENT@[190; 193) "bar" - ARG_LIST@[193; 195) - L_PAREN@[193; 194) "(" - R_PAREN@[194; 195) ")" - R_PAREN@[195; 196) ")" - WHITESPACE@[196; 197) "\n" - R_CURLY@[197; 198) "}" - WHITESPACE@[198; 199) "\n" +SOURCE_FILE@0..199 + COMMENT@0..60 "// https://github.com ..." + WHITESPACE@60..62 "\n\n" + STRUCT_DEF@62..73 + STRUCT_KW@62..68 "struct" + WHITESPACE@68..69 " " + NAME@69..72 + IDENT@69..72 "Foo" + SEMICOLON@72..73 ";" + WHITESPACE@73..75 "\n\n" + IMPL_DEF@75..141 + IMPL_KW@75..79 "impl" + WHITESPACE@79..80 " " + PATH_TYPE@80..83 + PATH@80..83 + PATH_SEGMENT@80..83 + NAME_REF@80..83 + IDENT@80..83 "Foo" + WHITESPACE@83..84 " " + ITEM_LIST@84..141 + L_CURLY@84..85 "{" + WHITESPACE@85..90 "\n " + FN_DEF@90..139 + FN_KW@90..92 "fn" + WHITESPACE@92..93 " " + NAME@93..96 + IDENT@93..96 "bar" + PARAM_LIST@96..98 + L_PAREN@96..97 "(" + R_PAREN@97..98 ")" + WHITESPACE@98..99 " " + RET_TYPE@99..106 + THIN_ARROW@99..101 "->" + WHITESPACE@101..102 " " + PATH_TYPE@102..106 + PATH@102..106 + PATH_SEGMENT@102..106 + NAME_REF@102..106 + IDENT@102..106 "bool" + WHITESPACE@106..107 " " + BLOCK_EXPR@107..139 + BLOCK@107..139 + L_CURLY@107..108 "{" + WHITESPACE@108..117 "\n " + MACRO_CALL@117..133 + PATH@117..130 + PATH_SEGMENT@117..130 + NAME_REF@117..130 + IDENT@117..130 "unimplemented" + BANG@130..131 "!" + TOKEN_TREE@131..133 + L_PAREN@131..132 "(" + R_PAREN@132..133 ")" + WHITESPACE@133..138 "\n " + R_CURLY@138..139 "}" + WHITESPACE@139..140 "\n" + R_CURLY@140..141 "}" + WHITESPACE@141..143 "\n\n" + FN_DEF@143..161 + FN_KW@143..145 "fn" + WHITESPACE@145..146 " " + NAME@146..149 + IDENT@146..149 "baz" + PARAM_LIST@149..158 + L_PAREN@149..150 "(" + PARAM@150..157 + PLACEHOLDER_PAT@150..151 + UNDERSCORE@150..151 "_" + COLON@151..152 ":" + WHITESPACE@152..153 " " + PATH_TYPE@153..157 + PATH@153..157 + PATH_SEGMENT@153..157 + NAME_REF@153..157 + IDENT@153..157 "bool" + R_PAREN@157..158 ")" + WHITESPACE@158..159 " " + BLOCK_EXPR@159..161 + BLOCK@159..161 + L_CURLY@159..160 "{" + R_CURLY@160..161 "}" + WHITESPACE@161..163 "\n\n" + FN_DEF@163..198 + FN_KW@163..165 "fn" + WHITESPACE@165..166 " " + NAME@166..170 + IDENT@166..170 "main" + PARAM_LIST@170..172 + L_PAREN@170..171 "(" + R_PAREN@171..172 ")" + WHITESPACE@172..173 " " + BLOCK_EXPR@173..198 + BLOCK@173..198 + L_CURLY@173..174 "{" + WHITESPACE@174..179 "\n " + CALL_EXPR@179..196 + PATH_EXPR@179..182 + PATH@179..182 + PATH_SEGMENT@179..182 + NAME_REF@179..182 + IDENT@179..182 "baz" + ARG_LIST@182..196 + L_PAREN@182..183 "(" + CALL_EXPR@183..195 + PATH_EXPR@183..193 + PATH@183..193 + PATH@183..188 + PATH_SEGMENT@183..188 + L_ANGLE@183..184 "<" + PATH_TYPE@184..187 + PATH@184..187 + PATH_SEGMENT@184..187 + NAME_REF@184..187 + IDENT@184..187 "Foo" + R_ANGLE@187..188 ">" + COLON2@188..190 "::" + PATH_SEGMENT@190..193 + NAME_REF@190..193 + IDENT@190..193 "bar" + ARG_LIST@193..195 + L_PAREN@193..194 "(" + R_PAREN@194..195 ")" + R_PAREN@195..196 ")" + WHITESPACE@196..197 "\n" + R_CURLY@197..198 "}" + WHITESPACE@198..199 "\n" 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 3bc0ddbde6..6e5b257484 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 @@ -1,110 +1,110 @@ -SOURCE_FILE@[0; 160) - COMMENT@[0; 60) "// https://github.com ..." - WHITESPACE@[60; 62) "\n\n" - STRUCT_DEF@[62; 90) - STRUCT_KW@[62; 68) "struct" - WHITESPACE@[68; 69) " " - NAME@[69; 73) - IDENT@[69; 73) "Repr" - WHITESPACE@[73; 74) " " - RECORD_FIELD_DEF_LIST@[74; 90) - L_CURLY@[74; 75) "{" - WHITESPACE@[75; 76) " " - RECORD_FIELD_DEF@[76; 88) - NAME@[76; 79) - IDENT@[76; 79) "raw" - COLON@[79; 80) ":" - WHITESPACE@[80; 81) " " - ARRAY_TYPE@[81; 88) - L_BRACK@[81; 82) "[" - PATH_TYPE@[82; 84) - PATH@[82; 84) - PATH_SEGMENT@[82; 84) - NAME_REF@[82; 84) - IDENT@[82; 84) "u8" - SEMICOLON@[84; 85) ";" - WHITESPACE@[85; 86) " " - LITERAL@[86; 87) - INT_NUMBER@[86; 87) "1" - R_BRACK@[87; 88) "]" - WHITESPACE@[88; 89) " " - R_CURLY@[89; 90) "}" - WHITESPACE@[90; 92) "\n\n" - FN_DEF@[92; 159) - FN_KW@[92; 94) "fn" - WHITESPACE@[94; 95) " " - NAME@[95; 98) - IDENT@[95; 98) "abc" - PARAM_LIST@[98; 100) - L_PAREN@[98; 99) "(" - R_PAREN@[99; 100) ")" - WHITESPACE@[100; 101) " " - BLOCK_EXPR@[101; 159) - BLOCK@[101; 159) - L_CURLY@[101; 102) "{" - WHITESPACE@[102; 107) "\n " - EXPR_STMT@[107; 136) - BIN_EXPR@[107; 135) - INDEX_EXPR@[107; 131) - FIELD_EXPR@[107; 128) - RECORD_LIT@[107; 124) - PATH@[107; 111) - PATH_SEGMENT@[107; 111) - NAME_REF@[107; 111) - IDENT@[107; 111) "Repr" - WHITESPACE@[111; 112) " " - RECORD_FIELD_LIST@[112; 124) - L_CURLY@[112; 113) "{" - WHITESPACE@[113; 114) " " - RECORD_FIELD@[114; 122) - NAME_REF@[114; 117) - IDENT@[114; 117) "raw" - COLON@[117; 118) ":" - WHITESPACE@[118; 119) " " - ARRAY_EXPR@[119; 122) - L_BRACK@[119; 120) "[" - LITERAL@[120; 121) - INT_NUMBER@[120; 121) "0" - R_BRACK@[121; 122) "]" - WHITESPACE@[122; 123) " " - R_CURLY@[123; 124) "}" - DOT@[124; 125) "." - NAME_REF@[125; 128) - IDENT@[125; 128) "raw" - L_BRACK@[128; 129) "[" - LITERAL@[129; 130) - INT_NUMBER@[129; 130) "0" - R_BRACK@[130; 131) "]" - WHITESPACE@[131; 132) " " - EQ@[132; 133) "=" - WHITESPACE@[133; 134) " " - LITERAL@[134; 135) - INT_NUMBER@[134; 135) "0" - SEMICOLON@[135; 136) ";" - WHITESPACE@[136; 141) "\n " - EXPR_STMT@[141; 157) - CALL_EXPR@[141; 156) - RECORD_LIT@[141; 154) - PATH@[141; 145) - PATH_SEGMENT@[141; 145) - NAME_REF@[141; 145) - IDENT@[141; 145) "Repr" - RECORD_FIELD_LIST@[145; 154) - L_CURLY@[145; 146) "{" - RECORD_FIELD@[146; 153) - NAME_REF@[146; 149) - IDENT@[146; 149) "raw" - COLON@[149; 150) ":" - ARRAY_EXPR@[150; 153) - L_BRACK@[150; 151) "[" - LITERAL@[151; 152) - INT_NUMBER@[151; 152) "0" - R_BRACK@[152; 153) "]" - R_CURLY@[153; 154) "}" - ARG_LIST@[154; 156) - L_PAREN@[154; 155) "(" - R_PAREN@[155; 156) ")" - SEMICOLON@[156; 157) ";" - WHITESPACE@[157; 158) "\n" - R_CURLY@[158; 159) "}" - WHITESPACE@[159; 160) "\n" +SOURCE_FILE@0..160 + COMMENT@0..60 "// https://github.com ..." + WHITESPACE@60..62 "\n\n" + STRUCT_DEF@62..90 + STRUCT_KW@62..68 "struct" + WHITESPACE@68..69 " " + NAME@69..73 + IDENT@69..73 "Repr" + WHITESPACE@73..74 " " + RECORD_FIELD_DEF_LIST@74..90 + L_CURLY@74..75 "{" + WHITESPACE@75..76 " " + RECORD_FIELD_DEF@76..88 + NAME@76..79 + IDENT@76..79 "raw" + COLON@79..80 ":" + WHITESPACE@80..81 " " + ARRAY_TYPE@81..88 + L_BRACK@81..82 "[" + PATH_TYPE@82..84 + PATH@82..84 + PATH_SEGMENT@82..84 + NAME_REF@82..84 + IDENT@82..84 "u8" + SEMICOLON@84..85 ";" + WHITESPACE@85..86 " " + LITERAL@86..87 + INT_NUMBER@86..87 "1" + R_BRACK@87..88 "]" + WHITESPACE@88..89 " " + R_CURLY@89..90 "}" + WHITESPACE@90..92 "\n\n" + FN_DEF@92..159 + FN_KW@92..94 "fn" + WHITESPACE@94..95 " " + NAME@95..98 + IDENT@95..98 "abc" + PARAM_LIST@98..100 + L_PAREN@98..99 "(" + R_PAREN@99..100 ")" + WHITESPACE@100..101 " " + BLOCK_EXPR@101..159 + BLOCK@101..159 + L_CURLY@101..102 "{" + WHITESPACE@102..107 "\n " + EXPR_STMT@107..136 + BIN_EXPR@107..135 + INDEX_EXPR@107..131 + FIELD_EXPR@107..128 + RECORD_LIT@107..124 + PATH@107..111 + PATH_SEGMENT@107..111 + NAME_REF@107..111 + IDENT@107..111 "Repr" + WHITESPACE@111..112 " " + RECORD_FIELD_LIST@112..124 + L_CURLY@112..113 "{" + WHITESPACE@113..114 " " + RECORD_FIELD@114..122 + NAME_REF@114..117 + IDENT@114..117 "raw" + COLON@117..118 ":" + WHITESPACE@118..119 " " + ARRAY_EXPR@119..122 + L_BRACK@119..120 "[" + LITERAL@120..121 + INT_NUMBER@120..121 "0" + R_BRACK@121..122 "]" + WHITESPACE@122..123 " " + R_CURLY@123..124 "}" + DOT@124..125 "." + NAME_REF@125..128 + IDENT@125..128 "raw" + L_BRACK@128..129 "[" + LITERAL@129..130 + INT_NUMBER@129..130 "0" + R_BRACK@130..131 "]" + WHITESPACE@131..132 " " + EQ@132..133 "=" + WHITESPACE@133..134 " " + LITERAL@134..135 + INT_NUMBER@134..135 "0" + SEMICOLON@135..136 ";" + WHITESPACE@136..141 "\n " + EXPR_STMT@141..157 + CALL_EXPR@141..156 + RECORD_LIT@141..154 + PATH@141..145 + PATH_SEGMENT@141..145 + NAME_REF@141..145 + IDENT@141..145 "Repr" + RECORD_FIELD_LIST@145..154 + L_CURLY@145..146 "{" + RECORD_FIELD@146..153 + NAME_REF@146..149 + IDENT@146..149 "raw" + COLON@149..150 ":" + ARRAY_EXPR@150..153 + L_BRACK@150..151 "[" + LITERAL@151..152 + INT_NUMBER@151..152 "0" + R_BRACK@152..153 "]" + R_CURLY@153..154 "}" + ARG_LIST@154..156 + L_PAREN@154..155 "(" + R_PAREN@155..156 ")" + SEMICOLON@156..157 ";" + WHITESPACE@157..158 "\n" + R_CURLY@158..159 "}" + 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 4b25931476..f1eef3be0f 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 @@ -1,76 +1,76 @@ -SOURCE_FILE@[0; 166) - FN_DEF@[0; 165) - COMMENT@[0; 60) "// https://github.com ..." - WHITESPACE@[60; 61) "\n" - FN_KW@[61; 63) "fn" - WHITESPACE@[63; 64) " " - NAME@[64; 68) - IDENT@[64; 68) "main" - PARAM_LIST@[68; 70) - L_PAREN@[68; 69) "(" - R_PAREN@[69; 70) ")" - WHITESPACE@[70; 71) " " - BLOCK_EXPR@[71; 165) - BLOCK@[71; 165) - L_CURLY@[71; 72) "{" - WHITESPACE@[72; 77) "\n " - LET_STMT@[77; 163) - ATTR@[77; 106) - POUND@[77; 78) "#" - L_BRACK@[78; 79) "[" - PATH@[79; 82) - PATH_SEGMENT@[79; 82) - NAME_REF@[79; 82) - IDENT@[79; 82) "cfg" - TOKEN_TREE@[82; 105) - L_PAREN@[82; 83) "(" - IDENT@[83; 90) "feature" - WHITESPACE@[90; 91) " " - EQ@[91; 92) "=" - WHITESPACE@[92; 93) " " - STRING@[93; 104) "\"backtrace\"" - R_PAREN@[104; 105) ")" - R_BRACK@[105; 106) "]" - WHITESPACE@[106; 111) "\n " - LET_KW@[111; 114) "let" - WHITESPACE@[114; 115) " " - BIND_PAT@[115; 124) - NAME@[115; 124) - IDENT@[115; 124) "exit_code" - WHITESPACE@[124; 125) " " - EQ@[125; 126) "=" - WHITESPACE@[126; 127) " " - CALL_EXPR@[127; 162) - PATH_EXPR@[127; 146) - PATH@[127; 146) - PATH@[127; 132) - PATH_SEGMENT@[127; 132) - NAME_REF@[127; 132) - IDENT@[127; 132) "panic" - COLON2@[132; 134) "::" - PATH_SEGMENT@[134; 146) - NAME_REF@[134; 146) - IDENT@[134; 146) "catch_unwind" - ARG_LIST@[146; 162) - L_PAREN@[146; 147) "(" - LAMBDA_EXPR@[147; 161) - MOVE_KW@[147; 151) "move" - WHITESPACE@[151; 152) " " - PARAM_LIST@[152; 154) - PIPE@[152; 153) "|" - PIPE@[153; 154) "|" - WHITESPACE@[154; 155) " " - CALL_EXPR@[155; 161) - PATH_EXPR@[155; 159) - PATH@[155; 159) - PATH_SEGMENT@[155; 159) - NAME_REF@[155; 159) - IDENT@[155; 159) "main" - ARG_LIST@[159; 161) - L_PAREN@[159; 160) "(" - R_PAREN@[160; 161) ")" - R_PAREN@[161; 162) ")" - SEMICOLON@[162; 163) ";" - WHITESPACE@[163; 164) "\n" - R_CURLY@[164; 165) "}" - WHITESPACE@[165; 166) "\n" +SOURCE_FILE@0..166 + FN_DEF@0..165 + COMMENT@0..60 "// https://github.com ..." + WHITESPACE@60..61 "\n" + FN_KW@61..63 "fn" + WHITESPACE@63..64 " " + NAME@64..68 + IDENT@64..68 "main" + PARAM_LIST@68..70 + L_PAREN@68..69 "(" + R_PAREN@69..70 ")" + WHITESPACE@70..71 " " + BLOCK_EXPR@71..165 + BLOCK@71..165 + L_CURLY@71..72 "{" + WHITESPACE@72..77 "\n " + LET_STMT@77..163 + ATTR@77..106 + POUND@77..78 "#" + L_BRACK@78..79 "[" + PATH@79..82 + PATH_SEGMENT@79..82 + NAME_REF@79..82 + IDENT@79..82 "cfg" + TOKEN_TREE@82..105 + L_PAREN@82..83 "(" + IDENT@83..90 "feature" + WHITESPACE@90..91 " " + EQ@91..92 "=" + WHITESPACE@92..93 " " + STRING@93..104 "\"backtrace\"" + R_PAREN@104..105 ")" + R_BRACK@105..106 "]" + WHITESPACE@106..111 "\n " + LET_KW@111..114 "let" + WHITESPACE@114..115 " " + BIND_PAT@115..124 + NAME@115..124 + IDENT@115..124 "exit_code" + WHITESPACE@124..125 " " + EQ@125..126 "=" + WHITESPACE@126..127 " " + CALL_EXPR@127..162 + PATH_EXPR@127..146 + PATH@127..146 + PATH@127..132 + PATH_SEGMENT@127..132 + NAME_REF@127..132 + IDENT@127..132 "panic" + COLON2@132..134 "::" + PATH_SEGMENT@134..146 + NAME_REF@134..146 + IDENT@134..146 "catch_unwind" + ARG_LIST@146..162 + L_PAREN@146..147 "(" + LAMBDA_EXPR@147..161 + MOVE_KW@147..151 "move" + WHITESPACE@151..152 " " + PARAM_LIST@152..154 + PIPE@152..153 "|" + PIPE@153..154 "|" + WHITESPACE@154..155 " " + CALL_EXPR@155..161 + PATH_EXPR@155..159 + PATH@155..159 + PATH_SEGMENT@155..159 + NAME_REF@155..159 + IDENT@155..159 "main" + ARG_LIST@159..161 + L_PAREN@159..160 "(" + R_PAREN@160..161 ")" + R_PAREN@161..162 ")" + SEMICOLON@162..163 ";" + WHITESPACE@163..164 "\n" + R_CURLY@164..165 "}" + 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 954b3bc2a6..f79feec19a 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 @@ -1,181 +1,181 @@ -SOURCE_FILE@[0; 686) - FN_DEF@[0; 461) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 8) - IDENT@[3; 8) "block" - PARAM_LIST@[8; 10) - L_PAREN@[8; 9) "(" - R_PAREN@[9; 10) ")" - WHITESPACE@[10; 11) " " - BLOCK_EXPR@[11; 461) - BLOCK@[11; 461) - L_CURLY@[11; 12) "{" - WHITESPACE@[12; 17) "\n " - ATTR@[17; 57) - POUND@[17; 18) "#" - BANG@[18; 19) "!" - L_BRACK@[19; 20) "[" - PATH@[20; 23) - PATH_SEGMENT@[20; 23) - NAME_REF@[20; 23) - IDENT@[20; 23) "doc" - TOKEN_TREE@[23; 56) - L_PAREN@[23; 24) "(" - STRING@[24; 55) "\"Inner attributes all ..." - R_PAREN@[55; 56) ")" - R_BRACK@[56; 57) "]" - WHITESPACE@[57; 62) "\n " - COMMENT@[62; 97) "//! As are ModuleDoc ..." - WHITESPACE@[97; 102) "\n " - EXPR_STMT@[102; 295) - BLOCK_EXPR@[102; 294) - BLOCK@[102; 294) - L_CURLY@[102; 103) "{" - WHITESPACE@[103; 112) "\n " - ATTR@[112; 180) - POUND@[112; 113) "#" - BANG@[113; 114) "!" - L_BRACK@[114; 115) "[" - PATH@[115; 118) - PATH_SEGMENT@[115; 118) - NAME_REF@[115; 118) - IDENT@[115; 118) "doc" - TOKEN_TREE@[118; 179) - L_PAREN@[118; 119) "(" - STRING@[119; 178) "\"Inner attributes are ..." - R_PAREN@[178; 179) ")" - R_BRACK@[179; 180) "]" - WHITESPACE@[180; 189) "\n " - ATTR@[189; 244) - POUND@[189; 190) "#" - BANG@[190; 191) "!" - L_BRACK@[191; 192) "[" - PATH@[192; 195) - PATH_SEGMENT@[192; 195) - NAME_REF@[192; 195) - IDENT@[192; 195) "doc" - TOKEN_TREE@[195; 243) - L_PAREN@[195; 196) "(" - STRING@[196; 242) "\"Being validated is n ..." - R_PAREN@[242; 243) ")" - R_BRACK@[243; 244) "]" - WHITESPACE@[244; 253) "\n " - COMMENT@[253; 288) "//! As are ModuleDoc ..." - WHITESPACE@[288; 293) "\n " - R_CURLY@[293; 294) "}" - SEMICOLON@[294; 295) ";" - WHITESPACE@[295; 300) "\n " - BLOCK_EXPR@[300; 459) - BLOCK@[300; 459) - L_CURLY@[300; 301) "{" - WHITESPACE@[301; 310) "\n " - ATTR@[310; 409) - POUND@[310; 311) "#" - BANG@[311; 312) "!" - L_BRACK@[312; 313) "[" - PATH@[313; 316) - PATH_SEGMENT@[313; 316) - NAME_REF@[313; 316) - IDENT@[313; 316) "doc" - TOKEN_TREE@[316; 408) - L_PAREN@[316; 317) "(" - STRING@[317; 407) "\"Inner attributes are ..." - R_PAREN@[407; 408) ")" - R_BRACK@[408; 409) "]" - WHITESPACE@[409; 418) "\n " - COMMENT@[418; 453) "//! As are ModuleDoc ..." - WHITESPACE@[453; 458) "\n " - R_CURLY@[458; 459) "}" - WHITESPACE@[459; 460) "\n" - R_CURLY@[460; 461) "}" - WHITESPACE@[461; 463) "\n\n" - COMMENT@[463; 523) "// https://github.com ..." - WHITESPACE@[523; 524) "\n" - IMPL_DEF@[524; 685) - IMPL_KW@[524; 528) "impl" - WHITESPACE@[528; 529) " " - PATH_TYPE@[529; 537) - PATH@[529; 537) - PATH_SEGMENT@[529; 537) - NAME_REF@[529; 537) - IDENT@[529; 537) "Whatever" - WHITESPACE@[537; 538) " " - ITEM_LIST@[538; 685) - L_CURLY@[538; 539) "{" - WHITESPACE@[539; 544) "\n " - FN_DEF@[544; 683) - FN_KW@[544; 546) "fn" - WHITESPACE@[546; 547) " " - NAME@[547; 558) - IDENT@[547; 558) "salsa_event" - PARAM_LIST@[558; 601) - L_PAREN@[558; 559) "(" - SELF_PARAM@[559; 564) - AMP@[559; 560) "&" - SELF_KW@[560; 564) "self" - COMMA@[564; 565) "," - WHITESPACE@[565; 566) " " - PARAM@[566; 600) - BIND_PAT@[566; 574) - NAME@[566; 574) - IDENT@[566; 574) "event_fn" - COLON@[574; 575) ":" - WHITESPACE@[575; 576) " " - IMPL_TRAIT_TYPE@[576; 600) - IMPL_KW@[576; 580) "impl" - WHITESPACE@[580; 581) " " - TYPE_BOUND_LIST@[581; 600) - TYPE_BOUND@[581; 600) - PATH_TYPE@[581; 600) - PATH@[581; 600) - PATH_SEGMENT@[581; 600) - NAME_REF@[581; 583) - IDENT@[581; 583) "Fn" - PARAM_LIST@[583; 585) - L_PAREN@[583; 584) "(" - R_PAREN@[584; 585) ")" - WHITESPACE@[585; 586) " " - RET_TYPE@[586; 600) - THIN_ARROW@[586; 588) "->" - WHITESPACE@[588; 589) " " - PATH_TYPE@[589; 600) - PATH@[589; 600) - PATH_SEGMENT@[589; 600) - NAME_REF@[589; 594) - IDENT@[589; 594) "Event" - TYPE_ARG_LIST@[594; 600) - L_ANGLE@[594; 595) "<" - TYPE_ARG@[595; 599) - PATH_TYPE@[595; 599) - PATH@[595; 599) - PATH_SEGMENT@[595; 599) - NAME_REF@[595; 599) - IDENT@[595; 599) "Self" - R_ANGLE@[599; 600) ">" - R_PAREN@[600; 601) ")" - WHITESPACE@[601; 602) " " - BLOCK_EXPR@[602; 683) - BLOCK@[602; 683) - L_CURLY@[602; 603) "{" - WHITESPACE@[603; 612) "\n " - ATTR@[612; 639) - POUND@[612; 613) "#" - BANG@[613; 614) "!" - L_BRACK@[614; 615) "[" - PATH@[615; 620) - PATH_SEGMENT@[615; 620) - NAME_REF@[615; 620) - IDENT@[615; 620) "allow" - TOKEN_TREE@[620; 638) - L_PAREN@[620; 621) "(" - IDENT@[621; 637) "unused_variables" - R_PAREN@[637; 638) ")" - R_BRACK@[638; 639) "]" - WHITESPACE@[639; 640) " " - COMMENT@[640; 677) "// this is `inner_at ..." - WHITESPACE@[677; 682) "\n " - R_CURLY@[682; 683) "}" - WHITESPACE@[683; 684) "\n" - R_CURLY@[684; 685) "}" - WHITESPACE@[685; 686) "\n" +SOURCE_FILE@0..686 + FN_DEF@0..461 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..8 + IDENT@3..8 "block" + PARAM_LIST@8..10 + L_PAREN@8..9 "(" + R_PAREN@9..10 ")" + WHITESPACE@10..11 " " + BLOCK_EXPR@11..461 + BLOCK@11..461 + L_CURLY@11..12 "{" + WHITESPACE@12..17 "\n " + ATTR@17..57 + POUND@17..18 "#" + BANG@18..19 "!" + L_BRACK@19..20 "[" + PATH@20..23 + PATH_SEGMENT@20..23 + NAME_REF@20..23 + IDENT@20..23 "doc" + TOKEN_TREE@23..56 + L_PAREN@23..24 "(" + STRING@24..55 "\"Inner attributes all ..." + R_PAREN@55..56 ")" + R_BRACK@56..57 "]" + WHITESPACE@57..62 "\n " + COMMENT@62..97 "//! As are ModuleDoc ..." + WHITESPACE@97..102 "\n " + EXPR_STMT@102..295 + BLOCK_EXPR@102..294 + BLOCK@102..294 + L_CURLY@102..103 "{" + WHITESPACE@103..112 "\n " + ATTR@112..180 + POUND@112..113 "#" + BANG@113..114 "!" + L_BRACK@114..115 "[" + PATH@115..118 + PATH_SEGMENT@115..118 + NAME_REF@115..118 + IDENT@115..118 "doc" + TOKEN_TREE@118..179 + L_PAREN@118..119 "(" + STRING@119..178 "\"Inner attributes are ..." + R_PAREN@178..179 ")" + R_BRACK@179..180 "]" + WHITESPACE@180..189 "\n " + ATTR@189..244 + POUND@189..190 "#" + BANG@190..191 "!" + L_BRACK@191..192 "[" + PATH@192..195 + PATH_SEGMENT@192..195 + NAME_REF@192..195 + IDENT@192..195 "doc" + TOKEN_TREE@195..243 + L_PAREN@195..196 "(" + STRING@196..242 "\"Being validated is n ..." + R_PAREN@242..243 ")" + R_BRACK@243..244 "]" + WHITESPACE@244..253 "\n " + COMMENT@253..288 "//! As are ModuleDoc ..." + WHITESPACE@288..293 "\n " + R_CURLY@293..294 "}" + SEMICOLON@294..295 ";" + WHITESPACE@295..300 "\n " + BLOCK_EXPR@300..459 + BLOCK@300..459 + L_CURLY@300..301 "{" + WHITESPACE@301..310 "\n " + ATTR@310..409 + POUND@310..311 "#" + BANG@311..312 "!" + L_BRACK@312..313 "[" + PATH@313..316 + PATH_SEGMENT@313..316 + NAME_REF@313..316 + IDENT@313..316 "doc" + TOKEN_TREE@316..408 + L_PAREN@316..317 "(" + STRING@317..407 "\"Inner attributes are ..." + R_PAREN@407..408 ")" + R_BRACK@408..409 "]" + WHITESPACE@409..418 "\n " + COMMENT@418..453 "//! As are ModuleDoc ..." + WHITESPACE@453..458 "\n " + R_CURLY@458..459 "}" + WHITESPACE@459..460 "\n" + R_CURLY@460..461 "}" + WHITESPACE@461..463 "\n\n" + COMMENT@463..523 "// https://github.com ..." + WHITESPACE@523..524 "\n" + IMPL_DEF@524..685 + IMPL_KW@524..528 "impl" + WHITESPACE@528..529 " " + PATH_TYPE@529..537 + PATH@529..537 + PATH_SEGMENT@529..537 + NAME_REF@529..537 + IDENT@529..537 "Whatever" + WHITESPACE@537..538 " " + ITEM_LIST@538..685 + L_CURLY@538..539 "{" + WHITESPACE@539..544 "\n " + FN_DEF@544..683 + FN_KW@544..546 "fn" + WHITESPACE@546..547 " " + NAME@547..558 + IDENT@547..558 "salsa_event" + PARAM_LIST@558..601 + L_PAREN@558..559 "(" + SELF_PARAM@559..564 + AMP@559..560 "&" + SELF_KW@560..564 "self" + COMMA@564..565 "," + WHITESPACE@565..566 " " + PARAM@566..600 + BIND_PAT@566..574 + NAME@566..574 + IDENT@566..574 "event_fn" + COLON@574..575 ":" + WHITESPACE@575..576 " " + IMPL_TRAIT_TYPE@576..600 + IMPL_KW@576..580 "impl" + WHITESPACE@580..581 " " + TYPE_BOUND_LIST@581..600 + TYPE_BOUND@581..600 + PATH_TYPE@581..600 + PATH@581..600 + PATH_SEGMENT@581..600 + NAME_REF@581..583 + IDENT@581..583 "Fn" + PARAM_LIST@583..585 + L_PAREN@583..584 "(" + R_PAREN@584..585 ")" + WHITESPACE@585..586 " " + RET_TYPE@586..600 + THIN_ARROW@586..588 "->" + WHITESPACE@588..589 " " + PATH_TYPE@589..600 + PATH@589..600 + PATH_SEGMENT@589..600 + NAME_REF@589..594 + IDENT@589..594 "Event" + TYPE_ARG_LIST@594..600 + L_ANGLE@594..595 "<" + TYPE_ARG@595..599 + PATH_TYPE@595..599 + PATH@595..599 + PATH_SEGMENT@595..599 + NAME_REF@595..599 + IDENT@595..599 "Self" + R_ANGLE@599..600 ">" + R_PAREN@600..601 ")" + WHITESPACE@601..602 " " + BLOCK_EXPR@602..683 + BLOCK@602..683 + L_CURLY@602..603 "{" + WHITESPACE@603..612 "\n " + ATTR@612..639 + POUND@612..613 "#" + BANG@613..614 "!" + L_BRACK@614..615 "[" + PATH@615..620 + PATH_SEGMENT@615..620 + NAME_REF@615..620 + IDENT@615..620 "allow" + TOKEN_TREE@620..638 + L_PAREN@620..621 "(" + IDENT@621..637 "unused_variables" + R_PAREN@637..638 ")" + R_BRACK@638..639 "]" + WHITESPACE@639..640 " " + COMMENT@640..677 "// this is `inner_at ..." + WHITESPACE@677..682 "\n " + R_CURLY@682..683 "}" + WHITESPACE@683..684 "\n" + R_CURLY@684..685 "}" + WHITESPACE@685..686 "\n" 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 92c8df2d67..37594769aa 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 @@ -1,28 +1,28 @@ -SOURCE_FILE@[0; 87) - EXTERN_BLOCK@[0; 86) - ABI@[0; 10) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - STRING@[7; 10) "\"C\"" - WHITESPACE@[10; 11) " " - EXTERN_ITEM_LIST@[11; 86) - L_CURLY@[11; 12) "{" - WHITESPACE@[12; 17) "\n " - COMMENT@[17; 42) "//! This is a doc com ..." - WHITESPACE@[42; 47) "\n " - ATTR@[47; 84) - POUND@[47; 48) "#" - BANG@[48; 49) "!" - L_BRACK@[49; 50) "[" - PATH@[50; 53) - PATH_SEGMENT@[50; 53) - NAME_REF@[50; 53) - IDENT@[50; 53) "doc" - TOKEN_TREE@[53; 83) - L_PAREN@[53; 54) "(" - STRING@[54; 82) "\"This is also a doc c ..." - R_PAREN@[82; 83) ")" - R_BRACK@[83; 84) "]" - WHITESPACE@[84; 85) "\n" - R_CURLY@[85; 86) "}" - WHITESPACE@[86; 87) "\n" +SOURCE_FILE@0..87 + EXTERN_BLOCK@0..86 + ABI@0..10 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + STRING@7..10 "\"C\"" + WHITESPACE@10..11 " " + EXTERN_ITEM_LIST@11..86 + L_CURLY@11..12 "{" + WHITESPACE@12..17 "\n " + COMMENT@17..42 "//! This is a doc com ..." + WHITESPACE@42..47 "\n " + ATTR@47..84 + POUND@47..48 "#" + BANG@48..49 "!" + L_BRACK@49..50 "[" + PATH@50..53 + PATH_SEGMENT@50..53 + NAME_REF@50..53 + IDENT@50..53 "doc" + TOKEN_TREE@53..83 + L_PAREN@53..54 "(" + STRING@54..82 "\"This is also a doc c ..." + R_PAREN@82..83 ")" + R_BRACK@83..84 "]" + WHITESPACE@84..85 "\n" + R_CURLY@85..86 "}" + WHITESPACE@86..87 "\n" 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 de703328af..1cf12d670a 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 @@ -1,323 +1,323 @@ -SOURCE_FILE@[0; 395) - COMMENT@[0; 60) "// https://github.com ..." - WHITESPACE@[60; 62) "\n\n" - FN_DEF@[62; 341) - FN_KW@[62; 64) "fn" - WHITESPACE@[64; 65) " " - NAME@[65; 69) - IDENT@[65; 69) "main" - PARAM_LIST@[69; 71) - L_PAREN@[69; 70) "(" - R_PAREN@[70; 71) ")" - WHITESPACE@[71; 72) " " - BLOCK_EXPR@[72; 341) - BLOCK@[72; 341) - L_CURLY@[72; 73) "{" - WHITESPACE@[73; 78) "\n " - EXPR_STMT@[78; 141) - MATCH_EXPR@[78; 141) - MATCH_KW@[78; 83) "match" - WHITESPACE@[83; 84) " " - CALL_EXPR@[84; 92) - PATH_EXPR@[84; 88) - PATH@[84; 88) - PATH_SEGMENT@[84; 88) - NAME_REF@[84; 88) - IDENT@[84; 88) "Some" - ARG_LIST@[88; 92) - L_PAREN@[88; 89) "(" - PREFIX_EXPR@[89; 91) - MINUS@[89; 90) "-" - LITERAL@[90; 91) - INT_NUMBER@[90; 91) "1" - R_PAREN@[91; 92) ")" - WHITESPACE@[92; 93) " " - MATCH_ARM_LIST@[93; 141) - L_CURLY@[93; 94) "{" - WHITESPACE@[94; 103) "\n " - MATCH_ARM@[103; 117) - TUPLE_STRUCT_PAT@[103; 111) - PATH@[103; 107) - PATH_SEGMENT@[103; 107) - NAME_REF@[103; 107) - IDENT@[103; 107) "Some" - L_PAREN@[107; 108) "(" - LITERAL_PAT@[108; 110) - MINUS@[108; 109) "-" - LITERAL@[109; 110) - INT_NUMBER@[109; 110) "1" - R_PAREN@[110; 111) ")" - WHITESPACE@[111; 112) " " - FAT_ARROW@[112; 114) "=>" - WHITESPACE@[114; 115) " " - TUPLE_EXPR@[115; 117) - L_PAREN@[115; 116) "(" - R_PAREN@[116; 117) ")" - COMMA@[117; 118) "," - WHITESPACE@[118; 127) "\n " - MATCH_ARM@[127; 134) - PLACEHOLDER_PAT@[127; 128) - UNDERSCORE@[127; 128) "_" - WHITESPACE@[128; 129) " " - FAT_ARROW@[129; 131) "=>" - WHITESPACE@[131; 132) " " - TUPLE_EXPR@[132; 134) - L_PAREN@[132; 133) "(" - R_PAREN@[133; 134) ")" - COMMA@[134; 135) "," - WHITESPACE@[135; 140) "\n " - R_CURLY@[140; 141) "}" - WHITESPACE@[141; 147) "\n\n " - EXPR_STMT@[147; 222) - MATCH_EXPR@[147; 222) - MATCH_KW@[147; 152) "match" - WHITESPACE@[152; 153) " " - CALL_EXPR@[153; 167) - PATH_EXPR@[153; 157) - PATH@[153; 157) - PATH_SEGMENT@[153; 157) - NAME_REF@[153; 157) - IDENT@[153; 157) "Some" - ARG_LIST@[157; 167) - L_PAREN@[157; 158) "(" - TUPLE_EXPR@[158; 166) - L_PAREN@[158; 159) "(" - PREFIX_EXPR@[159; 161) - MINUS@[159; 160) "-" - LITERAL@[160; 161) - INT_NUMBER@[160; 161) "1" - COMMA@[161; 162) "," - WHITESPACE@[162; 163) " " - PREFIX_EXPR@[163; 165) - MINUS@[163; 164) "-" - LITERAL@[164; 165) - INT_NUMBER@[164; 165) "1" - R_PAREN@[165; 166) ")" - R_PAREN@[166; 167) ")" - WHITESPACE@[167; 168) " " - MATCH_ARM_LIST@[168; 222) - L_CURLY@[168; 169) "{" - WHITESPACE@[169; 178) "\n " - MATCH_ARM@[178; 198) - TUPLE_STRUCT_PAT@[178; 192) - PATH@[178; 182) - PATH_SEGMENT@[178; 182) - NAME_REF@[178; 182) - IDENT@[178; 182) "Some" - L_PAREN@[182; 183) "(" - TUPLE_PAT@[183; 191) - L_PAREN@[183; 184) "(" - LITERAL_PAT@[184; 186) - MINUS@[184; 185) "-" - LITERAL@[185; 186) - INT_NUMBER@[185; 186) "1" - COMMA@[186; 187) "," - WHITESPACE@[187; 188) " " - LITERAL_PAT@[188; 190) - MINUS@[188; 189) "-" - LITERAL@[189; 190) - INT_NUMBER@[189; 190) "1" - R_PAREN@[190; 191) ")" - R_PAREN@[191; 192) ")" - WHITESPACE@[192; 193) " " - FAT_ARROW@[193; 195) "=>" - WHITESPACE@[195; 196) " " - TUPLE_EXPR@[196; 198) - L_PAREN@[196; 197) "(" - R_PAREN@[197; 198) ")" - COMMA@[198; 199) "," - WHITESPACE@[199; 208) "\n " - MATCH_ARM@[208; 215) - PLACEHOLDER_PAT@[208; 209) - UNDERSCORE@[208; 209) "_" - WHITESPACE@[209; 210) " " - FAT_ARROW@[210; 212) "=>" - WHITESPACE@[212; 213) " " - TUPLE_EXPR@[213; 215) - L_PAREN@[213; 214) "(" - R_PAREN@[214; 215) ")" - COMMA@[215; 216) "," - WHITESPACE@[216; 221) "\n " - R_CURLY@[221; 222) "}" - WHITESPACE@[222; 228) "\n\n " - EXPR_STMT@[228; 299) - MATCH_EXPR@[228; 299) - MATCH_KW@[228; 233) "match" - WHITESPACE@[233; 234) " " - CALL_EXPR@[234; 246) - PATH_EXPR@[234; 238) - PATH@[234; 238) - PATH@[234; 235) - PATH_SEGMENT@[234; 235) - NAME_REF@[234; 235) - IDENT@[234; 235) "A" - COLON2@[235; 237) "::" - PATH_SEGMENT@[237; 238) - NAME_REF@[237; 238) - IDENT@[237; 238) "B" - ARG_LIST@[238; 246) - L_PAREN@[238; 239) "(" - PREFIX_EXPR@[239; 241) - MINUS@[239; 240) "-" - LITERAL@[240; 241) - INT_NUMBER@[240; 241) "1" - COMMA@[241; 242) "," - WHITESPACE@[242; 243) " " - PREFIX_EXPR@[243; 245) - MINUS@[243; 244) "-" - LITERAL@[244; 245) - INT_NUMBER@[244; 245) "1" - R_PAREN@[245; 246) ")" - WHITESPACE@[246; 247) " " - MATCH_ARM_LIST@[247; 299) - L_CURLY@[247; 248) "{" - WHITESPACE@[248; 257) "\n " - MATCH_ARM@[257; 275) - TUPLE_STRUCT_PAT@[257; 269) - PATH@[257; 261) - PATH@[257; 258) - PATH_SEGMENT@[257; 258) - NAME_REF@[257; 258) - IDENT@[257; 258) "A" - COLON2@[258; 260) "::" - PATH_SEGMENT@[260; 261) - NAME_REF@[260; 261) - IDENT@[260; 261) "B" - L_PAREN@[261; 262) "(" - LITERAL_PAT@[262; 264) - MINUS@[262; 263) "-" - LITERAL@[263; 264) - INT_NUMBER@[263; 264) "1" - COMMA@[264; 265) "," - WHITESPACE@[265; 266) " " - LITERAL_PAT@[266; 268) - MINUS@[266; 267) "-" - LITERAL@[267; 268) - INT_NUMBER@[267; 268) "1" - R_PAREN@[268; 269) ")" - WHITESPACE@[269; 270) " " - FAT_ARROW@[270; 272) "=>" - WHITESPACE@[272; 273) " " - TUPLE_EXPR@[273; 275) - L_PAREN@[273; 274) "(" - R_PAREN@[274; 275) ")" - COMMA@[275; 276) "," - WHITESPACE@[276; 285) "\n " - MATCH_ARM@[285; 292) - PLACEHOLDER_PAT@[285; 286) - UNDERSCORE@[285; 286) "_" - WHITESPACE@[286; 287) " " - FAT_ARROW@[287; 289) "=>" - WHITESPACE@[289; 290) " " - TUPLE_EXPR@[290; 292) - L_PAREN@[290; 291) "(" - R_PAREN@[291; 292) ")" - COMMA@[292; 293) "," - WHITESPACE@[293; 298) "\n " - R_CURLY@[298; 299) "}" - WHITESPACE@[299; 305) "\n\n " - IF_EXPR@[305; 339) - IF_KW@[305; 307) "if" - WHITESPACE@[307; 308) " " - CONDITION@[308; 331) - LET_KW@[308; 311) "let" - WHITESPACE@[311; 312) " " - TUPLE_STRUCT_PAT@[312; 320) - PATH@[312; 316) - PATH_SEGMENT@[312; 316) - NAME_REF@[312; 316) - IDENT@[312; 316) "Some" - L_PAREN@[316; 317) "(" - LITERAL_PAT@[317; 319) - MINUS@[317; 318) "-" - LITERAL@[318; 319) - INT_NUMBER@[318; 319) "1" - R_PAREN@[319; 320) ")" - WHITESPACE@[320; 321) " " - EQ@[321; 322) "=" - WHITESPACE@[322; 323) " " - CALL_EXPR@[323; 331) - PATH_EXPR@[323; 327) - PATH@[323; 327) - PATH_SEGMENT@[323; 327) - NAME_REF@[323; 327) - IDENT@[323; 327) "Some" - ARG_LIST@[327; 331) - L_PAREN@[327; 328) "(" - PREFIX_EXPR@[328; 330) - MINUS@[328; 329) "-" - LITERAL@[329; 330) - INT_NUMBER@[329; 330) "1" - R_PAREN@[330; 331) ")" - WHITESPACE@[331; 332) " " - BLOCK_EXPR@[332; 339) - BLOCK@[332; 339) - L_CURLY@[332; 333) "{" - WHITESPACE@[333; 338) "\n " - R_CURLY@[338; 339) "}" - WHITESPACE@[339; 340) "\n" - R_CURLY@[340; 341) "}" - WHITESPACE@[341; 343) "\n\n" - ENUM_DEF@[343; 367) - ENUM_KW@[343; 347) "enum" - WHITESPACE@[347; 348) " " - NAME@[348; 349) - IDENT@[348; 349) "A" - WHITESPACE@[349; 350) " " - ENUM_VARIANT_LIST@[350; 367) - L_CURLY@[350; 351) "{" - WHITESPACE@[351; 356) "\n " - ENUM_VARIANT@[356; 365) - NAME@[356; 357) - IDENT@[356; 357) "B" - TUPLE_FIELD_DEF_LIST@[357; 365) - L_PAREN@[357; 358) "(" - TUPLE_FIELD_DEF@[358; 360) - PATH_TYPE@[358; 360) - PATH@[358; 360) - PATH_SEGMENT@[358; 360) - NAME_REF@[358; 360) - IDENT@[358; 360) "i8" - COMMA@[360; 361) "," - WHITESPACE@[361; 362) " " - TUPLE_FIELD_DEF@[362; 364) - PATH_TYPE@[362; 364) - PATH@[362; 364) - PATH_SEGMENT@[362; 364) - NAME_REF@[362; 364) - IDENT@[362; 364) "i8" - R_PAREN@[364; 365) ")" - WHITESPACE@[365; 366) "\n" - R_CURLY@[366; 367) "}" - WHITESPACE@[367; 369) "\n\n" - FN_DEF@[369; 394) - FN_KW@[369; 371) "fn" - WHITESPACE@[371; 372) " " - NAME@[372; 375) - IDENT@[372; 375) "foo" - PARAM_LIST@[375; 391) - L_PAREN@[375; 376) "(" - PARAM@[376; 390) - RANGE_PAT@[376; 386) - LITERAL_PAT@[376; 380) - MINUS@[376; 377) "-" - LITERAL@[377; 380) - INT_NUMBER@[377; 380) "128" - DOT2EQ@[380; 383) "..=" - LITERAL_PAT@[383; 386) - LITERAL@[383; 386) - INT_NUMBER@[383; 386) "127" - COLON@[386; 387) ":" - WHITESPACE@[387; 388) " " - PATH_TYPE@[388; 390) - PATH@[388; 390) - PATH_SEGMENT@[388; 390) - NAME_REF@[388; 390) - IDENT@[388; 390) "i8" - R_PAREN@[390; 391) ")" - WHITESPACE@[391; 392) " " - BLOCK_EXPR@[392; 394) - BLOCK@[392; 394) - L_CURLY@[392; 393) "{" - R_CURLY@[393; 394) "}" - WHITESPACE@[394; 395) "\n" +SOURCE_FILE@0..395 + COMMENT@0..60 "// https://github.com ..." + WHITESPACE@60..62 "\n\n" + FN_DEF@62..341 + FN_KW@62..64 "fn" + WHITESPACE@64..65 " " + NAME@65..69 + IDENT@65..69 "main" + PARAM_LIST@69..71 + L_PAREN@69..70 "(" + R_PAREN@70..71 ")" + WHITESPACE@71..72 " " + BLOCK_EXPR@72..341 + BLOCK@72..341 + L_CURLY@72..73 "{" + WHITESPACE@73..78 "\n " + EXPR_STMT@78..141 + MATCH_EXPR@78..141 + MATCH_KW@78..83 "match" + WHITESPACE@83..84 " " + CALL_EXPR@84..92 + PATH_EXPR@84..88 + PATH@84..88 + PATH_SEGMENT@84..88 + NAME_REF@84..88 + IDENT@84..88 "Some" + ARG_LIST@88..92 + L_PAREN@88..89 "(" + PREFIX_EXPR@89..91 + MINUS@89..90 "-" + LITERAL@90..91 + INT_NUMBER@90..91 "1" + R_PAREN@91..92 ")" + WHITESPACE@92..93 " " + MATCH_ARM_LIST@93..141 + L_CURLY@93..94 "{" + WHITESPACE@94..103 "\n " + MATCH_ARM@103..117 + TUPLE_STRUCT_PAT@103..111 + PATH@103..107 + PATH_SEGMENT@103..107 + NAME_REF@103..107 + IDENT@103..107 "Some" + L_PAREN@107..108 "(" + LITERAL_PAT@108..110 + MINUS@108..109 "-" + LITERAL@109..110 + INT_NUMBER@109..110 "1" + R_PAREN@110..111 ")" + WHITESPACE@111..112 " " + FAT_ARROW@112..114 "=>" + WHITESPACE@114..115 " " + TUPLE_EXPR@115..117 + L_PAREN@115..116 "(" + R_PAREN@116..117 ")" + COMMA@117..118 "," + WHITESPACE@118..127 "\n " + MATCH_ARM@127..134 + PLACEHOLDER_PAT@127..128 + UNDERSCORE@127..128 "_" + WHITESPACE@128..129 " " + FAT_ARROW@129..131 "=>" + WHITESPACE@131..132 " " + TUPLE_EXPR@132..134 + L_PAREN@132..133 "(" + R_PAREN@133..134 ")" + COMMA@134..135 "," + WHITESPACE@135..140 "\n " + R_CURLY@140..141 "}" + WHITESPACE@141..147 "\n\n " + EXPR_STMT@147..222 + MATCH_EXPR@147..222 + MATCH_KW@147..152 "match" + WHITESPACE@152..153 " " + CALL_EXPR@153..167 + PATH_EXPR@153..157 + PATH@153..157 + PATH_SEGMENT@153..157 + NAME_REF@153..157 + IDENT@153..157 "Some" + ARG_LIST@157..167 + L_PAREN@157..158 "(" + TUPLE_EXPR@158..166 + L_PAREN@158..159 "(" + PREFIX_EXPR@159..161 + MINUS@159..160 "-" + LITERAL@160..161 + INT_NUMBER@160..161 "1" + COMMA@161..162 "," + WHITESPACE@162..163 " " + PREFIX_EXPR@163..165 + MINUS@163..164 "-" + LITERAL@164..165 + INT_NUMBER@164..165 "1" + R_PAREN@165..166 ")" + R_PAREN@166..167 ")" + WHITESPACE@167..168 " " + MATCH_ARM_LIST@168..222 + L_CURLY@168..169 "{" + WHITESPACE@169..178 "\n " + MATCH_ARM@178..198 + TUPLE_STRUCT_PAT@178..192 + PATH@178..182 + PATH_SEGMENT@178..182 + NAME_REF@178..182 + IDENT@178..182 "Some" + L_PAREN@182..183 "(" + TUPLE_PAT@183..191 + L_PAREN@183..184 "(" + LITERAL_PAT@184..186 + MINUS@184..185 "-" + LITERAL@185..186 + INT_NUMBER@185..186 "1" + COMMA@186..187 "," + WHITESPACE@187..188 " " + LITERAL_PAT@188..190 + MINUS@188..189 "-" + LITERAL@189..190 + INT_NUMBER@189..190 "1" + R_PAREN@190..191 ")" + R_PAREN@191..192 ")" + WHITESPACE@192..193 " " + FAT_ARROW@193..195 "=>" + WHITESPACE@195..196 " " + TUPLE_EXPR@196..198 + L_PAREN@196..197 "(" + R_PAREN@197..198 ")" + COMMA@198..199 "," + WHITESPACE@199..208 "\n " + MATCH_ARM@208..215 + PLACEHOLDER_PAT@208..209 + UNDERSCORE@208..209 "_" + WHITESPACE@209..210 " " + FAT_ARROW@210..212 "=>" + WHITESPACE@212..213 " " + TUPLE_EXPR@213..215 + L_PAREN@213..214 "(" + R_PAREN@214..215 ")" + COMMA@215..216 "," + WHITESPACE@216..221 "\n " + R_CURLY@221..222 "}" + WHITESPACE@222..228 "\n\n " + EXPR_STMT@228..299 + MATCH_EXPR@228..299 + MATCH_KW@228..233 "match" + WHITESPACE@233..234 " " + CALL_EXPR@234..246 + PATH_EXPR@234..238 + PATH@234..238 + PATH@234..235 + PATH_SEGMENT@234..235 + NAME_REF@234..235 + IDENT@234..235 "A" + COLON2@235..237 "::" + PATH_SEGMENT@237..238 + NAME_REF@237..238 + IDENT@237..238 "B" + ARG_LIST@238..246 + L_PAREN@238..239 "(" + PREFIX_EXPR@239..241 + MINUS@239..240 "-" + LITERAL@240..241 + INT_NUMBER@240..241 "1" + COMMA@241..242 "," + WHITESPACE@242..243 " " + PREFIX_EXPR@243..245 + MINUS@243..244 "-" + LITERAL@244..245 + INT_NUMBER@244..245 "1" + R_PAREN@245..246 ")" + WHITESPACE@246..247 " " + MATCH_ARM_LIST@247..299 + L_CURLY@247..248 "{" + WHITESPACE@248..257 "\n " + MATCH_ARM@257..275 + TUPLE_STRUCT_PAT@257..269 + PATH@257..261 + PATH@257..258 + PATH_SEGMENT@257..258 + NAME_REF@257..258 + IDENT@257..258 "A" + COLON2@258..260 "::" + PATH_SEGMENT@260..261 + NAME_REF@260..261 + IDENT@260..261 "B" + L_PAREN@261..262 "(" + LITERAL_PAT@262..264 + MINUS@262..263 "-" + LITERAL@263..264 + INT_NUMBER@263..264 "1" + COMMA@264..265 "," + WHITESPACE@265..266 " " + LITERAL_PAT@266..268 + MINUS@266..267 "-" + LITERAL@267..268 + INT_NUMBER@267..268 "1" + R_PAREN@268..269 ")" + WHITESPACE@269..270 " " + FAT_ARROW@270..272 "=>" + WHITESPACE@272..273 " " + TUPLE_EXPR@273..275 + L_PAREN@273..274 "(" + R_PAREN@274..275 ")" + COMMA@275..276 "," + WHITESPACE@276..285 "\n " + MATCH_ARM@285..292 + PLACEHOLDER_PAT@285..286 + UNDERSCORE@285..286 "_" + WHITESPACE@286..287 " " + FAT_ARROW@287..289 "=>" + WHITESPACE@289..290 " " + TUPLE_EXPR@290..292 + L_PAREN@290..291 "(" + R_PAREN@291..292 ")" + COMMA@292..293 "," + WHITESPACE@293..298 "\n " + R_CURLY@298..299 "}" + WHITESPACE@299..305 "\n\n " + IF_EXPR@305..339 + IF_KW@305..307 "if" + WHITESPACE@307..308 " " + CONDITION@308..331 + LET_KW@308..311 "let" + WHITESPACE@311..312 " " + TUPLE_STRUCT_PAT@312..320 + PATH@312..316 + PATH_SEGMENT@312..316 + NAME_REF@312..316 + IDENT@312..316 "Some" + L_PAREN@316..317 "(" + LITERAL_PAT@317..319 + MINUS@317..318 "-" + LITERAL@318..319 + INT_NUMBER@318..319 "1" + R_PAREN@319..320 ")" + WHITESPACE@320..321 " " + EQ@321..322 "=" + WHITESPACE@322..323 " " + CALL_EXPR@323..331 + PATH_EXPR@323..327 + PATH@323..327 + PATH_SEGMENT@323..327 + NAME_REF@323..327 + IDENT@323..327 "Some" + ARG_LIST@327..331 + L_PAREN@327..328 "(" + PREFIX_EXPR@328..330 + MINUS@328..329 "-" + LITERAL@329..330 + INT_NUMBER@329..330 "1" + R_PAREN@330..331 ")" + WHITESPACE@331..332 " " + BLOCK_EXPR@332..339 + BLOCK@332..339 + L_CURLY@332..333 "{" + WHITESPACE@333..338 "\n " + R_CURLY@338..339 "}" + WHITESPACE@339..340 "\n" + R_CURLY@340..341 "}" + WHITESPACE@341..343 "\n\n" + ENUM_DEF@343..367 + ENUM_KW@343..347 "enum" + WHITESPACE@347..348 " " + NAME@348..349 + IDENT@348..349 "A" + WHITESPACE@349..350 " " + ENUM_VARIANT_LIST@350..367 + L_CURLY@350..351 "{" + WHITESPACE@351..356 "\n " + ENUM_VARIANT@356..365 + NAME@356..357 + IDENT@356..357 "B" + TUPLE_FIELD_DEF_LIST@357..365 + L_PAREN@357..358 "(" + TUPLE_FIELD_DEF@358..360 + PATH_TYPE@358..360 + PATH@358..360 + PATH_SEGMENT@358..360 + NAME_REF@358..360 + IDENT@358..360 "i8" + COMMA@360..361 "," + WHITESPACE@361..362 " " + TUPLE_FIELD_DEF@362..364 + PATH_TYPE@362..364 + PATH@362..364 + PATH_SEGMENT@362..364 + NAME_REF@362..364 + IDENT@362..364 "i8" + R_PAREN@364..365 ")" + WHITESPACE@365..366 "\n" + R_CURLY@366..367 "}" + WHITESPACE@367..369 "\n\n" + FN_DEF@369..394 + FN_KW@369..371 "fn" + WHITESPACE@371..372 " " + NAME@372..375 + IDENT@372..375 "foo" + PARAM_LIST@375..391 + L_PAREN@375..376 "(" + PARAM@376..390 + RANGE_PAT@376..386 + LITERAL_PAT@376..380 + MINUS@376..377 "-" + LITERAL@377..380 + INT_NUMBER@377..380 "128" + DOT2EQ@380..383 "..=" + LITERAL_PAT@383..386 + LITERAL@383..386 + INT_NUMBER@383..386 "127" + COLON@386..387 ":" + WHITESPACE@387..388 " " + PATH_TYPE@388..390 + PATH@388..390 + PATH_SEGMENT@388..390 + NAME_REF@388..390 + IDENT@388..390 "i8" + R_PAREN@390..391 ")" + WHITESPACE@391..392 " " + BLOCK_EXPR@392..394 + BLOCK@392..394 + L_CURLY@392..393 "{" + R_CURLY@393..394 "}" + WHITESPACE@394..395 "\n" 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 849d8a445c..9c2701bf7f 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 @@ -1,201 +1,201 @@ -SOURCE_FILE@[0; 257) - COMMENT@[0; 58) "// https://github.com ..." - WHITESPACE@[58; 60) "\n\n" - FN_DEF@[60; 256) - FN_KW@[60; 62) "fn" - WHITESPACE@[62; 63) " " - NAME@[63; 82) - IDENT@[63; 82) "compound_assignment" - PARAM_LIST@[82; 84) - L_PAREN@[82; 83) "(" - R_PAREN@[83; 84) ")" - WHITESPACE@[84; 85) " " - BLOCK_EXPR@[85; 256) - BLOCK@[85; 256) - L_CURLY@[85; 86) "{" - WHITESPACE@[86; 91) "\n " - LET_STMT@[91; 105) - LET_KW@[91; 94) "let" - WHITESPACE@[94; 95) " " - BIND_PAT@[95; 100) - MUT_KW@[95; 98) "mut" - WHITESPACE@[98; 99) " " - NAME@[99; 100) - IDENT@[99; 100) "a" - WHITESPACE@[100; 101) " " - EQ@[101; 102) "=" - WHITESPACE@[102; 103) " " - LITERAL@[103; 104) - INT_NUMBER@[103; 104) "0" - SEMICOLON@[104; 105) ";" - WHITESPACE@[105; 110) "\n " - EXPR_STMT@[110; 117) - BIN_EXPR@[110; 116) - PATH_EXPR@[110; 111) - PATH@[110; 111) - PATH_SEGMENT@[110; 111) - NAME_REF@[110; 111) - IDENT@[110; 111) "a" - WHITESPACE@[111; 112) " " - PLUSEQ@[112; 114) "+=" - WHITESPACE@[114; 115) " " - LITERAL@[115; 116) - INT_NUMBER@[115; 116) "1" - SEMICOLON@[116; 117) ";" - WHITESPACE@[117; 122) "\n " - EXPR_STMT@[122; 129) - BIN_EXPR@[122; 128) - PATH_EXPR@[122; 123) - PATH@[122; 123) - PATH_SEGMENT@[122; 123) - NAME_REF@[122; 123) - IDENT@[122; 123) "a" - WHITESPACE@[123; 124) " " - MINUSEQ@[124; 126) "-=" - WHITESPACE@[126; 127) " " - LITERAL@[127; 128) - INT_NUMBER@[127; 128) "2" - SEMICOLON@[128; 129) ";" - WHITESPACE@[129; 134) "\n " - EXPR_STMT@[134; 141) - BIN_EXPR@[134; 140) - PATH_EXPR@[134; 135) - PATH@[134; 135) - PATH_SEGMENT@[134; 135) - NAME_REF@[134; 135) - IDENT@[134; 135) "a" - WHITESPACE@[135; 136) " " - STAREQ@[136; 138) "*=" - WHITESPACE@[138; 139) " " - LITERAL@[139; 140) - INT_NUMBER@[139; 140) "3" - SEMICOLON@[140; 141) ";" - WHITESPACE@[141; 146) "\n " - EXPR_STMT@[146; 153) - BIN_EXPR@[146; 152) - PATH_EXPR@[146; 147) - PATH@[146; 147) - PATH_SEGMENT@[146; 147) - NAME_REF@[146; 147) - IDENT@[146; 147) "a" - WHITESPACE@[147; 148) " " - PERCENTEQ@[148; 150) "%=" - WHITESPACE@[150; 151) " " - LITERAL@[151; 152) - INT_NUMBER@[151; 152) "4" - SEMICOLON@[152; 153) ";" - WHITESPACE@[153; 158) "\n " - EXPR_STMT@[158; 165) - BIN_EXPR@[158; 164) - PATH_EXPR@[158; 159) - PATH@[158; 159) - PATH_SEGMENT@[158; 159) - NAME_REF@[158; 159) - IDENT@[158; 159) "a" - WHITESPACE@[159; 160) " " - SLASHEQ@[160; 162) "/=" - WHITESPACE@[162; 163) " " - LITERAL@[163; 164) - INT_NUMBER@[163; 164) "5" - SEMICOLON@[164; 165) ";" - WHITESPACE@[165; 170) "\n " - EXPR_STMT@[170; 177) - BIN_EXPR@[170; 176) - PATH_EXPR@[170; 171) - PATH@[170; 171) - PATH_SEGMENT@[170; 171) - NAME_REF@[170; 171) - IDENT@[170; 171) "a" - WHITESPACE@[171; 172) " " - PIPEEQ@[172; 174) "|=" - WHITESPACE@[174; 175) " " - LITERAL@[175; 176) - INT_NUMBER@[175; 176) "6" - SEMICOLON@[176; 177) ";" - WHITESPACE@[177; 182) "\n " - EXPR_STMT@[182; 189) - BIN_EXPR@[182; 188) - PATH_EXPR@[182; 183) - PATH@[182; 183) - PATH_SEGMENT@[182; 183) - NAME_REF@[182; 183) - IDENT@[182; 183) "a" - WHITESPACE@[183; 184) " " - AMPEQ@[184; 186) "&=" - WHITESPACE@[186; 187) " " - LITERAL@[187; 188) - INT_NUMBER@[187; 188) "7" - SEMICOLON@[188; 189) ";" - WHITESPACE@[189; 194) "\n " - EXPR_STMT@[194; 201) - BIN_EXPR@[194; 200) - PATH_EXPR@[194; 195) - PATH@[194; 195) - PATH_SEGMENT@[194; 195) - NAME_REF@[194; 195) - IDENT@[194; 195) "a" - WHITESPACE@[195; 196) " " - CARETEQ@[196; 198) "^=" - WHITESPACE@[198; 199) " " - LITERAL@[199; 200) - INT_NUMBER@[199; 200) "8" - SEMICOLON@[200; 201) ";" - WHITESPACE@[201; 206) "\n " - EXPR_STMT@[206; 213) - BIN_EXPR@[206; 212) - PATH_EXPR@[206; 207) - PATH@[206; 207) - PATH_SEGMENT@[206; 207) - NAME_REF@[206; 207) - IDENT@[206; 207) "a" - WHITESPACE@[207; 208) " " - LTEQ@[208; 210) "<=" - WHITESPACE@[210; 211) " " - LITERAL@[211; 212) - INT_NUMBER@[211; 212) "9" - SEMICOLON@[212; 213) ";" - WHITESPACE@[213; 218) "\n " - EXPR_STMT@[218; 226) - BIN_EXPR@[218; 225) - PATH_EXPR@[218; 219) - PATH@[218; 219) - PATH_SEGMENT@[218; 219) - NAME_REF@[218; 219) - IDENT@[218; 219) "a" - WHITESPACE@[219; 220) " " - GTEQ@[220; 222) ">=" - WHITESPACE@[222; 223) " " - LITERAL@[223; 225) - INT_NUMBER@[223; 225) "10" - SEMICOLON@[225; 226) ";" - WHITESPACE@[226; 231) "\n " - EXPR_STMT@[231; 240) - BIN_EXPR@[231; 239) - PATH_EXPR@[231; 232) - PATH@[231; 232) - PATH_SEGMENT@[231; 232) - NAME_REF@[231; 232) - IDENT@[231; 232) "a" - WHITESPACE@[232; 233) " " - SHREQ@[233; 236) ">>=" - WHITESPACE@[236; 237) " " - LITERAL@[237; 239) - INT_NUMBER@[237; 239) "11" - SEMICOLON@[239; 240) ";" - WHITESPACE@[240; 245) "\n " - EXPR_STMT@[245; 254) - BIN_EXPR@[245; 253) - PATH_EXPR@[245; 246) - PATH@[245; 246) - PATH_SEGMENT@[245; 246) - NAME_REF@[245; 246) - IDENT@[245; 246) "a" - WHITESPACE@[246; 247) " " - SHLEQ@[247; 250) "<<=" - WHITESPACE@[250; 251) " " - LITERAL@[251; 253) - INT_NUMBER@[251; 253) "12" - SEMICOLON@[253; 254) ";" - WHITESPACE@[254; 255) "\n" - R_CURLY@[255; 256) "}" - WHITESPACE@[256; 257) "\n" +SOURCE_FILE@0..257 + COMMENT@0..58 "// https://github.com ..." + WHITESPACE@58..60 "\n\n" + FN_DEF@60..256 + FN_KW@60..62 "fn" + WHITESPACE@62..63 " " + NAME@63..82 + IDENT@63..82 "compound_assignment" + PARAM_LIST@82..84 + L_PAREN@82..83 "(" + R_PAREN@83..84 ")" + WHITESPACE@84..85 " " + BLOCK_EXPR@85..256 + BLOCK@85..256 + L_CURLY@85..86 "{" + WHITESPACE@86..91 "\n " + LET_STMT@91..105 + LET_KW@91..94 "let" + WHITESPACE@94..95 " " + BIND_PAT@95..100 + MUT_KW@95..98 "mut" + WHITESPACE@98..99 " " + NAME@99..100 + IDENT@99..100 "a" + WHITESPACE@100..101 " " + EQ@101..102 "=" + WHITESPACE@102..103 " " + LITERAL@103..104 + INT_NUMBER@103..104 "0" + SEMICOLON@104..105 ";" + WHITESPACE@105..110 "\n " + EXPR_STMT@110..117 + BIN_EXPR@110..116 + PATH_EXPR@110..111 + PATH@110..111 + PATH_SEGMENT@110..111 + NAME_REF@110..111 + IDENT@110..111 "a" + WHITESPACE@111..112 " " + PLUSEQ@112..114 "+=" + WHITESPACE@114..115 " " + LITERAL@115..116 + INT_NUMBER@115..116 "1" + SEMICOLON@116..117 ";" + WHITESPACE@117..122 "\n " + EXPR_STMT@122..129 + BIN_EXPR@122..128 + PATH_EXPR@122..123 + PATH@122..123 + PATH_SEGMENT@122..123 + NAME_REF@122..123 + IDENT@122..123 "a" + WHITESPACE@123..124 " " + MINUSEQ@124..126 "-=" + WHITESPACE@126..127 " " + LITERAL@127..128 + INT_NUMBER@127..128 "2" + SEMICOLON@128..129 ";" + WHITESPACE@129..134 "\n " + EXPR_STMT@134..141 + BIN_EXPR@134..140 + PATH_EXPR@134..135 + PATH@134..135 + PATH_SEGMENT@134..135 + NAME_REF@134..135 + IDENT@134..135 "a" + WHITESPACE@135..136 " " + STAREQ@136..138 "*=" + WHITESPACE@138..139 " " + LITERAL@139..140 + INT_NUMBER@139..140 "3" + SEMICOLON@140..141 ";" + WHITESPACE@141..146 "\n " + EXPR_STMT@146..153 + BIN_EXPR@146..152 + PATH_EXPR@146..147 + PATH@146..147 + PATH_SEGMENT@146..147 + NAME_REF@146..147 + IDENT@146..147 "a" + WHITESPACE@147..148 " " + PERCENTEQ@148..150 "%=" + WHITESPACE@150..151 " " + LITERAL@151..152 + INT_NUMBER@151..152 "4" + SEMICOLON@152..153 ";" + WHITESPACE@153..158 "\n " + EXPR_STMT@158..165 + BIN_EXPR@158..164 + PATH_EXPR@158..159 + PATH@158..159 + PATH_SEGMENT@158..159 + NAME_REF@158..159 + IDENT@158..159 "a" + WHITESPACE@159..160 " " + SLASHEQ@160..162 "/=" + WHITESPACE@162..163 " " + LITERAL@163..164 + INT_NUMBER@163..164 "5" + SEMICOLON@164..165 ";" + WHITESPACE@165..170 "\n " + EXPR_STMT@170..177 + BIN_EXPR@170..176 + PATH_EXPR@170..171 + PATH@170..171 + PATH_SEGMENT@170..171 + NAME_REF@170..171 + IDENT@170..171 "a" + WHITESPACE@171..172 " " + PIPEEQ@172..174 "|=" + WHITESPACE@174..175 " " + LITERAL@175..176 + INT_NUMBER@175..176 "6" + SEMICOLON@176..177 ";" + WHITESPACE@177..182 "\n " + EXPR_STMT@182..189 + BIN_EXPR@182..188 + PATH_EXPR@182..183 + PATH@182..183 + PATH_SEGMENT@182..183 + NAME_REF@182..183 + IDENT@182..183 "a" + WHITESPACE@183..184 " " + AMPEQ@184..186 "&=" + WHITESPACE@186..187 " " + LITERAL@187..188 + INT_NUMBER@187..188 "7" + SEMICOLON@188..189 ";" + WHITESPACE@189..194 "\n " + EXPR_STMT@194..201 + BIN_EXPR@194..200 + PATH_EXPR@194..195 + PATH@194..195 + PATH_SEGMENT@194..195 + NAME_REF@194..195 + IDENT@194..195 "a" + WHITESPACE@195..196 " " + CARETEQ@196..198 "^=" + WHITESPACE@198..199 " " + LITERAL@199..200 + INT_NUMBER@199..200 "8" + SEMICOLON@200..201 ";" + WHITESPACE@201..206 "\n " + EXPR_STMT@206..213 + BIN_EXPR@206..212 + PATH_EXPR@206..207 + PATH@206..207 + PATH_SEGMENT@206..207 + NAME_REF@206..207 + IDENT@206..207 "a" + WHITESPACE@207..208 " " + LTEQ@208..210 "<=" + WHITESPACE@210..211 " " + LITERAL@211..212 + INT_NUMBER@211..212 "9" + SEMICOLON@212..213 ";" + WHITESPACE@213..218 "\n " + EXPR_STMT@218..226 + BIN_EXPR@218..225 + PATH_EXPR@218..219 + PATH@218..219 + PATH_SEGMENT@218..219 + NAME_REF@218..219 + IDENT@218..219 "a" + WHITESPACE@219..220 " " + GTEQ@220..222 ">=" + WHITESPACE@222..223 " " + LITERAL@223..225 + INT_NUMBER@223..225 "10" + SEMICOLON@225..226 ";" + WHITESPACE@226..231 "\n " + EXPR_STMT@231..240 + BIN_EXPR@231..239 + PATH_EXPR@231..232 + PATH@231..232 + PATH_SEGMENT@231..232 + NAME_REF@231..232 + IDENT@231..232 "a" + WHITESPACE@232..233 " " + SHREQ@233..236 ">>=" + WHITESPACE@236..237 " " + LITERAL@237..239 + INT_NUMBER@237..239 "11" + SEMICOLON@239..240 ";" + WHITESPACE@240..245 "\n " + EXPR_STMT@245..254 + BIN_EXPR@245..253 + PATH_EXPR@245..246 + PATH@245..246 + PATH_SEGMENT@245..246 + NAME_REF@245..246 + IDENT@245..246 "a" + WHITESPACE@246..247 " " + SHLEQ@247..250 "<<=" + WHITESPACE@250..251 " " + LITERAL@251..253 + INT_NUMBER@251..253 "12" + SEMICOLON@253..254 ";" + WHITESPACE@254..255 "\n" + R_CURLY@255..256 "}" + 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 0d32f0115b..750527bb9f 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 @@ -1,36 +1,36 @@ -SOURCE_FILE@[0; 47) - FN_DEF@[0; 45) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 45) - BLOCK@[9; 45) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 24) - BLOCK_EXPR@[15; 23) - ASYNC_KW@[15; 20) "async" - WHITESPACE@[20; 21) " " - BLOCK@[21; 23) - L_CURLY@[21; 22) "{" - R_CURLY@[22; 23) "}" - SEMICOLON@[23; 24) ";" - WHITESPACE@[24; 29) "\n " - EXPR_STMT@[29; 43) - BLOCK_EXPR@[29; 42) - ASYNC_KW@[29; 34) "async" - WHITESPACE@[34; 35) " " - MOVE_KW@[35; 39) "move" - WHITESPACE@[39; 40) " " - BLOCK@[40; 42) - L_CURLY@[40; 41) "{" - R_CURLY@[41; 42) "}" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 44) "\n" - R_CURLY@[44; 45) "}" - WHITESPACE@[45; 47) "\n\n" +SOURCE_FILE@0..47 + FN_DEF@0..45 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..45 + BLOCK@9..45 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..24 + BLOCK_EXPR@15..23 + ASYNC_KW@15..20 "async" + WHITESPACE@20..21 " " + BLOCK@21..23 + L_CURLY@21..22 "{" + R_CURLY@22..23 "}" + SEMICOLON@23..24 ";" + WHITESPACE@24..29 "\n " + EXPR_STMT@29..43 + BLOCK_EXPR@29..42 + ASYNC_KW@29..34 "async" + WHITESPACE@34..35 " " + MOVE_KW@35..39 "move" + WHITESPACE@39..40 " " + BLOCK@40..42 + L_CURLY@40..41 "{" + R_CURLY@41..42 "}" + SEMICOLON@42..43 ";" + WHITESPACE@43..44 "\n" + R_CURLY@44..45 "}" + 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 17591d99fa..b5577e9332 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 @@ -1,92 +1,92 @@ -SOURCE_FILE@[0; 95) - FN_DEF@[0; 52) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 49) - L_PAREN@[6; 7) "(" - PARAM@[7; 48) - BIND_PAT@[7; 8) - NAME@[7; 8) - IDENT@[7; 8) "x" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - IMPL_TRAIT_TYPE@[10; 48) - IMPL_KW@[10; 14) "impl" - WHITESPACE@[14; 15) " " - TYPE_BOUND_LIST@[15; 48) - TYPE_BOUND@[15; 48) - PATH_TYPE@[15; 48) - PATH@[15; 48) - PATH@[15; 26) - PATH@[15; 18) - PATH_SEGMENT@[15; 18) - NAME_REF@[15; 18) - IDENT@[15; 18) "std" - COLON2@[18; 20) "::" - PATH_SEGMENT@[20; 26) - NAME_REF@[20; 26) - IDENT@[20; 26) "future" - COLON2@[26; 28) "::" - PATH_SEGMENT@[28; 48) - NAME_REF@[28; 34) - IDENT@[28; 34) "Future" - TYPE_ARG_LIST@[34; 48) - L_ANGLE@[34; 35) "<" - ASSOC_TYPE_ARG@[35; 47) - NAME_REF@[35; 41) - IDENT@[35; 41) "Output" - WHITESPACE@[41; 42) " " - EQ@[42; 43) "=" - WHITESPACE@[43; 44) " " - PATH_TYPE@[44; 47) - PATH@[44; 47) - PATH_SEGMENT@[44; 47) - NAME_REF@[44; 47) - IDENT@[44; 47) "i32" - R_ANGLE@[47; 48) ">" - R_PAREN@[48; 49) ")" - WHITESPACE@[49; 50) " " - BLOCK_EXPR@[50; 52) - BLOCK@[50; 52) - L_CURLY@[50; 51) "{" - R_CURLY@[51; 52) "}" - WHITESPACE@[52; 54) "\n\n" - FN_DEF@[54; 94) - FN_KW@[54; 56) "fn" - WHITESPACE@[56; 57) " " - NAME@[57; 61) - IDENT@[57; 61) "main" - PARAM_LIST@[61; 63) - L_PAREN@[61; 62) "(" - R_PAREN@[62; 63) ")" - WHITESPACE@[63; 64) " " - BLOCK_EXPR@[64; 94) - BLOCK@[64; 94) - L_CURLY@[64; 65) "{" - WHITESPACE@[65; 70) "\n " - CALL_EXPR@[70; 92) - PATH_EXPR@[70; 73) - PATH@[70; 73) - PATH_SEGMENT@[70; 73) - NAME_REF@[70; 73) - IDENT@[70; 73) "foo" - ARG_LIST@[73; 92) - L_PAREN@[73; 74) "(" - BLOCK_EXPR@[74; 91) - ASYNC_KW@[74; 79) "async" - WHITESPACE@[79; 80) " " - MOVE_KW@[80; 84) "move" - WHITESPACE@[84; 85) " " - BLOCK@[85; 91) - L_CURLY@[85; 86) "{" - WHITESPACE@[86; 87) " " - LITERAL@[87; 89) - INT_NUMBER@[87; 89) "12" - WHITESPACE@[89; 90) " " - R_CURLY@[90; 91) "}" - R_PAREN@[91; 92) ")" - WHITESPACE@[92; 93) "\n" - R_CURLY@[93; 94) "}" - WHITESPACE@[94; 95) "\n" +SOURCE_FILE@0..95 + FN_DEF@0..52 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..49 + L_PAREN@6..7 "(" + PARAM@7..48 + BIND_PAT@7..8 + NAME@7..8 + IDENT@7..8 "x" + COLON@8..9 ":" + WHITESPACE@9..10 " " + IMPL_TRAIT_TYPE@10..48 + IMPL_KW@10..14 "impl" + WHITESPACE@14..15 " " + TYPE_BOUND_LIST@15..48 + TYPE_BOUND@15..48 + PATH_TYPE@15..48 + PATH@15..48 + PATH@15..26 + PATH@15..18 + PATH_SEGMENT@15..18 + NAME_REF@15..18 + IDENT@15..18 "std" + COLON2@18..20 "::" + PATH_SEGMENT@20..26 + NAME_REF@20..26 + IDENT@20..26 "future" + COLON2@26..28 "::" + PATH_SEGMENT@28..48 + NAME_REF@28..34 + IDENT@28..34 "Future" + TYPE_ARG_LIST@34..48 + L_ANGLE@34..35 "<" + ASSOC_TYPE_ARG@35..47 + NAME_REF@35..41 + IDENT@35..41 "Output" + WHITESPACE@41..42 " " + EQ@42..43 "=" + WHITESPACE@43..44 " " + PATH_TYPE@44..47 + PATH@44..47 + PATH_SEGMENT@44..47 + NAME_REF@44..47 + IDENT@44..47 "i32" + R_ANGLE@47..48 ">" + R_PAREN@48..49 ")" + WHITESPACE@49..50 " " + BLOCK_EXPR@50..52 + BLOCK@50..52 + L_CURLY@50..51 "{" + R_CURLY@51..52 "}" + WHITESPACE@52..54 "\n\n" + FN_DEF@54..94 + FN_KW@54..56 "fn" + WHITESPACE@56..57 " " + NAME@57..61 + IDENT@57..61 "main" + PARAM_LIST@61..63 + L_PAREN@61..62 "(" + R_PAREN@62..63 ")" + WHITESPACE@63..64 " " + BLOCK_EXPR@64..94 + BLOCK@64..94 + L_CURLY@64..65 "{" + WHITESPACE@65..70 "\n " + CALL_EXPR@70..92 + PATH_EXPR@70..73 + PATH@70..73 + PATH_SEGMENT@70..73 + NAME_REF@70..73 + IDENT@70..73 "foo" + ARG_LIST@73..92 + L_PAREN@73..74 "(" + BLOCK_EXPR@74..91 + ASYNC_KW@74..79 "async" + WHITESPACE@79..80 " " + MOVE_KW@80..84 "move" + WHITESPACE@84..85 " " + BLOCK@85..91 + L_CURLY@85..86 "{" + WHITESPACE@86..87 " " + LITERAL@87..89 + INT_NUMBER@87..89 "12" + WHITESPACE@89..90 " " + R_CURLY@90..91 "}" + R_PAREN@91..92 ")" + WHITESPACE@92..93 "\n" + R_CURLY@93..94 "}" + WHITESPACE@94..95 "\n" 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 8fd28427c6..6aacc21417 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 @@ -1,519 +1,519 @@ -SOURCE_FILE@[0; 519) - FN_DEF@[0; 37) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 5) - IDENT@[3; 5) "g1" - PARAM_LIST@[5; 34) - L_PAREN@[5; 6) "(" - ATTR@[6; 14) - POUND@[6; 7) "#" - L_BRACK@[7; 8) "[" - PATH@[8; 13) - PATH_SEGMENT@[8; 13) - NAME_REF@[8; 13) - IDENT@[8; 13) "attr1" - R_BRACK@[13; 14) "]" - WHITESPACE@[14; 15) " " - ATTR@[15; 23) - POUND@[15; 16) "#" - L_BRACK@[16; 17) "[" - PATH@[17; 22) - PATH_SEGMENT@[17; 22) - NAME_REF@[17; 22) - IDENT@[17; 22) "attr2" - R_BRACK@[22; 23) "]" - WHITESPACE@[23; 24) " " - PARAM@[24; 33) - BIND_PAT@[24; 27) - NAME@[24; 27) - IDENT@[24; 27) "pat" - COLON@[27; 28) ":" - WHITESPACE@[28; 29) " " - PATH_TYPE@[29; 33) - PATH@[29; 33) - PATH_SEGMENT@[29; 33) - NAME_REF@[29; 33) - IDENT@[29; 33) "Type" - R_PAREN@[33; 34) ")" - WHITESPACE@[34; 35) " " - BLOCK_EXPR@[35; 37) - BLOCK@[35; 37) - L_CURLY@[35; 36) "{" - R_CURLY@[36; 37) "}" - WHITESPACE@[37; 38) "\n" - FN_DEF@[38; 62) - FN_KW@[38; 40) "fn" - WHITESPACE@[40; 41) " " - NAME@[41; 43) - IDENT@[41; 43) "g2" - PARAM_LIST@[43; 59) - L_PAREN@[43; 44) "(" - ATTR@[44; 52) - POUND@[44; 45) "#" - L_BRACK@[45; 46) "[" - PATH@[46; 51) - PATH_SEGMENT@[46; 51) - NAME_REF@[46; 51) - IDENT@[46; 51) "attr1" - R_BRACK@[51; 52) "]" - WHITESPACE@[52; 53) " " - PARAM@[53; 58) - BIND_PAT@[53; 54) - NAME@[53; 54) - IDENT@[53; 54) "x" - COLON@[54; 55) ":" - WHITESPACE@[55; 56) " " - PATH_TYPE@[56; 58) - PATH@[56; 58) - PATH_SEGMENT@[56; 58) - NAME_REF@[56; 58) - IDENT@[56; 58) "u8" - R_PAREN@[58; 59) ")" - WHITESPACE@[59; 60) " " - BLOCK_EXPR@[60; 62) - BLOCK@[60; 62) - L_CURLY@[60; 61) "{" - R_CURLY@[61; 62) "}" - WHITESPACE@[62; 64) "\n\n" - EXTERN_BLOCK@[64; 128) - ABI@[64; 74) - EXTERN_KW@[64; 70) "extern" - WHITESPACE@[70; 71) " " - STRING@[71; 74) "\"C\"" - WHITESPACE@[74; 75) " " - EXTERN_ITEM_LIST@[75; 128) - L_CURLY@[75; 76) "{" - WHITESPACE@[76; 77) " " - FN_DEF@[77; 126) - FN_KW@[77; 79) "fn" - WHITESPACE@[79; 80) " " - NAME@[80; 86) - IDENT@[80; 86) "printf" - PARAM_LIST@[86; 118) - L_PAREN@[86; 87) "(" - PARAM@[87; 104) - BIND_PAT@[87; 93) - NAME@[87; 93) - IDENT@[87; 93) "format" - COLON@[93; 94) ":" - WHITESPACE@[94; 95) " " - POINTER_TYPE@[95; 104) - STAR@[95; 96) "*" - CONST_KW@[96; 101) "const" - WHITESPACE@[101; 102) " " - PATH_TYPE@[102; 104) - PATH@[102; 104) - PATH_SEGMENT@[102; 104) - NAME_REF@[102; 104) - IDENT@[102; 104) "i8" - COMMA@[104; 105) "," - WHITESPACE@[105; 106) " " - ATTR@[106; 113) - POUND@[106; 107) "#" - L_BRACK@[107; 108) "[" - PATH@[108; 112) - PATH_SEGMENT@[108; 112) - NAME_REF@[108; 112) - IDENT@[108; 112) "attr" - R_BRACK@[112; 113) "]" - WHITESPACE@[113; 114) " " - PARAM@[114; 117) - DOT3@[114; 117) "..." - R_PAREN@[117; 118) ")" - WHITESPACE@[118; 119) " " - RET_TYPE@[119; 125) - THIN_ARROW@[119; 121) "->" - WHITESPACE@[121; 122) " " - PATH_TYPE@[122; 125) - PATH@[122; 125) - PATH_SEGMENT@[122; 125) - NAME_REF@[122; 125) - IDENT@[122; 125) "i32" - SEMICOLON@[125; 126) ";" - WHITESPACE@[126; 127) " " - R_CURLY@[127; 128) "}" - WHITESPACE@[128; 130) "\n\n" - FN_DEF@[130; 172) - FN_KW@[130; 132) "fn" - WHITESPACE@[132; 133) " " - NAME@[133; 136) - IDENT@[133; 136) "foo" - TYPE_PARAM_LIST@[136; 168) - L_ANGLE@[136; 137) "<" - TYPE_PARAM@[137; 167) - NAME@[137; 138) - IDENT@[137; 138) "F" - COLON@[138; 139) ":" - WHITESPACE@[139; 140) " " - TYPE_BOUND_LIST@[140; 167) - TYPE_BOUND@[140; 167) - PATH_TYPE@[140; 167) - PATH@[140; 167) - PATH_SEGMENT@[140; 167) - NAME_REF@[140; 145) - IDENT@[140; 145) "FnMut" - PARAM_LIST@[145; 167) - L_PAREN@[145; 146) "(" - ATTR@[146; 153) - POUND@[146; 147) "#" - L_BRACK@[147; 148) "[" - PATH@[148; 152) - PATH_SEGMENT@[148; 152) - NAME_REF@[148; 152) - IDENT@[148; 152) "attr" - R_BRACK@[152; 153) "]" - WHITESPACE@[153; 154) " " - PARAM@[154; 166) - REFERENCE_TYPE@[154; 166) - AMP@[154; 155) "&" - MUT_KW@[155; 158) "mut" - WHITESPACE@[158; 159) " " - PATH_TYPE@[159; 166) - PATH@[159; 166) - PATH_SEGMENT@[159; 166) - NAME_REF@[159; 162) - IDENT@[159; 162) "Foo" - TYPE_ARG_LIST@[162; 166) - L_ANGLE@[162; 163) "<" - LIFETIME_ARG@[163; 165) - LIFETIME@[163; 165) "\'a" - R_ANGLE@[165; 166) ">" - R_PAREN@[166; 167) ")" - R_ANGLE@[167; 168) ">" - PARAM_LIST@[168; 170) - L_PAREN@[168; 169) "(" - R_PAREN@[169; 170) ")" - BLOCK_EXPR@[170; 172) - BLOCK@[170; 172) - L_CURLY@[170; 171) "{" - R_CURLY@[171; 172) "}" - WHITESPACE@[172; 174) "\n\n" - TRAIT_DEF@[174; 236) - TRAIT_KW@[174; 179) "trait" - WHITESPACE@[179; 180) " " - NAME@[180; 183) - IDENT@[180; 183) "Foo" - WHITESPACE@[183; 184) " " - ITEM_LIST@[184; 236) - L_CURLY@[184; 185) "{" - WHITESPACE@[185; 190) "\n " - FN_DEF@[190; 234) - FN_KW@[190; 192) "fn" - WHITESPACE@[192; 193) " " - NAME@[193; 196) - IDENT@[193; 196) "bar" - PARAM_LIST@[196; 233) - L_PAREN@[196; 197) "(" - ATTR@[197; 204) - POUND@[197; 198) "#" - L_BRACK@[198; 199) "[" - PATH@[199; 203) - PATH_SEGMENT@[199; 203) - NAME_REF@[199; 203) - IDENT@[199; 203) "attr" - R_BRACK@[203; 204) "]" - WHITESPACE@[204; 205) " " - PARAM@[205; 211) - PLACEHOLDER_PAT@[205; 206) - UNDERSCORE@[205; 206) "_" - COLON@[206; 207) ":" - WHITESPACE@[207; 208) " " - PATH_TYPE@[208; 211) - PATH@[208; 211) - PATH_SEGMENT@[208; 211) - NAME_REF@[208; 211) - IDENT@[208; 211) "u64" - COMMA@[211; 212) "," - WHITESPACE@[212; 213) " " - ATTR@[213; 221) - POUND@[213; 214) "#" - WHITESPACE@[214; 215) " " - L_BRACK@[215; 216) "[" - PATH@[216; 220) - PATH_SEGMENT@[216; 220) - NAME_REF@[216; 220) - IDENT@[216; 220) "attr" - R_BRACK@[220; 221) "]" - WHITESPACE@[221; 222) " " - PARAM@[222; 232) - BIND_PAT@[222; 227) - MUT_KW@[222; 225) "mut" - WHITESPACE@[225; 226) " " - NAME@[226; 227) - IDENT@[226; 227) "x" - COLON@[227; 228) ":" - WHITESPACE@[228; 229) " " - PATH_TYPE@[229; 232) - PATH@[229; 232) - PATH_SEGMENT@[229; 232) - NAME_REF@[229; 232) - IDENT@[229; 232) "i32" - R_PAREN@[232; 233) ")" - SEMICOLON@[233; 234) ";" - WHITESPACE@[234; 235) "\n" - R_CURLY@[235; 236) "}" - WHITESPACE@[236; 238) "\n\n" - IMPL_DEF@[238; 519) - IMPL_KW@[238; 242) "impl" - WHITESPACE@[242; 243) " " - PATH_TYPE@[243; 244) - PATH@[243; 244) - PATH_SEGMENT@[243; 244) - NAME_REF@[243; 244) - IDENT@[243; 244) "S" - WHITESPACE@[244; 245) " " - ITEM_LIST@[245; 519) - L_CURLY@[245; 246) "{" - WHITESPACE@[246; 252) "\n " - FN_DEF@[252; 277) - FN_KW@[252; 254) "fn" - WHITESPACE@[254; 255) " " - NAME@[255; 256) - IDENT@[255; 256) "f" - PARAM_LIST@[256; 274) - L_PAREN@[256; 257) "(" - ATTR@[257; 268) - POUND@[257; 258) "#" - L_BRACK@[258; 259) "[" - PATH@[259; 267) - PATH_SEGMENT@[259; 267) - NAME_REF@[259; 267) - IDENT@[259; 267) "must_use" - R_BRACK@[267; 268) "]" - WHITESPACE@[268; 269) " " - SELF_PARAM@[269; 273) - SELF_KW@[269; 273) "self" - R_PAREN@[273; 274) ")" - WHITESPACE@[274; 275) " " - BLOCK_EXPR@[275; 277) - BLOCK@[275; 277) - L_CURLY@[275; 276) "{" - R_CURLY@[276; 277) "}" - WHITESPACE@[277; 283) "\n " - FN_DEF@[283; 305) - FN_KW@[283; 285) "fn" - WHITESPACE@[285; 286) " " - NAME@[286; 288) - IDENT@[286; 288) "g1" - PARAM_LIST@[288; 302) - L_PAREN@[288; 289) "(" - ATTR@[289; 296) - POUND@[289; 290) "#" - L_BRACK@[290; 291) "[" - PATH@[291; 295) - PATH_SEGMENT@[291; 295) - NAME_REF@[291; 295) - IDENT@[291; 295) "attr" - R_BRACK@[295; 296) "]" - WHITESPACE@[296; 297) " " - SELF_PARAM@[297; 301) - SELF_KW@[297; 301) "self" - R_PAREN@[301; 302) ")" - WHITESPACE@[302; 303) " " - BLOCK_EXPR@[303; 305) - BLOCK@[303; 305) - L_CURLY@[303; 304) "{" - R_CURLY@[304; 305) "}" - WHITESPACE@[305; 311) "\n " - FN_DEF@[311; 334) - FN_KW@[311; 313) "fn" - WHITESPACE@[313; 314) " " - NAME@[314; 316) - IDENT@[314; 316) "g2" - PARAM_LIST@[316; 331) - L_PAREN@[316; 317) "(" - ATTR@[317; 324) - POUND@[317; 318) "#" - L_BRACK@[318; 319) "[" - PATH@[319; 323) - PATH_SEGMENT@[319; 323) - NAME_REF@[319; 323) - IDENT@[319; 323) "attr" - R_BRACK@[323; 324) "]" - WHITESPACE@[324; 325) " " - SELF_PARAM@[325; 330) - AMP@[325; 326) "&" - SELF_KW@[326; 330) "self" - R_PAREN@[330; 331) ")" - WHITESPACE@[331; 332) " " - BLOCK_EXPR@[332; 334) - BLOCK@[332; 334) - L_CURLY@[332; 333) "{" - R_CURLY@[333; 334) "}" - WHITESPACE@[334; 340) "\n " - FN_DEF@[340; 371) - FN_KW@[340; 342) "fn" - WHITESPACE@[342; 343) " " - NAME@[343; 345) - IDENT@[343; 345) "g3" - TYPE_PARAM_LIST@[345; 349) - L_ANGLE@[345; 346) "<" - LIFETIME_PARAM@[346; 348) - LIFETIME@[346; 348) "\'a" - R_ANGLE@[348; 349) ">" - PARAM_LIST@[349; 368) - L_PAREN@[349; 350) "(" - ATTR@[350; 357) - POUND@[350; 351) "#" - L_BRACK@[351; 352) "[" - PATH@[352; 356) - PATH_SEGMENT@[352; 356) - NAME_REF@[352; 356) - IDENT@[352; 356) "attr" - R_BRACK@[356; 357) "]" - WHITESPACE@[357; 358) " " - SELF_PARAM@[358; 367) - AMP@[358; 359) "&" - MUT_KW@[359; 362) "mut" - WHITESPACE@[362; 363) " " - SELF_KW@[363; 367) "self" - R_PAREN@[367; 368) ")" - WHITESPACE@[368; 369) " " - BLOCK_EXPR@[369; 371) - BLOCK@[369; 371) - L_CURLY@[369; 370) "{" - R_CURLY@[370; 371) "}" - WHITESPACE@[371; 377) "\n " - FN_DEF@[377; 407) - FN_KW@[377; 379) "fn" - WHITESPACE@[379; 380) " " - NAME@[380; 382) - IDENT@[380; 382) "g4" - TYPE_PARAM_LIST@[382; 386) - L_ANGLE@[382; 383) "<" - LIFETIME_PARAM@[383; 385) - LIFETIME@[383; 385) "\'a" - R_ANGLE@[385; 386) ">" - PARAM_LIST@[386; 404) - L_PAREN@[386; 387) "(" - ATTR@[387; 394) - POUND@[387; 388) "#" - L_BRACK@[388; 389) "[" - PATH@[389; 393) - PATH_SEGMENT@[389; 393) - NAME_REF@[389; 393) - IDENT@[389; 393) "attr" - R_BRACK@[393; 394) "]" - WHITESPACE@[394; 395) " " - SELF_PARAM@[395; 403) - AMP@[395; 396) "&" - LIFETIME@[396; 398) "\'a" - WHITESPACE@[398; 399) " " - SELF_KW@[399; 403) "self" - R_PAREN@[403; 404) ")" - WHITESPACE@[404; 405) " " - BLOCK_EXPR@[405; 407) - BLOCK@[405; 407) - L_CURLY@[405; 406) "{" - R_CURLY@[406; 407) "}" - WHITESPACE@[407; 413) "\n " - FN_DEF@[413; 447) - FN_KW@[413; 415) "fn" - WHITESPACE@[415; 416) " " - NAME@[416; 418) - IDENT@[416; 418) "g5" - TYPE_PARAM_LIST@[418; 422) - L_ANGLE@[418; 419) "<" - LIFETIME_PARAM@[419; 421) - LIFETIME@[419; 421) "\'a" - R_ANGLE@[421; 422) ">" - PARAM_LIST@[422; 444) - L_PAREN@[422; 423) "(" - ATTR@[423; 430) - POUND@[423; 424) "#" - L_BRACK@[424; 425) "[" - PATH@[425; 429) - PATH_SEGMENT@[425; 429) - NAME_REF@[425; 429) - IDENT@[425; 429) "attr" - R_BRACK@[429; 430) "]" - WHITESPACE@[430; 431) " " - SELF_PARAM@[431; 443) - AMP@[431; 432) "&" - LIFETIME@[432; 434) "\'a" - WHITESPACE@[434; 435) " " - MUT_KW@[435; 438) "mut" - WHITESPACE@[438; 439) " " - SELF_KW@[439; 443) "self" - R_PAREN@[443; 444) ")" - WHITESPACE@[444; 445) " " - BLOCK_EXPR@[445; 447) - BLOCK@[445; 447) - L_CURLY@[445; 446) "{" - R_CURLY@[446; 447) "}" - WHITESPACE@[447; 453) "\n " - FN_DEF@[453; 480) - FN_KW@[453; 455) "fn" - WHITESPACE@[455; 456) " " - NAME@[456; 457) - IDENT@[456; 457) "c" - PARAM_LIST@[457; 477) - L_PAREN@[457; 458) "(" - ATTR@[458; 465) - POUND@[458; 459) "#" - L_BRACK@[459; 460) "[" - PATH@[460; 464) - PATH_SEGMENT@[460; 464) - NAME_REF@[460; 464) - IDENT@[460; 464) "attr" - R_BRACK@[464; 465) "]" - WHITESPACE@[465; 466) " " - SELF_PARAM@[466; 476) - SELF_KW@[466; 470) "self" - COLON@[470; 471) ":" - WHITESPACE@[471; 472) " " - PATH_TYPE@[472; 476) - PATH@[472; 476) - PATH_SEGMENT@[472; 476) - NAME_REF@[472; 476) - IDENT@[472; 476) "Self" - R_PAREN@[476; 477) ")" - WHITESPACE@[477; 478) " " - BLOCK_EXPR@[478; 480) - BLOCK@[478; 480) - L_CURLY@[478; 479) "{" - R_CURLY@[479; 480) "}" - WHITESPACE@[480; 486) "\n " - FN_DEF@[486; 517) - FN_KW@[486; 488) "fn" - WHITESPACE@[488; 489) " " - NAME@[489; 490) - IDENT@[489; 490) "d" - PARAM_LIST@[490; 514) - L_PAREN@[490; 491) "(" - ATTR@[491; 498) - POUND@[491; 492) "#" - L_BRACK@[492; 493) "[" - PATH@[493; 497) - PATH_SEGMENT@[493; 497) - NAME_REF@[493; 497) - IDENT@[493; 497) "attr" - R_BRACK@[497; 498) "]" - WHITESPACE@[498; 499) " " - SELF_PARAM@[499; 513) - SELF_KW@[499; 503) "self" - COLON@[503; 504) ":" - WHITESPACE@[504; 505) " " - PATH_TYPE@[505; 513) - PATH@[505; 513) - PATH_SEGMENT@[505; 513) - NAME_REF@[505; 507) - IDENT@[505; 507) "Rc" - TYPE_ARG_LIST@[507; 513) - L_ANGLE@[507; 508) "<" - TYPE_ARG@[508; 512) - PATH_TYPE@[508; 512) - PATH@[508; 512) - PATH_SEGMENT@[508; 512) - NAME_REF@[508; 512) - IDENT@[508; 512) "Self" - R_ANGLE@[512; 513) ">" - R_PAREN@[513; 514) ")" - WHITESPACE@[514; 515) " " - BLOCK_EXPR@[515; 517) - BLOCK@[515; 517) - L_CURLY@[515; 516) "{" - R_CURLY@[516; 517) "}" - WHITESPACE@[517; 518) "\n" - R_CURLY@[518; 519) "}" +SOURCE_FILE@0..519 + FN_DEF@0..37 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..5 + IDENT@3..5 "g1" + PARAM_LIST@5..34 + L_PAREN@5..6 "(" + ATTR@6..14 + POUND@6..7 "#" + L_BRACK@7..8 "[" + PATH@8..13 + PATH_SEGMENT@8..13 + NAME_REF@8..13 + IDENT@8..13 "attr1" + R_BRACK@13..14 "]" + WHITESPACE@14..15 " " + ATTR@15..23 + POUND@15..16 "#" + L_BRACK@16..17 "[" + PATH@17..22 + PATH_SEGMENT@17..22 + NAME_REF@17..22 + IDENT@17..22 "attr2" + R_BRACK@22..23 "]" + WHITESPACE@23..24 " " + PARAM@24..33 + BIND_PAT@24..27 + NAME@24..27 + IDENT@24..27 "pat" + COLON@27..28 ":" + WHITESPACE@28..29 " " + PATH_TYPE@29..33 + PATH@29..33 + PATH_SEGMENT@29..33 + NAME_REF@29..33 + IDENT@29..33 "Type" + R_PAREN@33..34 ")" + WHITESPACE@34..35 " " + BLOCK_EXPR@35..37 + BLOCK@35..37 + L_CURLY@35..36 "{" + R_CURLY@36..37 "}" + WHITESPACE@37..38 "\n" + FN_DEF@38..62 + FN_KW@38..40 "fn" + WHITESPACE@40..41 " " + NAME@41..43 + IDENT@41..43 "g2" + PARAM_LIST@43..59 + L_PAREN@43..44 "(" + ATTR@44..52 + POUND@44..45 "#" + L_BRACK@45..46 "[" + PATH@46..51 + PATH_SEGMENT@46..51 + NAME_REF@46..51 + IDENT@46..51 "attr1" + R_BRACK@51..52 "]" + WHITESPACE@52..53 " " + PARAM@53..58 + BIND_PAT@53..54 + NAME@53..54 + IDENT@53..54 "x" + COLON@54..55 ":" + WHITESPACE@55..56 " " + PATH_TYPE@56..58 + PATH@56..58 + PATH_SEGMENT@56..58 + NAME_REF@56..58 + IDENT@56..58 "u8" + R_PAREN@58..59 ")" + WHITESPACE@59..60 " " + BLOCK_EXPR@60..62 + BLOCK@60..62 + L_CURLY@60..61 "{" + R_CURLY@61..62 "}" + WHITESPACE@62..64 "\n\n" + EXTERN_BLOCK@64..128 + ABI@64..74 + EXTERN_KW@64..70 "extern" + WHITESPACE@70..71 " " + STRING@71..74 "\"C\"" + WHITESPACE@74..75 " " + EXTERN_ITEM_LIST@75..128 + L_CURLY@75..76 "{" + WHITESPACE@76..77 " " + FN_DEF@77..126 + FN_KW@77..79 "fn" + WHITESPACE@79..80 " " + NAME@80..86 + IDENT@80..86 "printf" + PARAM_LIST@86..118 + L_PAREN@86..87 "(" + PARAM@87..104 + BIND_PAT@87..93 + NAME@87..93 + IDENT@87..93 "format" + COLON@93..94 ":" + WHITESPACE@94..95 " " + POINTER_TYPE@95..104 + STAR@95..96 "*" + CONST_KW@96..101 "const" + WHITESPACE@101..102 " " + PATH_TYPE@102..104 + PATH@102..104 + PATH_SEGMENT@102..104 + NAME_REF@102..104 + IDENT@102..104 "i8" + COMMA@104..105 "," + WHITESPACE@105..106 " " + ATTR@106..113 + POUND@106..107 "#" + L_BRACK@107..108 "[" + PATH@108..112 + PATH_SEGMENT@108..112 + NAME_REF@108..112 + IDENT@108..112 "attr" + R_BRACK@112..113 "]" + WHITESPACE@113..114 " " + PARAM@114..117 + DOT3@114..117 "..." + R_PAREN@117..118 ")" + WHITESPACE@118..119 " " + RET_TYPE@119..125 + THIN_ARROW@119..121 "->" + WHITESPACE@121..122 " " + PATH_TYPE@122..125 + PATH@122..125 + PATH_SEGMENT@122..125 + NAME_REF@122..125 + IDENT@122..125 "i32" + SEMICOLON@125..126 ";" + WHITESPACE@126..127 " " + R_CURLY@127..128 "}" + WHITESPACE@128..130 "\n\n" + FN_DEF@130..172 + FN_KW@130..132 "fn" + WHITESPACE@132..133 " " + NAME@133..136 + IDENT@133..136 "foo" + TYPE_PARAM_LIST@136..168 + L_ANGLE@136..137 "<" + TYPE_PARAM@137..167 + NAME@137..138 + IDENT@137..138 "F" + COLON@138..139 ":" + WHITESPACE@139..140 " " + TYPE_BOUND_LIST@140..167 + TYPE_BOUND@140..167 + PATH_TYPE@140..167 + PATH@140..167 + PATH_SEGMENT@140..167 + NAME_REF@140..145 + IDENT@140..145 "FnMut" + PARAM_LIST@145..167 + L_PAREN@145..146 "(" + ATTR@146..153 + POUND@146..147 "#" + L_BRACK@147..148 "[" + PATH@148..152 + PATH_SEGMENT@148..152 + NAME_REF@148..152 + IDENT@148..152 "attr" + R_BRACK@152..153 "]" + WHITESPACE@153..154 " " + PARAM@154..166 + REFERENCE_TYPE@154..166 + AMP@154..155 "&" + MUT_KW@155..158 "mut" + WHITESPACE@158..159 " " + PATH_TYPE@159..166 + PATH@159..166 + PATH_SEGMENT@159..166 + NAME_REF@159..162 + IDENT@159..162 "Foo" + TYPE_ARG_LIST@162..166 + L_ANGLE@162..163 "<" + LIFETIME_ARG@163..165 + LIFETIME@163..165 "\'a" + R_ANGLE@165..166 ">" + R_PAREN@166..167 ")" + R_ANGLE@167..168 ">" + PARAM_LIST@168..170 + L_PAREN@168..169 "(" + R_PAREN@169..170 ")" + BLOCK_EXPR@170..172 + BLOCK@170..172 + L_CURLY@170..171 "{" + R_CURLY@171..172 "}" + WHITESPACE@172..174 "\n\n" + TRAIT_DEF@174..236 + TRAIT_KW@174..179 "trait" + WHITESPACE@179..180 " " + NAME@180..183 + IDENT@180..183 "Foo" + WHITESPACE@183..184 " " + ITEM_LIST@184..236 + L_CURLY@184..185 "{" + WHITESPACE@185..190 "\n " + FN_DEF@190..234 + FN_KW@190..192 "fn" + WHITESPACE@192..193 " " + NAME@193..196 + IDENT@193..196 "bar" + PARAM_LIST@196..233 + L_PAREN@196..197 "(" + ATTR@197..204 + POUND@197..198 "#" + L_BRACK@198..199 "[" + PATH@199..203 + PATH_SEGMENT@199..203 + NAME_REF@199..203 + IDENT@199..203 "attr" + R_BRACK@203..204 "]" + WHITESPACE@204..205 " " + PARAM@205..211 + PLACEHOLDER_PAT@205..206 + UNDERSCORE@205..206 "_" + COLON@206..207 ":" + WHITESPACE@207..208 " " + PATH_TYPE@208..211 + PATH@208..211 + PATH_SEGMENT@208..211 + NAME_REF@208..211 + IDENT@208..211 "u64" + COMMA@211..212 "," + WHITESPACE@212..213 " " + ATTR@213..221 + POUND@213..214 "#" + WHITESPACE@214..215 " " + L_BRACK@215..216 "[" + PATH@216..220 + PATH_SEGMENT@216..220 + NAME_REF@216..220 + IDENT@216..220 "attr" + R_BRACK@220..221 "]" + WHITESPACE@221..222 " " + PARAM@222..232 + BIND_PAT@222..227 + MUT_KW@222..225 "mut" + WHITESPACE@225..226 " " + NAME@226..227 + IDENT@226..227 "x" + COLON@227..228 ":" + WHITESPACE@228..229 " " + PATH_TYPE@229..232 + PATH@229..232 + PATH_SEGMENT@229..232 + NAME_REF@229..232 + IDENT@229..232 "i32" + R_PAREN@232..233 ")" + SEMICOLON@233..234 ";" + WHITESPACE@234..235 "\n" + R_CURLY@235..236 "}" + WHITESPACE@236..238 "\n\n" + IMPL_DEF@238..519 + IMPL_KW@238..242 "impl" + WHITESPACE@242..243 " " + PATH_TYPE@243..244 + PATH@243..244 + PATH_SEGMENT@243..244 + NAME_REF@243..244 + IDENT@243..244 "S" + WHITESPACE@244..245 " " + ITEM_LIST@245..519 + L_CURLY@245..246 "{" + WHITESPACE@246..252 "\n " + FN_DEF@252..277 + FN_KW@252..254 "fn" + WHITESPACE@254..255 " " + NAME@255..256 + IDENT@255..256 "f" + PARAM_LIST@256..274 + L_PAREN@256..257 "(" + ATTR@257..268 + POUND@257..258 "#" + L_BRACK@258..259 "[" + PATH@259..267 + PATH_SEGMENT@259..267 + NAME_REF@259..267 + IDENT@259..267 "must_use" + R_BRACK@267..268 "]" + WHITESPACE@268..269 " " + SELF_PARAM@269..273 + SELF_KW@269..273 "self" + R_PAREN@273..274 ")" + WHITESPACE@274..275 " " + BLOCK_EXPR@275..277 + BLOCK@275..277 + L_CURLY@275..276 "{" + R_CURLY@276..277 "}" + WHITESPACE@277..283 "\n " + FN_DEF@283..305 + FN_KW@283..285 "fn" + WHITESPACE@285..286 " " + NAME@286..288 + IDENT@286..288 "g1" + PARAM_LIST@288..302 + L_PAREN@288..289 "(" + ATTR@289..296 + POUND@289..290 "#" + L_BRACK@290..291 "[" + PATH@291..295 + PATH_SEGMENT@291..295 + NAME_REF@291..295 + IDENT@291..295 "attr" + R_BRACK@295..296 "]" + WHITESPACE@296..297 " " + SELF_PARAM@297..301 + SELF_KW@297..301 "self" + R_PAREN@301..302 ")" + WHITESPACE@302..303 " " + BLOCK_EXPR@303..305 + BLOCK@303..305 + L_CURLY@303..304 "{" + R_CURLY@304..305 "}" + WHITESPACE@305..311 "\n " + FN_DEF@311..334 + FN_KW@311..313 "fn" + WHITESPACE@313..314 " " + NAME@314..316 + IDENT@314..316 "g2" + PARAM_LIST@316..331 + L_PAREN@316..317 "(" + ATTR@317..324 + POUND@317..318 "#" + L_BRACK@318..319 "[" + PATH@319..323 + PATH_SEGMENT@319..323 + NAME_REF@319..323 + IDENT@319..323 "attr" + R_BRACK@323..324 "]" + WHITESPACE@324..325 " " + SELF_PARAM@325..330 + AMP@325..326 "&" + SELF_KW@326..330 "self" + R_PAREN@330..331 ")" + WHITESPACE@331..332 " " + BLOCK_EXPR@332..334 + BLOCK@332..334 + L_CURLY@332..333 "{" + R_CURLY@333..334 "}" + WHITESPACE@334..340 "\n " + FN_DEF@340..371 + FN_KW@340..342 "fn" + WHITESPACE@342..343 " " + NAME@343..345 + IDENT@343..345 "g3" + TYPE_PARAM_LIST@345..349 + L_ANGLE@345..346 "<" + LIFETIME_PARAM@346..348 + LIFETIME@346..348 "\'a" + R_ANGLE@348..349 ">" + PARAM_LIST@349..368 + L_PAREN@349..350 "(" + ATTR@350..357 + POUND@350..351 "#" + L_BRACK@351..352 "[" + PATH@352..356 + PATH_SEGMENT@352..356 + NAME_REF@352..356 + IDENT@352..356 "attr" + R_BRACK@356..357 "]" + WHITESPACE@357..358 " " + SELF_PARAM@358..367 + AMP@358..359 "&" + MUT_KW@359..362 "mut" + WHITESPACE@362..363 " " + SELF_KW@363..367 "self" + R_PAREN@367..368 ")" + WHITESPACE@368..369 " " + BLOCK_EXPR@369..371 + BLOCK@369..371 + L_CURLY@369..370 "{" + R_CURLY@370..371 "}" + WHITESPACE@371..377 "\n " + FN_DEF@377..407 + FN_KW@377..379 "fn" + WHITESPACE@379..380 " " + NAME@380..382 + IDENT@380..382 "g4" + TYPE_PARAM_LIST@382..386 + L_ANGLE@382..383 "<" + LIFETIME_PARAM@383..385 + LIFETIME@383..385 "\'a" + R_ANGLE@385..386 ">" + PARAM_LIST@386..404 + L_PAREN@386..387 "(" + ATTR@387..394 + POUND@387..388 "#" + L_BRACK@388..389 "[" + PATH@389..393 + PATH_SEGMENT@389..393 + NAME_REF@389..393 + IDENT@389..393 "attr" + R_BRACK@393..394 "]" + WHITESPACE@394..395 " " + SELF_PARAM@395..403 + AMP@395..396 "&" + LIFETIME@396..398 "\'a" + WHITESPACE@398..399 " " + SELF_KW@399..403 "self" + R_PAREN@403..404 ")" + WHITESPACE@404..405 " " + BLOCK_EXPR@405..407 + BLOCK@405..407 + L_CURLY@405..406 "{" + R_CURLY@406..407 "}" + WHITESPACE@407..413 "\n " + FN_DEF@413..447 + FN_KW@413..415 "fn" + WHITESPACE@415..416 " " + NAME@416..418 + IDENT@416..418 "g5" + TYPE_PARAM_LIST@418..422 + L_ANGLE@418..419 "<" + LIFETIME_PARAM@419..421 + LIFETIME@419..421 "\'a" + R_ANGLE@421..422 ">" + PARAM_LIST@422..444 + L_PAREN@422..423 "(" + ATTR@423..430 + POUND@423..424 "#" + L_BRACK@424..425 "[" + PATH@425..429 + PATH_SEGMENT@425..429 + NAME_REF@425..429 + IDENT@425..429 "attr" + R_BRACK@429..430 "]" + WHITESPACE@430..431 " " + SELF_PARAM@431..443 + AMP@431..432 "&" + LIFETIME@432..434 "\'a" + WHITESPACE@434..435 " " + MUT_KW@435..438 "mut" + WHITESPACE@438..439 " " + SELF_KW@439..443 "self" + R_PAREN@443..444 ")" + WHITESPACE@444..445 " " + BLOCK_EXPR@445..447 + BLOCK@445..447 + L_CURLY@445..446 "{" + R_CURLY@446..447 "}" + WHITESPACE@447..453 "\n " + FN_DEF@453..480 + FN_KW@453..455 "fn" + WHITESPACE@455..456 " " + NAME@456..457 + IDENT@456..457 "c" + PARAM_LIST@457..477 + L_PAREN@457..458 "(" + ATTR@458..465 + POUND@458..459 "#" + L_BRACK@459..460 "[" + PATH@460..464 + PATH_SEGMENT@460..464 + NAME_REF@460..464 + IDENT@460..464 "attr" + R_BRACK@464..465 "]" + WHITESPACE@465..466 " " + SELF_PARAM@466..476 + SELF_KW@466..470 "self" + COLON@470..471 ":" + WHITESPACE@471..472 " " + PATH_TYPE@472..476 + PATH@472..476 + PATH_SEGMENT@472..476 + NAME_REF@472..476 + IDENT@472..476 "Self" + R_PAREN@476..477 ")" + WHITESPACE@477..478 " " + BLOCK_EXPR@478..480 + BLOCK@478..480 + L_CURLY@478..479 "{" + R_CURLY@479..480 "}" + WHITESPACE@480..486 "\n " + FN_DEF@486..517 + FN_KW@486..488 "fn" + WHITESPACE@488..489 " " + NAME@489..490 + IDENT@489..490 "d" + PARAM_LIST@490..514 + L_PAREN@490..491 "(" + ATTR@491..498 + POUND@491..492 "#" + L_BRACK@492..493 "[" + PATH@493..497 + PATH_SEGMENT@493..497 + NAME_REF@493..497 + IDENT@493..497 "attr" + R_BRACK@497..498 "]" + WHITESPACE@498..499 " " + SELF_PARAM@499..513 + SELF_KW@499..503 "self" + COLON@503..504 ":" + WHITESPACE@504..505 " " + PATH_TYPE@505..513 + PATH@505..513 + PATH_SEGMENT@505..513 + NAME_REF@505..507 + IDENT@505..507 "Rc" + TYPE_ARG_LIST@507..513 + L_ANGLE@507..508 "<" + TYPE_ARG@508..512 + PATH_TYPE@508..512 + PATH@508..512 + PATH_SEGMENT@508..512 + NAME_REF@508..512 + IDENT@508..512 "Self" + R_ANGLE@512..513 ">" + R_PAREN@513..514 ")" + WHITESPACE@514..515 " " + BLOCK_EXPR@515..517 + BLOCK@515..517 + L_CURLY@515..516 "{" + R_CURLY@516..517 "}" + WHITESPACE@517..518 "\n" + R_CURLY@518..519 "}" 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 473966cd40..f376f86a74 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 @@ -1,81 +1,81 @@ -SOURCE_FILE@[0; 80) - FN_DEF@[0; 79) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 79) - BLOCK@[9; 79) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 14) "\n " - FOR_EXPR@[14; 77) - FOR_KW@[14; 17) "for" - WHITESPACE@[17; 18) " " - BIND_PAT@[18; 20) - NAME@[18; 20) - IDENT@[18; 20) "_x" - WHITESPACE@[20; 21) " " - IN_KW@[21; 23) "in" - WHITESPACE@[23; 24) " " - RANGE_EXPR@[24; 56) - LITERAL@[24; 25) - INT_NUMBER@[24; 25) "0" - WHITESPACE@[25; 26) " " - DOT2@[26; 28) ".." - WHITESPACE@[28; 29) " " - METHOD_CALL_EXPR@[29; 56) - PAREN_EXPR@[29; 43) - L_PAREN@[29; 30) "(" - RANGE_EXPR@[30; 42) - LITERAL@[30; 31) - INT_NUMBER@[30; 31) "0" - WHITESPACE@[31; 32) " " - DOT2@[32; 34) ".." - WHITESPACE@[34; 35) " " - BLOCK_EXPR@[35; 42) - BLOCK@[35; 42) - L_CURLY@[35; 36) "{" - BIN_EXPR@[36; 41) - LITERAL@[36; 37) - INT_NUMBER@[36; 37) "1" - WHITESPACE@[37; 38) " " - PLUS@[38; 39) "+" - WHITESPACE@[39; 40) " " - LITERAL@[40; 41) - INT_NUMBER@[40; 41) "2" - R_CURLY@[41; 42) "}" - R_PAREN@[42; 43) ")" - DOT@[43; 44) "." - NAME_REF@[44; 47) - IDENT@[44; 47) "sum" - TYPE_ARG_LIST@[47; 54) - COLON2@[47; 49) "::" - L_ANGLE@[49; 50) "<" - TYPE_ARG@[50; 53) - PATH_TYPE@[50; 53) - PATH@[50; 53) - PATH_SEGMENT@[50; 53) - NAME_REF@[50; 53) - IDENT@[50; 53) "u32" - R_ANGLE@[53; 54) ">" - ARG_LIST@[54; 56) - L_PAREN@[54; 55) "(" - R_PAREN@[55; 56) ")" - WHITESPACE@[56; 57) " " - BLOCK_EXPR@[57; 77) - BLOCK@[57; 77) - L_CURLY@[57; 58) "{" - WHITESPACE@[58; 66) "\n " - EXPR_STMT@[66; 72) - BREAK_EXPR@[66; 71) - BREAK_KW@[66; 71) "break" - SEMICOLON@[71; 72) ";" - WHITESPACE@[72; 76) "\n " - R_CURLY@[76; 77) "}" - WHITESPACE@[77; 78) "\n" - R_CURLY@[78; 79) "}" - WHITESPACE@[79; 80) "\n" +SOURCE_FILE@0..80 + FN_DEF@0..79 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..79 + BLOCK@9..79 + L_CURLY@9..10 "{" + WHITESPACE@10..14 "\n " + FOR_EXPR@14..77 + FOR_KW@14..17 "for" + WHITESPACE@17..18 " " + BIND_PAT@18..20 + NAME@18..20 + IDENT@18..20 "_x" + WHITESPACE@20..21 " " + IN_KW@21..23 "in" + WHITESPACE@23..24 " " + RANGE_EXPR@24..56 + LITERAL@24..25 + INT_NUMBER@24..25 "0" + WHITESPACE@25..26 " " + DOT2@26..28 ".." + WHITESPACE@28..29 " " + METHOD_CALL_EXPR@29..56 + PAREN_EXPR@29..43 + L_PAREN@29..30 "(" + RANGE_EXPR@30..42 + LITERAL@30..31 + INT_NUMBER@30..31 "0" + WHITESPACE@31..32 " " + DOT2@32..34 ".." + WHITESPACE@34..35 " " + BLOCK_EXPR@35..42 + BLOCK@35..42 + L_CURLY@35..36 "{" + BIN_EXPR@36..41 + LITERAL@36..37 + INT_NUMBER@36..37 "1" + WHITESPACE@37..38 " " + PLUS@38..39 "+" + WHITESPACE@39..40 " " + LITERAL@40..41 + INT_NUMBER@40..41 "2" + R_CURLY@41..42 "}" + R_PAREN@42..43 ")" + DOT@43..44 "." + NAME_REF@44..47 + IDENT@44..47 "sum" + TYPE_ARG_LIST@47..54 + COLON2@47..49 "::" + L_ANGLE@49..50 "<" + TYPE_ARG@50..53 + PATH_TYPE@50..53 + PATH@50..53 + PATH_SEGMENT@50..53 + NAME_REF@50..53 + IDENT@50..53 "u32" + R_ANGLE@53..54 ">" + ARG_LIST@54..56 + L_PAREN@54..55 "(" + R_PAREN@55..56 ")" + WHITESPACE@56..57 " " + BLOCK_EXPR@57..77 + BLOCK@57..77 + L_CURLY@57..58 "{" + WHITESPACE@58..66 "\n " + EXPR_STMT@66..72 + BREAK_EXPR@66..71 + BREAK_KW@66..71 "break" + SEMICOLON@71..72 ";" + WHITESPACE@72..76 "\n " + R_CURLY@76..77 "}" + WHITESPACE@77..78 "\n" + R_CURLY@78..79 "}" + WHITESPACE@79..80 "\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 60a4918531..be60f7a8ed 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 @@ -1,39 +1,39 @@ -SOURCE_FILE@[0; 65) - MACRO_CALL@[0; 64) - COMMENT@[0; 13) "/// Some docs" - WHITESPACE@[13; 14) "\n" - ATTR@[14; 29) - POUND@[14; 15) "#" - L_BRACK@[15; 16) "[" - PATH@[16; 28) - PATH_SEGMENT@[16; 28) - NAME_REF@[16; 28) - IDENT@[16; 28) "macro_export" - R_BRACK@[28; 29) "]" - WHITESPACE@[29; 30) "\n" - PATH@[30; 41) - PATH_SEGMENT@[30; 41) - NAME_REF@[30; 41) - IDENT@[30; 41) "macro_rules" - BANG@[41; 42) "!" - WHITESPACE@[42; 43) " " - NAME@[43; 46) - IDENT@[43; 46) "foo" - WHITESPACE@[46; 47) " " - TOKEN_TREE@[47; 64) - L_CURLY@[47; 48) "{" - WHITESPACE@[48; 53) "\n " - TOKEN_TREE@[53; 55) - L_PAREN@[53; 54) "(" - R_PAREN@[54; 55) ")" - WHITESPACE@[55; 56) " " - EQ@[56; 57) "=" - R_ANGLE@[57; 58) ">" - WHITESPACE@[58; 59) " " - TOKEN_TREE@[59; 61) - L_CURLY@[59; 60) "{" - R_CURLY@[60; 61) "}" - SEMICOLON@[61; 62) ";" - WHITESPACE@[62; 63) "\n" - R_CURLY@[63; 64) "}" - WHITESPACE@[64; 65) "\n" +SOURCE_FILE@0..65 + MACRO_CALL@0..64 + COMMENT@0..13 "/// Some docs" + WHITESPACE@13..14 "\n" + ATTR@14..29 + POUND@14..15 "#" + L_BRACK@15..16 "[" + PATH@16..28 + PATH_SEGMENT@16..28 + NAME_REF@16..28 + IDENT@16..28 "macro_export" + R_BRACK@28..29 "]" + WHITESPACE@29..30 "\n" + PATH@30..41 + PATH_SEGMENT@30..41 + NAME_REF@30..41 + IDENT@30..41 "macro_rules" + BANG@41..42 "!" + WHITESPACE@42..43 " " + NAME@43..46 + IDENT@43..46 "foo" + WHITESPACE@46..47 " " + TOKEN_TREE@47..64 + L_CURLY@47..48 "{" + WHITESPACE@48..53 "\n " + TOKEN_TREE@53..55 + L_PAREN@53..54 "(" + R_PAREN@54..55 ")" + WHITESPACE@55..56 " " + EQ@56..57 "=" + R_ANGLE@57..58 ">" + WHITESPACE@58..59 " " + TOKEN_TREE@59..61 + L_CURLY@59..60 "{" + R_CURLY@60..61 "}" + SEMICOLON@61..62 ";" + WHITESPACE@62..63 "\n" + R_CURLY@63..64 "}" + 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 fabf88e8f2..f20819bd29 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 @@ -1,126 +1,126 @@ -SOURCE_FILE@[0; 88) - FN_DEF@[0; 26) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "a" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - RET_TYPE@[7; 23) - THIN_ARROW@[7; 9) "->" - WHITESPACE@[9; 10) " " - PATH_TYPE@[10; 23) - PATH@[10; 23) - PATH_SEGMENT@[10; 23) - NAME_REF@[10; 13) - IDENT@[10; 13) "Foo" - TYPE_ARG_LIST@[13; 23) - L_ANGLE@[13; 14) "<" - TYPE_ARG@[14; 22) - PATH_TYPE@[14; 22) - PATH@[14; 22) - PATH@[14; 17) - PATH_SEGMENT@[14; 17) - NAME_REF@[14; 17) - IDENT@[14; 17) "bar" - COLON2@[17; 19) "::" - PATH_SEGMENT@[19; 22) - NAME_REF@[19; 22) - IDENT@[19; 22) "Baz" - R_ANGLE@[22; 23) ">" - WHITESPACE@[23; 24) " " - BLOCK_EXPR@[24; 26) - BLOCK@[24; 26) - L_CURLY@[24; 25) "{" - R_CURLY@[25; 26) "}" - WHITESPACE@[26; 28) "\n\n" - FN_DEF@[28; 56) - FN_KW@[28; 30) "fn" - WHITESPACE@[30; 31) " " - NAME@[31; 32) - IDENT@[31; 32) "b" - PARAM_LIST@[32; 53) - L_PAREN@[32; 33) "(" - PARAM@[33; 52) - PLACEHOLDER_PAT@[33; 34) - UNDERSCORE@[33; 34) "_" - COLON@[34; 35) ":" - WHITESPACE@[35; 36) " " - IMPL_TRAIT_TYPE@[36; 52) - IMPL_KW@[36; 40) "impl" - WHITESPACE@[40; 41) " " - TYPE_BOUND_LIST@[41; 52) - TYPE_BOUND@[41; 52) - PATH_TYPE@[41; 52) - PATH@[41; 52) - PATH_SEGMENT@[41; 52) - NAME_REF@[41; 46) - IDENT@[41; 46) "FnMut" - PARAM_LIST@[46; 52) - L_PAREN@[46; 47) "(" - PARAM@[47; 51) - PATH_TYPE@[47; 51) - PATH@[47; 51) - PATH@[47; 48) - PATH_SEGMENT@[47; 48) - NAME_REF@[47; 48) - IDENT@[47; 48) "x" - COLON2@[48; 50) "::" - PATH_SEGMENT@[50; 51) - NAME_REF@[50; 51) - IDENT@[50; 51) "Y" - R_PAREN@[51; 52) ")" - R_PAREN@[52; 53) ")" - WHITESPACE@[53; 54) " " - BLOCK_EXPR@[54; 56) - BLOCK@[54; 56) - L_CURLY@[54; 55) "{" - R_CURLY@[55; 56) "}" - WHITESPACE@[56; 58) "\n\n" - FN_DEF@[58; 87) - FN_KW@[58; 60) "fn" - WHITESPACE@[60; 61) " " - NAME@[61; 62) - IDENT@[61; 62) "c" - PARAM_LIST@[62; 84) - L_PAREN@[62; 63) "(" - PARAM@[63; 83) - PLACEHOLDER_PAT@[63; 64) - UNDERSCORE@[63; 64) "_" - COLON@[64; 65) ":" - WHITESPACE@[65; 66) " " - IMPL_TRAIT_TYPE@[66; 83) - IMPL_KW@[66; 70) "impl" - WHITESPACE@[70; 71) " " - TYPE_BOUND_LIST@[71; 83) - TYPE_BOUND@[71; 83) - PATH_TYPE@[71; 83) - PATH@[71; 83) - PATH_SEGMENT@[71; 83) - NAME_REF@[71; 76) - IDENT@[71; 76) "FnMut" - PARAM_LIST@[76; 83) - L_PAREN@[76; 77) "(" - PARAM@[77; 82) - REFERENCE_TYPE@[77; 82) - AMP@[77; 78) "&" - PATH_TYPE@[78; 82) - PATH@[78; 82) - PATH@[78; 79) - PATH_SEGMENT@[78; 79) - NAME_REF@[78; 79) - IDENT@[78; 79) "x" - COLON2@[79; 81) "::" - PATH_SEGMENT@[81; 82) - NAME_REF@[81; 82) - IDENT@[81; 82) "Y" - R_PAREN@[82; 83) ")" - R_PAREN@[83; 84) ")" - WHITESPACE@[84; 85) " " - BLOCK_EXPR@[85; 87) - BLOCK@[85; 87) - L_CURLY@[85; 86) "{" - R_CURLY@[86; 87) "}" - WHITESPACE@[87; 88) "\n" +SOURCE_FILE@0..88 + FN_DEF@0..26 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "a" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + RET_TYPE@7..23 + THIN_ARROW@7..9 "->" + WHITESPACE@9..10 " " + PATH_TYPE@10..23 + PATH@10..23 + PATH_SEGMENT@10..23 + NAME_REF@10..13 + IDENT@10..13 "Foo" + TYPE_ARG_LIST@13..23 + L_ANGLE@13..14 "<" + TYPE_ARG@14..22 + PATH_TYPE@14..22 + PATH@14..22 + PATH@14..17 + PATH_SEGMENT@14..17 + NAME_REF@14..17 + IDENT@14..17 "bar" + COLON2@17..19 "::" + PATH_SEGMENT@19..22 + NAME_REF@19..22 + IDENT@19..22 "Baz" + R_ANGLE@22..23 ">" + WHITESPACE@23..24 " " + BLOCK_EXPR@24..26 + BLOCK@24..26 + L_CURLY@24..25 "{" + R_CURLY@25..26 "}" + WHITESPACE@26..28 "\n\n" + FN_DEF@28..56 + FN_KW@28..30 "fn" + WHITESPACE@30..31 " " + NAME@31..32 + IDENT@31..32 "b" + PARAM_LIST@32..53 + L_PAREN@32..33 "(" + PARAM@33..52 + PLACEHOLDER_PAT@33..34 + UNDERSCORE@33..34 "_" + COLON@34..35 ":" + WHITESPACE@35..36 " " + IMPL_TRAIT_TYPE@36..52 + IMPL_KW@36..40 "impl" + WHITESPACE@40..41 " " + TYPE_BOUND_LIST@41..52 + TYPE_BOUND@41..52 + PATH_TYPE@41..52 + PATH@41..52 + PATH_SEGMENT@41..52 + NAME_REF@41..46 + IDENT@41..46 "FnMut" + PARAM_LIST@46..52 + L_PAREN@46..47 "(" + PARAM@47..51 + PATH_TYPE@47..51 + PATH@47..51 + PATH@47..48 + PATH_SEGMENT@47..48 + NAME_REF@47..48 + IDENT@47..48 "x" + COLON2@48..50 "::" + PATH_SEGMENT@50..51 + NAME_REF@50..51 + IDENT@50..51 "Y" + R_PAREN@51..52 ")" + R_PAREN@52..53 ")" + WHITESPACE@53..54 " " + BLOCK_EXPR@54..56 + BLOCK@54..56 + L_CURLY@54..55 "{" + R_CURLY@55..56 "}" + WHITESPACE@56..58 "\n\n" + FN_DEF@58..87 + FN_KW@58..60 "fn" + WHITESPACE@60..61 " " + NAME@61..62 + IDENT@61..62 "c" + PARAM_LIST@62..84 + L_PAREN@62..63 "(" + PARAM@63..83 + PLACEHOLDER_PAT@63..64 + UNDERSCORE@63..64 "_" + COLON@64..65 ":" + WHITESPACE@65..66 " " + IMPL_TRAIT_TYPE@66..83 + IMPL_KW@66..70 "impl" + WHITESPACE@70..71 " " + TYPE_BOUND_LIST@71..83 + TYPE_BOUND@71..83 + PATH_TYPE@71..83 + PATH@71..83 + PATH_SEGMENT@71..83 + NAME_REF@71..76 + IDENT@71..76 "FnMut" + PARAM_LIST@76..83 + L_PAREN@76..77 "(" + PARAM@77..82 + REFERENCE_TYPE@77..82 + AMP@77..78 "&" + PATH_TYPE@78..82 + PATH@78..82 + PATH@78..79 + PATH_SEGMENT@78..79 + NAME_REF@78..79 + IDENT@78..79 "x" + COLON2@79..81 "::" + PATH_SEGMENT@81..82 + NAME_REF@81..82 + IDENT@81..82 "Y" + R_PAREN@82..83 ")" + R_PAREN@83..84 ")" + WHITESPACE@84..85 " " + BLOCK_EXPR@85..87 + BLOCK@85..87 + L_CURLY@85..86 "{" + R_CURLY@86..87 "}" + WHITESPACE@87..88 "\n" 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 6ac3f14587..dcdb3cc6db 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 @@ -1,50 +1,50 @@ -SOURCE_FILE@[0; 49) - TYPE_ALIAS_DEF@[0; 12) - TYPE_KW@[0; 4) "type" - WHITESPACE@[4; 5) " " - NAME@[5; 6) - IDENT@[5; 6) "X" - WHITESPACE@[6; 7) " " - EQ@[7; 8) "=" - WHITESPACE@[8; 9) " " - TUPLE_TYPE@[9; 11) - L_PAREN@[9; 10) "(" - R_PAREN@[10; 11) ")" - SEMICOLON@[11; 12) ";" - WHITESPACE@[12; 14) "\n\n" - FN_DEF@[14; 48) - FN_KW@[14; 16) "fn" - WHITESPACE@[16; 17) " " - NAME@[17; 21) - IDENT@[17; 21) "main" - PARAM_LIST@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - BLOCK_EXPR@[24; 48) - BLOCK@[24; 48) - L_CURLY@[24; 25) "{" - WHITESPACE@[25; 30) "\n " - LET_STMT@[30; 46) - LET_KW@[30; 33) "let" - WHITESPACE@[33; 34) " " - TUPLE_PAT@[34; 36) - L_PAREN@[34; 35) "(" - R_PAREN@[35; 36) ")" - COLON@[36; 37) ":" - PATH_TYPE@[37; 40) - PATH@[37; 40) - PATH_SEGMENT@[37; 40) - COLON2@[37; 39) "::" - NAME_REF@[39; 40) - IDENT@[39; 40) "X" - WHITESPACE@[40; 41) " " - EQ@[41; 42) "=" - WHITESPACE@[42; 43) " " - TUPLE_EXPR@[43; 45) - L_PAREN@[43; 44) "(" - R_PAREN@[44; 45) ")" - SEMICOLON@[45; 46) ";" - WHITESPACE@[46; 47) "\n" - R_CURLY@[47; 48) "}" - WHITESPACE@[48; 49) "\n" +SOURCE_FILE@0..49 + TYPE_ALIAS_DEF@0..12 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "X" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + TUPLE_TYPE@9..11 + L_PAREN@9..10 "(" + R_PAREN@10..11 ")" + SEMICOLON@11..12 ";" + WHITESPACE@12..14 "\n\n" + FN_DEF@14..48 + FN_KW@14..16 "fn" + WHITESPACE@16..17 " " + NAME@17..21 + IDENT@17..21 "main" + PARAM_LIST@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + BLOCK_EXPR@24..48 + BLOCK@24..48 + L_CURLY@24..25 "{" + WHITESPACE@25..30 "\n " + LET_STMT@30..46 + LET_KW@30..33 "let" + WHITESPACE@33..34 " " + TUPLE_PAT@34..36 + L_PAREN@34..35 "(" + R_PAREN@35..36 ")" + COLON@36..37 ":" + PATH_TYPE@37..40 + PATH@37..40 + PATH_SEGMENT@37..40 + COLON2@37..39 "::" + NAME_REF@39..40 + IDENT@39..40 "X" + WHITESPACE@40..41 " " + EQ@41..42 "=" + WHITESPACE@42..43 " " + TUPLE_EXPR@43..45 + L_PAREN@43..44 "(" + R_PAREN@44..45 ")" + SEMICOLON@45..46 ";" + WHITESPACE@46..47 "\n" + R_CURLY@47..48 "}" + WHITESPACE@48..49 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast b/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast index 4a4ad84cab..6176a9620a 100644 --- a/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast +++ b/crates/ra_syntax/test_data/parser/ok/0056_neq_in_type.rast @@ -1,66 +1,66 @@ -SOURCE_FILE@[0; 71) - FN_DEF@[0; 70) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 70) - BLOCK@[10; 70) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - IF_EXPR@[16; 68) - IF_KW@[16; 18) "if" - WHITESPACE@[18; 19) " " - CONDITION@[19; 65) - BIN_EXPR@[19; 65) - CAST_EXPR@[19; 40) - METHOD_CALL_EXPR@[19; 33) - LITERAL@[19; 25) - FLOAT_NUMBER@[19; 25) "1.0f32" - DOT@[25; 26) "." - NAME_REF@[26; 31) - IDENT@[26; 31) "floor" - ARG_LIST@[31; 33) - L_PAREN@[31; 32) "(" - R_PAREN@[32; 33) ")" - WHITESPACE@[33; 34) " " - AS_KW@[34; 36) "as" - WHITESPACE@[36; 37) " " - PATH_TYPE@[37; 40) - PATH@[37; 40) - PATH_SEGMENT@[37; 40) - NAME_REF@[37; 40) - IDENT@[37; 40) "i64" - WHITESPACE@[40; 41) " " - NEQ@[41; 43) "!=" - WHITESPACE@[43; 44) " " - CAST_EXPR@[44; 65) - METHOD_CALL_EXPR@[44; 58) - LITERAL@[44; 50) - FLOAT_NUMBER@[44; 50) "1.0f32" - DOT@[50; 51) "." - NAME_REF@[51; 56) - IDENT@[51; 56) "floor" - ARG_LIST@[56; 58) - L_PAREN@[56; 57) "(" - R_PAREN@[57; 58) ")" - WHITESPACE@[58; 59) " " - AS_KW@[59; 61) "as" - WHITESPACE@[61; 62) " " - PATH_TYPE@[62; 65) - PATH@[62; 65) - PATH_SEGMENT@[62; 65) - NAME_REF@[62; 65) - IDENT@[62; 65) "i64" - WHITESPACE@[65; 66) " " - BLOCK_EXPR@[66; 68) - BLOCK@[66; 68) - L_CURLY@[66; 67) "{" - R_CURLY@[67; 68) "}" - WHITESPACE@[68; 69) "\n" - R_CURLY@[69; 70) "}" - WHITESPACE@[70; 71) "\n" +SOURCE_FILE@0..71 + FN_DEF@0..70 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..70 + BLOCK@10..70 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + IF_EXPR@16..68 + IF_KW@16..18 "if" + WHITESPACE@18..19 " " + CONDITION@19..65 + BIN_EXPR@19..65 + CAST_EXPR@19..40 + METHOD_CALL_EXPR@19..33 + LITERAL@19..25 + FLOAT_NUMBER@19..25 "1.0f32" + DOT@25..26 "." + NAME_REF@26..31 + IDENT@26..31 "floor" + ARG_LIST@31..33 + L_PAREN@31..32 "(" + R_PAREN@32..33 ")" + WHITESPACE@33..34 " " + AS_KW@34..36 "as" + WHITESPACE@36..37 " " + PATH_TYPE@37..40 + PATH@37..40 + PATH_SEGMENT@37..40 + NAME_REF@37..40 + IDENT@37..40 "i64" + WHITESPACE@40..41 " " + NEQ@41..43 "!=" + WHITESPACE@43..44 " " + CAST_EXPR@44..65 + METHOD_CALL_EXPR@44..58 + LITERAL@44..50 + FLOAT_NUMBER@44..50 "1.0f32" + DOT@50..51 "." + NAME_REF@51..56 + IDENT@51..56 "floor" + ARG_LIST@56..58 + L_PAREN@56..57 "(" + R_PAREN@57..58 ")" + WHITESPACE@58..59 " " + AS_KW@59..61 "as" + WHITESPACE@61..62 " " + PATH_TYPE@62..65 + PATH@62..65 + PATH_SEGMENT@62..65 + NAME_REF@62..65 + IDENT@62..65 "i64" + WHITESPACE@65..66 " " + BLOCK_EXPR@66..68 + BLOCK@66..68 + L_CURLY@66..67 "{" + R_CURLY@67..68 "}" + WHITESPACE@68..69 "\n" + R_CURLY@69..70 "}" + WHITESPACE@70..71 "\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 2c07bde436..342fe23f5f 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 @@ -1,59 +1,59 @@ -SOURCE_FILE@[0; 50) - FN_DEF@[0; 17) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 14) - L_PAREN@[6; 7) "(" - PARAM@[7; 13) - BIND_PAT@[7; 8) - NAME@[7; 8) - IDENT@[7; 8) "x" - COLON@[8; 9) ":" - WHITESPACE@[9; 10) " " - PATH_TYPE@[10; 13) - PATH@[10; 13) - PATH_SEGMENT@[10; 13) - NAME_REF@[10; 13) - IDENT@[10; 13) "i32" - R_PAREN@[13; 14) ")" - WHITESPACE@[14; 15) " " - BLOCK_EXPR@[15; 17) - BLOCK@[15; 17) - L_CURLY@[15; 16) "{" - R_CURLY@[16; 17) "}" - WHITESPACE@[17; 19) "\n\n" - FN_DEF@[19; 50) - FN_KW@[19; 21) "fn" - WHITESPACE@[21; 22) " " - NAME@[22; 26) - IDENT@[22; 26) "main" - PARAM_LIST@[26; 28) - L_PAREN@[26; 27) "(" - R_PAREN@[27; 28) ")" - WHITESPACE@[28; 29) " " - BLOCK_EXPR@[29; 50) - BLOCK@[29; 50) - L_CURLY@[29; 30) "{" - WHITESPACE@[30; 35) "\n " - EXPR_STMT@[35; 48) - CALL_EXPR@[35; 47) - PATH_EXPR@[35; 38) - PATH@[35; 38) - PATH_SEGMENT@[35; 38) - NAME_REF@[35; 38) - IDENT@[35; 38) "foo" - ARG_LIST@[38; 47) - L_PAREN@[38; 39) "(" - LOOP_EXPR@[39; 46) - LOOP_KW@[39; 43) "loop" - WHITESPACE@[43; 44) " " - BLOCK_EXPR@[44; 46) - BLOCK@[44; 46) - L_CURLY@[44; 45) "{" - R_CURLY@[45; 46) "}" - R_PAREN@[46; 47) ")" - SEMICOLON@[47; 48) ";" - WHITESPACE@[48; 49) "\n" - R_CURLY@[49; 50) "}" +SOURCE_FILE@0..50 + FN_DEF@0..17 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..14 + L_PAREN@6..7 "(" + PARAM@7..13 + BIND_PAT@7..8 + NAME@7..8 + IDENT@7..8 "x" + COLON@8..9 ":" + WHITESPACE@9..10 " " + PATH_TYPE@10..13 + PATH@10..13 + PATH_SEGMENT@10..13 + NAME_REF@10..13 + IDENT@10..13 "i32" + R_PAREN@13..14 ")" + WHITESPACE@14..15 " " + BLOCK_EXPR@15..17 + BLOCK@15..17 + L_CURLY@15..16 "{" + R_CURLY@16..17 "}" + WHITESPACE@17..19 "\n\n" + FN_DEF@19..50 + FN_KW@19..21 "fn" + WHITESPACE@21..22 " " + NAME@22..26 + IDENT@22..26 "main" + PARAM_LIST@26..28 + L_PAREN@26..27 "(" + R_PAREN@27..28 ")" + WHITESPACE@28..29 " " + BLOCK_EXPR@29..50 + BLOCK@29..50 + L_CURLY@29..30 "{" + WHITESPACE@30..35 "\n " + EXPR_STMT@35..48 + CALL_EXPR@35..47 + PATH_EXPR@35..38 + PATH@35..38 + PATH_SEGMENT@35..38 + NAME_REF@35..38 + IDENT@35..38 "foo" + ARG_LIST@38..47 + L_PAREN@38..39 "(" + LOOP_EXPR@39..46 + LOOP_KW@39..43 "loop" + WHITESPACE@43..44 " " + BLOCK_EXPR@44..46 + BLOCK@44..46 + L_CURLY@44..45 "{" + R_CURLY@45..46 "}" + R_PAREN@46..47 ")" + SEMICOLON@47..48 ";" + WHITESPACE@48..49 "\n" + 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 9de9efbade..360b6e0441 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 @@ -1,97 +1,97 @@ -SOURCE_FILE@[0; 79) - FN_DEF@[0; 78) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 6) - IDENT@[3; 6) "foo" - PARAM_LIST@[6; 8) - L_PAREN@[6; 7) "(" - R_PAREN@[7; 8) ")" - WHITESPACE@[8; 9) " " - BLOCK_EXPR@[9; 78) - BLOCK@[9; 78) - L_CURLY@[9; 10) "{" - WHITESPACE@[10; 15) "\n " - EXPR_STMT@[15; 27) - BIN_EXPR@[15; 26) - BIN_EXPR@[15; 22) - LITERAL@[15; 16) - INT_NUMBER@[15; 16) "1" - WHITESPACE@[16; 17) " " - PLUS@[17; 18) "+" - WHITESPACE@[18; 19) " " - PREFIX_EXPR@[19; 22) - STAR@[19; 20) "*" - REF_EXPR@[20; 22) - AMP@[20; 21) "&" - LITERAL@[21; 22) - INT_NUMBER@[21; 22) "2" - WHITESPACE@[22; 23) " " - PLUS@[23; 24) "+" - WHITESPACE@[24; 25) " " - LITERAL@[25; 26) - INT_NUMBER@[25; 26) "3" - SEMICOLON@[26; 27) ";" - WHITESPACE@[27; 32) "\n " - EXPR_STMT@[32; 43) - CAST_EXPR@[32; 42) - PREFIX_EXPR@[32; 35) - STAR@[32; 33) "*" - REF_EXPR@[33; 35) - AMP@[33; 34) "&" - LITERAL@[34; 35) - INT_NUMBER@[34; 35) "1" - WHITESPACE@[35; 36) " " - AS_KW@[36; 38) "as" - WHITESPACE@[38; 39) " " - PATH_TYPE@[39; 42) - PATH@[39; 42) - PATH_SEGMENT@[39; 42) - NAME_REF@[39; 42) - IDENT@[39; 42) "u64" - SEMICOLON@[42; 43) ";" - WHITESPACE@[43; 48) "\n " - EXPR_STMT@[48; 54) - PREFIX_EXPR@[48; 53) - STAR@[48; 49) "*" - CALL_EXPR@[49; 53) - PATH_EXPR@[49; 50) - PATH@[49; 50) - PATH_SEGMENT@[49; 50) - NAME_REF@[49; 50) - IDENT@[49; 50) "x" - ARG_LIST@[50; 53) - L_PAREN@[50; 51) "(" - LITERAL@[51; 52) - INT_NUMBER@[51; 52) "1" - R_PAREN@[52; 53) ")" - SEMICOLON@[53; 54) ";" - WHITESPACE@[54; 59) "\n " - EXPR_STMT@[59; 65) - REF_EXPR@[59; 64) - AMP@[59; 60) "&" - INDEX_EXPR@[60; 64) - PATH_EXPR@[60; 61) - PATH@[60; 61) - PATH_SEGMENT@[60; 61) - NAME_REF@[60; 61) - IDENT@[60; 61) "x" - L_BRACK@[61; 62) "[" - LITERAL@[62; 63) - INT_NUMBER@[62; 63) "1" - R_BRACK@[63; 64) "]" - SEMICOLON@[64; 65) ";" - WHITESPACE@[65; 70) "\n " - EXPR_STMT@[70; 76) - RANGE_EXPR@[70; 75) - PREFIX_EXPR@[70; 72) - MINUS@[70; 71) "-" - LITERAL@[71; 72) - INT_NUMBER@[71; 72) "1" - DOT2@[72; 74) ".." - LITERAL@[74; 75) - INT_NUMBER@[74; 75) "2" - SEMICOLON@[75; 76) ";" - WHITESPACE@[76; 77) "\n" - R_CURLY@[77; 78) "}" - WHITESPACE@[78; 79) "\n" +SOURCE_FILE@0..79 + FN_DEF@0..78 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..6 + IDENT@3..6 "foo" + PARAM_LIST@6..8 + L_PAREN@6..7 "(" + R_PAREN@7..8 ")" + WHITESPACE@8..9 " " + BLOCK_EXPR@9..78 + BLOCK@9..78 + L_CURLY@9..10 "{" + WHITESPACE@10..15 "\n " + EXPR_STMT@15..27 + BIN_EXPR@15..26 + BIN_EXPR@15..22 + LITERAL@15..16 + INT_NUMBER@15..16 "1" + WHITESPACE@16..17 " " + PLUS@17..18 "+" + WHITESPACE@18..19 " " + PREFIX_EXPR@19..22 + STAR@19..20 "*" + REF_EXPR@20..22 + AMP@20..21 "&" + LITERAL@21..22 + INT_NUMBER@21..22 "2" + WHITESPACE@22..23 " " + PLUS@23..24 "+" + WHITESPACE@24..25 " " + LITERAL@25..26 + INT_NUMBER@25..26 "3" + SEMICOLON@26..27 ";" + WHITESPACE@27..32 "\n " + EXPR_STMT@32..43 + CAST_EXPR@32..42 + PREFIX_EXPR@32..35 + STAR@32..33 "*" + REF_EXPR@33..35 + AMP@33..34 "&" + LITERAL@34..35 + INT_NUMBER@34..35 "1" + WHITESPACE@35..36 " " + AS_KW@36..38 "as" + WHITESPACE@38..39 " " + PATH_TYPE@39..42 + PATH@39..42 + PATH_SEGMENT@39..42 + NAME_REF@39..42 + IDENT@39..42 "u64" + SEMICOLON@42..43 ";" + WHITESPACE@43..48 "\n " + EXPR_STMT@48..54 + PREFIX_EXPR@48..53 + STAR@48..49 "*" + CALL_EXPR@49..53 + PATH_EXPR@49..50 + PATH@49..50 + PATH_SEGMENT@49..50 + NAME_REF@49..50 + IDENT@49..50 "x" + ARG_LIST@50..53 + L_PAREN@50..51 "(" + LITERAL@51..52 + INT_NUMBER@51..52 "1" + R_PAREN@52..53 ")" + SEMICOLON@53..54 ";" + WHITESPACE@54..59 "\n " + EXPR_STMT@59..65 + REF_EXPR@59..64 + AMP@59..60 "&" + INDEX_EXPR@60..64 + PATH_EXPR@60..61 + PATH@60..61 + PATH_SEGMENT@60..61 + NAME_REF@60..61 + IDENT@60..61 "x" + L_BRACK@61..62 "[" + LITERAL@62..63 + INT_NUMBER@62..63 "1" + R_BRACK@63..64 "]" + SEMICOLON@64..65 ";" + WHITESPACE@65..70 "\n " + EXPR_STMT@70..76 + RANGE_EXPR@70..75 + PREFIX_EXPR@70..72 + MINUS@70..71 "-" + LITERAL@71..72 + INT_NUMBER@71..72 "1" + DOT2@72..74 ".." + LITERAL@74..75 + INT_NUMBER@74..75 "2" + SEMICOLON@75..76 ";" + WHITESPACE@76..77 "\n" + R_CURLY@77..78 "}" + 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 101478ce12..225b1d0b6b 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 @@ -1,101 +1,101 @@ -SOURCE_FILE@[0; 105) - FN_DEF@[0; 104) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 104) - BLOCK@[10; 104) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - EXPR_STMT@[16; 50) - CALL_EXPR@[16; 49) - PATH_EXPR@[16; 20) - PATH@[16; 20) - PATH_SEGMENT@[16; 20) - NAME_REF@[16; 20) - IDENT@[16; 20) "Some" - ARG_LIST@[20; 49) - L_PAREN@[20; 21) "(" - FOR_EXPR@[21; 48) - FOR_KW@[21; 24) "for" - WHITESPACE@[24; 25) " " - PLACEHOLDER_PAT@[25; 26) - UNDERSCORE@[25; 26) "_" - WHITESPACE@[26; 27) " " - IN_KW@[27; 29) "in" - WHITESPACE@[29; 30) " " - METHOD_CALL_EXPR@[30; 45) - ARRAY_EXPR@[30; 33) - L_BRACK@[30; 31) "[" - LITERAL@[31; 32) - INT_NUMBER@[31; 32) "1" - R_BRACK@[32; 33) "]" - DOT@[33; 34) "." - NAME_REF@[34; 43) - IDENT@[34; 43) "into_iter" - ARG_LIST@[43; 45) - L_PAREN@[43; 44) "(" - R_PAREN@[44; 45) ")" - WHITESPACE@[45; 46) " " - BLOCK_EXPR@[46; 48) - BLOCK@[46; 48) - L_CURLY@[46; 47) "{" - R_CURLY@[47; 48) "}" - R_PAREN@[48; 49) ")" - SEMICOLON@[49; 50) ";" - WHITESPACE@[50; 55) "\n " - EXPR_STMT@[55; 77) - CALL_EXPR@[55; 76) - PATH_EXPR@[55; 59) - PATH@[55; 59) - PATH_SEGMENT@[55; 59) - NAME_REF@[55; 59) - IDENT@[55; 59) "Some" - ARG_LIST@[59; 76) - L_PAREN@[59; 60) "(" - LOOP_EXPR@[60; 75) - LOOP_KW@[60; 64) "loop" - WHITESPACE@[64; 65) " " - BLOCK_EXPR@[65; 75) - BLOCK@[65; 75) - L_CURLY@[65; 66) "{" - WHITESPACE@[66; 67) " " - EXPR_STMT@[67; 73) - BREAK_EXPR@[67; 72) - BREAK_KW@[67; 72) "break" - SEMICOLON@[72; 73) ";" - WHITESPACE@[73; 74) " " - R_CURLY@[74; 75) "}" - R_PAREN@[75; 76) ")" - SEMICOLON@[76; 77) ";" - WHITESPACE@[77; 82) "\n " - EXPR_STMT@[82; 102) - CALL_EXPR@[82; 101) - PATH_EXPR@[82; 86) - PATH@[82; 86) - PATH_SEGMENT@[82; 86) - NAME_REF@[82; 86) - IDENT@[82; 86) "Some" - ARG_LIST@[86; 101) - L_PAREN@[86; 87) "(" - WHILE_EXPR@[87; 100) - WHILE_KW@[87; 92) "while" - WHITESPACE@[92; 93) " " - CONDITION@[93; 97) - LITERAL@[93; 97) - TRUE_KW@[93; 97) "true" - WHITESPACE@[97; 98) " " - BLOCK_EXPR@[98; 100) - BLOCK@[98; 100) - L_CURLY@[98; 99) "{" - R_CURLY@[99; 100) "}" - R_PAREN@[100; 101) ")" - SEMICOLON@[101; 102) ";" - WHITESPACE@[102; 103) "\n" - R_CURLY@[103; 104) "}" - WHITESPACE@[104; 105) "\n" +SOURCE_FILE@0..105 + FN_DEF@0..104 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..104 + BLOCK@10..104 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..50 + CALL_EXPR@16..49 + PATH_EXPR@16..20 + PATH@16..20 + PATH_SEGMENT@16..20 + NAME_REF@16..20 + IDENT@16..20 "Some" + ARG_LIST@20..49 + L_PAREN@20..21 "(" + FOR_EXPR@21..48 + FOR_KW@21..24 "for" + WHITESPACE@24..25 " " + PLACEHOLDER_PAT@25..26 + UNDERSCORE@25..26 "_" + WHITESPACE@26..27 " " + IN_KW@27..29 "in" + WHITESPACE@29..30 " " + METHOD_CALL_EXPR@30..45 + ARRAY_EXPR@30..33 + L_BRACK@30..31 "[" + LITERAL@31..32 + INT_NUMBER@31..32 "1" + R_BRACK@32..33 "]" + DOT@33..34 "." + NAME_REF@34..43 + IDENT@34..43 "into_iter" + ARG_LIST@43..45 + L_PAREN@43..44 "(" + R_PAREN@44..45 ")" + WHITESPACE@45..46 " " + BLOCK_EXPR@46..48 + BLOCK@46..48 + L_CURLY@46..47 "{" + R_CURLY@47..48 "}" + R_PAREN@48..49 ")" + SEMICOLON@49..50 ";" + WHITESPACE@50..55 "\n " + EXPR_STMT@55..77 + CALL_EXPR@55..76 + PATH_EXPR@55..59 + PATH@55..59 + PATH_SEGMENT@55..59 + NAME_REF@55..59 + IDENT@55..59 "Some" + ARG_LIST@59..76 + L_PAREN@59..60 "(" + LOOP_EXPR@60..75 + LOOP_KW@60..64 "loop" + WHITESPACE@64..65 " " + BLOCK_EXPR@65..75 + BLOCK@65..75 + L_CURLY@65..66 "{" + WHITESPACE@66..67 " " + EXPR_STMT@67..73 + BREAK_EXPR@67..72 + BREAK_KW@67..72 "break" + SEMICOLON@72..73 ";" + WHITESPACE@73..74 " " + R_CURLY@74..75 "}" + R_PAREN@75..76 ")" + SEMICOLON@76..77 ";" + WHITESPACE@77..82 "\n " + EXPR_STMT@82..102 + CALL_EXPR@82..101 + PATH_EXPR@82..86 + PATH@82..86 + PATH_SEGMENT@82..86 + NAME_REF@82..86 + IDENT@82..86 "Some" + ARG_LIST@86..101 + L_PAREN@86..87 "(" + WHILE_EXPR@87..100 + WHILE_KW@87..92 "while" + WHITESPACE@92..93 " " + CONDITION@93..97 + LITERAL@93..97 + TRUE_KW@93..97 "true" + WHITESPACE@97..98 " " + BLOCK_EXPR@98..100 + BLOCK@98..100 + L_CURLY@98..99 "{" + R_CURLY@99..100 "}" + R_PAREN@100..101 ")" + SEMICOLON@101..102 ";" + WHITESPACE@102..103 "\n" + R_CURLY@103..104 "}" + 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 6bff575051..a52a08ed05 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 @@ -1,56 +1,56 @@ -SOURCE_FILE@[0; 56) - FN_DEF@[0; 55) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 55) - BLOCK@[10; 55) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - EXPR_STMT@[16; 30) - RANGE_EXPR@[16; 29) - CAST_EXPR@[16; 26) - LITERAL@[16; 17) - INT_NUMBER@[16; 17) "0" - WHITESPACE@[17; 18) " " - AS_KW@[18; 20) "as" - WHITESPACE@[20; 21) " " - PATH_TYPE@[21; 26) - PATH@[21; 26) - PATH_SEGMENT@[21; 26) - NAME_REF@[21; 26) - IDENT@[21; 26) "usize" - WHITESPACE@[26; 27) " " - DOT2@[27; 29) ".." - SEMICOLON@[29; 30) ";" - WHITESPACE@[30; 35) "\n " - EXPR_STMT@[35; 53) - RANGE_EXPR@[35; 52) - BIN_EXPR@[35; 49) - LITERAL@[35; 36) - INT_NUMBER@[35; 36) "1" - WHITESPACE@[36; 37) " " - PLUS@[37; 38) "+" - WHITESPACE@[38; 39) " " - CAST_EXPR@[39; 49) - LITERAL@[39; 40) - INT_NUMBER@[39; 40) "2" - WHITESPACE@[40; 41) " " - AS_KW@[41; 43) "as" - WHITESPACE@[43; 44) " " - PATH_TYPE@[44; 49) - PATH@[44; 49) - PATH_SEGMENT@[44; 49) - NAME_REF@[44; 49) - IDENT@[44; 49) "usize" - WHITESPACE@[49; 50) " " - DOT2@[50; 52) ".." - SEMICOLON@[52; 53) ";" - WHITESPACE@[53; 54) "\n" - R_CURLY@[54; 55) "}" - WHITESPACE@[55; 56) "\n" +SOURCE_FILE@0..56 + FN_DEF@0..55 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..55 + BLOCK@10..55 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + EXPR_STMT@16..30 + RANGE_EXPR@16..29 + CAST_EXPR@16..26 + LITERAL@16..17 + INT_NUMBER@16..17 "0" + WHITESPACE@17..18 " " + AS_KW@18..20 "as" + WHITESPACE@20..21 " " + PATH_TYPE@21..26 + PATH@21..26 + PATH_SEGMENT@21..26 + NAME_REF@21..26 + IDENT@21..26 "usize" + WHITESPACE@26..27 " " + DOT2@27..29 ".." + SEMICOLON@29..30 ";" + WHITESPACE@30..35 "\n " + EXPR_STMT@35..53 + RANGE_EXPR@35..52 + BIN_EXPR@35..49 + LITERAL@35..36 + INT_NUMBER@35..36 "1" + WHITESPACE@36..37 " " + PLUS@37..38 "+" + WHITESPACE@38..39 " " + CAST_EXPR@39..49 + LITERAL@39..40 + INT_NUMBER@39..40 "2" + WHITESPACE@40..41 " " + AS_KW@41..43 "as" + WHITESPACE@43..44 " " + PATH_TYPE@44..49 + PATH@44..49 + PATH_SEGMENT@44..49 + NAME_REF@44..49 + IDENT@44..49 "usize" + WHITESPACE@49..50 " " + DOT2@50..52 ".." + SEMICOLON@52..53 ";" + WHITESPACE@53..54 "\n" + R_CURLY@54..55 "}" + 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 be6774199f..b8974c942a 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 @@ -1,27 +1,27 @@ -SOURCE_FILE@[0; 35) - FN_DEF@[0; 34) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 7) - IDENT@[3; 7) "main" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - BLOCK_EXPR@[10; 34) - BLOCK@[10; 34) - L_CURLY@[10; 11) "{" - WHITESPACE@[11; 16) "\n " - MATCH_EXPR@[16; 32) - MATCH_KW@[16; 21) "match" - WHITESPACE@[21; 22) " " - RANGE_EXPR@[22; 24) - DOT2@[22; 24) ".." - WHITESPACE@[24; 25) " " - MATCH_ARM_LIST@[25; 32) - L_CURLY@[25; 26) "{" - WHITESPACE@[26; 31) "\n " - R_CURLY@[31; 32) "}" - WHITESPACE@[32; 33) "\n" - R_CURLY@[33; 34) "}" - WHITESPACE@[34; 35) "\n" +SOURCE_FILE@0..35 + FN_DEF@0..34 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..7 + IDENT@3..7 "main" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + BLOCK_EXPR@10..34 + BLOCK@10..34 + L_CURLY@10..11 "{" + WHITESPACE@11..16 "\n " + MATCH_EXPR@16..32 + MATCH_KW@16..21 "match" + WHITESPACE@21..22 " " + RANGE_EXPR@22..24 + DOT2@22..24 ".." + WHITESPACE@24..25 " " + MATCH_ARM_LIST@25..32 + L_CURLY@25..26 "{" + WHITESPACE@26..31 "\n " + R_CURLY@31..32 "}" + WHITESPACE@32..33 "\n" + R_CURLY@33..34 "}" + WHITESPACE@34..35 "\n" 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 f89d7c0d9c..46f370eec3 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 @@ -1,176 +1,176 @@ -SOURCE_FILE@[0; 349) - MACRO_DEF@[0; 93) - MACRO_KW@[0; 5) "macro" - WHITESPACE@[5; 6) " " - NAME@[6; 21) - IDENT@[6; 21) "parse_use_trees" - TOKEN_TREE@[21; 93) - TOKEN_TREE@[21; 41) - L_PAREN@[21; 22) "(" - DOLLAR@[22; 23) "$" - TOKEN_TREE@[23; 32) - L_PAREN@[23; 24) "(" - DOLLAR@[24; 25) "$" - IDENT@[25; 26) "s" - COLON@[26; 27) ":" - IDENT@[27; 31) "expr" - R_PAREN@[31; 32) ")" - COMMA@[32; 33) "," - STAR@[33; 34) "*" - WHITESPACE@[34; 35) " " - DOLLAR@[35; 36) "$" - TOKEN_TREE@[36; 39) - L_PAREN@[36; 37) "(" - COMMA@[37; 38) "," - R_PAREN@[38; 39) ")" - STAR@[39; 40) "*" - R_PAREN@[40; 41) ")" - WHITESPACE@[41; 42) " " - TOKEN_TREE@[42; 93) - L_CURLY@[42; 43) "{" - WHITESPACE@[43; 48) "\n " - IDENT@[48; 51) "vec" - BANG@[51; 52) "!" - TOKEN_TREE@[52; 91) - L_BRACK@[52; 53) "[" - WHITESPACE@[53; 62) "\n " - DOLLAR@[62; 63) "$" - TOKEN_TREE@[63; 84) - L_PAREN@[63; 64) "(" - IDENT@[64; 78) "parse_use_tree" - TOKEN_TREE@[78; 82) - L_PAREN@[78; 79) "(" - DOLLAR@[79; 80) "$" - IDENT@[80; 81) "s" - R_PAREN@[81; 82) ")" - COMMA@[82; 83) "," - R_PAREN@[83; 84) ")" - STAR@[84; 85) "*" - WHITESPACE@[85; 90) "\n " - R_BRACK@[90; 91) "]" - WHITESPACE@[91; 92) "\n" - R_CURLY@[92; 93) "}" - WHITESPACE@[93; 95) "\n\n" - FN_DEF@[95; 348) - ATTR@[95; 102) - POUND@[95; 96) "#" - L_BRACK@[96; 97) "[" - PATH@[97; 101) - PATH_SEGMENT@[97; 101) - NAME_REF@[97; 101) - IDENT@[97; 101) "test" - R_BRACK@[101; 102) "]" - WHITESPACE@[102; 103) "\n" - FN_KW@[103; 105) "fn" - WHITESPACE@[105; 106) " " - NAME@[106; 125) - IDENT@[106; 125) "test_use_tree_merge" - PARAM_LIST@[125; 127) - L_PAREN@[125; 126) "(" - R_PAREN@[126; 127) ")" - WHITESPACE@[127; 128) " " - BLOCK_EXPR@[128; 348) - BLOCK@[128; 348) - L_CURLY@[128; 129) "{" - WHITESPACE@[129; 134) "\n " - MACRO_DEF@[134; 346) - MACRO_KW@[134; 139) "macro" - WHITESPACE@[139; 140) " " - NAME@[140; 150) - IDENT@[140; 150) "test_merge" - TOKEN_TREE@[150; 346) - TOKEN_TREE@[150; 203) - L_PAREN@[150; 151) "(" - TOKEN_TREE@[151; 175) - L_BRACK@[151; 152) "[" - DOLLAR@[152; 153) "$" - TOKEN_TREE@[153; 166) - L_PAREN@[153; 154) "(" - DOLLAR@[154; 155) "$" - IDENT@[155; 160) "input" - COLON@[160; 161) ":" - IDENT@[161; 165) "expr" - R_PAREN@[165; 166) ")" - COMMA@[166; 167) "," - STAR@[167; 168) "*" - WHITESPACE@[168; 169) " " - DOLLAR@[169; 170) "$" - TOKEN_TREE@[170; 173) - L_PAREN@[170; 171) "(" - COMMA@[171; 172) "," - R_PAREN@[172; 173) ")" - STAR@[173; 174) "*" - R_BRACK@[174; 175) "]" - COMMA@[175; 176) "," - WHITESPACE@[176; 177) " " - TOKEN_TREE@[177; 202) - L_BRACK@[177; 178) "[" - DOLLAR@[178; 179) "$" - TOKEN_TREE@[179; 193) - L_PAREN@[179; 180) "(" - DOLLAR@[180; 181) "$" - IDENT@[181; 187) "output" - COLON@[187; 188) ":" - IDENT@[188; 192) "expr" - R_PAREN@[192; 193) ")" - COMMA@[193; 194) "," - STAR@[194; 195) "*" - WHITESPACE@[195; 196) " " - DOLLAR@[196; 197) "$" - TOKEN_TREE@[197; 200) - L_PAREN@[197; 198) "(" - COMMA@[198; 199) "," - R_PAREN@[199; 200) ")" - STAR@[200; 201) "*" - R_BRACK@[201; 202) "]" - R_PAREN@[202; 203) ")" - WHITESPACE@[203; 204) " " - TOKEN_TREE@[204; 346) - L_CURLY@[204; 205) "{" - WHITESPACE@[205; 214) "\n " - IDENT@[214; 223) "assert_eq" - BANG@[223; 224) "!" - TOKEN_TREE@[224; 339) - L_PAREN@[224; 225) "(" - WHITESPACE@[225; 238) "\n " - IDENT@[238; 253) "merge_use_trees" - TOKEN_TREE@[253; 284) - L_PAREN@[253; 254) "(" - IDENT@[254; 269) "parse_use_trees" - BANG@[269; 270) "!" - TOKEN_TREE@[270; 283) - L_PAREN@[270; 271) "(" - DOLLAR@[271; 272) "$" - TOKEN_TREE@[272; 281) - L_PAREN@[272; 273) "(" - DOLLAR@[273; 274) "$" - IDENT@[274; 279) "input" - COMMA@[279; 280) "," - R_PAREN@[280; 281) ")" - STAR@[281; 282) "*" - R_PAREN@[282; 283) ")" - R_PAREN@[283; 284) ")" - COMMA@[284; 285) "," - WHITESPACE@[285; 298) "\n " - IDENT@[298; 313) "parse_use_trees" - BANG@[313; 314) "!" - TOKEN_TREE@[314; 328) - L_PAREN@[314; 315) "(" - DOLLAR@[315; 316) "$" - TOKEN_TREE@[316; 326) - L_PAREN@[316; 317) "(" - DOLLAR@[317; 318) "$" - IDENT@[318; 324) "output" - COMMA@[324; 325) "," - R_PAREN@[325; 326) ")" - STAR@[326; 327) "*" - R_PAREN@[327; 328) ")" - COMMA@[328; 329) "," - WHITESPACE@[329; 338) "\n " - R_PAREN@[338; 339) ")" - SEMICOLON@[339; 340) ";" - WHITESPACE@[340; 345) "\n " - R_CURLY@[345; 346) "}" - WHITESPACE@[346; 347) "\n" - R_CURLY@[347; 348) "}" - WHITESPACE@[348; 349) "\n" +SOURCE_FILE@0..349 + MACRO_DEF@0..93 + MACRO_KW@0..5 "macro" + WHITESPACE@5..6 " " + NAME@6..21 + IDENT@6..21 "parse_use_trees" + TOKEN_TREE@21..93 + TOKEN_TREE@21..41 + L_PAREN@21..22 "(" + DOLLAR@22..23 "$" + TOKEN_TREE@23..32 + L_PAREN@23..24 "(" + DOLLAR@24..25 "$" + IDENT@25..26 "s" + COLON@26..27 ":" + IDENT@27..31 "expr" + R_PAREN@31..32 ")" + COMMA@32..33 "," + STAR@33..34 "*" + WHITESPACE@34..35 " " + DOLLAR@35..36 "$" + TOKEN_TREE@36..39 + L_PAREN@36..37 "(" + COMMA@37..38 "," + R_PAREN@38..39 ")" + STAR@39..40 "*" + R_PAREN@40..41 ")" + WHITESPACE@41..42 " " + TOKEN_TREE@42..93 + L_CURLY@42..43 "{" + WHITESPACE@43..48 "\n " + IDENT@48..51 "vec" + BANG@51..52 "!" + TOKEN_TREE@52..91 + L_BRACK@52..53 "[" + WHITESPACE@53..62 "\n " + DOLLAR@62..63 "$" + TOKEN_TREE@63..84 + L_PAREN@63..64 "(" + IDENT@64..78 "parse_use_tree" + TOKEN_TREE@78..82 + L_PAREN@78..79 "(" + DOLLAR@79..80 "$" + IDENT@80..81 "s" + R_PAREN@81..82 ")" + COMMA@82..83 "," + R_PAREN@83..84 ")" + STAR@84..85 "*" + WHITESPACE@85..90 "\n " + R_BRACK@90..91 "]" + WHITESPACE@91..92 "\n" + R_CURLY@92..93 "}" + WHITESPACE@93..95 "\n\n" + FN_DEF@95..348 + ATTR@95..102 + POUND@95..96 "#" + L_BRACK@96..97 "[" + PATH@97..101 + PATH_SEGMENT@97..101 + NAME_REF@97..101 + IDENT@97..101 "test" + R_BRACK@101..102 "]" + WHITESPACE@102..103 "\n" + FN_KW@103..105 "fn" + WHITESPACE@105..106 " " + NAME@106..125 + IDENT@106..125 "test_use_tree_merge" + PARAM_LIST@125..127 + L_PAREN@125..126 "(" + R_PAREN@126..127 ")" + WHITESPACE@127..128 " " + BLOCK_EXPR@128..348 + BLOCK@128..348 + L_CURLY@128..129 "{" + WHITESPACE@129..134 "\n " + MACRO_DEF@134..346 + MACRO_KW@134..139 "macro" + WHITESPACE@139..140 " " + NAME@140..150 + IDENT@140..150 "test_merge" + TOKEN_TREE@150..346 + TOKEN_TREE@150..203 + L_PAREN@150..151 "(" + TOKEN_TREE@151..175 + L_BRACK@151..152 "[" + DOLLAR@152..153 "$" + TOKEN_TREE@153..166 + L_PAREN@153..154 "(" + DOLLAR@154..155 "$" + IDENT@155..160 "input" + COLON@160..161 ":" + IDENT@161..165 "expr" + R_PAREN@165..166 ")" + COMMA@166..167 "," + STAR@167..168 "*" + WHITESPACE@168..169 " " + DOLLAR@169..170 "$" + TOKEN_TREE@170..173 + L_PAREN@170..171 "(" + COMMA@171..172 "," + R_PAREN@172..173 ")" + STAR@173..174 "*" + R_BRACK@174..175 "]" + COMMA@175..176 "," + WHITESPACE@176..177 " " + TOKEN_TREE@177..202 + L_BRACK@177..178 "[" + DOLLAR@178..179 "$" + TOKEN_TREE@179..193 + L_PAREN@179..180 "(" + DOLLAR@180..181 "$" + IDENT@181..187 "output" + COLON@187..188 ":" + IDENT@188..192 "expr" + R_PAREN@192..193 ")" + COMMA@193..194 "," + STAR@194..195 "*" + WHITESPACE@195..196 " " + DOLLAR@196..197 "$" + TOKEN_TREE@197..200 + L_PAREN@197..198 "(" + COMMA@198..199 "," + R_PAREN@199..200 ")" + STAR@200..201 "*" + R_BRACK@201..202 "]" + R_PAREN@202..203 ")" + WHITESPACE@203..204 " " + TOKEN_TREE@204..346 + L_CURLY@204..205 "{" + WHITESPACE@205..214 "\n " + IDENT@214..223 "assert_eq" + BANG@223..224 "!" + TOKEN_TREE@224..339 + L_PAREN@224..225 "(" + WHITESPACE@225..238 "\n " + IDENT@238..253 "merge_use_trees" + TOKEN_TREE@253..284 + L_PAREN@253..254 "(" + IDENT@254..269 "parse_use_trees" + BANG@269..270 "!" + TOKEN_TREE@270..283 + L_PAREN@270..271 "(" + DOLLAR@271..272 "$" + TOKEN_TREE@272..281 + L_PAREN@272..273 "(" + DOLLAR@273..274 "$" + IDENT@274..279 "input" + COMMA@279..280 "," + R_PAREN@280..281 ")" + STAR@281..282 "*" + R_PAREN@282..283 ")" + R_PAREN@283..284 ")" + COMMA@284..285 "," + WHITESPACE@285..298 "\n " + IDENT@298..313 "parse_use_trees" + BANG@313..314 "!" + TOKEN_TREE@314..328 + L_PAREN@314..315 "(" + DOLLAR@315..316 "$" + TOKEN_TREE@316..326 + L_PAREN@316..317 "(" + DOLLAR@317..318 "$" + IDENT@318..324 "output" + COMMA@324..325 "," + R_PAREN@325..326 ")" + STAR@326..327 "*" + R_PAREN@327..328 ")" + COMMA@328..329 "," + WHITESPACE@329..338 "\n " + R_PAREN@338..339 ")" + SEMICOLON@339..340 ";" + WHITESPACE@340..345 "\n " + R_CURLY@345..346 "}" + WHITESPACE@346..347 "\n" + R_CURLY@347..348 "}" + WHITESPACE@348..349 "\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 d0623ba904..1cd77aa14f 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 @@ -1,198 +1,198 @@ -SOURCE_FILE@[0; 170) - TRAIT_DEF@[0; 169) - TRAIT_KW@[0; 5) "trait" - WHITESPACE@[5; 6) " " - NAME@[6; 7) - IDENT@[6; 7) "T" - WHITESPACE@[7; 8) " " - ITEM_LIST@[8; 169) - L_CURLY@[8; 9) "{" - WHITESPACE@[9; 14) "\n " - FN_DEF@[14; 46) - FN_KW@[14; 16) "fn" - WHITESPACE@[16; 17) " " - NAME@[17; 19) - IDENT@[17; 19) "f1" - PARAM_LIST@[19; 43) - L_PAREN@[19; 20) "(" - PARAM@[20; 42) - TUPLE_PAT@[20; 26) - L_PAREN@[20; 21) "(" - BIND_PAT@[21; 22) - NAME@[21; 22) - IDENT@[21; 22) "a" - COMMA@[22; 23) "," - WHITESPACE@[23; 24) " " - BIND_PAT@[24; 25) - NAME@[24; 25) - IDENT@[24; 25) "b" - R_PAREN@[25; 26) ")" - COLON@[26; 27) ":" - WHITESPACE@[27; 28) " " - TUPLE_TYPE@[28; 42) - L_PAREN@[28; 29) "(" - PATH_TYPE@[29; 34) - PATH@[29; 34) - PATH_SEGMENT@[29; 34) - NAME_REF@[29; 34) - IDENT@[29; 34) "usize" - COMMA@[34; 35) "," - WHITESPACE@[35; 36) " " - PATH_TYPE@[36; 41) - PATH@[36; 41) - PATH_SEGMENT@[36; 41) - NAME_REF@[36; 41) - IDENT@[36; 41) "usize" - R_PAREN@[41; 42) ")" - R_PAREN@[42; 43) ")" - WHITESPACE@[43; 44) " " - BLOCK_EXPR@[44; 46) - BLOCK@[44; 46) - L_CURLY@[44; 45) "{" - R_CURLY@[45; 46) "}" - WHITESPACE@[46; 51) "\n " - FN_DEF@[51; 74) - FN_KW@[51; 53) "fn" - WHITESPACE@[53; 54) " " - NAME@[54; 56) - IDENT@[54; 56) "f2" - PARAM_LIST@[56; 71) - L_PAREN@[56; 57) "(" - PARAM@[57; 70) - RECORD_PAT@[57; 67) - PATH@[57; 58) - PATH_SEGMENT@[57; 58) - NAME_REF@[57; 58) - IDENT@[57; 58) "S" - WHITESPACE@[58; 59) " " - RECORD_FIELD_PAT_LIST@[59; 67) - L_CURLY@[59; 60) "{" - WHITESPACE@[60; 61) " " - RECORD_FIELD_PAT@[61; 62) - BIND_PAT@[61; 62) - NAME@[61; 62) - IDENT@[61; 62) "a" - COMMA@[62; 63) "," - WHITESPACE@[63; 64) " " - RECORD_FIELD_PAT@[64; 65) - BIND_PAT@[64; 65) - NAME@[64; 65) - IDENT@[64; 65) "b" - WHITESPACE@[65; 66) " " - R_CURLY@[66; 67) "}" - COLON@[67; 68) ":" - WHITESPACE@[68; 69) " " - PATH_TYPE@[69; 70) - PATH@[69; 70) - PATH_SEGMENT@[69; 70) - NAME_REF@[69; 70) - IDENT@[69; 70) "S" - R_PAREN@[70; 71) ")" - WHITESPACE@[71; 72) " " - BLOCK_EXPR@[72; 74) - BLOCK@[72; 74) - L_CURLY@[72; 73) "{" - R_CURLY@[73; 74) "}" - WHITESPACE@[74; 79) "\n " - FN_DEF@[79; 108) - FN_KW@[79; 81) "fn" - WHITESPACE@[81; 82) " " - NAME@[82; 84) - IDENT@[82; 84) "f3" - PARAM_LIST@[84; 105) - L_PAREN@[84; 85) "(" - PARAM@[85; 104) - TUPLE_STRUCT_PAT@[85; 95) - PATH@[85; 92) - PATH_SEGMENT@[85; 92) - NAME_REF@[85; 92) - IDENT@[85; 92) "NewType" - L_PAREN@[92; 93) "(" - BIND_PAT@[93; 94) - NAME@[93; 94) - IDENT@[93; 94) "a" - R_PAREN@[94; 95) ")" - COLON@[95; 96) ":" - WHITESPACE@[96; 97) " " - PATH_TYPE@[97; 104) - PATH@[97; 104) - PATH_SEGMENT@[97; 104) - NAME_REF@[97; 104) - IDENT@[97; 104) "NewType" - R_PAREN@[104; 105) ")" - WHITESPACE@[105; 106) " " - BLOCK_EXPR@[106; 108) - BLOCK@[106; 108) - L_CURLY@[106; 107) "{" - R_CURLY@[107; 108) "}" - WHITESPACE@[108; 113) "\n " - FN_DEF@[113; 135) - FN_KW@[113; 115) "fn" - WHITESPACE@[115; 116) " " - NAME@[116; 118) - IDENT@[116; 118) "f4" - PARAM_LIST@[118; 132) - L_PAREN@[118; 119) "(" - PARAM@[119; 131) - REF_PAT@[119; 122) - AMP@[119; 120) "&" - REF_PAT@[120; 122) - AMP@[120; 121) "&" - BIND_PAT@[121; 122) - NAME@[121; 122) - IDENT@[121; 122) "a" - COLON@[122; 123) ":" - WHITESPACE@[123; 124) " " - REFERENCE_TYPE@[124; 131) - AMP@[124; 125) "&" - REFERENCE_TYPE@[125; 131) - AMP@[125; 126) "&" - PATH_TYPE@[126; 131) - PATH@[126; 131) - PATH_SEGMENT@[126; 131) - NAME_REF@[126; 131) - IDENT@[126; 131) "usize" - R_PAREN@[131; 132) ")" - WHITESPACE@[132; 133) " " - BLOCK_EXPR@[133; 135) - BLOCK@[133; 135) - L_CURLY@[133; 134) "{" - R_CURLY@[134; 135) "}" - WHITESPACE@[135; 140) "\n " - FN_DEF@[140; 167) - FN_KW@[140; 142) "fn" - WHITESPACE@[142; 143) " " - NAME@[143; 146) - IDENT@[143; 146) "bar" - PARAM_LIST@[146; 166) - L_PAREN@[146; 147) "(" - PARAM@[147; 153) - PLACEHOLDER_PAT@[147; 148) - UNDERSCORE@[147; 148) "_" - COLON@[148; 149) ":" - WHITESPACE@[149; 150) " " - PATH_TYPE@[150; 153) - PATH@[150; 153) - PATH_SEGMENT@[150; 153) - NAME_REF@[150; 153) - IDENT@[150; 153) "u64" - COMMA@[153; 154) "," - WHITESPACE@[154; 155) " " - PARAM@[155; 165) - BIND_PAT@[155; 160) - MUT_KW@[155; 158) "mut" - WHITESPACE@[158; 159) " " - NAME@[159; 160) - IDENT@[159; 160) "x" - COLON@[160; 161) ":" - WHITESPACE@[161; 162) " " - PATH_TYPE@[162; 165) - PATH@[162; 165) - PATH_SEGMENT@[162; 165) - NAME_REF@[162; 165) - IDENT@[162; 165) "i32" - R_PAREN@[165; 166) ")" - SEMICOLON@[166; 167) ";" - WHITESPACE@[167; 168) "\n" - R_CURLY@[168; 169) "}" - WHITESPACE@[169; 170) "\n" +SOURCE_FILE@0..170 + TRAIT_DEF@0..169 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "T" + WHITESPACE@7..8 " " + ITEM_LIST@8..169 + L_CURLY@8..9 "{" + WHITESPACE@9..14 "\n " + FN_DEF@14..46 + FN_KW@14..16 "fn" + WHITESPACE@16..17 " " + NAME@17..19 + IDENT@17..19 "f1" + PARAM_LIST@19..43 + L_PAREN@19..20 "(" + PARAM@20..42 + TUPLE_PAT@20..26 + L_PAREN@20..21 "(" + BIND_PAT@21..22 + NAME@21..22 + IDENT@21..22 "a" + COMMA@22..23 "," + WHITESPACE@23..24 " " + BIND_PAT@24..25 + NAME@24..25 + IDENT@24..25 "b" + R_PAREN@25..26 ")" + COLON@26..27 ":" + WHITESPACE@27..28 " " + TUPLE_TYPE@28..42 + L_PAREN@28..29 "(" + PATH_TYPE@29..34 + PATH@29..34 + PATH_SEGMENT@29..34 + NAME_REF@29..34 + IDENT@29..34 "usize" + COMMA@34..35 "," + WHITESPACE@35..36 " " + PATH_TYPE@36..41 + PATH@36..41 + PATH_SEGMENT@36..41 + NAME_REF@36..41 + IDENT@36..41 "usize" + R_PAREN@41..42 ")" + R_PAREN@42..43 ")" + WHITESPACE@43..44 " " + BLOCK_EXPR@44..46 + BLOCK@44..46 + L_CURLY@44..45 "{" + R_CURLY@45..46 "}" + WHITESPACE@46..51 "\n " + FN_DEF@51..74 + FN_KW@51..53 "fn" + WHITESPACE@53..54 " " + NAME@54..56 + IDENT@54..56 "f2" + PARAM_LIST@56..71 + L_PAREN@56..57 "(" + PARAM@57..70 + RECORD_PAT@57..67 + PATH@57..58 + PATH_SEGMENT@57..58 + NAME_REF@57..58 + IDENT@57..58 "S" + WHITESPACE@58..59 " " + RECORD_FIELD_PAT_LIST@59..67 + L_CURLY@59..60 "{" + WHITESPACE@60..61 " " + RECORD_FIELD_PAT@61..62 + BIND_PAT@61..62 + NAME@61..62 + IDENT@61..62 "a" + COMMA@62..63 "," + WHITESPACE@63..64 " " + RECORD_FIELD_PAT@64..65 + BIND_PAT@64..65 + NAME@64..65 + IDENT@64..65 "b" + WHITESPACE@65..66 " " + R_CURLY@66..67 "}" + COLON@67..68 ":" + WHITESPACE@68..69 " " + PATH_TYPE@69..70 + PATH@69..70 + PATH_SEGMENT@69..70 + NAME_REF@69..70 + IDENT@69..70 "S" + R_PAREN@70..71 ")" + WHITESPACE@71..72 " " + BLOCK_EXPR@72..74 + BLOCK@72..74 + L_CURLY@72..73 "{" + R_CURLY@73..74 "}" + WHITESPACE@74..79 "\n " + FN_DEF@79..108 + FN_KW@79..81 "fn" + WHITESPACE@81..82 " " + NAME@82..84 + IDENT@82..84 "f3" + PARAM_LIST@84..105 + L_PAREN@84..85 "(" + PARAM@85..104 + TUPLE_STRUCT_PAT@85..95 + PATH@85..92 + PATH_SEGMENT@85..92 + NAME_REF@85..92 + IDENT@85..92 "NewType" + L_PAREN@92..93 "(" + BIND_PAT@93..94 + NAME@93..94 + IDENT@93..94 "a" + R_PAREN@94..95 ")" + COLON@95..96 ":" + WHITESPACE@96..97 " " + PATH_TYPE@97..104 + PATH@97..104 + PATH_SEGMENT@97..104 + NAME_REF@97..104 + IDENT@97..104 "NewType" + R_PAREN@104..105 ")" + WHITESPACE@105..106 " " + BLOCK_EXPR@106..108 + BLOCK@106..108 + L_CURLY@106..107 "{" + R_CURLY@107..108 "}" + WHITESPACE@108..113 "\n " + FN_DEF@113..135 + FN_KW@113..115 "fn" + WHITESPACE@115..116 " " + NAME@116..118 + IDENT@116..118 "f4" + PARAM_LIST@118..132 + L_PAREN@118..119 "(" + PARAM@119..131 + REF_PAT@119..122 + AMP@119..120 "&" + REF_PAT@120..122 + AMP@120..121 "&" + BIND_PAT@121..122 + NAME@121..122 + IDENT@121..122 "a" + COLON@122..123 ":" + WHITESPACE@123..124 " " + REFERENCE_TYPE@124..131 + AMP@124..125 "&" + REFERENCE_TYPE@125..131 + AMP@125..126 "&" + PATH_TYPE@126..131 + PATH@126..131 + PATH_SEGMENT@126..131 + NAME_REF@126..131 + IDENT@126..131 "usize" + R_PAREN@131..132 ")" + WHITESPACE@132..133 " " + BLOCK_EXPR@133..135 + BLOCK@133..135 + L_CURLY@133..134 "{" + R_CURLY@134..135 "}" + WHITESPACE@135..140 "\n " + FN_DEF@140..167 + FN_KW@140..142 "fn" + WHITESPACE@142..143 " " + NAME@143..146 + IDENT@143..146 "bar" + PARAM_LIST@146..166 + L_PAREN@146..147 "(" + PARAM@147..153 + PLACEHOLDER_PAT@147..148 + UNDERSCORE@147..148 "_" + COLON@148..149 ":" + WHITESPACE@149..150 " " + PATH_TYPE@150..153 + PATH@150..153 + PATH_SEGMENT@150..153 + NAME_REF@150..153 + IDENT@150..153 "u64" + COMMA@153..154 "," + WHITESPACE@154..155 " " + PARAM@155..165 + BIND_PAT@155..160 + MUT_KW@155..158 "mut" + WHITESPACE@158..159 " " + NAME@159..160 + IDENT@159..160 "x" + COLON@160..161 ":" + WHITESPACE@161..162 " " + PATH_TYPE@162..165 + PATH@162..165 + PATH_SEGMENT@162..165 + NAME_REF@162..165 + IDENT@162..165 "i32" + R_PAREN@165..166 ")" + SEMICOLON@166..167 ";" + WHITESPACE@167..168 "\n" + R_CURLY@168..169 "}" + 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 17b08197b6..5a9f07c895 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 @@ -1,133 +1,133 @@ -SOURCE_FILE@[0; 126) - EXTERN_BLOCK@[0; 125) - ABI@[0; 10) - EXTERN_KW@[0; 6) "extern" - WHITESPACE@[6; 7) " " - STRING@[7; 10) "\"C\"" - WHITESPACE@[10; 11) " " - EXTERN_ITEM_LIST@[11; 125) - L_CURLY@[11; 12) "{" - WHITESPACE@[12; 17) "\n " - FN_DEF@[17; 40) - FN_KW@[17; 19) "fn" - WHITESPACE@[19; 20) " " - NAME@[20; 21) - IDENT@[20; 21) "a" - PARAM_LIST@[21; 39) - L_PAREN@[21; 22) "(" - PARAM@[22; 32) - PLACEHOLDER_PAT@[22; 23) - UNDERSCORE@[22; 23) "_" - COLON@[23; 24) ":" - WHITESPACE@[24; 25) " " - POINTER_TYPE@[25; 32) - STAR@[25; 26) "*" - MUT_KW@[26; 29) "mut" - WHITESPACE@[29; 30) " " - PATH_TYPE@[30; 32) - PATH@[30; 32) - PATH_SEGMENT@[30; 32) - NAME_REF@[30; 32) - IDENT@[30; 32) "u8" - COMMA@[32; 33) "," - WHITESPACE@[33; 34) " " - PARAM@[34; 37) - DOT3@[34; 37) "..." - COMMA@[37; 38) "," - R_PAREN@[38; 39) ")" - SEMICOLON@[39; 40) ";" - WHITESPACE@[40; 45) "\n " - FN_DEF@[45; 70) - FN_KW@[45; 47) "fn" - WHITESPACE@[47; 48) " " - NAME@[48; 49) - IDENT@[48; 49) "b" - PARAM_LIST@[49; 69) - L_PAREN@[49; 50) "(" - PARAM@[50; 60) - PLACEHOLDER_PAT@[50; 51) - UNDERSCORE@[50; 51) "_" - COLON@[51; 52) ":" - WHITESPACE@[52; 53) " " - POINTER_TYPE@[53; 60) - STAR@[53; 54) "*" - MUT_KW@[54; 57) "mut" - WHITESPACE@[57; 58) " " - PATH_TYPE@[58; 60) - PATH@[58; 60) - PATH_SEGMENT@[58; 60) - NAME_REF@[58; 60) - IDENT@[58; 60) "u8" - COMMA@[60; 61) "," - WHITESPACE@[61; 62) " " - PARAM@[62; 68) - PLACEHOLDER_PAT@[62; 63) - UNDERSCORE@[62; 63) "_" - COLON@[63; 64) ":" - WHITESPACE@[64; 65) " " - DOT3@[65; 68) "..." - R_PAREN@[68; 69) ")" - SEMICOLON@[69; 70) ";" - WHITESPACE@[70; 75) "\n " - FN_DEF@[75; 123) - FN_KW@[75; 77) "fn" - WHITESPACE@[77; 78) " " - NAME@[78; 79) - IDENT@[78; 79) "c" - PARAM_LIST@[79; 122) - L_PAREN@[79; 80) "(" - PARAM@[80; 90) - PLACEHOLDER_PAT@[80; 81) - UNDERSCORE@[80; 81) "_" - COLON@[81; 82) ":" - WHITESPACE@[82; 83) " " - POINTER_TYPE@[83; 90) - STAR@[83; 84) "*" - MUT_KW@[84; 87) "mut" - WHITESPACE@[87; 88) " " - PATH_TYPE@[88; 90) - PATH@[88; 90) - PATH_SEGMENT@[88; 90) - NAME_REF@[88; 90) - IDENT@[88; 90) "u8" - COMMA@[90; 91) "," - WHITESPACE@[91; 92) " " - ATTR@[92; 105) - POUND@[92; 93) "#" - L_BRACK@[93; 94) "[" - PATH@[94; 97) - PATH_SEGMENT@[94; 97) - NAME_REF@[94; 97) - IDENT@[94; 97) "cfg" - TOKEN_TREE@[97; 104) - L_PAREN@[97; 98) "(" - IDENT@[98; 103) "never" - R_PAREN@[103; 104) ")" - R_BRACK@[104; 105) "]" - WHITESPACE@[105; 106) " " - PARAM@[106; 120) - SLICE_PAT@[106; 115) - L_BRACK@[106; 107) "[" - BIND_PAT@[107; 108) - NAME@[107; 108) - IDENT@[107; 108) "w" - COMMA@[108; 109) "," - WHITESPACE@[109; 110) " " - BIND_PAT@[110; 111) - NAME@[110; 111) - IDENT@[110; 111) "t" - COMMA@[111; 112) "," - WHITESPACE@[112; 113) " " - BIND_PAT@[113; 114) - NAME@[113; 114) - IDENT@[113; 114) "f" - R_BRACK@[114; 115) "]" - COLON@[115; 116) ":" - WHITESPACE@[116; 117) " " - DOT3@[117; 120) "..." - COMMA@[120; 121) "," - R_PAREN@[121; 122) ")" - SEMICOLON@[122; 123) ";" - WHITESPACE@[123; 124) "\n" - R_CURLY@[124; 125) "}" - WHITESPACE@[125; 126) "\n" +SOURCE_FILE@0..126 + EXTERN_BLOCK@0..125 + ABI@0..10 + EXTERN_KW@0..6 "extern" + WHITESPACE@6..7 " " + STRING@7..10 "\"C\"" + WHITESPACE@10..11 " " + EXTERN_ITEM_LIST@11..125 + L_CURLY@11..12 "{" + WHITESPACE@12..17 "\n " + FN_DEF@17..40 + FN_KW@17..19 "fn" + WHITESPACE@19..20 " " + NAME@20..21 + IDENT@20..21 "a" + PARAM_LIST@21..39 + L_PAREN@21..22 "(" + PARAM@22..32 + PLACEHOLDER_PAT@22..23 + UNDERSCORE@22..23 "_" + COLON@23..24 ":" + WHITESPACE@24..25 " " + POINTER_TYPE@25..32 + STAR@25..26 "*" + MUT_KW@26..29 "mut" + WHITESPACE@29..30 " " + PATH_TYPE@30..32 + PATH@30..32 + PATH_SEGMENT@30..32 + NAME_REF@30..32 + IDENT@30..32 "u8" + COMMA@32..33 "," + WHITESPACE@33..34 " " + PARAM@34..37 + DOT3@34..37 "..." + COMMA@37..38 "," + R_PAREN@38..39 ")" + SEMICOLON@39..40 ";" + WHITESPACE@40..45 "\n " + FN_DEF@45..70 + FN_KW@45..47 "fn" + WHITESPACE@47..48 " " + NAME@48..49 + IDENT@48..49 "b" + PARAM_LIST@49..69 + L_PAREN@49..50 "(" + PARAM@50..60 + PLACEHOLDER_PAT@50..51 + UNDERSCORE@50..51 "_" + COLON@51..52 ":" + WHITESPACE@52..53 " " + POINTER_TYPE@53..60 + STAR@53..54 "*" + MUT_KW@54..57 "mut" + WHITESPACE@57..58 " " + PATH_TYPE@58..60 + PATH@58..60 + PATH_SEGMENT@58..60 + NAME_REF@58..60 + IDENT@58..60 "u8" + COMMA@60..61 "," + WHITESPACE@61..62 " " + PARAM@62..68 + PLACEHOLDER_PAT@62..63 + UNDERSCORE@62..63 "_" + COLON@63..64 ":" + WHITESPACE@64..65 " " + DOT3@65..68 "..." + R_PAREN@68..69 ")" + SEMICOLON@69..70 ";" + WHITESPACE@70..75 "\n " + FN_DEF@75..123 + FN_KW@75..77 "fn" + WHITESPACE@77..78 " " + NAME@78..79 + IDENT@78..79 "c" + PARAM_LIST@79..122 + L_PAREN@79..80 "(" + PARAM@80..90 + PLACEHOLDER_PAT@80..81 + UNDERSCORE@80..81 "_" + COLON@81..82 ":" + WHITESPACE@82..83 " " + POINTER_TYPE@83..90 + STAR@83..84 "*" + MUT_KW@84..87 "mut" + WHITESPACE@87..88 " " + PATH_TYPE@88..90 + PATH@88..90 + PATH_SEGMENT@88..90 + NAME_REF@88..90 + IDENT@88..90 "u8" + COMMA@90..91 "," + WHITESPACE@91..92 " " + ATTR@92..105 + POUND@92..93 "#" + L_BRACK@93..94 "[" + PATH@94..97 + PATH_SEGMENT@94..97 + NAME_REF@94..97 + IDENT@94..97 "cfg" + TOKEN_TREE@97..104 + L_PAREN@97..98 "(" + IDENT@98..103 "never" + R_PAREN@103..104 ")" + R_BRACK@104..105 "]" + WHITESPACE@105..106 " " + PARAM@106..120 + SLICE_PAT@106..115 + L_BRACK@106..107 "[" + BIND_PAT@107..108 + NAME@107..108 + IDENT@107..108 "w" + COMMA@108..109 "," + WHITESPACE@109..110 " " + BIND_PAT@110..111 + NAME@110..111 + IDENT@110..111 "t" + COMMA@111..112 "," + WHITESPACE@112..113 " " + BIND_PAT@113..114 + NAME@113..114 + IDENT@113..114 "f" + R_BRACK@114..115 "]" + COLON@115..116 ":" + WHITESPACE@116..117 " " + DOT3@117..120 "..." + COMMA@120..121 "," + R_PAREN@121..122 ")" + SEMICOLON@122..123 ";" + WHITESPACE@123..124 "\n" + R_CURLY@124..125 "}" + WHITESPACE@125..126 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast b/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast index 5e96b695bb..4f9a14066f 100644 --- a/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast +++ b/crates/ra_syntax/test_data/parser/ok/0064_impl_fn_params.rast @@ -1,166 +1,166 @@ -SOURCE_FILE@[0; 137) - IMPL_DEF@[0; 136) - IMPL_KW@[0; 4) "impl" - WHITESPACE@[4; 5) " " - PATH_TYPE@[5; 6) - PATH@[5; 6) - PATH_SEGMENT@[5; 6) - NAME_REF@[5; 6) - IDENT@[5; 6) "U" - WHITESPACE@[6; 7) " " - ITEM_LIST@[7; 136) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 13) "\n " - FN_DEF@[13; 45) - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 18) - IDENT@[16; 18) "f1" - PARAM_LIST@[18; 42) - L_PAREN@[18; 19) "(" - PARAM@[19; 41) - TUPLE_PAT@[19; 25) - L_PAREN@[19; 20) "(" - BIND_PAT@[20; 21) - NAME@[20; 21) - IDENT@[20; 21) "a" - COMMA@[21; 22) "," - WHITESPACE@[22; 23) " " - BIND_PAT@[23; 24) - NAME@[23; 24) - IDENT@[23; 24) "b" - R_PAREN@[24; 25) ")" - COLON@[25; 26) ":" - WHITESPACE@[26; 27) " " - TUPLE_TYPE@[27; 41) - L_PAREN@[27; 28) "(" - PATH_TYPE@[28; 33) - PATH@[28; 33) - PATH_SEGMENT@[28; 33) - NAME_REF@[28; 33) - IDENT@[28; 33) "usize" - COMMA@[33; 34) "," - WHITESPACE@[34; 35) " " - PATH_TYPE@[35; 40) - PATH@[35; 40) - PATH_SEGMENT@[35; 40) - NAME_REF@[35; 40) - IDENT@[35; 40) "usize" - R_PAREN@[40; 41) ")" - R_PAREN@[41; 42) ")" - WHITESPACE@[42; 43) " " - BLOCK_EXPR@[43; 45) - BLOCK@[43; 45) - L_CURLY@[43; 44) "{" - R_CURLY@[44; 45) "}" - WHITESPACE@[45; 50) "\n " - FN_DEF@[50; 73) - FN_KW@[50; 52) "fn" - WHITESPACE@[52; 53) " " - NAME@[53; 55) - IDENT@[53; 55) "f2" - PARAM_LIST@[55; 70) - L_PAREN@[55; 56) "(" - PARAM@[56; 69) - RECORD_PAT@[56; 66) - PATH@[56; 57) - PATH_SEGMENT@[56; 57) - NAME_REF@[56; 57) - IDENT@[56; 57) "S" - WHITESPACE@[57; 58) " " - RECORD_FIELD_PAT_LIST@[58; 66) - L_CURLY@[58; 59) "{" - WHITESPACE@[59; 60) " " - RECORD_FIELD_PAT@[60; 61) - BIND_PAT@[60; 61) - NAME@[60; 61) - IDENT@[60; 61) "a" - COMMA@[61; 62) "," - WHITESPACE@[62; 63) " " - RECORD_FIELD_PAT@[63; 64) - BIND_PAT@[63; 64) - NAME@[63; 64) - IDENT@[63; 64) "b" - WHITESPACE@[64; 65) " " - R_CURLY@[65; 66) "}" - COLON@[66; 67) ":" - WHITESPACE@[67; 68) " " - PATH_TYPE@[68; 69) - PATH@[68; 69) - PATH_SEGMENT@[68; 69) - NAME_REF@[68; 69) - IDENT@[68; 69) "S" - R_PAREN@[69; 70) ")" - WHITESPACE@[70; 71) " " - BLOCK_EXPR@[71; 73) - BLOCK@[71; 73) - L_CURLY@[71; 72) "{" - R_CURLY@[72; 73) "}" - WHITESPACE@[73; 78) "\n " - FN_DEF@[78; 107) - FN_KW@[78; 80) "fn" - WHITESPACE@[80; 81) " " - NAME@[81; 83) - IDENT@[81; 83) "f3" - PARAM_LIST@[83; 104) - L_PAREN@[83; 84) "(" - PARAM@[84; 103) - TUPLE_STRUCT_PAT@[84; 94) - PATH@[84; 91) - PATH_SEGMENT@[84; 91) - NAME_REF@[84; 91) - IDENT@[84; 91) "NewType" - L_PAREN@[91; 92) "(" - BIND_PAT@[92; 93) - NAME@[92; 93) - IDENT@[92; 93) "a" - R_PAREN@[93; 94) ")" - COLON@[94; 95) ":" - WHITESPACE@[95; 96) " " - PATH_TYPE@[96; 103) - PATH@[96; 103) - PATH_SEGMENT@[96; 103) - NAME_REF@[96; 103) - IDENT@[96; 103) "NewType" - R_PAREN@[103; 104) ")" - WHITESPACE@[104; 105) " " - BLOCK_EXPR@[105; 107) - BLOCK@[105; 107) - L_CURLY@[105; 106) "{" - R_CURLY@[106; 107) "}" - WHITESPACE@[107; 112) "\n " - FN_DEF@[112; 134) - FN_KW@[112; 114) "fn" - WHITESPACE@[114; 115) " " - NAME@[115; 117) - IDENT@[115; 117) "f4" - PARAM_LIST@[117; 131) - L_PAREN@[117; 118) "(" - PARAM@[118; 130) - REF_PAT@[118; 121) - AMP@[118; 119) "&" - REF_PAT@[119; 121) - AMP@[119; 120) "&" - BIND_PAT@[120; 121) - NAME@[120; 121) - IDENT@[120; 121) "a" - COLON@[121; 122) ":" - WHITESPACE@[122; 123) " " - REFERENCE_TYPE@[123; 130) - AMP@[123; 124) "&" - REFERENCE_TYPE@[124; 130) - AMP@[124; 125) "&" - PATH_TYPE@[125; 130) - PATH@[125; 130) - PATH_SEGMENT@[125; 130) - NAME_REF@[125; 130) - IDENT@[125; 130) "usize" - R_PAREN@[130; 131) ")" - WHITESPACE@[131; 132) " " - BLOCK_EXPR@[132; 134) - BLOCK@[132; 134) - L_CURLY@[132; 133) "{" - R_CURLY@[133; 134) "}" - WHITESPACE@[134; 135) "\n" - R_CURLY@[135; 136) "}" - WHITESPACE@[136; 137) "\n" +SOURCE_FILE@0..137 + IMPL_DEF@0..136 + IMPL_KW@0..4 "impl" + WHITESPACE@4..5 " " + PATH_TYPE@5..6 + PATH@5..6 + PATH_SEGMENT@5..6 + NAME_REF@5..6 + IDENT@5..6 "U" + WHITESPACE@6..7 " " + ITEM_LIST@7..136 + L_CURLY@7..8 "{" + WHITESPACE@8..13 "\n " + FN_DEF@13..45 + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..18 + IDENT@16..18 "f1" + PARAM_LIST@18..42 + L_PAREN@18..19 "(" + PARAM@19..41 + TUPLE_PAT@19..25 + L_PAREN@19..20 "(" + BIND_PAT@20..21 + NAME@20..21 + IDENT@20..21 "a" + COMMA@21..22 "," + WHITESPACE@22..23 " " + BIND_PAT@23..24 + NAME@23..24 + IDENT@23..24 "b" + R_PAREN@24..25 ")" + COLON@25..26 ":" + WHITESPACE@26..27 " " + TUPLE_TYPE@27..41 + L_PAREN@27..28 "(" + PATH_TYPE@28..33 + PATH@28..33 + PATH_SEGMENT@28..33 + NAME_REF@28..33 + IDENT@28..33 "usize" + COMMA@33..34 "," + WHITESPACE@34..35 " " + PATH_TYPE@35..40 + PATH@35..40 + PATH_SEGMENT@35..40 + NAME_REF@35..40 + IDENT@35..40 "usize" + R_PAREN@40..41 ")" + R_PAREN@41..42 ")" + WHITESPACE@42..43 " " + BLOCK_EXPR@43..45 + BLOCK@43..45 + L_CURLY@43..44 "{" + R_CURLY@44..45 "}" + WHITESPACE@45..50 "\n " + FN_DEF@50..73 + FN_KW@50..52 "fn" + WHITESPACE@52..53 " " + NAME@53..55 + IDENT@53..55 "f2" + PARAM_LIST@55..70 + L_PAREN@55..56 "(" + PARAM@56..69 + RECORD_PAT@56..66 + PATH@56..57 + PATH_SEGMENT@56..57 + NAME_REF@56..57 + IDENT@56..57 "S" + WHITESPACE@57..58 " " + RECORD_FIELD_PAT_LIST@58..66 + L_CURLY@58..59 "{" + WHITESPACE@59..60 " " + RECORD_FIELD_PAT@60..61 + BIND_PAT@60..61 + NAME@60..61 + IDENT@60..61 "a" + COMMA@61..62 "," + WHITESPACE@62..63 " " + RECORD_FIELD_PAT@63..64 + BIND_PAT@63..64 + NAME@63..64 + IDENT@63..64 "b" + WHITESPACE@64..65 " " + R_CURLY@65..66 "}" + COLON@66..67 ":" + WHITESPACE@67..68 " " + PATH_TYPE@68..69 + PATH@68..69 + PATH_SEGMENT@68..69 + NAME_REF@68..69 + IDENT@68..69 "S" + R_PAREN@69..70 ")" + WHITESPACE@70..71 " " + BLOCK_EXPR@71..73 + BLOCK@71..73 + L_CURLY@71..72 "{" + R_CURLY@72..73 "}" + WHITESPACE@73..78 "\n " + FN_DEF@78..107 + FN_KW@78..80 "fn" + WHITESPACE@80..81 " " + NAME@81..83 + IDENT@81..83 "f3" + PARAM_LIST@83..104 + L_PAREN@83..84 "(" + PARAM@84..103 + TUPLE_STRUCT_PAT@84..94 + PATH@84..91 + PATH_SEGMENT@84..91 + NAME_REF@84..91 + IDENT@84..91 "NewType" + L_PAREN@91..92 "(" + BIND_PAT@92..93 + NAME@92..93 + IDENT@92..93 "a" + R_PAREN@93..94 ")" + COLON@94..95 ":" + WHITESPACE@95..96 " " + PATH_TYPE@96..103 + PATH@96..103 + PATH_SEGMENT@96..103 + NAME_REF@96..103 + IDENT@96..103 "NewType" + R_PAREN@103..104 ")" + WHITESPACE@104..105 " " + BLOCK_EXPR@105..107 + BLOCK@105..107 + L_CURLY@105..106 "{" + R_CURLY@106..107 "}" + WHITESPACE@107..112 "\n " + FN_DEF@112..134 + FN_KW@112..114 "fn" + WHITESPACE@114..115 " " + NAME@115..117 + IDENT@115..117 "f4" + PARAM_LIST@117..131 + L_PAREN@117..118 "(" + PARAM@118..130 + REF_PAT@118..121 + AMP@118..119 "&" + REF_PAT@119..121 + AMP@119..120 "&" + BIND_PAT@120..121 + NAME@120..121 + IDENT@120..121 "a" + COLON@121..122 ":" + WHITESPACE@122..123 " " + REFERENCE_TYPE@123..130 + AMP@123..124 "&" + REFERENCE_TYPE@124..130 + AMP@124..125 "&" + PATH_TYPE@125..130 + PATH@125..130 + PATH_SEGMENT@125..130 + NAME_REF@125..130 + IDENT@125..130 "usize" + R_PAREN@130..131 ")" + WHITESPACE@131..132 " " + BLOCK_EXPR@132..134 + BLOCK@132..134 + L_CURLY@132..133 "{" + R_CURLY@133..134 "}" + WHITESPACE@134..135 "\n" + R_CURLY@135..136 "}" + WHITESPACE@136..137 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast b/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast index 91d0c37365..3294f49013 100644 --- a/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast +++ b/crates/ra_syntax/test_data/parser/ok/0065_comment_newline.rast @@ -1,17 +1,17 @@ -SOURCE_FILE@[0; 26) - FN_DEF@[0; 25) - COMMENT@[0; 11) "/// Example" - WHITESPACE@[11; 13) "\n\n" - FN_KW@[13; 15) "fn" - WHITESPACE@[15; 16) " " - NAME@[16; 20) - IDENT@[16; 20) "test" - PARAM_LIST@[20; 22) - L_PAREN@[20; 21) "(" - R_PAREN@[21; 22) ")" - WHITESPACE@[22; 23) " " - BLOCK_EXPR@[23; 25) - BLOCK@[23; 25) - L_CURLY@[23; 24) "{" - R_CURLY@[24; 25) "}" - WHITESPACE@[25; 26) "\n" +SOURCE_FILE@0..26 + FN_DEF@0..25 + COMMENT@0..11 "/// Example" + WHITESPACE@11..13 "\n\n" + FN_KW@13..15 "fn" + WHITESPACE@15..16 " " + NAME@16..20 + IDENT@16..20 "test" + PARAM_LIST@20..22 + L_PAREN@20..21 "(" + R_PAREN@21..22 ")" + WHITESPACE@22..23 " " + BLOCK_EXPR@23..25 + BLOCK@23..25 + L_CURLY@23..24 "{" + R_CURLY@24..25 "}" + WHITESPACE@25..26 "\n" diff --git a/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast b/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast index 1b0acf47c6..633b14000e 100644 --- a/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast +++ b/crates/ra_syntax/test_data/parser/ok/0065_plus_after_fn_trait_bound.rast @@ -1,61 +1,61 @@ -SOURCE_FILE@[0; 40) - FN_DEF@[0; 39) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "f" - TYPE_PARAM_LIST@[4; 7) - L_ANGLE@[4; 5) "<" - TYPE_PARAM@[5; 6) - NAME@[5; 6) - IDENT@[5; 6) "T" - R_ANGLE@[6; 7) ">" - PARAM_LIST@[7; 9) - L_PAREN@[7; 8) "(" - R_PAREN@[8; 9) ")" - WHITESPACE@[9; 10) " " - WHERE_CLAUSE@[10; 36) - WHERE_KW@[10; 15) "where" - WHITESPACE@[15; 16) " " - WHERE_PRED@[16; 36) - PATH_TYPE@[16; 17) - PATH@[16; 17) - PATH_SEGMENT@[16; 17) - NAME_REF@[16; 17) - IDENT@[16; 17) "T" - COLON@[17; 18) ":" - WHITESPACE@[18; 19) " " - TYPE_BOUND_LIST@[19; 36) - TYPE_BOUND@[19; 29) - PATH_TYPE@[19; 29) - PATH@[19; 29) - PATH_SEGMENT@[19; 29) - NAME_REF@[19; 21) - IDENT@[19; 21) "Fn" - PARAM_LIST@[21; 23) - L_PAREN@[21; 22) "(" - R_PAREN@[22; 23) ")" - WHITESPACE@[23; 24) " " - RET_TYPE@[24; 29) - THIN_ARROW@[24; 26) "->" - WHITESPACE@[26; 27) " " - PATH_TYPE@[27; 29) - PATH@[27; 29) - PATH_SEGMENT@[27; 29) - NAME_REF@[27; 29) - IDENT@[27; 29) "u8" - WHITESPACE@[29; 30) " " - PLUS@[30; 31) "+" - WHITESPACE@[31; 32) " " - TYPE_BOUND@[32; 36) - PATH_TYPE@[32; 36) - PATH@[32; 36) - PATH_SEGMENT@[32; 36) - NAME_REF@[32; 36) - IDENT@[32; 36) "Send" - WHITESPACE@[36; 37) " " - BLOCK_EXPR@[37; 39) - BLOCK@[37; 39) - L_CURLY@[37; 38) "{" - R_CURLY@[38; 39) "}" - WHITESPACE@[39; 40) "\n" +SOURCE_FILE@0..40 + FN_DEF@0..39 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "f" + TYPE_PARAM_LIST@4..7 + L_ANGLE@4..5 "<" + TYPE_PARAM@5..6 + NAME@5..6 + IDENT@5..6 "T" + R_ANGLE@6..7 ">" + PARAM_LIST@7..9 + L_PAREN@7..8 "(" + R_PAREN@8..9 ")" + WHITESPACE@9..10 " " + WHERE_CLAUSE@10..36 + WHERE_KW@10..15 "where" + WHITESPACE@15..16 " " + WHERE_PRED@16..36 + PATH_TYPE@16..17 + PATH@16..17 + PATH_SEGMENT@16..17 + NAME_REF@16..17 + IDENT@16..17 "T" + COLON@17..18 ":" + WHITESPACE@18..19 " " + TYPE_BOUND_LIST@19..36 + TYPE_BOUND@19..29 + PATH_TYPE@19..29 + PATH@19..29 + PATH_SEGMENT@19..29 + NAME_REF@19..21 + IDENT@19..21 "Fn" + PARAM_LIST@21..23 + L_PAREN@21..22 "(" + R_PAREN@22..23 ")" + WHITESPACE@23..24 " " + RET_TYPE@24..29 + THIN_ARROW@24..26 "->" + WHITESPACE@26..27 " " + PATH_TYPE@27..29 + PATH@27..29 + PATH_SEGMENT@27..29 + NAME_REF@27..29 + IDENT@27..29 "u8" + WHITESPACE@29..30 " " + PLUS@30..31 "+" + WHITESPACE@31..32 " " + TYPE_BOUND@32..36 + PATH_TYPE@32..36 + PATH@32..36 + PATH_SEGMENT@32..36 + NAME_REF@32..36 + IDENT@32..36 "Send" + WHITESPACE@36..37 " " + BLOCK_EXPR@37..39 + BLOCK@37..39 + L_CURLY@37..38 "{" + R_CURLY@38..39 "}" + WHITESPACE@39..40 "\n" diff --git a/docs/dev/syntax.md b/docs/dev/syntax.md index e138c656a7..4dd1de6592 100644 --- a/docs/dev/syntax.md +++ b/docs/dev/syntax.md @@ -82,29 +82,29 @@ Points of note: An input like `fn f() { 90 + 2 }` might be parsed as ``` -FN_DEF@[0; 17) - FN_KW@[0; 2) "fn" - WHITESPACE@[2; 3) " " - NAME@[3; 4) - IDENT@[3; 4) "f" - PARAM_LIST@[4; 6) - L_PAREN@[4; 5) "(" - R_PAREN@[5; 6) ")" - WHITESPACE@[6; 7) " " - BLOCK_EXPR@[7; 17) - BLOCK@[7; 17) - L_CURLY@[7; 8) "{" - WHITESPACE@[8; 9) " " - BIN_EXPR@[9; 15) - LITERAL@[9; 11) - INT_NUMBER@[9; 11) "90" - WHITESPACE@[11; 12) " " - PLUS@[12; 13) "+" - WHITESPACE@[13; 14) " " - LITERAL@[14; 15) - INT_NUMBER@[14; 15) "2" - WHITESPACE@[15; 16) " " - R_CURLY@[16; 17) "}" +FN_DEF@0..17 + FN_KW@0..2 "fn" + WHITESPACE@2..3 " " + NAME@3..4 + IDENT@3..4 "f" + PARAM_LIST@4..6 + L_PAREN@4..5 "(" + R_PAREN@5..6 ")" + WHITESPACE@6..7 " " + BLOCK_EXPR@7..17 + BLOCK@7..17 + L_CURLY@7..8 "{" + WHITESPACE@8..9 " " + BIN_EXPR@9..15 + LITERAL@9..11 + INT_NUMBER@9..11 "90" + WHITESPACE@11..12 " " + PLUS@12..13 "+" + WHITESPACE@13..14 " " + LITERAL@14..15 + INT_NUMBER@14..15 "2" + WHITESPACE@15..16 " " + R_CURLY@16..17 "}" ``` #### Optimizations From dc2151085e9b117bc87307bf47edf3d17a170b49 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Apr 2020 00:17:50 +0200 Subject: [PATCH 3/5] Cleanups --- crates/ra_ide/src/syntax_highlighting/html.rs | 13 ++++------ crates/ra_ide_db/src/line_index.rs | 24 ++++++++----------- crates/ra_ide_db/src/search.rs | 3 ++- .../rust-analyzer/src/main_loop/handlers.rs | 2 +- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/crates/ra_ide/src/syntax_highlighting/html.rs b/crates/ra_ide/src/syntax_highlighting/html.rs index 4f17d10402..010db40175 100644 --- a/crates/ra_ide/src/syntax_highlighting/html.rs +++ b/crates/ra_ide/src/syntax_highlighting/html.rs @@ -1,11 +1,9 @@ //! Renders a bit of code as HTML. use ra_db::SourceDatabase; -use ra_syntax::{AstNode, TextSize}; +use ra_syntax::{AstNode, TextRange, TextSize}; -use crate::{FileId, RootDatabase}; - -use super::highlight; +use crate::{syntax_highlighting::highlight, FileId, RootDatabase}; pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: bool) -> String { let parse = db.parse(file_id); @@ -27,14 +25,13 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo let mut buf = String::new(); buf.push_str(&STYLE); buf.push_str("
");
-    // TODO: unusize
     for range in &ranges {
         if range.range.start() > prev_pos {
-            let curr = &text[usize::from(prev_pos)..usize::from(range.range.start())];
+            let curr = &text[TextRange::new(prev_pos, range.range.start())];
             let text = html_escape(curr);
             buf.push_str(&text);
         }
-        let curr = &text[usize::from(range.range.start())..usize::from(range.range.end())];
+        let curr = &text[TextRange::new(range.range.start(), range.range.end())];
 
         let class = range.highlight.to_string().replace('.', " ");
         let color = match (rainbow, range.binding_hash) {
@@ -48,7 +45,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo
         prev_pos = range.range.end();
     }
     // Add the remaining (non-highlighted) text
-    let curr = &text[usize::from(prev_pos)..];
+    let curr = &text[TextRange::new(prev_pos, TextSize::of(&text))];
     let text = html_escape(curr);
     buf.push_str(&text);
     buf.push_str("
"); diff --git a/crates/ra_ide_db/src/line_index.rs b/crates/ra_ide_db/src/line_index.rs index 7794dc9fd7..81eebc7110 100644 --- a/crates/ra_ide_db/src/line_index.rs +++ b/crates/ra_ide_db/src/line_index.rs @@ -1,9 +1,8 @@ //! `LineIndex` maps flat `TextSize` offsets into `(Line, Column)` //! representation. -use std::iter; -// TODO: un TextSize use ra_syntax::{TextRange, TextSize}; use rustc_hash::FxHashMap; +use std::iter; use superslice::Ext; #[derive(Clone, Debug, PartialEq, Eq)] @@ -42,7 +41,8 @@ impl LineIndex { let mut curr_col = 0.into(); let mut line = 0; for c in text.chars() { - curr_row += TextSize::of(c); + let c_len = TextSize::of(c); + curr_row += c_len; if c == '\n' { newlines.push(curr_row); @@ -58,12 +58,11 @@ impl LineIndex { continue; } - let char_len = TextSize::of(c); - if char_len > TextSize::from_usize(1) { - utf16_chars.push(Utf16Char { start: curr_col, end: curr_col + char_len }); + if !c.is_ascii() { + utf16_chars.push(Utf16Char { start: curr_col, end: curr_col + c_len }); } - curr_col += char_len; + curr_col += c_len; } // Save any utf-16 characters seen in the last line @@ -102,22 +101,19 @@ impl LineIndex { } fn utf8_to_utf16_col(&self, line: u32, col: TextSize) -> usize { + let mut res: usize = col.into(); if let Some(utf16_chars) = self.utf16_lines.get(&line) { - let mut correction = 0; for c in utf16_chars { - if col >= c.end { - correction += usize::from(c.len()) - 1; + if c.end <= col { + res -= usize::from(c.len()) - 1; } else { // From here on, all utf16 characters come *after* the character we are mapping, // so we don't need to take them into account break; } } - - usize::from(col) - correction - } else { - usize::from(col) } + res } fn utf16_to_utf8_col(&self, line: u32, col: u32) -> TextSize { diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs index c66de4f422..599b8e5624 100644 --- a/crates/ra_ide_db/src/search.rs +++ b/crates/ra_ide_db/src/search.rs @@ -200,7 +200,8 @@ impl Definition { for (file_id, search_range) in search_scope { let text = db.file_text(file_id); - let search_range = search_range.unwrap_or(TextRange::up_to(TextSize::of(&text))); + let search_range = + search_range.unwrap_or(TextRange::up_to(TextSize::of(text.as_str()))); let sema = Semantics::new(db); let tree = Lazy::new(|| sema.parse(file_id).syntax().clone()); diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index 381f37f169..2303ebfdbc 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs @@ -592,7 +592,7 @@ pub fn handle_formatting( let crate_ids = world.analysis().crate_for(file_id)?; let file_line_index = world.analysis().file_line_index(file_id)?; - let end_position = TextSize::of(&file).conv_with(&file_line_index); + let end_position = TextSize::of(file.as_str()).conv_with(&file_line_index); let mut rustfmt = match &world.config.rustfmt { RustfmtConfig::Rustfmt { extra_args } => { From 63a462f37ca584e1a585a69e30823ce25d4d252f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Apr 2020 00:57:47 +0200 Subject: [PATCH 4/5] Switch to TryFrom --- .../src/handlers/add_custom_impl.rs | 4 ++-- .../ra_assists/src/handlers/add_function.rs | 2 +- crates/ra_assists/src/handlers/add_new.rs | 4 ++-- .../src/handlers/merge_match_arms.rs | 2 +- crates/ra_ide_db/src/line_index.rs | 22 ++++++++--------- crates/ra_ide_db/src/line_index_utils.rs | 11 +++++---- crates/ra_ide_db/src/search.rs | 4 ++-- crates/ra_mbe/src/syntax_bridge.rs | 12 +++++----- crates/ra_syntax/src/ast/tokens.rs | 14 +++++------ crates/ra_syntax/src/fuzz.rs | 11 ++++++--- crates/ra_syntax/src/parsing/lexer.rs | 24 ++++++++++--------- crates/ra_syntax/src/tests.rs | 2 +- crates/ra_syntax/src/validation.rs | 4 +++- 13 files changed, 63 insertions(+), 53 deletions(-) diff --git a/crates/ra_assists/src/handlers/add_custom_impl.rs b/crates/ra_assists/src/handlers/add_custom_impl.rs index 7bb90dba35..4ea26a5508 100644 --- a/crates/ra_assists/src/handlers/add_custom_impl.rs +++ b/crates/ra_assists/src/handlers/add_custom_impl.rs @@ -60,7 +60,6 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option { .collect::>(); let has_more_derives = !new_attr_input.is_empty(); let new_attr_input = new_attr_input.iter().sep_by(", ").surround_with("(", ")").to_string(); - let new_attr_input_len = new_attr_input.len(); let mut buf = String::new(); buf.push_str("\n\nimpl "); @@ -70,8 +69,9 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option { buf.push_str(" {\n"); let cursor_delta = if has_more_derives { + let delta = input.syntax().text_range().len() - TextSize::of(&new_attr_input); edit.replace(input.syntax().text_range(), new_attr_input); - input.syntax().text_range().len() - TextSize::from_usize(new_attr_input_len) + delta } else { let attr_range = attr.syntax().text_range(); edit.delete(attr_range); diff --git a/crates/ra_assists/src/handlers/add_function.rs b/crates/ra_assists/src/handlers/add_function.rs index 7a8f5705f4..6c7456579f 100644 --- a/crates/ra_assists/src/handlers/add_function.rs +++ b/crates/ra_assists/src/handlers/add_function.rs @@ -129,7 +129,7 @@ impl FunctionBuilder { let fn_def = indent_once.increase_indent(fn_def); let fn_def = ast::make::add_trailing_newlines(1, fn_def); let fn_def = indent.increase_indent(fn_def); - (fn_def, it.syntax().text_range().start() + TextSize::from_usize(1)) + (fn_def, it.syntax().text_range().start() + TextSize::of('{')) } }; diff --git a/crates/ra_assists/src/handlers/add_new.rs b/crates/ra_assists/src/handlers/add_new.rs index 0698cce88a..0f9174a299 100644 --- a/crates/ra_assists/src/handlers/add_new.rs +++ b/crates/ra_assists/src/handlers/add_new.rs @@ -77,13 +77,13 @@ pub(crate) fn add_new(ctx: AssistCtx) -> Option { .text_range() .end(); - Some((start, TextSize::from_usize(1))) + Some((start, TextSize::of("\n"))) }) .unwrap_or_else(|| { buf = generate_impl_text(&strukt, &buf); let start = strukt.syntax().text_range().end(); - (start, TextSize::from_usize(3)) + (start, TextSize::of("\n}\n")) }); edit.set_cursor(start_offset + TextSize::of(&buf) - end_offset); diff --git a/crates/ra_assists/src/handlers/merge_match_arms.rs b/crates/ra_assists/src/handlers/merge_match_arms.rs index cd0416f018..5a77d3dbce 100644 --- a/crates/ra_assists/src/handlers/merge_match_arms.rs +++ b/crates/ra_assists/src/handlers/merge_match_arms.rs @@ -89,7 +89,7 @@ pub(crate) fn merge_match_arms(ctx: AssistCtx) -> Option { edit.target(current_text_range); edit.set_cursor(match cursor_pos { - CursorPos::InExpr(back_offset) => start + TextSize::from_usize(arm.len()) - back_offset, + CursorPos::InExpr(back_offset) => start + TextSize::of(&arm) - back_offset, CursorPos::InPat(offset) => offset, }); edit.replace(TextRange::new(start, end), arm); diff --git a/crates/ra_ide_db/src/line_index.rs b/crates/ra_ide_db/src/line_index.rs index 81eebc7110..00ba95913c 100644 --- a/crates/ra_ide_db/src/line_index.rs +++ b/crates/ra_ide_db/src/line_index.rs @@ -1,8 +1,9 @@ //! `LineIndex` maps flat `TextSize` offsets into `(Line, Column)` //! representation. +use std::iter; + use ra_syntax::{TextRange, TextSize}; use rustc_hash::FxHashMap; -use std::iter; use superslice::Ext; #[derive(Clone, Debug, PartialEq, Eq)] @@ -116,12 +117,11 @@ impl LineIndex { res } - fn utf16_to_utf8_col(&self, line: u32, col: u32) -> TextSize { - let mut col: TextSize = col.into(); + fn utf16_to_utf8_col(&self, line: u32, mut col: u32) -> TextSize { if let Some(utf16_chars) = self.utf16_lines.get(&line) { for c in utf16_chars { - if col >= c.start { - col += c.len() - TextSize::from_usize(1); + if col >= u32::from(c.start) { + col += u32::from(c.len()) - 1; } else { // From here on, all utf16 characters come *after* the character we are mapping, // so we don't need to take them into account @@ -130,12 +130,12 @@ impl LineIndex { } } - col + col.into() } } #[cfg(test)] -mod test_line_index { +mod tests { use super::*; #[test] @@ -224,12 +224,12 @@ const C: char = \"メ メ\"; assert!(col_index.utf8_to_utf16_col(2, 15.into()) == 15); // UTF-16 to UTF-8 - assert_eq!(col_index.utf16_to_utf8_col(1, 15), TextSize::from_usize(15)); + assert_eq!(col_index.utf16_to_utf8_col(1, 15), TextSize::from(15)); - assert_eq!(col_index.utf16_to_utf8_col(1, 18), TextSize::from_usize(20)); - assert_eq!(col_index.utf16_to_utf8_col(1, 19), TextSize::from_usize(23)); + assert_eq!(col_index.utf16_to_utf8_col(1, 18), TextSize::from(20)); + assert_eq!(col_index.utf16_to_utf8_col(1, 19), TextSize::from(23)); - assert_eq!(col_index.utf16_to_utf8_col(2, 15), TextSize::from_usize(15)); + assert_eq!(col_index.utf16_to_utf8_col(2, 15), TextSize::from(15)); } #[test] diff --git a/crates/ra_ide_db/src/line_index_utils.rs b/crates/ra_ide_db/src/line_index_utils.rs index f050fe77ff..039a12c0d8 100644 --- a/crates/ra_ide_db/src/line_index_utils.rs +++ b/crates/ra_ide_db/src/line_index_utils.rs @@ -7,6 +7,8 @@ //! Code in this module applies this "to (Line, Column) after edit" //! transformation. +use std::convert::TryInto; + use ra_syntax::{TextRange, TextSize}; use ra_text_edit::{AtomTextEdit, TextEdit}; @@ -139,14 +141,15 @@ impl Iterator for OffsetStepIter<'_> { .text .char_indices() .filter_map(|(i, c)| { + let i: TextSize = i.try_into().unwrap(); + let char_len = TextSize::of(c); if c == '\n' { - let next_offset = self.offset + TextSize::from_usize(i + 1); + let next_offset = self.offset + i + char_len; let next = Step::Newline(next_offset); Some((next, next_offset)) } else { - let char_len = TextSize::of(c); - if char_len > TextSize::from_usize(1) { - let start = self.offset + TextSize::from_usize(i); + if !c.is_ascii() { + let start = self.offset + i; let end = start + char_len; let next = Step::Utf16Char(TextRange::new(start, end)); let next_offset = end; diff --git a/crates/ra_ide_db/src/search.rs b/crates/ra_ide_db/src/search.rs index 599b8e5624..596f957b8c 100644 --- a/crates/ra_ide_db/src/search.rs +++ b/crates/ra_ide_db/src/search.rs @@ -4,7 +4,7 @@ //! get a super-set of matches. Then, we we confirm each match using precise //! name resolution. -use std::mem; +use std::{convert::TryInto, mem}; use hir::{DefWithBody, HasSource, Module, ModuleSource, Semantics, Visibility}; use once_cell::unsync::Lazy; @@ -207,7 +207,7 @@ impl Definition { let tree = Lazy::new(|| sema.parse(file_id).syntax().clone()); for (idx, _) in text.match_indices(pat) { - let offset = TextSize::from_usize(idx); + let offset: TextSize = idx.try_into().unwrap(); if !search_range.contains_inclusive(offset) { tested_by!(search_filters_by_range; force); continue; diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index fa9787266b..bb28acfd95 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs @@ -516,7 +516,7 @@ impl TokenConvertor for Convertor { fn bump(&mut self) -> Option<(Self::Token, TextRange)> { if let Some((punct, offset)) = self.punct_offset.clone() { if usize::from(offset) + 1 < punct.text().len() { - let offset = offset + TextSize::from_usize(1); + let offset = offset + TextSize::of('.'); let range = punct.text_range(); self.punct_offset = Some((punct.clone(), offset)); let range = TextRange::at(range.start() + offset, TextSize::of('.')); @@ -532,9 +532,9 @@ impl TokenConvertor for Convertor { let token = if curr.kind().is_punct() { let range = curr.text_range(); - let range = TextRange::at(range.start(), TextSize::from_usize(1)); - self.punct_offset = Some((curr.clone(), TextSize::from_usize(0))); - (SynToken::Punch(curr, TextSize::from_usize(0)), range) + let range = TextRange::at(range.start(), TextSize::of('.')); + self.punct_offset = Some((curr.clone(), 0.into())); + (SynToken::Punch(curr, 0.into()), range) } else { self.punct_offset = None; let range = curr.text_range(); @@ -546,7 +546,7 @@ impl TokenConvertor for Convertor { fn peek(&self) -> Option { if let Some((punct, mut offset)) = self.punct_offset.clone() { - offset = offset + TextSize::from_usize(1); + offset = offset + TextSize::of('.'); if usize::from(offset) < punct.text().len() { return Some(SynToken::Punch(punct, offset)); } @@ -558,7 +558,7 @@ impl TokenConvertor for Convertor { } let token = if curr.kind().is_punct() { - SynToken::Punch(curr, TextSize::from_usize(0)) + SynToken::Punch(curr, 0.into()) } else { SynToken::Ordiniary(curr) }; diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index 26b8f9c364..8e04b0bbd6 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs @@ -1,5 +1,7 @@ //! There are many AstNodes, but only a few tokens, so we hand-write them here. +use std::convert::{TryFrom, TryInto}; + use crate::{ ast::{AstToken, Comment, RawString, String, Whitespace}, TextRange, TextSize, @@ -95,8 +97,8 @@ impl QuoteOffsets { } let start = TextSize::from(0); - let left_quote = TextSize::from_usize(left_quote) + TextSize::of('"'); - let right_quote = TextSize::from_usize(right_quote); + let left_quote = TextSize::try_from(left_quote).unwrap() + TextSize::of('"'); + let right_quote = TextSize::try_from(right_quote).unwrap(); let end = TextSize::of(literal); let res = QuoteOffsets { @@ -498,7 +500,7 @@ impl HasFormatSpecifier for String { let mut res = Vec::with_capacity(text.len()); rustc_lexer::unescape::unescape_str(text, &mut |range, unescaped_char| { res.push(( - TextRange::new(TextSize::from_usize(range.start), TextSize::from_usize(range.end)) + TextRange::new(range.start.try_into().unwrap(), range.end.try_into().unwrap()) + offset, unescaped_char, )) @@ -518,11 +520,7 @@ impl HasFormatSpecifier for RawString { let mut res = Vec::with_capacity(text.len()); for (idx, c) in text.char_indices() { - res.push(( - TextRange::new(TextSize::from_usize(idx), TextSize::from_usize(idx + c.len_utf8())) - + offset, - Ok(c), - )); + res.push((TextRange::at(idx.try_into().unwrap(), TextSize::of(c)) + offset, Ok(c))); } Some(res) } diff --git a/crates/ra_syntax/src/fuzz.rs b/crates/ra_syntax/src/fuzz.rs index 15aad22056..10fbe31768 100644 --- a/crates/ra_syntax/src/fuzz.rs +++ b/crates/ra_syntax/src/fuzz.rs @@ -1,8 +1,13 @@ //! FIXME: write short doc here -use crate::{validation, AstNode, SourceFile, TextRange, TextSize}; +use std::{ + convert::TryInto, + str::{self, FromStr}, +}; + use ra_text_edit::AtomTextEdit; -use std::str::{self, FromStr}; + +use crate::{validation, AstNode, SourceFile, TextRange}; fn check_file_invariants(file: &SourceFile) { let root = file.syntax(); @@ -35,7 +40,7 @@ impl CheckReparse { let text = format!("{}{}{}", PREFIX, text, SUFFIX); text.get(delete_start..delete_start.checked_add(delete_len)?)?; // make sure delete is a valid range let delete = - TextRange::at(TextSize::from_usize(delete_start), TextSize::from_usize(delete_len)); + TextRange::at(delete_start.try_into().unwrap(), delete_len.try_into().unwrap()); let edited_text = format!("{}{}{}", &text[..delete_start], &insert, &text[delete_start + delete_len..]); let edit = AtomTextEdit { delete, insert }; diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index 1fdc76d986..f450ef4a2c 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs @@ -1,6 +1,8 @@ //! Lexer analyzes raw input string and produces lexemes (tokens). //! It is just a bridge to `rustc_lexer`. +use std::convert::TryInto; + use crate::{ SyntaxError, SyntaxKind::{self, *}, @@ -28,18 +30,19 @@ pub fn tokenize(text: &str) -> (Vec, Vec) { let mut tokens = Vec::new(); let mut errors = Vec::new(); - let mut offset: usize = rustc_lexer::strip_shebang(text) - .map(|shebang_len| { - tokens.push(Token { kind: SHEBANG, len: TextSize::from_usize(shebang_len) }); + let mut offset = match rustc_lexer::strip_shebang(text) { + Some(shebang_len) => { + tokens.push(Token { kind: SHEBANG, len: shebang_len.try_into().unwrap() }); shebang_len - }) - .unwrap_or(0); + } + None => 0, + }; let text_without_shebang = &text[offset..]; for rustc_token in rustc_lexer::tokenize(text_without_shebang) { - let token_len = TextSize::from_usize(rustc_token.len); - let token_range = TextRange::at(TextSize::from_usize(offset), token_len); + let token_len: TextSize = rustc_token.len.try_into().unwrap(); + let token_range = TextRange::at(offset.try_into().unwrap(), token_len); let (syntax_kind, err_message) = rustc_token_kind_to_syntax_kind(&rustc_token.kind, &text[token_range]); @@ -96,10 +99,9 @@ fn lex_first_token(text: &str) -> Option<(Token, Option)> { let rustc_token = rustc_lexer::first_token(text); let (syntax_kind, err_message) = rustc_token_kind_to_syntax_kind(&rustc_token.kind, text); - let token = Token { kind: syntax_kind, len: TextSize::from_usize(rustc_token.len) }; - let optional_error = err_message.map(|err_message| { - SyntaxError::new(err_message, TextRange::new(0.into(), TextSize::of(text))) - }); + let token = Token { kind: syntax_kind, len: rustc_token.len.try_into().unwrap() }; + let optional_error = err_message + .map(|err_message| SyntaxError::new(err_message, TextRange::up_to(TextSize::of(text)))); Some((token, optional_error)) } diff --git a/crates/ra_syntax/src/tests.rs b/crates/ra_syntax/src/tests.rs index 4f2b67febd..aee57db62a 100644 --- a/crates/ra_syntax/src/tests.rs +++ b/crates/ra_syntax/src/tests.rs @@ -121,7 +121,7 @@ fn assert_errors_are_absent(errors: &[SyntaxError], path: &Path) { fn dump_tokens_and_errors(tokens: &[Token], errors: &[SyntaxError], text: &str) -> String { let mut acc = String::new(); - let mut offset = TextSize::from_usize(0); + let mut offset: TextSize = 0.into(); for token in tokens { let token_len = token.len; let token_text = &text[TextRange::at(offset, token.len)]; diff --git a/crates/ra_syntax/src/validation.rs b/crates/ra_syntax/src/validation.rs index 77d7e132d8..5e93895ec5 100644 --- a/crates/ra_syntax/src/validation.rs +++ b/crates/ra_syntax/src/validation.rs @@ -2,6 +2,8 @@ mod block; +use std::convert::TryFrom; + use rustc_lexer::unescape; use crate::{ @@ -112,7 +114,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec) { // FIXME: lift this lambda refactor to `fn` (https://github.com/rust-analyzer/rust-analyzer/pull/2834#discussion_r366199205) let mut push_err = |prefix_len, (off, err): (usize, unescape::EscapeError)| { - let off = token.text_range().start() + TextSize::from_usize(off + prefix_len); + let off = token.text_range().start() + TextSize::try_from(off + prefix_len).unwrap(); acc.push(SyntaxError::new_at_offset(rustc_unescape_error_to_string(err), off)); }; From e87346950039a54c3f0b02d6056cbb92ca38eb28 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Apr 2020 11:52:10 +0200 Subject: [PATCH 5/5] text-size 1.0.0 --- Cargo.lock | 8 ++++++-- .../src/completion/complete_unqualified_path.rs | 12 ++++++------ crates/ra_syntax/Cargo.toml | 2 +- crates/ra_text_edit/Cargo.toml | 2 +- crates/ra_text_edit/src/text_edit.rs | 2 +- crates/test_utils/Cargo.toml | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70dfa019d2..20e6cd5403 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1322,7 +1322,9 @@ dependencies = [ [[package]] name = "rowan" -version = "0.10.0-pre.1" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e081ed6eacce09e243b619ab90f069c27b0cff8a6d0eb8ad2ec935b65853798" dependencies = [ "rustc-hash", "smol_str", @@ -1623,7 +1625,9 @@ dependencies = [ [[package]] name = "text-size" -version = "1.0.0-pre.1" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f03e7efdedc3bc78cb2337f1e2785c39e45f5ef762d9e4ebb137fff7380a6d8a" [[package]] name = "thin-dst" diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index b2af81ae5b..56cd086c68 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs @@ -1333,8 +1333,8 @@ mod tests { [ CompletionItem { label: "f()", - source_range: [98; 99), - delete: [98; 99), + source_range: 98..99, + delete: 98..99, insert: "f()$0", kind: Function, lookup: "f", @@ -1342,15 +1342,15 @@ mod tests { }, CompletionItem { label: "m", - source_range: [98; 99), - delete: [98; 99), + source_range: 98..99, + delete: 98..99, insert: "m", kind: Module, }, CompletionItem { label: "m::E::V", - source_range: [98; 99), - delete: [98; 99), + source_range: 98..99, + delete: 98..99, insert: "m::E::V", kind: EnumVariant, detail: "()", diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index dda396582f..7ffe46c699 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] itertools = "0.9.0" -rowan = { path = "../../../rowan" } +rowan = "0.10.0" rustc_lexer = { version = "652.0.0", package = "rustc-ap-rustc_lexer" } rustc-hash = "1.1.0" arrayvec = "0.5.1" diff --git a/crates/ra_text_edit/Cargo.toml b/crates/ra_text_edit/Cargo.toml index 9b0567c981..46a2ab68f4 100644 --- a/crates/ra_text_edit/Cargo.toml +++ b/crates/ra_text_edit/Cargo.toml @@ -9,4 +9,4 @@ publish = false doctest = false [dependencies] -text-size = { path = "../../../text-size" } +text-size = "1.0.0" diff --git a/crates/ra_text_edit/src/text_edit.rs b/crates/ra_text_edit/src/text_edit.rs index db69a7e7b6..eabab4b4d1 100644 --- a/crates/ra_text_edit/src/text_edit.rs +++ b/crates/ra_text_edit/src/text_edit.rs @@ -1,7 +1,7 @@ //! FIXME: write short doc here use crate::AtomTextEdit; -// TODO: fix Cargo.toml + use text_size::{TextRange, TextSize}; #[derive(Debug, Clone)] diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 652ab45371..8ec986bcb0 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -9,5 +9,5 @@ doctest = false [dependencies] difference = "2.0.0" -text-size = { path = "../../../text-size" } +text-size = "1.0.0" serde_json = "1.0.48"