fix String_with_vars.sexp_of_t (#595)

This commit is contained in:
Jérémie Dimino 2018-03-07 15:01:46 +00:00 committed by GitHub
parent 7494834b50
commit b029d32dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -85,8 +85,7 @@ let sexp_of_item =
| Var (vs, s) -> List [sexp_of_var_syntax vs ;
Sexp.atom_or_quoted_string s]
let sexp_of_t t = Sexp.To_sexp.list sexp_of_item t.items
let sexp_of_ast t = Sexp.To_sexp.list sexp_of_item t.items
let fold t ~init ~f =
List.fold_left t.items ~init ~f:(fun acc item ->
@ -197,3 +196,5 @@ let to_string t =
| Text s -> s
| Var (syntax, v) -> string_of_var syntax v)
|> String.concat ~sep:""
let sexp_of_t t = Sexp.To_sexp.string (to_string t)

View File

@ -18,6 +18,10 @@ val loc : t -> Loc.t
val sexp_of_t : t -> Sexp.t
(** Same as [sexp_of_t] but the S-expression encodes the internal
structure of [t]. *)
val sexp_of_ast : t -> Sexp.t
val to_string : t -> string
(** [t] generated by the OCaml code. The first argument should be