67 Commits

Author SHA1 Message Date
Connor Skees
827225a143 initial implementation of @keyframes 2020-07-04 20:50:53 -04:00
Connor Skees
8622efc7be deny exponents over 2 digits
this is done in order to avoid hangs on small inputs.
2020-06-28 07:02:12 -04:00
Connor Skees
c7608fce4e convert immutable Strings to Box<str> in Pseudo 2020-06-28 05:10:34 -04:00
ConnorSkees
41bfea3cea update dependencies 2020-06-26 08:03:43 -04:00
ConnorSkees
27e4f2b541 properly parse maps with maps as values 2020-06-20 21:53:01 -04:00
ConnorSkees
47c4a421ac upgrade dependencies 2020-06-19 22:47:06 -04:00
ConnorSkees
5fc3748472 remove most remaining unwraps 2020-06-18 03:09:24 -04:00
ConnorSkees
c1b5ff5730 prettify imports 2020-06-16 20:00:11 -04:00
ConnorSkees
71dd7df951 reimplement parsing 2020-06-16 19:38:30 -04:00
ConnorSkees
6decd85d0d handle invalid escape sequences in variable names 2020-06-04 15:14:00 -04:00
Vincent Prouillet
9ae3ce52be Fix fmt + sass 2020-05-26 16:29:39 +02:00
ConnorSkees
bb53aaab8a replace std::borrow::Cow with beef::Cow 2020-05-25 13:09:20 -04:00
ConnorSkees
6d76e1518a refactor away many unwraps 2020-05-25 00:57:59 -04:00
ConnorSkees
ec83a9dff7 clippy 2020-05-24 17:41:24 -04:00
ConnorSkees
3c129780d0 span_before in quoted string 2020-05-24 16:27:07 -04:00
ConnorSkees
8d4b4bedbe remove unwrap in peek_ident 2020-05-24 15:53:51 -04:00
ConnorSkees
e5cceb60ec track span_before when parsing values
this allows us to remove many panics on invalid input
2020-05-24 15:30:06 -04:00
ConnorSkees
b5c1fb2013 ignore non-ascii numeric characters in numbers 2020-05-24 13:08:31 -04:00
ConnorSkees
c42fdc5ee7 remove unwrap when nothing after / 2020-05-24 10:47:16 -04:00
ConnorSkees
1382ea32ca remove unwrap inside interpolated ident body parsing 2020-05-24 10:37:40 -04:00
ConnorSkees
737a6ba90d emit proper error on unclosed quote 2020-05-24 10:04:30 -04:00
ConnorSkees
b653c55ad7 handle case when there is no input after escape 2020-05-24 09:20:55 -04:00
ConnorSkees
042dbfa914 remove panics from missing identifiers 2020-05-24 08:56:53 -04:00
ConnorSkees
bc12c0b4e7 refactor number parsing to reduce nesting 2020-05-23 01:49:21 -04:00
ConnorSkees
d4141e09ee document internal function 2020-05-22 20:50:48 -04:00
ConnorSkees
283a2097ff rename Value::Ident to Value::String 2020-05-22 14:35:41 -04:00
ConnorSkees
969726eb30 Revert string interning
There existed issues related to multithreaded tests that are difficult
to resolve. In the future interning may be reimplemented but in a more
limited capacity.

The motivation behind interning *values* was that it appeared checking
for named colors was responsible for much of the time lost when parsing
unquoted strings. If interning were to be reimplemented, it may make
sense to limit it solely to identifiers and style properties.
2020-05-22 14:20:31 -04:00
ConnorSkees
9a6c8ce019 add string interning
this seems to improve performance by ~20% as well as significantly
decrease memory usage
2020-05-21 22:46:40 -04:00
ConnorSkees
c68576bb23 refactor parsing of toplevel variables 2020-05-21 13:25:37 -04:00
ConnorSkees
67091115db better handle - at the start of idents 2020-05-21 12:06:42 -04:00
ConnorSkees
d300d4e1fc test for ] in value 2020-05-21 00:09:52 -04:00
ConnorSkees
b58ed29fd0 add more span information
this resolves a lot of panics that occurred when there was no more input
2020-05-17 00:35:07 -04:00
ConnorSkees
2db3398fe2 properly handle escaped newlines in quoted strings 2020-05-16 17:20:53 -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
26df276266 Value::to_css_string returns a Cow<'static, str> 2020-05-05 11:08:34 -04:00
ConnorSkees
4321a383f2 eat whitespace after silent comments 2020-05-02 12:49:42 -04:00
ConnorSkees
3ca48702a1 interpolated_ident_body doesn't allocate its own string 2020-05-02 11:47:49 -04:00
ConnorSkees
daf7f247cf refactor iteration over intermediate values 2020-05-01 03:13:20 -04:00
ConnorSkees
8a3ba1ae07 make lowercase in place where possible 2020-04-30 16:08:35 -04:00
ConnorSkees
03316161a8 remove superfluous is_float variable 2020-04-28 15:49:19 -04:00
ConnorSkees
bc09e49c89 remove is_float field of ParsedNumber 2020-04-28 15:28:50 -04:00
ConnorSkees
bcbf3f4a90 clippy 2020-04-28 15:14:44 -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
d53b44aafe tabs are not emitted literally 2020-04-26 19:02:43 -04:00
ConnorSkees
4a2503b04c refactor attribute parsing 2020-04-26 00:55:38 -04:00
ConnorSkees
a8141d2488 handle edge case in parsing of units ending with hypen followed by whitespace 2020-04-25 20:19: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