@mojir/lits 2.0.21 → 2.0.23

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.
@@ -6105,13 +6105,15 @@ function analyze(ast, params) {
6105
6105
  };
6106
6106
  }
6107
6107
 
6108
- function minifyTokenStream(tokenStream) {
6109
- var tokens = tokenStream.tokens.filter(function (token) {
6108
+ function minifyTokenStream(tokenStream, _a) {
6109
+ var removeWhiteSpace = _a.removeWhiteSpace;
6110
+ var tokens = tokenStream.tokens
6111
+ .filter(function (token) {
6110
6112
  if (isP_CommentToken(token)
6111
6113
  || isA_CommentToken(token)
6112
6114
  || isA_MultiLineCommentToken(token)
6113
- || isA_WhitespaceToken(token)
6114
- || isP_WhitespaceToken(token)) {
6115
+ || (removeWhiteSpace && isA_WhitespaceToken(token))
6116
+ || (removeWhiteSpace && isP_WhitespaceToken(token))) {
6115
6117
  return false;
6116
6118
  }
6117
6119
  return true;
@@ -7637,7 +7639,7 @@ function parsePolishToken(tokenStream, parseState) {
7637
7639
  }
7638
7640
 
7639
7641
  function parse(tokenStream) {
7640
- tokenStream = minifyTokenStream(tokenStream);
7642
+ tokenStream = minifyTokenStream(tokenStream, { removeWhiteSpace: true });
7641
7643
  var algebraic = tokenStream.algebraic;
7642
7644
  var ast = {
7643
7645
  b: [],
@@ -8485,7 +8487,7 @@ var Lits = /** @class */ (function () {
8485
8487
  var debug = this.debug;
8486
8488
  var algebraic = this.algebraic;
8487
8489
  var tokenStream = tokenize(program, __assign(__assign({}, tokenizeParams), { debug: debug, algebraic: algebraic }));
8488
- return tokenizeParams.minify ? minifyTokenStream(tokenStream) : tokenStream;
8490
+ return tokenizeParams.minify ? minifyTokenStream(tokenStream, { removeWhiteSpace: false }) : tokenStream;
8489
8491
  };
8490
8492
  Lits.prototype.parse = function (tokenStream) {
8491
8493
  return parse(tokenStream);