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

16
LINES

< > BotCompany Repo | #1028482 // renderLineCompedSingleWithBrackets

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

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

sS renderLineCompedSingleWithBrackets(LineCompedSingle<Char> lc) {
  new StringBuilder buf;
  renderLineCompedSingleWithBrackets_step(lc, buf, lc.main);
  ret str(buf);
}
  
svoid renderLineCompedSingleWithBrackets_step(LineCompedSingle<Char> lc, StringBuilder buf, L<Int> chunks) {
  for (int idx : chunks)
    if (idx < l(lc.literals))
      buf.append(lc.literals.get(idx));
    else {
      buf.append("(");
      renderLineCompedSingleWithBrackets_step(lc, buf, intPairToList(lc.pairs.get(idx-l(lc.literals))));
      buf.append(")");
    }
}

Author comment

Began life as a copy of #1028479

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: #1028482
Snippet name: renderLineCompedSingleWithBrackets
Eternal ID of this version: #1028482/6
Text MD5: c0797e2fb7d49654ca2ed3d85f022bba
Transpilation MD5: fd5f35e486a446c5477fa01e553cafe0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-06-22 00:40:39
Source code size: 562 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 213 / 300
Version history: 5 change(s)
Referenced in: [show references]