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

16
LINES

< > BotCompany Repo | #1025963 // ai_angleBracketVarsToFreshVarConditions

JavaX fragment (include)

1  
/* e.g. "he is called <a name>" =>
2  
3  
  he is called $1
4  
    & $1 is (a name)
5  
6  
*/
7  
sS ai_angleBracketVarsToFreshVarConditions(S s) {
8  
  LS tok = javaTokWithAngleBrackets(s);
9  
  new LS out;
10  
  for (int i : indicesOfAngleBracketVars(tok)) {
11  
    S var = makeDollarVar();
12  
    out.add(var + " is " + roundOpt(deAngleBracket(tok.get(i))));
13  
    tok.set(i, var);
14  
  }
15  
  ret joinWithIndentedAmpersand(itemPlusList(join(tok), out));
16  
}

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: 148 / 187
Referenced in: [show references]