Parse tuple struct field initialization
This commit is contained in:
@@ -274,7 +274,7 @@ fn name(p: &mut Parser) {
|
||||
}
|
||||
|
||||
fn name_ref(p: &mut Parser) {
|
||||
if p.at(IDENT) {
|
||||
if p.at(IDENT) || p.at(INT_NUMBER) {
|
||||
let m = p.start();
|
||||
p.bump();
|
||||
m.complete(p, NAME_REF);
|
||||
|
||||
@@ -572,6 +572,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) {
|
||||
// S {};
|
||||
// S { x, y: 32, };
|
||||
// S { x, y: 32, ..Default::default() };
|
||||
// TupleStruct { 0: 1 };
|
||||
// }
|
||||
pub(crate) fn named_field_list(p: &mut Parser) {
|
||||
assert!(p.at(T!['{']));
|
||||
@@ -583,7 +584,7 @@ pub(crate) fn named_field_list(p: &mut Parser) {
|
||||
// fn main() {
|
||||
// S { #[cfg(test)] field: 1 }
|
||||
// }
|
||||
IDENT | T![#] => {
|
||||
IDENT | INT_NUMBER | T![#] => {
|
||||
let m = p.start();
|
||||
attributes::outer_attributes(p);
|
||||
name_ref(p);
|
||||
|
||||
Reference in New Issue
Block a user