aboutsummaryrefslogtreecommitdiffstats
path: root/askama_parser/src/lib.rs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Limit nesting in parser nodes, tooLibravatar René Kijewski2023-09-281-0/+15
|
* Move Level into the crate rootLibravatar Dirkjan Ochtman2023-09-281-0/+15
|
* Parse paths and identifiers only onceLibravatar René Kijewski2023-08-031-24/+31
| | | | | | | | | | | | | | 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.
* parser: allow negative numbers in patternsLibravatar René Kijewski2023-08-021-1/+5
|
* parser: better error message for unknown nodesLibravatar René Kijewski2023-08-021-8/+7
|
* parser: remove re-exports `parser::{node,expr}::*`Libravatar René Kijewski2023-08-011-9/+6
|
* parser: add type for `Node::Extends`Libravatar René Kijewski2023-08-011-2/+2
|
* parser: add type for `Node::Include`Libravatar René Kijewski2023-08-011-2/+2
|
* parser: rename `Node::Cond` into `If` and add typeLibravatar René Kijewski2023-08-011-2/+2
|
* parser: add type for `Node::Let`Libravatar René Kijewski2023-08-011-1/+1
|
* parser: add type for `Node::Raw`Libravatar René Kijewski2023-08-011-1/+1
|
* parser: add type for `Node::Lit`Libravatar René Kijewski2023-08-011-8/+2
|
* parser: add type for `Node::BlockDef`Libravatar René Kijewski2023-08-011-1/+1
|
* parser: add type for `Node::Match`Libravatar René Kijewski2023-08-011-1/+1
|
* parser: add type for `Node::Call`Libravatar René Kijewski2023-08-011-1/+3
|
* parser: add type for `Node::Import`Libravatar René Kijewski2023-08-011-1/+1
|
* parser: add `Ast::nodes()` methodLibravatar René Kijewski2023-08-011-0/+4
|
* parser: impement `PartialEq` for `Ast`Libravatar René Kijewski2023-08-011-0/+7
|
* parser: implement `Debug` for `Parsed`Libravatar René Kijewski2023-08-011-1/+9
|
* parser: use `?`Libravatar René Kijewski2023-08-011-5/+1
|
* parser: ensure correct drop order for `Parsed`Libravatar René Kijewski2023-08-011-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
* parser: move node parsers into impl blockLibravatar Dirkjan Ochtman2023-07-311-22/+2
|
* parser: simplify top-level parser matchLibravatar Dirkjan Ochtman2023-07-311-29/+24
|
* parser: add top-level Ast typeLibravatar Dirkjan Ochtman2023-07-311-33/+40
|
* parser: move nested_parenthesis() helper into node moduleLibravatar Dirkjan Ochtman2023-07-311-48/+0
|
* parser: move helper functions into State implLibravatar Dirkjan Ochtman2023-07-311-61/+61
|
* parser: move trait impl closer to type definitionLibravatar Dirkjan Ochtman2023-07-311-11/+0
|
* parser: move single-use functions into callerLibravatar Dirkjan Ochtman2023-07-311-13/+13
|
* Extract askama_parser crateLibravatar Dirkjan Ochtman2023-07-311-0/+384