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
error report cites line-number which is not anywhere close to the actual error. (Mantis 7063) #102
Comments
I think it's because of the |
The problem comes from the fact that camlp4 accepts |
This is http://caml.inria.fr/mantis/view.php?id=7063 :
In some cases camlp4 reports very odd line-numbers when there is an error.
When I compile the attached file:
ocamlfind c -g -c -syntax camlp4o -package mikmatch_str main.ml
I get the following error:
File "main.ml", line 8, characters 7-8:
Parse error: [regexp] expected after "=" (in [str_item])
File "main.ml", line 1:
Error: Error while running external preprocessor
Command line: camlp4 '-I' '/home/me/.opam/4.02.3/lib/ocaml/camlp4' '-I' '/home/me/.opam/4.02.3/lib/ocaml' '-I' '/home/me/.opam/4.02.3/lib/ocaml' '-I' '/home/me/.opam/4.02.3/lib/mikmatch_str' '-parser' 'o' '-parser' 'op' '-printer' 'p' 'str.cma' 'unix.cma' 'pa_mikmatch_str.cma' 'main.ml' > /tmp/ocamlppca2754
There, camlp4 tells me that something is wrong on line 8, column 7
which is very far from the actual error (line 30, column 54).
In this case, it seems that the reported line number with the error
and the line with the actual error can be arbitrarily far.
This can be a source of frustration for programmers.
The attached file is very artificial, but I stumbled upon this with a real program I am working on.
The text was updated successfully, but these errors were encountered: