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).

please include function jfind.

static int rjfind(L<S> tok, S in) {
  ret rjfind(tok, 1, in);
}

static int rjfind(L<S> tok, int startIdx, S in) {
  ret rjfind(tok, startIdx, in, null);
}

static int rjfind(L<S> tok, int startIdx, int endIndex, S in) {
  ret rjfind(tok, startIdx, endIndex, in, null);
}

static int rjfind(L<S> tok, S in, ITokCondition condition) {
  ret rjfind(tok, 1, in, (O) condition);
}

static int rjfind(L<S> tok, S in, O condition) {
  ret rjfind(tok, 1, in, condition);
}

static int rjfind(L<S> tok, int startIdx, S in, O condition) {
  List<String> tokin = javaTok(in);
  jfind_preprocess(tokin);
  ret rjfind(tok, startIdx, tokin, condition);
}

static int rjfind(L<S> tok, int startIdx, int endIndex, S in, O condition) {
  List<String> tokin = javaTok(in);
  jfind_preprocess(tokin);
  ret rjfind(tok, startIdx, endIndex, tokin, condition);
}

// assumes you preprocessed tokin
static int rjfind(L<S> tok, L<S> tokin) {
  ret rjfind(tok, 1, tokin);
}

static int rjfind(L<S> tok, int startIdx, L<S> tokin) {
  ret rjfind(tok, startIdx, tokin, null);
}

static int rjfind(L<S> tok, int startIdx, L<S> tokin, O condition) {
  return rfindCodeTokens(tok, startIdx, false, toStringArray(codeTokensOnly(tokin)), condition);
}

static int rjfind(L<S> tok, int startIdx, int endIndex, L<S> tokin, O condition) {
  return rfindCodeTokens(tok, startIdx, endIndex, false, toStringArray(codeTokensOnly(tokin)), condition);
}

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: 597 / 680
Version history: 4 change(s)
Referenced in: [show references]