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

17
LINES

< > BotCompany Repo | #1017378 - tok_typeAA

JavaX fragment (include)

svoid tok_typeAA(L<S> tok, Set<S> pairClasses) {
  int n = l(tok)-6;
  bool change = false;
  for (int i = 1; i < n; i += 2) {
    if (!eq(get(tok, i+2), "<")) continue;
    S t = tok.get(i);
    continue unless
         contains(pairClasses, t)
      || eq(t, "Entry") && eqGet(tok, i-2, ".") && eqGet(tok, i-4, "Map");
    if (tok_isSingleTypeArg(tok, i+2)) {
      int j = findEndOfTypeArgs(tok, i+2)-1;
      S type = joinSubList(tok, i+4, j);
      replaceTokens_reTok(tok, i+4, j, type + ", " + type);
      change = true;
    }
  }
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1017378
Snippet name: tok_typeAA
Eternal ID of this version: #1017378/4
Text MD5: 383e96842d2538bb888da064c3fe9d41
Author: stefan
Category: javax / transpilation
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-08 11:29:54
Source code size: 558 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 187 / 185
Version history: 3 change(s)
Referenced in: [show references]

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