272 Commits

Author SHA1 Message Date
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
374e9f9eb4 correctly parse idents starting with interpolation 2020-05-14 00:10:24 -04:00
ConnorSkees
5b69ad2659 special functions are always lowercased 2020-05-13 00:16:36 -04:00
ConnorSkees
e5226e5cfe eat_calc_args doesn't allocate its own string 2020-05-06 12:15:42 -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
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
07f12b6fb4 remove unnecessary logical not 2020-05-02 12:31:53 -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
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
7270890e45 use is_one rather than comparison 2020-04-30 16:36:10 -04:00
ConnorSkees
6b257fbfe9 mark some error branches as #[cold] 2020-04-30 16:33:27 -04:00
ConnorSkees
a6e03e4ae1 reduce nesting in ident parsing 2020-04-30 16:02:40 -04:00
ConnorSkees
2eef3e9f6a store &'static str rather than String for builtin fn names 2020-04-30 15:00:57 -04:00
ConnorSkees
3645a93382 further optimize parsing and printing of floats 2020-04-29 12:13:47 -04:00
ConnorSkees
bc09e49c89 remove is_float field of ParsedNumber 2020-04-28 15:28:50 -04:00
ConnorSkees
a9ec7ff73f fix issue where only 0 would be emitted for non-scientific-notation numbers 2020-04-28 14:49:00 -04:00
ConnorSkees
a183a9ffa2 optimize parsing of numbers
This makes parsing of floats roughly 10x faster
2020-04-28 13:18:54 -04:00
ConnorSkees
2ee4396978 handle scientific notation in numbers 2020-04-28 12:15:10 -04:00
ConnorSkees
7db57054e1 emitting get-function is an error 2020-04-26 23:11:04 -04:00
ConnorSkees
a746d81013 remove superfluous trait impls for Number 2020-04-26 23:06:32 -04:00
ConnorSkees
f158f03708 better handle named color transparent 2020-04-26 22:51:38 -04:00
ConnorSkees
af7e236ca3 refactor named colors into bidirectional map 2020-04-26 22:23:55 -04:00
ConnorSkees
c4de587f4e investigate feature complete inspect() 2020-04-26 18:27:08 -04:00
ConnorSkees
fb7fac5a53 empty bracketed lists are not null 2020-04-26 16:39:44 -04:00
ConnorSkees
f6fd0e9af5 refactor how & is handled in values 2020-04-26 13:07:44 -04:00
ConnorSkees
690c8a1f89 clippy 2020-04-26 01:52:43 -04:00
ConnorSkees
eb690b9adf test for superselector in function called from get-function 2020-04-25 12:10:50 -04:00
ConnorSkees
a5cd335318 properly handle whitespace and start and end of url() 2020-04-24 19:00:06 -04:00
ConnorSkees
a86d717f26 properly parse variable flags 2020-04-23 21:30:25 -04:00
ConnorSkees
1749f65fd9 Display decimal for number uses with_capacity 2020-04-23 14:41:37 -04:00
ConnorSkees
71495cd03b do not strip whitespace after var in call args 2020-04-23 13:54:49 -04:00
ConnorSkees
4d989b60b1 remove final clamp! macro 2020-04-22 06:05:19 -04:00
ConnorSkees
33ccabce7b box color in value 2020-04-21 18:54:19 -04:00
ConnorSkees
3805eaab2b clippy 2020-04-21 18:22:26 -04:00
ConnorSkees
d480e60628 replace clamp! macro with builtin method 2020-04-21 17:59:40 -04:00
ConnorSkees
4607163a62 more robustly handle - as start of identifier 2020-04-21 17:57:50 -04:00
ConnorSkees
38c45129d9 refactor function eval 2020-04-21 11:32:27 -04:00
ConnorSkees
fc3facb80c properly handle url() 2020-04-21 04:20:35 -04:00
ConnorSkees
a6b61082fe interpolation of strings in idents is literal 2020-04-20 12:12:39 -04:00
ConnorSkees
29886d6845 newlines are no longer replaced with spaces in quoted strings 2020-04-20 11:48:17 -04:00
ConnorSkees
4cdcf4f0d4 use peekmore rather than std::iter::Peekable 2020-04-20 03:45:28 -04:00
ConnorSkees
e07ceda8c7 add unit field to ident eating 2020-04-20 03:20:08 -04:00
ConnorSkees
9790846c99 inspect comma separated list of comma separated lists 2020-04-20 03:07:02 -04:00