Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update to current rust: struct fields are private by default.
  • Loading branch information
Ms2ger committed Apr 5, 2014
commit bfea81d98f22f5e69240adbfda2a31f3c4d7711e
38 changes: 19 additions & 19 deletions ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ use std::slice;

#[deriving(Eq)]
pub struct NumericValue {
representation: ~str,
value: f64,
int_value: Option<i64>,
pub representation: ~str,
pub value: f64,
pub int_value: Option<i64>,
}


#[deriving(Eq)]
pub struct SourceLocation {
line: uint, // First line is 1
column: uint, // First character of a line is at column 1
pub line: uint, // First line is 1
pub column: uint, // First character of a line is at column 1
}


Expand Down Expand Up @@ -70,25 +70,25 @@ pub enum ComponentValue {

#[deriving(Eq)]
pub struct Declaration {
location: SourceLocation,
name: ~str,
value: ~[ComponentValue],
important: bool,
pub location: SourceLocation,
pub name: ~str,
pub value: ~[ComponentValue],
pub important: bool,
}

#[deriving(Eq)]
pub struct QualifiedRule {
location: SourceLocation,
prelude: ~[ComponentValue],
block: ~[Node],
pub location: SourceLocation,
pub prelude: ~[ComponentValue],
pub block: ~[Node],
}

#[deriving(Eq)]
pub struct AtRule {
location: SourceLocation,
name: ~str,
prelude: ~[ComponentValue],
block: Option<~[Node]>,
pub location: SourceLocation,
pub name: ~str,
pub prelude: ~[ComponentValue],
pub block: Option<~[Node]>,
}

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

#[deriving(Eq)]
pub struct SyntaxError {
location: SourceLocation,
reason: ErrorReason,
pub location: SourceLocation,
pub reason: ErrorReason,
}

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

#[deriving(Clone)]
pub struct SkipWhitespaceIterator<'a> {
iter_with_whitespace: slice::Items<'a, ComponentValue>,
pub iter_with_whitespace: slice::Items<'a, ComponentValue>,
}

impl<'a> Iterator<&'a ComponentValue> for SkipWhitespaceIterator<'a> {
Expand Down
8 changes: 4 additions & 4 deletions color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use ast::*;
pub struct RGBA {
// All in 0..1
// Use f32 to try and match rust-azure’s AzFloat
red: f32,
green: f32,
blue: f32,
alpha: f32,
pub red: f32,
pub green: f32,
pub blue: f32,
pub alpha: f32,
}

#[deriving(Clone, Eq)]
Expand Down
10 changes: 5 additions & 5 deletions tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ fn test_preprocess() {


pub struct Tokenizer {
priv input: ~str,
priv length: uint, // All counted in bytes, not characters
priv position: uint, // All counted in bytes, not characters
priv line: uint,
priv last_line_start: uint, // All counted in bytes, not characters
input: ~str,
length: uint, // All counted in bytes, not characters
position: uint, // All counted in bytes, not characters
line: uint,
last_line_start: uint, // All counted in bytes, not characters
}


Expand Down