@@ -30,9 +30,9 @@ pub struct ident { name: Name, ctxt: SyntaxContext }
30
30
/// Construct an identifier with the given name and an empty context:
31
31
pub fn new_ident ( name : Name ) -> ident { ident { name : name, ctxt : empty_ctxt} }
32
32
33
- // a SyntaxContext represents a chain of macro-expandings
34
- // and renamings. Each macro expansion corresponds to
35
- // a fresh uint
33
+ /// A SyntaxContext represents a chain of macro-expandings
34
+ /// and renamings. Each macro expansion corresponds to
35
+ /// a fresh uint
36
36
37
37
// I'm representing this syntax context as an index into
38
38
// a table, in order to work around a compiler bug
@@ -70,11 +70,10 @@ pub enum SyntaxContext_ {
70
70
IllegalCtxt ( )
71
71
}
72
72
73
- // a name is a part of an identifier, representing a string
74
- // or gensym. It's the result of interning.
73
+ /// A name is a part of an identifier, representing a string or gensym. It's
74
+ /// the result of interning.
75
75
pub type Name = uint ;
76
- // a mark represents a unique id associated
77
- // with a macro expansion
76
+ /// A mark represents a unique id associated with a macro expansion
78
77
pub type Mrk = uint ;
79
78
80
79
impl < S : Encoder > Encodable < S > for ident {
@@ -90,7 +89,7 @@ impl<D:Decoder> Decodable<D> for ident {
90
89
}
91
90
}
92
91
93
- // Functions may or may not have names.
92
+ /// Function name (not all functions have names)
94
93
pub type fn_ident = Option < ident > ;
95
94
96
95
#[ deriving( Clone , Eq , Encodable , Decodable , IterBytes ) ]
@@ -107,9 +106,14 @@ pub struct Lifetime {
107
106
#[ deriving( Clone , Eq , Encodable , Decodable , IterBytes ) ]
108
107
pub struct Path {
109
108
span : span ,
109
+ /// A `::foo` path, is relative to the crate root rather than current
110
+ /// module (like paths in an import).
110
111
global : bool ,
112
+ /// The segments in the path (the things separated by ::)
111
113
idents : ~[ ident ] ,
114
+ /// "Region parameter", currently only one lifetime is allowed in a path.
112
115
rp : Option < Lifetime > ,
116
+ /// These are the type parameters, ie, the `a, b` in `foo::bar::<a, b>`
113
117
types : ~[ Ty ] ,
114
118
}
115
119
0 commit comments