Libraryless. Click here for Pure Java version (2779L/18K).
1 | // S s = opt cast ...; |
2 | static LS tok_equalsOptCast(LS tok) {
|
3 | if (!tok.contains("cast")) ret tok;
|
4 | int iVar = -1; |
5 | while ((iVar = jfind(tok, iVar+1, "<id> = opt cast")) >= 0) {
|
6 | int iTypeStart = tok_scanTypeBackwards(tok, iVar-2); |
7 | int iCast = iVar+6; |
8 | int j = scanToEndOfInitializer2(tok, iCast); |
9 | S type = joinSubList(tok, iTypeStart, iVar-1); |
10 | replaceTokens(tok, iCast-2, iCast+2, "optCast " + type + "(");
|
11 | tokPrepend(tok, j+1, ")"); |
12 | reTok(tok, iCast-2, j+2); |
13 | } |
14 | ret tok; |
15 | } |
Began life as a copy of #1021796
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1025434 |
| Snippet name: | tok_equalsOptCast |
| Eternal ID of this version: | #1025434/3 |
| Text MD5: | 3084b94ef9202813fb130890bd045a96 |
| Transpilation MD5: | 14e48fefcb6f9de85c31b8517fc0f2fe |
| Author: | stefan |
| Category: | javax / transpiling |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-09-29 00:07:02 |
| Source code size: | 519 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 515 / 664 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |