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

12
LINES

< > BotCompany Repo | #1022794 - tok_expandLT3 - LT3<...> to L<T3<...>>

JavaX fragment (include)

svoid tok_expandLT3(L<S> tok) {
  if (!tok.contains("LT3")) ret;
  int n = l(tok)-6;
  for (int i = 1; i < n; i += 2) {
    continue unless eq(tok.get(i), "LT3") && eq(tok.get(i+2), "<");
    int j = findEndOfTypeArgs(tok, i+2)-1; // j = index of >
    tok.set(i, "L<T3");
    tok.set(j, ">>");
    reTok(tok, i, j+1);
    n = l(tok)-6;
  }
}

Author comment

Began life as a copy of #1017528

download  show line numbers  debug dex   

Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1022794
Snippet name: tok_expandLT3 - LT3<...> to L<T3<...>>
Eternal ID of this version: #1022794/1
Text MD5: fd67056691116f11aab69d16044915c9
Author: stefan
Category: javax / transpilation
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-07 17:37:40
Source code size: 355 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 47 / 54
Referenced in: [show references]

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