templater: eliminate whitespace nodes from parse tree

This commit is contained in:
Yuya Nishihara 2023-01-28 19:02:07 +09:00
parent a85488b11d
commit f7993f0fe9
2 changed files with 2 additions and 2 deletions

View file

@ -17,7 +17,7 @@
// predecessors % ("predecessor: " commit_id)
// parents % (commit_id " is a parent of " super.commit_id)
whitespace = { " " | "\n" }
whitespace = _{ " " | "\n" }
escape = @{ "\\" ~ ("n" | "\"" | "\\") }
literal_char = @{ !("\"" | "\\") ~ ANY }

View file

@ -374,7 +374,7 @@ fn parse_commit_template_rule<'a>(
}
Box::new(ListTemplate(formatters))
}
_ => Box::new(Literal(String::new())),
other => panic!("unexpected template rule: {other:?}"),
}
}