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

Gracefully handle position conversion errors #96

Merged
merged 1 commit into from
Oct 4, 2018
Merged

Conversation

olafurpg
Copy link
Member

@olafurpg olafurpg commented Oct 4, 2018

Previously, mdoc failed with an exception when converting bogus
positions reported by the compiler. Now we fall back to Position.None
instead, which means the message is reported without a caret.

The best long-term solution is probably to reconsider the architecture
for how fail modifiers are compiled. The design in
https://github.com/olafurpg/mdoc/issues/95#issuecomment-426993507 is
both simpler than the current macro-based design and should also
produce consistent errors with the compiler.

Previously, mdoc failed with an exception when converting bogus
positions reported by the compiler. Now we fall back to `Position.None`
instead, which means the message is reported without a caret.

The best long-term solution is probably to reconsider the architecture
for how `fail` modifiers are compiled.  The design in
https://github.com/olafurpg/mdoc/issues/95#issuecomment-426993507 is
both simpler than the current  macro-based design and should also
produce consistent errors with the compiler.
@olafurpg olafurpg merged commit e68b32b into master Oct 4, 2018
@olafurpg olafurpg deleted the fail-fs2 branch October 4, 2018 13:08
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.

1 participant