lua: refactor translator without LPeg