Closed lurch closed 4 years ago
Thanks, this was a useful addition!
I switched the design over to a .walk() method on the item, however; this allowed individual classes to override the method as they needed, such as OneOrMore which needs to walk over both its item and its repeat.
Thanks for the improvements, thanks for doing the JS port, and thanks for merging! :tada: (I'd missed the fact that OneOrMore's repeat was a node in its own right and not just a boolean flag)
Brief explanation: I've got a
dict()
of fairly complicated inter-related syntax diagrams, and they're now getting so complex I wanted to add some code to "sanity check" them. To do that, I need to iterate through all the nodes in each of the diagrams, and the newwalk_railroad
function allows me to do just that :smiley:E.g. my current
callback_fn
looks something like:and then I can do: