diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-01-02 19:37:10 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-01-02 19:37:10 +0100 |
| commit | 1c40dc42e7bc7b799b77f06d25414aca59a044ba (patch) | |
| tree | ea8bdedaebf59f5bc601346b0108236c7264a29d /src/parse/tokens.rs | |
| parent | 8cad78481cd52680317032c3bb84cacda5666489 (diff) | |
Dynamic values, Types, Arrays, and Dictionaries 🚀
- Identifiers are now evaluated as variables instead of being plain values
- Constants like `left` or `bold` are stored as dynamic values containing the respective rust types
- We now distinguish between arrays and dictionaries to make things more intuitive (at the cost of a bit more complex parsing)
- Spans were removed from collections (arrays, dictionaries), function arguments still have spans for the top-level values to enable good diagnostics
Diffstat (limited to 'src/parse/tokens.rs')
| -rw-r--r-- | src/parse/tokens.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs index d7919763..a9692a58 100644 --- a/src/parse/tokens.rs +++ b/src/parse/tokens.rs @@ -477,13 +477,9 @@ mod tests { } #[test] - fn test_length_from_str_parses_correct_value_and_unit() { + fn test_length_from_str() { assert_eq!(parse_length("2.5cm"), Some((2.5, Cm))); assert_eq!(parse_length("1.e+2cm"), Some((100.0, Cm))); - } - - #[test] - fn test_length_from_str_works_with_non_ascii_chars() { assert_eq!(parse_length("123🚚"), None); } |
