Libraryless. Click here for Pure Java version (2500L/16K).
// combine e.g. "a/b" into one token // - but not "a / b" static LS tok_combineSpacelessSlashCombos(LS tok) { new LS l; for i over tok: { if (l(l) > 1 && subListStartingAtIs(tok, i, "", "/", "") && i < l(tok)-4) { tokAppend(l, l(l)-1, joinSubList(tok, i+1, i+4)); i += 3; } else l.add(tok.get(i)); } ret l; }
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027949 |
Snippet name: | tok_combineSpacelessSlashCombos |
Eternal ID of this version: | #1027949/7 |
Text MD5: | 638a555b9a35de0a2cd90c59c4cf3a35 |
Transpilation MD5: | 0468dbe11fbfb82fa67597d8397b2ec7 |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-04-20 13:24:37 |
Source code size: | 361 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 176 / 299 |
Version history: | 6 change(s) |
Referenced in: | [show references] |