The problem lies in this template:
template literal(lit: string, kind: untyped): untyped {.dirty.} =
if input == lit: result = Token(kind: kind)
Run
For both occurences of kind the parameter kind is inserted, which obviously
isn't right.
This should fix it.
template literal(lit: string, litKind: untyped): untyped {.dirty.} =
if input == lit: result = Token(kind: litKind)
Run
