// adds default constructor to classes with "persistable" modifier svoid tok_persistableClasses(LS tok) { int i; while((i = jfind(tok, "persistable", tokCondition { while (int j = i+1; isIdentifier(_get(tok, j)); j += 2) if (eqGet(tok, j, "class")) true; false; })) >= 0) { int iClass = indexOf(tok, "class", i); int idx = indexOf(tok, iClass, "{"); L contents = subList(tok, idx+1, j); LS contentsWithoutCurly = replaceCurlyBracedWith(tok_combineCurlyBrackets_keep(cloneList(contents)), ""); bool hasDefaultConstructor = jcontains(contentsWithoutCurly, "*()"); if (!hasDefaultConstructor) tokAppend_reTok(idx, "\n *() {}"); clearTokens_reTok(i, i+2); // drop persistable keyword } }