2210 Commits

Author SHA1 Message Date
René Kijewski
05f483f11f book: a features section 2025-01-14 20:10:44 +01:00
René Kijewski
651224dc38 book: update a bit
* include "Getting stated" in the introduction
* disable run example button because it does not work anyway
* update debug output
* add missing `#[handler]` to actix-web example
* replace `::rinja` with `rinja`
2025-01-14 20:10:27 +01:00
René Kijewski
5c6f61eaf0
Merge pull request #315 from m4tx/patch-1
docs: fix recursive example in template_syntax.md
2025-01-14 15:52:28 +01:00
Mateusz Maćkowski
a6548e1186
docs: fix recursive example in template_syntax.md
The original description mentions askama issues which is confusing, since they don't exist in rinja repo and, most importantly, the example doesn't compile at all. This fixes both issues.
2025-01-14 15:31:26 +01:00
René Kijewski
32b976216c
Merge pull request #313 from Kijewski/pr-salvo
Add salvo example by translating the axum example
2025-01-13 20:35:46 +01:00
René Kijewski
78734c1e4d Add salvo example by translating the axum example 2025-01-13 19:53:50 +01:00
Guillaume Gomez
f6cf374683
Merge pull request #308 from Kijewski/pr-axum-example
examples: add {axum,poem,rocket,warp} by translating the actix-web example; book: add frameworks section
2025-01-13 14:40:54 +01:00
René Kijewski
da8d6454d2 book: add frameworks section 2025-01-13 13:54:46 +01:00
René Kijewski
bcf59ed305 Add poem example by translating the actix-web example 2025-01-13 13:54:45 +01:00
René Kijewski
861c59032d Add rocket example by translating the warp example 2025-01-13 13:08:02 +01:00
René Kijewski
42a82c4785 Add warp example by translating the axum example 2025-01-13 13:08:02 +01:00
René Kijewski
5bf465eb3c Add axum example by translating the actix-web example 2025-01-13 13:08:02 +01:00
René Kijewski
3421168948 Update actix-web example 2025-01-13 13:08:01 +01:00
Guillaume Gomez
be9069f86f
Merge pull request #312 from Kijewski/pr-rust-and-winnow
Update ui tests for rust 1.84, and deprecations in winnow 0.6.24
2025-01-12 22:58:27 +01:00
René Kijewski
35a77e3c25 Fix winnow deprecation warning 2025-01-12 19:43:52 +01:00
Guillaume Gomez
7947cdcafb Fix ui test 2025-01-12 19:43:39 +01:00
René Kijewski
c01e3dce04
Merge pull request #310 from GuillaumeGomez/book-update
Remove "Using integrations" part in book
2025-01-12 17:45:51 +01:00
Guillaume Gomez
f78cb94216 Remove "Using integrations" part in book 2025-01-09 16:19:35 +01:00
Guillaume Gomez
395a1d8dfe
Merge pull request #305 from Kijewski/pr-update-fuzzing
ci: group checks in fast, average and slow
2025-01-04 21:17:29 +01:00
René Kijewski
5b4df98ff6 ci: group checks in fast, avg and slow 2025-01-04 19:08:16 +01:00
René Kijewski
d3a1afd99d fuzzing: update corpus 2025-01-04 18:25:38 +01:00
René Kijewski
fff55f2a1d
Merge pull request #304 from Kijewski/pr-excessive-filter-block
parser: fix excessive filter blocks
2025-01-04 11:53:26 +01:00
René Kijewski
053366821b
Merge pull request #303 from Kijewski/pr-upgrade
book: add `upgrading.md`
2025-01-04 11:52:52 +01:00
René Kijewski
ff25aaab2a parser: fix excessive filter blocks
A `{% filter %}` block could have an unbound number of filters chained
one after another. This chain would wind up as a nested structure on the
heap. When dropped, this would cause a stackoverflow.

Resolves <https://issues.oss-fuzz.com/issues/386547457>.
2025-01-04 11:23:54 +01:00
René Kijewski
d1287adf80 fuzzing: add option to write out fuzzed scenarios 2025-01-04 11:03:16 +01:00
René Kijewski
6be9f7104b book: add upgrading.md 2025-01-04 00:13:21 +01:00
René Kijewski
0373645eb9
Merge pull request #301 from Kijewski/pr-digits
Speed-up HTML escaping a bit
2025-01-01 18:09:37 +01:00
René Kijewski
39647e57a6 Speed-up HTML escaping a bit
This PR adds an `enum Digits` that contains all possible values for
two-digit decimal numbers: `b"00" ..= b"99"`. This seems to enable rust
and/or llvm to make better use of niches. Previously there were no
niches, and we compared against `0` manually. Now most of the u16-space
are niches.

