It seems like there is a bug in the function "semantic-token-type" in
the file semantic-util.el.
The bug appears when one is trying to call
semantic-find-nonterminals-by-type which in turn calls
semantic-find-nonterminals-by-function, which calls semantic-token-type
and things get messed up.
In particular, defunning semantic-token-type to
(nth 1 token)
fixes the problem.
Let me know if I am wrong, or if the bug should be fixed in some other