From 41c338c0e5e2fdc1aeb6ff93deadedca48b66af0 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 13:55:51 -0800 Subject: [PATCH 01/11] Add view parameter to search query grammar --- src/CONST/index.ts | 7 + src/components/Search/types.ts | 3 + src/libs/SearchParser/autocompleteParser.js | 525 ++++++++++--------- src/libs/SearchParser/baseRules.peggy | 3 +- src/libs/SearchParser/searchParser.js | 531 ++++++++++---------- src/libs/SearchParser/searchParser.peggy | 5 +- 6 files changed, 568 insertions(+), 506 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index ba2f5a4d872a..e1bd802cff97 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -7063,6 +7063,13 @@ const CONST = { SORT_ORDER: 'sortOrder', GROUP_BY: 'groupBy', COLUMNS: 'columns', + VIEW: 'view', + }, + VIEW: { + TABLE: 'table', + BAR: 'bar', + LINE: 'line', + PIE: 'pie', }, SYNTAX_FILTER_KEYS: { TYPE: 'type', diff --git a/src/components/Search/types.ts b/src/components/Search/types.ts index f67f651a6112..a122e48a2e1d 100644 --- a/src/components/Search/types.ts +++ b/src/components/Search/types.ts @@ -112,6 +112,7 @@ type TaskSearchStatus = ValueOf; type SingularSearchStatus = ExpenseSearchStatus | ExpenseReportSearchStatus | InvoiceSearchStatus | TripSearchStatus | TaskSearchStatus; type SearchStatus = SingularSearchStatus | SingularSearchStatus[]; type SearchGroupBy = ValueOf; +type SearchView = ValueOf; type TableColumnSize = ValueOf; type SearchDatePreset = ValueOf; type SearchWithdrawalType = ValueOf; @@ -244,6 +245,7 @@ type SearchQueryAST = { sortBy: SearchColumnType; sortOrder: SortOrder; groupBy?: SearchGroupBy; + view: SearchView; filters: ASTNode; policyID?: string[]; rawFilterList?: RawQueryFilter[]; @@ -323,6 +325,7 @@ export type { SearchParams, TableColumnSize, SearchGroupBy, + SearchView, SingularSearchStatus, SearchDatePreset, SearchWithdrawalType, diff --git a/src/libs/SearchParser/autocompleteParser.js b/src/libs/SearchParser/autocompleteParser.js index 73a708820759..bdd1ca3a0b27 100644 --- a/src/libs/SearchParser/autocompleteParser.js +++ b/src/libs/SearchParser/autocompleteParser.js @@ -247,34 +247,35 @@ function peg$parse(input, options) { var peg$c61 = "purchasecurrency"; var peg$c62 = "purchase-currency"; var peg$c63 = "columns"; - var peg$c64 = "per-diem"; - var peg$c65 = "drafts"; - var peg$c66 = "draft"; - var peg$c67 = "original-amount"; - var peg$c68 = "tax"; - var peg$c69 = "policy-name"; - var peg$c70 = "bank-account"; - var peg$c71 = "long-report-id"; - var peg$c72 = "exported-to"; - var peg$c73 = "exchange-rate"; - var peg$c74 = "reimbursable-total"; - var peg$c75 = "non-reimbursable-total"; - var peg$c76 = "group-from"; - var peg$c77 = "group-expenses"; - var peg$c78 = "group-total"; - var peg$c79 = "group-card"; - var peg$c80 = "group-feed"; - var peg$c81 = "group-bank-account"; - var peg$c82 = "group-withdrawn"; - var peg$c83 = "group-withdrawal-id"; - var peg$c84 = "!="; - var peg$c85 = ">="; - var peg$c86 = ">"; - var peg$c87 = "<="; - var peg$c88 = "<"; - var peg$c89 = "\u201C"; - var peg$c90 = "\u201D"; - var peg$c91 = "\""; + var peg$c64 = "view"; + var peg$c65 = "per-diem"; + var peg$c66 = "drafts"; + var peg$c67 = "draft"; + var peg$c68 = "original-amount"; + var peg$c69 = "tax"; + var peg$c70 = "policy-name"; + var peg$c71 = "bank-account"; + var peg$c72 = "long-report-id"; + var peg$c73 = "exported-to"; + var peg$c74 = "exchange-rate"; + var peg$c75 = "reimbursable-total"; + var peg$c76 = "non-reimbursable-total"; + var peg$c77 = "group-from"; + var peg$c78 = "group-expenses"; + var peg$c79 = "group-total"; + var peg$c80 = "group-card"; + var peg$c81 = "group-feed"; + var peg$c82 = "group-bank-account"; + var peg$c83 = "group-withdrawn"; + var peg$c84 = "group-withdrawal-id"; + var peg$c85 = "!="; + var peg$c86 = ">="; + var peg$c87 = ">"; + var peg$c88 = "<="; + var peg$c89 = "<"; + var peg$c90 = "\u201C"; + var peg$c91 = "\u201D"; + var peg$c92 = "\""; var peg$r0 = /^[ \t\r\n\xA0,:=<>!]/; var peg$r1 = /^[:=]/; @@ -357,50 +358,51 @@ function peg$parse(input, options) { var peg$e64 = peg$literalExpectation("purchaseCurrency", true); var peg$e65 = peg$literalExpectation("purchase-currency", true); var peg$e66 = peg$literalExpectation("columns", true); - var peg$e67 = peg$literalExpectation("per-diem", true); - var peg$e68 = peg$literalExpectation("drafts", true); - var peg$e69 = peg$literalExpectation("draft", true); - var peg$e70 = peg$literalExpectation("original-amount", true); - var peg$e71 = peg$literalExpectation("tax", true); - var peg$e72 = peg$literalExpectation("policy-name", true); - var peg$e73 = peg$literalExpectation("bank-account", true); - var peg$e74 = peg$literalExpectation("long-report-id", true); - var peg$e75 = peg$literalExpectation("exported-to", true); - var peg$e76 = peg$literalExpectation("exchange-rate", true); - var peg$e77 = peg$literalExpectation("reimbursable-total", true); - var peg$e78 = peg$literalExpectation("non-reimbursable-total", true); - var peg$e79 = peg$literalExpectation("group-from", true); - var peg$e80 = peg$literalExpectation("group-expenses", true); - var peg$e81 = peg$literalExpectation("group-total", true); - var peg$e82 = peg$literalExpectation("group-card", true); - var peg$e83 = peg$literalExpectation("group-feed", true); - var peg$e84 = peg$literalExpectation("group-bank-account", true); - var peg$e85 = peg$literalExpectation("group-withdrawn", true); - var peg$e86 = peg$literalExpectation("group-withdrawal-id", true); - var peg$e87 = peg$otherExpectation("operator"); - var peg$e88 = peg$classExpectation([":", "="], false, false); - var peg$e89 = peg$literalExpectation("!=", false); - var peg$e90 = peg$literalExpectation(">=", false); - var peg$e91 = peg$literalExpectation(">", false); - var peg$e92 = peg$literalExpectation("<=", false); - var peg$e93 = peg$literalExpectation("<", false); - var peg$e94 = peg$otherExpectation("word"); - var peg$e95 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e96 = peg$otherExpectation("whitespace"); - var peg$e97 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); - var peg$e98 = peg$otherExpectation("quote"); - var peg$e99 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e100 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); - var peg$e101 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); - var peg$e102 = peg$literalExpectation("\u201C", false); - var peg$e103 = peg$literalExpectation("\u201D", false); - var peg$e104 = peg$literalExpectation("\"", false); - var peg$e105 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e106 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e107 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); - var peg$e108 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); - var peg$e109 = peg$classExpectation([","], false, false); - var peg$e110 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); + var peg$e67 = peg$literalExpectation("view", true); + var peg$e68 = peg$literalExpectation("per-diem", true); + var peg$e69 = peg$literalExpectation("drafts", true); + var peg$e70 = peg$literalExpectation("draft", true); + var peg$e71 = peg$literalExpectation("original-amount", true); + var peg$e72 = peg$literalExpectation("tax", true); + var peg$e73 = peg$literalExpectation("policy-name", true); + var peg$e74 = peg$literalExpectation("bank-account", true); + var peg$e75 = peg$literalExpectation("long-report-id", true); + var peg$e76 = peg$literalExpectation("exported-to", true); + var peg$e77 = peg$literalExpectation("exchange-rate", true); + var peg$e78 = peg$literalExpectation("reimbursable-total", true); + var peg$e79 = peg$literalExpectation("non-reimbursable-total", true); + var peg$e80 = peg$literalExpectation("group-from", true); + var peg$e81 = peg$literalExpectation("group-expenses", true); + var peg$e82 = peg$literalExpectation("group-total", true); + var peg$e83 = peg$literalExpectation("group-card", true); + var peg$e84 = peg$literalExpectation("group-feed", true); + var peg$e85 = peg$literalExpectation("group-bank-account", true); + var peg$e86 = peg$literalExpectation("group-withdrawn", true); + var peg$e87 = peg$literalExpectation("group-withdrawal-id", true); + var peg$e88 = peg$otherExpectation("operator"); + var peg$e89 = peg$classExpectation([":", "="], false, false); + var peg$e90 = peg$literalExpectation("!=", false); + var peg$e91 = peg$literalExpectation(">=", false); + var peg$e92 = peg$literalExpectation(">", false); + var peg$e93 = peg$literalExpectation("<=", false); + var peg$e94 = peg$literalExpectation("<", false); + var peg$e95 = peg$otherExpectation("word"); + var peg$e96 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e97 = peg$otherExpectation("whitespace"); + var peg$e98 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); + var peg$e99 = peg$otherExpectation("quote"); + var peg$e100 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e101 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); + var peg$e102 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); + var peg$e103 = peg$literalExpectation("\u201C", false); + var peg$e104 = peg$literalExpectation("\u201D", false); + var peg$e105 = peg$literalExpectation("\"", false); + var peg$e106 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e107 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e108 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); + var peg$e109 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); + var peg$e110 = peg$classExpectation([","], false, false); + var peg$e111 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); var peg$f0 = function(ranges) { return { autocomplete, ranges }; }; var peg$f1 = function(filters) { return filters.filter(Boolean).flat(); }; @@ -509,59 +511,60 @@ function peg$parse(input, options) { var peg$f49 = function() {return "is"; }; var peg$f50 = function() {return "purchaseAmount"}; var peg$f51 = function() {return "purchaseCurrency"}; - var peg$f52 = function() { + var peg$f52 = function() { isColumnsContext = true; return "columns"; }; - var peg$f53 = function() { return isColumnsContext; }; - var peg$f54 = function() { return "perDiem"; }; - var peg$f55 = function() { return "drafts"; }; - var peg$f56 = function() { return "originalamount"; }; - var peg$f57 = function() { return "taxAmount"; }; - var peg$f58 = function() { return "taxrate"; }; - var peg$f59 = function() { return "policyname"; }; - var peg$f60 = function() { return "withdrawalID"; }; - var peg$f61 = function() { return "bankAccount"; }; - var peg$f62 = function() { return "reportID"; }; - var peg$f63 = function() { return "base62ReportID"; }; - var peg$f64 = function() { return "exportedto"; }; - var peg$f65 = function() { return "exchangeRate"; }; - var peg$f66 = function() { return "reimbursableTotal"; }; - var peg$f67 = function() { return "nonReimbursableTotal"; }; - var peg$f68 = function() { return "groupFrom"; }; - var peg$f69 = function() { return "groupExpenses"; }; - var peg$f70 = function() { return "groupTotal"; }; - var peg$f71 = function() { return "groupCard"; }; - var peg$f72 = function() { return "groupFeed"; }; - var peg$f73 = function() { return "groupBankAccount"; }; - var peg$f74 = function() { return "groupWithdrawn"; }; - var peg$f75 = function() { return "groupWithdrawalID"; }; - var peg$f76 = function() { return "eq"; }; - var peg$f77 = function() { return "neq"; }; - var peg$f78 = function() { return "gte"; }; - var peg$f79 = function() { return "gt"; }; - var peg$f80 = function() { return "lte"; }; - var peg$f81 = function() { return "lt"; }; - var peg$f82 = function(o) { + var peg$f53 = function() {return "view"}; + var peg$f54 = function() { return isColumnsContext; }; + var peg$f55 = function() { return "perDiem"; }; + var peg$f56 = function() { return "drafts"; }; + var peg$f57 = function() { return "originalamount"; }; + var peg$f58 = function() { return "taxAmount"; }; + var peg$f59 = function() { return "taxrate"; }; + var peg$f60 = function() { return "policyname"; }; + var peg$f61 = function() { return "withdrawalID"; }; + var peg$f62 = function() { return "bankAccount"; }; + var peg$f63 = function() { return "reportID"; }; + var peg$f64 = function() { return "base62ReportID"; }; + var peg$f65 = function() { return "exportedto"; }; + var peg$f66 = function() { return "exchangeRate"; }; + var peg$f67 = function() { return "reimbursableTotal"; }; + var peg$f68 = function() { return "nonReimbursableTotal"; }; + var peg$f69 = function() { return "groupFrom"; }; + var peg$f70 = function() { return "groupExpenses"; }; + var peg$f71 = function() { return "groupTotal"; }; + var peg$f72 = function() { return "groupCard"; }; + var peg$f73 = function() { return "groupFeed"; }; + var peg$f74 = function() { return "groupBankAccount"; }; + var peg$f75 = function() { return "groupWithdrawn"; }; + var peg$f76 = function() { return "groupWithdrawalID"; }; + var peg$f77 = function() { return "eq"; }; + var peg$f78 = function() { return "neq"; }; + var peg$f79 = function() { return "gte"; }; + var peg$f80 = function() { return "gt"; }; + var peg$f81 = function() { return "lte"; }; + var peg$f82 = function() { return "lt"; }; + var peg$f83 = function(o) { if (nameOperator) { expectingNestedQuote = (o === "eq"); // Use simple parser if no valid operator is found } isColumnsContext = false; return o; }; - var peg$f83 = function(chars) { return chars.join("").trim(); }; - var peg$f84 = function() { + var peg$f84 = function(chars) { return chars.join("").trim(); }; + var peg$f85 = function() { isColumnsContext = false; return "and"; }; - var peg$f85 = function() { return expectingNestedQuote; }; - var peg$f86 = function(start, inner, end) { //handle no-breaking space + var peg$f86 = function() { return expectingNestedQuote; }; + var peg$f87 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; - var peg$f87 = function(start) {return "“"}; - var peg$f88 = function(start) {return "”"}; - var peg$f89 = function(start) {return "\""}; - var peg$f90 = function(start, inner, end) { + var peg$f88 = function(start) {return "“"}; + var peg$f89 = function(start) {return "”"}; + var peg$f90 = function(start) {return "\""}; + var peg$f91 = function(start, inner, end) { return [...start, '"', ...inner, '"'].join(""); }; var peg$currPos = options.peg$currPos | 0; @@ -2241,12 +2244,32 @@ function peg$parse(input, options) { return s0; } + function peg$parseview() { + var s0, s1; + + s0 = peg$currPos; + s1 = input.substr(peg$currPos, 4); + if (s1.toLowerCase() === peg$c64) { + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e67); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f53(); + } + s0 = s1; + + return s0; + } + function peg$parsevalues() { var s0, s1, s2; s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f53(); + s1 = peg$f54(); if (s1) { s1 = undefined; } else { @@ -2345,11 +2368,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c64) { + if (s1.toLowerCase() === peg$c65) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e67); } + if (peg$silentFails === 0) { peg$fail(peg$e68); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2364,7 +2387,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f54(); + s0 = peg$f55(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2382,19 +2405,19 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c65) { + if (s1.toLowerCase() === peg$c66) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e68); } + if (peg$silentFails === 0) { peg$fail(peg$e69); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c66) { + if (s1.toLowerCase() === peg$c67) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } } if (s1 !== peg$FAILED) { @@ -2410,7 +2433,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f55(); + s0 = peg$f56(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2428,11 +2451,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c67) { + if (s1.toLowerCase() === peg$c68) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e70); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2447,7 +2470,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f56(); + s0 = peg$f57(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2465,11 +2488,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 3); - if (s1.toLowerCase() === peg$c68) { + if (s1.toLowerCase() === peg$c69) { peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2484,7 +2507,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f57(); + s0 = peg$f58(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2521,7 +2544,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f58(); + s0 = peg$f59(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2539,11 +2562,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c69) { + if (s1.toLowerCase() === peg$c70) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e72); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2558,7 +2581,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f59(); + s0 = peg$f60(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2595,7 +2618,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f60(); + s0 = peg$f61(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2613,11 +2636,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c70) { + if (s1.toLowerCase() === peg$c71) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e73); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2632,7 +2655,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f61(); + s0 = peg$f62(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2650,11 +2673,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c71) { + if (s1.toLowerCase() === peg$c72) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e74); } + if (peg$silentFails === 0) { peg$fail(peg$e75); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2669,7 +2692,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f62(); + s0 = peg$f63(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2706,7 +2729,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f63(); + s0 = peg$f64(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2724,11 +2747,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c72) { + if (s1.toLowerCase() === peg$c73) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e75); } + if (peg$silentFails === 0) { peg$fail(peg$e76); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2743,7 +2766,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f64(); + s0 = peg$f65(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2761,11 +2784,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c73) { + if (s1.toLowerCase() === peg$c74) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e76); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2780,7 +2803,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f65(); + s0 = peg$f66(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2798,11 +2821,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c74) { + if (s1.toLowerCase() === peg$c75) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e77); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2817,7 +2840,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f66(); + s0 = peg$f67(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2835,11 +2858,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 22); - if (s1.toLowerCase() === peg$c75) { + if (s1.toLowerCase() === peg$c76) { peg$currPos += 22; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e78); } + if (peg$silentFails === 0) { peg$fail(peg$e79); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2854,7 +2877,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f67(); + s0 = peg$f68(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2872,11 +2895,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c76) { + if (s1.toLowerCase() === peg$c77) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e79); } + if (peg$silentFails === 0) { peg$fail(peg$e80); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2891,7 +2914,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f68(); + s0 = peg$f69(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2909,11 +2932,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c77) { + if (s1.toLowerCase() === peg$c78) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e80); } + if (peg$silentFails === 0) { peg$fail(peg$e81); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2928,7 +2951,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f69(); + s0 = peg$f70(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2946,11 +2969,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c78) { + if (s1.toLowerCase() === peg$c79) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e81); } + if (peg$silentFails === 0) { peg$fail(peg$e82); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2965,7 +2988,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f70(); + s0 = peg$f71(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2983,11 +3006,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c79) { + if (s1.toLowerCase() === peg$c80) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e82); } + if (peg$silentFails === 0) { peg$fail(peg$e83); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3002,7 +3025,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f71(); + s0 = peg$f72(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3020,11 +3043,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c80) { + if (s1.toLowerCase() === peg$c81) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e83); } + if (peg$silentFails === 0) { peg$fail(peg$e84); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3039,7 +3062,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f72(); + s0 = peg$f73(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3057,11 +3080,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c81) { + if (s1.toLowerCase() === peg$c82) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e84); } + if (peg$silentFails === 0) { peg$fail(peg$e85); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3076,7 +3099,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f73(); + s0 = peg$f74(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3094,11 +3117,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c82) { + if (s1.toLowerCase() === peg$c83) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e85); } + if (peg$silentFails === 0) { peg$fail(peg$e86); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3113,7 +3136,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f74(); + s0 = peg$f75(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3131,11 +3154,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 19); - if (s1.toLowerCase() === peg$c83) { + if (s1.toLowerCase() === peg$c84) { peg$currPos += 19; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e86); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3150,7 +3173,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f75(); + s0 = peg$f76(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3173,81 +3196,81 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e88); } + if (peg$silentFails === 0) { peg$fail(peg$e89); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f76(); + s1 = peg$f77(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c84) { - s1 = peg$c84; + if (input.substr(peg$currPos, 2) === peg$c85) { + s1 = peg$c85; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e89); } + if (peg$silentFails === 0) { peg$fail(peg$e90); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f77(); + s1 = peg$f78(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c85) { - s1 = peg$c85; + if (input.substr(peg$currPos, 2) === peg$c86) { + s1 = peg$c86; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e90); } + if (peg$silentFails === 0) { peg$fail(peg$e91); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f78(); + s1 = peg$f79(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c86; + s1 = peg$c87; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e91); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f79(); + s1 = peg$f80(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c87) { - s1 = peg$c87; + if (input.substr(peg$currPos, 2) === peg$c88) { + s1 = peg$c88; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e92); } + if (peg$silentFails === 0) { peg$fail(peg$e93); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f80(); + s1 = peg$f81(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c88; + s1 = peg$c89; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e93); } + if (peg$silentFails === 0) { peg$fail(peg$e94); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f81(); + s1 = peg$f82(); } s0 = s1; } @@ -3258,7 +3281,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e87); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } return s0; @@ -3271,7 +3294,7 @@ function peg$parse(input, options) { s1 = peg$parseoperator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f82(s1); + s1 = peg$f83(s1); } s0 = s1; @@ -3289,7 +3312,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { @@ -3299,7 +3322,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } } } else { @@ -3307,13 +3330,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f83(s1); + s1 = peg$f84(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e94); } + if (peg$silentFails === 0) { peg$fail(peg$e95); } } return s0; @@ -3325,7 +3348,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f84(); + s1 = peg$f85(); s0 = s1; return s0; @@ -3341,7 +3364,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -3350,12 +3373,12 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } } peg$silentFails--; s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e96); } + if (peg$silentFails === 0) { peg$fail(peg$e97); } return s0; } @@ -3365,7 +3388,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f85(); + s1 = peg$f86(); if (s1) { s1 = undefined; } else { @@ -3402,7 +3425,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3411,7 +3434,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } } s2 = input.charAt(peg$currPos); @@ -3419,7 +3442,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s2 !== peg$FAILED) { s3 = []; @@ -3428,7 +3451,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -3437,7 +3460,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } } s4 = input.charAt(peg$currPos); @@ -3445,7 +3468,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s4 !== peg$FAILED) { s5 = []; @@ -3454,7 +3477,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } while (s6 !== peg$FAILED) { s5.push(s6); @@ -3463,11 +3486,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } } peg$savedPos = s0; - s0 = peg$f86(s1, s3, s5); + s0 = peg$f87(s1, s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3479,7 +3502,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e98); } + if (peg$silentFails === 0) { peg$fail(peg$e99); } } return s0; @@ -3496,7 +3519,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3505,7 +3528,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } } s2 = input.charAt(peg$currPos); @@ -3513,7 +3536,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s2 !== peg$FAILED) { s3 = []; @@ -3522,7 +3545,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -3538,15 +3561,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c89; + s6 = peg$c90; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f87(s1); + s4 = peg$f88(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3569,15 +3592,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c90; + s6 = peg$c91; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f88(s1); + s4 = peg$f89(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3600,15 +3623,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c91; + s6 = peg$c92; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f89(s1); + s4 = peg$f90(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3627,7 +3650,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -3643,15 +3666,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c89; + s6 = peg$c90; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f87(s1); + s4 = peg$f88(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3674,15 +3697,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c90; + s6 = peg$c91; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f88(s1); + s4 = peg$f89(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3705,15 +3728,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c91; + s6 = peg$c92; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f89(s1); + s4 = peg$f90(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3729,7 +3752,7 @@ function peg$parse(input, options) { s4 = peg$parseclosingQuote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f90(s1, s3, s4); + s0 = peg$f91(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3741,7 +3764,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e98); } + if (peg$silentFails === 0) { peg$fail(peg$e99); } } return s0; @@ -3756,7 +3779,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3794,7 +3817,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e105); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3803,7 +3826,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e105); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } } s2 = []; @@ -3812,7 +3835,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e106); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -3821,7 +3844,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e106); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } } s3 = []; @@ -3830,7 +3853,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e107); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -3839,7 +3862,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e107); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } } s4 = peg$parseoperator(); @@ -3858,7 +3881,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e108); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3867,7 +3890,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e108); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } } s2 = peg$currPos; @@ -3914,7 +3937,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e109); } + if (peg$silentFails === 0) { peg$fail(peg$e110); } } } } @@ -3930,7 +3953,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e110); } + if (peg$silentFails === 0) { peg$fail(peg$e111); } } if (s0 === peg$FAILED) { s0 = peg$currPos; diff --git a/src/libs/SearchParser/baseRules.peggy b/src/libs/SearchParser/baseRules.peggy index 117d06056cdc..2752261d3e0b 100644 --- a/src/libs/SearchParser/baseRules.peggy +++ b/src/libs/SearchParser/baseRules.peggy @@ -79,10 +79,11 @@ has = "has"i {return "has"; } is = "is"i {return "is"; } purchaseAmount = "purchaseAmount"i / "purchase-amount"i {return "purchaseAmount"} purchaseCurrency = "purchaseCurrency"i / "purchase-currency"i {return "purchaseCurrency"} -columns = "columns"i { +columns = "columns"i { isColumnsContext = true; return "columns"; } +view = "view"i {return "view"} // Value transformation rules values diff --git a/src/libs/SearchParser/searchParser.js b/src/libs/SearchParser/searchParser.js index 4c74ad6062d8..8d7da6a2252d 100644 --- a/src/libs/SearchParser/searchParser.js +++ b/src/libs/SearchParser/searchParser.js @@ -248,34 +248,35 @@ function peg$parse(input, options) { var peg$c61 = "purchasecurrency"; var peg$c62 = "purchase-currency"; var peg$c63 = "columns"; - var peg$c64 = "per-diem"; - var peg$c65 = "drafts"; - var peg$c66 = "draft"; - var peg$c67 = "original-amount"; - var peg$c68 = "tax"; - var peg$c69 = "policy-name"; - var peg$c70 = "bank-account"; - var peg$c71 = "long-report-id"; - var peg$c72 = "exported-to"; - var peg$c73 = "exchange-rate"; - var peg$c74 = "reimbursable-total"; - var peg$c75 = "non-reimbursable-total"; - var peg$c76 = "group-from"; - var peg$c77 = "group-expenses"; - var peg$c78 = "group-total"; - var peg$c79 = "group-card"; - var peg$c80 = "group-feed"; - var peg$c81 = "group-bank-account"; - var peg$c82 = "group-withdrawn"; - var peg$c83 = "group-withdrawal-id"; - var peg$c84 = "!="; - var peg$c85 = ">="; - var peg$c86 = ">"; - var peg$c87 = "<="; - var peg$c88 = "<"; - var peg$c89 = "\u201C"; - var peg$c90 = "\u201D"; - var peg$c91 = "\""; + var peg$c64 = "view"; + var peg$c65 = "per-diem"; + var peg$c66 = "drafts"; + var peg$c67 = "draft"; + var peg$c68 = "original-amount"; + var peg$c69 = "tax"; + var peg$c70 = "policy-name"; + var peg$c71 = "bank-account"; + var peg$c72 = "long-report-id"; + var peg$c73 = "exported-to"; + var peg$c74 = "exchange-rate"; + var peg$c75 = "reimbursable-total"; + var peg$c76 = "non-reimbursable-total"; + var peg$c77 = "group-from"; + var peg$c78 = "group-expenses"; + var peg$c79 = "group-total"; + var peg$c80 = "group-card"; + var peg$c81 = "group-feed"; + var peg$c82 = "group-bank-account"; + var peg$c83 = "group-withdrawn"; + var peg$c84 = "group-withdrawal-id"; + var peg$c85 = "!="; + var peg$c86 = ">="; + var peg$c87 = ">"; + var peg$c88 = "<="; + var peg$c89 = "<"; + var peg$c90 = "\u201C"; + var peg$c91 = "\u201D"; + var peg$c92 = "\""; var peg$r0 = /^[^ \t\r\n\xA0]/; var peg$r1 = /^[ \t\r\n\xA0,:=<>!]/; @@ -361,50 +362,51 @@ function peg$parse(input, options) { var peg$e66 = peg$literalExpectation("purchaseCurrency", true); var peg$e67 = peg$literalExpectation("purchase-currency", true); var peg$e68 = peg$literalExpectation("columns", true); - var peg$e69 = peg$literalExpectation("per-diem", true); - var peg$e70 = peg$literalExpectation("drafts", true); - var peg$e71 = peg$literalExpectation("draft", true); - var peg$e72 = peg$literalExpectation("original-amount", true); - var peg$e73 = peg$literalExpectation("tax", true); - var peg$e74 = peg$literalExpectation("policy-name", true); - var peg$e75 = peg$literalExpectation("bank-account", true); - var peg$e76 = peg$literalExpectation("long-report-id", true); - var peg$e77 = peg$literalExpectation("exported-to", true); - var peg$e78 = peg$literalExpectation("exchange-rate", true); - var peg$e79 = peg$literalExpectation("reimbursable-total", true); - var peg$e80 = peg$literalExpectation("non-reimbursable-total", true); - var peg$e81 = peg$literalExpectation("group-from", true); - var peg$e82 = peg$literalExpectation("group-expenses", true); - var peg$e83 = peg$literalExpectation("group-total", true); - var peg$e84 = peg$literalExpectation("group-card", true); - var peg$e85 = peg$literalExpectation("group-feed", true); - var peg$e86 = peg$literalExpectation("group-bank-account", true); - var peg$e87 = peg$literalExpectation("group-withdrawn", true); - var peg$e88 = peg$literalExpectation("group-withdrawal-id", true); - var peg$e89 = peg$otherExpectation("operator"); - var peg$e90 = peg$classExpectation([":", "="], false, false); - var peg$e91 = peg$literalExpectation("!=", false); - var peg$e92 = peg$literalExpectation(">=", false); - var peg$e93 = peg$literalExpectation(">", false); - var peg$e94 = peg$literalExpectation("<=", false); - var peg$e95 = peg$literalExpectation("<", false); - var peg$e96 = peg$otherExpectation("word"); - var peg$e97 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e98 = peg$otherExpectation("whitespace"); - var peg$e99 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); - var peg$e100 = peg$otherExpectation("quote"); - var peg$e101 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); - var peg$e102 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); - var peg$e103 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); - var peg$e104 = peg$literalExpectation("\u201C", false); - var peg$e105 = peg$literalExpectation("\u201D", false); - var peg$e106 = peg$literalExpectation("\"", false); - var peg$e107 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e108 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); - var peg$e109 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); - var peg$e110 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); - var peg$e111 = peg$classExpectation([","], false, false); - var peg$e112 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); + var peg$e69 = peg$literalExpectation("view", true); + var peg$e70 = peg$literalExpectation("per-diem", true); + var peg$e71 = peg$literalExpectation("drafts", true); + var peg$e72 = peg$literalExpectation("draft", true); + var peg$e73 = peg$literalExpectation("original-amount", true); + var peg$e74 = peg$literalExpectation("tax", true); + var peg$e75 = peg$literalExpectation("policy-name", true); + var peg$e76 = peg$literalExpectation("bank-account", true); + var peg$e77 = peg$literalExpectation("long-report-id", true); + var peg$e78 = peg$literalExpectation("exported-to", true); + var peg$e79 = peg$literalExpectation("exchange-rate", true); + var peg$e80 = peg$literalExpectation("reimbursable-total", true); + var peg$e81 = peg$literalExpectation("non-reimbursable-total", true); + var peg$e82 = peg$literalExpectation("group-from", true); + var peg$e83 = peg$literalExpectation("group-expenses", true); + var peg$e84 = peg$literalExpectation("group-total", true); + var peg$e85 = peg$literalExpectation("group-card", true); + var peg$e86 = peg$literalExpectation("group-feed", true); + var peg$e87 = peg$literalExpectation("group-bank-account", true); + var peg$e88 = peg$literalExpectation("group-withdrawn", true); + var peg$e89 = peg$literalExpectation("group-withdrawal-id", true); + var peg$e90 = peg$otherExpectation("operator"); + var peg$e91 = peg$classExpectation([":", "="], false, false); + var peg$e92 = peg$literalExpectation("!=", false); + var peg$e93 = peg$literalExpectation(">=", false); + var peg$e94 = peg$literalExpectation(">", false); + var peg$e95 = peg$literalExpectation("<=", false); + var peg$e96 = peg$literalExpectation("<", false); + var peg$e97 = peg$otherExpectation("word"); + var peg$e98 = peg$classExpectation([" ", ",", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e99 = peg$otherExpectation("whitespace"); + var peg$e100 = peg$classExpectation([" ", "\t", "\r", "\n", "\xA0"], false, false); + var peg$e101 = peg$otherExpectation("quote"); + var peg$e102 = peg$classExpectation([" ", ",", "\"", "\u201D", "\u201C", "\t", "\n", "\r", "\xA0"], true, false); + var peg$e103 = peg$classExpectation(["\"", ["\u201C", "\u201D"]], false, false); + var peg$e104 = peg$classExpectation(["\"", "\u201D", "\u201C", "\r", "\n"], true, false); + var peg$e105 = peg$literalExpectation("\u201C", false); + var peg$e106 = peg$literalExpectation("\u201D", false); + var peg$e107 = peg$literalExpectation("\"", false); + var peg$e108 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e109 = peg$classExpectation([["a", "z"], ["A", "Z"], ["0", "9"]], false, false); + var peg$e110 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0"], false, false); + var peg$e111 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ["a", "z"], ["A", "Z"]], false, false); + var peg$e112 = peg$classExpectation([","], false, false); + var peg$e113 = peg$classExpectation([" ", "\t", "\n", "\r", "\xA0", ","], false, false); var peg$f0 = function(filters) { return applyDefaults(filters); }; var peg$f1 = function(head, tail) { @@ -536,59 +538,60 @@ function peg$parse(input, options) { var peg$f50 = function() {return "is"; }; var peg$f51 = function() {return "purchaseAmount"}; var peg$f52 = function() {return "purchaseCurrency"}; - var peg$f53 = function() { + var peg$f53 = function() { isColumnsContext = true; return "columns"; }; - var peg$f54 = function() { return isColumnsContext; }; - var peg$f55 = function() { return "perDiem"; }; - var peg$f56 = function() { return "drafts"; }; - var peg$f57 = function() { return "originalamount"; }; - var peg$f58 = function() { return "taxAmount"; }; - var peg$f59 = function() { return "taxrate"; }; - var peg$f60 = function() { return "policyname"; }; - var peg$f61 = function() { return "withdrawalID"; }; - var peg$f62 = function() { return "bankAccount"; }; - var peg$f63 = function() { return "reportID"; }; - var peg$f64 = function() { return "base62ReportID"; }; - var peg$f65 = function() { return "exportedto"; }; - var peg$f66 = function() { return "exchangeRate"; }; - var peg$f67 = function() { return "reimbursableTotal"; }; - var peg$f68 = function() { return "nonReimbursableTotal"; }; - var peg$f69 = function() { return "groupFrom"; }; - var peg$f70 = function() { return "groupExpenses"; }; - var peg$f71 = function() { return "groupTotal"; }; - var peg$f72 = function() { return "groupCard"; }; - var peg$f73 = function() { return "groupFeed"; }; - var peg$f74 = function() { return "groupBankAccount"; }; - var peg$f75 = function() { return "groupWithdrawn"; }; - var peg$f76 = function() { return "groupWithdrawalID"; }; - var peg$f77 = function() { return "eq"; }; - var peg$f78 = function() { return "neq"; }; - var peg$f79 = function() { return "gte"; }; - var peg$f80 = function() { return "gt"; }; - var peg$f81 = function() { return "lte"; }; - var peg$f82 = function() { return "lt"; }; - var peg$f83 = function(o) { + var peg$f54 = function() {return "view"}; + var peg$f55 = function() { return isColumnsContext; }; + var peg$f56 = function() { return "perDiem"; }; + var peg$f57 = function() { return "drafts"; }; + var peg$f58 = function() { return "originalamount"; }; + var peg$f59 = function() { return "taxAmount"; }; + var peg$f60 = function() { return "taxrate"; }; + var peg$f61 = function() { return "policyname"; }; + var peg$f62 = function() { return "withdrawalID"; }; + var peg$f63 = function() { return "bankAccount"; }; + var peg$f64 = function() { return "reportID"; }; + var peg$f65 = function() { return "base62ReportID"; }; + var peg$f66 = function() { return "exportedto"; }; + var peg$f67 = function() { return "exchangeRate"; }; + var peg$f68 = function() { return "reimbursableTotal"; }; + var peg$f69 = function() { return "nonReimbursableTotal"; }; + var peg$f70 = function() { return "groupFrom"; }; + var peg$f71 = function() { return "groupExpenses"; }; + var peg$f72 = function() { return "groupTotal"; }; + var peg$f73 = function() { return "groupCard"; }; + var peg$f74 = function() { return "groupFeed"; }; + var peg$f75 = function() { return "groupBankAccount"; }; + var peg$f76 = function() { return "groupWithdrawn"; }; + var peg$f77 = function() { return "groupWithdrawalID"; }; + var peg$f78 = function() { return "eq"; }; + var peg$f79 = function() { return "neq"; }; + var peg$f80 = function() { return "gte"; }; + var peg$f81 = function() { return "gt"; }; + var peg$f82 = function() { return "lte"; }; + var peg$f83 = function() { return "lt"; }; + var peg$f84 = function(o) { if (nameOperator) { expectingNestedQuote = (o === "eq"); // Use simple parser if no valid operator is found } isColumnsContext = false; return o; }; - var peg$f84 = function(chars) { return chars.join("").trim(); }; - var peg$f85 = function() { + var peg$f85 = function(chars) { return chars.join("").trim(); }; + var peg$f86 = function() { isColumnsContext = false; return "and"; }; - var peg$f86 = function() { return expectingNestedQuote; }; - var peg$f87 = function(start, inner, end) { //handle no-breaking space + var peg$f87 = function() { return expectingNestedQuote; }; + var peg$f88 = function(start, inner, end) { //handle no-breaking space return [...start, '"', ...inner, '"', ...end].join(""); }; - var peg$f88 = function(start) {return "“"}; - var peg$f89 = function(start) {return "”"}; - var peg$f90 = function(start) {return "\""}; - var peg$f91 = function(start, inner, end) { + var peg$f89 = function(start) {return "“"}; + var peg$f90 = function(start) {return "”"}; + var peg$f91 = function(start) {return "\""}; + var peg$f92 = function(start, inner, end) { return [...start, '"', ...inner, '"'].join(""); }; var peg$currPos = options.peg$currPos | 0; @@ -1235,6 +1238,9 @@ function peg$parse(input, options) { s1 = peg$parsegroupBy(); if (s1 === peg$FAILED) { s1 = peg$parsecolumns(); + if (s1 === peg$FAILED) { + s1 = peg$parseview(); + } } } } @@ -2425,12 +2431,32 @@ function peg$parse(input, options) { return s0; } + function peg$parseview() { + var s0, s1; + + s0 = peg$currPos; + s1 = input.substr(peg$currPos, 4); + if (s1.toLowerCase() === peg$c64) { + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$e69); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$f54(); + } + s0 = s1; + + return s0; + } + function peg$parsevalues() { var s0, s1, s2; s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f54(); + s1 = peg$f55(); if (s1) { s1 = undefined; } else { @@ -2529,11 +2555,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 8); - if (s1.toLowerCase() === peg$c64) { + if (s1.toLowerCase() === peg$c65) { peg$currPos += 8; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e69); } + if (peg$silentFails === 0) { peg$fail(peg$e70); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2548,7 +2574,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f55(); + s0 = peg$f56(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2566,19 +2592,19 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 6); - if (s1.toLowerCase() === peg$c65) { + if (s1.toLowerCase() === peg$c66) { peg$currPos += 6; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e70); } + if (peg$silentFails === 0) { peg$fail(peg$e71); } } if (s1 === peg$FAILED) { s1 = input.substr(peg$currPos, 5); - if (s1.toLowerCase() === peg$c66) { + if (s1.toLowerCase() === peg$c67) { peg$currPos += 5; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e71); } + if (peg$silentFails === 0) { peg$fail(peg$e72); } } } if (s1 !== peg$FAILED) { @@ -2594,7 +2620,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f56(); + s0 = peg$f57(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2612,11 +2638,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c67) { + if (s1.toLowerCase() === peg$c68) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e72); } + if (peg$silentFails === 0) { peg$fail(peg$e73); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2631,7 +2657,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f57(); + s0 = peg$f58(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2649,11 +2675,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 3); - if (s1.toLowerCase() === peg$c68) { + if (s1.toLowerCase() === peg$c69) { peg$currPos += 3; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e73); } + if (peg$silentFails === 0) { peg$fail(peg$e74); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2668,7 +2694,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f58(); + s0 = peg$f59(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2705,7 +2731,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f59(); + s0 = peg$f60(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2723,11 +2749,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c69) { + if (s1.toLowerCase() === peg$c70) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e74); } + if (peg$silentFails === 0) { peg$fail(peg$e75); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2742,7 +2768,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f60(); + s0 = peg$f61(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2779,7 +2805,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f61(); + s0 = peg$f62(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2797,11 +2823,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 12); - if (s1.toLowerCase() === peg$c70) { + if (s1.toLowerCase() === peg$c71) { peg$currPos += 12; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e75); } + if (peg$silentFails === 0) { peg$fail(peg$e76); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2816,7 +2842,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f62(); + s0 = peg$f63(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2834,11 +2860,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c71) { + if (s1.toLowerCase() === peg$c72) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e76); } + if (peg$silentFails === 0) { peg$fail(peg$e77); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2853,7 +2879,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f63(); + s0 = peg$f64(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2890,7 +2916,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f64(); + s0 = peg$f65(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2908,11 +2934,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c72) { + if (s1.toLowerCase() === peg$c73) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e77); } + if (peg$silentFails === 0) { peg$fail(peg$e78); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2927,7 +2953,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f65(); + s0 = peg$f66(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2945,11 +2971,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 13); - if (s1.toLowerCase() === peg$c73) { + if (s1.toLowerCase() === peg$c74) { peg$currPos += 13; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e78); } + if (peg$silentFails === 0) { peg$fail(peg$e79); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -2964,7 +2990,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f66(); + s0 = peg$f67(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -2982,11 +3008,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c74) { + if (s1.toLowerCase() === peg$c75) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e79); } + if (peg$silentFails === 0) { peg$fail(peg$e80); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3001,7 +3027,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f67(); + s0 = peg$f68(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3019,11 +3045,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 22); - if (s1.toLowerCase() === peg$c75) { + if (s1.toLowerCase() === peg$c76) { peg$currPos += 22; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e80); } + if (peg$silentFails === 0) { peg$fail(peg$e81); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3038,7 +3064,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f68(); + s0 = peg$f69(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3056,11 +3082,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c76) { + if (s1.toLowerCase() === peg$c77) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e81); } + if (peg$silentFails === 0) { peg$fail(peg$e82); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3075,7 +3101,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f69(); + s0 = peg$f70(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3093,11 +3119,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 14); - if (s1.toLowerCase() === peg$c77) { + if (s1.toLowerCase() === peg$c78) { peg$currPos += 14; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e82); } + if (peg$silentFails === 0) { peg$fail(peg$e83); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3112,7 +3138,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f70(); + s0 = peg$f71(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3130,11 +3156,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 11); - if (s1.toLowerCase() === peg$c78) { + if (s1.toLowerCase() === peg$c79) { peg$currPos += 11; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e83); } + if (peg$silentFails === 0) { peg$fail(peg$e84); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3149,7 +3175,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f71(); + s0 = peg$f72(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3167,11 +3193,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c79) { + if (s1.toLowerCase() === peg$c80) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e84); } + if (peg$silentFails === 0) { peg$fail(peg$e85); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3186,7 +3212,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f72(); + s0 = peg$f73(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3204,11 +3230,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 10); - if (s1.toLowerCase() === peg$c80) { + if (s1.toLowerCase() === peg$c81) { peg$currPos += 10; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e85); } + if (peg$silentFails === 0) { peg$fail(peg$e86); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3223,7 +3249,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f73(); + s0 = peg$f74(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3241,11 +3267,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 18); - if (s1.toLowerCase() === peg$c81) { + if (s1.toLowerCase() === peg$c82) { peg$currPos += 18; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e86); } + if (peg$silentFails === 0) { peg$fail(peg$e87); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3260,7 +3286,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f74(); + s0 = peg$f75(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3278,11 +3304,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 15); - if (s1.toLowerCase() === peg$c82) { + if (s1.toLowerCase() === peg$c83) { peg$currPos += 15; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e87); } + if (peg$silentFails === 0) { peg$fail(peg$e88); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3297,7 +3323,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f75(); + s0 = peg$f76(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3315,11 +3341,11 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = input.substr(peg$currPos, 19); - if (s1.toLowerCase() === peg$c83) { + if (s1.toLowerCase() === peg$c84) { peg$currPos += 19; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e88); } + if (peg$silentFails === 0) { peg$fail(peg$e89); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3334,7 +3360,7 @@ function peg$parse(input, options) { } if (s2 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f76(); + s0 = peg$f77(); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3357,81 +3383,81 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e90); } + if (peg$silentFails === 0) { peg$fail(peg$e91); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f77(); + s1 = peg$f78(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c84) { - s1 = peg$c84; + if (input.substr(peg$currPos, 2) === peg$c85) { + s1 = peg$c85; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e91); } + if (peg$silentFails === 0) { peg$fail(peg$e92); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f78(); + s1 = peg$f79(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c85) { - s1 = peg$c85; + if (input.substr(peg$currPos, 2) === peg$c86) { + s1 = peg$c86; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e92); } + if (peg$silentFails === 0) { peg$fail(peg$e93); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f79(); + s1 = peg$f80(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 62) { - s1 = peg$c86; + s1 = peg$c87; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e93); } + if (peg$silentFails === 0) { peg$fail(peg$e94); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f80(); + s1 = peg$f81(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; - if (input.substr(peg$currPos, 2) === peg$c87) { - s1 = peg$c87; + if (input.substr(peg$currPos, 2) === peg$c88) { + s1 = peg$c88; peg$currPos += 2; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e94); } + if (peg$silentFails === 0) { peg$fail(peg$e95); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f81(); + s1 = peg$f82(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 60) { - s1 = peg$c88; + s1 = peg$c89; peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e95); } + if (peg$silentFails === 0) { peg$fail(peg$e96); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f82(); + s1 = peg$f83(); } s0 = s1; } @@ -3442,7 +3468,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e89); } + if (peg$silentFails === 0) { peg$fail(peg$e90); } } return s0; @@ -3455,7 +3481,7 @@ function peg$parse(input, options) { s1 = peg$parseoperator(); if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f83(s1); + s1 = peg$f84(s1); } s0 = s1; @@ -3473,7 +3499,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { @@ -3483,7 +3509,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } } } else { @@ -3491,13 +3517,13 @@ function peg$parse(input, options) { } if (s1 !== peg$FAILED) { peg$savedPos = s0; - s1 = peg$f84(s1); + s1 = peg$f85(s1); } s0 = s1; peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e96); } + if (peg$silentFails === 0) { peg$fail(peg$e97); } } return s0; @@ -3509,7 +3535,7 @@ function peg$parse(input, options) { s0 = peg$currPos; s1 = peg$parse_(); peg$savedPos = s0; - s1 = peg$f85(); + s1 = peg$f86(); s0 = s1; return s0; @@ -3525,7 +3551,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } while (s1 !== peg$FAILED) { s0.push(s1); @@ -3534,12 +3560,12 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e99); } + if (peg$silentFails === 0) { peg$fail(peg$e100); } } } peg$silentFails--; s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e98); } + if (peg$silentFails === 0) { peg$fail(peg$e99); } return s0; } @@ -3549,7 +3575,7 @@ function peg$parse(input, options) { s0 = peg$currPos; peg$savedPos = peg$currPos; - s1 = peg$f86(); + s1 = peg$f87(); if (s1) { s1 = undefined; } else { @@ -3586,7 +3612,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3595,7 +3621,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } } s2 = input.charAt(peg$currPos); @@ -3603,7 +3629,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s2 !== peg$FAILED) { s3 = []; @@ -3612,7 +3638,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -3621,7 +3647,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } } s4 = input.charAt(peg$currPos); @@ -3629,7 +3655,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s4 !== peg$FAILED) { s5 = []; @@ -3638,7 +3664,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } while (s6 !== peg$FAILED) { s5.push(s6); @@ -3647,11 +3673,11 @@ function peg$parse(input, options) { peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e97); } + if (peg$silentFails === 0) { peg$fail(peg$e98); } } } peg$savedPos = s0; - s0 = peg$f87(s1, s3, s5); + s0 = peg$f88(s1, s3, s5); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3663,7 +3689,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } return s0; @@ -3680,7 +3706,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3689,7 +3715,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e101); } + if (peg$silentFails === 0) { peg$fail(peg$e102); } } } s2 = input.charAt(peg$currPos); @@ -3697,7 +3723,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s2 !== peg$FAILED) { s3 = []; @@ -3706,7 +3732,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -3722,15 +3748,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c89; + s6 = peg$c90; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f88(s1); + s4 = peg$f89(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3753,15 +3779,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c90; + s6 = peg$c91; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e105); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f89(s1); + s4 = peg$f90(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3784,15 +3810,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c91; + s6 = peg$c92; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e106); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f90(s1); + s4 = peg$f91(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3811,7 +3837,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e103); } + if (peg$silentFails === 0) { peg$fail(peg$e104); } } if (s4 === peg$FAILED) { s4 = peg$currPos; @@ -3827,15 +3853,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8220) { - s6 = peg$c89; + s6 = peg$c90; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e104); } + if (peg$silentFails === 0) { peg$fail(peg$e105); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f88(s1); + s4 = peg$f89(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3858,15 +3884,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 8221) { - s6 = peg$c90; + s6 = peg$c91; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e105); } + if (peg$silentFails === 0) { peg$fail(peg$e106); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f89(s1); + s4 = peg$f90(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3889,15 +3915,15 @@ function peg$parse(input, options) { } if (s5 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 34) { - s6 = peg$c91; + s6 = peg$c92; peg$currPos++; } else { s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e106); } + if (peg$silentFails === 0) { peg$fail(peg$e107); } } if (s6 !== peg$FAILED) { peg$savedPos = s4; - s4 = peg$f90(s1); + s4 = peg$f91(s1); } else { peg$currPos = s4; s4 = peg$FAILED; @@ -3913,7 +3939,7 @@ function peg$parse(input, options) { s4 = peg$parseclosingQuote(); if (s4 !== peg$FAILED) { peg$savedPos = s0; - s0 = peg$f91(s1, s3, s4); + s0 = peg$f92(s1, s3, s4); } else { peg$currPos = s0; s0 = peg$FAILED; @@ -3925,7 +3951,7 @@ function peg$parse(input, options) { peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e100); } + if (peg$silentFails === 0) { peg$fail(peg$e101); } } return s0; @@ -3940,7 +3966,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s1 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e102); } + if (peg$silentFails === 0) { peg$fail(peg$e103); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; @@ -3978,7 +4004,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e107); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -3987,7 +4013,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e107); } + if (peg$silentFails === 0) { peg$fail(peg$e108); } } } s2 = []; @@ -3996,7 +4022,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e108); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } while (s3 !== peg$FAILED) { s2.push(s3); @@ -4005,7 +4031,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s3 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e108); } + if (peg$silentFails === 0) { peg$fail(peg$e109); } } } s3 = []; @@ -4014,7 +4040,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e109); } + if (peg$silentFails === 0) { peg$fail(peg$e110); } } while (s4 !== peg$FAILED) { s3.push(s4); @@ -4023,7 +4049,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s4 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e109); } + if (peg$silentFails === 0) { peg$fail(peg$e110); } } } s4 = peg$parseoperator(); @@ -4042,7 +4068,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e110); } + if (peg$silentFails === 0) { peg$fail(peg$e111); } } while (s2 !== peg$FAILED) { s1.push(s2); @@ -4051,7 +4077,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s2 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e110); } + if (peg$silentFails === 0) { peg$fail(peg$e111); } } } s2 = peg$currPos; @@ -4098,7 +4124,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e111); } + if (peg$silentFails === 0) { peg$fail(peg$e112); } } } } @@ -4114,7 +4140,7 @@ function peg$parse(input, options) { peg$currPos++; } else { s0 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$e112); } + if (peg$silentFails === 0) { peg$fail(peg$e113); } } if (s0 === peg$FAILED) { s0 = peg$currPos; @@ -4158,13 +4184,14 @@ function peg$parse(input, options) { status: "", sortBy: "date", sortOrder: "desc", + view: "table", }; let rawFilterList = []; let userProvidedSortBy = false; // List fields where you cannot prefix it with "-" to negate it const nonNegatableKeys = new Set([ - "type", "keyword", "groupCurrency", "groupBy", "columns" + "type", "keyword", "groupCurrency", "groupBy", "columns", "view" ]); function isDefaultSortValue(sortBy) { diff --git a/src/libs/SearchParser/searchParser.peggy b/src/libs/SearchParser/searchParser.peggy index a0301ee29ee2..c384b7f33d3b 100644 --- a/src/libs/SearchParser/searchParser.peggy +++ b/src/libs/SearchParser/searchParser.peggy @@ -47,13 +47,14 @@ status: "", sortBy: "date", sortOrder: "desc", + view: "table", }; let rawFilterList = []; let userProvidedSortBy = false; // List fields where you cannot prefix it with "-" to negate it const nonNegatableKeys = new Set([ - "type", "keyword", "groupCurrency", "groupBy", "columns" + "type", "keyword", "groupCurrency", "groupBy", "columns", "view" ]); function isDefaultSortValue(sortBy) { @@ -260,7 +261,7 @@ filterKey return k; } -defaultKey "default key" = @(type / status / sortBy / sortOrder / policyID / groupBy / columns) +defaultKey "default key" = @(type / status / sortBy / sortOrder / policyID / groupBy / columns / view) identifier = (","+)? parts:(values / quotedString / alphanumeric)|1.., ","+| empty:(","+)? { From 1abaa8e8b8b3ea69a72211902c3e61955922ab07 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 14:02:04 -0800 Subject: [PATCH 02/11] Remove future chart types from consts --- src/CONST/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index e1bd802cff97..1d048f949b03 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -7068,8 +7068,6 @@ const CONST = { VIEW: { TABLE: 'table', BAR: 'bar', - LINE: 'line', - PIE: 'pie', }, SYNTAX_FILTER_KEYS: { TYPE: 'type', From c157b9f2afa8a07ad2d11f11e160e0c3263e0ec2 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 14:17:17 -0800 Subject: [PATCH 03/11] Update tests --- tests/unit/SearchParserTest.ts | 89 ++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/tests/unit/SearchParserTest.ts b/tests/unit/SearchParserTest.ts index 32d7b6d79c69..d5e0578130f1 100644 --- a/tests/unit/SearchParserTest.ts +++ b/tests/unit/SearchParserTest.ts @@ -11,6 +11,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: null, }, }, @@ -21,6 +22,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -59,6 +61,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -97,6 +100,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -143,6 +147,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'category', @@ -157,6 +162,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -171,6 +177,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -185,6 +192,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'tag', @@ -199,6 +207,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -213,6 +222,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -243,6 +253,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -273,6 +284,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -303,6 +315,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -373,6 +386,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -395,6 +409,7 @@ const tests = [ status: '', sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: null, }, }, @@ -405,6 +420,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -435,6 +451,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -489,6 +506,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_TYPE, @@ -503,6 +521,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWAL_ID, @@ -517,6 +536,7 @@ const tests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.WITHDRAWN, @@ -531,6 +551,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.IS, @@ -545,6 +566,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.IS, @@ -559,6 +581,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.IS, @@ -573,6 +596,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.IS, @@ -587,6 +611,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS, @@ -601,6 +626,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS, @@ -615,6 +641,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.HAS, @@ -629,6 +656,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.IS, @@ -643,6 +671,7 @@ const tests = [ status: '', sortBy: CONST.SEARCH.SYNTAX_FILTER_KEYS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: 'table', filters: { operator: CONST.SEARCH.SYNTAX_OPERATORS.EQUAL_TO, left: CONST.SEARCH.SYNTAX_FILTER_KEYS.IS, @@ -664,6 +693,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -678,6 +708,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -692,6 +723,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -706,6 +738,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'keyword', @@ -720,6 +753,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -750,6 +784,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'and', left: { @@ -772,6 +807,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'expenseType', @@ -786,6 +822,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', columns: ['originalamount', 'taxAmount', 'base62ReportID'], filters: null, }, @@ -797,6 +834,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', columns: 'taxAmount', filters: null, }, @@ -808,6 +846,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', filters: { operator: 'eq', left: 'merchant', @@ -822,6 +861,7 @@ const keywordTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', columns: ['groupBankAccount', 'groupFrom'], filters: { left: 'action', @@ -830,6 +870,55 @@ const keywordTests = [ }, }, }, + // View parameter tests + { + query: 'type:expense view:bar', + expected: { + type: 'expense', + status: CONST.SEARCH.STATUS.EXPENSE.ALL, + sortBy: 'date', + sortOrder: 'desc', + view: 'bar', + filters: null, + }, + }, + { + query: 'type:expense view:table', + expected: { + type: 'expense', + status: CONST.SEARCH.STATUS.EXPENSE.ALL, + sortBy: 'date', + sortOrder: 'desc', + view: 'table', + filters: null, + }, + }, + { + query: 'type:expense status:all', // default view should be 'table' + expected: { + type: 'expense', + status: CONST.SEARCH.STATUS.EXPENSE.ALL, + sortBy: 'date', + sortOrder: 'desc', + view: 'table', + filters: null, + }, + }, + { + query: 'type:expense view:bar category:travel', + expected: { + type: 'expense', + status: CONST.SEARCH.STATUS.EXPENSE.ALL, + sortBy: 'date', + sortOrder: 'desc', + view: 'bar', + filters: { + operator: 'eq', + left: 'category', + right: 'travel', + }, + }, + }, ]; describe('search parser', () => { From 531068e8f7a18d8835ce5f3daf50e97f26860d4a Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 14:25:10 -0800 Subject: [PATCH 04/11] Fix test data in useSearchHighlightAndScrollTest to match type definitions --- tests/unit/useSearchHighlightAndScrollTest.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/useSearchHighlightAndScrollTest.ts b/tests/unit/useSearchHighlightAndScrollTest.ts index 30ac57245929..76e3a3b27f4f 100644 --- a/tests/unit/useSearchHighlightAndScrollTest.ts +++ b/tests/unit/useSearchHighlightAndScrollTest.ts @@ -54,6 +54,7 @@ describe('useSearchHighlightAndScroll', () => { hash: 123, recentSearchHash: 456, similarSearchHash: 789, + view: 'table', }, searchKey: undefined, shouldCalculateTotals: false, From 09da1da8803d1f5c04950c979392e0c62b244e6d Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 15:54:07 -0800 Subject: [PATCH 05/11] Fix Search tests to include view:table in expected query strings --- tests/unit/Search/SearchQueryUtilsTest.ts | 4 ++-- tests/unit/Search/SearchUIUtilsTest.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/Search/SearchQueryUtilsTest.ts b/tests/unit/Search/SearchQueryUtilsTest.ts index 2e3b935d15f6..20aaace0687e 100644 --- a/tests/unit/Search/SearchQueryUtilsTest.ts +++ b/tests/unit/Search/SearchQueryUtilsTest.ts @@ -41,7 +41,7 @@ jest.mock('@libs/PersonalDetailsUtils', () => { // The default query is generated by default values from parser, which are defined in grammar. // We don't want to test or mock the grammar and the parser, so we're simply defining this string directly here. -const defaultQuery = `type:expense sortBy:date sortOrder:desc`; +const defaultQuery = `type:expense sortBy:date sortOrder:desc view:table`; describe('SearchQueryUtils', () => { describe('getQueryWithUpdatedValues', () => { @@ -90,7 +90,7 @@ describe('SearchQueryUtils', () => { const result = getQueryWithUpdatedValues(userQuery); - expect(result).toEqual(`${defaultQuery} groupBy:reports from:12345`); + expect(result).toEqual(`type:expense sortBy:date sortOrder:desc groupBy:reports view:table from:12345`); }); test('deduplicates conflicting type filters keeping the last occurrence', () => { diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index 26b0329ab7a3..c181d52295c5 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -2717,7 +2717,7 @@ describe('SearchUIUtils', () => { .map((section) => section.menuItems) .flat(); - const expectedQueries = ['type:expense sortBy:date sortOrder:desc', 'type:expense-report sortBy:date sortOrder:desc', 'type:chat sortBy:date sortOrder:desc']; + const expectedQueries = ['type:expense sortBy:date sortOrder:desc view:table', 'type:expense-report sortBy:date sortOrder:desc view:table', 'type:chat sortBy:date sortOrder:desc view:table']; for (const [index, item] of menuItems.entries()) { expect(item.searchQuery).toStrictEqual(expectedQueries.at(index)); From affb962dbac89f8d77dfcb0d4cbb030d3df13c0d Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 16:01:07 -0800 Subject: [PATCH 06/11] Run prettier --- tests/unit/Search/SearchUIUtilsTest.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index 7e6d135a9fad..dcf284e945d5 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -3161,7 +3161,11 @@ describe('SearchUIUtils', () => { .map((section) => section.menuItems) .flat(); - const expectedQueries = ['type:expense sortBy:date sortOrder:desc view:table', 'type:expense-report sortBy:date sortOrder:desc view:table', 'type:chat sortBy:date sortOrder:desc view:table']; + const expectedQueries = [ + 'type:expense sortBy:date sortOrder:desc view:table', + 'type:expense-report sortBy:date sortOrder:desc view:table', + 'type:chat sortBy:date sortOrder:desc view:table', + ]; for (const [index, item] of menuItems.entries()) { expect(item.searchQuery).toStrictEqual(expectedQueries.at(index)); From 7fe9d61615a17ed9c4f10dfaecaf39db3c9362a1 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 16:11:17 -0800 Subject: [PATCH 07/11] Fix queryJSON to match type definition --- tests/unit/Search/SearchUIUtilsTest.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index dcf284e945d5..c731632ef3b1 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -2410,6 +2410,7 @@ describe('SearchUIUtils', () => { status: '', sortBy: CONST.SEARCH.TABLE_COLUMNS.DATE, sortOrder: CONST.SEARCH.SORT_ORDER.DESC, + view: CONST.SEARCH.VIEW.TABLE, hash: 12345, flatFilters: [], inputQuery: 'type:expense groupBy:category', From e7a152010a875ea1c430d9acbd9dc961bb562360 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Mon, 26 Jan 2026 16:33:33 -0800 Subject: [PATCH 08/11] Fix test to use defaultQuery const --- src/CONST/index.ts | 2 +- tests/unit/Search/SearchQueryUtilsTest.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 0d22dfa1875f..1b4bee33ce0d 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -7074,9 +7074,9 @@ const CONST = { STATUS: 'status', SORT_BY: 'sortBy', SORT_ORDER: 'sortOrder', + VIEW: 'view', GROUP_BY: 'groupBy', COLUMNS: 'columns', - VIEW: 'view', }, VIEW: { TABLE: 'table', diff --git a/tests/unit/Search/SearchQueryUtilsTest.ts b/tests/unit/Search/SearchQueryUtilsTest.ts index 20aaace0687e..8b3b72d6b51e 100644 --- a/tests/unit/Search/SearchQueryUtilsTest.ts +++ b/tests/unit/Search/SearchQueryUtilsTest.ts @@ -90,7 +90,7 @@ describe('SearchQueryUtils', () => { const result = getQueryWithUpdatedValues(userQuery); - expect(result).toEqual(`type:expense sortBy:date sortOrder:desc groupBy:reports view:table from:12345`); + expect(result).toEqual(`${defaultQuery} groupBy:reports from:12345`); }); test('deduplicates conflicting type filters keeping the last occurrence', () => { From a4ab81cffa5b69cb15f0796894a4050f4b5a1c60 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Tue, 27 Jan 2026 09:17:33 -0800 Subject: [PATCH 09/11] Add view to nonNegatableKeys in autocompleteParser.peggy --- src/libs/SearchParser/autocompleteParser.js | 2 +- src/libs/SearchParser/autocompleteParser.peggy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/SearchParser/autocompleteParser.js b/src/libs/SearchParser/autocompleteParser.js index 8307816e7ed5..56bc52491d59 100644 --- a/src/libs/SearchParser/autocompleteParser.js +++ b/src/libs/SearchParser/autocompleteParser.js @@ -4025,7 +4025,7 @@ function peg$parse(input, options) { // List fields where you cannot prefix it with "-" to negate it const nonNegatableKeys = new Set([ - "type", "keyword", "groupCurrency", "groupBy", "columns" + "type", "keyword", "groupCurrency", "groupBy", "columns", "view" ]); diff --git a/src/libs/SearchParser/autocompleteParser.peggy b/src/libs/SearchParser/autocompleteParser.peggy index cda2b7c8c888..408dcffb4b8e 100644 --- a/src/libs/SearchParser/autocompleteParser.peggy +++ b/src/libs/SearchParser/autocompleteParser.peggy @@ -23,7 +23,7 @@ // List fields where you cannot prefix it with "-" to negate it const nonNegatableKeys = new Set([ - "type", "keyword", "groupCurrency", "groupBy", "columns" + "type", "keyword", "groupCurrency", "groupBy", "columns", "view" ]); } From 39b94952243a1fe7a383ae4022b5c6ef613185e4 Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Tue, 27 Jan 2026 10:25:51 -0800 Subject: [PATCH 10/11] Fix tests --- tests/unit/SearchParserTest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/SearchParserTest.ts b/tests/unit/SearchParserTest.ts index 3c116097ac6d..31c8f96bf551 100644 --- a/tests/unit/SearchParserTest.ts +++ b/tests/unit/SearchParserTest.ts @@ -930,6 +930,7 @@ const limitTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', limit: '10', filters: null, }, @@ -942,6 +943,7 @@ const limitTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', limit: '50', filters: { operator: 'eq', @@ -958,6 +960,7 @@ const limitTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', limit: '25', filters: null, }, @@ -970,6 +973,7 @@ const limitTests = [ status: CONST.SEARCH.STATUS.EXPENSE.ALL, sortBy: 'date', sortOrder: 'desc', + view: 'table', limit: '100', filters: { operator: 'eq', From db63fbabb4a1720db545dc9d307a0cbc75a99dea Mon Sep 17 00:00:00 2001 From: Mateusz Rajski Date: Tue, 27 Jan 2026 11:19:14 -0800 Subject: [PATCH 11/11] Do not add view to URL when it is not explicitly used in query --- src/libs/SearchQueryUtils.ts | 8 ++++++++ tests/unit/Search/SearchQueryUtilsTest.ts | 3 ++- tests/unit/Search/SearchUIUtilsTest.ts | 6 +----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/libs/SearchQueryUtils.ts b/src/libs/SearchQueryUtils.ts index 6c030db4568a..4c6db1f6594a 100644 --- a/src/libs/SearchQueryUtils.ts +++ b/src/libs/SearchQueryUtils.ts @@ -473,7 +473,15 @@ function buildSearchQueryString(queryJSON?: SearchQueryJSON) { const queryParts: string[] = []; const defaultQueryJSON = buildSearchQueryJSON(''); + // Check if view was explicitly set by the user (exists in rawFilterList) + const wasViewExplicitlySet = queryJSON?.rawFilterList?.some((filter) => filter.key === CONST.SEARCH.SYNTAX_ROOT_KEYS.VIEW); + for (const [, key] of Object.entries(CONST.SEARCH.SYNTAX_ROOT_KEYS)) { + // Skip view if it wasn't explicitly set by the user + if (key === CONST.SEARCH.SYNTAX_ROOT_KEYS.VIEW && !wasViewExplicitlySet) { + continue; + } + const existingFieldValue = queryJSON?.[key]; const queryFieldValue = existingFieldValue ?? defaultQueryJSON?.[key]; diff --git a/tests/unit/Search/SearchQueryUtilsTest.ts b/tests/unit/Search/SearchQueryUtilsTest.ts index 7aa02239dc60..67aff2e48b3b 100644 --- a/tests/unit/Search/SearchQueryUtilsTest.ts +++ b/tests/unit/Search/SearchQueryUtilsTest.ts @@ -41,7 +41,8 @@ jest.mock('@libs/PersonalDetailsUtils', () => { // The default query is generated by default values from parser, which are defined in grammar. // We don't want to test or mock the grammar and the parser, so we're simply defining this string directly here. -const defaultQuery = `type:expense sortBy:date sortOrder:desc view:table`; +// Note: view:table is not included because it's only added when explicitly set by the user. +const defaultQuery = `type:expense sortBy:date sortOrder:desc`; describe('SearchQueryUtils', () => { describe('getQueryWithUpdatedValues', () => { diff --git a/tests/unit/Search/SearchUIUtilsTest.ts b/tests/unit/Search/SearchUIUtilsTest.ts index c731632ef3b1..46bd6e0a8773 100644 --- a/tests/unit/Search/SearchUIUtilsTest.ts +++ b/tests/unit/Search/SearchUIUtilsTest.ts @@ -3162,11 +3162,7 @@ describe('SearchUIUtils', () => { .map((section) => section.menuItems) .flat(); - const expectedQueries = [ - 'type:expense sortBy:date sortOrder:desc view:table', - 'type:expense-report sortBy:date sortOrder:desc view:table', - 'type:chat sortBy:date sortOrder:desc view:table', - ]; + const expectedQueries = ['type:expense sortBy:date sortOrder:desc', 'type:expense-report sortBy:date sortOrder:desc', 'type:chat sortBy:date sortOrder:desc']; for (const [index, item] of menuItems.entries()) { expect(item.searchQuery).toStrictEqual(expectedQueries.at(index));