syntax: ast: replace Gc<T> (previously @T) with P<T>.
This commit is contained in:
parent
1872c4c6b5
commit
cccb6f84a3
1 changed files with 76 additions and 77 deletions
|
@ -16,13 +16,12 @@ use ast_util;
|
||||||
use owned_slice::OwnedSlice;
|
use owned_slice::OwnedSlice;
|
||||||
use parse::token::{InternedString, str_to_ident};
|
use parse::token::{InternedString, str_to_ident};
|
||||||
use parse::token;
|
use parse::token;
|
||||||
|
use ptr::P;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::num::Zero;
|
use std::num::Zero;
|
||||||
use std::fmt::Show;
|
use std::fmt::Show;
|
||||||
use std::option::Option;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::gc::{Gc, GC};
|
|
||||||
use serialize::{Encodable, Decodable, Encoder, Decoder};
|
use serialize::{Encodable, Decodable, Encoder, Decoder};
|
||||||
|
|
||||||
// FIXME #6993: in librustc, uses of "ident" should be replaced
|
// FIXME #6993: in librustc, uses of "ident" should be replaced
|
||||||
|
@ -267,7 +266,7 @@ pub struct WherePredicate {
|
||||||
|
|
||||||
/// The set of MetaItems that define the compilation environment of the crate,
|
/// The set of MetaItems that define the compilation environment of the crate,
|
||||||
/// used to drive conditional compilation
|
/// used to drive conditional compilation
|
||||||
pub type CrateConfig = Vec<Gc<MetaItem>>;
|
pub type CrateConfig = Vec<P<MetaItem>> ;
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct Crate {
|
pub struct Crate {
|
||||||
|
@ -275,7 +274,7 @@ pub struct Crate {
|
||||||
pub attrs: Vec<Attribute>,
|
pub attrs: Vec<Attribute>,
|
||||||
pub config: CrateConfig,
|
pub config: CrateConfig,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
pub exported_macros: Vec<Gc<Item>>
|
pub exported_macros: Vec<P<Item>>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type MetaItem = Spanned<MetaItem_>;
|
pub type MetaItem = Spanned<MetaItem_>;
|
||||||
|
@ -283,7 +282,7 @@ pub type MetaItem = Spanned<MetaItem_>;
|
||||||
#[deriving(Clone, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum MetaItem_ {
|
pub enum MetaItem_ {
|
||||||
MetaWord(InternedString),
|
MetaWord(InternedString),
|
||||||
MetaList(InternedString, Vec<Gc<MetaItem>>),
|
MetaList(InternedString, Vec<P<MetaItem>>),
|
||||||
MetaNameValue(InternedString, Lit),
|
MetaNameValue(InternedString, Lit),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,8 +314,8 @@ impl PartialEq for MetaItem_ {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct Block {
|
pub struct Block {
|
||||||
pub view_items: Vec<ViewItem>,
|
pub view_items: Vec<ViewItem>,
|
||||||
pub stmts: Vec<Gc<Stmt>>,
|
pub stmts: Vec<P<Stmt>>,
|
||||||
pub expr: Option<Gc<Expr>>,
|
pub expr: Option<P<Expr>>,
|
||||||
pub id: NodeId,
|
pub id: NodeId,
|
||||||
pub rules: BlockCheckMode,
|
pub rules: BlockCheckMode,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
@ -332,7 +331,7 @@ pub struct Pat {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct FieldPat {
|
pub struct FieldPat {
|
||||||
pub ident: Ident,
|
pub ident: Ident,
|
||||||
pub pat: Gc<Pat>,
|
pub pat: P<Pat>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
|
@ -362,20 +361,20 @@ pub enum Pat_ {
|
||||||
/// which it is. The resolver determines this, and
|
/// which it is. The resolver determines this, and
|
||||||
/// records this pattern's NodeId in an auxiliary
|
/// records this pattern's NodeId in an auxiliary
|
||||||
/// set (of "PatIdents that refer to nullary enums")
|
/// set (of "PatIdents that refer to nullary enums")
|
||||||
PatIdent(BindingMode, SpannedIdent, Option<Gc<Pat>>),
|
PatIdent(BindingMode, SpannedIdent, Option<P<Pat>>),
|
||||||
|
|
||||||
/// "None" means a * pattern where we don't bind the fields to names.
|
/// "None" means a * pattern where we don't bind the fields to names.
|
||||||
PatEnum(Path, Option<Vec<Gc<Pat>>>),
|
PatEnum(Path, Option<Vec<P<Pat>>>),
|
||||||
|
|
||||||
PatStruct(Path, Vec<FieldPat>, bool),
|
PatStruct(Path, Vec<FieldPat>, bool),
|
||||||
PatTup(Vec<Gc<Pat>>),
|
PatTup(Vec<P<Pat>>),
|
||||||
PatBox(Gc<Pat>),
|
PatBox(P<Pat>),
|
||||||
PatRegion(Gc<Pat>), // reference pattern
|
PatRegion(P<Pat>), // reference pattern
|
||||||
PatLit(Gc<Expr>),
|
PatLit(P<Expr>),
|
||||||
PatRange(Gc<Expr>, Gc<Expr>),
|
PatRange(P<Expr>, P<Expr>),
|
||||||
/// [a, b, ..i, y, z] is represented as:
|
/// [a, b, ..i, y, z] is represented as:
|
||||||
/// PatVec(~[a, b], Some(i), ~[y, z])
|
/// PatVec(~[a, b], Some(i), ~[y, z])
|
||||||
PatVec(Vec<Gc<Pat>>, Option<Gc<Pat>>, Vec<Gc<Pat>>),
|
PatVec(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>),
|
||||||
PatMac(Mac),
|
PatMac(Mac),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,13 +420,13 @@ pub type Stmt = Spanned<Stmt_>;
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum Stmt_ {
|
pub enum Stmt_ {
|
||||||
/// Could be an item or a local (let) binding:
|
/// Could be an item or a local (let) binding:
|
||||||
StmtDecl(Gc<Decl>, NodeId),
|
StmtDecl(P<Decl>, NodeId),
|
||||||
|
|
||||||
/// Expr without trailing semi-colon (must have unit type):
|
/// Expr without trailing semi-colon (must have unit type):
|
||||||
StmtExpr(Gc<Expr>, NodeId),
|
StmtExpr(P<Expr>, NodeId),
|
||||||
|
|
||||||
/// Expr with trailing semi-colon (may have any type):
|
/// Expr with trailing semi-colon (may have any type):
|
||||||
StmtSemi(Gc<Expr>, NodeId),
|
StmtSemi(P<Expr>, NodeId),
|
||||||
|
|
||||||
/// bool: is there a trailing sem-colon?
|
/// bool: is there a trailing sem-colon?
|
||||||
StmtMac(Mac, bool),
|
StmtMac(Mac, bool),
|
||||||
|
@ -447,8 +446,8 @@ pub enum LocalSource {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct Local {
|
pub struct Local {
|
||||||
pub ty: P<Ty>,
|
pub ty: P<Ty>,
|
||||||
pub pat: Gc<Pat>,
|
pub pat: P<Pat>,
|
||||||
pub init: Option<Gc<Expr>>,
|
pub init: Option<P<Expr>>,
|
||||||
pub id: NodeId,
|
pub id: NodeId,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
pub source: LocalSource,
|
pub source: LocalSource,
|
||||||
|
@ -459,24 +458,24 @@ pub type Decl = Spanned<Decl_>;
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum Decl_ {
|
pub enum Decl_ {
|
||||||
/// A local (let) binding:
|
/// A local (let) binding:
|
||||||
DeclLocal(Gc<Local>),
|
DeclLocal(P<Local>),
|
||||||
/// An item binding:
|
/// An item binding:
|
||||||
DeclItem(Gc<Item>),
|
DeclItem(P<Item>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// represents one arm of a 'match'
|
/// represents one arm of a 'match'
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct Arm {
|
pub struct Arm {
|
||||||
pub attrs: Vec<Attribute>,
|
pub attrs: Vec<Attribute>,
|
||||||
pub pats: Vec<Gc<Pat>>,
|
pub pats: Vec<P<Pat>>,
|
||||||
pub guard: Option<Gc<Expr>>,
|
pub guard: Option<P<Expr>>,
|
||||||
pub body: Gc<Expr>,
|
pub body: P<Expr>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct Field {
|
pub struct Field {
|
||||||
pub ident: SpannedIdent,
|
pub ident: SpannedIdent,
|
||||||
pub expr: Gc<Expr>,
|
pub expr: P<Expr>,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -504,56 +503,56 @@ pub struct Expr {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum Expr_ {
|
pub enum Expr_ {
|
||||||
/// First expr is the place; second expr is the value.
|
/// First expr is the place; second expr is the value.
|
||||||
ExprBox(Gc<Expr>, Gc<Expr>),
|
ExprBox(P<Expr>, P<Expr>),
|
||||||
ExprVec(Vec<Gc<Expr>>),
|
ExprVec(Vec<P<Expr>>),
|
||||||
ExprCall(Gc<Expr>, Vec<Gc<Expr>>),
|
ExprCall(P<Expr>, Vec<P<Expr>>),
|
||||||
ExprMethodCall(SpannedIdent, Vec<P<Ty>>, Vec<Gc<Expr>>),
|
ExprMethodCall(SpannedIdent, Vec<P<Ty>>, Vec<P<Expr>>),
|
||||||
ExprTup(Vec<Gc<Expr>>),
|
ExprTup(Vec<P<Expr>>),
|
||||||
ExprBinary(BinOp, Gc<Expr>, Gc<Expr>),
|
ExprBinary(BinOp, P<Expr>, P<Expr>),
|
||||||
ExprUnary(UnOp, Gc<Expr>),
|
ExprUnary(UnOp, P<Expr>),
|
||||||
ExprLit(Gc<Lit>),
|
ExprLit(P<Lit>),
|
||||||
ExprCast(Gc<Expr>, P<Ty>),
|
ExprCast(P<Expr>, P<Ty>),
|
||||||
ExprIf(Gc<Expr>, P<Block>, Option<Gc<Expr>>),
|
ExprIf(P<Expr>, P<Block>, Option<P<Expr>>),
|
||||||
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
|
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
|
||||||
ExprWhile(Gc<Expr>, P<Block>, Option<Ident>),
|
ExprWhile(P<Expr>, P<Block>, Option<Ident>),
|
||||||
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
|
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
|
||||||
ExprForLoop(Gc<Pat>, Gc<Expr>, P<Block>, Option<Ident>),
|
ExprForLoop(P<Pat>, P<Expr>, P<Block>, Option<Ident>),
|
||||||
// Conditionless loop (can be exited with break, cont, or ret)
|
// Conditionless loop (can be exited with break, cont, or ret)
|
||||||
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
|
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
|
||||||
ExprLoop(P<Block>, Option<Ident>),
|
ExprLoop(P<Block>, Option<Ident>),
|
||||||
ExprMatch(Gc<Expr>, Vec<Arm>),
|
ExprMatch(P<Expr>, Vec<Arm>),
|
||||||
ExprFnBlock(CaptureClause, P<FnDecl>, P<Block>),
|
ExprFnBlock(CaptureClause, P<FnDecl>, P<Block>),
|
||||||
ExprProc(P<FnDecl>, P<Block>),
|
ExprProc(P<FnDecl>, P<Block>),
|
||||||
ExprUnboxedFn(CaptureClause, UnboxedClosureKind, P<FnDecl>, P<Block>),
|
ExprUnboxedFn(CaptureClause, UnboxedClosureKind, P<FnDecl>, P<Block>),
|
||||||
ExprBlock(P<Block>),
|
ExprBlock(P<Block>),
|
||||||
|
|
||||||
ExprAssign(Gc<Expr>, Gc<Expr>),
|
ExprAssign(P<Expr>, P<Expr>),
|
||||||
ExprAssignOp(BinOp, Gc<Expr>, Gc<Expr>),
|
ExprAssignOp(BinOp, P<Expr>, P<Expr>),
|
||||||
ExprField(Gc<Expr>, SpannedIdent, Vec<P<Ty>>),
|
ExprField(P<Expr>, SpannedIdent, Vec<P<Ty>>),
|
||||||
ExprTupField(Gc<Expr>, Spanned<uint>, Vec<P<Ty>>),
|
ExprTupField(P<Expr>, Spanned<uint>, Vec<P<Ty>>),
|
||||||
ExprIndex(Gc<Expr>, Gc<Expr>),
|
ExprIndex(P<Expr>, P<Expr>),
|
||||||
|
|
||||||
/// Variable reference, possibly containing `::` and/or
|
/// Variable reference, possibly containing `::` and/or
|
||||||
/// type parameters, e.g. foo::bar::<baz>
|
/// type parameters, e.g. foo::bar::<baz>
|
||||||
ExprPath(Path),
|
ExprPath(Path),
|
||||||
|
|
||||||
ExprAddrOf(Mutability, Gc<Expr>),
|
ExprAddrOf(Mutability, P<Expr>),
|
||||||
ExprBreak(Option<Ident>),
|
ExprBreak(Option<Ident>),
|
||||||
ExprAgain(Option<Ident>),
|
ExprAgain(Option<Ident>),
|
||||||
ExprRet(Option<Gc<Expr>>),
|
ExprRet(Option<P<Expr>>),
|
||||||
|
|
||||||
ExprInlineAsm(InlineAsm),
|
ExprInlineAsm(InlineAsm),
|
||||||
|
|
||||||
ExprMac(Mac),
|
ExprMac(Mac),
|
||||||
|
|
||||||
/// A struct literal expression.
|
/// A struct literal expression.
|
||||||
ExprStruct(Path, Vec<Field> , Option<Gc<Expr>> /* base */),
|
ExprStruct(Path, Vec<Field>, Option<P<Expr>> /* base */),
|
||||||
|
|
||||||
/// A vector literal constructed from one repeated element.
|
/// A vector literal constructed from one repeated element.
|
||||||
ExprRepeat(Gc<Expr> /* element */, Gc<Expr> /* count */),
|
ExprRepeat(P<Expr> /* element */, P<Expr> /* count */),
|
||||||
|
|
||||||
/// No-op: used solely so we can pretty-print faithfully
|
/// No-op: used solely so we can pretty-print faithfully
|
||||||
ExprParen(Gc<Expr>)
|
ExprParen(P<Expr>)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
|
@ -766,12 +765,12 @@ pub struct TypeMethod {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum TraitItem {
|
pub enum TraitItem {
|
||||||
RequiredMethod(TypeMethod),
|
RequiredMethod(TypeMethod),
|
||||||
ProvidedMethod(Gc<Method>),
|
ProvidedMethod(P<Method>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum ImplItem {
|
pub enum ImplItem {
|
||||||
MethodImplItem(Gc<Method>),
|
MethodImplItem(P<Method>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)]
|
||||||
|
@ -879,7 +878,7 @@ impl fmt::Show for Onceness {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents the type of a closure
|
/// Represents the type of a closure
|
||||||
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct ClosureTy {
|
pub struct ClosureTy {
|
||||||
pub lifetimes: Vec<LifetimeDef>,
|
pub lifetimes: Vec<LifetimeDef>,
|
||||||
pub fn_style: FnStyle,
|
pub fn_style: FnStyle,
|
||||||
|
@ -888,7 +887,7 @@ pub struct ClosureTy {
|
||||||
pub bounds: TyParamBounds,
|
pub bounds: TyParamBounds,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct BareFnTy {
|
pub struct BareFnTy {
|
||||||
pub fn_style: FnStyle,
|
pub fn_style: FnStyle,
|
||||||
pub abi: Abi,
|
pub abi: Abi,
|
||||||
|
@ -909,18 +908,18 @@ pub enum Ty_ {
|
||||||
TyBox(P<Ty>),
|
TyBox(P<Ty>),
|
||||||
TyUniq(P<Ty>),
|
TyUniq(P<Ty>),
|
||||||
TyVec(P<Ty>),
|
TyVec(P<Ty>),
|
||||||
TyFixedLengthVec(P<Ty>, Gc<Expr>),
|
TyFixedLengthVec(P<Ty>, P<Expr>),
|
||||||
TyPtr(MutTy),
|
TyPtr(MutTy),
|
||||||
TyRptr(Option<Lifetime>, MutTy),
|
TyRptr(Option<Lifetime>, MutTy),
|
||||||
TyClosure(Gc<ClosureTy>),
|
TyClosure(P<ClosureTy>),
|
||||||
TyProc(Gc<ClosureTy>),
|
TyProc(P<ClosureTy>),
|
||||||
TyBareFn(Gc<BareFnTy>),
|
TyBareFn(P<BareFnTy>),
|
||||||
TyUnboxedFn(Gc<UnboxedFnTy>),
|
TyUnboxedFn(P<UnboxedFnTy>),
|
||||||
TyTup(Vec<P<Ty>> ),
|
TyTup(Vec<P<Ty>> ),
|
||||||
TyPath(Path, Option<TyParamBounds>, NodeId), // for #7264; see above
|
TyPath(Path, Option<TyParamBounds>, NodeId), // for #7264; see above
|
||||||
/// No-op; kept solely so that we can pretty-print faithfully
|
/// No-op; kept solely so that we can pretty-print faithfully
|
||||||
TyParen(P<Ty>),
|
TyParen(P<Ty>),
|
||||||
TyTypeof(Gc<Expr>),
|
TyTypeof(P<Expr>),
|
||||||
/// TyInfer means the type should be inferred instead of it having been
|
/// TyInfer means the type should be inferred instead of it having been
|
||||||
/// specified. This can appear anywhere in a type.
|
/// specified. This can appear anywhere in a type.
|
||||||
TyInfer,
|
TyInfer,
|
||||||
|
@ -936,8 +935,8 @@ pub enum AsmDialect {
|
||||||
pub struct InlineAsm {
|
pub struct InlineAsm {
|
||||||
pub asm: InternedString,
|
pub asm: InternedString,
|
||||||
pub asm_str_style: StrStyle,
|
pub asm_str_style: StrStyle,
|
||||||
pub outputs: Vec<(InternedString, Gc<Expr>, bool)>,
|
pub outputs: Vec<(InternedString, P<Expr>, bool)>,
|
||||||
pub inputs: Vec<(InternedString, Gc<Expr>)>,
|
pub inputs: Vec<(InternedString, P<Expr>)>,
|
||||||
pub clobbers: InternedString,
|
pub clobbers: InternedString,
|
||||||
pub volatile: bool,
|
pub volatile: bool,
|
||||||
pub alignstack: bool,
|
pub alignstack: bool,
|
||||||
|
@ -948,7 +947,7 @@ pub struct InlineAsm {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct Arg {
|
pub struct Arg {
|
||||||
pub ty: P<Ty>,
|
pub ty: P<Ty>,
|
||||||
pub pat: Gc<Pat>,
|
pub pat: P<Pat>,
|
||||||
pub id: NodeId,
|
pub id: NodeId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,11 +961,11 @@ impl Arg {
|
||||||
node: TyInfer,
|
node: TyInfer,
|
||||||
span: DUMMY_SP,
|
span: DUMMY_SP,
|
||||||
}),
|
}),
|
||||||
pat: box(GC) Pat {
|
pat: P(Pat {
|
||||||
id: DUMMY_NODE_ID,
|
id: DUMMY_NODE_ID,
|
||||||
node: PatIdent(BindByValue(mutability), path, None),
|
node: PatIdent(BindByValue(mutability), path, None),
|
||||||
span: span
|
span: span
|
||||||
},
|
}),
|
||||||
id: DUMMY_NODE_ID
|
id: DUMMY_NODE_ID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1052,14 +1051,14 @@ pub struct Mod {
|
||||||
/// to the last token in the external file.
|
/// to the last token in the external file.
|
||||||
pub inner: Span,
|
pub inner: Span,
|
||||||
pub view_items: Vec<ViewItem>,
|
pub view_items: Vec<ViewItem>,
|
||||||
pub items: Vec<Gc<Item>>,
|
pub items: Vec<P<Item>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub struct ForeignMod {
|
pub struct ForeignMod {
|
||||||
pub abi: Abi,
|
pub abi: Abi,
|
||||||
pub view_items: Vec<ViewItem>,
|
pub view_items: Vec<ViewItem>,
|
||||||
pub items: Vec<Gc<ForeignItem>>,
|
pub items: Vec<P<ForeignItem>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
|
@ -1071,7 +1070,7 @@ pub struct VariantArg {
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum VariantKind {
|
pub enum VariantKind {
|
||||||
TupleVariantKind(Vec<VariantArg>),
|
TupleVariantKind(Vec<VariantArg>),
|
||||||
StructVariantKind(Gc<StructDef>),
|
StructVariantKind(P<StructDef>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
|
@ -1085,7 +1084,7 @@ pub struct Variant_ {
|
||||||
pub attrs: Vec<Attribute>,
|
pub attrs: Vec<Attribute>,
|
||||||
pub kind: VariantKind,
|
pub kind: VariantKind,
|
||||||
pub id: NodeId,
|
pub id: NodeId,
|
||||||
pub disr_expr: Option<Gc<Expr>>,
|
pub disr_expr: Option<P<Expr>>,
|
||||||
pub vis: Visibility,
|
pub vis: Visibility,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1141,7 +1140,7 @@ pub enum ViewItem_ {
|
||||||
/// (containing arbitrary characters) from which to fetch the crate sources
|
/// (containing arbitrary characters) from which to fetch the crate sources
|
||||||
/// For example, extern crate whatever = "github.com/rust-lang/rust"
|
/// For example, extern crate whatever = "github.com/rust-lang/rust"
|
||||||
ViewItemExternCrate(Ident, Option<(InternedString,StrStyle)>, NodeId),
|
ViewItemExternCrate(Ident, Option<(InternedString,StrStyle)>, NodeId),
|
||||||
ViewItemUse(Gc<ViewPath>),
|
ViewItemUse(P<ViewPath>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Meta-data associated with an item
|
/// Meta-data associated with an item
|
||||||
|
@ -1164,7 +1163,7 @@ pub struct AttrId(pub uint);
|
||||||
pub struct Attribute_ {
|
pub struct Attribute_ {
|
||||||
pub id: AttrId,
|
pub id: AttrId,
|
||||||
pub style: AttrStyle,
|
pub style: AttrStyle,
|
||||||
pub value: Gc<MetaItem>,
|
pub value: P<MetaItem>,
|
||||||
pub is_sugared_doc: bool,
|
pub is_sugared_doc: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1259,13 +1258,13 @@ pub struct Item {
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum Item_ {
|
pub enum Item_ {
|
||||||
ItemStatic(P<Ty>, Mutability, Gc<Expr>),
|
ItemStatic(P<Ty>, Mutability, P<Expr>),
|
||||||
ItemFn(P<FnDecl>, FnStyle, Abi, Generics, P<Block>),
|
ItemFn(P<FnDecl>, FnStyle, Abi, Generics, P<Block>),
|
||||||
ItemMod(Mod),
|
ItemMod(Mod),
|
||||||
ItemForeignMod(ForeignMod),
|
ItemForeignMod(ForeignMod),
|
||||||
ItemTy(P<Ty>, Generics),
|
ItemTy(P<Ty>, Generics),
|
||||||
ItemEnum(EnumDef, Generics),
|
ItemEnum(EnumDef, Generics),
|
||||||
ItemStruct(Gc<StructDef>, Generics),
|
ItemStruct(P<StructDef>, Generics),
|
||||||
/// Represents a Trait Declaration
|
/// Represents a Trait Declaration
|
||||||
ItemTrait(Generics,
|
ItemTrait(Generics,
|
||||||
Option<TyParamBound>, // (optional) default bound not required for Self.
|
Option<TyParamBound>, // (optional) default bound not required for Self.
|
||||||
|
@ -1308,15 +1307,15 @@ pub enum UnboxedClosureKind {
|
||||||
/// that we trans.
|
/// that we trans.
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum InlinedItem {
|
pub enum InlinedItem {
|
||||||
IIItem(Gc<Item>),
|
IIItem(P<Item>),
|
||||||
IITraitItem(DefId /* impl id */, InlinedTraitItem),
|
IITraitItem(DefId /* impl id */, InlinedTraitItem),
|
||||||
IIForeign(Gc<ForeignItem>),
|
IIForeign(P<ForeignItem>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
|
||||||
pub enum InlinedTraitItem {
|
pub enum InlinedTraitItem {
|
||||||
ProvidedInlinedTraitItem(Gc<Method>),
|
ProvidedInlinedTraitItem(P<Method>),
|
||||||
RequiredInlinedTraitItem(Gc<Method>),
|
RequiredInlinedTraitItem(P<Method>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue