Libraryless. Click here for Pure Java version (5640L/31K).
1 | static int jfind_any(S src, S... patterns) { |
2 | ret jfind_any(javaTok(src), patterns); |
3 | } |
4 | |
5 | static int jfind_any(LS tok, int startIdx default 1, S... patterns) { |
6 | ret jfind_any(tok, startIdx, null, patterns); |
7 | } |
8 | |
9 | static int jfind_any(LS tok, int startIdx default 1, TokCondition cond, S... patterns) { |
10 | int i = -1; |
11 | for (S pat : patterns) |
12 | i = minUnlessMinus1(i, jfind(tok, startIdx, pat, cond)); |
13 | ret i; |
14 | } |
Began life as a copy of #1002429
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: | #1023396 |
Snippet name: | jfind_any - returns C index. might not be efficient (always tries all the patterns) |
Eternal ID of this version: | #1023396/6 |
Text MD5: | c54d148af2fa010899fe59872d9a1b85 |
Transpilation MD5: | b57e945111e1720e4ec94fd46fbcdeb5 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-08 07:02:52 |
Source code size: | 424 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 307 / 439 |
Version history: | 5 change(s) |
Referenced in: | [show references] |