Simplify two WHEN to one AND
Add doc string and comments
Add scanner-error condition
Add SCAN, FETCH-MORE-TOKENS and FETCH-NEXT-TOKEN