// process #abc local identifier declaration // => scope + "abc" svoid tok_hashLocalIdentifiers(L tok, S scope) { scope = unnull(scope); new HashSet names; // first pass (find # declarations) for (int k = start; k < j-2; k += 2) { S t = get(tok, k+2); if (eqGet(tok, k, "#") && isIdentifier(t)) { names.add(t); replaceTokens(tok, k, k+3, scope + t); } } // early exit if nothing to do if (empty(names)) ret; // second pass (references to scoped variables) for (int k = 0; k < l(tok); k += 2) { S t = get(tok, k); if (isIdentifier(t) && names.contains(t)) tok.set(k, scopeName + "_" + t); } }