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

OCaml parses let (!*) but not camlp4o doesn't #5846

Closed
vicuna opened this issue Dec 5, 2012 · 2 comments
Closed

OCaml parses let (!*) but not camlp4o doesn't #5846

vicuna opened this issue Dec 5, 2012 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Dec 5, 2012

Original bug ID: 5846
Reporter: @protz
Status: closed (set by @damiendoligez on 2015-01-13T18:36:27Z)
Resolution: suspended
Priority: normal
Severity: minor
Target version: undecided
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues

Bug description

jonathan@ramona:/tmp $ cat > foo.ml
let (!*) = ();;
jonathan@ramona:/tmp $ ocamlc foo.ml
jonathan@ramona:/tmp $ ocamlc -pp camlp4o foo.ml
File "foo.ml", line 1, characters 4-5:
Parse error: ")" or "module" or [patt] expected after "(" (in [patt])
File "foo.ml", line 1:
Error: Preprocessor error
jonathan@ramona:/tmp $

@vicuna
Copy link
Author

vicuna commented Dec 5, 2012

Comment author: @bobzhang

Hi, try
let ( !* ) = ();;

camlp4 is a bit conservative when lexing here, I will upload a fix later

===================================
let ( !* ) = () ;;

LID "let" File "<string>", line 1, characters 0-3 BLANKS " " File "", line 1, characters 3-4
ESCAPED_IDENT "!*" File "<string>", line 1, characters 4-10 BLANKS " " File "", line 1, characters 10-11
SYMBOL "=" File "<string>", line 1, characters 11-12 BLANKS " " File "", line 1, characters 12-13
SYMBOL "(" File "<string>", line 1, characters 13-14 SYMBOL ")" File "", line 1, characters 14-15
SYMBOL ";" File "<string>", line 1, characters 15-16 EOI

let (!*) = ();;
LID "let" File "<string>", line 1, characters 0-3 BLANKS " " File "", line 1, characters 3-4
SYMBOL "(" File "<string>", line 1, characters 4-5 BLANKS " " File "", line 1, characters 5-6
SYMBOL "!*" File "<string>", line 1, characters 6-8 SYMBOL ")" File "", line 1, characters 8-9
BLANKS " " File "<string>", line 1, characters 9-10 SYMBOL "=" File "", line 1, characters 10-11
BLANKS " " File "<string>", line 1, characters 11-12 SYMBOL "(" File "", line 1, characters 12-13
SYMBOL ")" File "<string>", line 1, characters 13-14 SYMBOL ";" File "", line 1, characters 14-15
`EOI

@vicuna
Copy link
Author

vicuna commented Jan 13, 2015

Comment author: @damiendoligez

Transferred to camlp4/camlp4#78

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