fix pattern and sequence bugs in parser
fix span parsing