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

19
LINES

< > BotCompany Repo | #1025738 // gazelle_deepZip_keepBrackets - Gazelle's magic function

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

Libraryless. Click here for Pure Java version (3092L/19K).

1  
static SS gazelle_deepZip_keepBrackets(S inputA, S inputB, O... _) {
2  
  SS map = gazelle_zip_keepBrackets(inputA, inputB);
3  
  if (map == null) null;
4  
  SS map2 = similarEmptyMap(map);
5  
  for (S a, S b : map) {
6  
    bool iba = tok_isRoundOrCurlyBracketed(a), ibb = tok_isRoundOrCurlyBracketed(b);
7  
    if (iba && ibb) {
8  
      S aa = tok_deRoundOrCurlyBracket(a);
9  
      S bb = tok_deRoundOrCurlyBracket(b);
10  
      SS subMap = gazelle_deepZip_keepBrackets(aa, bb, _);
11  
      if (subMap == null) null;
12  
      if (!putAllStrictlyIC(map2, subMap)) null;
13  
    } else if (eqic_roundBracketed(a, b)) {
14  
      // OK, match
15  
    } else
16  
      if (!strictPutIC(map2, a, b)) null;
17  
  }
18  
  ret map2;
19  
}

Author comment

Began life as a copy of #1025728

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: #1025738
Snippet name: gazelle_deepZip_keepBrackets - Gazelle's magic function
Eternal ID of this version: #1025738/7
Text MD5: 115f9477eb81d3aa6513bbe9afdc9daf
Transpilation MD5: 94ff9e6682fdb45b461fe237ccc74392
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-23 12:47:27
Source code size: 690 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 258 / 393
Version history: 6 change(s)
Referenced in: [show references]