Skip to content

Allow custom warning printers / catchers.#171

Closed
klakplok wants to merge 1 commit intoocaml:trunkfrom
klakplok:trunk
Closed

Allow custom warning printers / catchers.#171
klakplok wants to merge 1 commit intoocaml:trunkfrom
klakplok:trunk

Conversation

@klakplok
Copy link

When writing alternative toplevels (such as tryocaml), one can catch errors to display them in a custom way, but doing so for warnings is not possible, except by parsing the output. This patch adds a hook for doing so.

I tried to make this patch minimal, but for the current error underlining to continue working with custom warning printers, I had to move some formatter patching code (that counts the '\n' present in Warning messages) from Warnings to Location.

I also added a hook for displaying errors, for consistency.

@damiendoligez
Copy link
Member

I like this patch, the new code is actually cleaner than the original.

@gasche
Copy link
Member

gasche commented Apr 26, 2015

Merged in trunk, thanks!

@gasche gasche closed this Apr 26, 2015
mshinwell pushed a commit to mshinwell/ocaml that referenced this pull request Jun 17, 2020
lthls added a commit to lthls/ocaml that referenced this pull request Sep 23, 2020
lthls added a commit to lthls/ocaml that referenced this pull request Sep 23, 2020
lthls added a commit to lthls/ocaml that referenced this pull request Sep 24, 2020
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