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

report syntax error even with camlp4o #30

Open
agarwal opened this issue May 26, 2015 · 0 comments
Open

report syntax error even with camlp4o #30

agarwal opened this issue May 26, 2015 · 0 comments

Comments

@agarwal
Copy link
Member

agarwal commented May 26, 2015

We get different errors if #camlp4o is issued or not. IIUC, we are not catching the correct error when camlp4 is used.

Without camlp4o:

$ cat a.ml 
let x-plus-y = x + y;;

$ oloop a.ml
(* part 0 *)
# let x-plus-y = x + y;;
Error: Syntax error

With camlp4o:

$ cat a.ml 
#use "topfind";;
#camlp4o;;
let x-plus-y = x + y;;

$ oloop a.ml -silent-directives
(* part 0 *)
# #use "topfind";;

# #camlp4o;;

# let x-plus-y = x + y;;
Pervasives.Exit

Note the specific error also differs in OCaml's toplevel:

$ ocaml -noinit
        OCaml version 4.02.1

# let x-plus-y = x + y;;
Error: Syntax error

versus:

$ ocaml -noinit
        OCaml version 4.02.1

# #use "topfind";;
# #camlp4o;;
# let x-plus-y = x + y;;
Error: Parse error: [fun_binding] expected after [ipatt] (in [let_binding])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant