Skip to content

Commit 574898d

Browse files
committed
Flatten the exported API
1 parent 0bce2f6 commit 574898d

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

cssparser.rc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77

88
extern mod extra;
99

10-
pub mod tokenizer;
11-
pub mod parser;
12-
pub mod ast;
13-
pub mod color;
10+
pub use ast::*;
11+
pub use tokenizer::*;
12+
pub use parser::*;
13+
pub use color::*;
14+
15+
mod ast;
16+
mod tokenizer;
17+
mod parser;
18+
mod color;
1419

1520
#[cfg(test)]
1621
mod tests;

parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use ast::*;
2323
/// Parse top-level of a CSS stylesheet.
2424
/// Return a Iterator<Result<Rule, ErrorReason>>
2525
#[inline]
26-
pub fn parse_stylesheet<T: Iterator<Node>>(iter: T) -> StylesheetParser<T> {
26+
pub fn parse_stylesheet_rules<T: Iterator<Node>>(iter: T) -> StylesheetParser<T> {
2727
StylesheetParser(iter)
2828
}
2929

tests.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ use std::{io, os, str, run, task};
66
use extra::{tempfile, json};
77
use extra::json::ToJson;
88

9-
use ast::*;
10-
use tokenizer::tokenize;
11-
use parser::*;
12-
use color::*;
9+
use super::*;
1310

1411

1512
fn write_whole_file(path: &Path, data: &str) {
@@ -119,7 +116,7 @@ fn rule_list() {
119116
#[test]
120117
fn stylesheet() {
121118
do run_json_tests(include_str!("css-parsing-tests/stylesheet.json")) |input| {
122-
parse_stylesheet(tokenize(input)).to_owned_vec()
119+
parse_stylesheet_rules(tokenize(input)).to_owned_vec()
123120
}
124121
}
125122

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
struct Parser {
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
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
5555
}
5656

5757

0 commit comments

Comments
 (0)