svoid tok_beginPeriod(LS tok) { for (i : jfind_all_reversed(tok, "begin.", (_tok, nIdx) -> _get(tok, startsWithSpaceEtc(nIdx+4)))) { int iClosing = tok_findEndOfBlock(tok, i)-1; tokPrepend_reTok(tok, iClosing, "}\n"); tokReplace_reTok(tok, i, i+3, "run {"); } }