From cdfe287b730a748f0601da2bc471d056c72c0559 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Tue, 1 Aug 2023 10:39:24 +0200 Subject: parser: remove re-exports `parser::{node,expr}::*` --- askama_parser/src/lib.rs | 15 ++++++--------- askama_parser/src/node.rs | 4 ++-- askama_parser/src/tests.rs | 6 ++++-- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'askama_parser/src') 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, -- cgit