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 not accepting some valid ocaml syntax #4216

Closed
vicuna opened this issue Feb 23, 2007 · 1 comment
Closed

camlp4 not accepting some valid ocaml syntax #4216

vicuna opened this issue Feb 23, 2007 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Feb 23, 2007

Original bug ID: 4216
Reporter: wneumann
Assigned to: ertai
Status: closed (set by @xavierleroy on 2009-03-31T11:03:19Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.10+dev
Fixed in version: 3.11.0
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues

Bug description

Two problems have recently come to light when trying to build Gerd Stolpmann's ocamlnet-2.2.4 with the CVS version of ocaml (3.10+24). Both issues involve camlp4 not accepting syntax that OCaml does (and that camlp4 version 3.09.3 accepted as well).

The first involves polymorphic variants: camlp4 no longer accepts definitions where a | character precedes the first variant, e.g. type t = [ | A | B ]. This can be seen from the command line:

[251] 12:48PM% camlp4o -printer o -str 'type t = [ | A | B ]'
File "/tmp/from_string7b9067.ml", line 1, characters 11-12:
Parse error: ">" or [row_field] expected after "[" (in [ctyp])

The second issue involves the declaration of external functions where one supplies separate C functions for native and bytecode compilation. Here, camlp4 doesn't appear to treat the second, native function as part of the declaration. This can be seen from the command line as well:

[248] 12:45PM% camlp4o -printer o -str 'external add6 : int -> int -> int -> int -> int -> int -> int = "add_six_byte" "add_six_nat"'
external add6 : int -> int -> int -> int -> int -> int -> int =
"add_six_byte"
let _ = "add_six_nat"

@vicuna
Copy link
Author

vicuna commented Feb 26, 2007

Comment author: ertai

Now fixed in CVS.

Thanks for reporting them.

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

No branches or pull requests

1 participant