Libraryless. Click here for Pure Java version (5899L/33K).
1 | svoid tok_moduleClassDecls(L<S> tok) { |
2 | jreplace(tok, "module <id> implements", "module $2 extends DynModule implements"); |
3 | jreplace(tok, "module <id> {", "module $2 extends DynModule {"); |
4 | jreplace(tok, "module {", "module " + stefansOS_defaultModuleClassName() + " {"); |
5 | jreplace(tok, "module > <id>", "module " + stefansOS_defaultModuleClassName() + " > $3"); |
6 | int i = -1; |
7 | while ((i = jfind(tok, i+1, "module <id>", |
8 | // check for interference with other productions |
9 | (_tok, nIdx) -> !eqGetOneOf(_tok, nIdx+3, "instanceof", "default", "aka"))) >= 0) { |
10 | int j = findEndOfBlock(tok, indexOf(tok, "{", i))-1; |
11 | S name = tok.get(i+2); |
12 | tok.set(i, "sclass"); |
13 | tokAppend(tok, j, "\nsbool _moduleClass_" + name + " = true;"); // just a marker to quickly find module classes |
14 | reTok(tok, j, j+1); |
15 | } |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018678 |
Snippet name: | tok_moduleClassDecls |
Eternal ID of this version: | #1018678/16 |
Text MD5: | e532f09641c2a57509c17fa0fda07561 |
Transpilation MD5: | e99f6d41c38b7051508003057839a1ed |
Author: | stefan |
Category: | javax / dynamic modules |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-06 18:10:33 |
Source code size: | 839 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 443 / 554 |
Version history: | 15 change(s) |
Referenced in: | [show references] |