Replies: 2 comments 3 replies
-
I'd suggest not relying on NodeKind, but rather, using the visitor pattern, which should ensure you exhaustively cover all the AST nodes. Either orOn that note, we don't currently provide a facility for registering custom/reflection functions that define and make use of scope, and that may be something we should look into. |
Beta Was this translation helpful? Give feedback.
1 reply
-
@cchannon - I'm not sure what you're asking. Impl here: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to explore how I can add Lookup Function support to my custom app running the C# interpreter. In order to do this, there is really no getting around the need to dynamically declare variables (or, more specifically, a List of Records). In general, I figure the only way to do this without losing my mind is something similar to:
-->2a. If so, get tablename from engine.Eval(Root.Args.Children[0])
--> 2b. get QE by converting from Root.Args.Children[1] (doing this conversion will be rough, but not impossible)
--> 2c. Create List of Records from result
But that is, of course, an oversimplification because the different NodeTypes all have different properties and I wouldn't actually need to loop over every Arg if I knew for sure which args definitely could not contain a Lookup (Microsoft.PowerFx.Syntax.NodeKind.BoolLit looks like something I might be able to ignore, for example)
So, my question is this: is there a test case somewhere that illustrates all the different NodeKind values that I could use to make sure I'm not missing anything? I am sure I could write up something for most of them, but I'd rather not guess at it if there's already something out there.
Beta Was this translation helpful? Give feedback.
All reactions