(#7659)(#20122) Fix comment stack when parsing hashes

This merges the two fixes from @yath and @ffrank. It uses the solution that calls commentpop from the grammar since this is more efficient than looking at tokens. It adds the test cases provided by @ffrank, but drops the pending tests for future syntax (because the "future parser" egrammar does not support documentation string processing).