userdata in AST#31
Conversation
|
And I'm thinking, since mpc provide tag as string, we should look what this node is string or number, etc in walking tree every times. |
|
Hey, I agree it would be nice to let the user use non-string tags of some sort - at least for performance reasons as you mention. Even better would be a way to let the user give their own AST type to be used with the language parser and a bunch of callback functions to be called for the various operations such as adding children, tagging or deletion. Then we can just let I'll have a think about it some more.
|
|
Hi, sorry about delay. Any thought? |
|
Hi mattn, Thanks for the reminder. I'll try to make this update soon. I was put off because the code for parsing the ast is kind of a mess because it does lots of auto-merging of nodes depending on various conditions so I'll have to try and separate that out.
|
mpc doesn't have userdata in AST. so we should parse strings in each times while walking AST.
For example: https://github.com/mattn/orelang/blob/master/ore.c#L1236
since parsing in each times, it's very slow.