aboutsummaryrefslogtreecommitdiff
path: root/discocaml/ast.ml
blob: 22f37902d2dda1635f2a5c40d50b3faeec7c1e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
type expr = Foo [@@deriving show { with_path = false }]

let expr_of_parsetree : Parsetree.expression -> expr = function _ -> Foo

let parsetree_of_expr : expr -> Parsetree.expression =
  let expression (pexp_desc : Parsetree.expression_desc) : Parsetree.expression
      =
    {
      pexp_desc;
      pexp_loc = Location.none;
      pexp_loc_stack = [];
      pexp_attributes = [];
    }
  in
  function Foo -> expression (Pexp_constant (Pconst_char '!'))