diff options
author | René Kijewski <rene.kijewski@fu-berlin.de> | 2023-08-01 10:39:24 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-08-01 13:04:41 +0200 |
commit | cdfe287b730a748f0601da2bc471d056c72c0559 (patch) | |
tree | 894d09427e3f8791af7d9196b45f387acb550b71 /askama_parser | |
parent | 1521a08a20b6631b54d4ecbbbfcb4260e393bc97 (diff) | |
download | askama-cdfe287b730a748f0601da2bc471d056c72c0559.tar.gz askama-cdfe287b730a748f0601da2bc471d056c72c0559.tar.bz2 askama-cdfe287b730a748f0601da2bc471d056c72c0559.zip |
parser: remove re-exports `parser::{node,expr}::*`
Diffstat (limited to 'askama_parser')
-rw-r--r-- | askama_parser/src/lib.rs | 15 | ||||
-rw-r--r-- | askama_parser/src/node.rs | 4 | ||||
-rw-r--r-- | askama_parser/src/tests.rs | 6 |
3 files changed, 12 insertions, 13 deletions
diff --git a/askama_parser/src/lib.rs b/askama_parser/src/lib.rs index bd7edde..25d164f 100644 --- a/askama_parser/src/lib.rs +++ b/askama_parser/src/lib.rs @@ -14,14 +14,10 @@ use nom::multi::separated_list1; use nom::sequence::{delimited, pair, tuple}; use nom::{error_position, AsChar, IResult, InputTakeAtPosition}; -pub use self::expr::Expr; -pub use self::node::{ - BlockDef, Call, Cond, CondTest, Extends, If, Import, Include, Let, Lit, Loop, Macro, Match, - Node, Raw, Target, When, Whitespace, Ws, -}; - -mod expr; -mod node; +pub mod expr; +pub use expr::Expr; +pub mod node; +pub use node::Node; #[cfg(test)] mod tests; @@ -29,7 +25,8 @@ mod _parsed { use std::cmp::PartialEq; use std::{fmt, mem}; - use super::{Ast, Node, ParseError, Syntax}; + use super::node::Node; + use super::{Ast, ParseError, Syntax}; pub struct Parsed { // `source` must outlive `ast`, so `ast` must be declared before `source` diff --git a/askama_parser/src/node.rs b/askama_parser/src/node.rs index b955549..89ffae1 100644 --- a/askama_parser/src/node.rs +++ b/askama_parser/src/node.rs @@ -9,9 +9,9 @@ use nom::multi::{fold_many0, many0, many1, separated_list0, separated_list1}; use nom::sequence::{delimited, pair, preceded, terminated, tuple}; use nom::{error_position, IResult}; +use super::expr::Expr; use super::{ - bool_lit, char_lit, identifier, is_ws, keyword, num_lit, path, skip_till, str_lit, ws, Expr, - State, + bool_lit, char_lit, identifier, is_ws, keyword, num_lit, path, skip_till, str_lit, ws, State, }; #[derive(Debug, PartialEq)] diff --git a/askama_parser/src/tests.rs b/askama_parser/src/tests.rs index 4717652..9f0fbd1 100644 --- a/askama_parser/src/tests.rs +++ b/askama_parser/src/tests.rs @@ -1,4 +1,6 @@ -use super::{Ast, Expr, Lit, Node, Syntax, Whitespace, Ws}; +use super::expr::Expr; +use super::node::{Lit, Node, Whitespace, Ws}; +use super::{Ast, Syntax}; fn check_ws_split(s: &str, res: &(&str, &str, &str)) { let Lit { lws, val, rws } = Lit::split_ws_parts(s); @@ -629,7 +631,7 @@ fn test_parse_comments() { #[test] fn test_parse_tuple() { - use super::Expr::*; + use super::expr::Expr::*; let syntax = Syntax::default(); assert_eq!( Ast::from_str("{{ () }}", &syntax).unwrap().nodes, |