153 Commits

Author SHA1 Message Date
René Kijewski
4fd4fb4d00 Add simple parser benchmark 2024-05-16 18:30:33 +02:00
René Kijewski
2b4f264d5a Better error message for break/continue 2024-05-16 13:50:49 +02:00
René Kijewski
e605478076 Better error message for {% macro super %} 2024-05-16 13:50:49 +02:00
René Kijewski
b668774f9b Fix parsing nested comments
This changes makes parsing nested comments run in linear time, and
constant space.
2024-05-01 13:52:46 +02:00
Guillaume Gomez
cbd74ad520 Fix clippy lint 2024-04-26 16:50:12 +02:00
Guillaume Gomez
c6d0ba8dbc Add checks for chars 2024-04-26 16:50:12 +02:00
Guillaume Gomez
3e5ccaeea5 Add more tests for floating parsing 2024-04-24 14:46:43 +02:00
vallentin
c1d945a882 Moved cfg not windows 2024-04-21 14:35:21 +02:00
Guillaume Gomez
ad73f755e9 Correctly handle whitespace character(s) on filter blocks 2024-04-12 17:23:42 +02:00
Guillaume Gomez
0b4b7d6345 Improve error message by providing the file where the error occurred if it is not an inlined source 2024-04-05 12:13:54 +02:00
Guillaume Gomez
5338f62a93 Add support for filter chaining in filter blocks 2024-03-11 14:25:46 +01:00
Guillaume Gomez
9439638e0f Create new Filter type 2024-03-11 14:25:46 +01:00
René Kijewski
7aa4a80791 Remove redundant import 2024-03-07 17:10:58 +01:00
Guillaume Gomez
279105bd4d Remove unused Next variant value 2024-03-07 14:55:53 +01:00
Guillaume Gomez
dab6c8007c Add support for filter block 2024-03-07 11:33:34 +01:00
Guillaume Gomez
29687db996 Improve error when whitespace control is used on extends 2024-01-22 17:13:01 +01:00
Dirkjan Ochtman
eb4c4ec915 Bump version numbers for release 2024-01-18 11:30:54 +01:00
Dirkjan Ochtman
79738ff238 Fix support for mixed case variables 2024-01-18 11:23:18 +01:00
Dirkjan Ochtman
250828a6d2 Yield error on deep AST recursion 2024-01-18 07:39:25 +01:00
max
2c7759c0d0 Improve performance of find_used_templates
Signed-off-by: max <gmx.sht@gmail.com>
2024-01-17 17:58:53 +01:00
Fabio Valentini
b1386c1fbf parser: add missing license files 2024-01-15 07:28:38 +01:00
Dirkjan Ochtman
84c2094e87 parser: add test for target recursion overflow 2024-01-11 16:32:50 +01:00
Dirkjan Ochtman
10c38c51f6 parser: limit target recursion 2024-01-11 16:32:50 +01:00
Dirkjan Ochtman
25bf3e945c Prepare askama_derive and _parser releases 2023-12-18 11:07:31 +01:00
Guillaume Gomez
e4b8ca3c44 Allow trailing comma in macro definition and call 2023-12-07 11:03:26 +01:00
max
7f30a657f6 Undo an accidental deletion of #[derive(Debug)]
Signed-off-by: max <gmx.sht@gmail.com>
2023-12-07 10:17:43 +01:00
max
33eb70c34a Added testing for reserved variable names
Signed-off-by: max <gmx.sht@gmail.com>
2023-12-07 10:17:43 +01:00
Guillaume Gomez
b3020ee8bf Allow to pass named arguments to macro calls 2023-11-28 11:36:09 +01:00
PizzasBear
696561003d
Add better support for rust-like number literals (#908)
Signed-off-by: max <gmx.sht@gmail.com>
2023-11-22 16:09:33 +01:00
PizzasBear
48c6cd327d
Enhance match to include multiple targets (#911)
Signed-off-by: max <gmx.sht@gmail.com>
2023-11-22 14:56:14 +01:00
Andrew Dona-Couch
6cbfde0451 Derive Clone for Expr and Target 2023-11-13 20:24:02 +01:00
Guillaume Gomez
76462255ea Create a type alias for all IResult to simplify code reading 2023-10-25 16:26:36 +02:00
Guillaume Gomez
d48ac76f0a Improve error for elif keyword 2023-10-25 14:54:14 +02:00
Guillaume Gomez
c056d6287b Improve error for invalid name used in endmacro 2023-10-25 14:30:35 +02:00
Guillaume Gomez
c3281e353d Improve error for invalid name used in endblock 2023-10-25 14:30:35 +02:00
Guillaume Gomez
6dae920a45 Create ErrorContext type 2023-10-25 14:30:35 +02:00
Dirkjan Ochtman
a6bc14c8ca Advertise Discord channel instead of Gitter 2023-10-03 17:39:03 +02:00
Dirkjan Ochtman
22ec6c95a1 parser: version bump to 0.1.1 2023-09-29 17:07:12 +02:00
Dirkjan Ochtman
1ce939a729 parser: add rudimentary README 2023-09-29 17:07:12 +02:00
Dirkjan Ochtman
daa8d89b57 Add MSRV checking in CI
Bump MSRV to 1.65 for the use of let .. else.
2023-09-29 16:13:24 +02:00
René Kijewski
eef38cea67 Pass Node parsing level to expressions 2023-09-28 17:28:26 +02:00
René Kijewski
238e4bbad7 Limit nesting in parser nodes, too 2023-09-28 17:28:26 +02:00
Dirkjan Ochtman
36f4442978 Require Expr::parse() callers to supply Level 2023-09-28 17:28:26 +02:00
Dirkjan Ochtman
5718175291 Move Level into the crate root 2023-09-28 17:28:26 +02:00
Dirkjan Ochtman
5ab8813fe2 Yield a parser error when defining a macro named 'super' 2023-09-28 15:40:57 +02:00
Dirkjan Ochtman
c8530493a1 Limit expression nesting level to avoid stack overflows 2023-09-28 14:43:44 +02:00
manunio
2ef2b9db9e fuzz: remove input limit
While working on https://github.com/djc/askama/pull/862 fuzz_parser was
crashing and failing oss-fuzz build_checks. so a limit of 500 was placed, this pr removes that.
2023-09-18 15:57:17 +02:00
manunio
8f3140a33f fuzz: Add fuzz for askama_parser 2023-09-13 14:48:08 +02:00
Dirkjan Ochtman
2e8e42af45 Use char_indices() to get byte indices for characters 2023-09-11 12:19:16 +02:00
Dirkjan Ochtman
dd9635ace6 Rename some variables 2023-09-11 12:19:16 +02:00