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

13
LINES

< > BotCompany Repo | #1021307 // tok_combineSquareBrackets

JavaX fragment (include)

static L<S> tok_combineSquareBrackets(LS tok) {
  new L<S> l;
  for i over tok: {
    S t = tok.get(i);
    if (odd(i) && eq(t, "[")) {
      int j = findEndOfBracketPart2(tok, i);
      l.add(joinSubList(tok, i+1, j-1));
      i = j-1;
    } else
      l.add(t);
  }
  ret l;
}

Author comment

Began life as a copy of #1013171

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: #1021307
Snippet name: tok_combineSquareBrackets
Eternal ID of this version: #1021307/1
Text MD5: 138d6b7bea6c893dcba002337d19abd4
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-08 13:56:59
Source code size: 290 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 194 / 226
Referenced in: [show references]