creates the MdqRefSelector and its variants (one for each selector type)
creates the fn try_select_node, which is the
match ... (selector, node) -> selector.try_select(node) dispatch
creates the fn parse_selector, which dispatches to the various
read(ParsingIterator) functions
This actually results in more code (whoops!), but it means it's closer to foolproof to register a selector. You just add it to the selectors! list, and it handles parsing and dispatch for you.
I'm going to go ahead and say this resolves #62. It's far from perfect, but it's also plenty good enough for now. Maybe even over-engineered.
Create a somewhat ugly macro that:
MdqRefSelector
and its variants (one for each selector type)fn try_select_node
, which is thematch ... (selector, node) -> selector.try_select(node)
dispatchfn parse_selector
, which dispatches to the variousread(ParsingIterator)
functionsThis actually results in more code (whoops!), but it means it's closer to foolproof to register a selector. You just add it to the
selectors!
list, and it handles parsing and dispatch for you.I'm going to go ahead and say this resolves #62. It's far from perfect, but it's also plenty good enough for now. Maybe even over-engineered.