Closed industrylol closed 4 years ago
I may be misunderstanding, when you refer to primary
, you mean the one in the rule's body, right?
When the @OnIncrement
action is called, it should be given the rule's body as argument with the node for the primary
in the primary '++'^ @OnIncrement
as first item. At this point the node should be the full AST.
If this is not the case this is a bug. I'll try to check this on my end.
Thanks, that prompted me to take another look and it turns out that I had been using a test case where my literal
rule wasn't catching the value right in one of its Semantic Actions and pushing it on the stack. So, that is why @OnIncrement
didn't have what I was expecting. Basically my own fault. Sorry about that!
I might be missing it in the documentation, but is there an idiomatic way to handle a semantic action on a postfix unary expression, like a keyword that will mark it during lexing to translate it to prefix?
For example below,
SemanticBody
in the action for@OnNot
has what I need to properly evaluate sincel_unary
is coming from the right hand side of the tree, but for@OnIncrement
,primary
has not yet been parsed.