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 -parser r -parser rp" accept original syntax, not equivalent to camlp4r #5071

Closed
vicuna opened this Issue Jun 14, 2010 · 0 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

commented Jun 14, 2010

Original bug ID: 5071
Reporter: @edwintorok
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.2
Fixed in version: 3.12.1+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Related to: #5129 #5134
Monitored by: @ygrek

Bug description

The Camlp4 wiki (http://brion.inria.fr/gallium/index.php/Using_Camlp4) says that
camlp4r is equivalent to "camlp4 -parser r -parser rp -printer a".

However "camlp4 -parser r -parser rp -printer a" seems to accept original syntax, not the revised one!
It doesn't give error on original syntax only, while camlp4r gives error on original syntax.

Testcase:

  1. cat >test.ml <<EOF
    let globalvalue = 4;;
    EOF
  2. camlp4r test.ml
    File "test.ml", line 1, characters 18-19:
    Parse error: "in" expected after [binding] (in [expr])
  3. camlp4 -parser r -parser rp -printer a test.ml
    let globalvalue = 4
  4. cat >test2.ml <<EOF
    value globalvalue = 4;
  5. camlp4r test2.ml
    let globalvalue = 4
  6. camlp4 -parser r -parser rp -printer a test2.ml
    (value globalvalue) = 4

Additional information

Looks like '-parser rp' loads the original syntax too:
$ camlp4 -parser r -parser rp -loaded-modules
Camlp4OCamlParser
Camlp4OCamlRevisedParser
Camlp4OCamlRevisedParserParser

$ camlp4 -parser rp -loaded-modules
Camlp4OCamlParser
Camlp4OCamlRevisedParser
Camlp4OCamlRevisedParserParser
camlp4r doesn't load it:
$ camlp4r -loaded-modules
Camlp4.Printers.OCaml
Camlp4OCamlRevisedParser
Camlp4OCamlRevisedParserParser

I think '-parser rp' is meant to load RevisedParserParser, but for some reason it loads the original syntax too (Camlp4OCamlParser), which makes the input language original syntax (not revised).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.