diff options
| author | Emilio Jesus Gallego Arias | 2020-04-03 11:10:08 -0400 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2020-04-03 11:10:08 -0400 |
| commit | e16a279b2afe1824ccb8bf4bbc17f797ee5baf6c (patch) | |
| tree | b80b24b87cafe88ccb5aa8c7ad02a084e99becea /ide/ideutils.mli | |
| parent | 8a3255bc99691c7c0f9b386e63b7947169f902b7 (diff) | |
| parent | 470f5e063535f91ce0e95798d4aaadfefffb89e0 (diff) | |
Merge PR #11664: Encoding string list as a string with application to the parsing of coqtop arguments in coqide
Reviewed-by: ejgallego
Diffstat (limited to 'ide/ideutils.mli')
| -rw-r--r-- | ide/ideutils.mli | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ide/ideutils.mli b/ide/ideutils.mli index b080f5b8ed..9a17eb1402 100644 --- a/ide/ideutils.mli +++ b/ide/ideutils.mli @@ -102,3 +102,19 @@ val run_command : (* Checks if an error message is printable, it not replaces it with * a printable error *) val validate : Pp.t -> Pp.t + +(** [encode_string_list l] encodes a list of strings into a single + string using a "shell"-like encoding: it quotes strings + containing space by surrounding them with single quotes, and, + outside quoted strings, quotes both single quote and backslash + by prefixing them with backslash; the encoding tries to be + minimalistic. *) + +val encode_string_list : string list -> string + +(** [decode_string_list l] decodes the encoding of a string list as + a string; it fails with a Failure if a single quote is unmatched + or if a backslash in unquoted part is not followed by a single + quote or another backslash. *) + +val decode_string_list : string -> string list |
