// process scope x. ... end scope blocks static void tok_scope(L tok) { if (!tok.contains("scope")) ret; int i; while ((i = rjfind(tok, "scope .")) >= 0) { int j = jfind(tok, i+6, "end scope"); if (j < 0) j = l(tok)-1; S scopeName = tok.get(i+2); for (int k = i+6; k < j-2; k += 2) if (eqGet(tok, k, "#") && isIdentifier(get(tok, k+2))) replaceTokens(tok, k, k+3, scopeName + "_" + tok.get(k+2)); //print("ifdef " + fname + " => " + has); clearTokens(tok, i, i+5); clearTokens(tok, j, j+3); reTok(tok, i, j+1); } }