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]

Libraryless. Click here for Pure Java version (1772L/12K).

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 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1021870
Snippet name: tok_autoLongConstants
Eternal ID of this version: #1021870/4
Text MD5: 03e307d16fb6854e1738c06d1d20558d
Transpilation MD5: 25739590e86eccbb9b9729f933bdbdcd
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 18:02:59
Source code size: 330 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 74 / 84
Version history: 3 change(s)
Referenced in: [show references]

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