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

12
LINES

< > BotCompany Repo | #1003852 - tok_addReturn - convert expression to return statement; leave code alone

JavaX fragment (include)

// optionally convert expression to return statement
static S tok_addReturn(L<S> tok) {
  if (tok_shouldAddReturn(tok)) {
    tokPrepend(tok, 1, "ret ");
    tokAppend(tok, l(tok)-2, ";");
  }
  ret join(tok);
}

static S tok_addReturn(S s) {
  ret tok_addReturn(javaTok(s));
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1003852
Snippet name: tok_addReturn - convert expression to return statement; leave code alone
Eternal ID of this version: #1003852/4
Text MD5: e3e7bb870bd554fcd67677a9e70878d9
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-06 21:46:42
Source code size: 288 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 377 / 889
Version history: 3 change(s)
Referenced in: [show references]

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