diff --git a/parser/src/ast/expr.rs b/parser/src/ast/expr.rs index 4eb8b91..f89da9a 100644 --- a/parser/src/ast/expr.rs +++ b/parser/src/ast/expr.rs @@ -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, prefixes: Vec, diff --git a/parser/src/parser/common/expr.rs b/parser/src/parser/common/expr.rs index c0dc13e..68c858c 100644 --- a/parser/src/parser/common/expr.rs +++ b/parser/src/parser/common/expr.rs @@ -74,7 +74,6 @@ impl<'a> TryFrom> 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> 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), } diff --git a/src/codegen.rs b/src/codegen.rs index 7e0b200..d6cb936 100644 --- a/src/codegen.rs +++ b/src/codegen.rs @@ -225,7 +225,7 @@ impl GetRust for ExprPath { .iter() .map(ExprPathSegment::get_rust) .collect::>() - .join(", ") + .join("::") } }