literals: tidy up mechanism for matching literal lexemes

Signed-off-by: Peter Williams <pwil3058@bigpond.net.au>