[wg-camlp4] nested quotation lexing problem?

Bob Zhang bobzhang1988 at gmail.com
Sat May 11 15:03:10 BST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/wg-camlp4/attachments/20130511/01656fcd/attachment.html>


More information about the wg-camlp4 mailing list