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

21
LINES

< > BotCompany Repo | #1028001 // tok_parseArgsDeclList2 - can also start at comma

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

Libraryless. Click here for Pure Java version (2583L/17K).

static L<S> tok_parseArgsDeclList2(LS tok) {
  ret tok_parseArgsDeclList2(tok, getBracketMapIncludingAngleBrackets(tok));
}

static LS tok_parseArgsDeclList2(LS tok, Map<Int> bracketMap) {
  int argStart = 1;
  if (eqGet(tok, argStart, ",")) argStart += 2;
  int i = argStart;
  new LS args;
  while (i < l(tok) && neq(get(tok, i), ")")) {
    Int j = bracketMap.get(i);
    if (j != null) continue with i = j+2;
    if (eqGetOneOf(tok, i, ",")) {
      if (i > argStart) args.add(trimJoinSubList(tok, argStart, i));
      argStart = i+2;
    }
    i += 2;
  }
  if (i > argStart) args.add(trimJoinSubList(tok, argStart, i));
  ret args;
}

Author comment

Began life as a copy of #1016801

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1028001
Snippet name: tok_parseArgsDeclList2 - can also start at comma
Eternal ID of this version: #1028001/3
Text MD5: 02039e734267839ddf1050226f2166b6
Transpilation MD5: d544859a67214462f5da2b68352a507f
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-26 20:32:10
Source code size: 659 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 172 / 248
Version history: 2 change(s)
Referenced in: [show references]