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

12
LINES

< > BotCompany Repo | #1022875 // pAttractor_allMatches2 - returns cloned attractors

JavaX fragment (include)

static L<PartialAttractor> pAttractor_allMatches2(PartialAttractor a, LS tok) {
  int i = 0;
  new L<PartialAttractor> out;
  while (licensed() && i < l(tok)) {
    a.tok = subList(tok, i);
    if (!a.find()) break;
    assertTrue("match must not be empty", a.matchedRange.end >= 2);
    out.add(shallowClone(a));
    i += a.matchedRange.end & ~1; // go to next N token
  }
  ret out;
}

Author comment

Began life as a copy of #1022868

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022875
Snippet name: pAttractor_allMatches2 - returns cloned attractors
Eternal ID of this version: #1022875/1
Text MD5: 7fe374df5b05541f1c4bf28c7ab29dd9
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-12 16:59:04
Source code size: 397 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 302 / 349
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1022877 - pAttractor_allMatches3 - accepts multiple attractors, returns cloned attractors