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

17
LINES

< > BotCompany Repo | #1026191 // flexMatchIC_tok_iterator - takes tokenization/keeps punctuation

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

Libraryless. Click here for Pure Java version (3407L/22K).

static ItIt<Matches> flexMatchIC_tok_iterator(Tok pat, Tok input) {
  LS tokPat = pat.tok(), tokInput = input.tok();
  L<Int> varIndices = flexMatchIC_getVarIndices(tokPat, tokInput);
  ifdef flexMatchIC_tok_iterator_debug
    print(+varIndices);
  endifdef
  if (varIndices == null) ret emptyItIt();

  ItIt<LS> spreadInputs = ai_spreadCertainIndices_2_iterator(pat.tok(), input.tok(), varIndices);
  
  ret mapI_notNulls(tok -> {
    ifdef flexMatchIC_tok_iterator_debug
      print(+tok);
    endifdef
    ret getMatches(tokPat, tok);
  }, spreadInputs);
}

Author comment

Began life as a copy of #1026110

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: #1026191
Snippet name: flexMatchIC_tok_iterator - takes tokenization/keeps punctuation
Eternal ID of this version: #1026191/4
Text MD5: fee7054022f0a8d9318023d3099dd085
Transpilation MD5: e2bc190b527c7e42f0e1046d93b2bd2c
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 14:05:06
Source code size: 575 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 148 / 224
Version history: 3 change(s)
Referenced in: [show references]