Skip to content

Commit

Permalink
expose string escaping, added String.fromCharCode
Browse files Browse the repository at this point in the history
git-svn-id: http://ocamljs.googlecode.com/svn/trunk@94 27578800-e353-0410-a23a-a7c9f63c6ccd
  • Loading branch information
duckpilot committed Nov 18, 2008
1 parent 8066c68 commit 8e2f16d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/javascript/javascript.ml
Expand Up @@ -92,3 +92,8 @@ object
end

external js_string_of_string : string -> js_string = "%id"

module Js_string =
struct
external fromCharCode : int -> string = "@String.fromCharCode"
end
5 changes: 5 additions & 0 deletions src/javascript/javascript.mli
Expand Up @@ -90,3 +90,8 @@ object
end

external js_string_of_string : string -> js_string = "%id"

module Js_string :
sig
external fromCharCode : int -> string = "@String.fromCharCode"
end
4 changes: 2 additions & 2 deletions src/jslib/jslib_pp.ml
Expand Up @@ -13,8 +13,6 @@
open Format
open Jslib_ast

exception Unimplemented of string

(* XXX figure out how Format works *)

(*
Expand Down Expand Up @@ -391,3 +389,5 @@ and stmts ppf ss =
stmt ppf s;)
ss in
fprintf ppf "@[<v>%a@]" sl ss

let escaped = JSString.escaped
4 changes: 2 additions & 2 deletions src/jslib/jslib_pp.mli
@@ -1,5 +1,5 @@
exception Unimplemented of string

val exp : Format.formatter -> Jslib_ast.exp -> unit
val stmt : Format.formatter -> Jslib_ast.stmt -> unit
val stmts : Format.formatter -> Jslib_ast.stmt list -> unit

val escaped : string -> string

0 comments on commit 8e2f16d

Please sign in to comment.