@@ -23,7 +23,7 @@ pub(crate) enum MetaVarExpr {
23
23
24
24
/// The length of the repetition at a particular depth, where 0 is the inner-most
25
25
/// repetition. The `usize` is the depth.
26
- Length ( usize ) ,
26
+ Len ( usize ) ,
27
27
}
28
28
29
29
impl MetaVarExpr {
@@ -48,13 +48,13 @@ impl MetaVarExpr {
48
48
MetaVarExpr :: Ignore ( parse_ident ( & mut iter, psess, ident. span ) ?)
49
49
}
50
50
"index" => MetaVarExpr :: Index ( parse_depth ( & mut iter, psess, ident. span ) ?) ,
51
- "length " => MetaVarExpr :: Length ( parse_depth ( & mut iter, psess, ident. span ) ?) ,
51
+ "len " => MetaVarExpr :: Len ( parse_depth ( & mut iter, psess, ident. span ) ?) ,
52
52
_ => {
53
53
let err_msg = "unrecognized meta-variable expression" ;
54
54
let mut err = psess. dcx . struct_span_err ( ident. span , err_msg) ;
55
55
err. span_suggestion (
56
56
ident. span ,
57
- "supported expressions are count, ignore, index and length " ,
57
+ "supported expressions are count, ignore, index and len " ,
58
58
"" ,
59
59
Applicability :: MachineApplicable ,
60
60
) ;
@@ -68,7 +68,7 @@ impl MetaVarExpr {
68
68
pub ( crate ) fn ident ( & self ) -> Option < Ident > {
69
69
match * self {
70
70
MetaVarExpr :: Count ( ident, _) | MetaVarExpr :: Ignore ( ident) => Some ( ident) ,
71
- MetaVarExpr :: Index ( ..) | MetaVarExpr :: Length ( ..) => None ,
71
+ MetaVarExpr :: Index ( ..) | MetaVarExpr :: Len ( ..) => None ,
72
72
}
73
73
}
74
74
}
@@ -111,7 +111,7 @@ fn parse_count<'psess>(
111
111
Ok ( MetaVarExpr :: Count ( ident, depth) )
112
112
}
113
113
114
- /// Parses the depth used by index(depth) and length (depth).
114
+ /// Parses the depth used by index(depth) and len (depth).
115
115
fn parse_depth < ' psess > (
116
116
iter : & mut RefTokenTreeCursor < ' _ > ,
117
117
psess : & ' psess ParseSess ,
0 commit comments