-
Notifications
You must be signed in to change notification settings - Fork 0
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
WIP - add senum to thrift-parser #1
base: master
Are you sure you want to change the base?
Conversation
Also, add the relative parser tests and get them to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request adds support for 'senum' (string enum) to the Thrift parser, implementing new types and updating existing components to handle this feature.
- In
src/main/organizer.ts
, senums are not included in the final ThriftDocument body, potentially causing them to be omitted from the organized output. - The senum name 'Tes' in
src/tests/parser/fixtures/senum.thrift
and related files may be a typo, likely intended to be 'Test'. - The parser doesn't correctly handle commented-out senum members in
src/tests/parser/fixtures/senum-commented.thrift
. - Additional test cases and documentation updates may be needed to ensure comprehensive coverage of the new senum feature.
12 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings
senum Tes { | ||
ONE, | ||
TWO | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding a trailing comma after 'TWO' for consistency with other enum-like structures
} | ||
} | ||
}, | ||
"members": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The commented-out member 'TWO' is not represented in the JSON structure. The parser should handle commented-out members.
A
senum
is like anenum
but does not have the int identifier - soit is just a string when serialized.
e.g.
See more details on the rationale here:
https://docs.google.com/document/d/1VuKLrMyYMhEOTCaovQQii2wd0bUhp53FcqAYUeoS-QE/edit