mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-28 04:45:05 +00:00
Merge #9728
9728: fix: Attach comma token to MATCH_ARM instead of MATCH_ARM_LIST r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
0a3ac7a96c
18 changed files with 296 additions and 310 deletions
|
@ -3,11 +3,10 @@ use std::convert::TryFrom;
|
||||||
use ide_assists::utils::extract_trivial_expression;
|
use ide_assists::utils::extract_trivial_expression;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use syntax::{
|
use syntax::{
|
||||||
algo::non_trivia_sibling,
|
|
||||||
ast::{self, AstNode, AstToken, IsString},
|
ast::{self, AstNode, AstToken, IsString},
|
||||||
Direction, NodeOrToken, SourceFile, SyntaxElement,
|
NodeOrToken, SourceFile, SyntaxElement,
|
||||||
SyntaxKind::{self, USE_TREE, WHITESPACE},
|
SyntaxKind::{self, USE_TREE, WHITESPACE},
|
||||||
SyntaxNode, SyntaxToken, TextRange, TextSize, T,
|
SyntaxToken, TextRange, TextSize, T,
|
||||||
};
|
};
|
||||||
|
|
||||||
use text_edit::{TextEdit, TextEditBuilder};
|
use text_edit::{TextEdit, TextEditBuilder};
|
||||||
|
@ -204,13 +203,6 @@ fn remove_newline(
|
||||||
edit.replace(token.text_range(), compute_ws(prev.kind(), next.kind()).to_string());
|
edit.replace(token.text_range(), compute_ws(prev.kind(), next.kind()).to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_comma_after(node: &SyntaxNode) -> bool {
|
|
||||||
match non_trivia_sibling(node.clone().into(), Direction::Next) {
|
|
||||||
Some(n) => n.kind() == T![,],
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> {
|
fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Option<()> {
|
||||||
let block_expr = ast::BlockExpr::cast(token.parent()?)?;
|
let block_expr = ast::BlockExpr::cast(token.parent()?)?;
|
||||||
if !block_expr.is_standalone() {
|
if !block_expr.is_standalone() {
|
||||||
|
@ -223,7 +215,7 @@ fn join_single_expr_block(edit: &mut TextEditBuilder, token: &SyntaxToken) -> Op
|
||||||
|
|
||||||
// Match block needs to have a comma after the block
|
// Match block needs to have a comma after the block
|
||||||
if let Some(match_arm) = block_expr.syntax().parent().and_then(ast::MatchArm::cast) {
|
if let Some(match_arm) = block_expr.syntax().parent().and_then(ast::MatchArm::cast) {
|
||||||
if !has_comma_after(match_arm.syntax()) {
|
if match_arm.comma_token().is_none() {
|
||||||
buf.push(',');
|
buf.push(',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,10 +209,10 @@ fn main() {
|
||||||
match true {
|
match true {
|
||||||
false =>$0 {
|
false =>$0 {
|
||||||
println!("Test");
|
println!("Test");
|
||||||
},
|
}
|
||||||
true => {
|
true => {
|
||||||
println!("Hello, world");
|
println!("Hello, world");
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
"#]],
|
"#]],
|
||||||
|
@ -240,10 +240,10 @@ fn main() {
|
||||||
match true {
|
match true {
|
||||||
false => {
|
false => {
|
||||||
println!("Test");
|
println!("Test");
|
||||||
},
|
}
|
||||||
true =>$0 {
|
true =>$0 {
|
||||||
println!("Hello, world");
|
println!("Hello, world");
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
"#]],
|
"#]],
|
||||||
|
@ -789,7 +789,7 @@ enum FooBar {
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r##"
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
||||||
$0#[derive(Debug)]
|
$0#[derive(Debug)]
|
||||||
|
@ -797,7 +797,7 @@ enum FooBar {
|
||||||
Foo,
|
Foo,
|
||||||
Bar,
|
Bar,
|
||||||
}
|
}
|
||||||
"#]],
|
"##]],
|
||||||
Direction::Down,
|
Direction::Down,
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
|
|
|
@ -72,7 +72,7 @@ pub(crate) fn merge_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option
|
||||||
.join(" | ")
|
.join(" | ")
|
||||||
};
|
};
|
||||||
|
|
||||||
let arm = format!("{} => {}", pats, current_expr.syntax().text());
|
let arm = format!("{} => {},", pats, current_expr.syntax().text());
|
||||||
|
|
||||||
if let [first, .., last] = &*arms_to_merge {
|
if let [first, .., last] = &*arms_to_merge {
|
||||||
let start = first.syntax().text_range().start();
|
let start = first.syntax().text_range().start();
|
||||||
|
@ -118,7 +118,7 @@ enum X { A, B, C }
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = X::A;
|
let x = X::A;
|
||||||
let y = match x {
|
let y = match x {
|
||||||
X::A | X::B => { 1i32 }
|
X::A | X::B => { 1i32 },
|
||||||
X::C => { 2i32 }
|
X::C => { 2i32 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ fn main() {
|
||||||
let x = X::A;
|
let x = X::A;
|
||||||
let y = match x {
|
let y = match x {
|
||||||
X::A => { 1i32 },
|
X::A => { 1i32 },
|
||||||
_ => { 2i32 }
|
_ => { 2i32 },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
|
|
|
@ -64,7 +64,7 @@ fn f() {
|
||||||
match () {
|
match () {
|
||||||
() => (),
|
() => (),
|
||||||
#[cfg(a)] () => (),
|
#[cfg(a)] () => (),
|
||||||
//^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
//^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(a)] 0 // Trailing expression of block
|
#[cfg(a)] 0 // Trailing expression of block
|
||||||
|
|
|
@ -400,20 +400,7 @@ pub(crate) fn match_arm_list(p: &mut Parser) {
|
||||||
error_block(p, "expected match arm");
|
error_block(p, "expected match arm");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
match_arm(p);
|
||||||
// test match_arms_commas
|
|
||||||
// fn foo() {
|
|
||||||
// match () {
|
|
||||||
// _ => (),
|
|
||||||
// _ => {}
|
|
||||||
// _ => ()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if match_arm(p).is_block() {
|
|
||||||
p.eat(T![,]);
|
|
||||||
} else if !p.at(T!['}']) {
|
|
||||||
p.expect(T![,]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
p.expect(T!['}']);
|
p.expect(T!['}']);
|
||||||
m.complete(p, MATCH_ARM_LIST);
|
m.complete(p, MATCH_ARM_LIST);
|
||||||
|
@ -429,7 +416,7 @@ pub(crate) fn match_arm_list(p: &mut Parser) {
|
||||||
// | X => (),
|
// | X => (),
|
||||||
// };
|
// };
|
||||||
// }
|
// }
|
||||||
fn match_arm(p: &mut Parser) -> BlockLike {
|
fn match_arm(p: &mut Parser) {
|
||||||
let m = p.start();
|
let m = p.start();
|
||||||
// test match_arms_outer_attributes
|
// test match_arms_outer_attributes
|
||||||
// fn foo() {
|
// fn foo() {
|
||||||
|
@ -452,8 +439,19 @@ fn match_arm(p: &mut Parser) -> BlockLike {
|
||||||
}
|
}
|
||||||
p.expect(T![=>]);
|
p.expect(T![=>]);
|
||||||
let blocklike = expr_stmt(p).1;
|
let blocklike = expr_stmt(p).1;
|
||||||
|
|
||||||
|
// test match_arms_commas
|
||||||
|
// fn foo() {
|
||||||
|
// match () {
|
||||||
|
// _ => (),
|
||||||
|
// _ => {}
|
||||||
|
// _ => ()
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
if !p.eat(T![,]) && !blocklike.is_block() && !p.at(T!['}']) {
|
||||||
|
p.error("expected `,`");
|
||||||
|
}
|
||||||
m.complete(p, MATCH_ARM);
|
m.complete(p, MATCH_ARM);
|
||||||
blocklike
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// test match_guard
|
// test match_guard
|
||||||
|
|
|
@ -359,14 +359,10 @@ impl ast::MatchArmList {
|
||||||
let mut elements = Vec::new();
|
let mut elements = Vec::new();
|
||||||
let position = match self.arms().last() {
|
let position = match self.arms().last() {
|
||||||
Some(last_arm) => {
|
Some(last_arm) => {
|
||||||
let comma = last_arm
|
if needs_comma(&last_arm) {
|
||||||
.syntax()
|
ted::append_child(last_arm.syntax(), make::token(SyntaxKind::COMMA));
|
||||||
.siblings_with_tokens(Direction::Next)
|
|
||||||
.find(|it| it.kind() == T![,]);
|
|
||||||
if needs_comma(&last_arm) && comma.is_none() {
|
|
||||||
elements.push(make::token(SyntaxKind::COMMA).into());
|
|
||||||
}
|
}
|
||||||
Position::after(comma.unwrap_or_else(|| last_arm.syntax().clone().into()))
|
Position::after(last_arm.syntax().clone())
|
||||||
}
|
}
|
||||||
None => match self.l_curly_token() {
|
None => match self.l_curly_token() {
|
||||||
Some(it) => Position::after(it),
|
Some(it) => Position::after(it),
|
||||||
|
@ -377,12 +373,12 @@ impl ast::MatchArmList {
|
||||||
elements.push(make::tokens::whitespace(&format!("\n{}", indent)).into());
|
elements.push(make::tokens::whitespace(&format!("\n{}", indent)).into());
|
||||||
elements.push(arm.syntax().clone().into());
|
elements.push(arm.syntax().clone().into());
|
||||||
if needs_comma(&arm) {
|
if needs_comma(&arm) {
|
||||||
elements.push(make::token(SyntaxKind::COMMA).into());
|
ted::append_child(arm.syntax(), make::token(SyntaxKind::COMMA));
|
||||||
}
|
}
|
||||||
ted::insert_all(position, elements);
|
ted::insert_all(position, elements);
|
||||||
|
|
||||||
fn needs_comma(arm: &ast::MatchArm) -> bool {
|
fn needs_comma(arm: &ast::MatchArm) -> bool {
|
||||||
arm.expr().map_or(false, |e| !e.is_block_like())
|
arm.expr().map_or(false, |e| !e.is_block_like()) && arm.comma_token().is_none()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ SOURCE_FILE@0..293
|
||||||
MATCH_ARM_LIST@24..101
|
MATCH_ARM_LIST@24..101
|
||||||
L_CURLY@24..25 "{"
|
L_CURLY@24..25 "{"
|
||||||
WHITESPACE@25..34 "\n "
|
WHITESPACE@25..34 "\n "
|
||||||
MATCH_ARM@34..41
|
MATCH_ARM@34..42
|
||||||
WILDCARD_PAT@34..35
|
WILDCARD_PAT@34..35
|
||||||
UNDERSCORE@34..35 "_"
|
UNDERSCORE@34..35 "_"
|
||||||
WHITESPACE@35..36 " "
|
WHITESPACE@35..36 " "
|
||||||
|
@ -53,7 +53,7 @@ SOURCE_FILE@0..293
|
||||||
R_PAREN@76..77 ")"
|
R_PAREN@76..77 ")"
|
||||||
R_BRACK@77..78 "]"
|
R_BRACK@77..78 "]"
|
||||||
WHITESPACE@78..87 "\n "
|
WHITESPACE@78..87 "\n "
|
||||||
MATCH_ARM@87..94
|
MATCH_ARM@87..95
|
||||||
WILDCARD_PAT@87..88
|
WILDCARD_PAT@87..88
|
||||||
UNDERSCORE@87..88 "_"
|
UNDERSCORE@87..88 "_"
|
||||||
WHITESPACE@88..89 " "
|
WHITESPACE@88..89 " "
|
||||||
|
@ -77,7 +77,7 @@ SOURCE_FILE@0..293
|
||||||
MATCH_ARM_LIST@116..185
|
MATCH_ARM_LIST@116..185
|
||||||
L_CURLY@116..117 "{"
|
L_CURLY@116..117 "{"
|
||||||
WHITESPACE@117..126 "\n "
|
WHITESPACE@117..126 "\n "
|
||||||
MATCH_ARM@126..133
|
MATCH_ARM@126..134
|
||||||
WILDCARD_PAT@126..127
|
WILDCARD_PAT@126..127
|
||||||
UNDERSCORE@126..127 "_"
|
UNDERSCORE@126..127 "_"
|
||||||
WHITESPACE@127..128 " "
|
WHITESPACE@127..128 " "
|
||||||
|
@ -88,7 +88,7 @@ SOURCE_FILE@0..293
|
||||||
R_PAREN@132..133 ")"
|
R_PAREN@132..133 ")"
|
||||||
COMMA@133..134 ","
|
COMMA@133..134 ","
|
||||||
WHITESPACE@134..143 "\n "
|
WHITESPACE@134..143 "\n "
|
||||||
MATCH_ARM@143..150
|
MATCH_ARM@143..151
|
||||||
WILDCARD_PAT@143..144
|
WILDCARD_PAT@143..144
|
||||||
UNDERSCORE@143..144 "_"
|
UNDERSCORE@143..144 "_"
|
||||||
WHITESPACE@144..145 " "
|
WHITESPACE@144..145 " "
|
||||||
|
@ -165,7 +165,7 @@ SOURCE_FILE@0..293
|
||||||
R_PAREN@248..249 ")"
|
R_PAREN@248..249 ")"
|
||||||
R_BRACK@249..250 "]"
|
R_BRACK@249..250 "]"
|
||||||
WHITESPACE@250..259 "\n "
|
WHITESPACE@250..259 "\n "
|
||||||
MATCH_ARM@259..266
|
MATCH_ARM@259..267
|
||||||
WILDCARD_PAT@259..260
|
WILDCARD_PAT@259..260
|
||||||
UNDERSCORE@259..260 "_"
|
UNDERSCORE@259..260 "_"
|
||||||
WHITESPACE@260..261 " "
|
WHITESPACE@260..261 " "
|
||||||
|
@ -176,7 +176,7 @@ SOURCE_FILE@0..293
|
||||||
R_PAREN@265..266 ")"
|
R_PAREN@265..266 ")"
|
||||||
COMMA@266..267 ","
|
COMMA@266..267 ","
|
||||||
WHITESPACE@267..276 "\n "
|
WHITESPACE@267..276 "\n "
|
||||||
MATCH_ARM@276..283
|
MATCH_ARM@276..284
|
||||||
WILDCARD_PAT@276..277
|
WILDCARD_PAT@276..277
|
||||||
UNDERSCORE@276..277 "_"
|
UNDERSCORE@276..277 "_"
|
||||||
WHITESPACE@277..278 " "
|
WHITESPACE@277..278 " "
|
||||||
|
@ -194,11 +194,11 @@ SOURCE_FILE@0..293
|
||||||
error 52..52: expected `[`
|
error 52..52: expected `[`
|
||||||
error 52..52: expected pattern
|
error 52..52: expected pattern
|
||||||
error 53..53: expected FAT_ARROW
|
error 53..53: expected FAT_ARROW
|
||||||
error 78..78: expected COMMA
|
error 78..78: expected `,`
|
||||||
error 161..161: expected `[`
|
error 161..161: expected `[`
|
||||||
error 161..161: expected pattern
|
error 161..161: expected pattern
|
||||||
error 162..162: expected FAT_ARROW
|
error 162..162: expected FAT_ARROW
|
||||||
error 232..232: expected `[`
|
error 232..232: expected `[`
|
||||||
error 232..232: expected pattern
|
error 232..232: expected pattern
|
||||||
error 233..233: expected FAT_ARROW
|
error 233..233: expected FAT_ARROW
|
||||||
error 250..250: expected COMMA
|
error 250..250: expected `,`
|
||||||
|
|
|
@ -21,7 +21,7 @@ SOURCE_FILE@0..89
|
||||||
MATCH_ARM_LIST@24..86
|
MATCH_ARM_LIST@24..86
|
||||||
L_CURLY@24..25 "{"
|
L_CURLY@24..25 "{"
|
||||||
WHITESPACE@25..34 "\n "
|
WHITESPACE@25..34 "\n "
|
||||||
MATCH_ARM@34..41
|
MATCH_ARM@34..42
|
||||||
WILDCARD_PAT@34..35
|
WILDCARD_PAT@34..35
|
||||||
UNDERSCORE@34..35 "_"
|
UNDERSCORE@34..35 "_"
|
||||||
WHITESPACE@35..36 " "
|
WHITESPACE@35..36 " "
|
||||||
|
@ -32,7 +32,7 @@ SOURCE_FILE@0..89
|
||||||
R_PAREN@40..41 ")"
|
R_PAREN@40..41 ")"
|
||||||
COMMA@41..42 ","
|
COMMA@41..42 ","
|
||||||
WHITESPACE@42..51 "\n "
|
WHITESPACE@42..51 "\n "
|
||||||
MATCH_ARM@51..58
|
MATCH_ARM@51..59
|
||||||
WILDCARD_PAT@51..52
|
WILDCARD_PAT@51..52
|
||||||
UNDERSCORE@51..52 "_"
|
UNDERSCORE@51..52 "_"
|
||||||
WHITESPACE@52..53 " "
|
WHITESPACE@52..53 " "
|
||||||
|
|
|
@ -21,7 +21,7 @@ SOURCE_FILE@0..113
|
||||||
MATCH_ARM_LIST@25..110
|
MATCH_ARM_LIST@25..110
|
||||||
L_CURLY@25..26 "{"
|
L_CURLY@25..26 "{"
|
||||||
WHITESPACE@26..35 "\n "
|
WHITESPACE@26..35 "\n "
|
||||||
MATCH_ARM@35..43
|
MATCH_ARM@35..44
|
||||||
LITERAL_PAT@35..37
|
LITERAL_PAT@35..37
|
||||||
MINUS@35..36 "-"
|
MINUS@35..36 "-"
|
||||||
LITERAL@36..37
|
LITERAL@36..37
|
||||||
|
@ -34,7 +34,7 @@ SOURCE_FILE@0..113
|
||||||
R_PAREN@42..43 ")"
|
R_PAREN@42..43 ")"
|
||||||
COMMA@43..44 ","
|
COMMA@43..44 ","
|
||||||
WHITESPACE@44..53 "\n "
|
WHITESPACE@44..53 "\n "
|
||||||
MATCH_ARM@53..61
|
MATCH_ARM@53..62
|
||||||
LITERAL_PAT@53..55
|
LITERAL_PAT@53..55
|
||||||
LITERAL@53..55
|
LITERAL@53..55
|
||||||
INT_NUMBER@53..55 "92"
|
INT_NUMBER@53..55 "92"
|
||||||
|
@ -46,7 +46,7 @@ SOURCE_FILE@0..113
|
||||||
R_PAREN@60..61 ")"
|
R_PAREN@60..61 ")"
|
||||||
COMMA@61..62 ","
|
COMMA@61..62 ","
|
||||||
WHITESPACE@62..71 "\n "
|
WHITESPACE@62..71 "\n "
|
||||||
MATCH_ARM@71..80
|
MATCH_ARM@71..81
|
||||||
LITERAL_PAT@71..74
|
LITERAL_PAT@71..74
|
||||||
LITERAL@71..74
|
LITERAL@71..74
|
||||||
CHAR@71..74 "'c'"
|
CHAR@71..74 "'c'"
|
||||||
|
@ -58,7 +58,7 @@ SOURCE_FILE@0..113
|
||||||
R_PAREN@79..80 ")"
|
R_PAREN@79..80 ")"
|
||||||
COMMA@80..81 ","
|
COMMA@80..81 ","
|
||||||
WHITESPACE@81..90 "\n "
|
WHITESPACE@81..90 "\n "
|
||||||
MATCH_ARM@90..103
|
MATCH_ARM@90..104
|
||||||
LITERAL_PAT@90..97
|
LITERAL_PAT@90..97
|
||||||
LITERAL@90..97
|
LITERAL@90..97
|
||||||
STRING@90..97 "\"hello\""
|
STRING@90..97 "\"hello\""
|
||||||
|
|
|
@ -20,7 +20,7 @@ SOURCE_FILE@0..112
|
||||||
MATCH_ARM_LIST@25..109
|
MATCH_ARM_LIST@25..109
|
||||||
L_CURLY@25..26 "{"
|
L_CURLY@25..26 "{"
|
||||||
WHITESPACE@26..35 "\n "
|
WHITESPACE@26..35 "\n "
|
||||||
MATCH_ARM@35..50
|
MATCH_ARM@35..51
|
||||||
RANGE_PAT@35..44
|
RANGE_PAT@35..44
|
||||||
LITERAL_PAT@35..36
|
LITERAL_PAT@35..36
|
||||||
LITERAL@35..36
|
LITERAL@35..36
|
||||||
|
@ -39,7 +39,7 @@ SOURCE_FILE@0..112
|
||||||
R_PAREN@49..50 ")"
|
R_PAREN@49..50 ")"
|
||||||
COMMA@50..51 ","
|
COMMA@50..51 ","
|
||||||
WHITESPACE@51..60 "\n "
|
WHITESPACE@51..60 "\n "
|
||||||
MATCH_ARM@60..77
|
MATCH_ARM@60..78
|
||||||
RANGE_PAT@60..71
|
RANGE_PAT@60..71
|
||||||
LITERAL_PAT@60..63
|
LITERAL_PAT@60..63
|
||||||
LITERAL@60..63
|
LITERAL@60..63
|
||||||
|
@ -58,7 +58,7 @@ SOURCE_FILE@0..112
|
||||||
R_PAREN@76..77 ")"
|
R_PAREN@76..77 ")"
|
||||||
COMMA@77..78 ","
|
COMMA@77..78 ","
|
||||||
WHITESPACE@78..87 "\n "
|
WHITESPACE@78..87 "\n "
|
||||||
MATCH_ARM@87..102
|
MATCH_ARM@87..103
|
||||||
RANGE_PAT@87..97
|
RANGE_PAT@87..97
|
||||||
LITERAL_PAT@87..90
|
LITERAL_PAT@87..90
|
||||||
LITERAL@87..90
|
LITERAL@87..90
|
||||||
|
|
|
@ -21,7 +21,7 @@ SOURCE_FILE@0..83
|
||||||
MATCH_ARM_LIST@24..80
|
MATCH_ARM_LIST@24..80
|
||||||
L_CURLY@24..25 "{"
|
L_CURLY@24..25 "{"
|
||||||
WHITESPACE@25..34 "\n "
|
WHITESPACE@25..34 "\n "
|
||||||
MATCH_ARM@34..41
|
MATCH_ARM@34..42
|
||||||
WILDCARD_PAT@34..35
|
WILDCARD_PAT@34..35
|
||||||
UNDERSCORE@34..35 "_"
|
UNDERSCORE@34..35 "_"
|
||||||
WHITESPACE@35..36 " "
|
WHITESPACE@35..36 " "
|
||||||
|
|
|
@ -22,7 +22,7 @@ SOURCE_FILE@0..167
|
||||||
MATCH_ARM_LIST@24..163
|
MATCH_ARM_LIST@24..163
|
||||||
L_CURLY@24..25 "{"
|
L_CURLY@24..25 "{"
|
||||||
WHITESPACE@25..34 "\n "
|
WHITESPACE@25..34 "\n "
|
||||||
MATCH_ARM@34..41
|
MATCH_ARM@34..42
|
||||||
WILDCARD_PAT@34..35
|
WILDCARD_PAT@34..35
|
||||||
UNDERSCORE@34..35 "_"
|
UNDERSCORE@34..35 "_"
|
||||||
WHITESPACE@35..36 " "
|
WHITESPACE@35..36 " "
|
||||||
|
@ -33,7 +33,7 @@ SOURCE_FILE@0..167
|
||||||
R_PAREN@40..41 ")"
|
R_PAREN@40..41 ")"
|
||||||
COMMA@41..42 ","
|
COMMA@41..42 ","
|
||||||
WHITESPACE@42..51 "\n "
|
WHITESPACE@42..51 "\n "
|
||||||
MATCH_ARM@51..83
|
MATCH_ARM@51..84
|
||||||
WILDCARD_PAT@51..52
|
WILDCARD_PAT@51..52
|
||||||
UNDERSCORE@51..52 "_"
|
UNDERSCORE@51..52 "_"
|
||||||
WHITESPACE@52..53 " "
|
WHITESPACE@52..53 " "
|
||||||
|
@ -72,7 +72,7 @@ SOURCE_FILE@0..167
|
||||||
R_PAREN@82..83 ")"
|
R_PAREN@82..83 ")"
|
||||||
COMMA@83..84 ","
|
COMMA@83..84 ","
|
||||||
WHITESPACE@84..93 "\n "
|
WHITESPACE@84..93 "\n "
|
||||||
MATCH_ARM@93..109
|
MATCH_ARM@93..110
|
||||||
OR_PAT@93..98
|
OR_PAT@93..98
|
||||||
IDENT_PAT@93..94
|
IDENT_PAT@93..94
|
||||||
NAME@93..94
|
NAME@93..94
|
||||||
|
@ -100,7 +100,7 @@ SOURCE_FILE@0..167
|
||||||
R_PAREN@108..109 ")"
|
R_PAREN@108..109 ")"
|
||||||
COMMA@109..110 ","
|
COMMA@109..110 ","
|
||||||
WHITESPACE@110..119 "\n "
|
WHITESPACE@110..119 "\n "
|
||||||
MATCH_ARM@119..137
|
MATCH_ARM@119..138
|
||||||
PIPE@119..120 "|"
|
PIPE@119..120 "|"
|
||||||
WHITESPACE@120..121 " "
|
WHITESPACE@120..121 " "
|
||||||
OR_PAT@121..126
|
OR_PAT@121..126
|
||||||
|
@ -130,7 +130,7 @@ SOURCE_FILE@0..167
|
||||||
R_PAREN@136..137 ")"
|
R_PAREN@136..137 ")"
|
||||||
COMMA@137..138 ","
|
COMMA@137..138 ","
|
||||||
WHITESPACE@138..147 "\n "
|
WHITESPACE@138..147 "\n "
|
||||||
MATCH_ARM@147..156
|
MATCH_ARM@147..157
|
||||||
PIPE@147..148 "|"
|
PIPE@147..148 "|"
|
||||||
WHITESPACE@148..149 " "
|
WHITESPACE@148..149 " "
|
||||||
IDENT_PAT@149..150
|
IDENT_PAT@149..150
|
||||||
|
|
|
@ -21,7 +21,7 @@ SOURCE_FILE@0..58
|
||||||
MATCH_ARM_LIST@24..55
|
MATCH_ARM_LIST@24..55
|
||||||
L_CURLY@24..25 "{"
|
L_CURLY@24..25 "{"
|
||||||
WHITESPACE@25..34 "\n "
|
WHITESPACE@25..34 "\n "
|
||||||
MATCH_ARM@34..48
|
MATCH_ARM@34..49
|
||||||
WILDCARD_PAT@34..35
|
WILDCARD_PAT@34..35
|
||||||
UNDERSCORE@34..35 "_"
|
UNDERSCORE@34..35 "_"
|
||||||
WHITESPACE@35..36 " "
|
WHITESPACE@35..36 " "
|
||||||
|
|
|
@ -66,7 +66,7 @@ SOURCE_FILE@0..139
|
||||||
R_PAREN@111..112 ")"
|
R_PAREN@111..112 ")"
|
||||||
R_BRACK@112..113 "]"
|
R_BRACK@112..113 "]"
|
||||||
WHITESPACE@113..122 "\n "
|
WHITESPACE@113..122 "\n "
|
||||||
MATCH_ARM@122..129
|
MATCH_ARM@122..130
|
||||||
WILDCARD_PAT@122..123
|
WILDCARD_PAT@122..123
|
||||||
UNDERSCORE@122..123 "_"
|
UNDERSCORE@122..123 "_"
|
||||||
WHITESPACE@123..124 " "
|
WHITESPACE@123..124 " "
|
||||||
|
|
|
@ -21,7 +21,7 @@ SOURCE_FILE@0..259
|
||||||
MATCH_ARM_LIST@24..256
|
MATCH_ARM_LIST@24..256
|
||||||
L_CURLY@24..25 "{"
|
L_CURLY@24..25 "{"
|
||||||
WHITESPACE@25..34 "\n "
|
WHITESPACE@25..34 "\n "
|
||||||
MATCH_ARM@34..74
|
MATCH_ARM@34..75
|
||||||
ATTR@34..58
|
ATTR@34..58
|
||||||
POUND@34..35 "#"
|
POUND@34..35 "#"
|
||||||
L_BRACK@35..36 "["
|
L_BRACK@35..36 "["
|
||||||
|
@ -50,7 +50,7 @@ SOURCE_FILE@0..259
|
||||||
R_PAREN@73..74 ")"
|
R_PAREN@73..74 ")"
|
||||||
COMMA@74..75 ","
|
COMMA@74..75 ","
|
||||||
WHITESPACE@75..84 "\n "
|
WHITESPACE@75..84 "\n "
|
||||||
MATCH_ARM@84..125
|
MATCH_ARM@84..126
|
||||||
ATTR@84..109
|
ATTR@84..109
|
||||||
POUND@84..85 "#"
|
POUND@84..85 "#"
|
||||||
L_BRACK@85..86 "["
|
L_BRACK@85..86 "["
|
||||||
|
@ -79,7 +79,7 @@ SOURCE_FILE@0..259
|
||||||
R_PAREN@124..125 ")"
|
R_PAREN@124..125 ")"
|
||||||
COMMA@125..126 ","
|
COMMA@125..126 ","
|
||||||
WHITESPACE@126..135 "\n "
|
WHITESPACE@126..135 "\n "
|
||||||
MATCH_ARM@135..249
|
MATCH_ARM@135..250
|
||||||
ATTR@135..159
|
ATTR@135..159
|
||||||
POUND@135..136 "#"
|
POUND@135..136 "#"
|
||||||
L_BRACK@136..137 "["
|
L_BRACK@136..137 "["
|
||||||
|
|
|
@ -21,7 +21,7 @@ SOURCE_FILE@0..130
|
||||||
MATCH_ARM_LIST@25..127
|
MATCH_ARM_LIST@25..127
|
||||||
L_CURLY@25..26 "{"
|
L_CURLY@25..26 "{"
|
||||||
WHITESPACE@26..35 "\n "
|
WHITESPACE@26..35 "\n "
|
||||||
MATCH_ARM@35..48
|
MATCH_ARM@35..49
|
||||||
PAREN_PAT@35..42
|
PAREN_PAT@35..42
|
||||||
L_PAREN@35..36 "("
|
L_PAREN@35..36 "("
|
||||||
OR_PAT@36..41
|
OR_PAT@36..41
|
||||||
|
@ -41,7 +41,7 @@ SOURCE_FILE@0..130
|
||||||
R_PAREN@47..48 ")"
|
R_PAREN@47..48 ")"
|
||||||
COMMA@48..49 ","
|
COMMA@48..49 ","
|
||||||
WHITESPACE@49..58 "\n "
|
WHITESPACE@49..58 "\n "
|
||||||
MATCH_ARM@58..72
|
MATCH_ARM@58..73
|
||||||
REF_PAT@58..66
|
REF_PAT@58..66
|
||||||
AMP@58..59 "&"
|
AMP@58..59 "&"
|
||||||
PAREN_PAT@59..66
|
PAREN_PAT@59..66
|
||||||
|
@ -63,7 +63,7 @@ SOURCE_FILE@0..130
|
||||||
R_PAREN@71..72 ")"
|
R_PAREN@71..72 ")"
|
||||||
COMMA@72..73 ","
|
COMMA@72..73 ","
|
||||||
WHITESPACE@73..82 "\n "
|
WHITESPACE@73..82 "\n "
|
||||||
MATCH_ARM@82..96
|
MATCH_ARM@82..97
|
||||||
TUPLE_PAT@82..90
|
TUPLE_PAT@82..90
|
||||||
L_PAREN@82..83 "("
|
L_PAREN@82..83 "("
|
||||||
OR_PAT@83..88
|
OR_PAT@83..88
|
||||||
|
@ -84,7 +84,7 @@ SOURCE_FILE@0..130
|
||||||
R_PAREN@95..96 ")"
|
R_PAREN@95..96 ")"
|
||||||
COMMA@96..97 ","
|
COMMA@96..97 ","
|
||||||
WHITESPACE@97..106 "\n "
|
WHITESPACE@97..106 "\n "
|
||||||
MATCH_ARM@106..120
|
MATCH_ARM@106..121
|
||||||
SLICE_PAT@106..114
|
SLICE_PAT@106..114
|
||||||
L_BRACK@106..107 "["
|
L_BRACK@106..107 "["
|
||||||
OR_PAT@107..112
|
OR_PAT@107..112
|
||||||
|
|
|
@ -1093,7 +1093,7 @@ SOURCE_FILE@0..3813
|
||||||
MATCH_ARM_LIST@1853..1885
|
MATCH_ARM_LIST@1853..1885
|
||||||
L_CURLY@1853..1854 "{"
|
L_CURLY@1853..1854 "{"
|
||||||
WHITESPACE@1854..1855 " "
|
WHITESPACE@1854..1855 " "
|
||||||
MATCH_ARM@1855..1863
|
MATCH_ARM@1855..1864
|
||||||
LITERAL_PAT@1855..1856
|
LITERAL_PAT@1855..1856
|
||||||
LITERAL@1855..1856
|
LITERAL@1855..1856
|
||||||
INT_NUMBER@1855..1856 "1"
|
INT_NUMBER@1855..1856 "1"
|
||||||
|
|
|
@ -34,7 +34,7 @@ SOURCE_FILE@0..395
|
||||||
MATCH_ARM_LIST@93..141
|
MATCH_ARM_LIST@93..141
|
||||||
L_CURLY@93..94 "{"
|
L_CURLY@93..94 "{"
|
||||||
WHITESPACE@94..103 "\n "
|
WHITESPACE@94..103 "\n "
|
||||||
MATCH_ARM@103..117
|
MATCH_ARM@103..118
|
||||||
TUPLE_STRUCT_PAT@103..111
|
TUPLE_STRUCT_PAT@103..111
|
||||||
PATH@103..107
|
PATH@103..107
|
||||||
PATH_SEGMENT@103..107
|
PATH_SEGMENT@103..107
|
||||||
|
@ -54,7 +54,7 @@ SOURCE_FILE@0..395
|
||||||
R_PAREN@116..117 ")"
|
R_PAREN@116..117 ")"
|
||||||
COMMA@117..118 ","
|
COMMA@117..118 ","
|
||||||
WHITESPACE@118..127 "\n "
|
WHITESPACE@118..127 "\n "
|
||||||
MATCH_ARM@127..134
|
MATCH_ARM@127..135
|
||||||
WILDCARD_PAT@127..128
|
WILDCARD_PAT@127..128
|
||||||
UNDERSCORE@127..128 "_"
|
UNDERSCORE@127..128 "_"
|
||||||
WHITESPACE@128..129 " "
|
WHITESPACE@128..129 " "
|
||||||
|
@ -97,7 +97,7 @@ SOURCE_FILE@0..395
|
||||||
MATCH_ARM_LIST@168..222
|
MATCH_ARM_LIST@168..222
|
||||||
L_CURLY@168..169 "{"
|
L_CURLY@168..169 "{"
|
||||||
WHITESPACE@169..178 "\n "
|
WHITESPACE@169..178 "\n "
|
||||||
MATCH_ARM@178..198
|
MATCH_ARM@178..199
|
||||||
TUPLE_STRUCT_PAT@178..192
|
TUPLE_STRUCT_PAT@178..192
|
||||||
PATH@178..182
|
PATH@178..182
|
||||||
PATH_SEGMENT@178..182
|
PATH_SEGMENT@178..182
|
||||||
|
@ -126,7 +126,7 @@ SOURCE_FILE@0..395
|
||||||
R_PAREN@197..198 ")"
|
R_PAREN@197..198 ")"
|
||||||
COMMA@198..199 ","
|
COMMA@198..199 ","
|
||||||
WHITESPACE@199..208 "\n "
|
WHITESPACE@199..208 "\n "
|
||||||
MATCH_ARM@208..215
|
MATCH_ARM@208..216
|
||||||
WILDCARD_PAT@208..209
|
WILDCARD_PAT@208..209
|
||||||
UNDERSCORE@208..209 "_"
|
UNDERSCORE@208..209 "_"
|
||||||
WHITESPACE@209..210 " "
|
WHITESPACE@209..210 " "
|
||||||
|
@ -171,7 +171,7 @@ SOURCE_FILE@0..395
|
||||||
MATCH_ARM_LIST@247..299
|
MATCH_ARM_LIST@247..299
|
||||||
L_CURLY@247..248 "{"
|
L_CURLY@247..248 "{"
|
||||||
WHITESPACE@248..257 "\n "
|
WHITESPACE@248..257 "\n "
|
||||||
MATCH_ARM@257..275
|
MATCH_ARM@257..276
|
||||||
TUPLE_STRUCT_PAT@257..269
|
TUPLE_STRUCT_PAT@257..269
|
||||||
PATH@257..261
|
PATH@257..261
|
||||||
PATH@257..258
|
PATH@257..258
|
||||||
|
@ -202,7 +202,7 @@ SOURCE_FILE@0..395
|
||||||
R_PAREN@274..275 ")"
|
R_PAREN@274..275 ")"
|
||||||
COMMA@275..276 ","
|
COMMA@275..276 ","
|
||||||
WHITESPACE@276..285 "\n "
|
WHITESPACE@276..285 "\n "
|
||||||
MATCH_ARM@285..292
|
MATCH_ARM@285..293
|
||||||
WILDCARD_PAT@285..286
|
WILDCARD_PAT@285..286
|
||||||
UNDERSCORE@285..286 "_"
|
UNDERSCORE@285..286 "_"
|
||||||
WHITESPACE@286..287 " "
|
WHITESPACE@286..287 " "
|
||||||
|
|
Loading…
Reference in a new issue