@tokens-studio/tokenscript-interpreter 0.32.0 → 0.34.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.
Files changed (70) hide show
  1. package/dist/chunk-33CDF4L4.js +6444 -0
  2. package/dist/chunk-33CDF4L4.js.map +1 -0
  3. package/dist/chunk-AXH5N7KV.js +99 -0
  4. package/dist/chunk-AXH5N7KV.js.map +1 -0
  5. package/dist/chunk-QP7M6WUR.js +6227 -0
  6. package/dist/chunk-QP7M6WUR.js.map +1 -0
  7. package/dist/cli.js +242 -2
  8. package/dist/cli.js.map +1 -1
  9. package/dist/compliance-suite.js +2 -2
  10. package/dist/config-DtbN3iyg.d.ts +918 -0
  11. package/dist/lib/{chunk-QYRJ6NSL.cjs → chunk-LEYHQJTL.cjs} +3 -2
  12. package/dist/lib/chunk-LEYHQJTL.cjs.map +1 -0
  13. package/dist/lib/{chunk-GKSWF7FF.cjs → chunk-LMGHS2NP.cjs} +102 -100
  14. package/dist/lib/chunk-LMGHS2NP.cjs.map +1 -0
  15. package/dist/lib/{chunk-LI2D53SH.js → chunk-LSTH2XJ4.js} +5 -3
  16. package/dist/lib/chunk-LSTH2XJ4.js.map +1 -0
  17. package/dist/lib/{chunk-YD3MIYOO.js → chunk-ODVWXGOM.js} +3 -2
  18. package/dist/lib/chunk-ODVWXGOM.js.map +1 -0
  19. package/dist/lib/{chunk-UYVHWJIC.js → chunk-RWXDOZAS.js} +250 -5
  20. package/dist/lib/chunk-RWXDOZAS.js.map +1 -0
  21. package/dist/lib/{chunk-QGOGK2VP.cjs → chunk-YCIBJDRB.cjs} +790 -543
  22. package/dist/lib/chunk-YCIBJDRB.cjs.map +1 -0
  23. package/dist/lib/index.cjs +97 -89
  24. package/dist/lib/index.d.cts +5 -5
  25. package/dist/lib/index.d.ts +5 -5
  26. package/dist/lib/index.js +3 -3
  27. package/dist/lib/{interpreter-DNmBc--s.d.ts → interpreter-6QwMkUqD.d.cts} +30 -2
  28. package/dist/lib/{interpreter-CP7CNwDa.d.cts → interpreter-v7WiwSP9.d.ts} +30 -2
  29. package/dist/lib/interpreter.cjs +73 -73
  30. package/dist/lib/interpreter.d.cts +4 -4
  31. package/dist/lib/interpreter.d.ts +4 -4
  32. package/dist/lib/interpreter.js +3 -3
  33. package/dist/lib/processor-node.cjs +12 -12
  34. package/dist/lib/processor-node.d.cts +3 -3
  35. package/dist/lib/processor-node.d.ts +3 -3
  36. package/dist/lib/processor-node.js +3 -3
  37. package/dist/lib/processor.cjs +23 -15
  38. package/dist/lib/processor.d.cts +18 -5
  39. package/dist/lib/processor.d.ts +18 -5
  40. package/dist/lib/processor.js +3 -3
  41. package/dist/lib/schema.cjs +5 -5
  42. package/dist/lib/schema.d.cts +1 -1
  43. package/dist/lib/schema.d.ts +1 -1
  44. package/dist/lib/schema.js +3 -3
  45. package/dist/lib/syntax-highlighting.cjs +15 -15
  46. package/dist/lib/syntax-highlighting.d.cts +1 -1
  47. package/dist/lib/syntax-highlighting.d.ts +1 -1
  48. package/dist/lib/syntax-highlighting.js +2 -2
  49. package/dist/lib/{types-DHgmzR1Z.d.ts → types-BI0AZ4Ej.d.ts} +2 -2
  50. package/dist/lib/{types-BimJex2v.d.cts → types-EB8V9c46.d.cts} +1 -0
  51. package/dist/lib/{types-BimJex2v.d.ts → types-EB8V9c46.d.ts} +1 -0
  52. package/dist/lib/{types-DsJuwrq3.d.cts → types-cFwP43uv.d.cts} +2 -2
  53. package/dist/lib/types.cjs +6 -6
  54. package/dist/lib/types.d.cts +1 -1
  55. package/dist/lib/types.d.ts +1 -1
  56. package/dist/lib/types.js +1 -1
  57. package/dist/processor/index.d.ts +15 -2
  58. package/dist/processor/index.js +24 -3
  59. package/dist/processor/index.js.map +1 -1
  60. package/dist/repl.d.ts +1 -1
  61. package/dist/repl.js +2 -2
  62. package/dist/types.d.ts +1 -1
  63. package/dist/types.js +1 -1
  64. package/package.json +1 -1
  65. package/dist/lib/chunk-GKSWF7FF.cjs.map +0 -1
  66. package/dist/lib/chunk-LI2D53SH.js.map +0 -1
  67. package/dist/lib/chunk-QGOGK2VP.cjs.map +0 -1
  68. package/dist/lib/chunk-QYRJ6NSL.cjs.map +0 -1
  69. package/dist/lib/chunk-UYVHWJIC.js.map +0 -1
  70. package/dist/lib/chunk-YD3MIYOO.js.map +0 -1
