Skip to content

Change Annotation to { code, args, message, span } #40

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 1 commit into from
Apr 10, 2017

Conversation

stasm
Copy link
Contributor

@stasm stasm commented Mar 30, 2017

Annotations will now have unique codes: E0000 for errors, W0000 for warnings
and H0000 for hints. They also now have a span, similar to Entries. If an
annotation is only related to a single position in the file, the Span's start
and end field should be equal.

Annotations now have unique codes: E0000 for errors, W0000 for warnings
and H0000 for hints.  Args is an array of strings with additional arguments
used for building the message of the Annotation.

Annotations also now have a span, similar to Entries.  If an annotation is only
related to a single position in the file, the Span's start and end field should
be equal.
@stasm stasm changed the title Change Annotation to { code, message, span } Change Annotation to { code, args, message, span } Mar 31, 2017
@stasm
Copy link
Contributor Author

stasm commented Mar 31, 2017

I made a change to the PR and added another field to Annotation: args. It's an array of string-typed arguments used to build the full message of the annotation.

This is modeled after https://docs.python.org/3/library/exceptions.html#BaseException.args and can be used to verify that annotations include extra information about parsing errors. It also opens up a way to localize annotations in CAT tools.

@stasm stasm requested a review from zbraniecki March 31, 2017 17:12
@stasm stasm merged commit ca8b25a into projectfluent:master Apr 10, 2017
@stasm stasm deleted the annot-code branch April 10, 2017 13:27
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.

2 participants