bugfix: do not maintain global state in parser

because it fails when imported and re-used
add example that fails if global state used in parser