Skip to content

Commit

Permalink
Merge pull request #270 from FissoreD/flatten_ast_of_commas
Browse files Browse the repository at this point in the history
[compiler] flatten commas AST
  • Loading branch information
gares authored Nov 9, 2024
2 parents a413abb + fcf9992 commit 72da262
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ let mkApp loc = function
| [] -> anomaly ~loc "empty application"
| x::_ -> raise (NotInProlog(loc,"syntax error: the head of an application must be a constant or a variable, got: " ^ best_effort_pp x.it))

let mkAppF loc (cloc, c) = function
let rec mkAppF loc (cloc, c) = function
| [] -> anomaly ~loc "empty application"
| { loc; it = App({it=Const ","; loc=cloc}, tl1)} ::tl when c="," -> mkAppF loc (cloc, ",") (tl1@tl)
| args -> { loc; it = App( { it = Const c; loc = cloc },args) }


Expand Down

0 comments on commit 72da262

Please sign in to comment.