aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Generator: make `normalize_identifier` faster (#946)Libravatar René Kijewski2024-01-123-54/+804
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `normalize_identifier` is called quite often in the generator, once for every variable name or path element that is written. This PR aims to speed up the function by * using a per-length input string length replacement map * binary searching the replacement map instead of a linear search Diffent, but functionally equivalent implementations were compared: ```text * linear search in one big map: 348.44 µs * binary search in one big map: 334.46 µs * linear search in a per-length map: 178.84 µs * binary search in a per-length map: 154.54 µs * perfect hashing: 170.87 µs ``` The winner of this competition is "binary search in a per-length map". It does not introduce new dependencies, but has the slight disadvantage that it uses one instance of `unsafe` code. I deem this disadvantage acceptable, though. Nb. It was also tested if a variant that only stores the replaced string would be faster. This "optimization" proved to be slower for all implementations except "binary search in a per-length map", for which it has the same runtime. Without a clear advantage to use the "optimized version", I chose to use the more easy to read slice of tuples variant. Obviously, for all measurements: YMMV.
* Add documentation for `as_ref` builtin filterLibravatar Guillaume Gomez2024-01-121-0/+18
|
* Add test for `as_ref` builtin filterLibravatar Guillaume Gomez2024-01-121-0/+14
|
* Add `as_ref` builtin filterLibravatar Guillaume Gomez2024-01-121-0/+17
|
* parser: add test for target recursion overflowLibravatar Dirkjan Ochtman2024-01-112-0/+6
|
* parser: limit target recursionLibravatar Dirkjan Ochtman2024-01-111-14/+25
|
* Revert "Add automatic borrowing to let statement"Libravatar Guillaume Gomez2024-01-102-21/+0
| | | | This reverts commit 3d52283b74573af509deb3c47cbabf7b7b58b1dd.
* Make the `markdown` filter compatible with `String`Libravatar Jakub Stachurski2024-01-092-1/+19
| | | | | | | | | | | | | | | | | This commit solves issue #719. This is done by making the markdown filter borrow the string and simplifying the filter to accept `&str` instead of `AsRef<str>` Add test for the markdown filter using as input Revert markdown filter changes Revert unnecessary changes Improve test_markdown_owned_string test Use cargo fmt
* Fix typoLibravatar Sadika Sumanapala2023-12-181-1/+1
|
* Bump askama_derive version to 0.12.4Libravatar Dirkjan Ochtman2023-12-181-1/+1
|
* Make API more idiomaticLibravatar Dirkjan Ochtman2023-12-182-4/+4
|
* Unbreak reading config from default locationLibravatar Dirkjan Ochtman2023-12-182-6/+8
| | | | | | I broke this in 2a4d58cbb2033114890415c98a61e730185d1f83 due to refactoring for better internal abstractions in askama_derive. We also don't currently have any tests for the default config path.
* Prepare askama_derive and _parser releasesLibravatar Dirkjan Ochtman2023-12-182-3/+3
|
* Add automatic borrowing to let statementLibravatar max2023-12-132-0/+21
| | | | Signed-off-by: max <gmx.sht@gmail.com>
* Bugfix in `is_attr_self()`Libravatar max2023-12-132-1/+20
| | | | Signed-off-by: max <gmx.sht@gmail.com>
* Allow trailing comma in macro definition and callLibravatar Guillaume Gomez2023-12-073-2/+32
|
* Undo an accidental deletion of `#[derive(Debug)]`Libravatar max2023-12-071-0/+1
| | | | Signed-off-by: max <gmx.sht@gmail.com>
* Added testing for reserved variable namesLibravatar max2023-12-072-5/+20
| | | | Signed-off-by: max <gmx.sht@gmail.com>
* Add macro test with only argument being passed as namedLibravatar Guillaume Gomez2023-12-071-0/+17
|
* build(deps): update comrak requirement from 0.18 to 0.20Libravatar dependabot[bot]2023-11-302-2/+2
| | | | | | | | | | | | | | Updates the requirements on [comrak](https://github.com/kivikakk/comrak) to permit the latest version. - [Release notes](https://github.com/kivikakk/comrak/releases) - [Changelog](https://github.com/kivikakk/comrak/blob/main/changelog.txt) - [Commits](https://github.com/kivikakk/comrak/compare/0.18.0...0.20.0) --- updated-dependencies: - dependency-name: comrak dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
* Upgrade to comrak 0.19Libravatar Dirkjan Ochtman2023-11-304-51/+19
|
* Add documentation for macro named argumentsLibravatar Guillaume Gomez2023-11-281-3/+48
|
* Add tests for named arguments in macro callsLibravatar Guillaume Gomez2023-11-283-0/+117
|
* Allow to pass named arguments to macro callsLibravatar Guillaume Gomez2023-11-283-7/+130
|
* askama_axum: update axum to 0.7 (#918)Libravatar lictex_2023-11-272-6/+8
|
* askama_rocket: Rocket v0.5.0Libravatar Philippe Loctaux2023-11-271-1/+1
|
* Add better support for rust-like number literals (#908)Libravatar PizzasBear2023-11-223-5/+99
| | | Signed-off-by: max <gmx.sht@gmail.com>
* Enhance match to include multiple targets (#911)Libravatar PizzasBear2023-11-224-0/+60
| | | Signed-off-by: max <gmx.sht@gmail.com>
* Add UI tests for macros error messageLibravatar Guillaume Gomez2023-11-202-0/+50
|
* Improve macro call arguments loopLibravatar Guillaume Gomez2023-11-201-4/+1
|
* Improve output error for non-matching number of arguments for macrosLibravatar Guillaume Gomez2023-11-201-1/+8
|
* Derive Clone for Expr and TargetLibravatar Andrew Dona-Couch2023-11-132-2/+2
|
* add support for svg file extensionLibravatar Marvin Jütte2023-11-092-3/+9
|
* Add missing link to template expansionLibravatar Guillaume Gomez2023-11-071-0/+1
|
* Add new chapter in the askama book about template expansionLibravatar Guillaume Gomez2023-11-071-0/+485
|
* document function syntax in templatesLibravatar Thomas Threadgold2023-11-071-0/+116
|
* Remove unused `_did_loop` condition if `else` block is emptyLibravatar Guillaume Gomez2023-11-011-9/+21
|
* Avoid passing around duplicate dataLibravatar Dirkjan Ochtman2023-11-012-21/+4
|
* Build Config from TemplateArgsLibravatar Dirkjan Ochtman2023-11-012-9/+12
|
* Reorganize TemplateArgs and TemplateInput structureLibravatar Dirkjan Ochtman2023-11-012-25/+24
|
* Inline some logic into find_used_templates()Libravatar Dirkjan Ochtman2023-11-012-8/+8
|
* Cleanup imports a bitLibravatar Dirkjan Ochtman2023-11-013-6/+4
|
* Implement Default for MapChainLibravatar Dirkjan Ochtman2023-11-012-8/+10
|
* Move build_template() up to the crate rootLibravatar Dirkjan Ochtman2023-11-012-63/+67
|
* Remove unnecessary type annotationLibravatar Dirkjan Ochtman2023-11-011-1/+1
|
* Attach find_used_templates() to TemplateInputLibravatar Dirkjan Ochtman2023-11-012-44/+45
|
* Move TemplateArgs into input moduleLibravatar Dirkjan Ochtman2023-11-012-134/+134
|
* Inline nested derive_template() implementationLibravatar Dirkjan Ochtman2023-11-012-12/+6
|
* Improve the macros sectionLibravatar Mo2023-10-301-5/+4
|
* build(deps): update futures-lite requirement from 1.12.0 to 2.0.0Libravatar dependabot[bot]2023-10-261-1/+1
| | | | | | | | | | | | | | Updates the requirements on [futures-lite](https://github.com/smol-rs/futures-lite) to permit the latest version. - [Release notes](https://github.com/smol-rs/futures-lite/releases) - [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md) - [Commits](https://github.com/smol-rs/futures-lite/compare/v1.12.0...v2.0.0) --- updated-dependencies: - dependency-name: futures-lite dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>