Skip to content

Commit

Permalink
print pexp_array
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed May 28, 2024
1 parent a38a5bd commit e0a1815
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions analysis/src/DumpAst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ and printExprItem expr ~pos ~indentation =
^ (expr.pexp_loc |> printLocDenominator ~pos)
^
match expr.Parsetree.pexp_desc with
| Pexp_array exprs ->
"Pexp_array(\n"
^ addIndentation (indentation + 1)
^ (exprs
|> List.map (fun expr ->
expr |> printExprItem ~pos ~indentation:(indentation + 1))
|> String.concat ("\n" ^ addIndentation (indentation + 1)))
^ "\n" ^ addIndentation indentation ^ ")"
| Pexp_match (matchExpr, cases) ->
"Pexp_match("
^ printExprItem matchExpr ~pos ~indentation:0
Expand Down

0 comments on commit e0a1815

Please sign in to comment.