1012 Commits

Author SHA1 Message Date
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
ConnorSkees
51585235c3 Remove decl! macro
This lets rustfmt work and gives better autocomplete and error messages
inside builtin functions.
2020-03-16 10:35:38 -04:00
ConnorSkees
d8db937470 reorder macro params 2020-03-10 21:53:21 -04:00
ConnorSkees
0665e67158 bump bugfix version 2020-03-10 21:30:36 -04:00
ConnorSkees
31fbb0a77e rustfmt 2020-03-10 21:23:47 -04:00
ConnorSkees
8458106833 Replace lazy_static! with once_cell::sync::Lazy
As per
276134eb93 (r37745873),
this allows us to avoid a macro call and get better autocompletion
within the declaration.
2020-03-10 21:19:23 -04:00
ConnorSkees
276134eb93 prefer hashmap over btreemap where ordering is unimportant 2020-03-03 19:51:02 -05:00
ConnorSkees
94a6109a05 exclude Cargo.lock from crates.io 2020-03-01 17:16:58 -05:00
ConnorSkees
74adf39166 Remove Cargo.lock 2020-03-01 17:13:48 -05:00
ConnorSkees
162377a06b Bump version to 0.3.0 2020-03-01 17:13:08 -05:00
ConnorSkees
84e402023a @content boilerplate 2020-03-01 17:06:55 -05:00
ConnorSkees
3181d58441 refactor and cleaning 2020-03-01 14:53:52 -05:00
ConnorSkees
d7b22a41a6 Properly handle & in most contexts 2020-03-01 12:03:14 -05:00
ConnorSkees
6ebadd7869 Add toplevel documentation 2020-03-01 09:08:13 -05:00
ConnorSkees
35163c4a36 Properly scope variables inside for loops 2020-03-01 08:20:59 -05:00
ConnorSkees
14eb173c56 Refactor unknown at rule parsing to separate file 2020-03-01 08:02:59 -05:00
ConnorSkees
286f67b984 ident addition chaining 2020-03-01 07:42:12 -05:00
ConnorSkees
547ac7415a Improve color ops error messages 2020-02-29 20:14:51 -05:00
ConnorSkees
7d39b0c86a Evaluate binary ops when inserting variables 2020-02-29 20:09:41 -05:00
ConnorSkees
b62b9240c0 Exit with error 2020-02-29 20:02:58 -05:00
ConnorSkees
4e7cf277e1 Improve binary op error messages 2020-02-29 20:01:43 -05:00
ConnorSkees
7949699229 Handle variables in binary ops in function calls 2020-02-29 18:58:09 -05:00