1 | // i = first C token, j = last C token |
2 | static LS tok_addCurlyBracketsAroundPart(LS tok, int i, int j) { |
3 | if (i == 1 && j == l(tok)-2) ret tok; |
4 | S pre = get(tok, i-1), post = get(tok, j+1); |
5 | if (endsWith(pre, "{") && startsWith(post, "}")) |
6 | ret tok; |
7 | tokPrepend(tok, i, "{"); |
8 | tokAppend(tok, j, "}"); |
9 | ret tok; |
10 | } |
Began life as a copy of #1021553
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022271 |
Snippet name: | tok_addCurlyBracketsAroundPart - modifies tok |
Eternal ID of this version: | #1022271/5 |
Text MD5: | 913fe585ed996d927d25d83dd3b10c1d |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-12 13:47:12 |
Source code size: | 329 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 279 / 310 |
Version history: | 4 change(s) |
Referenced in: | [show references] |