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

50
LINES

< > BotCompany Repo | #1006800 // rjfind - find last occurrence, returns C index

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

Libraryless. Click here for Pure Java version (8586L/48K).

1  
please include function jfind.
2  
3  
static int rjfind(L<S> tok, S in) {
4  
  ret rjfind(tok, 1, in);
5  
}
6  
7  
static int rjfind(L<S> tok, int startIdx, S in) {
8  
  ret rjfind(tok, startIdx, in, null);
9  
}
10  
11  
static int rjfind(L<S> tok, int startIdx, int endIndex, S in) {
12  
  ret rjfind(tok, startIdx, endIndex, in, null);
13  
}
14  
15  
static int rjfind(L<S> tok, S in, ITokCondition condition) {
16  
  ret rjfind(tok, 1, in, (O) condition);
17  
}
18  
19  
static int rjfind(L<S> tok, S in, O condition) {
20  
  ret rjfind(tok, 1, in, condition);
21  
}
22  
23  
static int rjfind(L<S> tok, int startIdx, S in, O condition) {
24  
  List<String> tokin = javaTok(in);
25  
  jfind_preprocess(tokin);
26  
  ret rjfind(tok, startIdx, tokin, condition);
27  
}
28  
29  
static int rjfind(L<S> tok, int startIdx, int endIndex, S in, O condition) {
30  
  List<String> tokin = javaTok(in);
31  
  jfind_preprocess(tokin);
32  
  ret rjfind(tok, startIdx, endIndex, tokin, condition);
33  
}
34  
35  
// assumes you preprocessed tokin
36  
static int rjfind(L<S> tok, L<S> tokin) {
37  
  ret rjfind(tok, 1, tokin);
38  
}
39  
40  
static int rjfind(L<S> tok, int startIdx, L<S> tokin) {
41  
  ret rjfind(tok, startIdx, tokin, null);
42  
}
43  
44  
static int rjfind(L<S> tok, int startIdx, L<S> tokin, O condition) {
45  
  return rfindCodeTokens(tok, startIdx, false, toStringArray(codeTokensOnly(tokin)), condition);
46  
}
47  
48  
static int rjfind(L<S> tok, int startIdx, int endIndex, L<S> tokin, O condition) {
49  
  return rfindCodeTokens(tok, startIdx, endIndex, false, toStringArray(codeTokensOnly(tokin)), condition);
50  
}

Author comment

Began life as a copy of #1002429

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006800
Snippet name: rjfind - find last occurrence, returns C index
Eternal ID of this version: #1006800/5
Text MD5: f908d276c2007526dbd37c57118486d0
Transpilation MD5: ef7813c28a750210910649a0e648c3c3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-28 23:29:28
Source code size: 1495 bytes / 50 lines
Pitched / IR pitched: No / No
Views / Downloads: 598 / 681
Version history: 4 change(s)
Referenced in: [show references]