Skip to content

Commit

Permalink
Insert semicolons after enum definitions and function constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
deltaluca committed Oct 10, 2013
1 parent 9f8d1c5 commit 05aeb9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions genjs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ let generate_enum ctx e =
print ctx "{";
if has_feature ctx "js.Boot.isEnum" then print ctx " __ename__ : %s," (if has_feature ctx "Type.getEnumName" then "[" ^ String.concat "," ename ^ "]" else "true");
print ctx " __constructs__ : [%s] }" (String.concat "," (List.map (fun s -> Printf.sprintf "\"%s\"" s) e.e_names));
ctx.separator <- true;
newline ctx;
List.iter (fun n ->
let f = PMap.find n e.e_constrs in
Expand All @@ -1030,6 +1031,7 @@ let generate_enum ctx e =
| TFun (args,_) ->
let sargs = String.concat "," (List.map (fun (n,_,_) -> ident n) args) in
print ctx "function(%s) { var $x = [\"%s\",%d,%s]; $x.__enum__ = %s; $x.toString = $estr; return $x; }" sargs f.ef_name f.ef_index sargs p;
ctx.separator <- true;
| _ ->
print ctx "[\"%s\",%d]" f.ef_name f.ef_index;
newline ctx;
Expand Down

0 comments on commit 05aeb9c

Please sign in to comment.