988 Commits

Author SHA1 Message Date
ConnorSkees
eb2f3ebe5a remove ;; in tests 2020-05-16 22:46:13 -04:00
ConnorSkees
4ee82e66be refactor comparison ops to src/value/ops.rs 2020-05-16 22:45:32 -04:00
ConnorSkees
c07bb7ecce refactor == and != order of operations 2020-05-16 22:43:13 -04:00
ConnorSkees
697ff3d12f error messages for values beginnning with #
prior to this commit, error messages that occurred within idents
beginning with interpolation would be swallowed by error messages for
hex (largely, "Expected identifier.")
2020-05-16 19:25:11 -04:00
ConnorSkees
f3e7abdaba allow units to begin with escape sequences 2020-05-16 18:54:42 -04:00
ConnorSkees
d4f67b5ed9 clippy 2020-05-16 18:38:37 -04:00
ConnorSkees
1fb6822259 rename register to declare 2020-05-16 18:01:06 -04:00
ConnorSkees
a3604491e9 consolidate implementations of hsl and hsla 2020-05-16 17:49:30 -04:00
ConnorSkees
b5a0931e45 consolidate implementations of rgb and rgba 2020-05-16 17:45:04 -04:00
ConnorSkees
2d0a9abb13 parse selectors that grow larger from interpolation 2020-05-16 17:28:30 -04:00
ConnorSkees
2db3398fe2 properly handle escaped newlines in quoted strings 2020-05-16 17:20:53 -04:00
ConnorSkees
09e6568c39 update rustfmt 2020-05-16 16:56:17 -04:00
ConnorSkees
dcdd2a1cb1 edge case in which @ include had no args AND no semicolon 2020-05-16 16:54:34 -04:00
ConnorSkees
223dade62b Emit proper error for escape sequence overflow
Before this commit, escape sequences above std::char::MAX ('\u{10ffff}')
would overflow and cause a panic. This commit replaces an `unwrap` with
`ok_or` and a clearer error message. This message will likely change
in the future in order to better conform to the `dart-sass` implementation
which currently also fails to cleanly handle this overflow.

See https://github.com/kaj/rsass/pull/73
2020-05-16 16:22:33 -04:00
ConnorSkees
eea8bdbc25 allow escapes at the start of selectors 2020-05-16 16:15:11 -04:00
ConnorSkees
374e9f9eb4 correctly parse idents starting with interpolation 2020-05-14 00:10:24 -04:00
ConnorSkees
4b15b27119 refactor mixin args 2020-05-13 23:56:47 -04:00
ConnorSkees
0cbdc67f06 improve scoping with regard to function variables existing 2020-05-13 01:32:29 -04:00
ConnorSkees
425c36be86 improve tests for feature-exists 2020-05-13 00:19:21 -04:00
ConnorSkees
5b69ad2659 special functions are always lowercased 2020-05-13 00:16:36 -04:00
ConnorSkees
e524867a30 bump version to 0.8.2
This release contains significant (>10x) improvements for WASM speed.
Performance is now comparable to libsass bindings with `node-sass` as
well as `dart-sass` with dart2js. It is, however, roughly 4x slower than
native `grass`.
2020-05-11 12:59:31 -04:00
ConnorSkees
2e9cd18a9d document internal fn CallArgs::decrement 2020-05-06 12:19:03 -04:00
ConnorSkees
e5226e5cfe eat_calc_args doesn't allocate its own string 2020-05-06 12:15:42 -04:00
ConnorSkees
edb9dde259 simplify Display on QuoteKind 2020-05-06 12:07:27 -04:00
ConnorSkees
1b774a9b91 simplify Unit::From<String> 2020-05-06 12:01:40 -04:00
ConnorSkees
01858ff543 use static strings inside unit conversion table 2020-05-06 11:55:49 -04:00
ConnorSkees
6729f24b17 Value::inspect returns cow 2020-05-06 11:50:35 -04:00
ConnorSkees
5ba28e27f3 bump version to 0.8.1 2020-05-05 19:12:49 -04:00
ConnorSkees
66f24c474d fix build on wasm 2020-05-05 19:12:17 -04:00
ConnorSkees
004ca3a7ed bump version to 0.8.0 2020-05-05 19:02:03 -04:00
ConnorSkees
648e101c49 add tests passing at the start of may 2020-05-05 19:01:40 -04:00
ConnorSkees
26df276266 Value::to_css_string returns a Cow<'static, str> 2020-05-05 11:08:34 -04:00
ConnorSkees
96e916e750 handle negative values in @for 2020-05-02 15:11:58 -04:00
ConnorSkees
4321a383f2 eat whitespace after silent comments 2020-05-02 12:49:42 -04:00
ConnorSkees
07f12b6fb4 remove unnecessary logical not 2020-05-02 12:31:53 -04:00
ConnorSkees
2e8126af13 prefer match over if let .. else .. 2020-05-02 12:25:53 -04:00
ConnorSkees
2cc655aa61 add flags for profile.release 2020-05-02 12:12:19 -04:00
ConnorSkees
3ca48702a1 interpolated_ident_body doesn't allocate its own string 2020-05-02 11:47:49 -04:00
ConnorSkees
cf0cb01141 further optimize formatting of numbers
grass differs from rsass in that all numbers are bigints. this makes our
fomatting of numbers 6x slower than rsass and barely faster than
node-sass. ideally in the future, we would just use plain float
formatting. i've learned that dart-sass no longer configures precision as a cli
flag, so there is potentially some manual loop unrolling or
optimizations we could make knowing that all numbers must be a max of 10
digits. the next release of num_rational should contain an
implementation of to_f64() for BigRational, so that may solve our
problems.
2020-05-02 10:36:23 -04:00
ConnorSkees
8ff334f26a we dont need to check that output buffer is valid utf8 2020-05-01 19:24:26 -04:00
ConnorSkees
fe92c5ed63 simplify lexing of \f and \r 2020-05-01 19:16:57 -04:00
ConnorSkees
be6ee76486 -I takes 1 arg and --precision takes a value 2020-05-01 16:06:22 -04:00
ConnorSkees
67bee201de add -t alias for style 2020-05-01 15:57:37 -04:00
ConnorSkees
d5169b2e23 add hidden cli arg --precision
dart-sass will accept this arg, but it will ignore its value
2020-05-01 15:48:16 -04:00
ConnorSkees
05b78a3ddd add profiling feature 2020-05-01 15:43:43 -04:00
ConnorSkees
1326e8f000 add all commandline flags/args from dart-sass 2020-05-01 14:16:40 -04:00
ConnorSkees
daf7f247cf refactor iteration over intermediate values 2020-05-01 03:13:20 -04:00
ConnorSkees
4d17c24514 replace some indexing with .get() 2020-04-30 19:59:13 -04:00
ConnorSkees
1d518efeaf refactor lowercasing of idents
avoid creating more strings than necessary
2020-04-30 19:43:59 -04:00
ConnorSkees
0aed492123 move builtin fns to outer scope to reduce nesting 2020-04-30 19:36:34 -04:00