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

12
LINES

< > BotCompany Repo | #1022735 - tok_unimplementedMethods

JavaX fragment (include)

// unimplemented S bla(); => S bla() { throw unimplemented(); }
svoid tok_unimplementedMethods(LS tok) {
  int i = -1;
  while ((i = jfind(tok, i+1, "unimplemented")) >= 0) {
    S t = get(tok, i+2);
    continue unless isIdentifier(t) || eq(t, "<");
    int j = tok_findEndOfStatement(tok, i); // abuse da function
    replaceTokens(tok, i, i+2, "");
    tokReplace(tok, j-1, " { throw unimplemented(); }");
    reTok(tok, i, j);
  }
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1022735
Snippet name: tok_unimplementedMethods
Eternal ID of this version: #1022735/3
Text MD5: 149868bc225c87221585d309b7aeb771
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-03 19:40:31
Source code size: 447 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 44 / 58
Version history: 2 change(s)
Referenced in: [show references]

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