diff options
author | René Kijewski <rene.kijewski@fu-berlin.de> | 2023-08-01 03:45:32 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-08-01 13:04:41 +0200 |
commit | 7b7c38b37785b83ce28f1cc5f6e89abb89672276 (patch) | |
tree | a16abd0f5e877184837adc032db0d3e0cf66b978 /askama_parser/src/lib.rs | |
parent | 26f598c0d189769952b11ea9fe6168718f403590 (diff) | |
download | askama-7b7c38b37785b83ce28f1cc5f6e89abb89672276.tar.gz askama-7b7c38b37785b83ce28f1cc5f6e89abb89672276.tar.bz2 askama-7b7c38b37785b83ce28f1cc5f6e89abb89672276.zip |
parser: add type for `Node::Lit`
Diffstat (limited to 'askama_parser/src/lib.rs')
-rw-r--r-- | askama_parser/src/lib.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/askama_parser/src/lib.rs b/askama_parser/src/lib.rs index d095f65..8138a19 100644 --- a/askama_parser/src/lib.rs +++ b/askama_parser/src/lib.rs @@ -16,7 +16,8 @@ use nom::{error_position, AsChar, IResult, InputTakeAtPosition}; pub use self::expr::Expr; pub use self::node::{ - BlockDef, Call, Cond, CondTest, Import, Loop, Macro, Match, Node, Target, When, Whitespace, Ws, + BlockDef, Call, Cond, CondTest, Import, Lit, Loop, Macro, Match, Node, Target, When, + Whitespace, Ws, }; mod expr; @@ -138,13 +139,6 @@ fn ws<'a, O>( delimited(take_till(not_ws), inner, take_till(not_ws)) } -fn split_ws_parts(s: &str) -> Node<'_> { - let trimmed_start = s.trim_start_matches(is_ws); - let len_start = s.len() - trimmed_start.len(); - let trimmed = trimmed_start.trim_end_matches(is_ws); - Node::Lit(&s[..len_start], trimmed, &trimmed_start[trimmed.len()..]) -} - /// Skips input until `end` was found, but does not consume it. /// Returns tuple that would be returned when parsing `end`. fn skip_till<'a, O>( |