-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add non scalar default support to BFBS files #8671
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
base: master
Are you sure you want to change the base?
Add non scalar default support to BFBS files #8671
Conversation
@dbaileychess and @aardappel interested to hear your collective take on this one! I realized this was missing while working on the wireshark generator. |
This PR has formatting and other changes that appear not directly related that make it hard to review. Why is the new bool in |
This is getting at the inelegance of the design -- much of the code relies on the constant string being default constructed as I tried to just default construct constant and set it to 0 if a scalar type, but then I couldn't tell the difference between "user set default to |
in reading up on the non scalar defaults more (#6053), it does seem that the bfbs would need to differentiate between being provided a default (
1 or 3 would work for me, and I can work to remove the auto formatting to make the pr easier to review (vscode format go brrrrrr) |
148d925
to
d92b677
Compare
there were only two lines of formatting changes -- the other change is flatc now generates scoped enums instead of unscoped. |
@dbaileychess your review here would be helpful |
ca5d722
to
22fa6e2
Compare
This PR adds in an extra field to the reflection.fbs that holds string representations of non scalar defaults -- vectors and strings, specifically.
This isn't the 'best' way to accomplish this, but I think its the most pragmatic given how prolific the
Value
struct is in the code base.Accepting suggestions for better names!