Warning: session_start(): open(/var/lib/php/sessions/sess_ha4inscvcr8t63h4vc5uq5l2cv, 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
srecord noeq LeftArrowScriptAutoCompleter(GazelleV_LeftArrowScriptParser parser) {
LS tok;
CharInToken cursor;
S typedCharacters;
void seek(S text, int iChar) {
parser.setText(text);
parser.init();
tok = parser.tok;
cursor = charIndexToCharInToken(tok, iChar);
// move one token left if necessary
if (cursor.iTok > 1 && cursor.iChar == 0 && empty(space())) {
cursor.iTok -= 2;
cursor.iChar = l(token());
}
typedCharacters = takeFirst(cursor.token(), cursor.iChar);
}
S typedCharacters() {
printVars ifdef LeftArrowScriptAutoCompleter_debug(+cursor);
ret typedCharacters;
}
S space() { ret get(tok, cursor.iTok-1); }
S token() { ret get(tok, cursor.iTok); }
S prevToken() { ret get(tok, cursor.iTok-2); }
bool beginningOfCmd() {
ret eqOneOf(prevToken(), ";", "{", "}")
|| containsNewLine(space());
}
Cl getCompletions() { ret searcher()!; }
ScoredStringSearcher searcher() {
ScoredStringSearcher searcher = new(typedCharacters);
if (empty(typedCharacters)) searcher.returnAll = true;
S prev = prevToken();
printVars ifdef LeftArrowScriptAutoCompleter_debug(+beginningOfCmd(), +prev, +cursor, +typedCharacters);
if (!beginningOfCmd() && isIdentifier(prev)) {
print ifdef LeftArrowScriptAutoCompleter_debug("Adding true and false etc");
searcher.addAll("true", "false", "null");
} else
searcher.addAll(globalMethodNames());
ret searcher;
}
swappable Cl globalMethodNames() {
ret concatMap methodNames(parser.functionContainers);
}
}