Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1012773 // ai_matchPattern - matches any pattern against any input - digs up the right standard function & calls it

JavaX fragment (include)

static Matches ai_matchPattern(S pat, S input) {
  pat = quoteUnlessQuoted(pat);
  S function = ai_forward(pat, "can be matched with");
  function = "get" + firstToUpper(function);
  if (!has_verified(function, "is", "a safe function to call")) fail("no mama: " + function);
  ret (Matches) quickImport(callAndMake(function, unquote(pat), input));
}

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: 327 / 370
Version history: 2 change(s)
Referenced in: [show references]