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

11
LINES

< > BotCompany Repo | #1007593 // tok_expandVarCopies

JavaX fragment (include)

1  
// +var => "var", +var
2  
static void tok_expandVarCopies(L<S> tok) {
3  
  for (int i = 3; i+2 < l(tok); i += 2) {
4  
    if (!eq(tok.get(i), "+")) continue;
5  
    if (!eqOneOf(tok.get(i-2), "(", ",", "{")) continue;
6  
    S s = tok.get(i+2);
7  
    if (!isIdentifier(s)) continue;
8  
    tok.set(i, quote(s) + ", ");
9  
    reTok(tok, i, i+1);
10  
  }
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007593
Snippet name: tok_expandVarCopies
Eternal ID of this version: #1007593/1
Text MD5: 7cf1f8f33bf036f065a6d57fbb5d80c2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-27 17:57:11
Source code size: 340 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 586 / 594
Referenced in: [show references]