pegjs plugin helper: Run a function once for each code snippet in a grammar AST.