Libraryless. Click here for Pure Java version (1253L/8K/28K).
1 | !752 |
2 | |
3 | static new MultiMap<S, S> m; |
4 | |
5 | p { |
6 | load("m"); |
7 | } |
8 | |
9 | answer { |
10 | L<S> tok = javaTok(s); |
11 | if (match3(javaTok("* = *"), tok, m)) { |
12 | main.m.put(toLower(m.unq(0)), toLower(m.unq(1))); |
13 | save("m"); |
14 | ret "ok"; |
15 | } |
16 | |
17 | |
18 | if (eq(get(tok, l(tok)-4), "=") && eq(get(tok, l(tok)-2), "?")) { |
19 | for (int i = 1; i < l(tok)-5; i += 2) { |
20 | S x = last(main.m.get(toLower(tok.get(i)))); |
21 | if (x != null) |
22 | tok.set(i, x); |
23 | } |
24 | ret join(tok.subList(0, l(tok)-5)); |
25 | } |
26 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1002023 |
Snippet name: | Translate Bot |
Eternal ID of this version: | #1002023/1 |
Text MD5: | 0168e6091c2d2a5279684ab1b2f1299e |
Transpilation MD5: | 07ee727cdbe6de718dbe828d9a374fb3 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-12-14 02:28:36 |
Source code size: | 504 bytes / 26 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 860 / 1574 |
Referenced in: | [show references] |