caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Quotation issue with camlp4 printer
@ 2011-07-11 19:05 Petter Urkedal
  2011-07-12  9:17 ` xclerc
  0 siblings, 1 reply; 3+ messages in thread
From: Petter Urkedal @ 2011-07-11 19:05 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

The attached program prints out

    let x = """;;

when compiled with ocamlc and camlp4 version 3.12.0.  As you can see,
the string literal lacks an escape character.  I haven't tried version
3.12.1, but I didn't find anything about it in the release notes.  (To
reproduce:

    ocamlc.opt -c -I +camlp4 -pp camlp4orf -o quotation_bug.cmo quotation_bug.ml
    ocamlc.opt dynlink.cma -I +camlp4 camlp4lib.cma quotation_bug.cmo
-o quotation_bug.byte
    ./quotation_bug.byte
)

Petter

[-- Attachment #2: quotation_bug.ml --]
[-- Type: application/octet-stream, Size: 172 bytes --]

open Camlp4.PreCast
open Printf

let _loc = Loc.ghost

let () =
    let code = <:str_item< value x = "\"" >> in
    Printers.OCaml.print_implem code;
    print_string "\n"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-12 16:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 19:05 [Caml-list] Quotation issue with camlp4 printer Petter Urkedal
2011-07-12  9:17 ` xclerc
2011-07-12 16:14   ` Petter Urkedal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).