astronomical 1.0.1 → 2.0.1
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/lib/cjs/index.js +32 -31
- package/lib/cjs/parseQuery.js +10 -11
- package/lib/cjs/types/index.d.ts +1 -1
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/nodeutils.d.ts.map +1 -1
- package/lib/esm/index.mjs +32 -31
- package/lib/esm/parseQuery.js +10 -11
- package/lib/esm/types/index.d.ts +1 -1
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/nodeutils.d.ts.map +1 -1
- package/package.json +2 -1
package/lib/cjs/index.js
CHANGED
|
@@ -11,12 +11,11 @@ const meriyah_1 = require("meriyah");
|
|
|
11
11
|
const nodeutils_1 = require("./nodeutils");
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const debugLogEnabled = false;
|
|
14
|
-
const log = {
|
|
15
|
-
debug:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
14
|
+
const log = debugLogEnabled ? {
|
|
15
|
+
debug: (...args) => {
|
|
16
|
+
console.debug(...args);
|
|
17
|
+
}
|
|
18
|
+
} : undefined;
|
|
20
19
|
exports.functions = {
|
|
21
20
|
"join": {
|
|
22
21
|
fn: (result) => {
|
|
@@ -109,17 +108,17 @@ function createQuerier() {
|
|
|
109
108
|
}
|
|
110
109
|
else if ("node" in filter) {
|
|
111
110
|
if (filter.node.type == "child") {
|
|
112
|
-
log
|
|
111
|
+
log?.debug("ADDING FILTER CHILD", filter.node);
|
|
113
112
|
state.child[state.depth + 1].push(filter);
|
|
114
113
|
}
|
|
115
114
|
if (filter.node.type == "descendant") {
|
|
116
|
-
log
|
|
115
|
+
log?.debug("ADDING FILTER DESCENDANT", filter.node);
|
|
117
116
|
state.descendant[state.depth + 1].push(filter);
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
function createFNodeAndAddToState(token, result, state) {
|
|
122
|
-
log
|
|
121
|
+
log?.debug("ADDING FNODE", token);
|
|
123
122
|
const fnode = createFNode(token, result);
|
|
124
123
|
if (token.type == "child") {
|
|
125
124
|
state.child[state.depth + 1].push(fnode);
|
|
@@ -133,7 +132,7 @@ function createQuerier() {
|
|
|
133
132
|
if (fnode.node.attribute) {
|
|
134
133
|
const m = fnode.node.value == path.parentKey || fnode.node.value == path.key;
|
|
135
134
|
if (m)
|
|
136
|
-
log
|
|
135
|
+
log?.debug("ATTR MATCH", fnode.node.value, breadCrumb(path));
|
|
137
136
|
return m;
|
|
138
137
|
}
|
|
139
138
|
if (fnode.node.value == "*") {
|
|
@@ -141,7 +140,7 @@ function createQuerier() {
|
|
|
141
140
|
}
|
|
142
141
|
const m = fnode.node.value == path.node.type;
|
|
143
142
|
if (m)
|
|
144
|
-
log
|
|
143
|
+
log?.debug("NODE MATCH", fnode.node.value, breadCrumb(path));
|
|
145
144
|
return m;
|
|
146
145
|
}
|
|
147
146
|
function addIfTokenMatch(fnode, path, state) {
|
|
@@ -209,11 +208,11 @@ function createQuerier() {
|
|
|
209
208
|
const nodes = getPrimitiveChildren(fnode.node.value, path);
|
|
210
209
|
if (nodes.length == 0)
|
|
211
210
|
return;
|
|
212
|
-
log
|
|
211
|
+
log?.debug("PRIMITIVE", fnode.node.value, nodes);
|
|
213
212
|
fnode.result.push(...nodes);
|
|
214
213
|
}
|
|
215
214
|
function evaluateFilter(filter, path) {
|
|
216
|
-
log
|
|
215
|
+
log?.debug("EVALUATING FILTER", filter, breadCrumb(path));
|
|
217
216
|
if ("type" in filter) {
|
|
218
217
|
if (filter.type == "and") {
|
|
219
218
|
const left = evaluateFilter(filter.left, path);
|
|
@@ -248,7 +247,7 @@ function createQuerier() {
|
|
|
248
247
|
function resolveBinding(path) {
|
|
249
248
|
if (!(0, nodeutils_1.isIdentifier)(path.node))
|
|
250
249
|
return undefined;
|
|
251
|
-
log
|
|
250
|
+
log?.debug("RESOLVING BINDING FOR ", path.node);
|
|
252
251
|
const name = path.node.name;
|
|
253
252
|
if (name == undefined || typeof name != "string")
|
|
254
253
|
return undefined;
|
|
@@ -256,7 +255,7 @@ function createQuerier() {
|
|
|
256
255
|
const binding = getBinding(path.scopeId, name);
|
|
257
256
|
if (!binding)
|
|
258
257
|
return undefined;
|
|
259
|
-
log
|
|
258
|
+
log?.debug("THIS IS THE BINDING", binding);
|
|
260
259
|
return binding.path;
|
|
261
260
|
}
|
|
262
261
|
function resolveFilterWithParent(node, path) {
|
|
@@ -267,7 +266,7 @@ function createQuerier() {
|
|
|
267
266
|
throw new Error("Parent filter must have child");
|
|
268
267
|
if (!startPath.parentPath)
|
|
269
268
|
return [];
|
|
270
|
-
log
|
|
269
|
+
log?.debug("STEP OUT", startNode, breadCrumb(startPath));
|
|
271
270
|
startNode = startNode.child;
|
|
272
271
|
startPath = startPath.parentPath;
|
|
273
272
|
}
|
|
@@ -286,9 +285,9 @@ function createQuerier() {
|
|
|
286
285
|
const lookup = startNode.value;
|
|
287
286
|
if (!lookup)
|
|
288
287
|
throw new Error("Selector must have a value");
|
|
289
|
-
//log
|
|
288
|
+
//log?.debug("STEP IN ", lookup, paths.map(p => breadCrumb(p)));
|
|
290
289
|
const nodes = paths.filter(nodeutils_1.isNodePath).map(n => getPrimitiveChildrenOrNodePaths(lookup, n)).flat();
|
|
291
|
-
//log
|
|
290
|
+
//log?.debug("LOOKUP", lookup, path.node.type, nodes.map(n => n.node));
|
|
292
291
|
//console.log(nodes);
|
|
293
292
|
if (nodes.length == 0)
|
|
294
293
|
return [];
|
|
@@ -310,7 +309,7 @@ function createQuerier() {
|
|
|
310
309
|
}
|
|
311
310
|
startNode = startNode.child;
|
|
312
311
|
}
|
|
313
|
-
//log
|
|
312
|
+
//log?.debug("DIRECT TRAV RESOLVE", startNode, paths.map(p => breadCrumb(p)));
|
|
314
313
|
const result = [];
|
|
315
314
|
//console.log(paths.length, subQueryCounter);
|
|
316
315
|
for (const path of paths) {
|
|
@@ -328,7 +327,7 @@ function createQuerier() {
|
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
329
|
}
|
|
331
|
-
log
|
|
330
|
+
log?.debug("DIRECT TRAV RESOLVE RESULT", result);
|
|
332
331
|
return result;
|
|
333
332
|
}
|
|
334
333
|
function addResultIfTokenMatch(fnode, path, state) {
|
|
@@ -385,7 +384,7 @@ function createQuerier() {
|
|
|
385
384
|
resolveFunctionCalls(fnode, functionCallResult, path, state);
|
|
386
385
|
}
|
|
387
386
|
else if (matchingFilters.length > 0) {
|
|
388
|
-
log
|
|
387
|
+
log?.debug("HAS MATCHING FILTER", fnode.result.length, matchingFilters.length, breadCrumb(path));
|
|
389
388
|
fnode.result.push(...matchingFilters.flatMap(f => f.result));
|
|
390
389
|
}
|
|
391
390
|
}
|
|
@@ -401,7 +400,7 @@ function createQuerier() {
|
|
|
401
400
|
}
|
|
402
401
|
}
|
|
403
402
|
const functionResult = exports.functions[functionCallResult.functionCall.function].fn(parameterResults);
|
|
404
|
-
log
|
|
403
|
+
log?.debug("PARAMETER RESULTS", functionCallResult.functionCall.function, parameterResults, functionResult);
|
|
405
404
|
fnode.result.push(...functionResult);
|
|
406
405
|
}
|
|
407
406
|
function travHandle(queries, root) {
|
|
@@ -422,7 +421,7 @@ function createQuerier() {
|
|
|
422
421
|
state.descendant.slice(0, state.depth + 1).forEach(fnodes => fnodes.forEach(fnode => addPrimitiveAttributeIfMatch(fnode, root)));
|
|
423
422
|
traverse(root.node, {
|
|
424
423
|
enter(path, state) {
|
|
425
|
-
//log
|
|
424
|
+
//log?.debug("ENTER", breadCrumb(path));
|
|
426
425
|
state.depth++;
|
|
427
426
|
state.child.push([]);
|
|
428
427
|
state.descendant.push([]);
|
|
@@ -440,7 +439,7 @@ function createQuerier() {
|
|
|
440
439
|
}
|
|
441
440
|
},
|
|
442
441
|
exit(path, state) {
|
|
443
|
-
log
|
|
442
|
+
log?.debug("EXIT", breadCrumb(path));
|
|
444
443
|
// Check for attributes as not all attributes are visited
|
|
445
444
|
state.child[state.depth + 1].forEach(fnode => addPrimitiveAttributeIfMatch(fnode, path));
|
|
446
445
|
for (const fnodes of state.descendant) {
|
|
@@ -465,6 +464,7 @@ function createQuerier() {
|
|
|
465
464
|
function beginHandle(queries, path) {
|
|
466
465
|
const rootPath = createNodePath(path, undefined, undefined, undefined, undefined);
|
|
467
466
|
const r = travHandle(queries, rootPath);
|
|
467
|
+
memo.clear();
|
|
468
468
|
return r;
|
|
469
469
|
}
|
|
470
470
|
return {
|
|
@@ -489,23 +489,24 @@ function multiQuery(code, namedQueries, returnAST) {
|
|
|
489
489
|
const queries = Object.fromEntries(Object.entries(namedQueries).map(([name, query]) => [name, (0, parseQuery_1.parse)(query)]));
|
|
490
490
|
const querier = createQuerier();
|
|
491
491
|
const result = querier.beginHandle(queries, ast);
|
|
492
|
-
log
|
|
492
|
+
log?.debug("Query time: ", Date.now() - start);
|
|
493
493
|
if (returnAST) {
|
|
494
494
|
return { ...result, __AST: ast };
|
|
495
495
|
}
|
|
496
496
|
return result;
|
|
497
497
|
}
|
|
498
|
-
function parseSource(source) {
|
|
498
|
+
function parseSource(source, optimize = true) {
|
|
499
|
+
const parsingOptions = optimize ? { loc: false, ranges: false } : { loc: true, ranges: true };
|
|
499
500
|
try {
|
|
500
|
-
return (0, meriyah_1.parseScript)(source, { module: true, next: true });
|
|
501
|
+
return (0, meriyah_1.parseScript)(source, { module: true, next: true, ...parsingOptions });
|
|
501
502
|
}
|
|
502
503
|
catch (e) {
|
|
503
|
-
return (0, meriyah_1.parseScript)(source, { module: false, next: true });
|
|
504
|
+
return (0, meriyah_1.parseScript)(source, { module: false, next: true, ...parsingOptions, webcompat: true });
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
|
-
const scopes = new Map();
|
|
507
507
|
function createTraverser() {
|
|
508
508
|
let scopeIdCounter = 0;
|
|
509
|
+
const scopes = new Map();
|
|
509
510
|
let removedScopes = 0;
|
|
510
511
|
const nodePathsCreated = {};
|
|
511
512
|
function createScope(parentScopeId) {
|
|
@@ -720,10 +721,10 @@ function createTraverser() {
|
|
|
720
721
|
const fscope = path?.functionScopeId ?? node.extra?.functionScopeId ?? scopeId;
|
|
721
722
|
traverseInner(node, visitor, scopeId, fscope, state, path);
|
|
722
723
|
if (!sOut.includes(scopeIdCounter)) {
|
|
723
|
-
log
|
|
724
|
+
log?.debug("Scopes created", scopeIdCounter, " Scopes removed", removedScopes, "Paths created", pathsCreated, bindingNodesVisited);
|
|
724
725
|
sOut.push(scopeIdCounter);
|
|
725
726
|
const k = Object.fromEntries(Object.entries(nodePathsCreated).sort((a, b) => a[1] - b[1]));
|
|
726
|
-
log
|
|
727
|
+
log?.debug("Node paths created", k);
|
|
727
728
|
}
|
|
728
729
|
}
|
|
729
730
|
return {
|
package/lib/cjs/parseQuery.js
CHANGED
|
@@ -5,12 +5,11 @@ exports.parse = parse;
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const nodeutils_1 = require("./nodeutils");
|
|
7
7
|
const debugLogEnabled = false;
|
|
8
|
-
const log = {
|
|
9
|
-
debug:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
8
|
+
const log = debugLogEnabled ? {
|
|
9
|
+
debug: (...args) => {
|
|
10
|
+
console.debug(...args);
|
|
11
|
+
}
|
|
12
|
+
} : undefined;
|
|
14
13
|
const supportedIdentifiers = Object.fromEntries(Object.keys(nodeutils_1.VISITOR_KEYS).map(k => [k, k]));
|
|
15
14
|
function isIdentifierToken(token) {
|
|
16
15
|
if (token == undefined)
|
|
@@ -151,7 +150,7 @@ function tokenize(input) {
|
|
|
151
150
|
return result;
|
|
152
151
|
}
|
|
153
152
|
function buildFilter(tokens) {
|
|
154
|
-
log
|
|
153
|
+
log?.debug("BUILD FILTER", tokens);
|
|
155
154
|
tokens.shift();
|
|
156
155
|
const p = buildTree(tokens);
|
|
157
156
|
const next = tokens[0];
|
|
@@ -198,7 +197,7 @@ function buildFilter(tokens) {
|
|
|
198
197
|
}
|
|
199
198
|
const subNodes = ["child", "descendant"];
|
|
200
199
|
function buildTree(tokens) {
|
|
201
|
-
log
|
|
200
|
+
log?.debug("BUILD TREE", tokens);
|
|
202
201
|
if (tokens.length == 0)
|
|
203
202
|
throw new Error("Unexpected end of input");
|
|
204
203
|
const token = tokens.shift();
|
|
@@ -241,7 +240,7 @@ function buildTree(tokens) {
|
|
|
241
240
|
let filter = undefined;
|
|
242
241
|
if (tokens.length > 0 && tokens[0].type == "filterBegin") {
|
|
243
242
|
filter = buildFilter(tokens);
|
|
244
|
-
log
|
|
243
|
+
log?.debug("FILTER", filter, tokens);
|
|
245
244
|
}
|
|
246
245
|
let child = undefined;
|
|
247
246
|
if (tokens.length > 0 && subNodes.includes(tokens[0].type)) {
|
|
@@ -268,7 +267,7 @@ function buildTree(tokens) {
|
|
|
268
267
|
throw new Error("Unexpected token: " + token.type);
|
|
269
268
|
}
|
|
270
269
|
function buildFunctionCall(name, tokens) {
|
|
271
|
-
log
|
|
270
|
+
log?.debug("BUILD FUNCTION", name, tokens);
|
|
272
271
|
const parameters = [];
|
|
273
272
|
const next = tokens.shift();
|
|
274
273
|
if (next?.type != "parametersBegin")
|
|
@@ -290,7 +289,7 @@ function buildFunctionCall(name, tokens) {
|
|
|
290
289
|
function parse(input) {
|
|
291
290
|
const tokens = tokenize(input);
|
|
292
291
|
const result = buildTree(tokens);
|
|
293
|
-
log
|
|
292
|
+
log?.debug("RESULT", result);
|
|
294
293
|
if (!result)
|
|
295
294
|
throw new Error("No root element found");
|
|
296
295
|
return result;
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare function query(code: string | ASTNode, query: string, returnAST?:
|
|
|
23
23
|
export declare function multiQuery<T extends Record<string, string>>(code: string | ASTNode, namedQueries: T, returnAST?: boolean): Record<keyof T, Result[]> & {
|
|
24
24
|
__AST?: ASTNode;
|
|
25
25
|
};
|
|
26
|
-
export declare function parseSource(source: string): ASTNode;
|
|
26
|
+
export declare function parseSource(source: string, optimize?: boolean): ASTNode;
|
|
27
27
|
export type Binding = {
|
|
28
28
|
path: NodePath;
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAYjC,eAAO,MAAM,SAAS;;qBAEL,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;;qBAWrB,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;;qBAMrB,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;;qBAOrB,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;CASrC,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,SAAS,CAAC;AACvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAI,IAAI,IAAI,iBAAiB,CAE5E;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvD,KAAK,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;AAsbvC,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,MAAM,EAAE,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAQjH;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM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M,GAAG,SAAS,GAAG,MAAM,aAAa,MAAM,GAAG,SAAS,WAAW,MAAM,GAAG,SAAS,mBAAmB,MAAM,GAAG,SAAS,aAAa,QAAQ,KAAI,QAAQ;uBAtC/K,MAAM,QAAQ,QAAQ,KAAI,QAAQ,EAAE;gCAW3B,MAAM,QAAQ,QAAQ,KAAI,cAAc,EAAE;2CAO/B,MAAM,QAAQ,QAAQ,KAAI,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;0BA1D3E,MAAM,QAAQ,MAAM,KAAG,OAAO,GAAG,SAAS;EAmPxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeutils.d.ts","sourceRoot":"","sources":["../../../src/nodeutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAEnC,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"nodeutils.d.ts","sourceRoot":"","sources":["../../../src/nodeutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAEnC,eAAO,MAAM,MAAM,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,OAEzD,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,QAE7D,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,MAAM,CAAC,OAEnE,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAI,KAAK,IAAI,cAEtD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,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AAM,CAAC,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC,eAAe,CAEnF"}
|
package/lib/esm/index.mjs
CHANGED
|
@@ -11,12 +11,11 @@ const meriyah_1 = require("meriyah");
|
|
|
11
11
|
const nodeutils_1 = require("./nodeutils");
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const debugLogEnabled = false;
|
|
14
|
-
const log = {
|
|
15
|
-
debug:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
14
|
+
const log = debugLogEnabled ? {
|
|
15
|
+
debug: (...args) => {
|
|
16
|
+
console.debug(...args);
|
|
17
|
+
}
|
|
18
|
+
} : undefined;
|
|
20
19
|
exports.functions = {
|
|
21
20
|
"join": {
|
|
22
21
|
fn: (result) => {
|
|
@@ -109,17 +108,17 @@ function createQuerier() {
|
|
|
109
108
|
}
|
|
110
109
|
else if ("node" in filter) {
|
|
111
110
|
if (filter.node.type == "child") {
|
|
112
|
-
log
|
|
111
|
+
log?.debug("ADDING FILTER CHILD", filter.node);
|
|
113
112
|
state.child[state.depth + 1].push(filter);
|
|
114
113
|
}
|
|
115
114
|
if (filter.node.type == "descendant") {
|
|
116
|
-
log
|
|
115
|
+
log?.debug("ADDING FILTER DESCENDANT", filter.node);
|
|
117
116
|
state.descendant[state.depth + 1].push(filter);
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
function createFNodeAndAddToState(token, result, state) {
|
|
122
|
-
log
|
|
121
|
+
log?.debug("ADDING FNODE", token);
|
|
123
122
|
const fnode = createFNode(token, result);
|
|
124
123
|
if (token.type == "child") {
|
|
125
124
|
state.child[state.depth + 1].push(fnode);
|
|
@@ -133,7 +132,7 @@ function createQuerier() {
|
|
|
133
132
|
if (fnode.node.attribute) {
|
|
134
133
|
const m = fnode.node.value == path.parentKey || fnode.node.value == path.key;
|
|
135
134
|
if (m)
|
|
136
|
-
log
|
|
135
|
+
log?.debug("ATTR MATCH", fnode.node.value, breadCrumb(path));
|
|
137
136
|
return m;
|
|
138
137
|
}
|
|
139
138
|
if (fnode.node.value == "*") {
|
|
@@ -141,7 +140,7 @@ function createQuerier() {
|
|
|
141
140
|
}
|
|
142
141
|
const m = fnode.node.value == path.node.type;
|
|
143
142
|
if (m)
|
|
144
|
-
log
|
|
143
|
+
log?.debug("NODE MATCH", fnode.node.value, breadCrumb(path));
|
|
145
144
|
return m;
|
|
146
145
|
}
|
|
147
146
|
function addIfTokenMatch(fnode, path, state) {
|
|
@@ -209,11 +208,11 @@ function createQuerier() {
|
|
|
209
208
|
const nodes = getPrimitiveChildren(fnode.node.value, path);
|
|
210
209
|
if (nodes.length == 0)
|
|
211
210
|
return;
|
|
212
|
-
log
|
|
211
|
+
log?.debug("PRIMITIVE", fnode.node.value, nodes);
|
|
213
212
|
fnode.result.push(...nodes);
|
|
214
213
|
}
|
|
215
214
|
function evaluateFilter(filter, path) {
|
|
216
|
-
log
|
|
215
|
+
log?.debug("EVALUATING FILTER", filter, breadCrumb(path));
|
|
217
216
|
if ("type" in filter) {
|
|
218
217
|
if (filter.type == "and") {
|
|
219
218
|
const left = evaluateFilter(filter.left, path);
|
|
@@ -248,7 +247,7 @@ function createQuerier() {
|
|
|
248
247
|
function resolveBinding(path) {
|
|
249
248
|
if (!(0, nodeutils_1.isIdentifier)(path.node))
|
|
250
249
|
return undefined;
|
|
251
|
-
log
|
|
250
|
+
log?.debug("RESOLVING BINDING FOR ", path.node);
|
|
252
251
|
const name = path.node.name;
|
|
253
252
|
if (name == undefined || typeof name != "string")
|
|
254
253
|
return undefined;
|
|
@@ -256,7 +255,7 @@ function createQuerier() {
|
|
|
256
255
|
const binding = getBinding(path.scopeId, name);
|
|
257
256
|
if (!binding)
|
|
258
257
|
return undefined;
|
|
259
|
-
log
|
|
258
|
+
log?.debug("THIS IS THE BINDING", binding);
|
|
260
259
|
return binding.path;
|
|
261
260
|
}
|
|
262
261
|
function resolveFilterWithParent(node, path) {
|
|
@@ -267,7 +266,7 @@ function createQuerier() {
|
|
|
267
266
|
throw new Error("Parent filter must have child");
|
|
268
267
|
if (!startPath.parentPath)
|
|
269
268
|
return [];
|
|
270
|
-
log
|
|
269
|
+
log?.debug("STEP OUT", startNode, breadCrumb(startPath));
|
|
271
270
|
startNode = startNode.child;
|
|
272
271
|
startPath = startPath.parentPath;
|
|
273
272
|
}
|
|
@@ -286,9 +285,9 @@ function createQuerier() {
|
|
|
286
285
|
const lookup = startNode.value;
|
|
287
286
|
if (!lookup)
|
|
288
287
|
throw new Error("Selector must have a value");
|
|
289
|
-
//log
|
|
288
|
+
//log?.debug("STEP IN ", lookup, paths.map(p => breadCrumb(p)));
|
|
290
289
|
const nodes = paths.filter(nodeutils_1.isNodePath).map(n => getPrimitiveChildrenOrNodePaths(lookup, n)).flat();
|
|
291
|
-
//log
|
|
290
|
+
//log?.debug("LOOKUP", lookup, path.node.type, nodes.map(n => n.node));
|
|
292
291
|
//console.log(nodes);
|
|
293
292
|
if (nodes.length == 0)
|
|
294
293
|
return [];
|
|
@@ -310,7 +309,7 @@ function createQuerier() {
|
|
|
310
309
|
}
|
|
311
310
|
startNode = startNode.child;
|
|
312
311
|
}
|
|
313
|
-
//log
|
|
312
|
+
//log?.debug("DIRECT TRAV RESOLVE", startNode, paths.map(p => breadCrumb(p)));
|
|
314
313
|
const result = [];
|
|
315
314
|
//console.log(paths.length, subQueryCounter);
|
|
316
315
|
for (const path of paths) {
|
|
@@ -328,7 +327,7 @@ function createQuerier() {
|
|
|
328
327
|
}
|
|
329
328
|
}
|
|
330
329
|
}
|
|
331
|
-
log
|
|
330
|
+
log?.debug("DIRECT TRAV RESOLVE RESULT", result);
|
|
332
331
|
return result;
|
|
333
332
|
}
|
|
334
333
|
function addResultIfTokenMatch(fnode, path, state) {
|
|
@@ -385,7 +384,7 @@ function createQuerier() {
|
|
|
385
384
|
resolveFunctionCalls(fnode, functionCallResult, path, state);
|
|
386
385
|
}
|
|
387
386
|
else if (matchingFilters.length > 0) {
|
|
388
|
-
log
|
|
387
|
+
log?.debug("HAS MATCHING FILTER", fnode.result.length, matchingFilters.length, breadCrumb(path));
|
|
389
388
|
fnode.result.push(...matchingFilters.flatMap(f => f.result));
|
|
390
389
|
}
|
|
391
390
|
}
|
|
@@ -401,7 +400,7 @@ function createQuerier() {
|
|
|
401
400
|
}
|
|
402
401
|
}
|
|
403
402
|
const functionResult = exports.functions[functionCallResult.functionCall.function].fn(parameterResults);
|
|
404
|
-
log
|
|
403
|
+
log?.debug("PARAMETER RESULTS", functionCallResult.functionCall.function, parameterResults, functionResult);
|
|
405
404
|
fnode.result.push(...functionResult);
|
|
406
405
|
}
|
|
407
406
|
function travHandle(queries, root) {
|
|
@@ -422,7 +421,7 @@ function createQuerier() {
|
|
|
422
421
|
state.descendant.slice(0, state.depth + 1).forEach(fnodes => fnodes.forEach(fnode => addPrimitiveAttributeIfMatch(fnode, root)));
|
|
423
422
|
traverse(root.node, {
|
|
424
423
|
enter(path, state) {
|
|
425
|
-
//log
|
|
424
|
+
//log?.debug("ENTER", breadCrumb(path));
|
|
426
425
|
state.depth++;
|
|
427
426
|
state.child.push([]);
|
|
428
427
|
state.descendant.push([]);
|
|
@@ -440,7 +439,7 @@ function createQuerier() {
|
|
|
440
439
|
}
|
|
441
440
|
},
|
|
442
441
|
exit(path, state) {
|
|
443
|
-
log
|
|
442
|
+
log?.debug("EXIT", breadCrumb(path));
|
|
444
443
|
// Check for attributes as not all attributes are visited
|
|
445
444
|
state.child[state.depth + 1].forEach(fnode => addPrimitiveAttributeIfMatch(fnode, path));
|
|
446
445
|
for (const fnodes of state.descendant) {
|
|
@@ -465,6 +464,7 @@ function createQuerier() {
|
|
|
465
464
|
function beginHandle(queries, path) {
|
|
466
465
|
const rootPath = createNodePath(path, undefined, undefined, undefined, undefined);
|
|
467
466
|
const r = travHandle(queries, rootPath);
|
|
467
|
+
memo.clear();
|
|
468
468
|
return r;
|
|
469
469
|
}
|
|
470
470
|
return {
|
|
@@ -489,23 +489,24 @@ function multiQuery(code, namedQueries, returnAST) {
|
|
|
489
489
|
const queries = Object.fromEntries(Object.entries(namedQueries).map(([name, query]) => [name, (0, parseQuery_1.parse)(query)]));
|
|
490
490
|
const querier = createQuerier();
|
|
491
491
|
const result = querier.beginHandle(queries, ast);
|
|
492
|
-
log
|
|
492
|
+
log?.debug("Query time: ", Date.now() - start);
|
|
493
493
|
if (returnAST) {
|
|
494
494
|
return { ...result, __AST: ast };
|
|
495
495
|
}
|
|
496
496
|
return result;
|
|
497
497
|
}
|
|
498
|
-
function parseSource(source) {
|
|
498
|
+
function parseSource(source, optimize = true) {
|
|
499
|
+
const parsingOptions = optimize ? { loc: false, ranges: false } : { loc: true, ranges: true };
|
|
499
500
|
try {
|
|
500
|
-
return (0, meriyah_1.parseScript)(source, { module: true, next: true });
|
|
501
|
+
return (0, meriyah_1.parseScript)(source, { module: true, next: true, ...parsingOptions });
|
|
501
502
|
}
|
|
502
503
|
catch (e) {
|
|
503
|
-
return (0, meriyah_1.parseScript)(source, { module: false, next: true });
|
|
504
|
+
return (0, meriyah_1.parseScript)(source, { module: false, next: true, ...parsingOptions, webcompat: true });
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
|
-
const scopes = new Map();
|
|
507
507
|
function createTraverser() {
|
|
508
508
|
let scopeIdCounter = 0;
|
|
509
|
+
const scopes = new Map();
|
|
509
510
|
let removedScopes = 0;
|
|
510
511
|
const nodePathsCreated = {};
|
|
511
512
|
function createScope(parentScopeId) {
|
|
@@ -720,10 +721,10 @@ function createTraverser() {
|
|
|
720
721
|
const fscope = path?.functionScopeId ?? node.extra?.functionScopeId ?? scopeId;
|
|
721
722
|
traverseInner(node, visitor, scopeId, fscope, state, path);
|
|
722
723
|
if (!sOut.includes(scopeIdCounter)) {
|
|
723
|
-
log
|
|
724
|
+
log?.debug("Scopes created", scopeIdCounter, " Scopes removed", removedScopes, "Paths created", pathsCreated, bindingNodesVisited);
|
|
724
725
|
sOut.push(scopeIdCounter);
|
|
725
726
|
const k = Object.fromEntries(Object.entries(nodePathsCreated).sort((a, b) => a[1] - b[1]));
|
|
726
|
-
log
|
|
727
|
+
log?.debug("Node paths created", k);
|
|
727
728
|
}
|
|
728
729
|
}
|
|
729
730
|
return {
|
package/lib/esm/parseQuery.js
CHANGED
|
@@ -5,12 +5,11 @@ exports.parse = parse;
|
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const nodeutils_1 = require("./nodeutils");
|
|
7
7
|
const debugLogEnabled = false;
|
|
8
|
-
const log = {
|
|
9
|
-
debug:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
8
|
+
const log = debugLogEnabled ? {
|
|
9
|
+
debug: (...args) => {
|
|
10
|
+
console.debug(...args);
|
|
11
|
+
}
|
|
12
|
+
} : undefined;
|
|
14
13
|
const supportedIdentifiers = Object.fromEntries(Object.keys(nodeutils_1.VISITOR_KEYS).map(k => [k, k]));
|
|
15
14
|
function isIdentifierToken(token) {
|
|
16
15
|
if (token == undefined)
|
|
@@ -151,7 +150,7 @@ function tokenize(input) {
|
|
|
151
150
|
return result;
|
|
152
151
|
}
|
|
153
152
|
function buildFilter(tokens) {
|
|
154
|
-
log
|
|
153
|
+
log?.debug("BUILD FILTER", tokens);
|
|
155
154
|
tokens.shift();
|
|
156
155
|
const p = buildTree(tokens);
|
|
157
156
|
const next = tokens[0];
|
|
@@ -198,7 +197,7 @@ function buildFilter(tokens) {
|
|
|
198
197
|
}
|
|
199
198
|
const subNodes = ["child", "descendant"];
|
|
200
199
|
function buildTree(tokens) {
|
|
201
|
-
log
|
|
200
|
+
log?.debug("BUILD TREE", tokens);
|
|
202
201
|
if (tokens.length == 0)
|
|
203
202
|
throw new Error("Unexpected end of input");
|
|
204
203
|
const token = tokens.shift();
|
|
@@ -241,7 +240,7 @@ function buildTree(tokens) {
|
|
|
241
240
|
let filter = undefined;
|
|
242
241
|
if (tokens.length > 0 && tokens[0].type == "filterBegin") {
|
|
243
242
|
filter = buildFilter(tokens);
|
|
244
|
-
log
|
|
243
|
+
log?.debug("FILTER", filter, tokens);
|
|
245
244
|
}
|
|
246
245
|
let child = undefined;
|
|
247
246
|
if (tokens.length > 0 && subNodes.includes(tokens[0].type)) {
|
|
@@ -268,7 +267,7 @@ function buildTree(tokens) {
|
|
|
268
267
|
throw new Error("Unexpected token: " + token.type);
|
|
269
268
|
}
|
|
270
269
|
function buildFunctionCall(name, tokens) {
|
|
271
|
-
log
|
|
270
|
+
log?.debug("BUILD FUNCTION", name, tokens);
|
|
272
271
|
const parameters = [];
|
|
273
272
|
const next = tokens.shift();
|
|
274
273
|
if (next?.type != "parametersBegin")
|
|
@@ -290,7 +289,7 @@ function buildFunctionCall(name, tokens) {
|
|
|
290
289
|
function parse(input) {
|
|
291
290
|
const tokens = tokenize(input);
|
|
292
291
|
const result = buildTree(tokens);
|
|
293
|
-
log
|
|
292
|
+
log?.debug("RESULT", result);
|
|
294
293
|
if (!result)
|
|
295
294
|
throw new Error("No root element found");
|
|
296
295
|
return result;
|
package/lib/esm/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare function query(code: string | ASTNode, query: string, returnAST?:
|
|
|
23
23
|
export declare function multiQuery<T extends Record<string, string>>(code: string | ASTNode, namedQueries: T, returnAST?: boolean): Record<keyof T, Result[]> & {
|
|
24
24
|
__AST?: ASTNode;
|
|
25
25
|
};
|
|
26
|
-
export declare function parseSource(source: string): ASTNode;
|
|
26
|
+
export declare function parseSource(source: string, optimize?: boolean): ASTNode;
|
|
27
27
|
export type Binding = {
|
|
28
28
|
path: NodePath;
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE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S;EAmPxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeutils.d.ts","sourceRoot":"","sources":["../../../src/nodeutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAEnC,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"nodeutils.d.ts","sourceRoot":"","sources":["../../../src/nodeutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAEnC,eAAO,MAAM,MAAM,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,OAEzD,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,QAE7D,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,MAAM,CAAC,OAEnE,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAI,KAAK,IAAI,cAEtD,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAI,KAAK,IAAI,MAAM,CAAC,gBAEpE,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,oBAEzE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,gBAErE,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,UAE/D,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,mBAExE,CAAA;AACD,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,kBAEvE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,kBAEvE,CAAA;AACD,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,IAAI,IAAI,MAAM,CAAC,mBAExE,CAAA;AACD,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,CAAC,IAAI,EAAE,YAAY,MAAM,CAAC,IAAI,EAAE,iBAAiB,MAAM,CAAC,IAAI,GAAG,SAAS,KAAG,OAwBhH,CAAA;AAuDD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CA2F9D,CAAC;AAqBF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAS3E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAqBrD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC,eAAe,CAEnF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astronomical",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"type": "commonjs",
|
|
4
5
|
"description": "offers a way to query a Javascript AST to find specific patterns using a syntax somewhat similar to XPath.",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"lint": "eslint . --ext .ts --fix --ignore-path .gitignore",
|