aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser/src/expr.rs (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-11-28Allow to pass named arguments to macro callsLibravatar Guillaume Gomez1-5/+74
2023-11-13Derive Clone for Expr and TargetLibravatar Andrew Dona-Couch1-1/+1
2023-10-25Create a type alias for all `IResult` to simplify code readingLibravatar Guillaume Gomez1-29/+23
2023-10-25Create `ErrorContext` typeLibravatar Guillaume Gomez1-33/+41
2023-09-28Require Expr::parse() callers to supply LevelLibravatar Dirkjan Ochtman1-10/+6
2023-09-28Move Level into the crate rootLibravatar Dirkjan Ochtman1-16/+1
2023-09-28Limit expression nesting level to avoid stack overflowsLibravatar Dirkjan Ochtman1-33/+81
2023-09-11Use char_indices() to get byte indices for charactersLibravatar Dirkjan Ochtman1-1/+1
2023-09-11Rename some variablesLibravatar Dirkjan Ochtman1-7/+7
2023-08-03Optimize parsing boolean literals, tooLibravatar René Kijewski1-9/+5
2023-08-03Parse paths and identifiers only onceLibravatar René Kijewski1-10/+10
In the old implementation each variable in an expression would be parsed up to three times: * Try to parse a path because it contains a leading double colon, or infix double colons. * Try to parse it as path again by scanning for an identifier that contains an upper case character. * Fall back to scanning for any identifier. This PR turns all three steps into one, without the need for backtracking.
2023-08-02parser: don't truncates whitespaces after arraysLibravatar René Kijewski1-1/+1
2023-07-31 Fix parsing arraysLibravatar René Kijewski1-5/+7
This change * allows using empty arrays `[]` in expessions, * adds a cut when the leading `[` was encountered, and * fixes the interaction between arrays and boolean OR. IMO the restriction that you couldn't use empty arrays is not needed. The missing cut made error messages slictly worse if you forget to add the closing `]`. Filter expressions must not have white spaces before the pipe `|`. The white space is used to tell a filter expressions, and `std::ops::Or` apart.
2023-07-31 Fix parsing callsLibravatar René Kijewski1-3/+5
This change: * adds a cut when the leading `(` was encountered, and * fixed the interaction between call expressions and boolean OR.
2023-07-31parser: move Expr parser helpers into callersLibravatar Dirkjan Ochtman1-53/+54
2023-07-31parser: move single expr parsers into Expr implLibravatar Dirkjan Ochtman1-63/+63
2023-07-31parser: move binary operator parsers into Expr implLibravatar Dirkjan Ochtman1-71/+71
2023-07-31parser: flatten top-level Expr interfaceLibravatar Dirkjan Ochtman1-35/+27
2023-07-31parser: move suffix parsers into impl blockLibravatar Dirkjan Ochtman1-53/+61
2023-07-31parser: move nested_parenthesis() helper into node moduleLibravatar Dirkjan Ochtman1-3/+49
2023-07-31Extract askama_parser crateLibravatar Dirkjan Ochtman1-1/+1
2023-07-31derive: move generator-specific methods out of ExprLibravatar Dirkjan Ochtman1-71/+0
2023-07-24Fix Rust macro invocations not accepting a path (#837)Libravatar Matthew Taylor1-14/+24
2023-02-24Fix typosLibravatar René Kijewski1-11/+11
2023-01-30derive: refactor parserLibravatar René Kijewski1-0/+346
`parser.rs` was a single file containing almost 2000 lines. This PR split the file into multiple, smaller files. `Expr`, `Node`, and `Target` each get an own file. Each struct gets a `parse()` method that return `Result<Self>`, and every other detail is private to the file. This PR should make this essential part of Askama more easy to understand, and make future modifications easier.