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

22
LINES

< > BotCompany Repo | #1007957 // Simple Include-Handling Translator (for !7, not used anymore)

JavaX translator [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4281L/29K).

!759

p {
  String s = loadMainJava();
  
  // process include statements

  for (int n = 0; n < 1000; n++) {   
    Matcher m = Pattern.compile("!include (#\\d+)").matcher(s);
    StringBuffer buf = new StringBuffer();
    if (!m.find())
      break;
    else do {
      String includedSrc = loadSnippet(m.group(1));
      m.appendReplacement(buf, m.quoteReplacement(includedSrc));
    } while (m.find());
    m.appendTail(buf);
    s = buf.toString();
  }
  
  saveMainJava(s);
}

Author comment

Began life as a copy of #636

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007957
Snippet name: Simple Include-Handling Translator (for !7, not used anymore)
Eternal ID of this version: #1007957/4
Text MD5: 9acd29442fcd1e3361ee581fc87b57f3
Transpilation MD5: 51f321f0221992e7977ab2f8905e7be8
Author: stefan
Category: javax
Type: JavaX translator
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-20 14:06:21
Source code size: 502 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 485 / 1980
Version history: 3 change(s)
Referenced in: [show references]