Transpiled version (5726L) is out of date.
svoid tok_ifCast(L<S> tok) { int i; while ((i = jfind_check cast(tok, "if (<id> cast <id>")) >= 0) { int iEndOfType = indexOfAny(tok, i, ")", "&"); int iClosing = tok_endOfExpression(tok, i+4)+1; S var = tok.get(i+4), type = joinSubList(tok, i+8, iEndOfType-1); S rawType = tok_dropTypeParameters(type); int start = iClosing+2, end = tok_findEndOfStatement(tok, start); replaceTokens(tok, i+6, iEndOfType-1, "instanceof " + rawType); // replace "var" with "((Type) var)" in enclosed block // unless it's another cast expression or an assignment printVars(+iEndOfType, +iClosing, iClosing := get(tok, iClosing), +start, start := get(tok, start), +end, lTok := l(tok)); end = min(end, l(tok)); tok_insertCasts_noReTok(tok, iEndOfType, end, var, type); reTok(tok, i+6, end); } }
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1017552 |
Snippet name: | tok_ifCast |
Eternal ID of this version: | #1017552/24 |
Text MD5: | 854fc5e971da13ac0e8e062b8ecefb94 |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-02-21 16:49:20 |
Source code size: | 863 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 480 / 631 |
Version history: | 23 change(s) |
Referenced in: | [show references] |