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

coqdoc does not report the filename on errors #14283

Closed
charguer opened this issue May 8, 2021 · 1 comment · Fixed by #14285
Closed

coqdoc does not report the filename on errors #14283

charguer opened this issue May 8, 2021 · 1 comment · Fixed by #14285
Labels
part: coqdoc The coqdoc binary for building documentation.
Milestone

Comments

@charguer
Copy link
Contributor

charguer commented May 8, 2021

Description of the problem

When coqdoc is executed on multiple files, it does not report the filename from which the error comes from.
E.g.:

Line 1047, character 162, warning: unterminated "]"

I suspect the lines:

  let coq_file f m =
    reset ();
    let c = open_in f in
    let lb = from_channel c in
    let lb = { lb with lex_start_p = { lb.lex_start_p with pos_fname = f } } in

are insufficient because they don't update the pos_fname of lex_curr_p.

In OCaml 4.11, the following function was added:

let set_filename lexbuf fname =
  lexbuf.lex_curr_p <- {lexbuf.lex_curr_p with pos_fname = fname}

It probably suggests that we should set pos_fname for lex_curr_p, not (just) for lex_start_p.

Coq Version

All versions.

@ejgallego ejgallego added the part: coqdoc The coqdoc binary for building documentation. label May 8, 2021
herbelin added a commit to herbelin/github-coq that referenced this issue May 8, 2021
…ror occurs.

Thanks to Arthur Charguéraud for diagnosis and suggested fix.
herbelin added a commit to herbelin/github-coq that referenced this issue May 8, 2021
…ror occurs.

Thanks to Arthur Charguéraud for diagnosis and suggested fix.
@herbelin
Copy link
Member

herbelin commented May 8, 2021

Hi @charguer, thanks for the diagnosis. Documentation in OCaml's lexing.mli indeed says "Position tracking mode works as follows. At each token, the lexing engine will copy [lex_curr_p] to [lex_start_p]", so setting the latter is short-lived.

Implemented at #14285.

herbelin added a commit to herbelin/github-coq that referenced this issue May 9, 2021
…ror occurs.

Thanks to Arthur Charguéraud for diagnosis and suggested fix.
coqbot-app bot added a commit that referenced this issue May 10, 2021
…le where an error occurs

Reviewed-by: SkySkimmer
Reviewed-by: Lysxia
@coqbot-app coqbot-app bot added this to the 8.13.3 milestone May 10, 2021
@Zimmi48 Zimmi48 modified the milestones: 8.13.3, 8.14+rc1 Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: coqdoc The coqdoc binary for building documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants