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).

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

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: 230 / 317
Version history: 5 change(s)
Referenced in: [show references]