pub fn parse_expr(source: &str) -> Result<Expr>Expand description
Parses the inside of a {{ … }} region into an Expr.
§Errors
Invalid syntax or trailing garbage (after trim) yields [RunjucksError].
§Examples
use runjucks_core::parser::parse_expr;
use runjucks_core::ast::Expr;
match parse_expr("foo").unwrap() {
Expr::Variable(name) => assert_eq!(name, "foo"),
_ => panic!("expected variable"),
}