Skip to content

Commit

Permalink
Move pexp_function_cases to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
patricoferris committed Oct 19, 2024
1 parent 575d335 commit 30ebdf9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/ast_builder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ end) : S = struct
let ptyp_poly vars ty = Default.ptyp_poly ~loc vars ty
let pexp_apply e el = Default.pexp_apply ~loc e el
let pexp_fun lbl e1 p e2 = Default.pexp_fun ~loc lbl e1 p e2
let pexp_function_cases cases = Default.pexp_function_cases ~loc cases
let eint t = Default.eint ~loc t
let echar t = Default.echar ~loc t
let estring t = Default.estring ~loc t
Expand Down
11 changes: 0 additions & 11 deletions src/ast_builder.mli
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@ module Default : sig
val ppat_construct :
loc:location -> longident loc -> pattern option -> pattern

val pexp_function :
loc:location ->
function_param list ->
type_constraint option ->
function_body ->
expression

val pexp_function_cases : loc:location -> Import.cases -> expression
(** [pexp_function_cases] builds an expression in the shape
[function C1 -> E1 | ...]. *)

val coalesce_arity : expression -> expression
(** [coalesce_arity e] will produce a maximum arity function from an
expression.
Expand Down
11 changes: 11 additions & 0 deletions src/ast_builder_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ module type Additional_helpers = sig
(arg_label -> expression option -> pattern -> expression -> expression)
with_loc

val pexp_function :
(function_param list ->
type_constraint option ->
function_body ->
expression)
with_loc

val pexp_function_cases : (Import.cases -> expression) with_loc
(** [pexp_function_cases] builds an expression in the shape
[function C1 -> E1 | ...]. *)

val pconstruct : constructor_declaration -> pattern option -> pattern
val econstruct : constructor_declaration -> expression option -> expression

Expand Down

0 comments on commit 30ebdf9

Please sign in to comment.