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

16
LINES

< > BotCompany Repo | #656 // Include processor (developing)

JavaX (input.txt to output.txt)

1  
!636
2  
!standard functions
3  
!609 // main
4  
5  
String s = loadTextFile("input/input.txt", null);
6  
StringBuilder buf = new StringBuilder();
7  
for (String line : toLines(s)) {
8  
  Matcher matcher = match(line, "^!include (#\\d+)");
9  
  if (matcher.find()) {
10  
    String id = matcher.group(1);
11  
    buf.append(loadSnippet(id));
12  
  } else
13  
    buf.append(line);
14  
  buf.append("\n");
15  
}
16  
saveTextFile("output/output.txt", buf.toString());

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #656
Snippet name: Include processor (developing)
Eternal ID of this version: #656/1
Text MD5: 28577fd0bc37a2ff3b90b695a0c95120
Author: stefan
Category: javax
Type: JavaX (input.txt to output.txt)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-07-05 18:47:05
Source code size: 426 bytes / 16 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 713 / 590
Referenced in: [show references]