Libraryless. Click here for Pure Java version (2558L/16K).
1 | // add {} to a statement if it isn't a block already |
2 | // i = beginning of statement or block |
3 | svoid tok_statementToBlock(LS tok, int i) { |
4 | if (neqGet(tok, i, "{")) { |
5 | int iEnd = tok_findEndOfStatement(tok, i)-1; |
6 | tokAppend_reTok(tok, iEnd, " }"); |
7 | tokPrepend_reTok(tok, i, "{ "); |
8 | } |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1025433 |
Snippet name: | tok_statementToBlock |
Eternal ID of this version: | #1025433/3 |
Text MD5: | 2eab0a8134f8d54805d185f2652cfb37 |
Transpilation MD5: | 26b5cb8d2b4a76801a1f25e1cf649e84 |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-29 19:57:19 |
Source code size: | 301 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 289 / 440 |
Version history: | 2 change(s) |
Referenced in: | [show references] |