fn parse_unquoted(&mut self) -> PResult<'a, TokenTree> {
        let mut sp = self.span;
        let (name, namep) = match self.token {
            token::Dollar => {
                self.bump();

                if self.token == token::OpenDelim(token::Paren) {
                    let Spanned { node: seq, span: seq_span } = try!(self.parse_seq(
                        &token::OpenDelim(token::Paren),
                        &token::CloseDelim(token::Paren),
                        SeqSep::none(),
                        |p| p.parse_token_tree()
                    ));
                    let (sep, repeat) = try!(self.parse_sep_and_kleene_op());
                    let name_num = macro_parser::count_names(&seq);
                    return Ok(TokenTree::Sequence(mk_sp(sp.lo, seq_span.hi),
                                      Rc::new(SequenceRepetition {
                                          tts: seq,
                                          separator: sep,
                                          op: repeat,
                                          num_captures: name_num
                                      })));
                } else if self.token.is_keyword_allow_following_colon(keywords::Crate) {
                    self.bump();
                    return Ok(TokenTree::Token(sp, SpecialVarNt(SpecialMacroVar::CrateMacroVar)));
                } else {
                    sp = mk_sp(sp.lo, self.span.hi);
                    let namep = match self.token { token::Ident(_, p) => p, _ => token::Plain };
                    let name = try!(self.parse_ident());
                    (name, namep)
                }
            }
            token::SubstNt(name, namep) => {
                self.bump();
                (name, namep)
            }
            _ => unreachable!()
        };
        // continue by trying to parse the `:ident` after `$name`
        if self.token == token::Colon && self.look_ahead(1, |t| t.is_ident() &&
                                                                !t.is_strict_keyword() &&
                                                                !t.is_reserved_keyword()) {
            self.bump();
            sp = mk_sp(sp.lo, self.span.hi);
            let kindp = match self.token { token::Ident(_, p) => p, _ => token::Plain };
            let nt_kind = try!(self.parse_ident());
            Ok(TokenTree::Token(sp, MatchNt(name, nt_kind, namep, kindp)))
        } else {
            Ok(TokenTree::Token(sp, SubstNt(name, namep)))
        }
    }
// Parse unquoted tokens after a `$` in a token tree
Parse unquoted tokens after a `$` in a token tree
Parse unquoted tokens after a ` $ ` in a token tree
fn parse_unquoted(&mut self) -> PResult<'a, TokenTree> {
        let mut sp = self.span;
        let (name, namep) = match self.token {
            token::Dollar => {
                self.bump();
                if self.token == token::OpenDelim(token::Paren) {
                    let Spanned { node: seq, span: seq_span } = try!(self.parse_seq(
                        &token::OpenDelim(token::Paren),
                        &token::CloseDelim(token::Paren),
                        SeqSep::none(),
                        |p| p.parse_token_tree()
                    ));
                    let (sep, repeat) = try!(self.parse_sep_and_kleene_op());
                    let name_num = macro_parser::count_names(&seq);
                    return Ok(TokenTree::Sequence(mk_sp(sp.lo, seq_span.hi),
                                      Rc::new(SequenceRepetition {
                                          tts: seq,
                                          separator: sep,
                                          op: repeat,
                                          num_captures: name_num
                                      })));
                } else if self.token.is_keyword_allow_following_colon(keywords::Crate) {
                    self.bump();
                    return Ok(TokenTree::Token(sp, SpecialVarNt(SpecialMacroVar::CrateMacroVar)));
                } else {
                    sp = mk_sp(sp.lo, self.span.hi);
                    let namep = match self.token { token::Ident(_, p) => p, _ => token::Plain };
                    let name = try!(self.parse_ident());
                    (name, namep)
                }
            }
            token::SubstNt(name, namep) => {
                self.bump();
                (name, namep)
            }
            _ => unreachable!()
        };
        // continue by trying to parse the `:ident` after `$name`
        if self.token == token::Colon && self.look_ahead(1, |t| t.is_ident() &&
                                                                !t.is_strict_keyword() &&
                                                                !t.is_reserved_keyword()) {
            self.bump();
            sp = mk_sp(sp.lo, self.span.hi);
            let kindp = match self.token { token::Ident(_, p) => p, _ => token::Plain };
            let nt_kind = try!(self.parse_ident());
            Ok(TokenTree::Token(sp, MatchNt(name, nt_kind, namep, kindp)))
        } else {
            Ok(TokenTree::Token(sp, SubstNt(name, namep)))
        }
    }
fn parse_unquoted ( & mut self ) -> PResult < ' a , TokenTree > { let mut sp = self . span ; let ( name , namep ) = match self . token { token :: Dollar => { self . bump ( ) ; if self . token == token :: OpenDelim ( token :: Paren ) { let Spanned { node : seq , span : seq_span } = try ! ( self parse_seq ( token OpenDelim ( token Paren ) token CloseDelim ( token Paren ) SeqSep none ( ) p p parse_token_tree ( ) ) ) ; let ( sep , repeat ) = try ! ( self parse_sep_and_kleene_op ( ) ) ; let name_num = macro_parser :: count_names ( & seq ) ; return Ok ( TokenTree :: Sequence ( mk_sp ( sp . lo , seq_span . hi ) , Rc :: new ( SequenceRepetition { tts : seq , separator : sep , op : repeat , num_captures : name_num } ) ) ) ; } else if self . token . is_keyword_allow_following_colon ( keywords :: Crate ) { self . bump ( ) ; return Ok ( TokenTree :: Token ( sp , SpecialVarNt ( SpecialMacroVar :: CrateMacroVar ) ) ) ; } else { sp = mk_sp ( sp . lo , self . span . hi ) ; let namep = match self . token { token :: Ident ( _ , p ) => p , _ => token :: Plain } ; let name = try ! ( self parse_ident ( ) ) ; ( name , namep ) } } token :: SubstNt ( name , namep ) => { self . bump ( ) ; ( name , namep ) } _ => unreachable ! ( ) } ; // continue by trying to parse the `:ident` after `$name` if self . token == token :: Colon && self . look_ahead ( 1 , | t | t . is_ident ( ) && ! t . is_strict_keyword ( ) && ! t . is_reserved_keyword ( ) ) { self . bump ( ) ; sp = mk_sp ( sp . lo , self . span . hi ) ; let kindp = match self . token { token :: Ident ( _ , p ) => p , _ => token :: Plain } ; let nt_kind = try ! ( self parse_ident ( ) ) ; Ok ( TokenTree :: Token ( sp , MatchNt ( name , nt_kind , namep , kindp ) ) ) } else { Ok ( TokenTree :: Token ( sp , SubstNt ( name , namep ) ) ) } }
Parse unquoted tokens after a `$` in a token tree
Parse unquoted tokens after a ` $ ` in a token tree
&mut self
&mut self