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

Loc.to_string: bad support for multiple lines #4598

Closed
vicuna opened this issue Aug 14, 2008 · 2 comments
Closed

Loc.to_string: bad support for multiple lines #4598

vicuna opened this issue Aug 14, 2008 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Aug 14, 2008

Original bug ID: 4598
Reporter: @Chris00
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2015-01-09T18:16:43Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 3.10.3+dev
Target version: undecided
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Related to: #4659 #6087

Bug description

When the location extends several lines, the format used by Loc.to_string is not compatible with the way Emacs parses locations, it should be of the form

File "xxx", line 12-13, characters 34-23:

The following code maybe shows better what I mean

let (fname, line0, bol0, off0, line1, bol1, off1, _) = Loc.to_tuple loc in
let line =
if line0 = line1 then sprintf "%i" line0
else sprintf "%i-%i" line0 line1 in
sprintf "File "%s", line %s, characters %i-%i"
fname line (off0 - bol0) (off1 - bol1)

@vicuna
Copy link
Author

vicuna commented Sep 4, 2008

Comment author: @damiendoligez

That's because the Emacs guys changed their parsing code without warning us. We'll make it compatible at some point, but we will also need to change our emacs-lisp code, so it won't be that easy.

@vicuna
Copy link
Author

vicuna commented Jan 9, 2015

Comment author: @damiendoligez

Transferred to camlp4/camlp4#66

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