about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-03-27 15:39:48 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-03-31 15:47:36 -0700
commit3c76f4ac8ddca0fb0809b00e3e448f57cf1931b7 (patch)
treec00e4a730162f2b18c90971183ae28a746bbf4f8 /src/libsyntax/parse
parentc034d0c854b9e80dc5d20ebe152eee8ce96ed544 (diff)
downloadrust-3c76f4ac8ddca0fb0809b00e3e448f57cf1931b7.tar.gz
rust-3c76f4ac8ddca0fb0809b00e3e448f57cf1931b7.zip
syntax: Switch field privacy as necessary
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/comments.rs10
-rw-r--r--src/libsyntax/parse/common.rs4
-rw-r--r--src/libsyntax/parse/lexer.rs20
-rw-r--r--src/libsyntax/parse/mod.rs2
-rw-r--r--src/libsyntax/parse/parser.rs42
-rw-r--r--src/libsyntax/parse/token.rs2
6 files changed, 38 insertions, 42 deletions
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<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 {
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<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> {
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<Vec<Path>>,
 }
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<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 {
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<IdentInterner> {
 /// somehow.
 #[deriving(Clone, Eq, Hash, Ord, TotalEq, TotalOrd)]
 pub struct InternedString {
-    priv string: RcStr,
+    string: RcStr,
 }
 
 impl InternedString {