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

error report cites line-number which is not anywhere close to the actual error. #7063

Closed
vicuna opened this issue Nov 27, 2015 · 1 comment
Closed

Comments

@vicuna
Copy link

vicuna commented Nov 27, 2015

Original bug ID: 7063
Reporter: kosik
Status: closed (set by @diml on 2016-12-07T17:25:06Z)
Resolution: suspended
Priority: low
Severity: minor
Version: 4.02.3
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues

Bug description

In some cases camlp4 reports very odd line-numbers when there is an error.

Steps to reproduce

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.

File attachments

@vicuna
Copy link
Author

vicuna commented Feb 8, 2016

Comment author: @damiendoligez

Issue moved to: camlp4/camlp4#102

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