@@ -1,58 +1,66 @@
1
1
  'use strict';
2
2
 
3
- var chunkQGOGK2VP_cjs = require('./chunk-QGOGK2VP.cjs');
4
- require('./chunk-GKSWF7FF.cjs');
5
- require('./chunk-QYRJ6NSL.cjs');
3
+ var chunkYCIBJDRB_cjs = require('./chunk-YCIBJDRB.cjs');
4
+ require('./chunk-LMGHS2NP.cjs');
5
+ require('./chunk-LEYHQJTL.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "TokenResolver", {
10
10
  enumerable: true,
11
- get: function () { return chunkQGOGK2VP_cjs.TokenResolver; }
11
+ get: function () { return chunkYCIBJDRB_cjs.TokenResolver; }
12
12
  });
13
13
  Object.defineProperty(exports, "ValidationSeverity", {
14
14
  enumerable: true,
15
- get: function () { return chunkQGOGK2VP_cjs.ValidationSeverity; }
15
+ get: function () { return chunkYCIBJDRB_cjs.ValidationSeverity; }
16
16
  });
17
17
  Object.defineProperty(exports, "buildTokens", {
18
18
  enumerable: true,
19
- get: function () { return chunkQGOGK2VP_cjs.buildTokens; }
19
+ get: function () { return chunkYCIBJDRB_cjs.buildTokens; }
20
20
  });
21
21
  Object.defineProperty(exports, "builders", {
22
22
  enumerable: true,
23
- get: function () { return chunkQGOGK2VP_cjs.builders_exports; }
23
+ get: function () { return chunkYCIBJDRB_cjs.builders_exports; }
24
24
  });
25
25
  Object.defineProperty(exports, "flattenChildrenMap", {
26
26
  enumerable: true,
27
- get: function () { return chunkQGOGK2VP_cjs.flattenChildrenMap; }
27
+ get: function () { return chunkYCIBJDRB_cjs.flattenChildrenMap; }
28
28
  });
29
29
  Object.defineProperty(exports, "flattenChildrenObject", {
30
30
  enumerable: true,
31
- get: function () { return chunkQGOGK2VP_cjs.flattenChildrenObject; }
31
+ get: function () { return chunkYCIBJDRB_cjs.flattenChildrenObject; }
32
32
  });
33
33
  Object.defineProperty(exports, "getAffectedTokens", {
34
34
  enumerable: true,
35
- get: function () { return chunkQGOGK2VP_cjs.getAffectedTokens; }
35
+ get: function () { return chunkYCIBJDRB_cjs.getAffectedTokens; }
36
36
  });
37
37
  Object.defineProperty(exports, "getBrokenReferences", {
38
38
  enumerable: true,
39
- get: function () { return chunkQGOGK2VP_cjs.getBrokenReferences; }
39
+ get: function () { return chunkYCIBJDRB_cjs.getBrokenReferences; }
40
40
  });
