added TokenStream::nextIf()

The introduction of `nextIf()` simplified a lot of code.