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

WIP - add senum to thrift-parser #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP - add senum to thrift-parser #1

wants to merge 2 commits into from

Conversation

lizard-boy
Copy link

A senum is like an enum but does not have the int identifier - so
it is just a string when serialized.

e.g.

senum Foo {
  VAL0,
  VAL1
}

See more details on the rationale here:
https://docs.google.com/document/d/1VuKLrMyYMhEOTCaovQQii2wd0bUhp53FcqAYUeoS-QE/edit

ugodiggi added 2 commits May 16, 2024 16:38
Also, add the relative parser tests and get them to pass.
Copy link

@greptile-apps greptile-apps bot left a 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

Comment on lines +1 to +4
senum Tes {
ONE,
TWO
}
Copy link

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": [
Copy link

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.

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