static ALQLLine agiBlue_parseQueryLine(S s) { LS tok = javaTokWithBrackets(s); // TODO: improve jmatch and use here if (eqGet(tok, 1, "return") && isIdentifier(get(tok, 3))) { LS l = tok_splitAtComma(subList(tok, 2)); if (l(l) == 1) ret ALQLReturn(first(l)); else ret ALQLReturnTuple(l); } T3S t = agiBlue_parseTriple(tok); if (t != null) ret ALQLTriple(t); if (lCodeTokens(tok) == 2 && eqGet(tok, 1, "lock")) { t = agiBlue_parseTriple(uncurly(tok.get(3))); if (t == null) fail("Bad lock statement: " + s); ret ALQLLockStatement(t); } if (lCodeTokens(tok) == 2 && eqGet(tok, 1, "page")) { S page = uncurly(tok.get(3)); S method = containsDollarVars(page) ? "flexMatchDollarVarsIC_first" : "eqic"; ret ALQLPage(page, method); } if (lCodeTokens(tok) == 3 && eqGet(tok, 1, "slice")) { S slice = unquote(tok.get(3)); S contents = uncurly(tok.get(5)); ret ALQLSlice(slice, agiBlue_parseQueryScript(print(+contents))); } fail("Can't parse ALQL line: " + s); }