diff --git a/src/core/server/saved_objects/service/lib/filter_utils.test.ts b/src/core/server/saved_objects/service/lib/filter_utils.test.ts index 92012bf477b3e..b50326627cf09 100644 --- a/src/core/server/saved_objects/service/lib/filter_utils.test.ts +++ b/src/core/server/saved_objects/service/lib/filter_utils.test.ts @@ -215,35 +215,35 @@ describe('Filter Utils', () => { type: 'foo', }, { - astPath: 'arguments.1.arguments.0', + astPath: 'arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.0', + astPath: 'arguments.2', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.3', error: null, isSavedObjectAttr: false, key: 'foo.attributes.title', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.4.arguments.0', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.1', + astPath: 'arguments.4.arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', @@ -290,35 +290,35 @@ describe('Filter Utils', () => { type: null, }, { - astPath: 'arguments.1.arguments.0', + astPath: 'arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.0', + astPath: 'arguments.2', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.3', error: null, isSavedObjectAttr: false, key: 'foo.attributes.title', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.4.arguments.0', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.1', + astPath: 'arguments.4.arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', @@ -345,14 +345,14 @@ describe('Filter Utils', () => { type: 'foo', }, { - astPath: 'arguments.1.arguments.0', + astPath: 'arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.0', + astPath: 'arguments.2', error: "This key 'foo.bytes' does NOT match the filter proposition SavedObjectType.attributes.key", isSavedObjectAttr: false, @@ -360,21 +360,21 @@ describe('Filter Utils', () => { type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.3', error: null, isSavedObjectAttr: false, key: 'foo.attributes.title', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.4.arguments.0', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.1', + astPath: 'arguments.4.arguments.1', error: "This key 'foo.description' does NOT match the filter proposition SavedObjectType.attributes.key", isSavedObjectAttr: false, @@ -402,35 +402,35 @@ describe('Filter Utils', () => { type: 'bar', }, { - astPath: 'arguments.1.arguments.0', + astPath: 'arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.0', + astPath: 'arguments.2', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.3', error: null, isSavedObjectAttr: false, key: 'foo.attributes.title', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.4.arguments.0', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.1', + astPath: 'arguments.4.arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', @@ -457,21 +457,21 @@ describe('Filter Utils', () => { type: 'foo', }, { - astPath: 'arguments.1.arguments.0', + astPath: 'arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.0', + astPath: 'arguments.2', error: null, isSavedObjectAttr: false, key: 'foo.attributes.bytes', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.3', error: "This key 'foo.attributes.header' does NOT exist in foo saved object index patterns", isSavedObjectAttr: false, @@ -479,14 +479,14 @@ describe('Filter Utils', () => { type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.0', + astPath: 'arguments.4.arguments.0', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', type: 'foo', }, { - astPath: 'arguments.1.arguments.1.arguments.1.arguments.1.arguments.1', + astPath: 'arguments.4.arguments.1', error: null, isSavedObjectAttr: false, key: 'foo.attributes.description', diff --git a/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js b/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js index fc6b706f6e01e..e8c9c3b4e9cc3 100644 --- a/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js +++ b/src/plugins/data/common/es_query/kuery/ast/_generated_/kuery.js @@ -47,25 +47,28 @@ module.exports = (function() { return nodeTypes.function.buildNode('is', '*', '*'); }, peg$c1 = function() { return errorOnLuceneSyntax; }, - peg$c2 = function(left, right) { - const cursor = [left, right].find(node => node.type === 'cursor'); + peg$c2 = function(head, query) { return query; }, + peg$c3 = function(head, tail) { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) return cursor; - return buildFunctionNode('or', [left, right]); + return buildFunctionNode('or', nodes); }, - peg$c3 = function(left, right) { - const cursor = [left, right].find(node => node.type === 'cursor'); + peg$c4 = function(head, tail) { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) return cursor; - return buildFunctionNode('and', [left, right]); + return buildFunctionNode('and', nodes); }, - peg$c4 = function(query) { + peg$c5 = function(query) { if (query.type === 'cursor') return query; return buildFunctionNode('not', [query]); }, - peg$c5 = "(", - peg$c6 = { type: "literal", value: "(", description: "\"(\"" }, - peg$c7 = ")", - peg$c8 = { type: "literal", value: ")", description: "\")\"" }, - peg$c9 = function(query, trailing) { + peg$c6 = "(", + peg$c7 = { type: "literal", value: "(", description: "\"(\"" }, + peg$c8 = ")", + peg$c9 = { type: "literal", value: ")", description: "\")\"" }, + peg$c10 = function(query, trailing) { if (trailing.type === 'cursor') { return { ...trailing, @@ -74,13 +77,13 @@ module.exports = (function() { } return query; }, - peg$c10 = ":", - peg$c11 = { type: "literal", value: ":", description: "\":\"" }, - peg$c12 = "{", - peg$c13 = { type: "literal", value: "{", description: "\"{\"" }, - peg$c14 = "}", - peg$c15 = { type: "literal", value: "}", description: "\"}\"" }, - peg$c16 = function(field, query, trailing) { + peg$c11 = ":", + peg$c12 = { type: "literal", value: ":", description: "\":\"" }, + peg$c13 = "{", + peg$c14 = { type: "literal", value: "{", description: "\"{\"" }, + peg$c15 = "}", + peg$c16 = { type: "literal", value: "}", description: "\"}\"" }, + peg$c17 = function(field, query, trailing) { if (query.type === 'cursor') { return { ...query, @@ -96,8 +99,8 @@ module.exports = (function() { } return buildFunctionNode('nested', [field, query]); }, - peg$c17 = { type: "other", description: "fieldName" }, - peg$c18 = function(field, operator, value) { + peg$c18 = { type: "other", description: "fieldName" }, + peg$c19 = function(field, operator, value) { if (value.type === 'cursor') { return { ...value, @@ -107,7 +110,7 @@ module.exports = (function() { const range = buildNamedArgNode(operator, value); return buildFunctionNode('range', [field, range]); }, - peg$c19 = function(field, partial) { + peg$c20 = function(field, partial) { if (partial.type === 'cursor') { return { ...partial, @@ -117,7 +120,7 @@ module.exports = (function() { } return partial(field); }, - peg$c20 = function(partial) { + peg$c21 = function(partial) { if (partial.type === 'cursor') { const fieldName = `${partial.prefix}${partial.suffix}`.trim(); return { @@ -129,7 +132,7 @@ module.exports = (function() { const field = buildLiteralNode(null); return partial(field); }, - peg$c21 = function(partial, trailing) { + peg$c22 = function(partial, trailing) { if (trailing.type === 'cursor') { return { ...trailing, @@ -138,27 +141,30 @@ module.exports = (function() { } return partial; }, - peg$c22 = function(partialLeft, partialRight) { - const cursor = [partialLeft, partialRight].find(node => node.type === 'cursor'); + peg$c23 = function(head, partial) { return partial; }, + peg$c24 = function(head, tail) { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) { return { ...cursor, suggestionTypes: ['value'] }; } - return (field) => buildFunctionNode('or', [partialLeft(field), partialRight(field)]); + return (field) => buildFunctionNode('or', nodes.map(partial => partial(field))); }, - peg$c23 = function(partialLeft, partialRight) { - const cursor = [partialLeft, partialRight].find(node => node.type === 'cursor'); + peg$c25 = function(head, tail) { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) { return { ...cursor, suggestionTypes: ['value'] }; } - return (field) => buildFunctionNode('and', [partialLeft(field), partialRight(field)]); + return (field) => buildFunctionNode('and', nodes.map(partial => partial(field))); }, - peg$c24 = function(partial) { + peg$c26 = function(partial) { if (partial.type === 'cursor') { return { ...list, @@ -167,13 +173,13 @@ module.exports = (function() { } return (field) => buildFunctionNode('not', [partial(field)]); }, - peg$c25 = { type: "other", description: "value" }, - peg$c26 = function(value) { + peg$c27 = { type: "other", description: "value" }, + peg$c28 = function(value) { if (value.type === 'cursor') return value; const isPhrase = buildLiteralNode(true); return (field) => buildFunctionNode('is', [field, value, isPhrase]); }, - peg$c27 = function(value) { + peg$c29 = function(value) { if (value.type === 'cursor') return value; if (!allowLeadingWildcards && value.type === 'wildcard' && nodeTypes.wildcard.hasLeadingWildcard(value)) { @@ -183,19 +189,19 @@ module.exports = (function() { const isPhrase = buildLiteralNode(false); return (field) => buildFunctionNode('is', [field, value, isPhrase]); }, - peg$c28 = { type: "other", description: "OR" }, - peg$c29 = "or", - peg$c30 = { type: "literal", value: "or", description: "\"or\"" }, - peg$c31 = { type: "other", description: "AND" }, - peg$c32 = "and", - peg$c33 = { type: "literal", value: "and", description: "\"and\"" }, - peg$c34 = { type: "other", description: "NOT" }, - peg$c35 = "not", - peg$c36 = { type: "literal", value: "not", description: "\"not\"" }, - peg$c37 = { type: "other", description: "literal" }, - peg$c38 = "\"", - peg$c39 = { type: "literal", value: "\"", description: "\"\\\"\"" }, - peg$c40 = function(prefix, cursor, suffix) { + peg$c30 = { type: "other", description: "OR" }, + peg$c31 = "or", + peg$c32 = { type: "literal", value: "or", description: "\"or\"" }, + peg$c33 = { type: "other", description: "AND" }, + peg$c34 = "and", + peg$c35 = { type: "literal", value: "and", description: "\"and\"" }, + peg$c36 = { type: "other", description: "NOT" }, + peg$c37 = "not", + peg$c38 = { type: "literal", value: "not", description: "\"not\"" }, + peg$c39 = { type: "other", description: "literal" }, + peg$c40 = "\"", + peg$c41 = { type: "literal", value: "\"", description: "\"\\\"\"" }, + peg$c42 = function(prefix, cursor, suffix) { const { start, end } = location(); return { type: 'cursor', @@ -206,17 +212,17 @@ module.exports = (function() { text: text().replace(cursor, '') }; }, - peg$c41 = function(chars) { + peg$c43 = function(chars) { return buildLiteralNode(chars.join('')); }, - peg$c42 = "\\", - peg$c43 = { type: "literal", value: "\\", description: "\"\\\\\"" }, - peg$c44 = /^[\\"]/, - peg$c45 = { type: "class", value: "[\\\\\"]", description: "[\\\\\"]" }, - peg$c46 = function(char) { return char; }, - peg$c47 = /^[^"]/, - peg$c48 = { type: "class", value: "[^\"]", description: "[^\"]" }, - peg$c49 = function(chars) { + peg$c44 = "\\", + peg$c45 = { type: "literal", value: "\\", description: "\"\\\\\"" }, + peg$c46 = /^[\\"]/, + peg$c47 = { type: "class", value: "[\\\\\"]", description: "[\\\\\"]" }, + peg$c48 = function(char) { return char; }, + peg$c49 = /^[^"]/, + peg$c50 = { type: "class", value: "[^\"]", description: "[^\"]" }, + peg$c51 = function(chars) { const sequence = chars.join('').trim(); if (sequence === 'null') return buildLiteralNode(null); if (sequence === 'true') return buildLiteralNode(true); @@ -225,104 +231,104 @@ module.exports = (function() { const isNumberPattern = /^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/ return buildLiteralNode(isNumberPattern.test(sequence) ? Number(sequence) : sequence); }, - peg$c50 = { type: "any", description: "any character" }, - peg$c51 = "*", - peg$c52 = { type: "literal", value: "*", description: "\"*\"" }, - peg$c53 = function() { return wildcardSymbol; }, - peg$c54 = "\\t", - peg$c55 = { type: "literal", value: "\\t", description: "\"\\\\t\"" }, - peg$c56 = function() { return '\t'; }, - peg$c57 = "\\r", - peg$c58 = { type: "literal", value: "\\r", description: "\"\\\\r\"" }, - peg$c59 = function() { return '\r'; }, - peg$c60 = "\\n", - peg$c61 = { type: "literal", value: "\\n", description: "\"\\\\n\"" }, - peg$c62 = function() { return '\n'; }, - peg$c63 = function(keyword) { return keyword; }, - peg$c64 = /^[\\():<>"*{}]/, - peg$c65 = { type: "class", value: "[\\\\():<>\"*{}]", description: "[\\\\():<>\"*{}]" }, - peg$c66 = "<=", - peg$c67 = { type: "literal", value: "<=", description: "\"<=\"" }, - peg$c68 = function() { return 'lte'; }, - peg$c69 = ">=", - peg$c70 = { type: "literal", value: ">=", description: "\">=\"" }, - peg$c71 = function() { return 'gte'; }, - peg$c72 = "<", - peg$c73 = { type: "literal", value: "<", description: "\"<\"" }, - peg$c74 = function() { return 'lt'; }, - peg$c75 = ">", - peg$c76 = { type: "literal", value: ">", description: "\">\"" }, - peg$c77 = function() { return 'gt'; }, - peg$c78 = { type: "other", description: "whitespace" }, - peg$c79 = /^[ \t\r\n]/, - peg$c80 = { type: "class", value: "[\\ \\t\\r\\n]", description: "[\\ \\t\\r\\n]" }, - peg$c81 = function() { return parseCursor; }, - peg$c82 = "@kuery-cursor@", - peg$c83 = { type: "literal", value: "@kuery-cursor@", description: "\"@kuery-cursor@\"" }, - peg$c84 = function() { return cursorSymbol; }, - peg$c85 = "||", - peg$c86 = { type: "literal", value: "||", description: "\"||\"" }, - peg$c87 = function() { + peg$c52 = { type: "any", description: "any character" }, + peg$c53 = "*", + peg$c54 = { type: "literal", value: "*", description: "\"*\"" }, + peg$c55 = function() { return wildcardSymbol; }, + peg$c56 = "\\t", + peg$c57 = { type: "literal", value: "\\t", description: "\"\\\\t\"" }, + peg$c58 = function() { return '\t'; }, + peg$c59 = "\\r", + peg$c60 = { type: "literal", value: "\\r", description: "\"\\\\r\"" }, + peg$c61 = function() { return '\r'; }, + peg$c62 = "\\n", + peg$c63 = { type: "literal", value: "\\n", description: "\"\\\\n\"" }, + peg$c64 = function() { return '\n'; }, + peg$c65 = function(keyword) { return keyword; }, + peg$c66 = /^[\\():<>"*{}]/, + peg$c67 = { type: "class", value: "[\\\\():<>\"*{}]", description: "[\\\\():<>\"*{}]" }, + peg$c68 = "<=", + peg$c69 = { type: "literal", value: "<=", description: "\"<=\"" }, + peg$c70 = function() { return 'lte'; }, + peg$c71 = ">=", + peg$c72 = { type: "literal", value: ">=", description: "\">=\"" }, + peg$c73 = function() { return 'gte'; }, + peg$c74 = "<", + peg$c75 = { type: "literal", value: "<", description: "\"<\"" }, + peg$c76 = function() { return 'lt'; }, + peg$c77 = ">", + peg$c78 = { type: "literal", value: ">", description: "\">\"" }, + peg$c79 = function() { return 'gt'; }, + peg$c80 = { type: "other", description: "whitespace" }, + peg$c81 = /^[ \t\r\n]/, + peg$c82 = { type: "class", value: "[\\ \\t\\r\\n]", description: "[\\ \\t\\r\\n]" }, + peg$c83 = function() { return parseCursor; }, + peg$c84 = "@kuery-cursor@", + peg$c85 = { type: "literal", value: "@kuery-cursor@", description: "\"@kuery-cursor@\"" }, + peg$c86 = function() { return cursorSymbol; }, + peg$c87 = "||", + peg$c88 = { type: "literal", value: "||", description: "\"||\"" }, + peg$c89 = function() { error('LuceneOr'); }, - peg$c88 = "&&", - peg$c89 = { type: "literal", value: "&&", description: "\"&&\"" }, - peg$c90 = function() { + peg$c90 = "&&", + peg$c91 = { type: "literal", value: "&&", description: "\"&&\"" }, + peg$c92 = function() { error('LuceneAnd'); }, - peg$c91 = "+", - peg$c92 = { type: "literal", value: "+", description: "\"+\"" }, - peg$c93 = "-", - peg$c94 = { type: "literal", value: "-", description: "\"-\"" }, - peg$c95 = function() { + peg$c93 = "+", + peg$c94 = { type: "literal", value: "+", description: "\"+\"" }, + peg$c95 = "-", + peg$c96 = { type: "literal", value: "-", description: "\"-\"" }, + peg$c97 = function() { error('LuceneNot'); }, - peg$c96 = "!", - peg$c97 = { type: "literal", value: "!", description: "\"!\"" }, - peg$c98 = "_exists_", - peg$c99 = { type: "literal", value: "_exists_", description: "\"_exists_\"" }, - peg$c100 = function() { + peg$c98 = "!", + peg$c99 = { type: "literal", value: "!", description: "\"!\"" }, + peg$c100 = "_exists_", + peg$c101 = { type: "literal", value: "_exists_", description: "\"_exists_\"" }, + peg$c102 = function() { error('LuceneExists'); }, - peg$c101 = function() { + peg$c103 = function() { error('LuceneRange'); }, - peg$c102 = "?", - peg$c103 = { type: "literal", value: "?", description: "\"?\"" }, - peg$c104 = function() { + peg$c104 = "?", + peg$c105 = { type: "literal", value: "?", description: "\"?\"" }, + peg$c106 = function() { error('LuceneWildcard'); }, - peg$c105 = "/", - peg$c106 = { type: "literal", value: "/", description: "\"/\"" }, - peg$c107 = /^[^\/]/, - peg$c108 = { type: "class", value: "[^/]", description: "[^/]" }, - peg$c109 = function() { + peg$c107 = "/", + peg$c108 = { type: "literal", value: "/", description: "\"/\"" }, + peg$c109 = /^[^\/]/, + peg$c110 = { type: "class", value: "[^/]", description: "[^/]" }, + peg$c111 = function() { error('LuceneRegex'); }, - peg$c110 = "~", - peg$c111 = { type: "literal", value: "~", description: "\"~\"" }, - peg$c112 = /^[0-9]/, - peg$c113 = { type: "class", value: "[0-9]", description: "[0-9]" }, - peg$c114 = function() { + peg$c112 = "~", + peg$c113 = { type: "literal", value: "~", description: "\"~\"" }, + peg$c114 = /^[0-9]/, + peg$c115 = { type: "class", value: "[0-9]", description: "[0-9]" }, + peg$c116 = function() { error('LuceneFuzzy'); }, - peg$c115 = function() { + peg$c117 = function() { error('LuceneProximity'); }, - peg$c116 = "^", - peg$c117 = { type: "literal", value: "^", description: "\"^\"" }, - peg$c118 = function() { + peg$c118 = "^", + peg$c119 = { type: "literal", value: "^", description: "\"^\"" }, + peg$c120 = function() { error('LuceneBoost'); }, - peg$c119 = function() { return char; }, - peg$c120 = "=", - peg$c121 = { type: "literal", value: "=", description: "\"=\"" }, - peg$c122 = "[", - peg$c123 = { type: "literal", value: "[", description: "\"[\"" }, - peg$c124 = "]", - peg$c125 = { type: "literal", value: "]", description: "\"]\"" }, - peg$c126 = "TO", - peg$c127 = { type: "literal", value: "TO", description: "\"TO\"" }, + peg$c121 = function() { return char; }, + peg$c122 = "=", + peg$c123 = { type: "literal", value: "=", description: "\"=\"" }, + peg$c124 = "[", + peg$c125 = { type: "literal", value: "[", description: "\"[\"" }, + peg$c126 = "]", + peg$c127 = { type: "literal", value: "]", description: "\"]\"" }, + peg$c128 = "TO", + peg$c129 = { type: "literal", value: "TO", description: "\"TO\"" }, peg$currPos = 0, peg$savedPos = 0, @@ -547,7 +553,7 @@ module.exports = (function() { } function peg$parseOrQuery() { - var s0, s1, s2, s3; + var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; peg$savedPos = peg$currPos; @@ -574,17 +580,50 @@ module.exports = (function() { s0 = peg$currPos; s1 = peg$parseAndQuery(); if (s1 !== peg$FAILED) { - s2 = peg$parseOr(); - if (s2 !== peg$FAILED) { - s3 = peg$parseOrQuery(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c2(s1, s3); - s0 = s1; + s2 = []; + s3 = peg$currPos; + s4 = peg$parseOr(); + if (s4 !== peg$FAILED) { + s5 = peg$parseAndQuery(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c2(s1, s5); + s3 = s4; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseOr(); + if (s4 !== peg$FAILED) { + s5 = peg$parseAndQuery(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c2(s1, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c3(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -602,22 +641,55 @@ module.exports = (function() { } function peg$parseAndQuery() { - var s0, s1, s2, s3; + var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseNotQuery(); if (s1 !== peg$FAILED) { - s2 = peg$parseAnd(); - if (s2 !== peg$FAILED) { - s3 = peg$parseAndQuery(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c3(s1, s3); - s0 = s1; + s2 = []; + s3 = peg$currPos; + s4 = peg$parseAnd(); + if (s4 !== peg$FAILED) { + s5 = peg$parseNotQuery(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c2(s1, s5); + s3 = s4; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseAnd(); + if (s4 !== peg$FAILED) { + s5 = peg$parseNotQuery(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c2(s1, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c4(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -642,7 +714,7 @@ module.exports = (function() { s2 = peg$parseSubQuery(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c4(s2); + s1 = peg$c5(s2); s0 = s1; } else { peg$currPos = s0; @@ -664,11 +736,11 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c5; + s1 = peg$c6; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } + if (peg$silentFails === 0) { peg$fail(peg$c7); } } if (s1 !== peg$FAILED) { s2 = []; @@ -683,15 +755,15 @@ module.exports = (function() { s4 = peg$parseOptionalSpace(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c7; + s5 = peg$c8; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } + if (peg$silentFails === 0) { peg$fail(peg$c9); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c9(s3, s4); + s1 = peg$c10(s3, s4); s0 = s1; } else { peg$currPos = s0; @@ -734,11 +806,11 @@ module.exports = (function() { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s3 = peg$c10; + s3 = peg$c11; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } + if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s3 !== peg$FAILED) { s4 = []; @@ -749,11 +821,11 @@ module.exports = (function() { } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { - s5 = peg$c12; + s5 = peg$c13; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } + if (peg$silentFails === 0) { peg$fail(peg$c14); } } if (s5 !== peg$FAILED) { s6 = []; @@ -768,15 +840,15 @@ module.exports = (function() { s8 = peg$parseOptionalSpace(); if (s8 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { - s9 = peg$c14; + s9 = peg$c15; peg$currPos++; } else { s9 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c15); } + if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s9 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c16(s1, s7, s8); + s1 = peg$c17(s1, s7, s8); s0 = s1; } else { peg$currPos = s0; @@ -843,7 +915,7 @@ module.exports = (function() { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c17); } + if (peg$silentFails === 0) { peg$fail(peg$c18); } } return s0; @@ -874,7 +946,7 @@ module.exports = (function() { s5 = peg$parseLiteral(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c18(s1, s3, s5); + s1 = peg$c19(s1, s3, s5); s0 = s1; } else { peg$currPos = s0; @@ -914,11 +986,11 @@ module.exports = (function() { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s3 = peg$c10; + s3 = peg$c11; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } + if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s3 !== peg$FAILED) { s4 = []; @@ -931,7 +1003,7 @@ module.exports = (function() { s5 = peg$parseListOfValues(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c19(s1, s5); + s1 = peg$c20(s1, s5); s0 = s1; } else { peg$currPos = s0; @@ -964,7 +1036,7 @@ module.exports = (function() { s1 = peg$parseValue(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c20(s1); + s1 = peg$c21(s1); } s0 = s1; @@ -976,11 +1048,11 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 40) { - s1 = peg$c5; + s1 = peg$c6; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } + if (peg$silentFails === 0) { peg$fail(peg$c7); } } if (s1 !== peg$FAILED) { s2 = []; @@ -995,15 +1067,15 @@ module.exports = (function() { s4 = peg$parseOptionalSpace(); if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s5 = peg$c7; + s5 = peg$c8; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } + if (peg$silentFails === 0) { peg$fail(peg$c9); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c21(s3, s4); + s1 = peg$c22(s3, s4); s0 = s1; } else { peg$currPos = s0; @@ -1033,22 +1105,55 @@ module.exports = (function() { } function peg$parseOrListOfValues() { - var s0, s1, s2, s3; + var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseAndListOfValues(); if (s1 !== peg$FAILED) { - s2 = peg$parseOr(); - if (s2 !== peg$FAILED) { - s3 = peg$parseOrListOfValues(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c22(s1, s3); - s0 = s1; + s2 = []; + s3 = peg$currPos; + s4 = peg$parseOr(); + if (s4 !== peg$FAILED) { + s5 = peg$parseAndListOfValues(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c23(s1, s5); + s3 = s4; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseOr(); + if (s4 !== peg$FAILED) { + s5 = peg$parseAndListOfValues(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c23(s1, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c24(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1065,22 +1170,55 @@ module.exports = (function() { } function peg$parseAndListOfValues() { - var s0, s1, s2, s3; + var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = peg$parseNotListOfValues(); if (s1 !== peg$FAILED) { - s2 = peg$parseAnd(); - if (s2 !== peg$FAILED) { - s3 = peg$parseAndListOfValues(); - if (s3 !== peg$FAILED) { - peg$savedPos = s0; - s1 = peg$c23(s1, s3); - s0 = s1; + s2 = []; + s3 = peg$currPos; + s4 = peg$parseAnd(); + if (s4 !== peg$FAILED) { + s5 = peg$parseNotListOfValues(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c23(s1, s5); + s3 = s4; } else { - peg$currPos = s0; - s0 = peg$FAILED; + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseAnd(); + if (s4 !== peg$FAILED) { + s5 = peg$parseNotListOfValues(); + if (s5 !== peg$FAILED) { + peg$savedPos = s3; + s4 = peg$c23(s1, s5); + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } } + } else { + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c25(s1, s2); + s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; @@ -1105,7 +1243,7 @@ module.exports = (function() { s2 = peg$parseListOfValues(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c24(s2); + s1 = peg$c26(s2); s0 = s1; } else { peg$currPos = s0; @@ -1130,7 +1268,7 @@ module.exports = (function() { s1 = peg$parseQuotedString(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c26(s1); + s1 = peg$c28(s1); } s0 = s1; if (s0 === peg$FAILED) { @@ -1138,14 +1276,14 @@ module.exports = (function() { s1 = peg$parseUnquotedLiteral(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c27(s1); + s1 = peg$c29(s1); } s0 = s1; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c25); } + if (peg$silentFails === 0) { peg$fail(peg$c27); } } return s0; @@ -1167,12 +1305,12 @@ module.exports = (function() { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c29) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c31) { s2 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c30); } + if (peg$silentFails === 0) { peg$fail(peg$c32); } } if (s2 !== peg$FAILED) { s3 = []; @@ -1226,7 +1364,7 @@ module.exports = (function() { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c28); } + if (peg$silentFails === 0) { peg$fail(peg$c30); } } return s0; @@ -1248,12 +1386,12 @@ module.exports = (function() { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c32) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c34) { s2 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c33); } + if (peg$silentFails === 0) { peg$fail(peg$c35); } } if (s2 !== peg$FAILED) { s3 = []; @@ -1307,7 +1445,7 @@ module.exports = (function() { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c31); } + if (peg$silentFails === 0) { peg$fail(peg$c33); } } return s0; @@ -1318,12 +1456,12 @@ module.exports = (function() { peg$silentFails++; s0 = peg$currPos; - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c35) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c37) { s1 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } + if (peg$silentFails === 0) { peg$fail(peg$c38); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1373,7 +1511,7 @@ module.exports = (function() { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c34); } + if (peg$silentFails === 0) { peg$fail(peg$c36); } } return s0; @@ -1390,7 +1528,7 @@ module.exports = (function() { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c37); } + if (peg$silentFails === 0) { peg$fail(peg$c39); } } return s0; @@ -1401,11 +1539,11 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c38; + s1 = peg$c40; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } + if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1425,15 +1563,15 @@ module.exports = (function() { } if (s4 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s5 = peg$c38; + s5 = peg$c40; peg$currPos++; } else { s5 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } + if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c40(s2, s3, s4); + s1 = peg$c42(s2, s3, s4); s0 = s1; } else { peg$currPos = s0; @@ -1458,11 +1596,11 @@ module.exports = (function() { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 34) { - s1 = peg$c38; + s1 = peg$c40; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } + if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s1 !== peg$FAILED) { s2 = []; @@ -1473,15 +1611,15 @@ module.exports = (function() { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s3 = peg$c38; + s3 = peg$c40; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } + if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c41(s2); + s1 = peg$c43(s2); s0 = s1; } else { peg$currPos = s0; @@ -1507,23 +1645,23 @@ module.exports = (function() { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c42; + s1 = peg$c44; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 !== peg$FAILED) { - if (peg$c44.test(input.charAt(peg$currPos))) { + if (peg$c46.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c45); } + if (peg$silentFails === 0) { peg$fail(peg$c47); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c46(s2); + s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; @@ -1546,16 +1684,16 @@ module.exports = (function() { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - if (peg$c47.test(input.charAt(peg$currPos))) { + if (peg$c49.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c48); } + if (peg$silentFails === 0) { peg$fail(peg$c50); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c46(s2); + s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; @@ -1592,7 +1730,7 @@ module.exports = (function() { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c40(s1, s2, s3); + s1 = peg$c42(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -1620,7 +1758,7 @@ module.exports = (function() { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c49(s1); + s1 = peg$c51(s1); } s0 = s1; } @@ -1678,11 +1816,11 @@ module.exports = (function() { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c50); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s4 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c46(s4); + s1 = peg$c48(s4); s0 = s1; } else { peg$currPos = s0; @@ -1713,15 +1851,15 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 42) { - s1 = peg$c51; + s1 = peg$c53; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c53(); + s1 = peg$c55(); } s0 = s1; @@ -1749,7 +1887,7 @@ module.exports = (function() { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c40(s1, s2, s3); + s1 = peg$c42(s1, s2, s3); s0 = s1; } else { peg$currPos = s0; @@ -1779,44 +1917,44 @@ module.exports = (function() { var s0, s1; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c54) { - s1 = peg$c54; + if (input.substr(peg$currPos, 2) === peg$c56) { + s1 = peg$c56; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c55); } + if (peg$silentFails === 0) { peg$fail(peg$c57); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c56(); + s1 = peg$c58(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c57) { - s1 = peg$c57; + if (input.substr(peg$currPos, 2) === peg$c59) { + s1 = peg$c59; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c58); } + if (peg$silentFails === 0) { peg$fail(peg$c60); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c59(); + s1 = peg$c61(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c60) { - s1 = peg$c60; + if (input.substr(peg$currPos, 2) === peg$c62) { + s1 = peg$c62; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c61); } + if (peg$silentFails === 0) { peg$fail(peg$c63); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c62(); + s1 = peg$c64(); } s0 = s1; } @@ -1830,17 +1968,17 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c42; + s1 = peg$c44; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 !== peg$FAILED) { s2 = peg$parseSpecialCharacter(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c46(s2); + s1 = peg$c48(s2); s0 = s1; } else { peg$currPos = s0; @@ -1859,41 +1997,41 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c42; + s1 = peg$c44; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2).toLowerCase() === peg$c29) { + if (input.substr(peg$currPos, 2).toLowerCase() === peg$c31) { s2 = input.substr(peg$currPos, 2); peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c30); } + if (peg$silentFails === 0) { peg$fail(peg$c32); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c32) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c34) { s2 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c33); } + if (peg$silentFails === 0) { peg$fail(peg$c35); } } if (s2 === peg$FAILED) { - if (input.substr(peg$currPos, 3).toLowerCase() === peg$c35) { + if (input.substr(peg$currPos, 3).toLowerCase() === peg$c37) { s2 = input.substr(peg$currPos, 3); peg$currPos += 3; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c36); } + if (peg$silentFails === 0) { peg$fail(peg$c38); } } } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c63(s2); + s1 = peg$c65(s2); s0 = s1; } else { peg$currPos = s0; @@ -1924,12 +2062,12 @@ module.exports = (function() { function peg$parseSpecialCharacter() { var s0; - if (peg$c64.test(input.charAt(peg$currPos))) { + if (peg$c66.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c65); } + if (peg$silentFails === 0) { peg$fail(peg$c67); } } return s0; @@ -1939,58 +2077,58 @@ module.exports = (function() { var s0, s1; s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c66) { - s1 = peg$c66; + if (input.substr(peg$currPos, 2) === peg$c68) { + s1 = peg$c68; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c67); } + if (peg$silentFails === 0) { peg$fail(peg$c69); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c68(); + s1 = peg$c70(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c69) { - s1 = peg$c69; + if (input.substr(peg$currPos, 2) === peg$c71) { + s1 = peg$c71; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c70); } + if (peg$silentFails === 0) { peg$fail(peg$c72); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c71(); + s1 = peg$c73(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c72; + s1 = peg$c74; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c75); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c74(); + s1 = peg$c76(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c75; + s1 = peg$c77; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c78); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c77(); + s1 = peg$c79(); } s0 = s1; } @@ -2004,17 +2142,17 @@ module.exports = (function() { var s0, s1; peg$silentFails++; - if (peg$c79.test(input.charAt(peg$currPos))) { + if (peg$c81.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c80); } + if (peg$silentFails === 0) { peg$fail(peg$c82); } } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c78); } + if (peg$silentFails === 0) { peg$fail(peg$c80); } } return s0; @@ -2025,23 +2163,23 @@ module.exports = (function() { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$c81(); + s1 = peg$c83(); if (s1) { s1 = void 0; } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 14) === peg$c82) { - s2 = peg$c82; + if (input.substr(peg$currPos, 14) === peg$c84) { + s2 = peg$c84; peg$currPos += 14; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c83); } + if (peg$silentFails === 0) { peg$fail(peg$c85); } } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c84(); + s1 = peg$c86(); s0 = s1; } else { peg$currPos = s0; @@ -2066,12 +2204,12 @@ module.exports = (function() { s2 = peg$parseSpace(); } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c85) { - s2 = peg$c85; + if (input.substr(peg$currPos, 2) === peg$c87) { + s2 = peg$c87; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c86); } + if (peg$silentFails === 0) { peg$fail(peg$c88); } } if (s2 !== peg$FAILED) { s3 = []; @@ -2082,7 +2220,7 @@ module.exports = (function() { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c87(); + s1 = peg$c89(); s0 = s1; } else { peg$currPos = s0; @@ -2111,12 +2249,12 @@ module.exports = (function() { s2 = peg$parseSpace(); } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c88) { - s2 = peg$c88; + if (input.substr(peg$currPos, 2) === peg$c90) { + s2 = peg$c90; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c89); } + if (peg$silentFails === 0) { peg$fail(peg$c91); } } if (s2 !== peg$FAILED) { s3 = []; @@ -2127,7 +2265,7 @@ module.exports = (function() { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c90(); + s1 = peg$c92(); s0 = s1; } else { peg$currPos = s0; @@ -2144,15 +2282,15 @@ module.exports = (function() { if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 43) { - s1 = peg$c91; + s1 = peg$c93; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c92); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c90(); + s1 = peg$c92(); } s0 = s1; } @@ -2165,29 +2303,29 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 45) { - s1 = peg$c93; + s1 = peg$c95; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c95(); + s1 = peg$c97(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 33) { - s1 = peg$c96; + s1 = peg$c98; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c97); } + if (peg$silentFails === 0) { peg$fail(peg$c99); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c95(); + s1 = peg$c97(); } s0 = s1; } @@ -2223,11 +2361,11 @@ module.exports = (function() { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s3 = peg$c10; + s3 = peg$c11; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } + if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s3 !== peg$FAILED) { s4 = []; @@ -2292,12 +2430,12 @@ module.exports = (function() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; - if (input.substr(peg$currPos, 8) === peg$c98) { - s1 = peg$c98; + if (input.substr(peg$currPos, 8) === peg$c100) { + s1 = peg$c100; peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c99); } + if (peg$silentFails === 0) { peg$fail(peg$c101); } } if (s1 !== peg$FAILED) { s2 = []; @@ -2308,11 +2446,11 @@ module.exports = (function() { } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s3 = peg$c10; + s3 = peg$c11; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } + if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s3 !== peg$FAILED) { s4 = []; @@ -2325,7 +2463,7 @@ module.exports = (function() { s5 = peg$parseLuceneLiteral(); if (s5 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c100(); + s1 = peg$c102(); s0 = s1; } else { peg$currPos = s0; @@ -2367,7 +2505,7 @@ module.exports = (function() { s3 = peg$parseLuceneLiteral(); if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c101(); + s1 = peg$c103(); s0 = s1; } else { peg$currPos = s0; @@ -2401,7 +2539,7 @@ module.exports = (function() { s6 = peg$parseLuceneRangeEnd(); if (s6 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c101(); + s1 = peg$c103(); s0 = s1; } else { peg$currPos = s0; @@ -2440,11 +2578,11 @@ module.exports = (function() { s2 = peg$parseLuceneUnquotedCharacter(); if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 42) { - s2 = peg$c51; + s2 = peg$c53; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } } while (s2 !== peg$FAILED) { @@ -2452,21 +2590,21 @@ module.exports = (function() { s2 = peg$parseLuceneUnquotedCharacter(); if (s2 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 42) { - s2 = peg$c51; + s2 = peg$c53; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } } } if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 63) { - s2 = peg$c102; + s2 = peg$c104; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s2 !== peg$FAILED) { s3 = []; @@ -2477,7 +2615,7 @@ module.exports = (function() { } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c104(); + s1 = peg$c106(); s0 = s1; } else { peg$currPos = s0; @@ -2500,42 +2638,42 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 47) { - s1 = peg$c105; + s1 = peg$c107; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c106); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s1 !== peg$FAILED) { s2 = []; - if (peg$c107.test(input.charAt(peg$currPos))) { + if (peg$c109.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c110); } } while (s3 !== peg$FAILED) { s2.push(s3); - if (peg$c107.test(input.charAt(peg$currPos))) { + if (peg$c109.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c108); } + if (peg$silentFails === 0) { peg$fail(peg$c110); } } } if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s3 = peg$c105; + s3 = peg$c107; peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c106); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c109(); + s1 = peg$c111(); s0 = s1; } else { peg$currPos = s0; @@ -2560,34 +2698,34 @@ module.exports = (function() { s1 = peg$parseLuceneUnquotedLiteral(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s2 = peg$c110; + s2 = peg$c112; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } if (s2 !== peg$FAILED) { s3 = []; - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$c114.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$c114.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c114(); + s1 = peg$c116(); s0 = s1; } else { peg$currPos = s0; @@ -2612,34 +2750,34 @@ module.exports = (function() { s1 = peg$parseQuotedString(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s2 = peg$c110; + s2 = peg$c112; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } if (s2 !== peg$FAILED) { s3 = []; - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$c114.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$c114.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c115(); + s1 = peg$c117(); s0 = s1; } else { peg$currPos = s0; @@ -2664,34 +2802,34 @@ module.exports = (function() { s1 = peg$parseLuceneLiteral(); if (s1 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 94) { - s2 = peg$c116; + s2 = peg$c118; peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c117); } + if (peg$silentFails === 0) { peg$fail(peg$c119); } } if (s2 !== peg$FAILED) { s3 = []; - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$c114.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } while (s4 !== peg$FAILED) { s3.push(s4); - if (peg$c112.test(input.charAt(peg$currPos))) { + if (peg$c114.test(input.charAt(peg$currPos))) { s4 = input.charAt(peg$currPos); peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c113); } + if (peg$silentFails === 0) { peg$fail(peg$c115); } } } if (s3 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c118(); + s1 = peg$c120(); s0 = s1; } else { peg$currPos = s0; @@ -2772,7 +2910,7 @@ module.exports = (function() { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c50); } + if (peg$silentFails === 0) { peg$fail(peg$c52); } } if (s3 !== peg$FAILED) { s1 = [s1, s2, s3]; @@ -2823,17 +2961,17 @@ module.exports = (function() { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 92) { - s1 = peg$c42; + s1 = peg$c44; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s1 !== peg$FAILED) { s2 = peg$parseLuceneSpecialCharacter(); if (s2 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$c119(); + s1 = peg$c121(); s0 = s1; } else { peg$currPos = s0; @@ -2851,163 +2989,163 @@ module.exports = (function() { var s0; if (input.charCodeAt(peg$currPos) === 43) { - s0 = peg$c91; + s0 = peg$c93; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c92); } + if (peg$silentFails === 0) { peg$fail(peg$c94); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 45) { - s0 = peg$c93; + s0 = peg$c95; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c94); } + if (peg$silentFails === 0) { peg$fail(peg$c96); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 61) { - s0 = peg$c120; + s0 = peg$c122; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c121); } + if (peg$silentFails === 0) { peg$fail(peg$c123); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 62) { - s0 = peg$c75; + s0 = peg$c77; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c76); } + if (peg$silentFails === 0) { peg$fail(peg$c78); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 60) { - s0 = peg$c72; + s0 = peg$c74; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c73); } + if (peg$silentFails === 0) { peg$fail(peg$c75); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 33) { - s0 = peg$c96; + s0 = peg$c98; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c97); } + if (peg$silentFails === 0) { peg$fail(peg$c99); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 40) { - s0 = peg$c5; + s0 = peg$c6; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c6); } + if (peg$silentFails === 0) { peg$fail(peg$c7); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 41) { - s0 = peg$c7; + s0 = peg$c8; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c8); } + if (peg$silentFails === 0) { peg$fail(peg$c9); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { - s0 = peg$c12; + s0 = peg$c13; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } + if (peg$silentFails === 0) { peg$fail(peg$c14); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { - s0 = peg$c14; + s0 = peg$c15; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c15); } + if (peg$silentFails === 0) { peg$fail(peg$c16); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 91) { - s0 = peg$c122; + s0 = peg$c124; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c125); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 93) { - s0 = peg$c124; + s0 = peg$c126; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$c127); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 94) { - s0 = peg$c116; + s0 = peg$c118; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c117); } + if (peg$silentFails === 0) { peg$fail(peg$c119); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s0 = peg$c38; + s0 = peg$c40; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c39); } + if (peg$silentFails === 0) { peg$fail(peg$c41); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 126) { - s0 = peg$c110; + s0 = peg$c112; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c111); } + if (peg$silentFails === 0) { peg$fail(peg$c113); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 42) { - s0 = peg$c51; + s0 = peg$c53; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c52); } + if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 63) { - s0 = peg$c102; + s0 = peg$c104; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c103); } + if (peg$silentFails === 0) { peg$fail(peg$c105); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 58) { - s0 = peg$c10; + s0 = peg$c11; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c11); } + if (peg$silentFails === 0) { peg$fail(peg$c12); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 92) { - s0 = peg$c42; + s0 = peg$c44; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c43); } + if (peg$silentFails === 0) { peg$fail(peg$c45); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 47) { - s0 = peg$c105; + s0 = peg$c107; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c106); } + if (peg$silentFails === 0) { peg$fail(peg$c108); } } } } @@ -3047,12 +3185,12 @@ module.exports = (function() { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { - if (input.substr(peg$currPos, 2) === peg$c126) { - s2 = peg$c126; + if (input.substr(peg$currPos, 2) === peg$c128) { + s2 = peg$c128; peg$currPos += 2; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c127); } + if (peg$silentFails === 0) { peg$fail(peg$c129); } } if (s2 !== peg$FAILED) { s3 = []; @@ -3088,19 +3226,19 @@ module.exports = (function() { var s0; if (input.charCodeAt(peg$currPos) === 91) { - s0 = peg$c122; + s0 = peg$c124; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c123); } + if (peg$silentFails === 0) { peg$fail(peg$c125); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { - s0 = peg$c12; + s0 = peg$c13; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c13); } + if (peg$silentFails === 0) { peg$fail(peg$c14); } } } @@ -3111,19 +3249,19 @@ module.exports = (function() { var s0; if (input.charCodeAt(peg$currPos) === 93) { - s0 = peg$c124; + s0 = peg$c126; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c125); } + if (peg$silentFails === 0) { peg$fail(peg$c127); } } if (s0 === peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { - s0 = peg$c14; + s0 = peg$c15; peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c15); } + if (peg$silentFails === 0) { peg$fail(peg$c16); } } } @@ -3163,4 +3301,4 @@ module.exports = (function() { SyntaxError: peg$SyntaxError, parse: peg$parse }; -})(); +})(); \ No newline at end of file diff --git a/src/plugins/data/common/es_query/kuery/ast/ast.test.ts b/src/plugins/data/common/es_query/kuery/ast/ast.test.ts index 3a602cf102ff6..f43049542f9de 100644 --- a/src/plugins/data/common/es_query/kuery/ast/ast.test.ts +++ b/src/plugins/data/common/es_query/kuery/ast/ast.test.ts @@ -69,6 +69,26 @@ describe('kuery AST API', () => { expect(actual).toEqual(expected); }); + test('should not nest same-level "and"', () => { + const expected = nodeTypes.function.buildNode('and', [ + nodeTypes.function.buildNode('is', null, 'foo'), + nodeTypes.function.buildNode('is', null, 'bar'), + nodeTypes.function.buildNode('is', null, 'baz'), + ]); + const actual = fromKueryExpression('foo and bar and baz'); + expect(actual).toEqual(expected); + }); + + test('should not nest same-level "or"', () => { + const expected = nodeTypes.function.buildNode('or', [ + nodeTypes.function.buildNode('is', null, 'foo'), + nodeTypes.function.buildNode('is', null, 'bar'), + nodeTypes.function.buildNode('is', null, 'baz'), + ]); + const actual = fromKueryExpression('foo or bar or baz'); + expect(actual).toEqual(expected); + }); + test('should support negation of queries with a "not" prefix', () => { const expected = nodeTypes.function.buildNode( 'not', @@ -84,13 +104,11 @@ describe('kuery AST API', () => { test('"and" should have a higher precedence than "or"', () => { const expected = nodeTypes.function.buildNode('or', [ nodeTypes.function.buildNode('is', null, 'foo'), - nodeTypes.function.buildNode('or', [ - nodeTypes.function.buildNode('and', [ - nodeTypes.function.buildNode('is', null, 'bar'), - nodeTypes.function.buildNode('is', null, 'baz'), - ]), - nodeTypes.function.buildNode('is', null, 'qux'), + nodeTypes.function.buildNode('and', [ + nodeTypes.function.buildNode('is', null, 'bar'), + nodeTypes.function.buildNode('is', null, 'baz'), ]), + nodeTypes.function.buildNode('is', null, 'qux'), ]); const actual = fromKueryExpression('foo or bar and baz or qux'); expect(actual).toEqual(expected); diff --git a/src/plugins/data/common/es_query/kuery/ast/kuery.peg b/src/plugins/data/common/es_query/kuery/ast/kuery.peg index 625c5069f936a..6407107e5ee65 100644 --- a/src/plugins/data/common/es_query/kuery/ast/kuery.peg +++ b/src/plugins/data/common/es_query/kuery/ast/kuery.peg @@ -27,18 +27,20 @@ start OrQuery = &{ return errorOnLuceneSyntax; } LuceneQuery - / left:AndQuery Or right:OrQuery { - const cursor = [left, right].find(node => node.type === 'cursor'); + / head:AndQuery tail:(Or query:AndQuery { return query; })+ { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) return cursor; - return buildFunctionNode('or', [left, right]); + return buildFunctionNode('or', nodes); } / AndQuery AndQuery - = left:NotQuery And right:AndQuery { - const cursor = [left, right].find(node => node.type === 'cursor'); + = head:NotQuery tail:(And query:NotQuery { return query; })+ { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) return cursor; - return buildFunctionNode('and', [left, right]); + return buildFunctionNode('and', nodes); } / NotQuery @@ -139,28 +141,30 @@ ListOfValues / Value OrListOfValues - = partialLeft:AndListOfValues Or partialRight:OrListOfValues { - const cursor = [partialLeft, partialRight].find(node => node.type === 'cursor'); + = head:AndListOfValues tail:(Or partial:AndListOfValues { return partial; })+ { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) { return { ...cursor, suggestionTypes: ['value'] }; } - return (field) => buildFunctionNode('or', [partialLeft(field), partialRight(field)]); + return (field) => buildFunctionNode('or', nodes.map(partial => partial(field))); } / AndListOfValues AndListOfValues - = partialLeft:NotListOfValues And partialRight:AndListOfValues { - const cursor = [partialLeft, partialRight].find(node => node.type === 'cursor'); + = head:NotListOfValues tail:(And partial:NotListOfValues { return partial; })+ { + const nodes = [head, ...tail]; + const cursor = nodes.find(node => node.type === 'cursor'); if (cursor) { return { ...cursor, suggestionTypes: ['value'] }; } - return (field) => buildFunctionNode('and', [partialLeft(field), partialRight(field)]); + return (field) => buildFunctionNode('and', nodes.map(partial => partial(field))); } / NotListOfValues diff --git a/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts b/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts index 6b140c7877fb0..2a7bc6238e5d9 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/get_query_filter.test.ts @@ -981,132 +981,132 @@ describe('get_filter', () => { ['my custom index'], [] ); - expect(esQuery).toEqual({ - bool: { - must: [], - filter: [ - { - bool: { - filter: [ - { - bool: { - filter: [ - { - bool: { - should: [{ match: { 'event.module': 'suricata' } }], - minimum_should_match: 1, + expect(esQuery).toMatchInlineSnapshot(` + Object { + "bool": Object { + "filter": Array [ + Object { + "bool": Object { + "filter": Array [ + Object { + "bool": Object { + "filter": Array [ + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "event.module": "suricata", + }, + }, + ], + }, }, - }, - { - bool: { - should: [{ match: { 'event.kind': 'alert' } }], - minimum_should_match: 1, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "event.kind": "alert", + }, + }, + ], + }, }, - }, - ], + ], + }, }, - }, - { - bool: { - should: [ - { - bool: { - should: [{ match: { 'suricata.eve.alert.signature_id': 2610182 } }], - minimum_should_match: 1, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "suricata.eve.alert.signature_id": 2610182, + }, + }, + ], + }, }, - }, - { - bool: { - should: [ - { - bool: { - should: [ - { match: { 'suricata.eve.alert.signature_id': 2610183 } }, - ], - minimum_should_match: 1, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "suricata.eve.alert.signature_id": 2610183, + }, }, - }, - { - bool: { - should: [ - { - bool: { - should: [ - { match: { 'suricata.eve.alert.signature_id': 2610184 } }, - ], - minimum_should_match: 1, - }, - }, - { - bool: { - should: [ - { - bool: { - should: [ - { - match: { - 'suricata.eve.alert.signature_id': 2610185, - }, - }, - ], - minimum_should_match: 1, - }, - }, - { - bool: { - should: [ - { - bool: { - should: [ - { - match: { - 'suricata.eve.alert.signature_id': 2610186, - }, - }, - ], - minimum_should_match: 1, - }, - }, - { - bool: { - should: [ - { - match: { - 'suricata.eve.alert.signature_id': 2610187, - }, - }, - ], - minimum_should_match: 1, - }, - }, - ], - minimum_should_match: 1, - }, - }, - ], - minimum_should_match: 1, - }, - }, - ], - minimum_should_match: 1, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "suricata.eve.alert.signature_id": 2610184, + }, }, - }, - ], - minimum_should_match: 1, + ], + }, }, - }, - ], - minimum_should_match: 1, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "suricata.eve.alert.signature_id": 2610185, + }, + }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "suricata.eve.alert.signature_id": 2610186, + }, + }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "suricata.eve.alert.signature_id": 2610187, + }, + }, + ], + }, + }, + ], + }, }, - }, - ], + ], + }, }, - }, - ], - should: [], - must_not: [], - }, - }); + ], + "must": Array [], + "must_not": Array [], + "should": Array [], + }, + } + `); }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx index 82c245fc9f0a7..8e03a56c1aa9b 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx @@ -451,8 +451,8 @@ describe('Combined Queries', () => { kqlQuery: { query: 'host.name: "host-1"', language: 'kuery' }, kqlMode: 'search', })!; - expect(filterQuery).toEqual( - '{"bool":{"must":[],"filter":[{"bool":{"should":[{"bool":{"should":[{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 3"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 4"}}],"minimum_should_match":1}}]}}]}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 2"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 5"}}],"minimum_should_match":1}}]}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}],"minimum_should_match":1}}],"should":[],"must_not":[]}}' + expect(filterQuery).toMatchInlineSnapshot( + `"{\\"bool\\":{\\"must\\":[],\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 1\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 3\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 4\\"}}],\\"minimum_should_match\\":1}}]}},{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 2\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 5\\"}}],\\"minimum_should_match\\":1}}]}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"host.name\\":\\"host-1\\"}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}}],\\"should\\":[],\\"must_not\\":[]}}"` ); }); @@ -469,8 +469,8 @@ describe('Combined Queries', () => { kqlQuery: { query: 'host.name: "host-1"', language: 'kuery' }, kqlMode: 'filter', })!; - expect(filterQuery).toEqual( - '{"bool":{"must":[],"filter":[{"bool":{"filter":[{"bool":{"should":[{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 1"}}],"minimum_should_match":1}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 3"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 4"}}],"minimum_should_match":1}}]}}]}},{"bool":{"filter":[{"bool":{"should":[{"match_phrase":{"name":"Provider 2"}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"name":"Provider 5"}}],"minimum_should_match":1}}]}}],"minimum_should_match":1}},{"bool":{"should":[{"match_phrase":{"host.name":"host-1"}}],"minimum_should_match":1}}]}}],"should":[],"must_not":[]}}' + expect(filterQuery).toMatchInlineSnapshot( + `"{\\"bool\\":{\\"must\\":[],\\"filter\\":[{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 1\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 3\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 4\\"}}],\\"minimum_should_match\\":1}}]}},{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 2\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"name\\":\\"Provider 5\\"}}],\\"minimum_should_match\\":1}}]}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"host.name\\":\\"host-1\\"}}],\\"minimum_should_match\\":1}}]}}],\\"should\\":[],\\"must_not\\":[]}}"` ); }); diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts index ada8a1c8ce235..4fac71a53a1dc 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts @@ -365,27 +365,20 @@ describe('status check alert', () => { "minimum_should_match": 1, "should": Array [ Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "url.port": 5601, - }, - }, - ], + "match": Object { + "url.port": 5601, }, }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "url.port": 443, - }, - }, - ], + "match": Object { + "url.port": 443, }, }, ], @@ -396,14 +389,39 @@ describe('status check alert', () => { }, Object { "bool": Object { - "filter": Array [ + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "observer.geo.name": "harrisburg", + }, + }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "monitor.type": "http", + }, + }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ Object { "bool": Object { "minimum_should_match": 1, "should": Array [ Object { "match": Object { - "observer.geo.name": "harrisburg", + "tags": "unsecured", }, }, ], @@ -411,67 +429,23 @@ describe('status check alert', () => { }, Object { "bool": Object { - "filter": Array [ + "minimum_should_match": 1, + "should": Array [ Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "monitor.type": "http", - }, - }, - ], + "match": Object { + "tags": "containers", }, }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "tags": "unsecured", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "tags": "containers", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match_phrase": Object { - "tags": "org:google", - }, - }, - ], - }, - }, - ], - }, - }, - ], + "match_phrase": Object { + "tags": "org:google", }, }, ], @@ -761,7 +735,7 @@ describe('status check alert', () => { expect(mockAvailability.mock.calls[0]).toMatchInlineSnapshot(` Array [ Object { - "filters": "{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"url.port\\":12349}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"url.port\\":5601}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"url.port\\":443}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"observer.geo.name\\":\\"harrisburg\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"monitor.type\\":\\"http\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"tags\\":\\"unsecured\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"tags\\":\\"containers\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"tags\\":\\"org:google\\"}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}}]}}]}}]}}", + "filters": "{\\"bool\\":{\\"filter\\":[{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"url.port\\":12349}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"url.port\\":5601}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"url.port\\":443}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"observer.geo.name\\":\\"harrisburg\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"monitor.type\\":\\"http\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"tags\\":\\"unsecured\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match\\":{\\"tags\\":\\"containers\\"}}],\\"minimum_should_match\\":1}},{\\"bool\\":{\\"should\\":[{\\"match_phrase\\":{\\"tags\\":\\"org:google\\"}}],\\"minimum_should_match\\":1}}],\\"minimum_should_match\\":1}}]}}", "range": 35, "rangeUnit": "d", "threshold": "99.34", @@ -1071,46 +1045,32 @@ describe('status check alert', () => { "minimum_should_match": 1, "should": Array [ Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "observer.geo.name": "apj", - }, - }, - ], + "match": Object { + "observer.geo.name": "apj", }, }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "observer.geo.name": "sydney", - }, - }, - ], - }, - }, - Object { - "bool": Object { - "minimum_should_match": 1, - "should": Array [ - Object { - "match": Object { - "observer.geo.name": "us-west", - }, - }, - ], - }, - }, - ], + "match": Object { + "observer.geo.name": "sydney", + }, + }, + ], + }, + }, + Object { + "bool": Object { + "minimum_should_match": 1, + "should": Array [ + Object { + "match": Object { + "observer.geo.name": "us-west", }, }, ],