remove stylesheet module
This commit is contained in:
parent
c1b5ff5730
commit
053dac2ecb
@ -119,7 +119,6 @@ mod parse;
|
|||||||
mod scope;
|
mod scope;
|
||||||
mod selector;
|
mod selector;
|
||||||
mod style;
|
mod style;
|
||||||
mod stylesheet;
|
|
||||||
mod token;
|
mod token;
|
||||||
mod unit;
|
mod unit;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
@ -96,12 +96,7 @@ pub(crate) struct Parser<'a> {
|
|||||||
pub toks: &'a mut PeekMoreIterator<IntoIter<Token>>,
|
pub toks: &'a mut PeekMoreIterator<IntoIter<Token>>,
|
||||||
pub map: &'a mut CodeMap,
|
pub map: &'a mut CodeMap,
|
||||||
pub path: &'a Path,
|
pub path: &'a Path,
|
||||||
// `pub` to allow meta functions
|
|
||||||
pub global_scope: &'a mut Scope,
|
pub global_scope: &'a mut Scope,
|
||||||
// todo: make these fields private. they are currently public to hack in
|
|
||||||
// `Value::to_selector`, which requires a scope and selector to parse.
|
|
||||||
// presumably we could pass in empty scope since no interpolation will ever be done
|
|
||||||
// maybe even empty selector
|
|
||||||
pub scopes: &'a mut NeverEmptyVec<Scope>,
|
pub scopes: &'a mut NeverEmptyVec<Scope>,
|
||||||
pub super_selectors: &'a mut NeverEmptyVec<Selector>,
|
pub super_selectors: &'a mut NeverEmptyVec<Selector>,
|
||||||
pub span_before: Span,
|
pub span_before: Span,
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
#[cfg(feature = "wasm")]
|
|
||||||
#[wasm_bindgen]
|
|
||||||
impl StyleSheet {
|
|
||||||
pub fn new(input: String) -> Result<String, JsValue> {
|
|
||||||
let mut map = CodeMap::new();
|
|
||||||
let file = map.add_file("stdin".into(), input);
|
|
||||||
Ok(Css::from_stylesheet(StyleSheet(
|
|
||||||
StyleSheetParser {
|
|
||||||
lexer: &mut Lexer::new(&file).peekmore(),
|
|
||||||
nesting: 0,
|
|
||||||
map: &mut map,
|
|
||||||
path: Path::new(""),
|
|
||||||
}
|
|
||||||
.parse_toplevel()
|
|
||||||
.map_err(|e| raw_to_parse_error(&map, e).to_string())?
|
|
||||||
.0,
|
|
||||||
))
|
|
||||||
.map_err(|e| raw_to_parse_error(&map, e).to_string())?
|
|
||||||
.pretty_print(&map)
|
|
||||||
.map_err(|e| raw_to_parse_error(&map, e).to_string())?)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user