Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/mbe/src/benchmark.rs2
-rw-r--r--crates/mbe/src/expander/matcher.rs4
-rw-r--r--crates/mbe/src/expander/transcriber.rs2
-rw-r--r--crates/mbe/src/parser.rs4
4 files changed, 6 insertions, 6 deletions
diff --git a/crates/mbe/src/benchmark.rs b/crates/mbe/src/benchmark.rs
index f73e188c79..19ba5c7a15 100644
--- a/crates/mbe/src/benchmark.rs
+++ b/crates/mbe/src/benchmark.rs
@@ -215,7 +215,7 @@ fn invocation_fixtures(
token_trees.push(subtree.into());
}
- Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Length { .. } => {}
+ Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Len { .. } => {}
};
// Simple linear congruential generator for deterministic result
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs
index 78d4bfee2a..0cec4e70da 100644
--- a/crates/mbe/src/expander/matcher.rs
+++ b/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/crates/mbe/src/expander/transcriber.rs b/crates/mbe/src/expander/transcriber.rs
index 5e6e45f152..0f689a2692 100644
--- a/crates/mbe/src/expander/transcriber.rs
+++ b/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/crates/mbe/src/parser.rs b/crates/mbe/src/parser.rs
index eaf2fd8c27..bbe00f0afc 100644
--- a/crates/mbe/src/parser.rs
+++ b/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()?;