[wg-camlp4] nested quotation lexing problem?

Bob Zhang bobzhang1988 at gmail.com
Sat May 11 15:06:43 BST 2013


Sorry, the outlook of second sample is a bit ambiguous, its a char `"'
between`''  and `''


On Sat, May 11, 2013 at 10:03 AM, Bob Zhang <bobzhang1988 at gmail.com> wrote:

>
> Hi all,
>    I have came across a nasty bug when lexing the nested quotations. I
> would like to have your opinions about this problem.
>
>    Sample 1:
>    {:q|  "|}" |}
>        Shall we accept this or reject it? the intuition is that this is a
> legal quotation, however, if we treat the contents inside the quotation in
> a verbatim way, this is illegal...
>   Sample 2:
>   {:q| '"' |}
>      If we treat " inside the quotation specially, the quotation above
> seems to be illegal (a non-terminated string).
>
>    If we treat both ' and " inside quotation in a special way, which is
> good in most cases, then we lose some use cases, for example, the contents
> inside the quotation have to follow the same string char lexical convention
> as OCaml.. what do you think?
> --
> Regards
> -- Bob
>



-- 
Regards
-- Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/wg-camlp4/attachments/20130511/89ee3d04/attachment.html>


More information about the wg-camlp4 mailing list