diff options
| author | Piotr Czarnecki <pioczarn@gmail.com> | 2014-11-02 12:21:16 +0100 |
|---|---|---|
| committer | Piotr Czarnecki <pioczarn@gmail.com> | 2014-11-07 10:21:57 +0100 |
| commit | 00676c8ea20a7310dacc85759daf57eab86ac965 (patch) | |
| tree | bb02492e716dbaec7000567d63b8b49fea719d55 /src/libsyntax/parse | |
| parent | 964191a313b84785b29b7a33560ae8959f66b582 (diff) | |
| download | rust-00676c8ea20a7310dacc85759daf57eab86ac965.tar.gz rust-00676c8ea20a7310dacc85759daf57eab86ac965.zip | |
Add `ast::SequenceRepetition`
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5a0c7d92fa2..08a1001a30b 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -48,7 +48,8 @@ use ast::{StmtExpr, StmtSemi, StmtMac, StructDef, StructField}; use ast::{StructVariantKind, BiSub}; use ast::StrStyle; use ast::{SelfExplicit, SelfRegion, SelfStatic, SelfValue}; -use ast::{Delimited, TokenTree, TraitItem, TraitRef, TtDelimited, TtSequence, TtToken}; +use ast::{Delimited, SequenceRepetition, TokenTree, TraitItem, TraitRef}; +use ast::{TtDelimited, TtSequence, TtToken}; use ast::{TupleVariantKind, Ty, Ty_, TyBot}; use ast::{TypeField, TyFixedLengthVec, TyClosure, TyProc, TyBareFn}; use ast::{TyTypeof, TyInfer, TypeMethod}; @@ -2551,7 +2552,13 @@ impl<'a> Parser<'a> { Spanned { node, .. } => node, }; let name_num = macro_parser::count_names(seq.as_slice()); - TtSequence(mk_sp(sp.lo, p.span.hi), Rc::new(seq), sep, repeat, name_num) + TtSequence(mk_sp(sp.lo, p.span.hi), + Rc::new(SequenceRepetition { + tts: seq, + separator: sep, + op: repeat, + num_captures: name_num + })) } else { // A nonterminal that matches or not let namep = match p.token { token::Ident(_, p) => p, _ => token::Plain }; |
