Performance of the parser could be improved by leveraging JS maps that point to functions instead of the large switch statement.