fix String_with_vars.sexp_of_t (#595)
This commit is contained in:
parent
7494834b50
commit
b029d32dfb
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue