Libraryless. Click here for Pure Java version (4068L/24K).
1 | svoid tok_compactModules(LS tok) { |
2 | S latestID = #1031187; |
3 | |
4 | // cm means "latest version of compact module" |
5 | jreplace(tok, "cm *", "cmodule2 $2", (_tok, nIdx) -> { |
6 | S t = _tok.get(nIdx+3); |
7 | ret eqOneOf(t, ">", "{") || isIdentifier(t); |
8 | }); |
9 | |
10 | for (S kw : ll("cprint", "cprint2")) { |
11 | jreplace(tok, kw + " {", kw + " " + stefansOS_defaultModuleClassName() + " {"); |
12 | jreplace(tok, kw + " <id> {", "cmodule2 $2 > DynPrintLog {"); |
13 | } |
14 | |
15 | if (jreplace_multi(tok, ll("cmodule", "compact module"), "module")) { |
16 | print("compact modules"); |
17 | includeInMainLoaded(tok, "!include once " + latestID + "\n"); |
18 | } |
19 | |
20 | if (jreplace_multi(tok, ll("cmodule2 <id>", "cmodule2 >", "cmodule2 {"), "module $2")) |
21 | includeInMainLoaded(tok, "!include once " + latestID + "\n"); |
22 | } |
Began life as a copy of #1018678
download show line numbers debug dex old transpilations
Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1020763 |
Snippet name: | tok_compactModules |
Eternal ID of this version: | #1020763/22 |
Text MD5: | 7e7c8df0b8780afc9b08e212e98d6112 |
Transpilation MD5: | 67632f9502a7ed0c93a77a03fea38880 |
Author: | stefan |
Category: | javax / dynamic modules |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-06-30 02:11:10 |
Source code size: | 807 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 399 / 685 |
Version history: | 21 change(s) |
Referenced in: | [show references] |