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

11
LINES

< > BotCompany Repo | #1007593 - tok_expandVarCopies

JavaX fragment (include)

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

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

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: 290 / 278
Referenced in: [show references]

Formerly at http://tinybrain.de/1007593 & http://1007593.tinybrain.de