Skip to content

Commit

Permalink
parser: move node parsers into impl block
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jul 2, 2023
1 parent b92c848 commit 1f4ee68
Show file tree
Hide file tree
Showing 2 changed files with 348 additions and 352 deletions.
2 changes: 1 addition & 1 deletion askama_parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct Ast<'a> {

impl<'a> Ast<'a> {
pub fn from_str(src: &'a str, syntax: &Syntax<'_>) -> Result<Self, ParseError> {
let err = match Node::parse(src, &State::new(syntax)) {
let err = match Node::many(src, &State::new(syntax)) {
Ok((left, nodes)) => match left.is_empty() {
true => return Ok(Self { nodes }),
false => return Err(ParseError(format!("unable to parse template:\n\n{left:?}"))),
Expand Down
Loading

0 comments on commit 1f4ee68

Please sign in to comment.