Closed aantron closed 8 years ago
Ok in principle, but the name is not very explicit. What about quotation_delimiter, as used in Ast_helper.Const.string?
I think we should rather add a get_full_str
that would return both the string and the delimiter. You usually want both at the same time and the multiple option wrapping are a bit annoying.
Will change it to whatever we agree on. I'm fine with changing the name and combining with retrieving the string, but what do you think @alainfrisch?
My proposal:
val get_str_with_quotation_delimiter: expression -> (expression * string option) option
The name is long, but more explicit than get_full_str
; and we don't want to encourage too much ppx authors to depend on the quotation delimiter (which, in its original design at least, is supposed to be purely syntactic).
Works for me.
Updated, assuming you meant (string * string option) option
for the result type.
Would be quite helpful for https://github.com/ocsigen/tyxml/pull/89. In particular, see: https://github.com/ocsigen/tyxml/blob/ppx/ppx/ppx_tyxml.ml#L177