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

14
LINES

< > BotCompany Repo | #1025153 // tok_scanTypeBackwards OLD version

JavaX fragment (include)

1  
// i = last C token of type
2  
// returns first C token of type
3  
static int tok_scanTypeBackwards(LS tok, int i) {
4  
  if (i < 0) ret i;
5  
  int level = 0;
6  
  while (i > 0) {
7  
    S t = tok.get(i);
8  
    if (isIdentifier(t) && level == 0) ret i;
9  
    if (eq(t, ">")) ++level;
10  
    else if (eq(t, "<")) --level;
11  
    i -= 2;
12  
  }
13  
  ret i;
14  
}

Author comment

Began life as a copy of #1021797

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025153
Snippet name: tok_scanTypeBackwards OLD version
Eternal ID of this version: #1025153/1
Text MD5: eabce6ba6242a967146c765bb8617ce4
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-09 22:32:21
Source code size: 336 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 194 / 225
Referenced in: [show references]