145 Commits

Author SHA1 Message Date
Heinenen
ad901c2cdb
Syntax error if function name is parenthesized (#3058)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
2024-01-16 08:52:56 +00:00
emilylime
4a65c2115b
Fix typos (#3126) 2024-01-05 14:12:27 +00:00
Sébastien d'Herbais de Thun
3aeb150c95
Added to-absolute method to length. (#3117)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
2024-01-03 09:43:08 +00:00
Leedehai
39e53fcdc9
Clarify the way to access functions from dictionaries (#3064)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
2024-01-02 09:13:45 +00:00
Heinenen
c27b9e2b0f
Don't allow nested line comment inside block comment (#3048) 2023-12-30 13:01:05 +00:00
voidiz
4e5afa672f
Suggest accessing field if method doesn't exist (#2977) 2023-12-28 14:28:04 +00:00
Leedehai
99f32a45e5
Add a test to verify .with() applies to sinks (#3071) 2023-12-28 13:32:51 +00:00
PgBiel
eb9dd539aa
Fix unnamed sinks not capturing named args (#2984) 2023-12-18 12:30:03 +01:00
Malo
7adeb49652
Improve number display (#2936) 2023-12-14 14:21:25 +01:00
Malo
ce9d420472
Mention str(<label>) feature in documentation for label (#2906) 2023-12-11 17:03:26 +01:00
PgBiel
0ebce56b36
Implement lexicographic array comparison (#2827) 2023-12-05 19:15:03 +01:00
Laurenz
aa23198ad9 A little less route nesting 2023-11-29 13:09:00 +01:00
Laurenz
2007f30b11 Better error message for named instead of positional argument 2023-11-28 18:55:03 +01:00
Leedehai
c354f00f79
Add test cases to verify lexer's identifier validation (#2773) 2023-11-27 11:50:15 +01:00
Laurenz
85b1d1d4dd Rework Vt into Engine
- Moves as much data out of the `Vm`
- Removes duplication with call_vm and call_vt flavours
- Uses tracked chain instead of fixed int for determining max nesting depth
- This means that nesting checks now generalizes to layout and realization, to detect crashing show rules and overly nested layouts
2023-11-26 19:03:21 +01:00
frozolotl
e5470401f4
Fix has on non-inherent fields (#2745) 2023-11-24 11:41:38 +01:00
frozolotl
55799f7395
Make color.components' alpha parameter named (#2734) 2023-11-21 18:05:12 +01:00
frozolotl
b0e81d4b3f
Remove restrictions to chroma and improve clamping (#2690)
This PR does a few small things:
- Oklab's a*/b* and Oklch's chroma components can be as large as desired.
- In PDF, when encoding Oklab, the range is widened from [-0.4,0.4] to [-0.5,0.5].
- In PDF, clamping is now performed on Oklch's chroma instead of a* and b*.
  This causes hue not to be distorted when clamping.

SVG and PNG export remain unchanged:
- SVG itself never had any restrictions on chroma.
  We directly use the `oklab` and `oklch` CSS colors, which should work fine for the most part.
  In the future, embedded ICC profiles might be nice. Further research is likely necessary.
- While PNG does not support color spaces like Oklab or Oklch, certain useful features exist.
  One can define gamma (gAMA) and chromacities&whitepoint (cHRM) chunks and even embed ICC profiles.
  While `image` crate does not support these features for encoding, its backend crate `png` does support gAMA and cHRM.
  It does not allow embedding ICC profiles yet, though.

As it stands, to fully support wide gamuts and more accurate colors, more work is necessary.
This PR should help a bit though.
2023-11-17 10:41:45 +01:00
frozolotl
d16ab29068
Make Oklab and Oklch chroma ratios relative to 0.4 (#2642) 2023-11-13 15:48:54 +01:00
TheJosefOlsson
d25e6726e2
Add tests for shorthand (#2660) 2023-11-13 11:54:48 +01:00
frozolotl
d93ed1b3d8
Implement Oklch support (#2611) 2023-11-10 10:31:06 +01:00
tingerrr
5f922abfd8
Add hints for invalid identifier errors (#2583) 2023-11-07 12:14:20 +01:00
Samuel Tardieu
e550f0a8f7
Prevent silent swallowing of return expressions trailing arguments (#2545)
Fixes #2104
2023-11-06 21:42:38 +01:00
Matt Fellenz
8fd546760c
Implement dict key interpolation (#2559) 2023-11-02 17:08:08 +01:00
MALO
500468fd05
Improve "cannot apply '{+,-}'" error messages (#2510) 2023-10-29 11:15:53 +01:00
Laurenz
24a0bd8cfb Fix error priority for function arguments
Errors about superfluous arguments are now thrown before errors of the function execution itself.

Fixes #1367
2023-10-27 15:38:08 +02:00
Laurenz
cbfd9884a9 Fix argument parsing bug
Things like `luma(1, key: "val")` didn't produce an error before because `args.finish()?` wasn't called. This changes `args: Args` to `args: &mut Args` to make it impossible for that to happen.
2023-10-27 13:25:15 +02:00
Joseph Wilson
e182777133
Implement unary array.zip, closing #2478 (#2491) 2023-10-27 12:58:55 +02:00
Sébastien d'Herbais de Thun
a8af6b449a
Adds a default value to .remove() on dict and array (#2346) 2023-10-10 11:44:59 +02:00
MALO
0804a9e25d
Use/allow U+2212 MINUS SIGN instead of U+002D HYPHEN MINUS everywhere (#2318) 2023-10-09 15:30:40 +02:00
Sébastien d'Herbais de Thun
a4e357fb37
Gradient Part 2 - Linear gradients (#2279) 2023-10-03 19:31:02 +02:00
T0mstone
cf9bde3245
Add capability to get current compiler version (#2016) 2023-10-02 20:28:19 +02:00
bluebear94
553da642bd
Handle compiler panics when handling infinite lengths (#2215) 2023-09-28 11:15:09 +02:00
Arnaud Golfouse
962071619d
Avoid plugin panics (#2232) 2023-09-26 16:21:21 +02:00
Sébastien d'Herbais de Thun
163c2e1aa2
Gradient Part 1 - Color rework (#2171) 2023-09-19 15:48:33 +02:00
Laurenz
25613cfaf3 Fix missing capturing of assignments
The previous commit was a bit overambitious. The left-hand side of assignments should actually be fully captured: Argument lists in `at` calls can contain captured variables. And if the assigned variable itself is captured, then the function is faulty anyway. (And we ensure the correct error message by capturing it.)

Fixes #2169
2023-09-16 20:41:44 +02:00
Laurenz
94380f4457 Remove 64-bit-specific test
Fixes #2139
2023-09-15 12:34:35 +02:00
Laurenz
2dc000daeb Type compatibility
For now, types can be used like strings in operations to prevent breakage of many packages. Hopefully, we can get rid of this in the future.
2023-09-11 17:38:03 +02:00
Laurenz
305524d005 Update tests for type system changes 2023-09-11 14:42:43 +02:00
Laurenz
2f672b4e2e Allow packages to specify their minimum compiler version 2023-09-04 16:29:57 +02:00
Laurenz
a6f347fbb7 Add test for ends-with fix 2023-08-30 17:19:25 +02:00
Pg Biel
19b91d59d1
Allow renaming imports with as (#1923) 2023-08-30 13:36:02 +02:00
Sébastien d'Herbais de Thun
8a0dd88f10
Make zip variadic (#2041) 2023-08-30 13:31:37 +02:00
Beiri22
f616302496
Duration type, simple date-duration-calculations and comparisons (#1843) 2023-08-30 12:28:53 +02:00
Kevin K
45bd58fbaa
Implement rev() method on string (#2013) 2023-08-26 17:35:52 +02:00
damaxwell
756bdb623c
Support selectors with and/or followed by before/after (#1883)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
2023-08-22 12:23:55 +02:00
Simon Rask
046029b1e2
Add hint for missing method error for dictionary where a field with a function is present (#1922) 2023-08-21 16:26:05 +02:00
bluebear94
877df549aa
Check for control flow event before let binding (#1912)
Fixes #1906 (trying to destructure the result of `continue`).
2023-08-21 16:21:37 +02:00
Gokul Soumya
5c6434d4ce
Add intersperse() method for arrays (#1897) 2023-08-21 16:01:27 +02:00
Laurenz
d52493938e Make bytes joinable 2023-08-21 15:33:03 +02:00