41
41
  Object.defineProperty(exports, "getModifiedDependants", {
42
42
  enumerable: true,
43
- get: function () { return chunkQGOGK2VP_cjs.getModifiedDependants; }
43
+ get: function () { return chunkYCIBJDRB_cjs.getModifiedDependants; }
44
44
  });
45
45
  Object.defineProperty(exports, "getRenamedReferences", {
46
46
  enumerable: true,
47
- get: function () { return chunkQGOGK2VP_cjs.getRenamedReferences; }
47
+ get: function () { return chunkYCIBJDRB_cjs.getRenamedReferences; }
48
48
  });
49
49
  Object.defineProperty(exports, "processTokenSets", {
50
50
  enumerable: true,
51
- get: function () { return chunkQGOGK2VP_cjs.processTokenSets; }
51
+ get: function () { return chunkYCIBJDRB_cjs.processTokenSets; }
52
52
  });
53
53
  Object.defineProperty(exports, "processTokens", {
54
54
  enumerable: true,
55
- get: function () { return chunkQGOGK2VP_cjs.processTokens; }
55
+ get: function () { return chunkYCIBJDRB_cjs.processTokens; }
56
+ });
57
+ Object.defineProperty(exports, "validateTokenName", {
58
+ enumerable: true,
59
+ get: function () { return chunkYCIBJDRB_cjs.validateTokenName; }
60
+ });
61
+ Object.defineProperty(exports, "validateTokenPath", {
62
+ enumerable: true,
63
+ get: function () { return chunkYCIBJDRB_cjs.validateTokenPath; }
56
64
  });
57
65
  //# sourceMappingURL=processor.cjs.map
58
66
  //# sourceMappingURL=processor.cjs.map
@@ -1,7 +1,7 @@
1
- import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-DsJuwrq3.cjs';
2
- export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-DsJuwrq3.cjs';
3
- import { l as InterpreterResult } from './interpreter-CP7CNwDa.cjs';
4
- import './types-BimJex2v.cjs';
1
+ import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-cFwP43uv.cjs';
2
+ export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-cFwP43uv.cjs';
3
+ import { l as InterpreterResult } from './interpreter-6QwMkUqD.cjs';
4
+ import './types-EB8V9c46.cjs';
5
5
  import '@tokens-studio/schema-validation';
6
6
 
7
7
  type FlattenCallback<T> = (key: string, value: InterpreterResult) => T;
@@ -134,4 +134,17 @@ declare function getRenamedReferences(_result: TokenOperationResult, modifiedTok
134
134
  */
135
135
  declare function getModifiedDependants(oldTokens: Map<RefPath, any>, result: TokenOperationResult): Set<RefPath>;
136
136
 
137
- export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens };
137
+ /**
138
+ * Token name validation.
139
+ *
140
+ * Must stay in sync with the Go and Ruby versions. The shared fixture
141
+ * at tokenscript/test-suites/token-name-validation.json proves they agree.
142
+ * Uses explicit whitespace chars (not \s) to ensure identical behavior
143
+ * across Go/JS/Ruby regex engines.
144
+ */
145
+ /** Returns true if a single name segment is valid: non-empty and contains no whitespace, braces, or brackets. */
146
+ declare function validateTokenName(name: string): boolean;
147
+ /** Returns true if every segment of a dot-delimited token path is a valid token name. */
148
+ declare function validateTokenPath(path: string): boolean;
149
+
150
+ export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens, validateTokenName, validateTokenPath };
@@ -1,7 +1,7 @@
1
- import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-DHgmzR1Z.js';
2
- export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-DHgmzR1Z.js';
3
- import { l as InterpreterResult } from './interpreter-DNmBc--s.js';
4
- import './types-BimJex2v.js';
1
+ import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-BI0AZ4Ej.js';
2
+ export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-BI0AZ4Ej.js';
3
+ import { l as InterpreterResult } from './interpreter-v7WiwSP9.js';
4
+ import './types-EB8V9c46.js';
5
5
  import '@tokens-studio/schema-validation';
6
6
 
7
7
  type FlattenCallback<T> = (key: string, value: InterpreterResult) => T;
