[wip] scanner: improve token conversion