Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camlp4 strings newlines from strings #3074

Closed
vicuna opened this issue Aug 18, 2004 · 3 comments
Closed

camlp4 strings newlines from strings #3074

vicuna opened this issue Aug 18, 2004 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 18, 2004

Original bug ID: 3074
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Richard Jones
Version: 3.08
OS: Linux
Submission from: annexia.force9.co.uk (212.56.101.183)

Bug, with test case is described here:

http://caml.inria.fr/archives/200408/msg00300.html

It appears to be that camlp4 strips newline characters from strings. This
behaviour is different from basic ocaml, and means that files that parse
correctly with ocaml parse incorrectly when passed through camlp4.

This behaviour is also a regression over 3.07+02.

@vicuna
Copy link
Author

vicuna commented Aug 18, 2004

Comment author: administrator

I've fixed it in the CVS. See the attached patch, if necessary.

Thanks,

-- Michel Mauny

rich@annexia.org wrote/écrivait (Wed, Aug 18, 2004 at 10:36:52AM +0200):

Full_Name: Richard Jones
Version: 3.08
OS: Linux
Submission from: annexia.force9.co.uk (212.56.101.183)

Bug, with test case is described here:

http://caml.inria.fr/archives/200408/msg00300.html

It appears to be that camlp4 strips newline characters from strings. This
behaviour is different from basic ocaml, and means that files that parse
correctly with ocaml parse incorrectly when passed through camlp4.

This behaviour is also a regression over 3.07+02.


--- camlp4/lib/plexer.ml.orig 2004-08-18 13:25:59.000000000 +0200
+++ camlp4/lib/plexer.ml 2004-08-18 13:17:37.000000000 +0200
@@ -10,7 +10,7 @@
(* *)
(***********************************************************************)

-(* $Id: plexer.ml,v 1.20.2.1 2004/06/30 13:05:31 mauny Exp $ )
+(
$Id: plexer.ml,v 1.20.2.2 2004/08/18 11:17:37 mauny Exp $ *)

open Stdpp;
open Token;
@@ -317,7 +317,7 @@
parser
[ [: '"' :] -> len | [: '\'; `c; s :] ep -> string bp (store (store len '\') c) s

  • | [: `'\010'; s :] ep -> do { bolpos.val := ep; incr lnum; string bp len s }
  • | [: '\010'; s :] ep -> do { bolpos.val := ep; incr lnum; string bp (store len '\010') s } | [: '\013'; s :] ep ->
    let (len, ep) =
    match Stream.peek s with


@vicuna
Copy link
Author

vicuna commented Aug 19, 2004

Comment author: administrator

fixed MM 2004-08-18

@vicuna vicuna closed this as completed Aug 19, 2004
@vicuna
Copy link
Author

vicuna commented Sep 3, 2004

Comment author: administrator

The commit to pa_o.ml that was supposed to fix #3074 have replaced the
grammar for the `` patt LEVEL "simple" '' with a new non-terminal
patt_simple. The pa_macro.ml package adds to patt at LEVEL "simple",
however in the new pa_o grammar, those additional productions end up
being shadowed by the patt_simple one.

End result - macros are never expanded in patterns. :-(

See
http://camlcvs.inria.fr/cgi-bin/cvsweb.cgi/ocaml/camlp4/etc/pa_o.ml.diff?r1=1.58&r2=1.58.2.1

--
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin@cs.caltech.edu (office), aleksey@nogin.org (personal)
Office: Jorgensen 70, tel: (626) 395-2907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant