diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-11-25 16:10:28 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-11-26 19:03:21 +0100 |
| commit | 85b1d1d4dd4628d1fb8901c3280cde84da450bbe (patch) | |
| tree | b69a629be9295268e071667b1587a5701f2bc7ef /tests/typ/compiler/recursion.typ | |
| parent | 2f795b5c07171affa0709195a9dae3ed5c0afbeb (diff) | |
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
Diffstat (limited to 'tests/typ/compiler/recursion.typ')
| -rw-r--r-- | tests/typ/compiler/recursion.typ | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/tests/typ/compiler/recursion.typ b/tests/typ/compiler/recursion.typ index 82da7245..461680ab 100644 --- a/tests/typ/compiler/recursion.typ +++ b/tests/typ/compiler/recursion.typ @@ -32,11 +32,40 @@ #test(type(f()), int) --- +// Test redefinition. +#let f(x) = "hello" +#let f(x) = if x != none { f(none) } else { "world" } +#test(f(1), "world") + +--- // Error: 15-21 maximum function call depth exceeded #let rec(n) = rec(n) + 1 #rec(1) --- -#let f(x) = "hello" -#let f(x) = if x != none { f(none) } else { "world" } -#test(f(1), "world") +// Test cyclic imports during layout. +// Error: 2-38 maximum layout depth exceeded +// Hint: 2-38 try to reduce the amount of nesting in your layout +#layout(_ => include "recursion.typ") + +--- +// Test recursive show rules. +// Error: 22-25 maximum show rule depth exceeded +// Hint: 22-25 check whether the show rule matches its own output +// Hint: 22-25 this is a current compiler limitation that will be resolved in the future +#show math.equation: $x$ +$ x $ + +--- +// Error: 18-21 maximum show rule depth exceeded +// Hint: 18-21 check whether the show rule matches its own output +// Hint: 18-21 this is a current compiler limitation that will be resolved in the future +#show "hey": box[hey] +hey + +--- +// Error: 14-19 maximum show rule depth exceeded +// Hint: 14-19 check whether the show rule matches its own output +// Hint: 14-19 this is a current compiler limitation that will be resolved in the future +#show "hey": "hey" +hey |
