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
refactor(options): generate available options values from lua #28659
base: master
Are you sure you want to change the base?
Conversation
local gen_values = options_file:find('options_values') and true or false | ||
|
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.
I don't like this pattern of using the same generator for 2 completely different purposes. Use a separate generator file for this, similar to what gen_options_enum.lua
does
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.
These are not "complete different purposes". And why is gen_options_enum.lua
in a separate file?
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.
These are not "complete different purposes".
The script does two very different things depending on which file it's being called on, that seems different to me. A script's behavior depending on the filename is certainly not ideal.
And why is
gen_options_enum.lua
in a separate file?
Precisely because it does a completely different thing. gen_options
generates the options[]
array, gen_options_enum
generates the option index enum (using information from the options[]
array, so order matters here) and the hash table for findoption()
8920fd4
to
340517c
Compare
Problem: currently the available values of options is split from options meta lua file. Solution: generate it from lua file.
Problem: currently the available values of options is split from options meta lua file.
Solution: generate it from lua file.