How can I get which variables I need to pass through the scope dynamically? #3302
Replies: 1 comment
-
Maybe the following topics help: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can I get which variables I need to pass through the scope dynamically?
Given an arbitrary expression written by a user, I want to be able to find out which "variables" this expression expects in the scope, and if possible, the type of those variables.
Some ideas I've thought of:
I have the user write their expression, and also write which variables their expression expects (this would be written outside the expression, in json for example)
I create and expose a function, something like getArg('argName', 'argType'), so instead of the expression simply trying to access a variable in an expression, I would initialize all the variables with something like arg1 = getArg('arg1', 'number').
I go through the ast looking for all the symbols that were used before they were assigned.
Beta Was this translation helpful? Give feedback.
All reactions