Skip to content

Commit bfea81d

Browse files
committed
Update to current rust: struct fields are private by default.
1 parent 1c69b99 commit bfea81d

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

ast.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ use std::slice;
88

99
#[deriving(Eq)]
1010
pub struct NumericValue {
11-
representation: ~str,
12-
value: f64,
13-
int_value: Option<i64>,
11+
pub representation: ~str,
12+
pub value: f64,
13+
pub int_value: Option<i64>,
1414
}
1515

1616

1717
#[deriving(Eq)]
1818
pub struct SourceLocation {
19-
line: uint, // First line is 1
20-
column: uint, // First character of a line is at column 1
19+
pub line: uint, // First line is 1
20+
pub column: uint, // First character of a line is at column 1
2121
}
2222

2323

@@ -70,25 +70,25 @@ pub enum ComponentValue {
7070

7171
#[deriving(Eq)]
7272
pub struct Declaration {
73-
location: SourceLocation,
74-
name: ~str,
75-
value: ~[ComponentValue],
76-
important: bool,
73+
pub location: SourceLocation,
74+
pub name: ~str,
75+
pub value: ~[ComponentValue],
76+
pub important: bool,
7777
}
7878

7979
#[deriving(Eq)]
8080
pub struct QualifiedRule {
81-
location: SourceLocation,
82-
prelude: ~[ComponentValue],
83-
block: ~[Node],
81+
pub location: SourceLocation,
82+
pub prelude: ~[ComponentValue],
83+
pub block: ~[Node],
8484
}
8585

8686
#[deriving(Eq)]
8787
pub struct AtRule {
88-
location: SourceLocation,
89-
name: ~str,
90-
prelude: ~[ComponentValue],
91-
block: Option<~[Node]>,
88+
pub location: SourceLocation,
89+
pub name: ~str,
90+
pub prelude: ~[ComponentValue],
91+
pub block: Option<~[Node]>,
9292
}
9393

9494
#[deriving(Eq)]
@@ -106,8 +106,8 @@ pub enum Rule {
106106

107107
#[deriving(Eq)]
108108
pub struct SyntaxError {
109-
location: SourceLocation,
110-
reason: ErrorReason,
109+
pub location: SourceLocation,
110+
pub reason: ErrorReason,
111111
}
112112

113113
#[deriving(Eq)]
@@ -139,7 +139,7 @@ impl<'a> SkipWhitespaceIterable<'a> for &'a [ComponentValue] {
139139

140140
#[deriving(Clone)]
141141
pub struct SkipWhitespaceIterator<'a> {
142-
iter_with_whitespace: slice::Items<'a, ComponentValue>,
142+
pub iter_with_whitespace: slice::Items<'a, ComponentValue>,
143143
}
144144

145145
impl<'a> Iterator<&'a ComponentValue> for SkipWhitespaceIterator<'a> {

color.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use ast::*;
1111
pub struct RGBA {
1212
// All in 0..1
1313
// Use f32 to try and match rust-azure’s AzFloat
14-
red: f32,
15-
green: f32,
16-
blue: f32,
17-
alpha: f32,
14+
pub red: f32,
15+
pub green: f32,
16+
pub blue: f32,
17+
pub alpha: f32,
1818
}
1919

2020
#[deriving(Clone, Eq)]

tokenizer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ fn test_preprocess() {
4747

4848

4949
pub struct Tokenizer {
50-
priv input: ~str,
51-
priv length: uint, // All counted in bytes, not characters
52-
priv position: uint, // All counted in bytes, not characters
53-
priv line: uint,
54-
priv last_line_start: uint, // All counted in bytes, not characters
50+
input: ~str,
51+
length: uint, // All counted in bytes, not characters
52+
position: uint, // All counted in bytes, not characters
53+
line: uint,
54+
last_line_start: uint, // All counted in bytes, not characters
5555
}
5656

5757

0 commit comments

Comments
 (0)