Skip to content

Commit

Permalink
Remove duplicate literal
Browse files Browse the repository at this point in the history
  • Loading branch information
AlSchlo committed Feb 10, 2025
1 parent 591f4c3 commit c5bcfa5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions optd-core/src/dsl/parser/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ pub enum Expr {
Match(Box<Expr>, Vec<MatchArm>), // Pattern matching
If(Box<Expr>, Box<Expr>, Box<Expr>), // If-then-else
Val(String, Box<Expr>, Box<Expr>), // Local binding (val x = e1; e2)
Array(Vec<Expr>), // Array literals
Tuple(Vec<Expr>), // Tuple literals
Constructor(String, Vec<Expr>), // Constructor application (currently only operators)
Binary(Box<Expr>, BinOp, Box<Expr>), // Binary operations
Unary(UnaryOp, Box<Expr>), // Unary operations
Expand Down
4 changes: 2 additions & 2 deletions optd-core/src/dsl/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ fn parse_val_expr(pair: Pair<'_, Rule>) -> Expr {
/// Parse an array literal
fn parse_array_literal(pair: Pair<'_, Rule>) -> Expr {
let exprs = pair.into_inner().map(parse_expr).collect();
Expr::Array(exprs)
Expr::Literal(Literal::Array(exprs))
}

/// Parse a tuple literal
fn parse_tuple_literal(pair: Pair<'_, Rule>) -> Expr {
let exprs = pair.into_inner().map(parse_expr).collect();
Expr::Tuple(exprs)
Expr::Literal(Literal::Tuple(exprs))
}

/// Parse a constructor expression
Expand Down

0 comments on commit c5bcfa5

Please sign in to comment.