@react-querybuilder/core 8.10.0 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{arrayUtils-C9sO4qLO.mjs → arrayUtils-A_OXU9W1.mjs} +3 -3
- package/dist/{arrayUtils-C9sO4qLO.mjs.map → arrayUtils-A_OXU9W1.mjs.map} +1 -1
- package/dist/{basic-CDDA-KZa.d.ts → basic-DEc65Kng.d.mts} +21 -21
- package/dist/{basic-BmpEwexQ.d.mts → basic-Dd_M2f3M.d.ts} +21 -21
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +412 -278
- package/dist/cjs/react-querybuilder_core.cjs.development.js +53 -1
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +412 -278
- package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/{convertQuery-BUgyz1GA.mjs → convertQuery-CqX3rPvj.mjs} +3 -3
- package/dist/{convertQuery-BUgyz1GA.mjs.map → convertQuery-CqX3rPvj.mjs.map} +1 -1
- package/dist/{export-Ccjfea21.d.mts → export-Dy4FckB-.d.ts} +6 -6
- package/dist/{export-GUuxJ7zR.d.ts → export-t1V2N8pz.d.mts} +6 -6
- package/dist/formatQuery.d.mts +2 -2
- package/dist/formatQuery.d.ts +2 -2
- package/dist/formatQuery.mjs +6 -6
- package/dist/{import-Dxevzw_-.d.mts → import-Cz8canKo.d.mts} +3 -3
- package/dist/{import-D-hm1phN.d.ts → import-DtS9Ocx5.d.ts} +3 -3
- package/dist/{isRuleGroup-CGe_rb2w.mjs → isRuleGroup-CYcfPgbg.mjs} +2 -2
- package/dist/{isRuleGroup-CGe_rb2w.mjs.map → isRuleGroup-CYcfPgbg.mjs.map} +1 -1
- package/dist/lexer-C53tqS2p.js +406 -0
- package/dist/lexer-C53tqS2p.js.map +1 -0
- package/dist/optGroupUtils-B0hTpodo.js.map +1 -1
- package/dist/{optGroupUtils-DrubUpx0.mjs → optGroupUtils-VeZ3k7-1.mjs} +3 -3
- package/dist/optGroupUtils-VeZ3k7-1.mjs.map +1 -0
- package/dist/parseCEL.d.mts +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseCEL.js +760 -1095
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +763 -1099
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJSONata.mjs +3 -3
- package/dist/parseJsonLogic.d.mts +3 -3
- package/dist/parseJsonLogic.d.ts +3 -3
- package/dist/parseJsonLogic.mjs +5 -5
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.mjs +5 -5
- package/dist/{parseNumber-B_-sR6d5.mjs → parseNumber-CXdMVNFx.mjs} +2 -2
- package/dist/{parseNumber-B_-sR6d5.mjs.map → parseNumber-CXdMVNFx.mjs.map} +1 -1
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +2680 -3021
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +2684 -3026
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.mjs +4 -4
- package/dist/{prepareQueryObjects-CJNpnGcJ.mjs → prepareQueryObjects-DPCC-iHp.mjs} +4 -4
- package/dist/{prepareQueryObjects-CJNpnGcJ.mjs.map → prepareQueryObjects-DPCC-iHp.mjs.map} +1 -1
- package/dist/query-builder.css +1 -1
- package/dist/query-builder.css.map +1 -1
- package/dist/react-querybuilder_core.d.mts +412 -278
- package/dist/react-querybuilder_core.legacy-esm.d.ts +412 -278
- package/dist/react-querybuilder_core.legacy-esm.js +57 -9
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +50 -2
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +412 -278
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/styles/_main.scss +5 -0
- package/dist/{transformQuery-DHvtgDgZ.mjs → transformQuery-DCCpjtyq.mjs} +3 -3
- package/dist/{transformQuery-DHvtgDgZ.mjs.map → transformQuery-DCCpjtyq.mjs.map} +1 -1
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.mjs +2 -2
- package/package.json +9 -9
- package/dist/optGroupUtils-DrubUpx0.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as lc, n as isRuleGroupType, r as isRuleGroupTypeIC, t as isRuleGroup } from "./isRuleGroup-CYcfPgbg.mjs";
|
|
2
2
|
import { produce } from "immer";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/convertQuery.ts
|
|
@@ -71,5 +71,5 @@ const convertToIC = (rg) => {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
|
-
export {
|
|
75
|
-
//# sourceMappingURL=convertQuery-
|
|
74
|
+
export { convertToIC as n, convertFromIC as t };
|
|
75
|
+
//# sourceMappingURL=convertQuery-CqX3rPvj.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertQuery-
|
|
1
|
+
{"version":3,"file":"convertQuery-CqX3rPvj.mjs","names":["rules: (RuleGroupTypeIC | RuleType | string)[]"],"sources":["../src/utils/convertQuery.ts"],"sourcesContent":["import { produce } from 'immer';\nimport type {\n RuleGroupArray,\n RuleGroupType,\n RuleGroupTypeAny,\n RuleGroupTypeIC,\n RuleType,\n} from '../types';\nimport { isRuleGroup, isRuleGroupType, isRuleGroupTypeIC } from './isRuleGroup';\nimport { lc } from './misc';\n\nconst combinatorLevels = ['or', 'xor', 'and'] as const;\n\nconst isSameString = (a: unknown, b: string) => lc(a) === b;\n\nconst generateRuleGroupICWithConsistentCombinators = (\n rg: RuleGroupTypeIC,\n baseCombinatorLevel: number = 0\n): RuleGroupTypeIC => {\n const baseCombinator = combinatorLevels[baseCombinatorLevel];\n\n // oxlint-disable-next-line typescript/no-explicit-any\n if (!rg.rules.includes(baseCombinator as any)) {\n // No instances of this combinator, so group based on the next\n // combinator level if at least two levels remain\n return baseCombinatorLevel < combinatorLevels.length - 2\n ? generateRuleGroupICWithConsistentCombinators(rg, baseCombinatorLevel + 1)\n : rg;\n }\n\n return produce(rg, draft => {\n let cursor = 0;\n\n // Group all chains of combinators in the rule array that are not the base combinator\n while (cursor < draft.rules.length - 2) {\n if (isSameString(draft.rules[cursor + 1], baseCombinator)) {\n cursor += 2;\n continue;\n }\n\n const nextBaseCombinatorIndex = draft.rules.findIndex(\n (r, i) => i > cursor && typeof r === 'string' && lc(r) === baseCombinator\n );\n\n if (nextBaseCombinatorIndex === -1) {\n // No more instances of this combinator, so group all remaining rules and exit the loop\n draft.rules.splice(\n cursor,\n draft.rules.length,\n generateRuleGroupICWithConsistentCombinators(\n // oxlint-disable-next-line typescript/no-explicit-any\n { rules: draft.rules.slice(cursor) as any },\n baseCombinatorLevel + 1\n )\n );\n break;\n } else {\n // Group all rules between the current cursor and the next instance of the base combinator\n draft.rules.splice(\n cursor,\n nextBaseCombinatorIndex - cursor,\n generateRuleGroupICWithConsistentCombinators(\n // oxlint-disable-next-line typescript/no-explicit-any\n { rules: draft.rules.slice(cursor, nextBaseCombinatorIndex) as any },\n baseCombinatorLevel + 1\n )\n );\n }\n }\n });\n};\n\n/**\n * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}.\n *\n * This function is idempotent: {@link RuleGroupType} queries will be\n * returned as-is.\n *\n * @group Query Tools\n */\nexport const convertFromIC = <RG extends RuleGroupType = RuleGroupType>(\n rg: RuleGroupTypeAny\n): RG => {\n if (isRuleGroupType(rg)) {\n return rg as RG;\n }\n const processedRG = generateRuleGroupICWithConsistentCombinators(rg);\n const rulesAsMixedList = processedRG.rules.map(r =>\n typeof r === 'string' || !isRuleGroup(r) ? r : convertFromIC(r)\n );\n const combinator = rulesAsMixedList.length < 2 ? 'and' : (rulesAsMixedList[1] as string);\n const rules = rulesAsMixedList.filter(r => typeof r !== 'string') as RuleGroupArray;\n return { ...processedRG, combinator, rules } as RG;\n};\n\n/**\n * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}.\n *\n * This function is idempotent: {@link RuleGroupTypeIC} queries will be\n * returned as-is.\n *\n * @group Query Tools\n */\nexport const convertToIC = <RGIC extends RuleGroupTypeIC = RuleGroupTypeIC>(\n rg: RuleGroupTypeAny\n): RGIC => {\n if (isRuleGroupTypeIC(rg)) {\n return rg as RGIC;\n }\n const { combinator, ...queryWithoutCombinator } = rg;\n const rules: (RuleGroupTypeIC | RuleType | string)[] = [];\n const { length } = rg.rules;\n for (const [idx, r] of rg.rules.entries()) {\n if (isRuleGroup(r)) {\n rules.push(convertToIC(r));\n } else {\n rules.push(r);\n }\n if (combinator && idx < length - 1) {\n rules.push(combinator);\n }\n }\n return { ...queryWithoutCombinator, rules } as RGIC;\n};\n\n/**\n * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}. For a more explicit\n * operation, use {@link convertToIC}.\n *\n * @group Query Tools\n */\nfunction convertQuery(query: RuleGroupType): RuleGroupTypeIC;\n/**\n * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}. For a more explicit\n * operation, use {@link convertFromIC}.\n *\n * @group Query Tools\n */\nfunction convertQuery(query: RuleGroupTypeIC): RuleGroupType;\nfunction convertQuery(query: RuleGroupType | RuleGroupTypeIC): RuleGroupType | RuleGroupTypeIC {\n return isRuleGroupTypeIC(query) ? convertFromIC(query) : convertToIC(query);\n}\n\nexport { convertQuery };\n"],"mappings":";;;;AAWA,MAAM,mBAAmB;CAAC;CAAM;CAAO;CAAM;AAE7C,MAAM,gBAAgB,GAAY,MAAc,GAAG,EAAE,KAAK;AAE1D,MAAM,gDACJ,IACA,sBAA8B,MACV;CACpB,MAAM,iBAAiB,iBAAiB;AAGxC,KAAI,CAAC,GAAG,MAAM,SAAS,eAAsB,CAG3C,QAAO,sBAAsB,iBAAiB,SAAS,IACnD,6CAA6C,IAAI,sBAAsB,EAAE,GACzE;AAGN,QAAO,QAAQ,KAAI,UAAS;EAC1B,IAAI,SAAS;AAGb,SAAO,SAAS,MAAM,MAAM,SAAS,GAAG;AACtC,OAAI,aAAa,MAAM,MAAM,SAAS,IAAI,eAAe,EAAE;AACzD,cAAU;AACV;;GAGF,MAAM,0BAA0B,MAAM,MAAM,WACzC,GAAG,MAAM,IAAI,UAAU,OAAO,MAAM,YAAY,GAAG,EAAE,KAAK,eAC5D;AAED,OAAI,4BAA4B,IAAI;AAElC,UAAM,MAAM,OACV,QACA,MAAM,MAAM,QACZ,6CAEE,EAAE,OAAO,MAAM,MAAM,MAAM,OAAO,EAAS,EAC3C,sBAAsB,EACvB,CACF;AACD;SAGA,OAAM,MAAM,OACV,QACA,0BAA0B,QAC1B,6CAEE,EAAE,OAAO,MAAM,MAAM,MAAM,QAAQ,wBAAwB,EAAS,EACpE,sBAAsB,EACvB,CACF;;GAGL;;;;;;;;;;AAWJ,MAAa,iBACX,OACO;AACP,KAAI,gBAAgB,GAAG,CACrB,QAAO;CAET,MAAM,cAAc,6CAA6C,GAAG;CACpE,MAAM,mBAAmB,YAAY,MAAM,KAAI,MAC7C,OAAO,MAAM,YAAY,CAAC,YAAY,EAAE,GAAG,IAAI,cAAc,EAAE,CAChE;CACD,MAAM,aAAa,iBAAiB,SAAS,IAAI,QAAS,iBAAiB;CAC3E,MAAM,QAAQ,iBAAiB,QAAO,MAAK,OAAO,MAAM,SAAS;AACjE,QAAO;EAAE,GAAG;EAAa;EAAY;EAAO;;;;;;;;;;AAW9C,MAAa,eACX,OACS;AACT,KAAI,kBAAkB,GAAG,CACvB,QAAO;CAET,MAAM,EAAE,WAAY,GAAG,2BAA2B;CAClD,MAAMA,QAAiD,EAAE;CACzD,MAAM,EAAE,WAAW,GAAG;AACtB,MAAK,MAAM,CAAC,KAAK,MAAM,GAAG,MAAM,SAAS,EAAE;AACzC,MAAI,YAAY,EAAE,CAChB,OAAM,KAAK,YAAY,EAAE,CAAC;MAE1B,OAAM,KAAK,EAAE;AAEf,MAAI,cAAc,MAAM,SAAS,EAC/B,OAAM,KAAK,WAAW;;AAG1B,QAAO;EAAE,GAAG;EAAwB;EAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ValueSource, b as FullOptionList, c as RuleValidator, f as RuleGroupTypeAny, h as DefaultOperatorName, i as ParseNumbersPropConfig, l as ValidationMap, n as FullOperator, r as InputType, s as QueryValidator, t as FullField, u as ValidationResult, v as RuleType, y as FlexibleOptionList } from "./basic-Dd_M2f3M.js";
|
|
2
2
|
import { RulesLogic } from "json-logic-js";
|
|
3
3
|
import { Except } from "type-fest";
|
|
4
4
|
|
|
@@ -113,11 +113,11 @@ interface FormatQueryOptions {
|
|
|
113
113
|
quoteValuesWith?: string;
|
|
114
114
|
/**
|
|
115
115
|
* Validator function for the entire query. Can be the same function passed
|
|
116
|
-
* as `validator` prop to {@link QueryBuilder}.
|
|
116
|
+
* as `validator` prop to {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
117
117
|
*/
|
|
118
118
|
validator?: QueryValidator;
|
|
119
119
|
/**
|
|
120
|
-
* This can be the same {@link FullField} array passed to {@link QueryBuilder}, but
|
|
120
|
+
* This can be the same {@link FullField} array passed to {@link react-querybuilder!QueryBuilder QueryBuilder}, but
|
|
121
121
|
* really all you need to provide is the `name` and `validator` for each field.
|
|
122
122
|
*
|
|
123
123
|
* The full field object from this array, where the field's identifying property
|
|
@@ -125,7 +125,7 @@ interface FormatQueryOptions {
|
|
|
125
125
|
*/
|
|
126
126
|
fields?: FlexibleOptionList<FullField>;
|
|
127
127
|
/**
|
|
128
|
-
* This can be the same `getOperators` function passed to {@link QueryBuilder}.
|
|
128
|
+
* This can be the same `getOperators` function passed to {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
129
129
|
*
|
|
130
130
|
* The full operator object from this array, where the operator's identifying property
|
|
131
131
|
* matches the rule's `operator`, will be passed to the rule processor.
|
|
@@ -449,5 +449,5 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
|
|
|
449
449
|
*/
|
|
450
450
|
type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
451
451
|
//#endregion
|
|
452
|
-
export {
|
|
453
|
-
//# sourceMappingURL=export-
|
|
452
|
+
export { ValueProcessorOptions as _, FormatQueryOptions as a, NLTranslations as c, RQBJsonLogic as d, RuleGroupProcessor as f, ValueProcessorLegacy as g, ValueProcessorByRule as h, ExportOperatorMap as i, ParameterizedNamedSQL as l, SQLPreset as m, ExportFormat as n, GroupVariantCondition as o, RuleProcessor as p, ExportObjectFormats as r, NLTranslationKey as s, ConstituentWordOrder as t, ParameterizedSQL as u };
|
|
453
|
+
//# sourceMappingURL=export-Dy4FckB-.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ValueSource, b as FullOptionList, c as RuleValidator, f as RuleGroupTypeAny, h as DefaultOperatorName, i as ParseNumbersPropConfig, l as ValidationMap, n as FullOperator, r as InputType, s as QueryValidator, t as FullField, u as ValidationResult, v as RuleType, y as FlexibleOptionList } from "./basic-DEc65Kng.mjs";
|
|
2
2
|
import { RulesLogic } from "json-logic-js";
|
|
3
3
|
import { Except } from "type-fest";
|
|
4
4
|
|
|
@@ -113,11 +113,11 @@ interface FormatQueryOptions {
|
|
|
113
113
|
quoteValuesWith?: string;
|
|
114
114
|
/**
|
|
115
115
|
* Validator function for the entire query. Can be the same function passed
|
|
116
|
-
* as `validator` prop to {@link QueryBuilder}.
|
|
116
|
+
* as `validator` prop to {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
117
117
|
*/
|
|
118
118
|
validator?: QueryValidator;
|
|
119
119
|
/**
|
|
120
|
-
* This can be the same {@link FullField} array passed to {@link QueryBuilder}, but
|
|
120
|
+
* This can be the same {@link FullField} array passed to {@link react-querybuilder!QueryBuilder QueryBuilder}, but
|
|
121
121
|
* really all you need to provide is the `name` and `validator` for each field.
|
|
122
122
|
*
|
|
123
123
|
* The full field object from this array, where the field's identifying property
|
|
@@ -125,7 +125,7 @@ interface FormatQueryOptions {
|
|
|
125
125
|
*/
|
|
126
126
|
fields?: FlexibleOptionList<FullField>;
|
|
127
127
|
/**
|
|
128
|
-
* This can be the same `getOperators` function passed to {@link QueryBuilder}.
|
|
128
|
+
* This can be the same `getOperators` function passed to {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
129
129
|
*
|
|
130
130
|
* The full operator object from this array, where the operator's identifying property
|
|
131
131
|
* matches the rule's `operator`, will be passed to the rule processor.
|
|
@@ -449,5 +449,5 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
|
|
|
449
449
|
*/
|
|
450
450
|
type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
451
451
|
//#endregion
|
|
452
|
-
export {
|
|
453
|
-
//# sourceMappingURL=export-
|
|
452
|
+
export { ValueProcessorOptions as _, FormatQueryOptions as a, NLTranslations as c, RQBJsonLogic as d, RuleGroupProcessor as f, ValueProcessorLegacy as g, ValueProcessorByRule as h, ExportOperatorMap as i, ParameterizedNamedSQL as l, SQLPreset as m, ExportFormat as n, GroupVariantCondition as o, RuleProcessor as p, ExportObjectFormats as r, NLTranslationKey as s, ConstituentWordOrder as t, ParameterizedSQL as u };
|
|
453
|
+
//# sourceMappingURL=export-t1V2N8pz.d.mts.map
|
package/dist/formatQuery.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleGroupTypeAny, RuleType } from "./basic-
|
|
2
|
-
import {
|
|
1
|
+
import { f as RuleGroupTypeAny, v as RuleType } from "./basic-DEc65Kng.mjs";
|
|
2
|
+
import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-t1V2N8pz.mjs";
|
|
3
3
|
import { SetRequired } from "type-fest";
|
|
4
4
|
import { Column, Operators, SQL, Table } from "drizzle-orm";
|
|
5
5
|
import { WhereOptions } from "sequelize";
|
package/dist/formatQuery.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleGroupTypeAny, RuleType } from "./basic-
|
|
2
|
-
import {
|
|
1
|
+
import { f as RuleGroupTypeAny, v as RuleType } from "./basic-Dd_M2f3M.js";
|
|
2
|
+
import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-Dy4FckB-.js";
|
|
3
3
|
import { SetRequired } from "type-fest";
|
|
4
4
|
import { Column, Operators, SQL, Table } from "drizzle-orm";
|
|
5
5
|
import { WhereOptions } from "sequelize";
|
package/dist/formatQuery.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { parseNumber } from "./parseNumber-
|
|
5
|
-
import { transformQuery } from "./transformQuery-
|
|
6
|
-
import { convertFromIC } from "./convertQuery-
|
|
1
|
+
import { d as defaultPlaceholderOperatorName, i as toFlatOptionArray, o as toFullOptionList, t as getOption, u as defaultPlaceholderFieldName } from "./optGroupUtils-VeZ3k7-1.mjs";
|
|
2
|
+
import { i as trimIfString, n as splitBy, r as toArray, t as joinWith } from "./arrayUtils-A_OXU9W1.mjs";
|
|
3
|
+
import { a as lc, i as isPojo, n as isRuleGroupType, o as nullOrUndefinedOrEmpty, r as isRuleGroupTypeIC, s as numericRegex, t as isRuleGroup } from "./isRuleGroup-CYcfPgbg.mjs";
|
|
4
|
+
import { t as parseNumber } from "./parseNumber-CXdMVNFx.mjs";
|
|
5
|
+
import { t as transformQuery } from "./transformQuery-DCCpjtyq.mjs";
|
|
6
|
+
import { t as convertFromIC } from "./convertQuery-CqX3rPvj.mjs";
|
|
7
7
|
import { produce } from "immer";
|
|
8
8
|
|
|
9
9
|
//#region src/utils/isRuleOrGroupValid.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FullField, OptionList
|
|
1
|
+
import { o as ValueSources, t as FullField, x as OptionList } from "./basic-DEc65Kng.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/types/import.d.ts
|
|
4
4
|
|
|
@@ -24,5 +24,5 @@ interface ParserCommonOptions {
|
|
|
24
24
|
bigIntOnOverflow?: boolean;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
export { ParserCommonOptions };
|
|
28
|
-
//# sourceMappingURL=import-
|
|
27
|
+
export { ParserCommonOptions as t };
|
|
28
|
+
//# sourceMappingURL=import-Cz8canKo.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FullField, OptionList
|
|
1
|
+
import { o as ValueSources, t as FullField, x as OptionList } from "./basic-Dd_M2f3M.js";
|
|
2
2
|
|
|
3
3
|
//#region src/types/import.d.ts
|
|
4
4
|
|
|
@@ -24,5 +24,5 @@ interface ParserCommonOptions {
|
|
|
24
24
|
bigIntOnOverflow?: boolean;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
export { ParserCommonOptions };
|
|
28
|
-
//# sourceMappingURL=import-
|
|
27
|
+
export { ParserCommonOptions as t };
|
|
28
|
+
//# sourceMappingURL=import-DtS9Ocx5.d.ts.map
|
|
@@ -36,5 +36,5 @@ const isRuleGroupType = (rg) => isRuleGroup(rg) && typeof rg.combinator === "str
|
|
|
36
36
|
const isRuleGroupTypeIC = (rg) => isRuleGroup(rg) && rg.combinator === void 0;
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
|
-
export {
|
|
40
|
-
//# sourceMappingURL=isRuleGroup-
|
|
39
|
+
export { lc as a, isPojo as i, isRuleGroupType as n, nullOrUndefinedOrEmpty as o, isRuleGroupTypeIC as r, numericRegex$1 as s, isRuleGroup as t };
|
|
40
|
+
//# sourceMappingURL=isRuleGroup-CYcfPgbg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isRuleGroup-
|
|
1
|
+
{"version":3,"file":"isRuleGroup-CYcfPgbg.mjs","names":["numericRegex: RegExp","numericQuantityRegex"],"sources":["../src/utils/misc.ts","../src/utils/isRuleGroup.ts"],"sourcesContent":["import { numericRegex as numericQuantityRegex } from 'numeric-quantity';\n\n/**\n * Converts a value to lowercase if it's a string, otherwise returns the value as is.\n */\n// istanbul ignore next\nexport const lc = <T>(v: T): T => (typeof v === 'string' ? (v.toLowerCase() as T) : v);\n\n/**\n * Regex matching numeric strings. Passes for positive/negative integers, decimals,\n * and E notation, with optional surrounding whitespace.\n */\nexport const numericRegex: RegExp = new RegExp(\n numericQuantityRegex.source.replace(/^\\^/, String.raw`^\\s*`).replace(/\\$$/, String.raw`\\s*$`)\n);\n\n/**\n * Determines if a variable is a plain old JavaScript object, aka POJO.\n */\n// oxlint-disable-next-line typescript/no-explicit-any\nexport const isPojo = (obj: any): obj is Record<string, any> =>\n obj === null || typeof obj !== 'object' ? false : Object.getPrototypeOf(obj) === Object.prototype;\n\n/**\n * Simple helper to determine whether a value is null, undefined, or an empty string.\n */\nexport const nullOrUndefinedOrEmpty = (value: unknown): value is null | undefined | '' =>\n value === null || value === undefined || value === '';\n","import type { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from '../types';\nimport { isPojo } from './misc';\n\n/**\n * Determines if an object is a {@link RuleType} (only checks for a `field` property).\n */\nexport const isRuleType = (s: unknown): s is RuleType =>\n isPojo(s) && 'field' in s && typeof s.field === 'string';\n\n/**\n * Determines if an object is a {@link RuleGroupType} or {@link RuleGroupTypeIC}.\n */\nexport const isRuleGroup = (rg: unknown): rg is RuleGroupTypeAny =>\n isPojo(rg) && Array.isArray(rg.rules);\n\n/**\n * Determines if an object is a {@link RuleGroupType}.\n */\nexport const isRuleGroupType = (rg: unknown): rg is RuleGroupType =>\n isRuleGroup(rg) && typeof rg.combinator === 'string';\n\n/**\n * Determines if an object is a {@link RuleGroupTypeIC}.\n */\nexport const isRuleGroupTypeIC = (rg: unknown): rg is RuleGroupTypeIC =>\n isRuleGroup(rg) && rg.combinator === undefined;\n"],"mappings":";;;;;;;AAMA,MAAa,MAAS,MAAa,OAAO,MAAM,WAAY,EAAE,aAAa,GAAS;;;;;AAMpF,MAAaA,iBAAuB,IAAI,OACtCC,aAAqB,OAAO,QAAQ,OAAO,OAAO,GAAG,OAAO,CAAC,QAAQ,OAAO,OAAO,GAAG,OAAO,CAC9F;;;;AAMD,MAAa,UAAU,QACrB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,QAAQ,OAAO,eAAe,IAAI,KAAK,OAAO;;;;AAK1F,MAAa,0BAA0B,UACrC,UAAU,QAAQ,UAAU,UAAa,UAAU;;;;;;;ACfrD,MAAa,eAAe,OAC1B,OAAO,GAAG,IAAI,MAAM,QAAQ,GAAG,MAAM;;;;AAKvC,MAAa,mBAAmB,OAC9B,YAAY,GAAG,IAAI,OAAO,GAAG,eAAe;;;;AAK9C,MAAa,qBAAqB,OAChC,YAAY,GAAG,IAAI,GAAG,eAAe"}
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
const require_isRuleGroup = require('./isRuleGroup-DqAs2x4E.js');
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/@ts-jison/parser/lib/parser.js
|
|
4
|
+
var require_parser = /* @__PURE__ */ require_isRuleGroup.__commonJS({ "../../node_modules/@ts-jison/parser/lib/parser.js": ((exports) => {
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var JisonParser = function() {
|
|
7
|
+
function JisonParser$1(yy, lexer) {
|
|
8
|
+
if (yy === void 0) yy = {};
|
|
9
|
+
this.yy = yy;
|
|
10
|
+
this.lexer = lexer;
|
|
11
|
+
}
|
|
12
|
+
JisonParser$1.prototype.trace = function(str) {};
|
|
13
|
+
JisonParser$1.prototype.parseError = function(str, hash) {
|
|
14
|
+
if (hash.recoverable) this.trace(str);
|
|
15
|
+
else {
|
|
16
|
+
var error = new Error(str);
|
|
17
|
+
error.hash = hash;
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
JisonParser$1.prototype.parse = function(input, yy) {
|
|
22
|
+
if (yy === void 0) yy = typeof this.yy === "function" && typeof this.yy.constructor === "function" ? new this.yy(this, this.lexer) : Object.create(this.yy);
|
|
23
|
+
var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
|
|
24
|
+
var args = lstack.slice.call(arguments, 1);
|
|
25
|
+
var lexer = Object.create(this.lexer);
|
|
26
|
+
var sharedState = { yy };
|
|
27
|
+
lexer.setInput(input, sharedState.yy);
|
|
28
|
+
sharedState.yy.lexer = lexer;
|
|
29
|
+
sharedState.yy.parser = this;
|
|
30
|
+
if (typeof lexer.yylloc == "undefined") lexer.yylloc = {};
|
|
31
|
+
var yyloc = lexer.yylloc;
|
|
32
|
+
lstack.push(yyloc);
|
|
33
|
+
var ranges = lexer.options && lexer.options.ranges;
|
|
34
|
+
if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
|
|
35
|
+
function popStack(n) {
|
|
36
|
+
stack.length = stack.length - 2 * n;
|
|
37
|
+
vstack.length = vstack.length - n;
|
|
38
|
+
lstack.length = lstack.length - n;
|
|
39
|
+
}
|
|
40
|
+
var lex = function() {
|
|
41
|
+
var token = lexer.lex() || EOF;
|
|
42
|
+
if (typeof token !== "number") token = self.symbols_[token] || token;
|
|
43
|
+
return token;
|
|
44
|
+
}, symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
|
|
45
|
+
while (true) {
|
|
46
|
+
state = stack[stack.length - 1];
|
|
47
|
+
if (this.defaultActions[state]) action = this.defaultActions[state];
|
|
48
|
+
else {
|
|
49
|
+
if (symbol === null || typeof symbol == "undefined") symbol = lex();
|
|
50
|
+
action = table[state] && table[state][symbol];
|
|
51
|
+
}
|
|
52
|
+
_handle_error: if (typeof action === "undefined" || !action.length || !action[0]) {
|
|
53
|
+
var error_rule_depth = null;
|
|
54
|
+
var errStr = "";
|
|
55
|
+
if (!recovering) {
|
|
56
|
+
error_rule_depth = locateNearestErrorRecoveryRule(state);
|
|
57
|
+
expected = [];
|
|
58
|
+
for (var _p in table[state]) {
|
|
59
|
+
p = Number(_p);
|
|
60
|
+
if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
|
|
61
|
+
}
|
|
62
|
+
if (lexer.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
|
|
63
|
+
else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
|
|
64
|
+
this.parseError(errStr, {
|
|
65
|
+
text: lexer.match,
|
|
66
|
+
token: this.terminals_[symbol] || symbol,
|
|
67
|
+
line: lexer.yylineno,
|
|
68
|
+
loc: lexer.yylloc,
|
|
69
|
+
expected,
|
|
70
|
+
recoverable: error_rule_depth !== null
|
|
71
|
+
});
|
|
72
|
+
} else if (preErrorSymbol !== EOF) error_rule_depth = locateNearestErrorRecoveryRule(state);
|
|
73
|
+
if (recovering == 3) {
|
|
74
|
+
if (symbol === EOF || preErrorSymbol === EOF) throw new Error(errStr || "Parsing halted while starting to recover from another error.");
|
|
75
|
+
yyleng = lexer.yyleng;
|
|
76
|
+
yytext = lexer.yytext;
|
|
77
|
+
yylineno = lexer.yylineno;
|
|
78
|
+
yyloc = lexer.yylloc;
|
|
79
|
+
symbol = lex();
|
|
80
|
+
}
|
|
81
|
+
if (error_rule_depth === null) throw new Error(errStr || "Parsing halted. No suitable error recovery rule available.");
|
|
82
|
+
popStack(error_rule_depth || 0);
|
|
83
|
+
preErrorSymbol = symbol == TERROR ? null : symbol;
|
|
84
|
+
symbol = TERROR;
|
|
85
|
+
state = stack[stack.length - 1];
|
|
86
|
+
action = table[state] && table[state][TERROR];
|
|
87
|
+
recovering = 3;
|
|
88
|
+
}
|
|
89
|
+
if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
|
|
90
|
+
switch (action[0]) {
|
|
91
|
+
case 1:
|
|
92
|
+
stack.push(symbol);
|
|
93
|
+
vstack.push(lexer.yytext);
|
|
94
|
+
lstack.push(lexer.yylloc);
|
|
95
|
+
stack.push(action[1]);
|
|
96
|
+
symbol = null;
|
|
97
|
+
if (!preErrorSymbol) {
|
|
98
|
+
yyleng = lexer.yyleng;
|
|
99
|
+
yytext = lexer.yytext;
|
|
100
|
+
yylineno = lexer.yylineno;
|
|
101
|
+
yyloc = lexer.yylloc;
|
|
102
|
+
if (recovering > 0) recovering--;
|
|
103
|
+
} else {
|
|
104
|
+
symbol = preErrorSymbol;
|
|
105
|
+
preErrorSymbol = null;
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case 2:
|
|
109
|
+
len = this.productions_[action[1]][1];
|
|
110
|
+
yyval.$ = vstack[vstack.length - len];
|
|
111
|
+
yyval._$ = {
|
|
112
|
+
first_line: lstack[lstack.length - (len || 1)].first_line,
|
|
113
|
+
last_line: lstack[lstack.length - 1].last_line,
|
|
114
|
+
first_column: lstack[lstack.length - (len || 1)].first_column,
|
|
115
|
+
last_column: lstack[lstack.length - 1].last_column
|
|
116
|
+
};
|
|
117
|
+
if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
|
118
|
+
r = this.performAction.apply(yyval, [
|
|
119
|
+
yytext,
|
|
120
|
+
yyleng,
|
|
121
|
+
yylineno,
|
|
122
|
+
sharedState.yy,
|
|
123
|
+
action[1],
|
|
124
|
+
vstack,
|
|
125
|
+
lstack
|
|
126
|
+
].concat(args));
|
|
127
|
+
if (typeof r !== "undefined") return r;
|
|
128
|
+
if (len) {
|
|
129
|
+
stack = stack.slice(0, -1 * len * 2);
|
|
130
|
+
vstack = vstack.slice(0, -1 * len);
|
|
131
|
+
lstack = lstack.slice(0, -1 * len);
|
|
132
|
+
}
|
|
133
|
+
stack.push(this.productions_[action[1]][0]);
|
|
134
|
+
vstack.push(yyval.$);
|
|
135
|
+
lstack.push(yyval._$);
|
|
136
|
+
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
|
137
|
+
stack.push(newState);
|
|
138
|
+
break;
|
|
139
|
+
case 3: return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return true;
|
|
143
|
+
function locateNearestErrorRecoveryRule(state$1) {
|
|
144
|
+
var stack_probe = stack.length - 1;
|
|
145
|
+
var depth = 0;
|
|
146
|
+
for (;;) {
|
|
147
|
+
if (TERROR.toString() in table[state$1]) return depth;
|
|
148
|
+
if (state$1 === 0 || stack_probe < 2) return null;
|
|
149
|
+
stack_probe -= 2;
|
|
150
|
+
state$1 = stack[stack_probe];
|
|
151
|
+
++depth;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
JisonParser$1.expandParseTable = function(k, v, o) {
|
|
156
|
+
var l = k.length;
|
|
157
|
+
for (o = o || {}; l--; o[k[l]] = v);
|
|
158
|
+
return o;
|
|
159
|
+
};
|
|
160
|
+
return JisonParser$1;
|
|
161
|
+
}();
|
|
162
|
+
exports.JisonParser = JisonParser;
|
|
163
|
+
}) });
|
|
164
|
+
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region ../../node_modules/@ts-jison/lexer/lib/lexer.js
|
|
167
|
+
var require_lexer = /* @__PURE__ */ require_isRuleGroup.__commonJS({ "../../node_modules/@ts-jison/lexer/lib/lexer.js": ((exports) => {
|
|
168
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
169
|
+
var JisonLexer = function() {
|
|
170
|
+
function JisonLexer$1(yy) {
|
|
171
|
+
if (yy === void 0) yy = {};
|
|
172
|
+
this.yy = yy;
|
|
173
|
+
this.EOF = 1;
|
|
174
|
+
this.options = {};
|
|
175
|
+
this.yyleng = 0;
|
|
176
|
+
this.yylloc = {
|
|
177
|
+
first_line: 1,
|
|
178
|
+
first_column: 0,
|
|
179
|
+
last_line: 1,
|
|
180
|
+
last_column: 0
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
JisonLexer$1.prototype.parseError = function(str, hash) {
|
|
184
|
+
if (this.yy.parser) this.yy.parser.parseError(str, hash);
|
|
185
|
+
else throw new Error(str);
|
|
186
|
+
};
|
|
187
|
+
JisonLexer$1.prototype.setInput = function(input, yy) {
|
|
188
|
+
this.yy = yy || this.yy || {};
|
|
189
|
+
this._input = input;
|
|
190
|
+
this._more = this._backtrack = this.done = false;
|
|
191
|
+
this.yylineno = this.yyleng = 0;
|
|
192
|
+
this.yytext = this.matched = this.match = "";
|
|
193
|
+
this.conditionStack = ["INITIAL"];
|
|
194
|
+
this.yylloc = {
|
|
195
|
+
first_line: 1,
|
|
196
|
+
first_column: 0,
|
|
197
|
+
last_line: 1,
|
|
198
|
+
last_column: 0
|
|
199
|
+
};
|
|
200
|
+
if (this.options.ranges) this.yylloc.range = [0, 0];
|
|
201
|
+
this.offset = 0;
|
|
202
|
+
return this;
|
|
203
|
+
};
|
|
204
|
+
JisonLexer$1.prototype.input = function() {
|
|
205
|
+
if (this._input.length === 0) {
|
|
206
|
+
this.done = true;
|
|
207
|
+
return "" + this.EOF;
|
|
208
|
+
}
|
|
209
|
+
var ch = this._input[0];
|
|
210
|
+
this.yytext += ch;
|
|
211
|
+
this.yyleng++;
|
|
212
|
+
this.offset++;
|
|
213
|
+
this.match += ch;
|
|
214
|
+
this.matched += ch;
|
|
215
|
+
if (ch.match(/(?:\r\n?|\n).*/g)) {
|
|
216
|
+
this.yylineno++;
|
|
217
|
+
this.yylloc.last_line++;
|
|
218
|
+
} else this.yylloc.last_column++;
|
|
219
|
+
if (this.options.ranges) this.yylloc.range[1]++;
|
|
220
|
+
this._input = this._input.slice(1);
|
|
221
|
+
return ch;
|
|
222
|
+
};
|
|
223
|
+
JisonLexer$1.prototype.unput = function(ch) {
|
|
224
|
+
var len = ch.length;
|
|
225
|
+
var lines = ch.split(/(?:\r\n?|\n)/g);
|
|
226
|
+
this._input = ch + this._input;
|
|
227
|
+
this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
|
228
|
+
this.offset -= len;
|
|
229
|
+
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
|
230
|
+
this.match = this.match.substr(0, this.match.length - 1);
|
|
231
|
+
this.matched = this.matched.substr(0, this.matched.length - 1);
|
|
232
|
+
if (lines.length - 1) this.yylineno -= lines.length - 1;
|
|
233
|
+
var r = this.yylloc.range;
|
|
234
|
+
this.yylloc = {
|
|
235
|
+
first_line: this.yylloc.first_line,
|
|
236
|
+
last_line: this.yylineno + 1,
|
|
237
|
+
first_column: this.yylloc.first_column,
|
|
238
|
+
last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
|
|
239
|
+
};
|
|
240
|
+
if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
|
241
|
+
this.yyleng = this.yytext.length;
|
|
242
|
+
return this;
|
|
243
|
+
};
|
|
244
|
+
JisonLexer$1.prototype.more = function() {
|
|
245
|
+
this._more = true;
|
|
246
|
+
return this;
|
|
247
|
+
};
|
|
248
|
+
JisonLexer$1.prototype.reject = function() {
|
|
249
|
+
if (this.options.backtrack_lexer) this._backtrack = true;
|
|
250
|
+
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
|
|
251
|
+
text: "",
|
|
252
|
+
token: null,
|
|
253
|
+
line: this.yylineno
|
|
254
|
+
});
|
|
255
|
+
return this;
|
|
256
|
+
};
|
|
257
|
+
JisonLexer$1.prototype.less = function(n) {
|
|
258
|
+
this.unput(this.match.slice(n));
|
|
259
|
+
};
|
|
260
|
+
JisonLexer$1.prototype.pastInput = function() {
|
|
261
|
+
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
|
262
|
+
return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
|
|
263
|
+
};
|
|
264
|
+
JisonLexer$1.prototype.upcomingInput = function() {
|
|
265
|
+
var next = this.match;
|
|
266
|
+
if (next.length < 20) next += this._input.substr(0, 20 - next.length);
|
|
267
|
+
return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
268
|
+
};
|
|
269
|
+
JisonLexer$1.prototype.showPosition = function() {
|
|
270
|
+
var pre = this.pastInput();
|
|
271
|
+
var c = new Array(pre.length + 1).join("-");
|
|
272
|
+
return pre + this.upcomingInput() + "\n" + c + "^";
|
|
273
|
+
};
|
|
274
|
+
JisonLexer$1.prototype.test_match = function(match, indexed_rule) {
|
|
275
|
+
var token, lines, backup;
|
|
276
|
+
if (this.options.backtrack_lexer) {
|
|
277
|
+
backup = {
|
|
278
|
+
yylineno: this.yylineno,
|
|
279
|
+
yylloc: {
|
|
280
|
+
first_line: this.yylloc.first_line,
|
|
281
|
+
last_line: this.yylloc.last_line,
|
|
282
|
+
first_column: this.yylloc.first_column,
|
|
283
|
+
last_column: this.yylloc.last_column
|
|
284
|
+
},
|
|
285
|
+
yytext: this.yytext,
|
|
286
|
+
match: this.match,
|
|
287
|
+
matches: this.matches,
|
|
288
|
+
matched: this.matched,
|
|
289
|
+
yyleng: this.yyleng,
|
|
290
|
+
offset: this.offset,
|
|
291
|
+
_more: this._more,
|
|
292
|
+
_input: this._input,
|
|
293
|
+
yy: this.yy,
|
|
294
|
+
conditionStack: this.conditionStack.slice(0),
|
|
295
|
+
done: this.done
|
|
296
|
+
};
|
|
297
|
+
if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
|
|
298
|
+
}
|
|
299
|
+
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
|
300
|
+
if (lines) this.yylineno += lines.length;
|
|
301
|
+
this.yylloc = {
|
|
302
|
+
first_line: this.yylloc.last_line,
|
|
303
|
+
last_line: this.yylineno + 1,
|
|
304
|
+
first_column: this.yylloc.last_column,
|
|
305
|
+
last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
|
|
306
|
+
};
|
|
307
|
+
this.yytext += match[0];
|
|
308
|
+
this.match += match[0];
|
|
309
|
+
this.matches = match;
|
|
310
|
+
this.yyleng = this.yytext.length;
|
|
311
|
+
if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
|
312
|
+
this._more = false;
|
|
313
|
+
this._backtrack = false;
|
|
314
|
+
this._input = this._input.slice(match[0].length);
|
|
315
|
+
this.matched += match[0];
|
|
316
|
+
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
|
317
|
+
if (this.done && this._input) this.done = false;
|
|
318
|
+
if (token) return token;
|
|
319
|
+
else if (this._backtrack) {
|
|
320
|
+
for (var k in backup) this[k] = backup[k];
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
return false;
|
|
324
|
+
};
|
|
325
|
+
JisonLexer$1.prototype.next = function() {
|
|
326
|
+
if (this.done) return this.EOF;
|
|
327
|
+
if (!this._input) this.done = true;
|
|
328
|
+
var token, match = null, tempMatch, index;
|
|
329
|
+
if (!this._more) {
|
|
330
|
+
this.yytext = "";
|
|
331
|
+
this.match = "";
|
|
332
|
+
}
|
|
333
|
+
var rules = this._currentRules();
|
|
334
|
+
for (var i = 0; i < rules.length; i++) {
|
|
335
|
+
tempMatch = this._input.match(this.rules[rules[i]]);
|
|
336
|
+
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
|
337
|
+
match = tempMatch;
|
|
338
|
+
index = i;
|
|
339
|
+
if (this.options.backtrack_lexer) {
|
|
340
|
+
token = this.test_match(tempMatch, rules[i]);
|
|
341
|
+
if (token !== false) return token;
|
|
342
|
+
else if (this._backtrack) {
|
|
343
|
+
match = null;
|
|
344
|
+
continue;
|
|
345
|
+
} else return false;
|
|
346
|
+
} else if (!this.options.flex) break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (match) {
|
|
350
|
+
token = this.test_match(match, rules[index]);
|
|
351
|
+
if (token !== false) return token;
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
if (this._input === "") return this.EOF;
|
|
355
|
+
else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
|
|
356
|
+
text: "",
|
|
357
|
+
token: null,
|
|
358
|
+
line: this.yylineno
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
JisonLexer$1.prototype.lex = function() {
|
|
362
|
+
var r = this.next();
|
|
363
|
+
if (r) return r;
|
|
364
|
+
else return this.lex();
|
|
365
|
+
};
|
|
366
|
+
JisonLexer$1.prototype.begin = function(condition) {
|
|
367
|
+
this.conditionStack.push(condition);
|
|
368
|
+
};
|
|
369
|
+
JisonLexer$1.prototype.popState = function() {
|
|
370
|
+
if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
|
|
371
|
+
else return this.conditionStack[0];
|
|
372
|
+
};
|
|
373
|
+
JisonLexer$1.prototype._currentRules = function() {
|
|
374
|
+
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
|
375
|
+
else return this.conditions["INITIAL"].rules;
|
|
376
|
+
};
|
|
377
|
+
JisonLexer$1.prototype.topState = function(n) {
|
|
378
|
+
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
|
379
|
+
if (n >= 0) return this.conditionStack[n];
|
|
380
|
+
else return "INITIAL";
|
|
381
|
+
};
|
|
382
|
+
JisonLexer$1.prototype.pushState = function(condition) {
|
|
383
|
+
this.begin(condition);
|
|
384
|
+
};
|
|
385
|
+
JisonLexer$1.prototype.stateStackSize = function() {
|
|
386
|
+
return this.conditionStack.length;
|
|
387
|
+
};
|
|
388
|
+
return JisonLexer$1;
|
|
389
|
+
}();
|
|
390
|
+
exports.JisonLexer = JisonLexer;
|
|
391
|
+
}) });
|
|
392
|
+
|
|
393
|
+
//#endregion
|
|
394
|
+
Object.defineProperty(exports, 'require_lexer', {
|
|
395
|
+
enumerable: true,
|
|
396
|
+
get: function () {
|
|
397
|
+
return require_lexer;
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
Object.defineProperty(exports, 'require_parser', {
|
|
401
|
+
enumerable: true,
|
|
402
|
+
get: function () {
|
|
403
|
+
return require_parser;
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
//# sourceMappingURL=lexer-C53tqS2p.js.map
|