1 | svoid tok_overridableFunctionDefs(LS tok, Set<S> overriableFunctions_out) { |
2 | int i; |
3 | while ((i = jfind(tok, "static overridable <id>")) >= 0) { |
4 | int bracket = indexOf(tok, "(", i); |
5 | int codeStart = indexOf(tok, "{", bracket); |
6 | S fName = assertIdentifier(tok.get(bracket-2)); |
7 | S type = joinSubList(tok, i+4, bracket-3); |
8 | S boxedType = tok_toNonPrimitiveTypes(type); |
9 | S args = joinWithComma(map tok_lastIdentifier(tok_parseArgsDeclList(subList(tok, i)))); |
10 | S castIt = eq(type, "Object") ? "" : "(\*type*/)"; |
11 | |
12 | replaceTokens(tok, i, bracket-1, "static Object _override_\*fName*/;\n" |
13 | + "static \*type*/ \*fName*/"); |
14 | |
15 | tokAppend(tok, codeStart, " if (_override_\*fName*/ != null) return \*castIt*/ callF(_override_\*fName*/, \*args*/);\n"); |
16 | reTok(tok, i, codeStart+1); |
17 | addToCollection(overriableFunctions_out, fName); |
18 | } |
19 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020928 |
Snippet name: | tok_overridableFunctionDefs |
Eternal ID of this version: | #1020928/11 |
Text MD5: | 90b073a517e07a52a0ce42da4a73924c |
Author: | stefan |
Category: | javax / transpiling |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-01-10 23:23:59 |
Source code size: | 883 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 374 / 447 |
Version history: | 10 change(s) |
Referenced in: | [show references] |