A plugin where designers can write simple expressions.
Describe the problem or limitation you are having in your project
Expressions can do most things scripts can, including calling functions, getting members and evaluating mathematical expressions. One thing they can't do is set member variables.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allow setting members in expressions.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
var expression := Expression.new()
expression.parse("a = 2")
expression.execute([], base_object)
# Prints "2"
print(base_object.a)
If this enhancement will not be used often, can it be worked around with a few lines of script?
You can use set("a", 2), but because the plugin is made for designers, that's not really an option.
Is there a reason why this should be core and not an add-on in the asset library?
Expression is core.
Another solution would be to completely replace the 2000 lines long Expression parser with the GDScript parser, but that would require much larger changes.
Describe the project you are working on
A plugin where designers can write simple expressions.
Describe the problem or limitation you are having in your project
Expressions
can do most things scripts can, including calling functions, getting members and evaluating mathematical expressions. One thing they can't do is set member variables.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allow setting members in expressions.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If this enhancement will not be used often, can it be worked around with a few lines of script?
You can use
set("a", 2)
, but because the plugin is made for designers, that's not really an option.Is there a reason why this should be core and not an add-on in the asset library?
Expression
is core.Another solution would be to completely replace the 2000 lines long Expression parser with the GDScript parser, but that would require much larger changes.