1083 Commits

Author SHA1 Message Date
ConnorSkees
c5f3936eb2 refactor lexing of at-rules 2020-03-21 23:57:36 -04:00
ConnorSkees
5914a07d22 handle backticks and control characters 2020-03-21 17:29:12 -04:00
ConnorSkees
502da79d42 test errors 2020-03-21 14:39:16 -04:00
ConnorSkees
90fb2e6112 reduce usage of std::process::exit 2020-03-21 14:33:27 -04:00
ConnorSkees
11a93a21a6 properly lex $ 2020-03-21 14:20:33 -04:00
ConnorSkees
f88b4af564 identifiers must start with alphabetic character 2020-03-21 13:02:24 -04:00
ConnorSkees
77ed737293 disallow newlines in quoted strings 2020-03-21 12:21:06 -04:00
ConnorSkees
7d12bc8142 implement unary ops + and - 2020-03-21 12:14:02 -04:00
ConnorSkees
51b080e6eb proper error message for missing closing brace and semicolon 2020-03-21 10:40:38 -04:00
ConnorSkees
22ab800e4c remove todo! from other color functions 2020-03-21 00:10:15 -04:00
ConnorSkees
e746bc7bda Allow utf-8 characters in idents 2020-03-20 23:53:26 -04:00
ConnorSkees
a64dcaf394 properly bubble up parsing errors 2020-03-20 23:34:23 -04:00
ConnorSkees
1a481000b6 better error message for missing closing paren 2020-03-20 23:21:40 -04:00
ConnorSkees
f0c2522967 better error message when missing to or through 2020-03-20 23:15:51 -04:00
ConnorSkees
c987cde7bf fix code blocks in readme 2020-03-20 21:10:58 -04:00
ConnorSkees
f962595624 bump version to 0.4.0 2020-03-20 21:08:00 -04:00
ConnorSkees
8e43d906b5 update passing tests 2020-03-20 21:00:27 -04:00
ConnorSkees
87462490ac Handle empty lists () 2020-03-20 20:01:57 -04:00
ConnorSkees
b0aff089aa implement builtin function append() 2020-03-20 19:50:23 -04:00
ConnorSkees
4fdac4c5f1 implement builtin function set-nth() 2020-03-20 19:27:26 -04:00
ConnorSkees
5ce2515fb6 handle non-list to nth() 2020-03-20 12:36:31 -04:00
ConnorSkees
284bc8ea6d Implement builtin function list-separator() 2020-03-20 12:32:33 -04:00
ConnorSkees
dd1c1e5b06 implement builtin function nth 2020-03-20 12:09:08 -04:00
ConnorSkees
fb84361fae parse comma separated lists (somewhat) properly 2020-03-20 10:59:16 -04:00
ConnorSkees
ef480ad1f8 length() max args check 2020-03-20 10:03:54 -04:00
ConnorSkees
2db2ab10ca feature-exists units-level-3 2020-03-19 23:53:29 -04:00
ConnorSkees
20f702b40b Implement 1 arg for hsl and hsla 2020-03-19 23:44:53 -04:00
ConnorSkees
fb4021dae6 Properly handle percents in 1 arg rgb/rgba 2020-03-19 22:31:44 -04:00
ConnorSkees
8a811dae9e Properly parse spaced lists 2020-03-19 21:40:36 -04:00
ConnorSkees
3919e92dcb Allow function declarations inside rulesets 2020-03-19 20:01:13 -04:00
ConnorSkees
195a9b1552 Refactor tokens into separate file 2020-03-19 19:32:11 -04:00
ConnorSkees
4954f4bc6a better docs for colors 2020-03-19 16:40:30 -04:00
ConnorSkees
dcb712e3d4 Refactor unit conversions into separate file 2020-03-19 16:24:31 -04:00
ConnorSkees
0ad5e554b3 Add and subtract lists 2020-03-19 14:20:16 -04:00
ConnorSkees
d470074611 Improve chaining ops 2020-03-19 08:36:11 -04:00
ConnorSkees
9bbdf762ce clippy 2020-03-18 20:11:14 -04:00
ConnorSkees
103781e420 ident equality ignores quotekind 2020-03-18 17:23:38 -04:00
ConnorSkees
9630343676 Implement modulo 2020-03-18 11:39:58 -04:00
ConnorSkees
0fe97993f4 Properly handle trailing zeroes
This fixes an edge case in which there were trailing zeros that resulted
from the decimal having a non-zero part outside the precision range.

E.g. if precision were 10, `0.00000000000000000001` would be printed as `0.0000000000`.

This issue occured often when doing unit conversions between cm and in
(and similarly between dpcm and dpi).
2020-03-18 10:34:17 -04:00
ConnorSkees
efaa33088b Implement unit conversions in numeric subtraction 2020-03-18 10:14:35 -04:00
ConnorSkees
b3b5163113 Implement unit conversions in numeric addition 2020-03-18 10:08:40 -04:00
ConnorSkees
061694bd63 Initial implementation of !global (some issues remain) 2020-03-17 20:13:53 -04:00
ConnorSkees
d560f13289 Refactor how numbers are printed 2020-03-17 12:47:27 -04:00
ConnorSkees
1c4be96f73 Add tests for precision rounding 2020-03-17 10:28:04 -04:00
ConnorSkees
42787ec700 proper error message in unit() when not given number 2020-03-17 10:10:42 -04:00
ConnorSkees
3b5dd73a65 Support arbitrary amount of numbers multiplied together 2020-03-17 10:06:24 -04:00
ConnorSkees
f57b08069d Handle unit multiplication 2020-03-16 21:29:00 -04:00
ConnorSkees
6dbf8512e5 Bump version 2020-03-16 16:45:13 -04:00
ConnorSkees
7a5b5c7369 Workaround negative numbers in macro 2020-03-16 16:44:52 -04:00
ConnorSkees
849f3d8479 Refactor color-other builtin function arg macros 2020-03-16 10:52:42 -04:00