add ligo_string in simple_utils

This commit is contained in:
Pierre-Emmanuel Wulfman 2020-04-27 11:30:59 +02:00
parent 2db55ae965
commit f6ff6b85c4
3 changed files with 23 additions and 1 deletions

View File

@ -14,4 +14,4 @@ module Tree = Tree
module Region = Region module Region = Region
module Pos = Pos module Pos = Pos
module Var = Var module Var = Var
module Ligo_string = X_string

View File

@ -0,0 +1,11 @@
type t =
Standard of string
| Verbatim of string
let pp ppf = function
Standard s -> Format.fprintf ppf "%S" s
| Verbatim v -> Format.fprintf ppf "{|%s|}" v
let extract = function
Standard s -> s
| Verbatim v -> v

View File

@ -0,0 +1,11 @@
(*
Ligo_string represent string as they are writen in a ligo program,
delimited either with double quotes (standard) or with `{|...|}` (Varbatim)
*)
type t =
Standard of string
| Verbatim of string
val pp : Format.formatter -> t -> unit
val extract : t -> string