Skip to content

Comments for ast::Path #7940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pub struct ident { name: Name, ctxt: SyntaxContext }
/// Construct an identifier with the given name and an empty context:
pub fn new_ident(name: Name) -> ident { ident {name: name, ctxt: empty_ctxt}}

// a SyntaxContext represents a chain of macro-expandings
// and renamings. Each macro expansion corresponds to
// a fresh uint
/// A SyntaxContext represents a chain of macro-expandings
/// and renamings. Each macro expansion corresponds to
/// a fresh uint

// I'm representing this syntax context as an index into
// a table, in order to work around a compiler bug
Expand Down Expand Up @@ -70,11 +70,10 @@ pub enum SyntaxContext_ {
IllegalCtxt()
}

// a name is a part of an identifier, representing a string
// or gensym. It's the result of interning.
/// A name is a part of an identifier, representing a string or gensym. It's
/// the result of interning.
pub type Name = uint;
// a mark represents a unique id associated
// with a macro expansion
/// A mark represents a unique id associated with a macro expansion
pub type Mrk = uint;

impl<S:Encoder> Encodable<S> for ident {
Expand All @@ -90,7 +89,7 @@ impl<D:Decoder> Decodable<D> for ident {
}
}

// Functions may or may not have names.
/// Function name (not all functions have names)
pub type fn_ident = Option<ident>;

#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
Expand All @@ -107,9 +106,14 @@ pub struct Lifetime {
#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
pub struct Path {
span: span,
/// A `::foo` path, is relative to the crate root rather than current
/// module (like paths in an import).
global: bool,
/// The segments in the path (the things separated by ::)
idents: ~[ident],
/// "Region parameter", currently only one lifetime is allowed in a path.
rp: Option<Lifetime>,
/// These are the type parameters, ie, the `a, b` in `foo::bar::<a, b>`
types: ~[Ty],
}

Expand Down