@@ -84,25 +84,25 @@ pub enum Token {
84
84
LIT_INT ( i64 , ast:: IntTy ) ,
85
85
LIT_UINT ( u64 , ast:: UintTy ) ,
86
86
LIT_INT_UNSUFFIXED ( i64 ) ,
87
- LIT_FLOAT ( ast :: Ident , ast:: FloatTy ) ,
88
- LIT_FLOAT_UNSUFFIXED ( ast :: Ident ) ,
89
- LIT_STR ( ast :: Ident ) ,
90
- LIT_STR_RAW ( ast :: Ident , uint ) , /* raw str delimited by n hash symbols */
87
+ LIT_FLOAT ( Ident , ast:: FloatTy ) ,
88
+ LIT_FLOAT_UNSUFFIXED ( Ident ) ,
89
+ LIT_STR ( Ident ) ,
90
+ LIT_STR_RAW ( Ident , uint ) , /* raw str delimited by n hash symbols */
91
91
LIT_BINARY ( Rc < Vec < u8 > > ) ,
92
92
LIT_BINARY_RAW ( Rc < Vec < u8 > > , uint ) , /* raw binary str delimited by n hash symbols */
93
93
94
94
/* Name components */
95
95
/// An identifier contains an "is_mod_name" boolean,
96
96
/// indicating whether :: follows this token with no
97
97
/// whitespace in between.
98
- IDENT ( ast :: Ident , bool ) ,
98
+ IDENT ( Ident , bool ) ,
99
99
UNDERSCORE ,
100
- LIFETIME ( ast :: Ident ) ,
100
+ LIFETIME ( Ident ) ,
101
101
102
102
/* For interpolation */
103
103
INTERPOLATED ( Nonterminal ) ,
104
104
105
- DOC_COMMENT ( ast :: Ident ) ,
105
+ DOC_COMMENT ( Ident ) ,
106
106
EOF ,
107
107
}
108
108
@@ -115,11 +115,12 @@ pub enum Nonterminal {
115
115
NtPat ( Gc < ast:: Pat > ) ,
116
116
NtExpr ( Gc < ast:: Expr > ) ,
117
117
NtTy ( P < ast:: Ty > ) ,
118
- // see IDENT, above, for meaning of bool in NtIdent:
119
- NtIdent ( Box < ast:: Ident > , bool ) ,
120
- NtMeta ( Gc < ast:: MetaItem > ) , // stuff inside brackets for attributes
118
+ /// See IDENT, above, for meaning of bool in NtIdent:
119
+ NtIdent ( Box < Ident > , bool ) ,
120
+ /// Stuff inside brackets for attributes
121
+ NtMeta ( Gc < ast:: MetaItem > ) ,
121
122
NtPath ( Box < ast:: Path > ) ,
122
- NtTT ( Gc < ast:: TokenTree > ) , // needs @ed to break a circularity
123
+ NtTT ( Gc < ast:: TokenTree > ) , // needs Gc'd to break a circularity
123
124
NtMatchers ( Vec < ast:: Matcher > )
124
125
}
125
126
@@ -683,20 +684,20 @@ pub fn gensym(s: &str) -> Name {
683
684
684
685
/// Maps a string to an identifier with an empty syntax context.
685
686
#[ inline]
686
- pub fn str_to_ident ( s : & str ) -> ast :: Ident {
687
- ast :: Ident :: new ( intern ( s) )
687
+ pub fn str_to_ident ( s : & str ) -> Ident {
688
+ Ident :: new ( intern ( s) )
688
689
}
689
690
690
691
/// Maps a string to a gensym'ed identifier.
691
692
#[ inline]
692
- pub fn gensym_ident ( s : & str ) -> ast :: Ident {
693
- ast :: Ident :: new ( gensym ( s) )
693
+ pub fn gensym_ident ( s : & str ) -> Ident {
694
+ Ident :: new ( gensym ( s) )
694
695
}
695
696
696
697
// create a fresh name that maps to the same string as the old one.
697
698
// note that this guarantees that str_ptr_eq(ident_to_string(src),interner_get(fresh_name(src)));
698
699
// that is, that the new name and the old one are connected to ptr_eq strings.
699
- pub fn fresh_name ( src : & ast :: Ident ) -> Name {
700
+ pub fn fresh_name ( src : & Ident ) -> Name {
700
701
let interner = get_ident_interner ( ) ;
701
702
interner. gensym_copy ( src. name )
702
703
// following: debug version. Could work in final except that it's incompatible with
@@ -767,8 +768,8 @@ mod test {
767
768
use ast;
768
769
use ext:: mtwt;
769
770
770
- fn mark_ident ( id : ast :: Ident , m : ast:: Mrk ) -> ast :: Ident {
771
- ast :: Ident { name : id. name , ctxt : mtwt:: apply_mark ( m, id. ctxt ) }
771
+ fn mark_ident ( id : Ident , m : ast:: Mrk ) -> Ident {
772
+ Ident { name : id. name , ctxt : mtwt:: apply_mark ( m, id. ctxt ) }
772
773
}
773
774
774
775
#[ test] fn mtwt_token_eq_test ( ) {
0 commit comments