1
Fork 0
This commit is contained in:
Caio 2024-12-01 19:10:44 -03:00
parent 1555074ca9
commit b661e98f09
4 changed files with 46 additions and 17 deletions

View file

@ -696,8 +696,10 @@ fn transcribe_metavar_expr<'a>(
MetaVarExprConcatElem::Var(ident) => {
match matched_from_ident(dcx, *ident, interp)? {
NamedMatch::MatchedSeq(named_matches) => {
let curr_idx = repeats.last().unwrap().0;
match &named_matches[curr_idx] {
let Some((curr_idx, _)) = repeats.last() else {
return Err(dcx.struct_span_err(sp.entire(), "invalid syntax"));
};
match &named_matches[*curr_idx] {
// FIXME(c410-f3r) Nested repetitions are unimplemented
MatchedSeq(_) => unimplemented!(),
MatchedSingle(pnr) => {