DebugVisitor: catch and show invalid token indizes

Authored by kossebau on May 29 2017, 2:48 PM.

Description

DebugVisitor: catch and show invalid token indizes

Summary:
Current parsing logic can generate tokens with token range [0,-1]
(e.g. if some expected token at the start is not existing in the
input), so the debug logic needs to handle such invalid token indizes.

Reviewers: KDevelop, kfunk

Reviewed By: KDevelop, kfunk

Subscribers: kfunk, kdevelop-devel

Differential Revision: https://phabricator.kde.org/D6013