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

25
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+2, ",");
    tok.set(i+4, "");
    reTok(tok, i, i+5);
  }
  
  // <int> := value
  while ((i = jfind_check(":", tok, "<int> :=")) >= 0) {
    tok.set(i+2, ",");
    tok.set(i+4, "");
    reTok(tok, i, i+5);
  }
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): mqqgnosmbjvj, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1023741
Snippet name: tok_replaceColonEqualsSyntax
Eternal ID of this version: #1023741/3
Text MD5: 98e6438958dcae4614d83133779da99a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-03 17:45:16
Source code size: 615 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 45 / 63
Version history: 2 change(s)
Referenced in: [show references]

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