aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2023-08-01parser: add type for `Node::Raw`Libravatar René Kijewski2-29/+38
2023-08-01parser: add type for `Node::Lit`Libravatar René Kijewski3-49/+54
2023-08-01parser: add type for `Node::BlockDef`Libravatar René Kijewski2-30/+45
2023-08-01parser: add type for `Node::Match`Libravatar René Kijewski2-36/+54
2023-08-01parser: add type for `Node::Call`Libravatar René Kijewski2-20/+40
2023-08-01parser: add type for `Node::Import`Libravatar René Kijewski2-17/+33
2023-08-01parser: let `Macro` know its nameLibravatar René Kijewski1-52/+53
2023-08-01parser: add `Ast::nodes()` methodLibravatar René Kijewski1-0/+4
2023-08-01parser: impement `PartialEq` for `Ast`Libravatar René Kijewski1-0/+7
2023-08-01parser: implement `Debug` for `Parsed`Libravatar René Kijewski1-1/+9
2023-08-01parser: use `?`Libravatar René Kijewski1-5/+1
2023-08-01parser: ensure correct drop order for `Parsed`Libravatar René Kijewski1-2/+3
According to [RFC 1857] the fields of a struct are dropped in the same order as they are declared. For `struct S { a: A, b: B }` field `a` is dropped before field `b`. Our struct `Parsed` is self referencial. Its field `ast` depends on `source`, so `source` must outlife `ast`. This PR changes the order of the fields to reflect this requirement. In practice it should not matter, because we know that the variant of `Node` won't access the string data during their `Drop`, but better safe than sorry - maybe `Node` changes in the future. [RFC 1857]: https://rust-lang.github.io/rfcs/1857-stabilize-drop-order.html
2023-08-01parser: remove panicking `From<&str> for Whitespace`Libravatar René Kijewski1-12/+5
2023-07-31 Fix parsing arraysLibravatar René Kijewski2-5/+90
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é Kijewski2-4/+31
This change: * adds a cut when the leading `(` was encountered, and * fixed the interaction between call expressions and boolean OR.
2023-07-31parser: rename block to nodesLibravatar Dirkjan Ochtman1-12/+13
2023-07-31parser: reorder items in node moduleLibravatar Dirkjan Ochtman1-50/+50
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 Ochtman2-36/+28
2023-07-31parser: move suffix parsers into impl blockLibravatar Dirkjan Ochtman1-53/+61
2023-07-31parser: move cond parsers into type implsLibravatar Dirkjan Ochtman1-39/+43
2023-07-31parser: move parser helpers into callersLibravatar Dirkjan Ochtman1-35/+35
2023-07-31parser: move when parsers into impl blockLibravatar Dirkjan Ochtman1-47/+50
2023-07-31parser: define a struct for MatchLibravatar Dirkjan Ochtman1-3/+22
2023-07-31parser: define a struct for CondLibravatar Dirkjan Ochtman1-3/+19
2023-07-31parser: move node parsers into impl blockLibravatar Dirkjan Ochtman2-410/+406
2023-07-31parser: move Whitespace parser into methodLibravatar Dirkjan Ochtman1-144/+142
2023-07-31parser: move impl blocks closer to type definitionsLibravatar Dirkjan Ochtman1-12/+12
2023-07-31parser: simplify top-level parser matchLibravatar Dirkjan Ochtman1-29/+24
2023-07-31parser: add top-level Ast typeLibravatar Dirkjan Ochtman2-115/+148
2023-07-31parser: move nested_parenthesis() helper into node moduleLibravatar Dirkjan Ochtman2-51/+49
2023-07-31parser: move helper functions into State implLibravatar Dirkjan Ochtman2-93/+92
2023-07-31parser: move trait impl closer to type definitionLibravatar Dirkjan Ochtman2-11/+11
2023-07-31parser: move single-use functions into callerLibravatar Dirkjan Ochtman1-13/+13
2023-07-31Extract askama_parser crateLibravatar Dirkjan Ochtman4-0/+2055