Fixes #2981

To fix #2981, an example of going the way of checking for **EOF**, which probably should be done, to avoid problems such as #2984 (this PR includes that fix).

One thing to watch out for is that someone might be relying on generated tokens and this obviously adds the `EOF` token to the list, changing the compiler's output.

(parser compiled with Jison 0.4.4)