The current implementation of Parser debug(Parser)
doesn't work well with self-modifying parsers. Its implementation uses Parser transformParser(Parser, Function)
that creates a transformed copy of the complete grammar graph. Thus, you action function doesn't have any effect on the running code as it modifies the unused old version of the grammar.
I can think of a way to fix the problem (debug could modify the parser in-place), but that seems to have other disadvantages. Care to file and issue on GitHub to discuss this further?