Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
2023-08-01 | parser: ensure correct drop order for `Parsed` | René Kijewski | 1 | -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-01 | parser: remove panicking `From<&str> for Whitespace` | René Kijewski | 1 | -12/+5 | |
2023-07-31 | Fix parsing arrays | René Kijewski | 2 | -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 calls | René Kijewski | 2 | -4/+31 | |
This change: * adds a cut when the leading `(` was encountered, and * fixed the interaction between call expressions and boolean OR. | |||||
2023-07-31 | parser: rename block to nodes | Dirkjan Ochtman | 1 | -12/+13 | |
2023-07-31 | parser: reorder items in node module | Dirkjan Ochtman | 1 | -50/+50 | |
2023-07-31 | parser: move Expr parser helpers into callers | Dirkjan Ochtman | 1 | -53/+54 | |
2023-07-31 | parser: move single expr parsers into Expr impl | Dirkjan Ochtman | 1 | -63/+63 | |
2023-07-31 | parser: move binary operator parsers into Expr impl | Dirkjan Ochtman | 1 | -71/+71 | |
2023-07-31 | parser: flatten top-level Expr interface | Dirkjan Ochtman | 2 | -36/+28 | |
2023-07-31 | parser: move suffix parsers into impl block | Dirkjan Ochtman | 1 | -53/+61 | |
2023-07-31 | parser: move cond parsers into type impls | Dirkjan Ochtman | 1 | -39/+43 | |
2023-07-31 | parser: move parser helpers into callers | Dirkjan Ochtman | 1 | -35/+35 | |
2023-07-31 | parser: move when parsers into impl block | Dirkjan Ochtman | 1 | -47/+50 | |
2023-07-31 | parser: define a struct for Match | Dirkjan Ochtman | 1 | -3/+22 | |
2023-07-31 | parser: define a struct for Cond | Dirkjan Ochtman | 1 | -3/+19 | |
2023-07-31 | parser: move node parsers into impl block | Dirkjan Ochtman | 2 | -410/+406 | |
2023-07-31 | parser: move Whitespace parser into method | Dirkjan Ochtman | 1 | -144/+142 | |
2023-07-31 | parser: move impl blocks closer to type definitions | Dirkjan Ochtman | 1 | -12/+12 | |
2023-07-31 | parser: simplify top-level parser match | Dirkjan Ochtman | 1 | -29/+24 | |
2023-07-31 | parser: add top-level Ast type | Dirkjan Ochtman | 2 | -115/+148 | |
2023-07-31 | parser: move nested_parenthesis() helper into node module | Dirkjan Ochtman | 2 | -51/+49 | |
2023-07-31 | parser: move helper functions into State impl | Dirkjan Ochtman | 2 | -93/+92 | |
2023-07-31 | parser: move trait impl closer to type definition | Dirkjan Ochtman | 2 | -11/+11 | |
2023-07-31 | parser: move single-use functions into caller | Dirkjan Ochtman | 1 | -13/+13 | |
2023-07-31 | Extract askama_parser crate | Dirkjan Ochtman | 4 | -0/+2055 | |