Download Jar. Libraryless. Click here for Pure Java version (6162L/42K).
1 | !7 |
2 | |
3 | p { |
4 | autoRestart(); |
5 | new L<S> vars; |
6 | S pat = print(dollarVarsToStars("a $adjective1 $noun1", vars)); |
7 | print("Vars: " + sfu(vars)); |
8 | new Matches m; |
9 | assertTrue(match(pat, "a funny game", m)); |
10 | new SS map; |
11 | for (int i = 0; i < l(m.m); i++) |
12 | map.put(vars.get(i), m.get(i)); |
13 | pnl(map); |
14 | |
15 | print(" => " + formatDollarVars("a $noun1", map)); |
16 | |
17 | assertNull(matchDollarVars("a $x $x", "a funny game")); |
18 | assertNotNull(matchDollarVars("a $x $y", "a funny game")); |
19 | print("OK"); |
20 | } |
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: | #1010855 |
Snippet name: | Test matching with dollar vars [OK] |
Eternal ID of this version: | #1010855/12 |
Text MD5: | 959e0425c54105aef33c5f3b108c6b88 |
Transpilation MD5: | 05d9585e74b7831aa6922a9910f98cb8 |
Author: | stefan |
Category: | javax / parsing |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-11-26 13:15:23 |
Source code size: | 513 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 503 / 1132 |
Version history: | 11 change(s) |
Referenced in: | [show references] |