Make name_ref to accept numeric names optionally
This commit is contained in:
@@ -458,7 +458,7 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
||||
assert!(p.at(T![.]) && p.nth(1) == IDENT && (p.nth(2) == T!['('] || p.nth(2) == T![::]));
|
||||
let m = lhs.precede(p);
|
||||
p.bump();
|
||||
name_ref(p);
|
||||
name_ref(p, false);
|
||||
type_args::opt_type_arg_list(p, true);
|
||||
if p.at(T!['(']) {
|
||||
arg_list(p);
|
||||
@@ -485,7 +485,7 @@ fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
||||
let m = lhs.precede(p);
|
||||
p.bump();
|
||||
if p.at(IDENT) {
|
||||
name_ref(p)
|
||||
name_ref(p, false)
|
||||
} else if p.at(INT_NUMBER) {
|
||||
p.bump();
|
||||
} else if p.at(FLOAT_NUMBER) {
|
||||
@@ -587,7 +587,7 @@ pub(crate) fn named_field_list(p: &mut Parser) {
|
||||
IDENT | INT_NUMBER | T![#] => {
|
||||
let m = p.start();
|
||||
attributes::outer_attributes(p);
|
||||
name_ref(p);
|
||||
name_ref(p, true);
|
||||
if p.eat(T![:]) {
|
||||
expr(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user