Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1018678 - tok_moduleClassDecls

JavaX fragment (include)

svoid tok_moduleClassDecls(L<S> tok) {
  jreplace(tok, "module <id> {", "module $2 extends DynModule {");
  int i = -1;
  while ((i = jfind(tok, i+1, "module <id>")) >= 0) {
    int j = findEndOfBlock(tok, indexOf(tok, "{", i))-1;
    S name = tok.get(i+2);
    tok.set(i, "sclass");
    tokAppend(tok, j, "\nsbool _moduleClass_" + name + " = true;"); // just a marker to quickly find module classes
    reTok(tok, j, j+1);
  }
}

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1018678
Snippet name: tok_moduleClassDecls
Eternal ID of this version: #1018678/9
Text MD5: 94a1c9ffb71c2d360080846b4ec3bbae
Author: stefan
Category: javax / dynamic modules
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-27 17:20:10
Source code size: 441 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 141 / 164
Version history: 8 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1018678 & http://1018678.tinybrain.de