@@ -134,4 +134,17 @@ declare function getRenamedReferences(_result: TokenOperationResult, modifiedTok
134
134
  */
135
135
  declare function getModifiedDependants(oldTokens: Map<RefPath, any>, result: TokenOperationResult): Set<RefPath>;
136
136
 
137
- export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens };
137
+ /**
138
+ * Token name validation.
139
+ *
140
+ * Must stay in sync with the Go and Ruby versions. The shared fixture
141
+ * at tokenscript/test-suites/token-name-validation.json proves they agree.
142
+ * Uses explicit whitespace chars (not \s) to ensure identical behavior
143
+ * across Go/JS/Ruby regex engines.
144
+ */
145
+ /** Returns true if a single name segment is valid: non-empty and contains no whitespace, braces, or brackets. */
146
+ declare function validateTokenName(name: string): boolean;
147
+ /** Returns true if every segment of a dot-delimited token path is a valid token name. */
148
+ declare function validateTokenPath(path: string): boolean;
149
+
150
+ export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens, validateTokenName, validateTokenPath };
@@ -1,5 +1,5 @@
1
- export { TokenResolver, ValidationSeverity, buildTokens, builders_exports as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens } from './chunk-UYVHWJIC.js';
2
- import './chunk-LI2D53SH.js';
3
- import './chunk-YD3MIYOO.js';
1
+ export { TokenResolver, ValidationSeverity, buildTokens, builders_exports as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens, validateTokenName, validateTokenPath } from './chunk-RWXDOZAS.js';
2
+ import './chunk-LSTH2XJ4.js';
3
+ import './chunk-ODVWXGOM.js';
4
4
  //# sourceMappingURL=processor.js.map
5
5
  //# sourceMappingURL=processor.js.map
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkQGOGK2VP_cjs = require('./chunk-QGOGK2VP.cjs');
4
- require('./chunk-GKSWF7FF.cjs');
5
- require('./chunk-QYRJ6NSL.cjs');
3
+ var chunkYCIBJDRB_cjs = require('./chunk-YCIBJDRB.cjs');
4
+ require('./chunk-LMGHS2NP.cjs');
5
+ require('./chunk-LEYHQJTL.cjs');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "fetchAndRegisterSchemas", {
10
10
  enumerable: true,
11
- get: function () { return chunkQGOGK2VP_cjs.fetchAndRegisterSchemas; }
11
+ get: function () { return chunkYCIBJDRB_cjs.fetchAndRegisterSchemas; }
12
12
  });
13
13
  Object.defineProperty(exports, "fetchTokenScriptSchema", {
14
14
  enumerable: true,
15
- get: function () { return chunkQGOGK2VP_cjs.fetchTokenScriptSchema; }
15
+ get: function () { return chunkYCIBJDRB_cjs.fetchTokenScriptSchema; }
16
16
  });
17
17
  //# sourceMappingURL=schema.cjs.map
18
18
  //# sourceMappingURL=schema.cjs.map
@@ -1,4 +1,4 @@
1
- import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-BimJex2v.cjs';
1
+ import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-EB8V9c46.cjs';
2
2
  import '@tokens-studio/schema-validation';
3
3
 
