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

44
LINES

< > BotCompany Repo | #1002429 - jfind(s, pattern) - returns C index

JavaX fragment (include)

static int jfind(S s, S in) {
  ret jfind(javaTok(s), in);
}

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

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

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

static int jfind(L<S> tok, int startIdx, S in, O condition) {
  //LS tokin = jfind_preprocess(javaTok(in));
  ret jfind(tok, startIdx, javaTokForJFind_array(in), condition);
}

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

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

static int jfind(LS tok, int startIdx, S[] tokinC, O condition) {
  ret findCodeTokens(tok, startIdx, false, tokinC, condition);
}

static int jfind(LS tok, int startIdx, L<S> tokin, O condition) {
  ret jfind(tok, startIdx, codeTokensAsStringArray(tokin), condition);
}

static L<S> jfind_preprocess(L<S> tok) {
  for (S type : litlist("quoted", "id", "int"))
    replaceSublist(tok, ll("<", "", type, "", ">"), ll("<" + type + ">"));
  replaceSublist(tok, ll("\\", "", "*"), ll("\\*"));
  ret tok;
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1002429
Snippet name: jfind(s, pattern) - returns C index
Eternal ID of this version: #1002429/8
Text MD5: 9199bcdfe32735b31b73673b6dcffac4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-15 02:06:42
Source code size: 1228 bytes / 44 lines
Pitched / IR pitched: No / No
Views / Downloads: 493 / 1143
Version history: 7 change(s)
Referenced in: [show references]

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