Libraryless. Click here for Pure Java version (2500L/16K).
1 | // combine e.g. "a/b" into one token |
2 | // - but not "a / b" |
3 | static LS tok_combineSpacelessSlashCombos(LS tok) {
|
4 | new LS l; |
5 | for i over tok: {
|
6 | if (l(l) > 1 && subListStartingAtIs(tok, i, "", "/", "") |
7 | && i < l(tok)-4) {
|
8 | tokAppend(l, l(l)-1, joinSubList(tok, i+1, i+4)); |
9 | i += 3; |
10 | } else |
11 | l.add(tok.get(i)); |
12 | } |
13 | ret l; |
14 | } |
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: | 437 / 608 |
| Version history: | 6 change(s) |
| Referenced in: | [show references] |