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

19
LINES

< > BotCompany Repo | #1023741 - tok_replaceColonEqualsSyntax

JavaX fragment (include)

svoid tok_replaceColonEqualsSyntax(LS tok) {
  int i;
  
  // "field := value" for defining fields e.g. in "uniq"
  while ((i = jfind_check(":", tok, "<id> :=")) >= 0) {
    tok.set(i, quote(tok.get(i)));
    tok.set(i+2, ",");
    tok.set(i+4, "");
    reTok(tok, i, i+5);
  }
  
  // "quoted" := value
  while ((i = jfind_check(":", tok, "<quoted> :=")) >= 0) {
    tok.set(i, tok.get(i));
    tok.set(i+2, ",");
    tok.set(i+4, "");
    reTok(tok, i, i+5);
  }
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1023741
Snippet name: tok_replaceColonEqualsSyntax
Eternal ID of this version: #1023741/2
Text MD5: 812d8b2c9d85ffafac338e9a53946b83
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-10-01 18:06:24
Source code size: 484 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 23 / 37
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1023741 & http://1023741.tinybrain.de