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

fix: support annotations in union #233

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/parser-cases/annotations.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ service foo_service {
void foo() ( foo = "bar" )
} (a.b="c")

union foo_union {
1: optional bool abc
2: optional i32 xyz
} (a.b="c")
2 changes: 1 addition & 1 deletion thriftpy2/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def p_seen_struct(p):


def p_union(p):
'''union : seen_union '{' field_seq '}' '''
'''union : seen_union '{' field_seq '}' type_annotations'''
val = _fill_in_struct(p[1], p[3])
_add_thrift_meta('unions', val)

Expand Down
Loading