Skip to content

Commit

Permalink
[fix] OpaPrint: braces required in case of `string for dom actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Mar 8, 2012
1 parent 2a0e8bb commit 5ec0f77
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions opalang/opaPrint.ml
Expand Up @@ -458,14 +458,18 @@ module Sugar = struct


let pp_dst original_name ppe e = let pp_dst original_name ppe e =
match clear_directives e with match clear_directives e with
| Apply((Ident(id),_),([_,e],_)),_ -> | Apply((Ident(id),_),([_,e],_)),_ -> (
let op = match original_name id with let op = match original_name id with
| "Dom_select_id" -> "#" | "Dom_select_id" -> "#"
| "Dom_select_class" -> "." | "Dom_select_class" -> "."
| _ -> raise Fallback | _ -> raise Fallback
in in
fun f () -> fun f () -> (
pp f "%s%a" op (String.pp_expr_or_string ~quote:false ppe) e match fst e with
| Directive(`string,l,_) -> pp f "%s{%a}" op (String.pp_expr ppe) l
| _ -> pp f "%s%a" op (String.pp_expr_or_string ~quote:false ppe) e
)
)
| _ -> raise Fallback | _ -> raise Fallback


let str s f () = pp f "%s" s let str s f () = pp f "%s" s
Expand Down

0 comments on commit 5ec0f77

Please sign in to comment.