1 | static O safeInterpretedJavaEval(S s) { |
2 | ret safeInterpretedJavaEval(javaTok(s)); |
3 | } |
4 | |
5 | static O safeInterpretedJavaEval(L<S> tok) { |
6 | Pair<S, L<S>> p = tok_parseFunctionCall(tok); |
7 | if (p != null) |
8 | ret callAndMakeOrDirect_safe(p.a, map safeInterpretedJavaEval(p.b)); |
9 | if (lCodeTokens(tok) == 2 && eqGet(tok, 1, "#") && isIdentifier(get(tok, 3))) |
10 | ret ai_getVar("#" + get(tok, 3)); |
11 | if (lCodeTokens(tok) == 1) { |
12 | S t = get(tok, 1); |
13 | if (isQuoted(t)) ret unquote(t); |
14 | if (isInteger(t)) ret parseInt(t); |
15 | if (eq(t, "null")) ret null; |
16 | if (eq(t, "false")) ret false; |
17 | if (eq(t, "true")) ret true; |
18 | if (isIdentifier(t)) ret ai_getVar(t); |
19 | } |
20 | fail("Can't interpret: " + join(tok)); |
21 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1012910 |
Snippet name: | safeInterpretedJavaEval |
Eternal ID of this version: | #1012910/8 |
Text MD5: | 77b2a15cf712f849ef7e2abdcef7e005 |
Author: | stefan |
Category: | javax / eval |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-19 23:10:32 |
Source code size: | 727 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 396 / 432 |
Version history: | 7 change(s) |
Referenced in: | [show references] |