BUG: correctly tokenize local variable references