Fixed expression
This commit is contained in:
@@ -29,7 +29,7 @@ pub enum BinaryOp {
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum Expression {
|
||||
Literal(Literal),
|
||||
Path(ExprPath), // Updated from Path to support paths containing turbofish segments
|
||||
Path(ExprPath),
|
||||
Fix {
|
||||
initial: Box<Expression>,
|
||||
prefixes: Vec<Prefix>,
|
||||
|
||||
@@ -74,7 +74,6 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Expression {
|
||||
.parse(inner)
|
||||
}
|
||||
|
||||
// 2. The single unit 'term' replaces the old flat 'expr' layout
|
||||
Rule::term => {
|
||||
let mut prefix_pairs = Vec::new();
|
||||
let mut primary_pair = None;
|
||||
@@ -119,6 +118,7 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Expression {
|
||||
Rule::primary => pair.into_inner().next().unwrap().try_into(),
|
||||
Rule::static_path => ast_expr!(Expression::Path(pair.try_into())),
|
||||
Rule::literal => ast_expr!(Expression::Literal(pair.try_into())),
|
||||
Rule::expr_path => ast_expr!(Expression::Path(pair.try_into())),
|
||||
|
||||
_ => AstError::bug_unimplemented(pair),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user