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

19
LINES

< > BotCompany Repo | #1023407 // tok_findEndOfType

JavaX fragment (include)

static int tok_findEndOfType(LS tok) {
  ret tok_findEndOfType(tok, 1);
}

// i = beginning of type (identifier)
// index returned C index after type
// now does packages/inner classes too
static int tok_findEndOfType(LS tok, int i) {
  while licensed {
    if (eqGet(tok, i+2, ".") && isIdentifier(get(tok, i+4)))
      continue with i += 4;
    if (eqGet(tok, i+2, "<"))
      continue with i = findEndOfTypeArgs(tok, i+2)-1;
    if (eqGet(tok, i+2, "["))
      continue with i = findEndOfBracketPart2(tok, i+2)-1;
    break;
  }
  ret i+2;
}

Author comment

Began life as a copy of #1001160

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023407
Snippet name: tok_findEndOfType
Eternal ID of this version: #1023407/6
Text MD5: c350d5b495f85f43e0f58ef1393687c8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-18 02:10:30
Source code size: 562 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 271 / 325
Version history: 5 change(s)
Referenced in: [show references]