tighten up the checks in the place where the framework receives
values from the lexer (for syntax coloring)