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

line number/file_name changing directive sometimes does not have the desired effect #7755

Closed
vicuna opened this issue Mar 18, 2018 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Mar 18, 2018

Original bug ID: 7755
Reporter: kosik
Status: acknowledged (set by @xavierleroy on 2018-05-21T17:00:20Z)
Resolution: open
Priority: low
Severity: minor
Version: 4.06.1
Category: lexing and parsing
Monitored by: @nojb @gasche

Bug description

See "Steps To Reproduce".

Steps to reproduce

After executing the following comments:

ocamlc -g -o main main.ml
OCAMLRUNPARAM=b ./main

I see:

Fatal error: exception Main.E
Raised at file "generated.ml", line 4002, characters 4-47
Called from file "generated.ml", line 13002, characters 0-6

I was expecting to see:

Raised at file "original.mly", line 8, characters 13-14

Additional information

When I delete the following line from the attached "mail.ml" file:

let _1 = () in

then "ocamlc" behaves in the expected way. I.e. I see:

Fatal error: exception Main.E
Raised at file "original.mly", line 8, characters 13-14
Called from file "generated.ml", line 13002, characters 0-6

File attachments

@vicuna
Copy link
Author

vicuna commented May 21, 2018

Comment author: @xavierleroy

I can reproduce the problem with 4.06 but not with the current trunk. There was some changes recently in the way # line directives are handled, but I'm surprised they make a difference here.

@xavierleroy
Copy link
Contributor

The location is correct in 4.07 and in 4.08. The problem seems to have been fixed by the lexer changes post 4.06.

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

2 participants