Warning: session_start(): open(/var/lib/php/sessions/sess_ksfe6hvdso3feupgjrpttr4iov, 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
// only one multi-type argument per declaration for now
// also allows only one combo right now (File/S with newFile)
// example:
// sS loadTextFile(File/S file) { ... }
svoid tok_multiTypeArguments(LS tok) {
int i;
while ((i = jfind(tok, "File/ ", (_tok, nIdx) ->
eqGetOneOf(_tok, nIdx+5, "S", "String"))) >= 0) {
int iOpening = lastIndexOf(tok, i, "("); // TODO: brackets
int iClosing = findEndOfBracketPart2(tok, iOpening)-1;
// function name
int iName = iOpening-2;
S name = assertIdentifier(get(tok, iName));
int iType = tok_leftScanType(tok, iName);
int iStart = tok_leftScanTypeArgsOpt(tok, iType);
iStart = leftScanModifiers(tok, iStart);
//print("Found method head: " + joinSubList(tok, iStart, iClosing+1));
int iArgEnd = i+8; // comma or closing bracket
LS _args1 = subList(tok, iOpening+1, i);
LS _args2 = subList(tok, iArgEnd+1, iClosing);
LS args1 = tok_parseArgsDeclList2(_args1);
LS args2 = tok_parseArgsDeclList2(_args2);
LS type = subList(tok, iType-1, iName);
bool isVoid = containsOneOf(codeTokens(type), javaxVoidAliases());
//printVars(+expr, +_args1, +_args2, +args1, +args2, +type, +isVoid);
S argName = tok.get(i+6);
S mainType = tok.get(i), altType = tok.get(i+4);
S converter = "newFile";
S expr = converter + "(" + argName + ")";
S rewrittenHead = joinSubList(tok, iStart, iOpening+1)
+ joinWithComma(concatLists(
args1,
ll(altType + " " + argName),
args2)) + ")";
replaceTokens_reTok(tok, i, i+7, mainType + " " + argName);
tokPrepend_reTok(tok, iStart, rewrittenHead + " { "
+ (isVoid ? "" : "return ") + name + "(" +
joinWithComma(concatLists(
map tok_lastIdentifier(args1),
ll(expr),
map tok_lastIdentifier(args2))) + "); }\n");
}
}