Add annotation support #336
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for most annotations. For our use case, we actually really just need field-level annotations, but I took a look at the issues and saw others were interested in broader annotations in #278, so figured I'd include those as well.
Specifically:
__thrift_annotations__attr, with struct field annotations under the__thrift_field_annotations__attr__thrift_annotations__attr, with item annotations under__thrift_item_annotations____thrift_annotations__attr, with function annotations under__thrift_function_annotations____thrift_typedef_annotations__and__thrift_const_annotations__, respectivelyNote that this PR does not add support for annotations on the types, mostly because that would touch a lot more code: since types are represented by ints, we can't easily add metadata (like annotations).
So we parse the "foo=bar" annotation, but not the unicode.encoding annotation in
typedef string ( unicode.encoding = "UTF-16" ) non_latin_string (foo="bar").