Can't figure out how to match the node pattern for enum options.
Code I want to match, enum that has prefix: true (or scoped: true for later versions):
enum bla: { active: 0, not_active: 1 }, _prefix:true
Will get node as:
ruby-parse -e 'enum bla: { active: 0, not_active: 1 }, _prefix:true'
(send nil :enum
(hash
(pair
(sym :bla)
(hash
(pair
(sym :active)
(int 0))
(pair
(sym :not_active)
(int 1))))
(pair
(sym :_prefix)
(true))))
My pattern:
'(send nil? :enum (hash (pair (sym {:_prefix :true}))))'
Tried out a bunch of versions without sym and nil/_.
What I'm doing wrong in this matching? Do I Need to skip nodes before the prefix node?