drop unused variables

Remove unused variables that left after the recent work related to moving grammar checks outside the parser. Also this PR adds regression test for #1216 - this bug no longer relevant because of recent changes but having regression test is still good.