This commit is contained in:
connorskees 2023-01-16 22:29:08 +00:00
parent f5a654fe5b
commit a7c2ca7b82
6 changed files with 14 additions and 20 deletions

View File

@ -25,6 +25,10 @@ All known missing features and bugs are tracked in [#19](https://github.com/conn
`grass` is not a drop-in replacement for `libsass` and does not intend to be. If you are upgrading to `grass` from `libsass`, you may have to make modifications to your stylesheets, though these changes should not differ from those you would have to make if upgrading to `dart-sass`.
## Performance
`grass` is benchmarked against `dart-sass` and `sassc` (`libsass`) [here](https://github.com/connorskees/sass-perf). In general, `grass` appears to be ~2x faster than `dart-sass` and ~1.7x faster than `sassc`.
## Web Assembly
`grass` experimentally releases a
@ -80,9 +84,9 @@ The spec runner does not work on Windows.
Using a modified version of the spec runner that ignores warnings and error spans (but does include error messages), `grass` achieves the following results:
```
2022-01-07
PASSING: 6152
FAILING: 753
2022-01-16
PASSING: 6153
FAILING: 752
TOTAL: 6905
```

View File

@ -98,7 +98,7 @@ pub(crate) fn hwb(mut args: ArgumentResult, visitor: &mut Visitor) -> SassResult
args.span(),
)? {
ParsedChannels::String(s) => Err((
format!("Expected numeric channels, got \"{}\"", s),
format!("Expected numeric channels, got \"{}\".", s),
args.span(),
)
.into()),

View File

@ -90,11 +90,9 @@ fn module_functions(mut args: ArgumentResult, visitor: &mut Visitor) -> SassResu
);
Ok(Value::Map(
(*(*visitor.env.modules)
(*(*visitor.env.modules).borrow().get(module, args.span())?)
.borrow()
.get(module.into(), args.span())?)
.borrow()
.functions(args.span()),
.functions(args.span()),
))
}
@ -108,11 +106,9 @@ fn module_variables(mut args: ArgumentResult, visitor: &mut Visitor) -> SassResu
);
Ok(Value::Map(
(*(*visitor.env.modules)
(*(*visitor.env.modules).borrow().get(module, args.span())?)
.borrow()
.get(module.into(), args.span())?)
.borrow()
.variables(args.span()),
.variables(args.span()),
))
}

View File

@ -1161,7 +1161,7 @@ impl<'a> Visitor<'a> {
allows_placeholder: bool,
span: Span,
) -> SassResult<SelectorList> {
let sel_toks = Lexer::new_from_string(&selector_text, span);
let sel_toks = Lexer::new_from_string(selector_text, span);
SelectorParser::new(sel_toks, allows_parent, allows_placeholder, span).parse()
}

View File

@ -1534,7 +1534,7 @@ pub(crate) trait StylesheetParser<'a>: BaseParser<'a> + Sized {
&base_name[start..end]
};
let mut toks = Lexer::new_from_string(&namespace, url_span);
let mut toks = Lexer::new_from_string(namespace, url_span);
// if namespace is empty, avoid attempting to parse an identifier from
// an empty string, as there will be no span to emit

View File

@ -42,9 +42,3 @@ nightly = ["include_sass/nightly"]
[dev-dependencies]
tempfile = "3.3.0"
paste = "1.0.3"
# [profile.release]
# debug = true
# panic = "abort"
# lto = true
# codegen-units = 1