static L<S> tok_mergeInts(L<S> tok) { for (int i = 1; i+2 < l(tok); i++) { S t; if (eqGet(tok, i, "-") && eqGet(tok, i+1, "") && isInteger(t = tok.get(i+2))) { tok.remove(i--); tok.remove(i--); tok.set(i, "-" + t); } } ret tok; }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1008958 |
| Snippet name: | tok_mergeInts - merge integer constants into one token ("-1") |
| Eternal ID of this version: | #1008958/2 |
| Text MD5: | 11ab2410b4399d443b3714e2f3a7c908 |
| Author: | stefan |
| Category: | javax / parsing |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-06-20 01:19:47 |
| Source code size: | 275 bytes / 11 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 775 / 828 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |