@mojir/lits 1.2.1 → 1.2.2-alpha.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/dist/cli/cli.js +10 -1
- package/dist/cli/src/analyze/index.d.ts +2 -1
- package/dist/cli/src/index.d.ts +1 -0
- package/dist/index.esm.js +31 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +31 -1
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +31 -1
- package/dist/lits.iife.js.map +1 -1
- package/dist/src/analyze/index.d.ts +2 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/testFramework.esm.js +10 -1
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +10 -1
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LitsParams } from '../Lits/Lits';
|
|
2
2
|
import type { Builtin } from '../builtin/interface';
|
|
3
3
|
import { type ContextStack } from '../evaluator/ContextStack';
|
|
4
|
-
import type { Ast, AstNode } from '../parser/interface';
|
|
4
|
+
import type { Ast, AstNode, LitsFunction } from '../parser/interface';
|
|
5
5
|
import type { Token } from '../tokenizer/interface';
|
|
6
6
|
export interface UnresolvedIdentifier {
|
|
7
7
|
symbol: string;
|
|
@@ -15,3 +15,4 @@ export interface Analysis {
|
|
|
15
15
|
}
|
|
16
16
|
export type FindUnresolvedIdentifiers = (ast: Ast | AstNode[], contextStack: ContextStack, builtin: Builtin) => UnresolvedIdentifiers;
|
|
17
17
|
export declare function analyze(ast: Ast, params: LitsParams): Analysis;
|
|
18
|
+
export declare function findUnresolvedIdentifiersInFunction(fun: LitsFunction, params: LitsParams): UnresolvedIdentifiers;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export { apiReference, isDatatypeReference, isFunctionReference, isNormalExpress
|
|
|
14
14
|
export type { Argument, CommonReference, DatatypeReference, FunctionReference, Reference, ShorthandReference } from '../reference';
|
|
15
15
|
export type { ApiName, FunctionName, ShorthandName, DatatypeName } from '../reference/api';
|
|
16
16
|
export { isApiName, isDataType } from '../reference/api';
|
|
17
|
+
export { findUnresolvedIdentifiersInFunction } from './analyze';
|
|
@@ -2827,7 +2827,7 @@ var mathNormalExpression = {
|
|
|
2827
2827
|
},
|
|
2828
2828
|
};
|
|
2829
2829
|
|
|
2830
|
-
var version = "1.2.1";
|
|
2830
|
+
var version = "1.2.2-alpha.1";
|
|
2831
2831
|
|
|
2832
2832
|
var uuidTemplate = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
2833
2833
|
var xyRegexp = /[xy]/g;
|
|
@@ -6283,6 +6283,15 @@ function evaluateNumberAsFunction(fn, params, sourceCodeInfo) {
|
|
|
6283
6283
|
return toAny(param[fn]);
|
|
6284
6284
|
}
|
|
6285
6285
|
|
|
6286
|
+
// export function findUnresolvedIdentifiersInFunction(ast, contextStack, builtin: Builtin) => {
|
|
6287
|
+
// const astNodes = Array.isArray(ast) ? ast : ast.b
|
|
6288
|
+
// const unresolvedIdentifiers = new Set<UnresolvedIdentifier>()
|
|
6289
|
+
// for (const subNode of astNodes) {
|
|
6290
|
+
// findUnresolvedIdentifiersInAstNode(subNode, contextStack, builtin)
|
|
6291
|
+
// .forEach(symbol => unresolvedIdentifiers.add(symbol))
|
|
6292
|
+
// }
|
|
6293
|
+
// return unresolvedIdentifiers
|
|
6294
|
+
// }
|
|
6286
6295
|
var findUnresolvedIdentifiers = function (ast, contextStack, builtin) {
|
|
6287
6296
|
var e_1, _a;
|
|
6288
6297
|
var astNodes = Array.isArray(ast) ? ast : ast.b;
|