static IfThen nlLogic_parseRule(S s) { new IfThen rule; rule.originalText = s; L tok = javaTokPlusBrackets2(s); if (isSquareBracketed(get(tok, 1))) { L tokOptions = javaTokPlusBrackets2(deSquareBracket(get(tok, 1))); new Matches m; for (S option : tok_splitAtComma(tokOptions)) { if (startsWith_trim(option, "id: ", m)) rule.globalID = m.rest(); else rule.options = linkedHashSet_addWithAutoInit(rule.options, option); } tok = dropFirst(2, tok); } L l = splitAtDoubleArrow(tok); if (l(l) > 2 || l(l) == 0) null; rule.out = nlLogic_parseExpression(last(l)); rule.in = nlLogic_parseExpression(nextToLast(l)); if (rule.globalID == null) //rule.globalID = aGlobalID(); rule.globalID = textMD5ToGlobalID(str(rule)); ret rule; }