Libraryless. Click here for Pure Java version (304L/3K/9K).
// Syntax: stringFunc { s.trim() } !592 629 // auto-importer, standard function adder !723 // L<S> !680 // quicknew public class main { public static void main(String[] args) throws Exception { L<S> tok = javaTok(loadMainJava()); for (int i = 0; i < 100; i++) { int idx = findCodeTokens(tok, "stringfunc", "{"); if (idx < 0) break; int j = findEndOfBracketPart(tok, idx+2); tok.set(idx, "new StringFunc() {\n" + "public String get(String s) {\n" + "try { return "); tok.set(idx+2, ""); tok.set(j-1, "; } catch (Exception _e) {\n" + " throw _e instanceof RuntimeException ? (RuntimeException) _e : new RuntimeException(_e); } } }"); } // add interface to main class L<S> c = findMainClass(tok); if (join(c).indexOf("interface StringFunc") < 0) c.set(c.size()-2, "static interface StringFunc {\n" + " String get(String s);\n" + "}\n" + "}"); saveMainJava(join(tok)); } }
Began life as a copy of #721
download show line numbers debug dex old transpilations
Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, hxnwyiuffukg, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment