Warning: session_start(): open(/var/lib/php/sessions/sess_36173k3gtj899nuu695j7qkt93, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
scope tok_hashLocalIdentifiers
// process #abc local identifier declaration
// => scope + "abc"
static LS tok_hashLocalIdentifiers(LS tok, S scope) {
ret Obj(tok, scope)!;
}
srecord #Obj(LS tok, S scope) {
bool verbose;
selfType verbose(bool verbose) { this.verbose = verbose; this; }
LS get() {
tok = cloneList(tok);
scope = unnull(scope);
new HashSet names;
// first pass (find # declarations)
for (int k = 0; k < l(tok); k += 2) {
S t = _get(tok, k+2);
if (eqGet(tok, k, "#") && isIdentifier(t)) {
if (verbose)
print("Local name found: " + t);
names.add(t);
replaceTokens(tok, k, k+3, scope + t);
}
}
// early exit if nothing to do
if (empty(names)) ret tok;
// 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, scope + t);
}
ret tok;
}
}
end scope