Libraryless. Click here for Pure Java version (2765L/18K).
1  | svoid tok_standardBot(LS tok) {
 | 
2  | int i;  | 
3  |   while ((i = jfind(tok, "standard bot <id> {")) >= 0) {
 | 
4  |     int iOpening = indexOf(tok, i, "{");
 | 
5  | S name = tok.get(iOpening-2);  | 
6  | int iClosing = findEndOfBracketPart(tok, iOpening)-1;  | 
7  | LS contents = subList(tok, iOpening+1, iClosing);  | 
8  | |
9  |     int j = jfind(contents, "allServers {");
 | 
10  | int k = findEndOfBracketPart(contents, j+2);  | 
11  | S allServers = joinSubList(contents, j+4, k-2);  | 
12  | clearTokens(contents, j, k);  | 
13  | |
14  | replaceTokens_reTok(tok, i, iClosing+1,  | 
15  |       [[ cmodule ]] + name + [[ extends DynTalkBot2<.ByServer> {
 | 
16  |         void init {
 | 
17  | super.init();  | 
18  | makeByServer = () -> new ByServer;  | 
19  | useAGIBlueForDropPunctuation = false;  | 
20  | preprocessAtSelfToMyName = false;  | 
21  | }  | 
22  | |
23  | ]] + allServers + [[  | 
24  | |
25  |         class ByServer extends DynTalkBot2.ByServer { ]]
 | 
26  | + join(contents)  | 
27  | + "} }");  | 
28  | }  | 
29  | }  | 
Began life as a copy of #1025200
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1025378 | 
| Snippet name: | tok_standardBot - use tok_standardBot1 instead | 
| Eternal ID of this version: | #1025378/11 | 
| Text MD5: | f3454e7239541b93da56416d7c98fae4 | 
| Transpilation MD5: | 3e10fea68900d2eba643de169c4bf68f | 
| Author: | stefan | 
| Category: | javax / transpiling | 
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2019-10-01 18:40:48 | 
| Source code size: | 942 bytes / 29 lines | 
| Pitched / IR pitched: | No / No | 
| Views / Downloads: | 655 / 940 | 
| Version history: | 10 change(s) | 
| Referenced in: | [show references] |