1 | static Matches ai_matchPattern(S pat, S input) {
|
2 | pat = quoteUnlessQuoted(pat); |
3 | S function = ai_forward(pat, "can be matched with"); |
4 | function = "get" + firstToUpper(function); |
5 | if (!has_verified(function, "is", "a safe function to call")) fail("no mama: " + function);
|
6 | ret (Matches) quickImport(callAndMake(function, unquote(pat), input)); |
7 | } |
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: | #1012773 |
| Snippet name: | ai_matchPattern - matches any pattern against any input - digs up the right standard function & calls it |
| Eternal ID of this version: | #1012773/3 |
| Text MD5: | 50dc78119112caa6008bb630a2515db4 |
| Author: | stefan |
| Category: | javax / parsing |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2017-12-13 02:13:09 |
| Source code size: | 355 bytes / 7 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 674 / 719 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |