WIP - add senum to thrift-parser - #1
Open
lizard-boy wants to merge 2 commits into
Open
Conversation
Also, add the relative parser tests and get them to pass.
There was a problem hiding this comment.
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.thriftand 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
Comment on lines
+1
to
+4
| senum Tes { | ||
| ONE, | ||
| TWO | ||
| } |
There was a problem hiding this comment.
style: Consider adding a trailing comma after 'TWO' for consistency with other enum-like structures
| } | ||
| } | ||
| }, | ||
| "members": [ |
There was a problem hiding this comment.
logic: The commented-out member 'TWO' is not represented in the JSON structure. The parser should handle commented-out members.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A
senumis like anenumbut 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