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

24
LINES

< > BotCompany Repo | #1025723 // smartParser1_subParse

JavaX fragment (include)

static LS smartParser1_subParse(S s) {
  // drop outer brackets, keep first spacing if it's pythonesque
  s = tok_deRoundOrCurlyBracket_keepFirstSpacing(s);
  s = withoutLeadingLinesEmptyAfterTrim(s);
  bool lineByLine = ai_isLineByLine(s);
  if (lineByLine) {
    LS l = tlftj(s);
    if (l(l) > 1) ret l;
  }

  // find logic rule
  LS l = tok_splitAtDoubleArrow(s);
  if (l(l) > 1) ret intersperse("=>", l);
  
  // split at &
  l = tok_splitAtAmpersand(s);
  if (l(l) > 1) ret intersperse("&", l);
  
  // split at =
  l = tok_splitAtEquals(s);
  if (l(l) > 1) ret intersperse("=", l);
  
  ret wordTokC(s);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025723
Snippet name: smartParser1_subParse
Eternal ID of this version: #1025723/3
Text MD5: 9ebd064a6141ee9ed2bbc9ffdc168eaa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-15 16:21:10
Source code size: 636 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 250 / 319
Version history: 2 change(s)
Referenced in: [show references]