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

11
LINES

< > BotCompany Repo | #1021870 - tok_autoLongConstants

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (1772L) is out of date.

static LS tok_autoLongConstants(LS tok) {
  int n = l(tok);
  for (int i = 1 ; i < n; i += 2) {
    S t = tok.get(i);
    if (isInteger(t) && !eq(get(tok, i+2), "L")
      && !eqOneOf(get(tok, i-2), /*"-",*/ /* huh? */ "." /* float/double */)
      && !longIsInt(parseLong(t)))
      tokAppend(tok, i, "L");
  }
  ret tok;
}

download  show line numbers  debug dex   

Travelled to 4 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1021870
Snippet name: tok_autoLongConstants
Eternal ID of this version: #1021870/6
Text MD5: 1be0d75c4fe6b756da789f48cb7ef38b
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-03 17:50:17
Source code size: 334 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 102 / 116
Version history: 5 change(s)
Referenced in: [show references]

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