Skip to content

WIP - add senum to thrift-parser - #1

Open
lizard-boy wants to merge 2 commits into
masterfrom
ugo/senum
Open

WIP - add senum to thrift-parser#1
lizard-boy wants to merge 2 commits into
masterfrom
ugo/senum

Conversation

@lizard-boy

Copy link
Copy Markdown

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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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