gazayas / masamune-ast

A covenience wrapper around Prism, a Ruby source code parser
MIT License
13 stars 1 forks source link

Refactor NodeHelper into inline extensions #61

Closed kaspth closed 1 year ago

kaspth commented 1 year ago

Since we know the hierarchy we can add all our predicates and overrides directly into each Node subclass.

This makes for simpler, faster methods that should speed up node matching a bit too.

Also renames token to slightly clearer token_value.

kaspth commented 1 year ago

cc @gazayas

gazayas commented 1 year ago

Also renames token to slightly clearer token_value.

I'm fine with sticking with token_value for now, I'm not seeing anything in Prism that suggests that we should use anything else specific, but if anything comes up I'll open another PR! Thanks for this refactor!