diff --git a/src/passes/1-parser/pascaligo/AST.ml b/src/passes/1-parser/pascaligo/AST.ml index 8a95555eb..44c6c0734 100644 --- a/src/passes/1-parser/pascaligo/AST.ml +++ b/src/passes/1-parser/pascaligo/AST.ml @@ -406,8 +406,7 @@ and lhs = Path of path | MapPath of map_lookup reg -and rhs = - Expr of expr +and rhs = expr and loop = While of while_loop reg @@ -757,8 +756,7 @@ let lhs_to_region : lhs -> Region.t = function Path path -> path_to_region path | MapPath {region; _} -> region -let rhs_to_region = function - Expr e -> expr_to_region e +let rhs_to_region = expr_to_region let selection_to_region = function FieldName {region; _} diff --git a/src/passes/1-parser/pascaligo/AST.mli b/src/passes/1-parser/pascaligo/AST.mli index f3a22e743..4984830e0 100644 --- a/src/passes/1-parser/pascaligo/AST.mli +++ b/src/passes/1-parser/pascaligo/AST.mli @@ -390,8 +390,7 @@ and lhs = Path of path | MapPath of map_lookup reg -and rhs = - Expr of expr +and rhs = expr and loop = While of while_loop reg diff --git a/src/passes/1-parser/pascaligo/Parser.mly b/src/passes/1-parser/pascaligo/Parser.mly index a1902bade..bc99f9176 100644 --- a/src/passes/1-parser/pascaligo/Parser.mly +++ b/src/passes/1-parser/pascaligo/Parser.mly @@ -591,7 +591,7 @@ assignment: in {region; value}} rhs: - expr { Expr $1 } + expr { $1 } lhs: path { Path $1 } diff --git a/src/passes/1-parser/pascaligo/ParserLog.ml b/src/passes/1-parser/pascaligo/ParserLog.ml index b6e9d651f..3be60d699 100644 --- a/src/passes/1-parser/pascaligo/ParserLog.ml +++ b/src/passes/1-parser/pascaligo/ParserLog.ml @@ -309,8 +309,7 @@ and print_assignment {value; _} = print_token assign ":="; print_rhs rhs -and print_rhs = function - Expr e -> print_expr e +and print_rhs e = print_expr e and print_lhs = function Path path -> print_path path diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index f536a409a..5627c49f6 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -780,9 +780,7 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu ) | Assign a -> ( let (a , loc) = r_split a in - let%bind value_expr = match a.rhs with - | Expr e -> simpl_expression e - in + let%bind value_expr = simpl_expression a.rhs in match a.lhs with | Path path -> ( let (name , path') = simpl_path path in