// s = e.g. "(what, give) + (mrnuke, mrnuke's, mr + (nuke, nuke's)) + (url, address)" static MMOPattern mmo_parsePattern(S s) { s = trim(tok_deRoundBracket(trim(s))); LS tok = javaTokWithBrackets(s); LS l = tok_splitAtComma(tok); if (l(l) > 1) ret new MMOPattern.Or(lambdaMap mmo_parsePattern(l)); l = tok_splitAtPlus(s); if (l(l) > 1) ret new MMOPattern.And(lambdaMap mmo_parsePattern(l)); if (startsWith(s, "!")) ret new MMOPattern.Not(mmo_parsePattern(dropFirst(s))); ret new MMOPattern.Phrase(unquote(s), isQuoted(s)); }