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

17
LINES

< > BotCompany Repo | #1033184 // tok_elegantVSInlined

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4667L/27K).

1  
svoid tok_elegantVSInlined(LS tok) {
2  
  for (int i : rjfindAll(tok, "elegant {")) {
3  
    int iElegant = i+2;
4  
    int iEndOfElegant = tok_scanBlock_idx(tok, iElegant);
5  
    int iEnd = iEndOfElegant;
6  
    S replacement;
7  
    
8  
    if (eqGet(tok, iEndOfElegant, "inlined")) {
9  
      int iInlined = iEndOfElegant+2;
10  
      int iEndOfInlined = iEnd = tok_scanBlock_idx(tok, iInlined+2);
11  
      replacement = joinSubList(tok, iInlined+1, iEndOfInlined-2);
12  
    } else
13  
      replacement = joinSubList(tok, iElegant+1, iEndOfElegant-2);
14  
      
15  
    tokReplace_reTok(tok, i, iEnd-1, replacement);
16  
  }
17  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033184
Snippet name: tok_elegantVSInlined
Eternal ID of this version: #1033184/3
Text MD5: 82de16791b2ce5dbcdf5961e93e64b2f
Transpilation MD5: 46acb0c92dedeb70ef6aa26a7eae6af5
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-16 00:19:32
Source code size: 598 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 155 / 220
Version history: 2 change(s)
Referenced in: [show references]