[LeGo] add support for local variables #118
Open
+230
−49
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.
This PR introduces api to work with local variables in form of
set_local_variables_enableis intended to be called fromlocal()call override in LeGo based mod.Since engine has to wait for
local()call, it mean on very first invocation we wont know for sure, if particular function has intent to use local-variables.During runtime, if function annotated with
has_local_variables_enabled, is called:local()used.C++20 update
Since work with local variables is on critical path (frame-function in lego, timers and anim8-animations), performance is important. For that sake have had to use
std::spanforfind_locals_for_function, as well as forfind_parameters_for_function.I hope C++20 is fine (and minor api break) - it's 5 years old already and should be widely supported.