@tokens-studio/tokenscript-interpreter 0.32.0 → 0.33.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/chunk-QP7M6WUR.js +6227 -0
- package/dist/chunk-QP7M6WUR.js.map +1 -0
- package/dist/cli.js +22 -1
- package/dist/cli.js.map +1 -1
- package/dist/lib/{chunk-QGOGK2VP.cjs → chunk-AQEJB7EO.cjs} +28 -2
- package/dist/lib/chunk-AQEJB7EO.cjs.map +1 -0
- package/dist/lib/{chunk-UYVHWJIC.js → chunk-DFN353G4.js} +27 -3
- package/dist/lib/chunk-DFN353G4.js.map +1 -0
- package/dist/lib/index.cjs +56 -48
- package/dist/lib/index.d.cts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/interpreter.cjs +32 -32
- package/dist/lib/interpreter.js +1 -1
- package/dist/lib/processor-node.cjs +3 -3
- package/dist/lib/processor-node.js +1 -1
- package/dist/lib/processor.cjs +21 -13
- package/dist/lib/processor.d.cts +14 -1
- package/dist/lib/processor.d.ts +14 -1
- package/dist/lib/processor.js +1 -1
- package/dist/lib/schema.cjs +3 -3
- package/dist/lib/schema.js +1 -1
- package/dist/processor/index.d.ts +14 -1
- package/dist/processor/index.js +22 -1
- package/dist/processor/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/lib/chunk-QGOGK2VP.cjs.map +0 -1
- package/dist/lib/chunk-UYVHWJIC.js.map +0 -1
|
@@ -3211,6 +3211,21 @@ var _DependencyGraph = class _DependencyGraph {
|
|
|
3211
3211
|
__name(_DependencyGraph, "DependencyGraph");
|
|
3212
3212
|
var DependencyGraph = _DependencyGraph;
|
|
3213
3213
|
|
|
3214
|
+
// src/processor/utils/name-validation.ts
|
|
3215
|
+
var INVALID_TOKEN_NAME_CHARS = /[ \t\n\r\f{}[\]]/;
|
|
3216
|
+
function validateTokenName(name) {
|
|
3217
|
+
return name.length > 0 && !INVALID_TOKEN_NAME_CHARS.test(name);
|
|
3218
|
+
}
|
|
3219
|
+
__name(validateTokenName, "validateTokenName");
|
|
3220
|
+
function splitTokenPath(path) {
|
|
3221
|
+
return path.split(".");
|
|
3222
|
+
}
|
|
3223
|
+
__name(splitTokenPath, "splitTokenPath");
|
|
3224
|
+
function validateTokenPath(path) {
|
|
3225
|
+
return splitTokenPath(path).every(validateTokenName);
|
|
3226
|
+
}
|
|
3227
|
+
__name(validateTokenPath, "validateTokenPath");
|
|
3228
|
+
|
|
3214
3229
|
// src/processor/utils/structured-tokens.ts
|
|
3215
3230
|
function matchesObjectParser(value, parsers) {
|
|
3216
3231
|
if (!isObject(value)) return false;
|
|
@@ -3648,6 +3663,15 @@ var _PrefixResolver = class _PrefixResolver {
|
|
|
3648
3663
|
parseAndBuildGraph() {
|
|
3649
3664
|
this.earlyResolved = [];
|
|
3650
3665
|
for (const [tokenName, tokenData] of this.tokens.entries()) {
|
|
3666
|
+
if (!validateTokenPath(tokenName)) {
|
|
3667
|
+
this.addIssue(tokenName, {
|
|
3668
|
+
code: "INVALID_TOKEN_NAME",
|
|
3669
|
+
severity: "error" /* ERROR */,
|
|
3670
|
+
message: `token "${tokenName}" contains invalid characters in name (spaces, braces, or brackets are not allowed)`,
|
|
3671
|
+
tokenName,
|
|
3672
|
+
data: { path: tokenName }
|
|
3673
|
+
});
|
|
3674
|
+
}
|
|
3651
3675
|
const tokenValue = getTokenValue(tokenData);
|
|
3652
3676
|
if (isString(tokenValue) && UNINTERPRETED_KEYWORDS.includes(tokenValue)) {
|
|
3653
3677
|
const symbol = new StringSymbol(tokenValue, this.config);
|
|
@@ -6999,6 +7023,6 @@ var ASTNodes = {
|
|
|
6999
7023
|
UnaryOpNode
|
|
7000
7024
|
};
|
|
7001
7025
|
|
|
7002
|
-
export { ASTNodes, ColorManager, ColorSpecificationSchema, Config, ConstantsSpecificationSchema, DEFAULT_LANGUAGE_OPTIONS, FunctionSpecificationSchema, FunctionsManager, IncompleteType, Interpreter, Lexer, ParseState, Parser, PartialBinOpNode, PartialFunctionCallNode, PartialParenNode, PartialReferenceNode, PartialStringNode, PartialUnaryOpNode, TokenResolver, UnitManager, UnitSpecificationSchema, ValidationSeverity, buildTokens, builders_exports, collectAllReferences, collectReferenceNodes, errorClasses, errorHelpers, evaluateExpression, fetchAndRegisterSchemas, fetchTokenScriptSchema, filterAST, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, hasPartialNodes, parseExpression, parseTolerantly, processTokenSets, processTokens, renameReferences, tokenizeTolerantly, walkAST };
|
|
7003
|
-
//# sourceMappingURL=chunk-
|
|
7004
|
-
//# sourceMappingURL=chunk-
|
|
7026
|
+
export { ASTNodes, ColorManager, ColorSpecificationSchema, Config, ConstantsSpecificationSchema, DEFAULT_LANGUAGE_OPTIONS, FunctionSpecificationSchema, FunctionsManager, IncompleteType, Interpreter, Lexer, ParseState, Parser, PartialBinOpNode, PartialFunctionCallNode, PartialParenNode, PartialReferenceNode, PartialStringNode, PartialUnaryOpNode, TokenResolver, UnitManager, UnitSpecificationSchema, ValidationSeverity, buildTokens, builders_exports, collectAllReferences, collectReferenceNodes, errorClasses, errorHelpers, evaluateExpression, fetchAndRegisterSchemas, fetchTokenScriptSchema, filterAST, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, hasPartialNodes, parseExpression, parseTolerantly, processTokenSets, processTokens, renameReferences, tokenizeTolerantly, validateTokenName, validateTokenPath, walkAST };
|
|
7027
|
+
//# sourceMappingURL=chunk-DFN353G4.js.map
|
|
7028
|
+
//# sourceMappingURL=chunk-DFN353G4.js.map
|