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

16
LINES

< > BotCompany Repo | #1025963 // ai_angleBracketVarsToFreshVarConditions

JavaX fragment (include)

/* e.g. "he is called <a name>" =>

  he is called $1
    & $1 is (a name)

*/
sS ai_angleBracketVarsToFreshVarConditions(S s) {
  LS tok = javaTokWithAngleBrackets(s);
  new LS out;
  for (int i : indicesOfAngleBracketVars(tok)) {
    S var = makeDollarVar();
    out.add(var + " is " + roundOpt(deAngleBracket(tok.get(i))));
    tok.set(i, var);
  }
  ret joinWithIndentedAmpersand(itemPlusList(join(tok), out));
}

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: #1025963
Snippet name: ai_angleBracketVarsToFreshVarConditions
Eternal ID of this version: #1025963/1
Text MD5: 96fbcca8c7b4ddda6f3e1d153c8389ef
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-02 15:19:34
Source code size: 431 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 142 / 180
Referenced in: [show references]