4
4
  interface TokenScriptSchemaResponse {
@@ -1,4 +1,4 @@
1
- import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-BimJex2v.js';
1
+ import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-EB8V9c46.js';
2
2
  import '@tokens-studio/schema-validation';
3
3
 
4
4
  interface TokenScriptSchemaResponse {
@@ -1,5 +1,5 @@
1
- export { fetchAndRegisterSchemas, fetchTokenScriptSchema } from './chunk-UYVHWJIC.js';
2
- import './chunk-LI2D53SH.js';
3
- import './chunk-YD3MIYOO.js';
1
+ export { fetchAndRegisterSchemas, fetchTokenScriptSchema } from './chunk-RWXDOZAS.js';
2
+ import './chunk-LSTH2XJ4.js';
3
+ import './chunk-ODVWXGOM.js';
4
4
  //# sourceMappingURL=schema.js.map
5
5
  //# sourceMappingURL=schema.js.map
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkGKSWF7FF_cjs = require('./chunk-GKSWF7FF.cjs');
4
- var chunkQYRJ6NSL_cjs = require('./chunk-QYRJ6NSL.cjs');
3
+ var chunkLMGHS2NP_cjs = require('./chunk-LMGHS2NP.cjs');
4
+ var chunkLEYHQJTL_cjs = require('./chunk-LEYHQJTL.cjs');
5
5
 
6
6
  // src/syntax-highlighter/spec.ts
7
- var KEYWORDS = Object.values(chunkQYRJ6NSL_cjs.ReservedKeyword);
7
+ var KEYWORDS = Object.values(chunkLEYHQJTL_cjs.ReservedKeyword);
8
8
  var TYPES = [
9
- chunkGKSWF7FF_cjs.StringSymbol.type,
10
- chunkGKSWF7FF_cjs.NumberSymbol.type,
11
- chunkGKSWF7FF_cjs.NumberWithUnitSymbol.type,
12
- chunkGKSWF7FF_cjs.ColorSymbol.type,
13
- chunkGKSWF7FF_cjs.ListSymbol.type,
14
- chunkGKSWF7FF_cjs.DictionarySymbol.type,
15
- chunkGKSWF7FF_cjs.BooleanSymbol.type
9
+ chunkLMGHS2NP_cjs.StringSymbol.type,
10
+ chunkLMGHS2NP_cjs.NumberSymbol.type,
11
+ chunkLMGHS2NP_cjs.NumberWithUnitSymbol.type,
12
+ chunkLMGHS2NP_cjs.ColorSymbol.type,
13
+ chunkLMGHS2NP_cjs.ListSymbol.type,
14
+ chunkLMGHS2NP_cjs.DictionarySymbol.type,
15
+ chunkLMGHS2NP_cjs.BooleanSymbol.type
16
16
  ];
17
17
  var BUILTIN_FUNCTIONS = [
18
18
  "rgb",
@@ -35,9 +35,9 @@ var BUILTIN_FUNCTIONS = [
35
35
  "linear-gradient",
36
36
  "type"
37
37
  ];
38
- var UNITS = Object.values(chunkQYRJ6NSL_cjs.SupportedFormats);
38
+ var UNITS = Object.values(chunkLEYHQJTL_cjs.SupportedFormats);
39
39
  var OPERATORS = [
40
- ...Object.values(chunkQYRJ6NSL_cjs.Operations),
40
+ ...Object.values(chunkLEYHQJTL_cjs.Operations),
41
41
  "=",
42
42
  ">",
43
43
  "<",
@@ -91,12 +91,12 @@ var MONACO_PATTERNS = {
91
91
  function createKeywordPattern(keywords) {
92
92
  return new RegExp(`\\b(?:${keywords.join("|")})\\b`);
93
93
  }
94
- chunkQYRJ6NSL_cjs.__name(createKeywordPattern, "createKeywordPattern");
94
+ chunkLEYHQJTL_cjs.__name(createKeywordPattern, "createKeywordPattern");
95
95
  function createUnitPattern(units) {
96
96
  const escapedUnits = units.map((unit) => unit.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
97
97
  return new RegExp(`\\b\\d+(?:\\.\\d+)?(?:${escapedUnits.join("|")})(?!\\w)`);
98
98
  }
99
- chunkQYRJ6NSL_cjs.__name(createUnitPattern, "createUnitPattern");
99
+ chunkLEYHQJTL_cjs.__name(createUnitPattern, "createUnitPattern");
100
100
 
101
101
  // src/syntax-highlighter/monaco.ts
102
102
  var tokenscriptLanguageDefinition = {
@@ -269,7 +269,7 @@ function tokenscriptLanguage(Prism) {
269
269
  Prism.languages.ts = Prism.languages.tokenscript;
270
270
  return Prism.languages.tokenscript;
271
271
  }
272
- chunkQYRJ6NSL_cjs.__name(tokenscriptLanguage, "tokenscriptLanguage");
272
+ chunkLEYHQJTL_cjs.__name(tokenscriptLanguage, "tokenscriptLanguage");
273
273
 
274
274
  exports.BUILTIN_FUNCTIONS = BUILTIN_FUNCTIONS;
275
275
  exports.KEYWORDS = KEYWORDS;
@@ -1,5 +1,5 @@
1
1
  import { languages } from 'monaco-editor';
2
- import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-BimJex2v.cjs';
2
+ import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-EB8V9c46.cjs';
3
3
  import '@tokens-studio/schema-validation';
4
4
 
5
5
  declare const tokenscriptLanguageDefinition: languages.IMonarchLanguage;
@@ -1,5 +1,5 @@
1
1
  import { languages } from 'monaco-editor';
2
- import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-BimJex2v.js';
2
+ import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-EB8V9c46.js';
3
3
  import '@tokens-studio/schema-validation';
4
4
 
5
5
  declare const tokenscriptLanguageDefinition: languages.IMonarchLanguage;
@@ -1,5 +1,5 @@
1
- import { StringSymbol, NumberSymbol, NumberWithUnitSymbol, ColorSymbol, ListSymbol, DictionarySymbol, BooleanSymbol } from './chunk-LI2D53SH.js';
2
- import { ReservedKeyword, SupportedFormats, Operations, __name } from './chunk-YD3MIYOO.js';
1
+ import { StringSymbol, NumberSymbol, NumberWithUnitSymbol, ColorSymbol, ListSymbol, DictionarySymbol, BooleanSymbol } from './chunk-LSTH2XJ4.js';
2
+ import { ReservedKeyword, SupportedFormats, Operations, __name } from './chunk-ODVWXGOM.js';
3
3
 
4
4
  // src/syntax-highlighter/spec.ts
5
5
  var KEYWORDS = Object.values(ReservedKeyword);
@@ -1,5 +1,5 @@
1
- import { l as InterpreterResult, L as LanguageError } from './interpreter-DNmBc--s.js';
2
- import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-BimJex2v.js';
1
+ import { l as InterpreterResult, L as LanguageError } from './interpreter-v7WiwSP9.js';
2
+ import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-EB8V9c46.js';
3
3
 
4
4
  /**
5
5
  * ObjectParser allows custom transformation of structured values into interpreter symbols.
@@ -1100,6 +1100,7 @@ declare enum TokenType {
1100
1100
  HEX_COLOR = "HEX_COLOR",
1101
1101
  STRING = "STRING",
1102
1102
  EXPLICIT_STRING = "EXPLICIT_STRING",
1103
+ TEMPLATE_STRING = "TEMPLATE_STRING",
1103
1104
  ASSIGN = "ASSIGN",
1104
1105
  IS_EQ = "IS_EQ",
1105
1106
  IS_GT = "GT",
@@ -1100,6 +1100,7 @@ declare enum TokenType {
1100
1100
  HEX_COLOR = "HEX_COLOR",
1101
1101
  STRING = "STRING",
1102
1102
  EXPLICIT_STRING = "EXPLICIT_STRING",
1103
+ TEMPLATE_STRING = "TEMPLATE_STRING",
1103
1104
  ASSIGN = "ASSIGN",
1104
1105
  IS_EQ = "IS_EQ",
1105
1106
  IS_GT = "GT",
@@ -1,5 +1,5 @@
1
- import { l as InterpreterResult, L as LanguageError } from './interpreter-CP7CNwDa.cjs';
2
- import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-BimJex2v.cjs';
1
+ import { l as InterpreterResult, L as LanguageError } from './interpreter-6QwMkUqD.cjs';
2
+ import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-EB8V9c46.cjs';
3
3
 
4
4
  /**
5
5
  * ObjectParser allows custom transformation of structured values into interpreter symbols.
@@ -1,28 +1,28 @@
1
1
  'use strict';
2
2
 
3
- var chunkQYRJ6NSL_cjs = require('./chunk-QYRJ6NSL.cjs');
3
+ var chunkLEYHQJTL_cjs = require('./chunk-LEYHQJTL.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Operations", {
8
8
  enumerable: true,
9
- get: function () { return chunkQYRJ6NSL_cjs.Operations; }
9
+ get: function () { return chunkLEYHQJTL_cjs.Operations; }
10
10
  });
11
11
  Object.defineProperty(exports, "ReservedKeyword", {
12
12
  enumerable: true,
13
- get: function () { return chunkQYRJ6NSL_cjs.ReservedKeyword; }
13
+ get: function () { return chunkLEYHQJTL_cjs.ReservedKeyword; }
14
14
  });
15
15
  Object.defineProperty(exports, "SupportedFormats", {
16
16
  enumerable: true,
17
- get: function () { return chunkQYRJ6NSL_cjs.SupportedFormats; }
17
+ get: function () { return chunkLEYHQJTL_cjs.SupportedFormats; }
18
18
  });
19
19
  Object.defineProperty(exports, "TokenType", {
20
20
  enumerable: true,
21
- get: function () { return chunkQYRJ6NSL_cjs.TokenType; }
21
+ get: function () { return chunkLEYHQJTL_cjs.TokenType; }
22
22
  });
23
23
  Object.defineProperty(exports, "UNINTERPRETED_KEYWORDS", {
24
24
  enumerable: true,
25
- get: function () { return chunkQYRJ6NSL_cjs.UNINTERPRETED_KEYWORDS; }
25
+ get: function () { return chunkLEYHQJTL_cjs.UNINTERPRETED_KEYWORDS; }
26
26
  });
27
27
  //# sourceMappingURL=types.cjs.map
28
28
  //# sourceMappingURL=types.cjs.map
@@ -1,2 +1,2 @@
1
- export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-BimJex2v.cjs';
1
+ export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-EB8V9c46.cjs';
2
2
  import '@tokens-studio/schema-validation';
@@ -1,2 +1,2 @@
1
- export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-BimJex2v.js';
1
+ export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-EB8V9c46.js';
2
2
  import '@tokens-studio/schema-validation';
package/dist/lib/types.js CHANGED
@@ -1,3 +1,3 @@
1
- export { Operations, ReservedKeyword, SupportedFormats, TokenType, UNINTERPRETED_KEYWORDS } from './chunk-YD3MIYOO.js';
1
+ export { Operations, ReservedKeyword, SupportedFormats, TokenType, UNINTERPRETED_KEYWORDS } from './chunk-ODVWXGOM.js';
2
2
  //# sourceMappingURL=types.js.map
3
3
  //# sourceMappingURL=types.js.map
@@ -1,4 +1,4 @@
1
- import { I as ISymbolType, C as Config, T as Token, S as SymbolMetadata } from '../config-CFhN7-6U.js';
1
+ import { I as ISymbolType, C as Config, T as Token, S as SymbolMetadata } from '../config-DtbN3iyg.js';
2
2
  import '@tokens-studio/schema-validation';
3
3
 
4
4
  type InterpreterResult = ISymbolType | string | null;
@@ -474,4 +474,17 @@ declare function getTokensWithIssues(issues: IssuesMap | undefined): Set<string>
474
474
  */
475
475
  declare function hasAnyIssues(issues: IssuesMap | undefined): boolean;
476
476
 
477
- export { type BuildTokensOptions, type BuilderFormat, type CreateTokenParams, type CreateTokenResult, type DeleteTokenParams, type DeleteTokenResult, FlatObjectBuilder, type FlattenCallback, type IssuesMap, MapBuilder, NestedObjectBuilder, type ObjectParser, type ProcessFilesOptions, type ProcessOptions, type ProcessResult, type ProcessSetsOptions, type ProcessorOutput, type ProcessorResult, type ResolveIssue, type ResolveValueParams, type ResolveValueResult, StringMapBuilder, type TokenBuilder, type TokenDataMap, type TokenOperationResult, TokenResolver, type UpdateTokenParams, type UpdateTokenResult, type ValidationIssue, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode };
477
+ /**
478
+ * Token name validation.
479
+ *
480
+ * Must stay in sync with the Go and Ruby versions. The shared fixture
481
+ * at tokenscript/test-suites/token-name-validation.json proves they agree.
482
+ * Uses explicit whitespace chars (not \s) to ensure identical behavior
483
+ * across Go/JS/Ruby regex engines.
484
+ */
485
+ /** Returns true if a single name segment is valid: non-empty and contains no whitespace, braces, or brackets. */
486
+ declare function validateTokenName(name: string): boolean;
487
+ /** Returns true if every segment of a dot-delimited token path is a valid token name. */
488
+ declare function validateTokenPath(path: string): boolean;
489
+
490
+ export { type BuildTokensOptions, type BuilderFormat, type CreateTokenParams, type CreateTokenResult, type DeleteTokenParams, type DeleteTokenResult, FlatObjectBuilder, type FlattenCallback, type IssuesMap, MapBuilder, NestedObjectBuilder, type ObjectParser, type ProcessFilesOptions, type ProcessOptions, type ProcessResult, type ProcessSetsOptions, type ProcessorOutput, type ProcessorResult, type ResolveIssue, type ResolveValueParams, type ResolveValueResult, StringMapBuilder, type TokenBuilder, type TokenDataMap, type TokenOperationResult, TokenResolver, type UpdateTokenParams, type UpdateTokenResult, type ValidationIssue, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode, validateTokenName, validateTokenPath };
@@ -1,5 +1,5 @@
1
- import { NumberWithUnitSymbol, isLanguageError, ProcessorError, isObject, isNumber, isString, renameReferences, parseExpression, DictionarySymbol, serializeInterpreterResult, stringifyInterpreterResult, StringSymbol, NumberSymbol, isBoolean, BooleanSymbol, isNull, NullSymbol, isArray, TokenSymbol, ListSymbol, isTokenscriptSymbol, Interpreter, jsValueToSymbolType, getKeyAlt } from '../chunk-CKLFRLH7.js';
2
- import { UNINTERPRETED_KEYWORDS } from '../chunk-RI2BWY7D.js';
1
+ import { NumberWithUnitSymbol, isLanguageError, ProcessorError, isObject, isNumber, isString, renameReferences, parseExpression, DictionarySymbol, serializeInterpreterResult, stringifyInterpreterResult, StringSymbol, NumberSymbol, isBoolean, BooleanSymbol, isNull, NullSymbol, isArray, TokenSymbol, ListSymbol, isTokenscriptSymbol, Interpreter, jsValueToSymbolType, getKeyAlt } from '../chunk-33CDF4L4.js';
2
+ import { UNINTERPRETED_KEYWORDS } from '../chunk-AXH5N7KV.js';
3
3
  import { z } from '@tokens-studio/schema-validation';
4
4
 
5
5
  // src/processor/resolver/DependencyTracker.ts
@@ -945,6 +945,18 @@ var DependencyGraph = class {
945
945
  }
946
946
  };
947
947
 
948
+ // src/processor/utils/name-validation.ts
949
+ var INVALID_TOKEN_NAME_CHARS = /[ \t\n\r\f{}[\]]/;
950
+ function validateTokenName(name) {
951
+ return name.length > 0 && !INVALID_TOKEN_NAME_CHARS.test(name);
952
+ }
953
+ function splitTokenPath(path) {
954
+ return path.split(".");
955
+ }
956
+ function validateTokenPath(path) {
957
+ return splitTokenPath(path).every(validateTokenName);
958
+ }
959
+
948
960
  // src/processor/utils/structured-tokens.ts
949
961
  function matchesObjectParser(value, parsers) {
950
962
  if (!isObject(value)) return false;
@@ -1303,6 +1315,15 @@ var PrefixResolver = class _PrefixResolver {
1303
1315
  parseAndBuildGraph() {
1304
1316
  this.earlyResolved = [];
1305
1317
  for (const [tokenName, tokenData] of this.tokens.entries()) {
1318
+ if (!validateTokenPath(tokenName)) {
1319
+ this.addIssue(tokenName, {
1320
+ code: "INVALID_TOKEN_NAME",
1321
+ severity: "error" /* ERROR */,
1322
+ message: `token "${tokenName}" contains invalid characters in name (spaces, braces, or brackets are not allowed)`,
1323
+ tokenName,
1324
+ data: { path: tokenName }
1325
+ });
1326
+ }
1306
1327
  const tokenValue = getTokenValue(tokenData);
1307
1328
  if (isString(tokenValue) && UNINTERPRETED_KEYWORDS.includes(tokenValue)) {
1308
1329
  const symbol = new StringSymbol(tokenValue, this.config);
@@ -2227,6 +2248,6 @@ var StringMapBuilder = class extends MapBuilder {
2227
2248
  }
2228
2249
  };
2229
2250
 
2230
- export { FlatObjectBuilder, MapBuilder, NestedObjectBuilder, StringMapBuilder, TokenResolver, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode };
2251
+ export { FlatObjectBuilder, MapBuilder, NestedObjectBuilder, StringMapBuilder, TokenResolver, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode, validateTokenName, validateTokenPath };
2231
2252
  //# sourceMappingURL=index.js.map
2232
2253
  //# sourceMappingURL=index.js.map