Correctly Fix #221

This commit revert 364eb15b0f1efd9a63a3c8bce164c721eb851e47, and fix #223.

The logic should be simply, correctly emitting errors and abort parsing.
I misunderstood it before and attempted to fix the wrong thing.
Merge pull request #224 from sunyc/master

Correctly Fix #221