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

23
LINES

< > BotCompany Repo | #1038295 // tok_parseInnerArgsList

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

Libraryless. Click here for Pure Java version (10956L/61K).

1  
static LS tok_parseInnerArgsList(S s) {
2  
  ret tok_parseInnerArgsList(javaTok(s));
3  
}
4  
5  
static LS tok_parseInnerArgsList(LS tok) {
6  
  ret tok_parseInnerArgsList(tok, getBracketMap(tok));
7  
}
8  
  
9  
static LS tok_parseInnerArgsList(LS tok, Map<Int> bracketMap) {
10  
  new LS args;
11  
  int argStart = 1, i = 1;
12  
  while (i < l(tok)-2) {
13  
    Int j = bracketMap.get(i);
14  
    if (j != null) continue with i = j+2;
15  
    if (eqGetOneOf(tok, i, ",")) {
16  
      if (i > argStart) args.add(trimJoinSubList(tok, argStart, i));
17  
      argStart = i+2;
18  
    }
19  
    i += 2;
20  
  }
21  
  if (i > argStart) args.add(trimJoinSubList(tok, argStart, i));
22  
  ret args;
23  
}

Author comment

Began life as a copy of #1015569

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): gjtlkbvenryc, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1038295
Snippet name: tok_parseInnerArgsList
Eternal ID of this version: #1038295/3
Text MD5: 550ef0c565a7433a3c334e123265b777
Transpilation MD5: edf1c3b2813c929dbcd1e84d988709db
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2024-05-11 20:32:40
Source code size: 640 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 109 / 139
Version history: 2 change(s)
Referenced in: [show references]