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

17
LINES

< > BotCompany Repo | #1026110 // flexMatchIC_iterator

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3656L/23K).

static ItIt<Matches> flexMatchIC_iterator(S pat, S input) {
  L<S> tokPat = javaTokNPunctuation_plusAsterisk(pat), tokInput = javaTokNPunctuation_plusAsterisk(input);
  ret flexMatchIC_iterator(pat, tokPat, tokInput);
}
  
static ItIt<Matches> flexMatchIC_iterator(Tok pat, Tok input) {
  ret flexMatchIC_iterator(pat.text(), pat.tok(), input.tok());
}

static ItIt<Matches> flexMatchIC_iterator(S pat, LS tokPat, LS tokInput) {
  L<Int> varIndices = flexMatchIC_getVarIndices(tokPat, tokInput);
  if (varIndices == null) ret emptyItIt();

  ItIt<LS> spreadInputs = ai_spreadCertainIndices_2_iterator(tokPat, tokInput, varIndices);
  
  ret mapI_notNulls(tok -> getMatches(pat, tok), spreadInputs);
}

Author comment

Began life as a copy of #1021059

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1026110
Snippet name: flexMatchIC_iterator
Eternal ID of this version: #1026110/13
Text MD5: 2a4884bf667f76e5527800d6039dce1d
Transpilation MD5: b3e7df6ef9f36d62750934a8244453b3
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-28 13:32:04
Source code size: 716 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 262 / 410
Version history: 12 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1026121 - flexMatchIC_withBrackets_iterator
#1026178 - flexFindIC_iterator
#1026191 - flexMatchIC_tok_iterator - takes tokenization/keeps punctuation
#1030735 - flexMatchIC_first