diff options
| author | randomicon00 <20146907+randomicon00@users.noreply.github.com> | 2024-06-11 08:49:30 -0400 |
|---|---|---|
| committer | randomicon00 <20146907+randomicon00@users.noreply.github.com> | 2024-06-11 08:49:30 -0400 |
| commit | 25004a1018b4a511fde64430a5feeb4eafabd437 (patch) | |
| tree | 5246f440b446d2c1f43debe7d2832b4c82b6328d /src | |
| parent | 6259991f040ad74c5d27e4d834459241f1e20766 (diff) | |
| download | rust-25004a1018b4a511fde64430a5feeb4eafabd437.tar.gz rust-25004a1018b4a511fde64430a5feeb4eafabd437.zip | |
edit: change 'Length' to 'Len'
Diffstat (limited to 'src')
3 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/rust-analyzer/crates/mbe/src/expander/matcher.rs b/src/tools/rust-analyzer/crates/mbe/src/expander/matcher.rs index 78d4bfee2a1..0cec4e70daa 100644 --- a/src/tools/rust-analyzer/crates/mbe/src/expander/matcher.rs +++ b/src/tools/rust-analyzer/crates/mbe/src/expander/matcher.rs @@ -566,7 +566,7 @@ fn match_loop_inner<'t>( error_items.push(item); } OpDelimited::Op( - Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Length { .. }, + Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Len { .. }, ) => { stdx::never!("metavariable expression in lhs found"); } @@ -832,7 +832,7 @@ fn collect_vars(collector_fun: &mut impl FnMut(SmolStr), pattern: &MetaTemplate) Op::Subtree { tokens, .. } => collect_vars(collector_fun, tokens), Op::Repeat { tokens, .. } => collect_vars(collector_fun, tokens), Op::Literal(_) | Op::Ident(_) | Op::Punct(_) => {} - Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Length { .. } => { + Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Len { .. } => { stdx::never!("metavariable expression in lhs found"); } } diff --git a/src/tools/rust-analyzer/crates/mbe/src/expander/transcriber.rs b/src/tools/rust-analyzer/crates/mbe/src/expander/transcriber.rs index 5e6e45f1521..0f689a2692c 100644 --- a/src/tools/rust-analyzer/crates/mbe/src/expander/transcriber.rs +++ b/src/tools/rust-analyzer/crates/mbe/src/expander/transcriber.rs @@ -242,7 +242,7 @@ fn expand_subtree( .into(), ); } - Op::Length { depth } => { + Op::Len { depth } => { let length = ctx.nesting.get(ctx.nesting.len() - 1 - depth).map_or(0, |_nest| { // FIXME: to be implemented 0 diff --git a/src/tools/rust-analyzer/crates/mbe/src/parser.rs b/src/tools/rust-analyzer/crates/mbe/src/parser.rs index eaf2fd8c273..bbe00f0afca 100644 --- a/src/tools/rust-analyzer/crates/mbe/src/parser.rs +++ b/src/tools/rust-analyzer/crates/mbe/src/parser.rs @@ -75,7 +75,7 @@ pub(crate) enum Op { Index { depth: usize, }, - Length { + Len { depth: usize, }, Count { @@ -345,7 +345,7 @@ fn parse_metavar_expr(new_meta_vars: bool, src: &mut TtIter<'_, Span>) -> Result Op::Ignore { name: ident.text.clone(), id: ident.span } } "index" => Op::Index { depth: parse_depth(&mut args)? }, - "length" => Op::Length { depth: parse_depth(&mut args)? }, + "len" => Op::Len { depth: parse_depth(&mut args)? }, "count" => { if new_meta_vars { args.expect_dollar()?; |
