Libraryless. Click here for Pure Java version (2159L/14K).
1 | // returns null if crucial word not found in input |
2 | static L<Int> flexMatchIC_getVarIndices(LS tokPat, LS tokInput) { |
3 | // fail if crucial words not found (could be optimized more) |
4 | new L<Int> varIndices; |
5 | for (int i = 1; i < l(tokPat); i += 2) { |
6 | S t = tokPat.get(i); |
7 | if (eq(t, "*")) |
8 | varIndices.add(i); |
9 | else if (isIdentifier(t) && !cicAtOddPosition(tokInput, t)) { |
10 | //print("Crucial word fail (" + t + "): " + pat + " / " + join(tokInput)); |
11 | null; |
12 | } |
13 | } |
14 | ret varIndices; |
15 | } |
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: | 195 / 308 |
Version history: | 2 change(s) |
Referenced in: | [show references] |