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

17
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;
    break;
  }
  ret i+2;
}

Author comment

Began life as a copy of #1001160

download  show line numbers  debug dex   

Travelled to 5 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pzhvpgtvlbxg, tvejysmllsmz

No comments. add comment

Snippet ID: #1023407
Snippet name: tok_findEndOfType
Eternal ID of this version: #1023407/3
Text MD5: 7783605054c26ba53af7923983a97cfb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-25 21:35:40
Source code size: 471 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 67 / 89
Version history: 2 change(s)
Referenced in: [show references]

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