Libraryless. Click here for Pure Java version (8649L/49K).
static LS findFunctionDefsAtCurlyLevel(int curlyLevel, S s) { ret findFunctionDefsAtCurlyLevel(curlyLevel, javaTok(s)); } static LS findFunctionDefsAtCurlyLevel(int targetCurlyLevel, LS tok) { ifclass IContentsIndexedList2 if (tok cast IContentsIndexedList2<S>) ret findFunctionDefsAtCurlyLevel_indexed(targetCurlyLevel, tok); endif new LS functions; var keywords = findFunctionDefs_keywords(); int n = l(tok); int curlyLevel = 0; new BitSet ignore; for (int i = 1; i < n; i += 2) { if (ignore.get(i)) continue; S t = tok.get(i); // Account for meta-for (don't change curly level) if (eqSubList(tok, i, "meta", "", "-", "", "for")) { var r = tok_findFirstBlock(tok, i); ignore.set(r.start); ignore.set(r.end-1); } curlyLevel += curlyLevel(t); if (curlyLevel == targetCurlyLevel) if (keywords.contains(t)) findFunctionDefs_step(tok, i, functions); } ret functions; }
Began life as a copy of #1004051
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034500 |
Snippet name: | findFunctionDefsAtCurlyLevel |
Eternal ID of this version: | #1034500/4 |
Text MD5: | 9c50ca8a9e3d049a16d450f52b9ed088 |
Transpilation MD5: | 3c7d1acf527ed3ad094e90e86954a55e |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-01 20:17:49 |
Source code size: | 1011 bytes / 35 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 182 / 268 |
Version history: | 3 change(s) |
Referenced in: | [show references] |