Skip to content

Commit

Permalink
Add conditional simplification for markup_to_expr.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drup committed May 7, 2016
1 parent e352487 commit 413303e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ppx/ppx_tyxml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ let context_of_lang = function
(** Given the payload of a [%html ...] or [%svg ...] expression,
converts it to a TyXML expression representing the markup
contained therein. *)
let markup_to_expr lang loc expr =
let markup_to_expr ?(simplify=true) lang loc expr =
let context = context_of_lang lang in

let input_stream, adjust_location = ast_to_stream expr in
Expand Down Expand Up @@ -331,7 +331,7 @@ let markup_to_expr lang loc expr =
in

match l with
| [ Val x | Antiquot x ] -> x
| [ Val x | Antiquot x ] when simplify -> x
| l -> Ppx_common.list_wrap_value lang loc l

let markup_to_expr_with_implementation lang modname loc expr =
Expand Down
1 change: 1 addition & 0 deletions ppx/ppx_tyxml.mli
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*)

val markup_to_expr :
?simplify:bool ->
Ppx_common.lang ->
Location.t -> Parsetree.expression list -> Parsetree.expression
(** Given the payload of a [%html ...] or [%svg ...] expression,
Expand Down

0 comments on commit 413303e

Please sign in to comment.