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

12
LINES

< > BotCompany Repo | #1001162 // getClassDeclarationName (also works with interfaces and enums)

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

Libraryless. Click here for Pure Java version (4501L/26K).

please include function allClasses.

sS getClassDeclarationName(L<S> tok) {
  if (tok != null)
    for (int i = 1; i+2 < tok.size(); i += 2)
      if (allClasses_keywords.contains(tok.get(i)) && isIdentifier(tok.get(i+2))) {
        while (contains(getClassDeclarationName_skippables(), get(tok, i+2)))
          i += 2;
        ret tok.get(i+2);
      }
  null;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001162
Snippet name: getClassDeclarationName (also works with interfaces and enums)
Eternal ID of this version: #1001162/8
Text MD5: 2dce6a6bceb1af0d006c052793165751
Transpilation MD5: 256dd3d5fda63ac9a18d8f5fd9ece37d
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-16 02:44:23
Source code size: 377 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 674 / 2360
Version history: 7 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1033200 - getClassDeclarationName_skippables
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)