Difficulty with Stringer patch example - <nil> node type #368
-
I'm trying to do something very similar to the Stringer tree patch example at https://expr.medv.io/docs/Visitor-and-Patch, however discovered the exmple is broken and I cannot fix. After changing ast.MemberNode.Field to .Name, I can compile the example (see https://go.dev/play/p/wkZtzPYBKF-). however it crashes with panic: undefined node type () goroutine 1 [running]: I imagine the ast.MemberNode is missing information, but I don't understand the node/tree model well enough to fix. Can someone identify what is missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Indeed, the ast.MemberNode is missing a Property naming the method to call, so this:
Becomes this:
|
Beta Was this translation helpful? Give feedback.
Indeed, the ast.MemberNode is missing a Property naming the method to call, so this:
Becomes this: