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

46
LINES

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

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

Libraryless. Click here for Pure Java version (2785L/17K).

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, 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   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1006800
Snippet name: rjfind - find last occurrence, returns C index
Eternal ID of this version: #1006800/3
Text MD5: 3a9c0dbff69b1f996832562d8df9cae9
Transpilation MD5: 45a305a0147434a9fcfd4d2fe7336de1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-01 16:04:56
Source code size: 1386 bytes / 46 lines
Pitched / IR pitched: No / No
Views / Downloads: 299 / 306
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1006800 & http://1006800.tinybrain.de