hibernate/hibernate-hql-parser — pull request #21 by anistor (2014-02-26 16:09:23+00:00)
Title: HQLPARSER-39 Detection of unconsumed tokens must take non-buffered tokens into account 

* ensure the internal token buffer of CommonTokenStream is filled from the underlying TokenSource (lexer) before checking if any tokens are left unmatched
* detect EOF by comparing on token type rather than token text (this is just for efficiency, not actually necessary for fixing the main issue)
* add more trailing token test cases to gUnitHQLGrammar.testsuite

Jira: https://hibernate.atlassian.net/browse/HQLPARSER-39

See also https://hibernate.atlassian.net/browse/HQLPARSER-40