Dropping branches before using a transformer #1223
-
So im trying to evaluate some c like synatax I have cases like this: since the cast and value are both c names they are ambiguous
when I do this I would like to drop the first branch of any exp_cast before I use a transformer that way I don't try and look up the value of a type. But I'm not sure how to do that. Or perhaps there is a better way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I think to answer my own question the solution was not do drop a branch before using a transformer. but to use another transformer to drop the branch for me. class DropCast(Transformer): This transformer can do the thing. |
Beta Was this translation helpful? Give feedback.
I think to answer my own question the solution was not do drop a branch before using a transformer. but to use another transformer to drop the branch for me.
class DropCast(Transformer):
def exp_cast(self,args) return args[1] # keep the thing you want
This transformer can do the thing.