fix grammar file parser bug
add more tests for the regex parser