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

9
LINES

< > BotCompany Repo | #1030389 // tok_orCase - replace "orCase *" with "break; case *"

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

Libraryless. Click here for Pure Java version (3236L/21K).

svoid tok_orCase(LS tok) {
  jreplace_dyn(tok, "orCase",
    (_tok, cIdx) ->
      stringUnless(eqGet(tok, cIdx-2, "{"), "break; ") + "case",
    (_tok, nIdx) -> {
      S next = get(tok, nIdx+3);
      ret isIdentifier(next) || isInteger(next) || isQuoted(next);
    });
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030389
Snippet name: tok_orCase - replace "orCase *" with "break; case *"
Eternal ID of this version: #1030389/6
Text MD5: dd257d76b22f1fc282bfb4370c2c25a6
Transpilation MD5: 68c4e5dfb39d71e29c17c5fd4ecfb961
Author: stefan
Category: javax / transpiling
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-11 00:51:42
Source code size: 281 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 151 / 219
Version history: 5 change(s)
Referenced in: [show references]