@tokens-studio/tokenscript-interpreter 0.34.0 → 0.36.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.
@@ -1,4 +1,4 @@
1
- import { BaseSymbolType, InterpreterError, LexerError, ParserError, Lexer, Parser, Config, Interpreter, ColorSymbol, ColorManager, isArray, isObject, NumberWithUnitSymbol } from './chunk-33CDF4L4.js';
1
+ import { BaseSymbolType, InterpreterError, LexerError, ParserError, Lexer, Parser, Config, Interpreter, ColorSymbol, ColorManager, isArray, isObject, NumberWithUnitSymbol } from './chunk-HHCPY4WI.js';
2
2
  import './chunk-AXH5N7KV.js';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
@@ -568,6 +568,9 @@ var _Lexer = class _Lexer {
568
568
  }
569
569
  while (chunkLMGHS2NP_cjs.isNumber2(this.currentChar) || this.currentChar === ".") {
570
570
  if (this.currentChar === ".") {
571
+ if (!chunkLMGHS2NP_cjs.isNumber2(this.peek())) {
572
+ break;
573
+ }
571
574
  if (hasDecimalPoint) {
572
575
  this.error("LEXER_MULTIPLE_DECIMAL_POINTS" /* MULTIPLE_DECIMAL_POINTS */, {
573
576
  value: result + this.currentChar
@@ -1645,11 +1648,12 @@ ${contextText}`;
1645
1648
  return new ElementWithUnitNode(node, formatToken.value);
1646
1649
  }
1647
1650
  number() {
1648
- const node = new NumNode(this.currentToken);
1651
+ let node = new NumNode(this.currentToken);
1649
1652
  this.eat("NUMBER" /* NUMBER */);
1650
1653
  if (this.currentToken.type === "FORMAT" /* FORMAT */) {
1651
1654
  return this.format(node);
1652
1655
  }
1656
+ node = this.attributeAccess(node);
1653
1657
  return node;
1654
1658
  }
1655
1659
  // factor : PLUS factor
@@ -1664,7 +1668,9 @@ ${contextText}`;
1664
1668
  factor() {
1665
1669
  const token = this.currentToken;
1666
1670
  if (token.type === "LBLOCK" /* LBLOCK */) {
1667
- return this.explicitList();
1671
+ let node = this.explicitList();
1672
+ node = this.attributeAccess(node);
1673
+ return node;
1668
1674
  }
1669
1675
  if (token.type === "OPERATION" /* OPERATION */ && (token.value === "+" /* ADD */ || token.value === "-" /* SUBTRACT */ || token.value === "!" /* LOGIC_NOT */)) {
1670
1676
  this.eat("OPERATION" /* OPERATION */);
@@ -1680,11 +1686,15 @@ ${contextText}`;
1680
1686
  }
1681
1687
  if (token.type === "RESERVED_KEYWORD" /* RESERVED_KEYWORD */ && (token.value === "true" /* TRUE */ || token.value === "false" /* FALSE */)) {
1682
1688
  this.eat("RESERVED_KEYWORD" /* RESERVED_KEYWORD */);
1683
- return new BooleanNode(token.value === "true" /* TRUE */, token);
1689
+ let boolNode = new BooleanNode(token.value === "true" /* TRUE */, token);
1690
+ boolNode = this.attributeAccess(boolNode);
1691
+ return boolNode;
1684
1692
  }
1685
1693
  if (token.type === "RESERVED_KEYWORD" /* RESERVED_KEYWORD */ && token.value === "null" /* NULL */) {
1686
1694
  this.eat("RESERVED_KEYWORD" /* RESERVED_KEYWORD */);
1687
- return new NullNode(token);
1695
+ let nullNode = new NullNode(token);
1696
+ nullNode = this.attributeAccess(nullNode);
1697
+ return nullNode;
1688
1698
  }
1689
1699
  if (token.type === "NUMBER" /* NUMBER */) {
1690
1700
  return this.number();
@@ -1711,7 +1721,7 @@ ${contextText}`;
1711
1721
  if (this.currentToken.type === "FORMAT" /* FORMAT */) {
1712
1722
  return this.format(node);
1713
1723
  }
1714
- return node;
1724
+ return this.attributeAccess(node);
1715
1725
  }
1716
1726
  if (token.type === "PARTIAL_REFERENCE" /* PARTIAL_REFERENCE */) {
1717
1727
  let node = this.reference();
@@ -1725,7 +1735,9 @@ ${contextText}`;
1725
1735
  }
1726
1736
  if (token.type === "HEX_COLOR" /* HEX_COLOR */) {
1727
1737
  this.eat("HEX_COLOR" /* HEX_COLOR */);
1728
- return new HexColorNode(token);
1738
+ let hexNode = new HexColorNode(token);
1739
+ hexNode = this.attributeAccess(hexNode);
1740
+ return hexNode;
1729
1741
  }
1730
1742
  if (token.type === "PARTIAL_STRING" /* PARTIAL_STRING */) {
1731
1743
  this.eat("PARTIAL_STRING" /* PARTIAL_STRING */);
@@ -7295,5 +7307,5 @@ exports.tokenizeTolerantly = tokenizeTolerantly;
7295
7307
  exports.validateTokenName = validateTokenName;
7296
7308
  exports.validateTokenPath = validateTokenPath;
7297
7309
  exports.walkAST = walkAST;
7298
- //# sourceMappingURL=chunk-YCIBJDRB.cjs.map
7299
- //# sourceMappingURL=chunk-YCIBJDRB.cjs.map
7310
+ //# sourceMappingURL=chunk-IQ5YGWZK.cjs.map
7311
+ //# sourceMappingURL=chunk-IQ5YGWZK.cjs.map