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

15
LINES

< > BotCompany Repo | #1026119 // flexMatchIC_getVarIndices

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

Libraryless. Click here for Pure Java version (2159L/14K).

// returns null if crucial word not found in input
static L<Int> flexMatchIC_getVarIndices(LS tokPat, LS tokInput) {
  // fail if crucial words not found (could be optimized more)
  new L<Int> varIndices;
  for (int i = 1; i < l(tokPat); i += 2) {
    S t = tokPat.get(i);
    if (eq(t, "*"))
      varIndices.add(i);
    else if (isIdentifier(t) && !cicAtOddPosition(tokInput, t)) {
      //print("Crucial word fail (" + t + "): " + pat + " / " + join(tokInput));
      null;
    }
  }
  ret varIndices;
}

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: #1026119
Snippet name: flexMatchIC_getVarIndices
Eternal ID of this version: #1026119/3
Text MD5: 601c04d205f5494c6db38fac9d61c5b9
Transpilation MD5: f4b11eb6b4a8e1c6effed3e10496f904
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-25 20:01:35
Source code size: 520 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 194 / 306
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)