Skip to content

fix line number off-by-one-error #736

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

Merged
merged 2 commits into from
Sep 24, 2021
Merged

Conversation

asavahista
Copy link
Contributor

@asavahista asavahista commented Sep 24, 2021

warning: not extensively tested. if others could also test that'd be great.

please let me know if i need to add regression tests (or anything else)

it's a very small and simple change so just committing to master and closing this also works

@asavahista asavahista changed the title fix line number off-by-one-error (#730) fix line number off-by-one-error Sep 24, 2021
@asavahista
Copy link
Contributor Author

fixed the one test that was affected; the failing ci runs are the usual debian 4.02 to 4.05 - i'm assuming with type foo := bar in that one failing test was introduced in 4.06? if this is something that can be selectively disabled then someone might want to do that

Copy link
Collaborator

@Julow Julow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Adding a test would be nice. The place to do that would be test/integration/compile.t/, you'd need to add an .mld file with an error (eg. not beginning with a heading) and a odoc compile command in run.t.

@@ -1,9 +1,9 @@
# References to pages and items in pages

$ compile p.mld good_references.mli bad_references.mli
File "p.mld", line 6, characters 5-11:
File "p.mld", line 7, characters 5-11:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is wrong, these references should be changed to: (the errors will disappear)

{!Good_references} {!Good_references.t}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test and the other tests failing in CI will be fixed in #738

@asavahista
Copy link
Contributor Author

seems like not starting with a heading makes it stop completely (and not show any line numbers) - i'll just use some other error instead then

@asavahista
Copy link
Contributor Author

(hopefully) removed the fix for the unrelated test which is now in #738

@jonludlam
Copy link
Member

Slightly surprisingly, the examples for odoc-parser got this right. Surprising because the code was extracted from here :-)

@jonludlam jonludlam merged commit eb2cceb into ocaml:master Sep 24, 2021
@asavahista asavahista deleted the fix-line-number branch September 24, 2021 23:04
jonludlam added a commit to jonludlam/opam-repository that referenced this pull request Oct 5, 2021
CHANGES:

Breaking changes
- Remove odoc-parser into a separate repository (@jonludlam, ocaml/odoc#700)

Additions
- OCaml 4.13 support (@Octachron, ocaml/odoc#687, ocaml/odoc#689)
- Better errors/warnings (@Julow, ocaml/odoc#692, ocaml/odoc#717, ocaml/odoc#720, ocaml/odoc#732)
- ModuleType 'Alias' support (@jonludlam, ocaml/odoc#703)
- Improved test suite (@lubega-simon, ocaml/odoc#697)
- Improved documentation (@lubega-simon, @jonludlam, ocaml/odoc#702, ocaml/odoc#733)
- Strengthen module types (@jonludlam, ocaml/odoc#731)

Bugs fixed
- `uwt` now can be documented (@jonludlam, ocaml/odoc#708)
- Fix resolution involving deeply nested substitutions (@jonludlam, ocaml/odoc#727)
- Fix off-by-one error in error reporting (@asavahista, ocaml/odoc#736)
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

Successfully merging this pull request may close these issues.

3 participants