Skip to content

Commit

Permalink
112.35.00
Browse files Browse the repository at this point in the history
- Inline some calls that js_of_ocaml was unable to recognise as
  tail-recursive (cf. issue #14)
  • Loading branch information
bmillwood committed Jun 17, 2015
1 parent 0199e0c commit 896d450
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion _oasis
Expand Up @@ -2,7 +2,7 @@ OASISFormat: 0.4
OCamlVersion: >= 4.00.0
FindlibVersion: >= 1.3.2
Name: sexplib
Version: 112.24.00
Version: 112.35.00
Synopsis: sexplib - automated S-expression conversion
Authors: Jane Street Group, LLC <opensource@janestreet.com>
Copyrights: (C) 2005-2013 Jane Street Group LLC <opensource@janestreet.com>
Expand Down
2 changes: 1 addition & 1 deletion lib/conv.ml
Expand Up @@ -28,7 +28,7 @@ external format_float : string -> float -> string = "caml_format_float"
which was converted from a decimal (string) with <= 15 significant digits. So it's
worth trying first to avoid things like "3.1400000000000001".
See comment above [to_string_round_trippable] in [base/core/kernel/lib/float.ml] for
See comment above [to_string_round_trippable] in {!Core_kernel.Float} for
detailed explanation and examples. *)
let default_string_of_float =
ref (fun x ->
Expand Down
14 changes: 12 additions & 2 deletions lib/pre_sexp.ml
Expand Up @@ -744,7 +744,12 @@ let mk_cont_parser cont_parse = (); fun _state str ~max_pos ~pos ->
| '"' -> \
bump_found_atom \
bump_text_pos state str ~max_pos ~pos reg_parse_quoted \
| c -> add_bump_pos state str ~max_pos ~pos c parse_atom \
| c -> \
(* This is [add_bump_pos state str ~max_pos ~pos c parse_atom] inlined by \
hand, see https://github.com/janestreet/sexplib/pull/14 for details: *) \
Buffer.add_char state.pbuf c; \
bump_text_pos state; \
parse_atom state str ~max_pos ~pos:(pos + 1) \
\
and maybe_parse_bad_atom_pipe state str ~max_pos ~pos = \
if pos > max_pos then \
Expand Down Expand Up @@ -789,7 +794,12 @@ let mk_cont_parser cont_parse = (); fun _state str ~max_pos ~pos ->
bump_pos_cont state str ~max_pos ~pos PARSE) \
| '\\' -> bump_pos_cont state str ~max_pos ~pos parse_escaped \
| '\010' as c -> add_bump_line state str ~max_pos ~pos c parse_quoted \
| c -> add_bump_pos state str ~max_pos ~pos c parse_quoted \
| c -> \
(* This is [add_bump_pos state str ~max_pos ~pos c parse_quoted] inlined by \
hand, see https://github.com/janestreet/sexplib/pull/14 for details: *) \
Buffer.add_char state.pbuf c; \
bump_text_pos state; \
parse_quoted state str ~max_pos ~pos:(pos + 1) \
\
and parse_escaped state str ~max_pos ~pos = \
if pos > max_pos then mk_cont "parse_escaped" parse_escaped state \
Expand Down
6 changes: 2 additions & 4 deletions lib_test/test_macros.ml
Expand Up @@ -391,11 +391,9 @@ module Make (Load : Load) = struct
(Failure \"Error evaluating macros: Empty let bodies not allowed\"))
(:let f ()))"]

exception Conv_error

let rec conv_error = function
| Sexp.List [ Sexp.Atom "trigger"; Sexp.Atom "error" ] as t ->
raise (Pre_sexp.Of_sexp_error (Conv_error, t))
raise (Pre_sexp.Of_sexp_error (Exit, t))
| Sexp.Atom _ -> ()
| Sexp.List ts -> List.iter conv_error ts

Expand All @@ -409,7 +407,7 @@ module Make (Load : Load) = struct
(foo bar (trigger (:use err)))" ]
~expect:["((Sexplib.Sexp.Annotated.Conv_exn
DIR/include.sexp:2:18
(\"Test_macros.Make(Load).Conv_error\"))
\"Exit\")
(trigger (:use err)) (expanded (trigger error)))"]

TEST_UNIT "multiple conversion errors" =
Expand Down

0 comments on commit 896d450

Please sign in to comment.