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

18
LINES

< > BotCompany Repo | #1027140 // gazelle_visit - call a function on input and all inner parts of input

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

Libraryless. Click here for Pure Java version (2653L/16K).

svoid lambdaMapLike gazelle_visit(IVF1<S> visitor, S input, O... _) {
  if (visitor == null) ret;
  
  // call visitor on whole input
  visitor.get(input);
  
  // tokenize input
  O tokenizer = optPar tokenizer(_, f javaTokWithBrackets);
  LS tok = callTokenizer(tokenizer, input);
  
  for (int i = 1; i < l(tok); i += 2) {
    S t = tok.get(i);
    if (tok_isRoundOrCurlyBracketed(t)) {
      S unBracketed = tok_deRoundOrCurlyBracket(t);
      gazelle_visit(visitor, unBracketed, _);
    }
  }
}

Author comment

Began life as a copy of #1025738

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: #1027140
Snippet name: gazelle_visit - call a function on input and all inner parts of input
Eternal ID of this version: #1027140/4
Text MD5: a1c5fcedfe0ebae95b25c80be3ad26df
Transpilation MD5: 3959715689e4b067290a1fba891129d9
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-22 10:29:59
Source code size: 516 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 198 / 281
Version history: 3 change(s)
Referenced in: [show references]