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 (Mantis 4598) #66

Open
damiendoligez opened this issue Jan 9, 2015 · 0 comments
Open

Comments

@damiendoligez
Copy link

Transferred from http://caml.inria.fr/mantis/view.php?id=4598

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)
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