tokenizer rewrite (immediate mode)