```text
Escaping                time:   [3.3437 µs 3.3497 µs 3.3578 µs]
                        change: [-18.807% -18.620% -18.452%] (p = 0.00 < 0.05)
                        Performance has improved.
```
2025-01-01 17:55:34 +01:00
Guillaume Gomez
8d6279d9c8
Merge pull request #279 from GuillaumeGomez/block_in_include
Fix `block_in_include` and add explanations on what is going on
2025-01-01 12:15:33 +01:00
René Kijewski
d254942dbc Add jinja2 tests to verify that jinja2 renders the same 2025-01-01 09:31:52 +01:00
René Kijewski
97ecbe6dba
Merge pull request #299 from Kijewski/pr-issue-283
derive: keep track of called macros
2024-12-29 19:38:03 +01:00
René Kijewski
9336435859 derive: keep track of called macros
Recursive macro calls, direct and indirect, would cause a stackoverflow.

This PR lets the macro call handler keep track of the stack of called
macros we are currently in, so we can abort with an error message
instead of panicking.
2024-12-29 07:52:21 +01:00
Guillaume Gomez
889b2c5611
Merge pull request #297 from Kijewski/pr-fuzz-6098564903665664
parser: use drop guards to track nesting level
2024-12-27 11:03:40 +01:00
René Kijewski
4b8bd45844 parser: use drop guards to track nesting level
Not for all operations the nesting level was incremented when needed
and/or the un-incremented nesting level was used in subfunction calls.
Binary operators such as `*` did not properly increment the nesting
level.

This PR changes `Level` in such a way that it can be used to keep track
of the nesting level when used in a loop. It is now impossible to
accidentally refer to an old nesting level value.

Resolves <https://issues.oss-fuzz.com/issues/385256115>.
2024-12-27 04:31:24 +01:00
Guillaume Gomez
802d980a47
Merge pull request #296 from GuillaumeGomez/if-let-chain
Add full support for if let chain feature
2024-12-25 21:36:59 +01:00
Guillaume Gomez
ae59d772c4 Correctly handle bool comparisons 2024-12-25 21:18:57 +01:00
Guillaume Gomez
5deb71920d Add regression test for if let chain 2024-12-25 21:18:57 +01:00
Guillaume Gomez
2262a8d786 Move includes count test into its own function 2024-12-25 21:18:57 +01:00
Guillaume Gomez
5cc7cb2121 Add full support for if let chain feature 2024-12-25 21:18:57 +01:00
Guillaume Gomez
25593f249b
Merge pull request #295 from Kijewski/pr-split-generator
derive: split generator implementation into 3 files
2024-12-23 23:31:26 +01:00
René Kijewski
929d52f306 derive: split generator implementation into 3 files
3000 lines is much too many.
2024-12-23 19:12:43 +01:00
Guillaume Gomez
8a20caa136 Fix block_in_include and add explanations on what is going on 2024-12-22 21:11:04 +01:00
René Kijewski
222b9d23ca
Merge pull request #294 from Kijewski/pr-target-deny-kw
parser: deny all rust keywords as target names  and add `gen` to keywords
2024-12-22 00:03:29 +01:00
René Kijewski
18f1d9b343 parser: deny rust 2024 keyword gen as target name 2024-12-21 23:50:13 +01:00
René Kijewski
c80e78e8b5 parser: deny all rust keywords as target names 2024-12-21 23:49:48 +01:00
René Kijewski
d183c28012
Merge pull request #293 from GuillaumeGomez/improve-err-message
Improve reserved variable name error message
2024-12-21 23:20:29 +01:00
Guillaume Gomez
0d91bee794 Update ui tests 2024-12-21 23:06:56 +01:00
Guillaume Gomez
2a9d240ac4 Improve reserved variable name error message 2024-12-21 23:06:46 +01:00
Guillaume Gomez
d475e7a4a1
Merge pull request #292 from Kijewski/pr-target-writer
derive: reserve variable prefix `__rinja` and free name `writer`
2024-12-21 22:58:22 +01:00
René Kijewski
0cc0189927 Add missing softlinks 2024-12-21 19:55:15 +01:00