diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index b833eea6b56..caded1dc0b8 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -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] = &[ diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 8c47e65f234..3a9cdfb56e3 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -40,8 +40,8 @@ pub fn P(value: T) -> P { // 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 @@ pub type FnIdent = Option; #[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 , + pub segments: Vec , } /// 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, + pub lifetimes: Vec, /// The type parameters for this path segment, if present. - types: OwnedSlice>, + pub types: OwnedSlice>, } pub type CrateNum = u32; @@ -152,8 +152,8 @@ pub type NodeId = u32; #[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, - default: Option> + pub ident: Ident, + pub id: NodeId, + pub bounds: OwnedSlice, + pub default: Option> } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Generics { - lifetimes: Vec, - ty_params: OwnedSlice, + pub lifetimes: Vec, + pub ty_params: OwnedSlice, } impl Generics { @@ -259,10 +259,10 @@ pub type CrateConfig = Vec<@MetaItem> ; #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Crate { - module: Mod, - attrs: Vec , - config: CrateConfig, - span: Span, + pub module: Mod, + pub attrs: Vec, + pub config: CrateConfig, + pub span: Span, } pub type MetaItem = Spanned; @@ -301,25 +301,25 @@ impl Eq for MetaItem_ { #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Block { - view_items: Vec , - stmts: Vec<@Stmt> , - expr: Option<@Expr>, - id: NodeId, - rules: BlockCheckMode, - span: Span, + pub view_items: Vec, + 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 : = ;` #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Local { - ty: P, - pat: @Pat, - init: Option<@Expr>, - id: NodeId, - span: Span, + pub ty: P, + pub pat: @Pat, + pub init: Option<@Expr>, + pub id: NodeId, + pub span: Span, } pub type Decl = Spanned; @@ -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; @@ -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, - mutbl: Mutability, + pub ty: P, + 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 , - purity: Purity, - decl: P, - generics: Generics, - explicit_self: ExplicitSelf, - id: NodeId, - span: Span, + pub ident: Ident, + pub attrs: Vec, + pub purity: Purity, + pub decl: P, + 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 @@ impl fmt::Show for FloatTy { // 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 @@ impl fmt::Show for Onceness { #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)] pub struct ClosureTy { - sigil: Sigil, - region: Option, - lifetimes: Vec, - purity: Purity, - onceness: Onceness, - decl: P, + pub sigil: Sigil, + pub region: Option, + pub lifetimes: Vec, + pub purity: Purity, + pub onceness: Onceness, + pub decl: P, // 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>, + pub bounds: Option>, } #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)] pub struct BareFnTy { - purity: Purity, - abis: AbiSet, - lifetimes: Vec, - decl: P + pub purity: Purity, + pub abis: AbiSet, + pub lifetimes: Vec, + pub decl: P } #[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, - pat: @Pat, - id: NodeId, + pub ty: P, + pub pat: @Pat, + pub id: NodeId, } impl Arg { @@ -879,10 +879,10 @@ impl Arg { #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct FnDecl { - inputs: Vec , - output: P, - cf: RetStyle, - variadic: bool + pub inputs: Vec, + pub output: P, + pub cf: RetStyle, + pub variadic: bool } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] @@ -921,64 +921,64 @@ pub type ExplicitSelf = Spanned; #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Method { - ident: Ident, - attrs: Vec , - generics: Generics, - explicit_self: ExplicitSelf, - purity: Purity, - decl: P, - body: P, - id: NodeId, - span: Span, - vis: Visibility, + pub ident: Ident, + pub attrs: Vec, + pub generics: Generics, + pub explicit_self: ExplicitSelf, + pub purity: Purity, + pub decl: P, + pub body: P, + pub id: NodeId, + pub span: Span, + pub vis: Visibility, } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Mod { - view_items: Vec , - items: Vec<@Item> , + pub view_items: Vec , + pub items: Vec<@Item> , } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct ForeignMod { - abis: AbiSet, - view_items: Vec , - items: Vec<@ForeignItem> , + pub abis: AbiSet, + pub view_items: Vec, + pub items: Vec<@ForeignItem>, } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct VariantArg { - ty: P, - id: NodeId, + pub ty: P, + pub id: NodeId, } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub enum VariantKind { - TupleVariantKind(Vec ), + TupleVariantKind(Vec), StructVariantKind(@StructDef), } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct EnumDef { - variants: Vec> , + pub variants: Vec>, } #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Variant_ { - name: Ident, - attrs: Vec , - kind: VariantKind, - id: NodeId, - disr_expr: Option<@Expr>, - vis: Visibility, + pub name: Ident, + pub attrs: Vec, + pub kind: VariantKind, + pub id: NodeId, + pub disr_expr: Option<@Expr>, + pub vis: Visibility, } pub type Variant = Spanned; #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct PathListIdent_ { - name: Ident, - id: NodeId, + pub name: Ident, + pub id: NodeId, } pub type PathListIdent = Spanned; @@ -1004,10 +1004,10 @@ pub enum ViewPath_ { #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct ViewItem { - node: ViewItem_, - attrs: Vec , - vis: Visibility, - span: Span, + pub node: ViewItem_, + pub attrs: Vec, + 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 @@ impl Visibility { #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct StructField_ { - kind: StructFieldKind, - id: NodeId, - ty: P, - attrs: Vec , + pub kind: StructFieldKind, + pub id: NodeId, + pub ty: P, + pub attrs: Vec, } pub type StructField = Spanned; @@ -1096,10 +1096,10 @@ impl StructFieldKind { #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)] pub struct StructDef { - fields: Vec , /* fields, not including ctor */ + pub fields: Vec, /* fields, not including ctor */ /* ID of the constructor. This is only used for tuple- or enum-like * structs. */ - ctor_id: Option + pub ctor_id: Option } /* @@ -1108,12 +1108,12 @@ pub struct StructDef { */ #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)] pub struct Item { - ident: Ident, - attrs: Vec , - id: NodeId, - node: Item_, - vis: Visibility, - span: Span, + pub ident: Ident, + pub attrs: Vec, + 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 , - node: ForeignItem_, - id: NodeId, - span: Span, - vis: Visibility, + pub ident: Ident, + pub attrs: Vec, + pub node: ForeignItem_, + pub id: NodeId, + pub span: Span, + pub vis: Visibility, } #[deriving(Eq, TotalEq, Encodable, Decodable, Hash)] diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 5db353b7262..f07b0e71c1c 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -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 > + map: RefCell > } impl Map { diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 1676a130235..631489a65b2 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -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> { diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index ff9f9dece95..0c0d7bbb535 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -337,8 +337,8 @@ pub fn test_cfg> /// Represents the #[deprecated="foo"] (etc) attributes. pub struct Stability { - level: StabilityLevel, - text: Option + pub level: StabilityLevel, + pub text: Option } /// The available stability levels. diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 974868c1610..0d2492d7fad 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -86,19 +86,19 @@ to the original source. */ #[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 { - 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, + pub file: Rc, /// 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>, + pub filename: FileName, + pub line: uint, + pub col: CharPos, + pub file: Option>, } // used to be structural records. Better names, anyone? -pub struct FileMapAndLine {fm: Rc, line: uint} -pub struct FileMapAndBytePos {fm: Rc, pos: BytePos} +pub struct FileMapAndLine { pub fm: Rc, pub line: uint } +pub struct FileMapAndBytePos { pub fm: Rc, 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 + pub span: Option } /// 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, - lines: Vec + pub file: Rc, + pub lines: Vec } /// 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. `` - 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 >, + pub lines: RefCell >, /// Locations of multi-byte characters in the source code - multibyte_chars: RefCell >, + pub multibyte_chars: RefCell >, } impl FileMap { @@ -284,7 +284,7 @@ impl FileMap { } pub struct CodeMap { - files: RefCell>> + pub files: RefCell>> } impl CodeMap { diff --git a/src/libsyntax/crateid.rs b/src/libsyntax/crateid.rs index 96664fc39f6..353e1a23b5e 100644 --- a/src/libsyntax/crateid.rs +++ b/src/libsyntax/crateid.rs @@ -24,11 +24,11 @@ use std::from_str::FromStr; 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 { diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index faeb7b4e0f2..fb0f458b88a 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -40,8 +40,8 @@ pub struct ExplicitBug; // 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 { diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 2bcb9c4a229..7ff77923132 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -30,8 +30,8 @@ use collections::HashMap; // ast::MacInvocTT. pub struct MacroDef { - name: ~str, - ext: SyntaxExtension + pub name: ~str, + pub ext: SyntaxExtension } pub type ItemDecorator = @@ -41,8 +41,8 @@ pub type ItemModifier = fn(&mut ExtCtxt, Span, @ast::MetaItem, @ast::Item) -> @ast::Item; pub struct BasicMacroExpander { - expander: MacroExpanderFn, - span: Option + pub expander: MacroExpanderFn, + pub span: Option } pub trait MacroExpander { @@ -68,8 +68,8 @@ impl MacroExpander for BasicMacroExpander { } pub struct BasicIdentMacroExpander { - expander: IdentMacroExpanderFn, - span: Option + pub expander: IdentMacroExpanderFn, + pub span: Option } 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 @@ pub fn syntax_expander_table() -> SyntaxEnv { } pub struct MacroCrate { - lib: Option, - cnum: ast::CrateNum, + pub lib: Option, + 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 , - trace_mac: bool + pub mod_path: Vec , + 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 , + chain: Vec , } impl SyntaxEnv { diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 63e9a466a8e..0d851647b3d 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -192,75 +192,77 @@ mod ty; pub struct TraitDef<'a> { /// The span for the current #[deriving(Foo)] header. - span: Span, + pub span: Span, - attributes: Vec , + pub attributes: Vec, /// 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> , + pub additional_bounds: Vec>, /// Any extra lifetimes and/or bounds, e.g. `D: serialize::Decoder` - generics: LifetimeBounds<'a>, + pub generics: LifetimeBounds<'a>, - methods: Vec> } + pub methods: Vec>, +} 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>>, + pub explicit_self: Option>>, /// Arguments other than the self argument - args: Vec> , + pub args: Vec>, /// 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, + pub name: Option, /// 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 { diff --git a/src/libsyntax/ext/deriving/ty.rs b/src/libsyntax/ext/deriving/ty.rs index e58c024fcb0..c4ca2601f60 100644 --- a/src/libsyntax/ext/deriving/ty.rs +++ b/src/libsyntax/ext/deriving/ty.rs @@ -29,10 +29,10 @@ pub enum PtrTy<'a> { /// A path, e.g. `::std::option::Option::` (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 , ty_params: Vec ) - /// Lifetimes and bounds on type parameters pub struct LifetimeBounds<'a> { - lifetimes: Vec<&'a str>, - bounds: Vec<(&'a str, Vec>)>, + pub lifetimes: Vec<&'a str>, + pub bounds: Vec<(&'a str, Vec>)>, } impl<'a> LifetimeBounds<'a> { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index aa9330bf657..747ab583e79 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -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 @@ impl<'a, 'b> Folder for MacroExpander<'a, 'b> { } 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, diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index bc8709befae..8fa4857cab0 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -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, + stack: Vec, /* for MBE-style macro transcription */ - priv interpolations: HashMap>, - priv repeat_idx: Vec, - priv repeat_len: Vec, + interpolations: HashMap>, + repeat_idx: Vec, + repeat_len: Vec, /* 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 diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 86795b6623c..e25a84d6cd4 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -30,6 +30,8 @@ This API is completely unstable and subject to change. quote)] #![allow(deprecated)] +#![allow(visible_private_types)] // NOTE: remove after a stage0 snap + extern crate serialize; extern crate term; extern crate collections; diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index e5e3a05f998..57529228b51 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -18,8 +18,8 @@ use serialize::{Encodable, Decodable, Encoder, Decoder}; #[unsafe_no_drop_flag] // data is set to null on destruction pub struct OwnedSlice { /// null iff len == 0 - priv data: *mut T, - priv len: uint, + data: *mut T, + len: uint, } #[unsafe_destructor] diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 7d337e9c078..3bf1474c461 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -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 diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs index 460ad76cffe..0d40638d3a7 100644 --- a/src/libsyntax/parse/common.rs +++ b/src/libsyntax/parse/common.rs @@ -13,8 +13,8 @@ use parse::token; // SeqSep : a sequence separator (token) // and whether a trailing separator is allowed. pub struct SeqSep { - sep: Option, - trailing_sep_allowed: bool + pub sep: Option, + pub trailing_sep_allowed: bool } pub fn seq_sep_trailing_disallowed(t: token::Token) -> SeqSep { diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index c18571deaf5..23d7cc0af97 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -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, - filemap: Rc, + pub curr: Option, + pub filemap: Rc, /* cached: */ - peek_tok: token::Token, - peek_span: Span, + pub peek_tok: token::Token, + pub peek_span: Span, } impl<'a> StringReader<'a> { diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 36f33befb7a..76126e6780a 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -39,7 +39,7 @@ pub mod obsolete; // 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>, } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index bf96983cc7f..2d0c4ca488e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -78,7 +78,6 @@ use parse::{new_sub_parser_from_file, ParseSess}; 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>, + pub path: ast::Path, + pub bounds: Option>, } 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, + 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, /// The set of seen errors about obsolete syntax. Used to suppress /// extra detail when the same error is seen twice - obsolete_set: HashSet, + pub obsolete_set: HashSet, /// Used to determine the path to externally loaded source files - mod_path_stack: Vec , + pub mod_path_stack: Vec, /// Stack of spans of open delimiters. Used for error message. - open_braces: Vec , - /* do not copy the parser; its state is tied to outside state */ - priv nocopy: marker::NoCopy + pub open_braces: Vec, } fn is_plain_ident_or_underscore(t: &token::Token) -> bool { diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index b7586b5de14..2c5698ddec4 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -556,7 +556,7 @@ pub fn get_ident_interner() -> Rc { /// somehow. #[deriving(Clone, Eq, Hash, Ord, TotalEq, TotalOrd)] pub struct InternedString { - priv string: RcStr, + string: RcStr, } impl InternedString { diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 4996c1e96a8..7b64d0293cc 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -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 diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index b410e0c7169..98a3ff30916 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -54,7 +54,7 @@ pub struct CurrentCommentAndLiteral { } pub struct State<'a> { - s: pp::Printer, + pub s: pp::Printer, cm: Option<&'a CodeMap>, intr: Rc, comments: Option >, diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 969b9f81785..b7932da8738 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -23,8 +23,8 @@ use std::hash::Hash; use std::rc::Rc; pub struct Interner { - priv map: RefCell>, - priv vect: RefCell >, + map: RefCell>, + vect: RefCell >, } // when traits can extend traits, we should extend index to get [] @@ -92,7 +92,7 @@ impl Interner { #[deriving(Clone, Eq, Hash, Ord)] pub struct RcStr { - priv string: Rc<~str>, + string: Rc<~str>, } impl TotalEq for RcStr {} @@ -134,8 +134,8 @@ impl RcStr { // A StrInterner differs from Interner in that it accepts // &str rather than RcStr, resulting in less allocation. pub struct StrInterner { - priv map: RefCell>, - priv vect: RefCell >, + map: RefCell>, + vect: RefCell >, } // when traits can extend traits, we should extend index to get []