diff options
Diffstat (limited to 'xtask/src')
-rw-r--r-- | xtask/src/ast_src.rs | 36 | ||||
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 4 |
2 files changed, 22 insertions, 18 deletions
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 1483dc08e..943c91e23 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -338,7 +338,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
338 | struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] } | 338 | struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] } |
339 | struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } | 339 | struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } |
340 | 340 | ||
341 | struct TupleFieldDefList { LParen, fields: [TupleFieldDef], RParen } | 341 | struct TupleFieldDefList { T!['('], fields: [TupleFieldDef], T![')'] } |
342 | struct TupleFieldDef: VisibilityOwner, AttrsOwner { | 342 | struct TupleFieldDef: VisibilityOwner, AttrsOwner { |
343 | TypeRef, | 343 | TypeRef, |
344 | } | 344 | } |
@@ -411,13 +411,13 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
411 | ItemList, | 411 | ItemList, |
412 | } | 412 | } |
413 | 413 | ||
414 | struct ParenType { LParen, TypeRef, RParen } | 414 | struct ParenType { T!['('], TypeRef, T![')'] } |
415 | struct TupleType { LParen, fields: [TypeRef], RParen } | 415 | struct TupleType { T!['('], fields: [TypeRef], T![')'] } |
416 | struct NeverType { Excl } | 416 | struct NeverType { Excl } |
417 | struct PathType { Path } | 417 | struct PathType { Path } |
418 | struct PointerType { Star, T![const], T![mut], TypeRef } | 418 | struct PointerType { Star, T![const], T![mut], TypeRef } |
419 | struct ArrayType { LBrack, TypeRef, T![;], Expr, RBrack } | 419 | struct ArrayType { T!['['], TypeRef, T![;], Expr, T![']'] } |
420 | struct SliceType { LBrack, TypeRef, RBrack } | 420 | struct SliceType { T!['['], TypeRef, T![']'] } |
421 | struct ReferenceType { Amp, Lifetime, T![mut], TypeRef } | 421 | struct ReferenceType { Amp, Lifetime, T![mut], TypeRef } |
422 | struct PlaceholderType { Underscore } | 422 | struct PlaceholderType { Underscore } |
423 | struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType } | 423 | struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType } |
@@ -425,9 +425,9 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
425 | struct ImplTraitType: TypeBoundsOwner { T![impl] } | 425 | struct ImplTraitType: TypeBoundsOwner { T![impl] } |
426 | struct DynTraitType: TypeBoundsOwner { T![dyn] } | 426 | struct DynTraitType: TypeBoundsOwner { T![dyn] } |
427 | 427 | ||
428 | struct TupleExpr: AttrsOwner { LParen, exprs: [Expr], RParen } | 428 | struct TupleExpr: AttrsOwner { T!['('], exprs: [Expr], T![')'] } |
429 | struct ArrayExpr: AttrsOwner { LBrack, exprs: [Expr], T![;], RBrack } | 429 | struct ArrayExpr: AttrsOwner { T!['['], exprs: [Expr], T![;], T![']'] } |
430 | struct ParenExpr: AttrsOwner { LParen, Expr, RParen } | 430 | struct ParenExpr: AttrsOwner { T!['('], Expr, T![')'] } |
431 | struct PathExpr { Path } | 431 | struct PathExpr { Path } |
432 | struct LambdaExpr: AttrsOwner { | 432 | struct LambdaExpr: AttrsOwner { |
433 | T![static], | 433 | T![static], |
@@ -456,7 +456,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
456 | struct MethodCallExpr: AttrsOwner, ArgListOwner { | 456 | struct MethodCallExpr: AttrsOwner, ArgListOwner { |
457 | Expr, Dot, NameRef, TypeArgList, | 457 | Expr, Dot, NameRef, TypeArgList, |
458 | } | 458 | } |
459 | struct IndexExpr: AttrsOwner { LBrack, RBrack } | 459 | struct IndexExpr: AttrsOwner { T!['['], T![']'] } |
460 | struct FieldExpr: AttrsOwner { Expr, Dot, NameRef } | 460 | struct FieldExpr: AttrsOwner { Expr, Dot, NameRef } |
461 | struct AwaitExpr: AttrsOwner { Expr, Dot, T![await] } | 461 | struct AwaitExpr: AttrsOwner { Expr, Dot, T![await] } |
462 | struct TryExpr: AttrsOwner { T![try], Expr } | 462 | struct TryExpr: AttrsOwner { T![try], Expr } |
@@ -489,14 +489,14 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
489 | struct RecordField: AttrsOwner { NameRef, Colon, Expr } | 489 | struct RecordField: AttrsOwner { NameRef, Colon, Expr } |
490 | 490 | ||
491 | struct OrPat { pats: [Pat] } | 491 | struct OrPat { pats: [Pat] } |
492 | struct ParenPat { LParen, Pat, RParen } | 492 | struct ParenPat { T!['('], Pat, T![')'] } |
493 | struct RefPat { Amp, T![mut], Pat } | 493 | struct RefPat { Amp, T![mut], Pat } |
494 | struct BoxPat { T![box], Pat } | 494 | struct BoxPat { T![box], Pat } |
495 | struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], At, Pat } | 495 | struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], At, Pat } |
496 | struct PlaceholderPat { Underscore } | 496 | struct PlaceholderPat { Underscore } |
497 | struct DotDotPat { Dotdot } | 497 | struct DotDotPat { Dotdot } |
498 | struct PathPat { Path } | 498 | struct PathPat { Path } |
499 | struct SlicePat { LBrack, args: [Pat], RBrack } | 499 | struct SlicePat { T!['['], args: [Pat], T![']'] } |
500 | struct RangePat { RangeSeparator } | 500 | struct RangePat { RangeSeparator } |
501 | struct LiteralPat { Literal } | 501 | struct LiteralPat { Literal } |
502 | struct MacroPat { MacroCall } | 502 | struct MacroPat { MacroCall } |
@@ -512,8 +512,8 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
512 | } | 512 | } |
513 | struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat } | 513 | struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat } |
514 | 514 | ||
515 | struct TupleStructPat { Path, LParen, args: [Pat], RParen } | 515 | struct TupleStructPat { Path, T!['('], args: [Pat], T![')'] } |
516 | struct TuplePat { LParen, args: [Pat], RParen } | 516 | struct TuplePat { T!['('], args: [Pat], T![')'] } |
517 | 517 | ||
518 | struct Visibility { T![pub], T![super], T![self], T![crate] } | 518 | struct Visibility { T![pub], T![super], T![self], T![crate] } |
519 | struct Name { Ident } | 519 | struct Name { Ident } |
@@ -522,7 +522,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
522 | struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { | 522 | struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { |
523 | Path, Excl, TokenTree, T![;] | 523 | Path, Excl, TokenTree, T![;] |
524 | } | 524 | } |
525 | struct Attr { Pound, Excl, LBrack, Path, Eq, input: AttrInput, RBrack } | 525 | struct Attr { Pound, Excl, T!['['], Path, Eq, input: AttrInput, T![']'] } |
526 | struct TokenTree {} | 526 | struct TokenTree {} |
527 | struct TypeParamList { | 527 | struct TypeParamList { |
528 | LAngle, | 528 | LAngle, |
@@ -562,10 +562,10 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
562 | T!['}'], | 562 | T!['}'], |
563 | } | 563 | } |
564 | struct ParamList { | 564 | struct ParamList { |
565 | LParen, | 565 | T!['('], |
566 | SelfParam, | 566 | SelfParam, |
567 | params: [Param], | 567 | params: [Param], |
568 | RParen | 568 | T![')'] |
569 | } | 569 | } |
570 | struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, T![self] } | 570 | struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, T![self] } |
571 | struct Param: TypeAscriptionOwner, AttrsOwner { | 571 | struct Param: TypeAscriptionOwner, AttrsOwner { |
@@ -585,9 +585,9 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
585 | T![extern], T![crate], NameRef, Alias, | 585 | T![extern], T![crate], NameRef, Alias, |
586 | } | 586 | } |
587 | struct ArgList { | 587 | struct ArgList { |
588 | LParen, | 588 | T!['('], |
589 | args: [Expr], | 589 | args: [Expr], |
590 | RParen | 590 | T![')'] |
591 | } | 591 | } |
592 | struct Path { | 592 | struct Path { |
593 | segment: PathSegment, | 593 | segment: PathSegment, |
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index b7698ee6e..a903d1da7 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -531,6 +531,10 @@ impl Field<'_> { | |||
531 | "->" => "thin_arrow", | 531 | "->" => "thin_arrow", |
532 | "'{'" => "l_curly", | 532 | "'{'" => "l_curly", |
533 | "'}'" => "r_curly", | 533 | "'}'" => "r_curly", |
534 | "'('" => "l_paren", | ||
535 | "')'" => "r_paren", | ||
536 | "'['" => "l_brack", | ||
537 | "']'" => "r_brack", | ||
534 | _ => name, | 538 | _ => name, |
535 | }; | 539 | }; |
536 | format_ident!("{}_token", name) | 540 | format_ident!("{}_token", name) |