]> git.lizzy.rs Git - rust.git/commitdiff
syntax: Switch field privacy as necessary
authorAlex Crichton <alex@alexcrichton.com>
Thu, 27 Mar 2014 22:39:48 +0000 (15:39 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 31 Mar 2014 22:47:36 +0000 (15:47 -0700)
24 files changed:
src/libsyntax/abi.rs
src/libsyntax/ast.rs
src/libsyntax/ast_map.rs
src/libsyntax/ast_util.rs
src/libsyntax/attr.rs
src/libsyntax/codemap.rs
src/libsyntax/crateid.rs
src/libsyntax/diagnostic.rs
src/libsyntax/ext/base.rs
src/libsyntax/ext/deriving/generic.rs
src/libsyntax/ext/deriving/ty.rs
src/libsyntax/ext/expand.rs
src/libsyntax/ext/tt/transcribe.rs
src/libsyntax/lib.rs
src/libsyntax/owned_slice.rs
src/libsyntax/parse/comments.rs
src/libsyntax/parse/common.rs
src/libsyntax/parse/lexer.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs
src/libsyntax/parse/token.rs
src/libsyntax/print/pp.rs
src/libsyntax/print/pprust.rs
src/libsyntax/util/interner.rs

index b833eea6b560cf151dedba0e7eae4b90fdf1c7a7..caded1dc0b84532998336af1f13b41876d156500 100644 (file)
@@ -67,7 +67,7 @@ pub enum AbiArchitecture {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct AbiSet {
-    priv bits: u32   // each bit represents one of the abis below
+    bits: u32   // each bit represents one of the abis below
 }
 
 static AbiDatas: &'static [AbiData] = &[
index 8c47e65f2348012d421d5700cd70d0de4667fad4..3a9cdfb56e32a36424bd91bb47c2124670cafd80 100644 (file)
@@ -40,8 +40,8 @@ pub fn P<T: 'static>(value: T) -> P<T> {
 // That Work Together"
 #[deriving(Clone, Hash, Ord, TotalEq, TotalOrd, Show)]
 pub struct Ident {
-    name: Name,
-    ctxt: SyntaxContext
+    pub name: Name,
+    pub ctxt: SyntaxContext
 }
 
 impl Ident {
@@ -115,9 +115,9 @@ fn decode(d: &mut D) -> Result<Ident, E> {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Lifetime {
-    id: NodeId,
-    span: Span,
-    name: Name
+    pub id: NodeId,
+    pub span: Span,
+    pub name: Name
 }
 
 // a "Path" is essentially Rust's notion of a name;
@@ -126,12 +126,12 @@ pub struct Lifetime {
 // of supporting information.
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Path {
-    span: Span,
+    pub span: Span,
     /// A `::foo` path, is relative to the crate root rather than current
     /// module (like paths in an import).
-    global: bool,
+    pub global: bool,
     /// The segments in the path: the things separated by `::`.
-    segments: Vec<PathSegment> ,
+    pub segments: Vec<PathSegment> ,
 }
 
 /// A segment of a path: an identifier, an optional lifetime, and a set of
@@ -139,11 +139,11 @@ pub struct Path {
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct PathSegment {
     /// The identifier portion of this path segment.
-    identifier: Ident,
+    pub identifier: Ident,
     /// The lifetime parameters for this path segment.
-    lifetimes: Vec<Lifetime>,
+    pub lifetimes: Vec<Lifetime>,
     /// The type parameters for this path segment, if present.
-    types: OwnedSlice<P<Ty>>,
+    pub types: OwnedSlice<P<Ty>>,
 }
 
 pub type CrateNum = u32;
@@ -152,8 +152,8 @@ pub struct PathSegment {
 
 #[deriving(Clone, TotalEq, TotalOrd, Ord, Eq, Encodable, Decodable, Hash, Show)]
 pub struct DefId {
-    krate: CrateNum,
-    node: NodeId,
+    pub krate: CrateNum,
+    pub node: NodeId,
 }
 
 /// Item definitions in the currently-compiled crate would have the CrateNum
@@ -178,16 +178,16 @@ pub enum TyParamBound {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct TyParam {
-    ident: Ident,
-    id: NodeId,
-    bounds: OwnedSlice<TyParamBound>,
-    default: Option<P<Ty>>
+    pub ident: Ident,
+    pub id: NodeId,
+    pub bounds: OwnedSlice<TyParamBound>,
+    pub default: Option<P<Ty>>
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Generics {
-    lifetimes: Vec<Lifetime>,
-    ty_params: OwnedSlice<TyParam>,
+    pub lifetimes: Vec<Lifetime>,
+    pub ty_params: OwnedSlice<TyParam>,
 }
 
 impl Generics {
@@ -259,10 +259,10 @@ pub enum DefRegion {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Crate {
-    module: Mod,
-    attrs: Vec<Attribute> ,
-    config: CrateConfig,
-    span: Span,
+    pub module: Mod,
+    pub attrs: Vec<Attribute>,
+    pub config: CrateConfig,
+    pub span: Span,
 }
 
 pub type MetaItem = Spanned<MetaItem_>;
@@ -301,25 +301,25 @@ fn eq(&self, other: &MetaItem_) -> bool {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Block {
-    view_items: Vec<ViewItem> ,
-    stmts: Vec<@Stmt> ,
-    expr: Option<@Expr>,
-    id: NodeId,
-    rules: BlockCheckMode,
-    span: Span,
+    pub view_items: Vec<ViewItem>,
+    pub stmts: Vec<@Stmt>,
+    pub expr: Option<@Expr>,
+    pub id: NodeId,
+    pub rules: BlockCheckMode,
+    pub span: Span,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Pat {
-    id: NodeId,
-    node: Pat_,
-    span: Span,
+    pub id: NodeId,
+    pub node: Pat_,
+    pub span: Span,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct FieldPat {
-    ident: Ident,
-    pat: @Pat,
+    pub ident: Ident,
+    pub pat: @Pat,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -436,11 +436,11 @@ pub enum Stmt_ {
 /// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Local {
-    ty: P<Ty>,
-    pat: @Pat,
-    init: Option<@Expr>,
-    id: NodeId,
-    span: Span,
+    pub ty: P<Ty>,
+    pub pat: @Pat,
+    pub init: Option<@Expr>,
+    pub id: NodeId,
+    pub span: Span,
 }
 
 pub type Decl = Spanned<Decl_>;
@@ -455,16 +455,16 @@ pub enum Decl_ {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Arm {
-    pats: Vec<@Pat> ,
-    guard: Option<@Expr>,
-    body: @Expr,
+    pub pats: Vec<@Pat>,
+    pub guard: Option<@Expr>,
+    pub body: @Expr,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Field {
-    ident: SpannedIdent,
-    expr: @Expr,
-    span: Span,
+    pub ident: SpannedIdent,
+    pub expr: @Expr,
+    pub span: Span,
 }
 
 pub type SpannedIdent = Spanned<Ident>;
@@ -483,9 +483,9 @@ pub enum UnsafeSource {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Expr {
-    id: NodeId,
-    node: Expr_,
-    span: Span,
+    pub id: NodeId,
+    pub node: Expr_,
+    pub span: Span,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -681,27 +681,27 @@ pub enum Lit_ {
 // type structure in middle/ty.rs as well.
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct MutTy {
-    ty: P<Ty>,
-    mutbl: Mutability,
+    pub ty: P<Ty>,
+    pub mutbl: Mutability,
 }
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct TypeField {
-    ident: Ident,
-    mt: MutTy,
-    span: Span,
+    pub ident: Ident,
+    pub mt: MutTy,
+    pub span: Span,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct TypeMethod {
-    ident: Ident,
-    attrs: Vec<Attribute> ,
-    purity: Purity,
-    decl: P<FnDecl>,
-    generics: Generics,
-    explicit_self: ExplicitSelf,
-    id: NodeId,
-    span: Span,
+    pub ident: Ident,
+    pub attrs: Vec<Attribute>,
+    pub purity: Purity,
+    pub decl: P<FnDecl>,
+    pub generics: Generics,
+    pub explicit_self: ExplicitSelf,
+    pub id: NodeId,
+    pub span: Span,
 }
 
 // A trait method is either required (meaning it doesn't have an
@@ -758,9 +758,9 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 // NB Eq method appears below.
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Ty {
-    id: NodeId,
-    node: Ty_,
-    span: Span,
+    pub id: NodeId,
+    pub node: Ty_,
+    pub span: Span,
 }
 
 // Not represented directly in the AST, referred to by name through a ty_path.
@@ -791,25 +791,25 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct ClosureTy {
-    sigil: Sigil,
-    region: Option<Lifetime>,
-    lifetimes: Vec<Lifetime>,
-    purity: Purity,
-    onceness: Onceness,
-    decl: P<FnDecl>,
+    pub sigil: Sigil,
+    pub region: Option<Lifetime>,
+    pub lifetimes: Vec<Lifetime>,
+    pub purity: Purity,
+    pub onceness: Onceness,
+    pub decl: P<FnDecl>,
     // Optional optvec distinguishes between "fn()" and "fn:()" so we can
     // implement issue #7264. None means "fn()", which means infer a default
     // bound based on pointer sigil during typeck. Some(Empty) means "fn:()",
     // which means use no bounds (e.g., not even Owned on a ~fn()).
-    bounds: Option<OwnedSlice<TyParamBound>>,
+    pub bounds: Option<OwnedSlice<TyParamBound>>,
 }
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct BareFnTy {
-    purity: Purity,
-    abis: AbiSet,
-    lifetimes: Vec<Lifetime>,
-    decl: P<FnDecl>
+    pub purity: Purity,
+    pub abis: AbiSet,
+    pub lifetimes: Vec<Lifetime>,
+    pub decl: P<FnDecl>
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -840,21 +840,21 @@ pub enum AsmDialect {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct InlineAsm {
-    asm: InternedString,
-    asm_str_style: StrStyle,
-    clobbers: InternedString,
-    inputs: Vec<(InternedString, @Expr)> ,
-    outputs: Vec<(InternedString, @Expr)> ,
-    volatile: bool,
-    alignstack: bool,
-    dialect: AsmDialect
+    pub asm: InternedString,
+    pub asm_str_style: StrStyle,
+    pub clobbers: InternedString,
+    pub inputs: Vec<(InternedString, @Expr)>,
+    pub outputs: Vec<(InternedString, @Expr)>,
+    pub volatile: bool,
+    pub alignstack: bool,
+    pub dialect: AsmDialect
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Arg {
-    ty: P<Ty>,
-    pat: @Pat,
-    id: NodeId,
+    pub ty: P<Ty>,
+    pub pat: @Pat,
+    pub id: NodeId,
 }
 
 impl Arg {
@@ -879,10 +879,10 @@ pub fn new_self(span: Span, mutability: Mutability) -> Arg {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct FnDecl {
-    inputs: Vec<Arg> ,
-    output: P<Ty>,
-    cf: RetStyle,
-    variadic: bool
+    pub inputs: Vec<Arg>,
+    pub output: P<Ty>,
+    pub cf: RetStyle,
+    pub variadic: bool
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -921,64 +921,64 @@ pub enum ExplicitSelf_ {
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Method {
-    ident: Ident,
-    attrs: Vec<Attribute> ,
-    generics: Generics,
-    explicit_self: ExplicitSelf,
-    purity: Purity,
-    decl: P<FnDecl>,
-    body: P<Block>,
-    id: NodeId,
-    span: Span,
-    vis: Visibility,
+    pub ident: Ident,
+    pub attrs: Vec<Attribute>,
+    pub generics: Generics,
+    pub explicit_self: ExplicitSelf,
+    pub purity: Purity,
+    pub decl: P<FnDecl>,
+    pub body: P<Block>,
+    pub id: NodeId,
+    pub span: Span,
+    pub vis: Visibility,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Mod {
-    view_items: Vec<ViewItem> ,
-    items: Vec<@Item> ,
+    pub view_items: Vec<ViewItem> ,
+    pub items: Vec<@Item> ,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct ForeignMod {
-    abis: AbiSet,
-    view_items: Vec<ViewItem> ,
-    items: Vec<@ForeignItem> ,
+    pub abis: AbiSet,
+    pub view_items: Vec<ViewItem>,
+    pub items: Vec<@ForeignItem>,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct VariantArg {
-    ty: P<Ty>,
-    id: NodeId,
+    pub ty: P<Ty>,
+    pub id: NodeId,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub enum VariantKind {
-    TupleVariantKind(Vec<VariantArg> ),
+    TupleVariantKind(Vec<VariantArg>),
     StructVariantKind(@StructDef),
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct EnumDef {
-    variants: Vec<P<Variant>> ,
+    pub variants: Vec<P<Variant>>,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Variant_ {
-    name: Ident,
-    attrs: Vec<Attribute> ,
-    kind: VariantKind,
-    id: NodeId,
-    disr_expr: Option<@Expr>,
-    vis: Visibility,
+    pub name: Ident,
+    pub attrs: Vec<Attribute>,
+    pub kind: VariantKind,
+    pub id: NodeId,
+    pub disr_expr: Option<@Expr>,
+    pub vis: Visibility,
 }
 
 pub type Variant = Spanned<Variant_>;
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct PathListIdent_ {
-    name: Ident,
-    id: NodeId,
+    pub name: Ident,
+    pub id: NodeId,
 }
 
 pub type PathListIdent = Spanned<PathListIdent_>;
@@ -1004,10 +1004,10 @@ pub enum ViewPath_ {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct ViewItem {
-    node: ViewItem_,
-    attrs: Vec<Attribute> ,
-    vis: Visibility,
-    span: Span,
+    pub node: ViewItem_,
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub span: Span,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -1035,9 +1035,9 @@ pub enum AttrStyle {
 // doc-comments are promoted to attributes that have is_sugared_doc = true
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Attribute_ {
-    style: AttrStyle,
-    value: @MetaItem,
-    is_sugared_doc: bool,
+    pub style: AttrStyle,
+    pub value: @MetaItem,
+    pub is_sugared_doc: bool,
 }
 
 /*
@@ -1049,8 +1049,8 @@ pub struct Attribute_ {
  */
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct TraitRef {
-    path: Path,
-    ref_id: NodeId,
+    pub path: Path,
+    pub ref_id: NodeId,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -1071,10 +1071,10 @@ pub fn inherit_from(&self, parent_visibility: Visibility) -> Visibility {
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct StructField_ {
-    kind: StructFieldKind,
-    id: NodeId,
-    ty: P<Ty>,
-    attrs: Vec<Attribute> ,
+    pub kind: StructFieldKind,
+    pub id: NodeId,
+    pub ty: P<Ty>,
+    pub attrs: Vec<Attribute>,
 }
 
 pub type StructField = Spanned<StructField_>;
@@ -1096,10 +1096,10 @@ pub fn is_unnamed(&self) -> bool {
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct StructDef {
-    fields: Vec<StructField> , /* fields, not including ctor */
+    pub fields: Vec<StructField>, /* fields, not including ctor */
     /* ID of the constructor. This is only used for tuple- or enum-like
      * structs. */
-    ctor_id: Option<NodeId>
+    pub ctor_id: Option<NodeId>
 }
 
 /*
@@ -1108,12 +1108,12 @@ pub struct StructDef {
  */
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Item {
-    ident: Ident,
-    attrs: Vec<Attribute> ,
-    id: NodeId,
-    node: Item_,
-    vis: Visibility,
-    span: Span,
+    pub ident: Ident,
+    pub attrs: Vec<Attribute>,
+    pub id: NodeId,
+    pub node: Item_,
+    pub vis: Visibility,
+    pub span: Span,
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
@@ -1136,12 +1136,12 @@ pub enum Item_ {
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct ForeignItem {
-    ident: Ident,
-    attrs: Vec<Attribute> ,
-    node: ForeignItem_,
-    id: NodeId,
-    span: Span,
-    vis: Visibility,
+    pub ident: Ident,
+    pub attrs: Vec<Attribute>,
+    pub node: ForeignItem_,
+    pub id: NodeId,
+    pub span: Span,
+    pub vis: Visibility,
 }
 
 #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)]
index 5db353b7262a5ef1dce15093e7f3c6894e614c52..f07b0e71c1ce1245f9a9c30482851da13ac2ef73 100644 (file)
@@ -184,7 +184,7 @@ pub struct Map {
     ///
     /// Also, indexing is pretty quick when you've got a vector and
     /// plain old integers.
-    priv map: RefCell<Vec<MapEntry> >
+    map: RefCell<Vec<MapEntry> >
 }
 
 impl Map {
index 1676a130235562071bf158587e8698ecac978314..631489a65b2309093d09fdb1cd0166006692ec86 100644 (file)
@@ -325,8 +325,8 @@ pub fn empty_generics() -> Generics {
 
 #[deriving(Encodable, Decodable)]
 pub struct IdRange {
-    min: NodeId,
-    max: NodeId,
+    pub min: NodeId,
+    pub max: NodeId,
 }
 
 impl IdRange {
@@ -352,9 +352,9 @@ pub trait IdVisitingOperation {
 }
 
 pub struct IdVisitor<'a, O> {
-    operation: &'a O,
-    pass_through_items: bool,
-    visited_outermost: bool,
+    pub operation: &'a O,
+    pub pass_through_items: bool,
+    pub visited_outermost: bool,
 }
 
 impl<'a, O: IdVisitingOperation> IdVisitor<'a, O> {
index ff9f9dece95d17e589dfb2beee1de413efb4fb5e..0c0d7bbb535f7e3fccd0eb1578e2549e83672279 100644 (file)
@@ -337,8 +337,8 @@ pub fn test_cfg<AM: AttrMetaMethods, It: Iterator<AM>>
 
 /// Represents the #[deprecated="foo"] (etc) attributes.
 pub struct Stability {
-    level: StabilityLevel,
-    text: Option<InternedString>
+    pub level: StabilityLevel,
+    pub text: Option<InternedString>
 }
 
 /// The available stability levels.
index 974868c16109288ffc1456a7dc318deab0bdb7c4..0d2492d7fad0f0de698ab6591c14fa8a39c076ba 100644 (file)
@@ -86,19 +86,19 @@ fn sub(&self, rhs: &CharPos) -> CharPos {
 */
 #[deriving(Clone, Show, Hash)]
 pub struct Span {
-    lo: BytePos,
-    hi: BytePos,
+    pub lo: BytePos,
+    pub hi: BytePos,
     /// Information about where the macro came from, if this piece of
     /// code was created by a macro expansion.
-    expn_info: Option<@ExpnInfo>
+    pub expn_info: Option<@ExpnInfo>
 }
 
 pub static DUMMY_SP: Span = Span { lo: BytePos(0), hi: BytePos(0), expn_info: None };
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct Spanned<T> {
-    node: T,
-    span: Span,
+    pub node: T,
+    pub span: Span,
 }
 
 impl Eq for Span {
@@ -143,26 +143,26 @@ pub fn mk_sp(lo: BytePos, hi: BytePos) -> Span {
 /// A source code location used for error reporting
 pub struct Loc {
     /// Information about the original source
-    file: Rc<FileMap>,
+    pub file: Rc<FileMap>,
     /// The (1-based) line number
-    line: uint,
+    pub line: uint,
     /// The (0-based) column offset
-    col: CharPos
+    pub col: CharPos
 }
 
 /// A source code location used as the result of lookup_char_pos_adj
 // Actually, *none* of the clients use the filename *or* file field;
 // perhaps they should just be removed.
 pub struct LocWithOpt {
-    filename: FileName,
-    line: uint,
-    col: CharPos,
-    file: Option<Rc<FileMap>>,
+    pub filename: FileName,
+    pub line: uint,
+    pub col: CharPos,
+    pub file: Option<Rc<FileMap>>,
 }
 
 // used to be structural records. Better names, anyone?
-pub struct FileMapAndLine {fm: Rc<FileMap>, line: uint}
-pub struct FileMapAndBytePos {fm: Rc<FileMap>, pos: BytePos}
+pub struct FileMapAndLine { pub fm: Rc<FileMap>, pub line: uint }
+pub struct FileMapAndBytePos { pub fm: Rc<FileMap>, pub pos: BytePos }
 
 /// The syntax with which a macro was invoked.
 #[deriving(Clone, Hash, Show)]
@@ -177,13 +177,13 @@ pub enum MacroFormat {
 pub struct NameAndSpan {
     /// The name of the macro that was invoked to create the thing
     /// with this Span.
-    name: ~str,
+    pub name: ~str,
     /// The format with which the macro was invoked.
-    format: MacroFormat,
+    pub format: MacroFormat,
     /// The span of the macro definition itself. The macro may not
     /// have a sensible definition span (e.g. something defined
     /// completely inside libsyntax) in which case this is None.
-    span: Option<Span>
+    pub span: Option<Span>
 }
 
 /// Extra information for tracking macro expansion of spans
@@ -198,29 +198,29 @@ pub struct ExpnInfo {
     /// the expansion would point to the `bar!` invocation; that
     /// call_site span would have its own ExpnInfo, with the call_site
     /// pointing to the `foo!` invocation.
-    call_site: Span,
+    pub call_site: Span,
     /// Information about the macro and its definition.
     ///
     /// The `callee` of the inner expression in the `call_site`
     /// example would point to the `macro_rules! bar { ... }` and that
     /// of the `bar!()` invocation would point to the `macro_rules!
     /// foo { ... }`.
-    callee: NameAndSpan
+    pub callee: NameAndSpan
 }
 
 pub type FileName = ~str;
 
 pub struct FileLines {
-    file: Rc<FileMap>,
-    lines: Vec<uint>
+    pub file: Rc<FileMap>,
+    pub lines: Vec<uint>
 }
 
 /// Identifies an offset of a multi-byte character in a FileMap
 pub struct MultiByteChar {
     /// The absolute offset of the character in the CodeMap
-    pos: BytePos,
+    pub pos: BytePos,
     /// The number of bytes, >=2
-    bytes: uint,
+    pub bytes: uint,
 }
 
 /// A single source in the CodeMap
@@ -228,15 +228,15 @@ pub struct FileMap {
     /// The name of the file that the source came from, source that doesn't
     /// originate from files has names between angle brackets by convention,
     /// e.g. `<anon>`
-    name: FileName,
+    pub name: FileName,
     /// The complete source code
-    src: ~str,
+    pub src: ~str,
     /// The start position of this source in the CodeMap
-    start_pos: BytePos,
+    pub start_pos: BytePos,
     /// Locations of lines beginnings in the source code
-    lines: RefCell<Vec<BytePos> >,
+    pub lines: RefCell<Vec<BytePos> >,
     /// Locations of multi-byte characters in the source code
-    multibyte_chars: RefCell<Vec<MultiByteChar> >,
+    pub multibyte_chars: RefCell<Vec<MultiByteChar> >,
 }
 
 impl FileMap {
@@ -284,7 +284,7 @@ pub fn is_real_file(&self) -> bool {
 }
 
 pub struct CodeMap {
-    files: RefCell<Vec<Rc<FileMap>>>
+    pub files: RefCell<Vec<Rc<FileMap>>>
 }
 
 impl CodeMap {
index 96664fc39f6c2e8210ad1a887dbd838d9a994e35..353e1a23b5e089c099825206b9e1d08891d96809 100644 (file)
 pub struct CrateId {
     /// A path which represents the codes origin. By convention this is the
     /// URL, without `http://` or `https://` prefix, to the crate's repository
-    path: ~str,
+    pub path: ~str,
     /// The name of the crate.
-    name: ~str,
+    pub name: ~str,
     /// The version of the crate.
-    version: Option<~str>,
+    pub version: Option<~str>,
 }
 
 impl fmt::Show for CrateId {
index faeb7b4e0f24d0adbcb6bb72c6d8990e70f44f8c..fb0f458b88a2bbb05e4e2100cd0e20a66af4b2c1 100644 (file)
@@ -40,8 +40,8 @@ fn custom_emit(&mut self, cm: &codemap::CodeMap,
 // accepts span information for source-location
 // reporting.
 pub struct SpanHandler {
-    handler: Handler,
-    cm: codemap::CodeMap,
+    pub handler: Handler,
+    pub cm: codemap::CodeMap,
 }
 
 impl SpanHandler {
@@ -216,7 +216,7 @@ fn print_diagnostic(dst: &mut EmitterWriter,
 }
 
 pub struct EmitterWriter {
-    priv dst: Destination,
+    dst: Destination,
 }
 
 enum Destination {
index 2bcb9c4a229be1ec2fb2e65a635ff62ca7f10c38..7ff779231325197dcdde806e77d277a3f7c4500d 100644 (file)
@@ -30,8 +30,8 @@
 // ast::MacInvocTT.
 
 pub struct MacroDef {
-    name: ~str,
-    ext: SyntaxExtension
+    pub name: ~str,
+    pub ext: SyntaxExtension
 }
 
 pub type ItemDecorator =
@@ -41,8 +41,8 @@ pub struct MacroDef {
     fn(&mut ExtCtxt, Span, @ast::MetaItem, @ast::Item) -> @ast::Item;
 
 pub struct BasicMacroExpander {
-    expander: MacroExpanderFn,
-    span: Option<Span>
+    pub expander: MacroExpanderFn,
+    pub span: Option<Span>
 }
 
 pub trait MacroExpander {
@@ -68,8 +68,8 @@ fn expand(&self,
 }
 
 pub struct BasicIdentMacroExpander {
-    expander: IdentMacroExpanderFn,
-    span: Option<Span>
+    pub expander: IdentMacroExpanderFn,
+    pub span: Option<Span>
 }
 
 pub trait IdentMacroExpander {
@@ -172,9 +172,9 @@ pub enum SyntaxExtension {
 
 pub struct BlockInfo {
     // should macros escape from this scope?
-    macros_escape: bool,
+    pub macros_escape: bool,
     // what are the pending renames?
-    pending_renames: RenameList,
+    pub pending_renames: RenameList,
 }
 
 impl BlockInfo {
@@ -292,8 +292,8 @@ fn builtin_normal_expander(f: MacroExpanderFn) -> SyntaxExtension {
 }
 
 pub struct MacroCrate {
-    lib: Option<Path>,
-    cnum: ast::CrateNum,
+    pub lib: Option<Path>,
+    pub cnum: ast::CrateNum,
 }
 
 pub trait CrateLoader {
@@ -306,13 +306,13 @@ pub trait CrateLoader {
 // when a macro expansion occurs, the resulting nodes have the backtrace()
 // -> expn_info of their expansion context stored into their span.
 pub struct ExtCtxt<'a> {
-    parse_sess: &'a parse::ParseSess,
-    cfg: ast::CrateConfig,
-    backtrace: Option<@ExpnInfo>,
-    ecfg: expand::ExpansionConfig<'a>,
+    pub parse_sess: &'a parse::ParseSess,
+    pub cfg: ast::CrateConfig,
+    pub backtrace: Option<@ExpnInfo>,
+    pub ecfg: expand::ExpansionConfig<'a>,
 
-    mod_path: Vec<ast::Ident> ,
-    trace_mac: bool
+    pub mod_path: Vec<ast::Ident> ,
+    pub trace_mac: bool,
 }
 
 impl<'a> ExtCtxt<'a> {
@@ -532,7 +532,7 @@ struct MapChainFrame {
 
 // Only generic to make it easy to test
 pub struct SyntaxEnv {
-    priv chain: Vec<MapChainFrame> ,
+    chain: Vec<MapChainFrame> ,
 }
 
 impl SyntaxEnv {
index 63e9a466a8e877e15b451cb595ea5daf794e0456..0d851647b3de1d45936bd340b54ad94e904575dd 100644 (file)
@@ -192,75 +192,77 @@ fn eq(&self, other: &int) -> bool {
 
 pub struct TraitDef<'a> {
     /// The span for the current #[deriving(Foo)] header.
-    span: Span,
+    pub span: Span,
 
-    attributes: Vec<ast::Attribute> ,
+    pub attributes: Vec<ast::Attribute>,
 
     /// Path of the trait, including any type parameters
-    path: Path<'a>,
+    pub path: Path<'a>,
 
     /// Additional bounds required of any type parameters of the type,
     /// other than the current trait
-    additional_bounds: Vec<Ty<'a>> ,
+    pub additional_bounds: Vec<Ty<'a>>,
 
     /// Any extra lifetimes and/or bounds, e.g. `D: serialize::Decoder`
-    generics: LifetimeBounds<'a>,
+    pub generics: LifetimeBounds<'a>,
 
-    methods: Vec<MethodDef<'a>> }
+    pub methods: Vec<MethodDef<'a>>,
+}
 
 
 pub struct MethodDef<'a> {
     /// name of the method
-    name: &'a str,
+    pub name: &'a str,
     /// List of generics, e.g. `R: rand::Rng`
-    generics: LifetimeBounds<'a>,
+    pub generics: LifetimeBounds<'a>,
 
     /// Whether there is a self argument (outer Option) i.e. whether
     /// this is a static function, and whether it is a pointer (inner
     /// Option)
-    explicit_self: Option<Option<PtrTy<'a>>>,
+    pub explicit_self: Option<Option<PtrTy<'a>>>,
 
     /// Arguments other than the self argument
-    args: Vec<Ty<'a>> ,
+    pub args: Vec<Ty<'a>>,
 
     /// Return type
-    ret_ty: Ty<'a>,
+    pub ret_ty: Ty<'a>,
 
     /// Whether to mark this as #[inline]
-    inline: bool,
+    pub inline: bool,
 
     /// if the value of the nonmatching enums is independent of the
     /// actual enum variants, i.e. can use _ => .. match.
-    const_nonmatching: bool,
+    pub const_nonmatching: bool,
 
-    combine_substructure: CombineSubstructureFunc<'a>
+    pub combine_substructure: CombineSubstructureFunc<'a>,
 }
 
 /// All the data about the data structure/method being derived upon.
 pub struct Substructure<'a> {
     /// ident of self
-    type_ident: Ident,
+    pub type_ident: Ident,
     /// ident of the method
-    method_ident: Ident,
+    pub method_ident: Ident,
     /// dereferenced access to any Self or Ptr(Self, _) arguments
-    self_args: &'a [@Expr],
+    pub self_args: &'a [@Expr],
     /// verbatim access to any other arguments
-    nonself_args: &'a [@Expr],
-    fields: &'a SubstructureFields<'a>
+    pub nonself_args: &'a [@Expr],
+    pub fields: &'a SubstructureFields<'a>
 }
 
 /// Summary of the relevant parts of a struct/enum field.
 pub struct FieldInfo {
-    span: Span,
+    pub span: Span,
     /// None for tuple structs/normal enum variants, Some for normal
     /// structs/struct enum variants.
-    name: Option<Ident>,
+    pub name: Option<Ident>,
     /// The expression corresponding to this field of `self`
     /// (specifically, a reference to it).
-    self_: @Expr,
+    pub self_: @Expr,
     /// The expressions corresponding to references to this field in
     /// the other Self arguments.
-    other: Vec<@Expr> }
+    pub other: Vec<@Expr>,
+}
 
 /// Fields for a static method
 pub enum StaticFields {
index e58c024fcb01435fbbf6e83d89561a155ca9d53f..c4ca2601f601e27bc056ea9a41c30f1e26873388 100644 (file)
@@ -29,10 +29,10 @@ pub enum PtrTy<'a> {
 /// A path, e.g. `::std::option::Option::<int>` (global). Has support
 /// for type parameters and a lifetime.
 pub struct Path<'a> {
-    path: Vec<&'a str> ,
-    lifetime: Option<&'a str>,
-    params: Vec<~Ty<'a>> ,
-    global: bool
+    pub path: Vec<&'a str> ,
+    pub lifetime: Option<&'a str>,
+    pub params: Vec<~Ty<'a>> ,
+    pub global: bool,
 }
 
 impl<'a> Path<'a> {
@@ -205,8 +205,8 @@ fn mk_generics(lifetimes: Vec<ast::Lifetime> ,  ty_params: Vec<ast::TyParam> ) -
 
 /// Lifetimes and bounds on type parameters
 pub struct LifetimeBounds<'a> {
-    lifetimes: Vec<&'a str>,
-    bounds: Vec<(&'a str, Vec<Path<'a>>)>,
+    pub lifetimes: Vec<&'a str>,
+    pub bounds: Vec<(&'a str, Vec<Path<'a>>)>,
 }
 
 impl<'a> LifetimeBounds<'a> {
index aa9330bf65764ee631e7080e99fdf662dea0dbd2..747ab583e792a27333acd5c4da0bf2b49ee120bc 100644 (file)
@@ -838,8 +838,8 @@ pub fn new_span(cx: &ExtCtxt, sp: Span) -> Span {
 }
 
 pub struct MacroExpander<'a, 'b> {
-    extsbox: SyntaxEnv,
-    cx: &'a mut ExtCtxt<'b>,
+    pub extsbox: SyntaxEnv,
+    pub cx: &'a mut ExtCtxt<'b>,
 }
 
 impl<'a, 'b> Folder for MacroExpander<'a, 'b> {
@@ -869,9 +869,9 @@ fn new_span(&mut self, span: Span) -> Span {
 }
 
 pub struct ExpansionConfig<'a> {
-    loader: &'a mut CrateLoader,
-    deriving_hash_type_parameter: bool,
-    crate_id: CrateId,
+    pub loader: &'a mut CrateLoader,
+    pub deriving_hash_type_parameter: bool,
+    pub crate_id: CrateId,
 }
 
 pub fn expand_crate(parse_sess: &parse::ParseSess,
index bc8709befaee26c18b79d63c619c11390ad08d49..8fa4857cab02cb9c5106fa1b6595e077940500bd 100644 (file)
@@ -31,16 +31,16 @@ struct TtFrame {
 
 #[deriving(Clone)]
 pub struct TtReader<'a> {
-    sp_diag: &'a SpanHandler,
+    pub sp_diag: &'a SpanHandler,
     // the unzipped tree:
-    priv stack: Vec<TtFrame>,
+    stack: Vec<TtFrame>,
     /* for MBE-style macro transcription */
-    priv interpolations: HashMap<Ident, Rc<NamedMatch>>,
-    priv repeat_idx: Vec<uint>,
-    priv repeat_len: Vec<uint>,
+    interpolations: HashMap<Ident, Rc<NamedMatch>>,
+    repeat_idx: Vec<uint>,
+    repeat_len: Vec<uint>,
     /* cached: */
-    cur_tok: Token,
-    cur_span: Span,
+    pub cur_tok: Token,
+    pub cur_span: Span,
 }
 
 /** This can do Macro-By-Example transcription. On the other hand, if
index 86795b6623c7c6b9dfa4f6c4e02d8de5cce7fe2d..e25a84d6cd45d939094645a3b0f18667eccb3ce8 100644 (file)
@@ -30,6 +30,8 @@
            quote)]
 #![allow(deprecated)]
 
+#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
+
 extern crate serialize;
 extern crate term;
 extern crate collections;
index e5e3a05f9988346a101b879519b5b1c6d2685c42..57529228b51f9d1d82a63b325618a2bc1fbb5af2 100644 (file)
@@ -18,8 +18,8 @@
 #[unsafe_no_drop_flag] // data is set to null on destruction
 pub struct OwnedSlice<T> {
     /// null iff len == 0
-    priv data: *mut T,
-    priv len: uint,
+    data: *mut T,
+    len: uint,
 }
 
 #[unsafe_destructor]
index 7d337e9c0785209751931b4e6c27b18edb7cf0da..3bf1474c4612d8669875e0004ff184222c3bb049 100644 (file)
@@ -31,9 +31,9 @@ pub enum CommentStyle {
 
 #[deriving(Clone)]
 pub struct Comment {
-    style: CommentStyle,
-    lines: Vec<~str> ,
-    pos: BytePos
+    pub style: CommentStyle,
+    pub lines: Vec<~str>,
+    pub pos: BytePos,
 }
 
 pub fn is_doc_comment(s: &str) -> bool {
@@ -338,8 +338,8 @@ fn consume_comment(rdr: &mut StringReader,
 
 #[deriving(Clone)]
 pub struct Literal {
-    lit: ~str,
-    pos: BytePos
+    pub lit: ~str,
+    pub pos: BytePos,
 }
 
 // it appears this function is called only from pprust... that's
index 460ad76cffeb9e3b369cd9e23e9ee5436c018963..0d40638d3a7dcb867df2ceddd229d38b3ee60175 100644 (file)
@@ -13,8 +13,8 @@
 // SeqSep : a sequence separator (token)
 // and whether a trailing separator is allowed.
 pub struct SeqSep {
-    sep: Option<token::Token>,
-    trailing_sep_allowed: bool
+    pub sep: Option<token::Token>,
+    pub trailing_sep_allowed: bool
 }
 
 pub fn seq_sep_trailing_disallowed(t: token::Token) -> SeqSep {
index c18571deaf5bee85cf445eb99cdc1acb7058d4e8..23d7cc0af97e4e4e18b65ecac8130e3c73f634eb 100644 (file)
@@ -34,24 +34,24 @@ pub trait Reader {
 
 #[deriving(Clone, Eq, Show)]
 pub struct TokenAndSpan {
-    tok: token::Token,
-    sp: Span,
+    pub tok: token::Token,
+    pub sp: Span,
 }
 
 pub struct StringReader<'a> {
-    span_diagnostic: &'a SpanHandler,
+    pub span_diagnostic: &'a SpanHandler,
     // The absolute offset within the codemap of the next character to read
-    pos: BytePos,
+    pub pos: BytePos,
     // The absolute offset within the codemap of the last character read(curr)
-    last_pos: BytePos,
+    pub last_pos: BytePos,
     // The column of the next character to read
-    col: CharPos,
+    pub col: CharPos,
     // The last character to be read
-    curr: Option<char>,
-    filemap: Rc<codemap::FileMap>,
+    pub curr: Option<char>,
+    pub filemap: Rc<codemap::FileMap>,
     /* cached: */
-    peek_tok: token::Token,
-    peek_span: Span,
+    pub peek_tok: token::Token,
+    pub peek_span: Span,
 }
 
 impl<'a> StringReader<'a> {
index 36f33befb7aeb7219f950f96c079e846b814490a..76126e6780a2b7f7ed3dd24f0ea9d81bedb4e790 100644 (file)
@@ -39,7 +39,7 @@
 
 // info about a parsing session.
 pub struct ParseSess {
-    span_diagnostic: SpanHandler, // better be the same as the one in the reader!
+    pub span_diagnostic: SpanHandler, // better be the same as the one in the reader!
     /// Used to determine and report recursive mod inclusions
     included_mod_stack: RefCell<Vec<Path>>,
 }
index bf96983cc7fa984b9ee74d2317d465f4826b08f4..2d0c4ca488eab3d7476b2af9009e5a2b7480b952 100644 (file)
@@ -78,7 +78,6 @@
 use owned_slice::OwnedSlice;
 
 use collections::HashSet;
-use std::kinds::marker;
 use std::mem::replace;
 use std::rc::Rc;
 
@@ -113,8 +112,8 @@ pub enum PathParsingMode {
 
 /// A path paired with optional type bounds.
 pub struct PathAndBounds {
-    path: ast::Path,
-    bounds: Option<OwnedSlice<TyParamBound>>,
+    pub path: ast::Path,
+    pub bounds: Option<OwnedSlice<TyParamBound>>,
 }
 
 enum ItemOrViewItem {
@@ -306,38 +305,35 @@ pub fn Parser<'a>(sess: &'a ParseSess, cfg: ast::CrateConfig, mut rdr: ~Reader:)
         obsolete_set: HashSet::new(),
         mod_path_stack: Vec::new(),
         open_braces: Vec::new(),
-        nocopy: marker::NoCopy
     }
 }
 
 pub struct Parser<'a> {
-    sess: &'a ParseSess,
-    cfg: CrateConfig,
+    pub sess: &'a ParseSess,
     // the current token:
-    token: token::Token,
+    pub token: token::Token,
     // the span of the current token:
-    span: Span,
+    pub span: Span,
     // the span of the prior token:
-    last_span: Span,
+    pub last_span: Span,
+    pub cfg: CrateConfig,
     // the previous token or None (only stashed sometimes).
-    last_token: Option<~token::Token>,
-    buffer: [TokenAndSpan, ..4],
-    buffer_start: int,
-    buffer_end: int,
-    tokens_consumed: uint,
-    restriction: restriction,
-    quote_depth: uint, // not (yet) related to the quasiquoter
-    reader: ~Reader:,
-    interner: Rc<token::IdentInterner>,
+    pub last_token: Option<~token::Token>,
+    pub buffer: [TokenAndSpan, ..4],
+    pub buffer_start: int,
+    pub buffer_end: int,
+    pub tokens_consumed: uint,
+    pub restriction: restriction,
+    pub quote_depth: uint, // not (yet) related to the quasiquoter
+    pub reader: ~Reader:,
+    pub interner: Rc<token::IdentInterner>,
     /// The set of seen errors about obsolete syntax. Used to suppress
     /// extra detail when the same error is seen twice
-    obsolete_set: HashSet<ObsoleteSyntax>,
+    pub obsolete_set: HashSet<ObsoleteSyntax>,
     /// Used to determine the path to externally loaded source files
-    mod_path_stack: Vec<InternedString> ,
+    pub mod_path_stack: Vec<InternedString>,
     /// Stack of spans of open delimiters. Used for error message.
-    open_braces: Vec<Span> ,
-    /* do not copy the parser; its state is tied to outside state */
-    priv nocopy: marker::NoCopy
+    pub open_braces: Vec<Span>,
 }
 
 fn is_plain_ident_or_underscore(t: &token::Token) -> bool {
index b7586b5de1494ef7a9861d9419010491874903cc..2c5698ddec4035fe1403db90f9106cf98805d799 100644 (file)
@@ -556,7 +556,7 @@ pub fn get_ident_interner() -> Rc<IdentInterner> {
 /// somehow.
 #[deriving(Clone, Eq, Hash, Ord, TotalEq, TotalOrd)]
 pub struct InternedString {
-    priv string: RcStr,
+    string: RcStr,
 }
 
 impl InternedString {
index 4996c1e96a86b0d673270d0d38a15a3418a535c1..7b64d0293cce4816c51e4628d3a513b75950c67a 100644 (file)
@@ -257,7 +257,7 @@ pub fn mk_printer(out: ~io::Writer, linewidth: uint) -> Printer {
  * called 'print'.
  */
 pub struct Printer {
-    out: ~io::Writer,
+    pub out: ~io::Writer,
     buf_len: uint,
     margin: int, // width of lines we're constrained to
     space: int, // number of spaces left on line
index b410e0c7169ab49b038f69743c21f63e2a336c38..98a3ff309162390574efe160fd12bd47aeaefb1e 100644 (file)
@@ -54,7 +54,7 @@ pub struct CurrentCommentAndLiteral {
 }
 
 pub struct State<'a> {
-    s: pp::Printer,
+    pub s: pp::Printer,
     cm: Option<&'a CodeMap>,
     intr: Rc<token::IdentInterner>,
     comments: Option<Vec<comments::Comment> >,
index 969b9f81785e164dbfabd6c636dc895f42749711..b7932da8738da909c4e84d81e2c3e880f7e4bf62 100644 (file)
@@ -23,8 +23,8 @@
 use std::rc::Rc;
 
 pub struct Interner<T> {
-    priv map: RefCell<HashMap<T, Name>>,
-    priv vect: RefCell<Vec<T> >,
+    map: RefCell<HashMap<T, Name>>,
+    vect: RefCell<Vec<T> >,
 }
 
 // when traits can extend traits, we should extend index<Name,T> to get []
@@ -92,7 +92,7 @@ pub fn clear(&self) {
 
 #[deriving(Clone, Eq, Hash, Ord)]
 pub struct RcStr {
-    priv string: Rc<~str>,
+    string: Rc<~str>,
 }
 
 impl TotalEq for RcStr {}
@@ -134,8 +134,8 @@ pub fn new(string: &str) -> RcStr {
 // A StrInterner differs from Interner<String> in that it accepts
 // &str rather than RcStr, resulting in less allocation.
 pub struct StrInterner {
-    priv map: RefCell<HashMap<RcStr, Name>>,
-    priv vect: RefCell<Vec<RcStr> >,
+    map: RefCell<HashMap<RcStr, Name>>,
+    vect: RefCell<Vec<RcStr> >,
 }
 
 // when traits can extend traits, we should extend index<Name,T> to get []