CS2121 lab exercise 2 part a1 - hint

Patterns that recognise special cases, such as particular keywords, must come before patterns that recognise more general cases, such as identifiers - if you aren't sure why, see what happens when you swap them.

Similarly, the rule that recognises unexpected characters:

 .                      {lexeme(unknown);     /*keep this*/}
must come last - again, if you aren't sure why, see what happens if you make it the first rule.