@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.
package/dist/index.js CHANGED
@@ -6143,13 +6143,15 @@ function analyze(ast, params) {
6143
6143
  };
6144
6144
  }
6145
6145
 
6146
- function minifyTokenStream(tokenStream) {
6147
- var tokens = tokenStream.tokens.filter(function (token) {
6146
+ function minifyTokenStream(tokenStream, _a) {
6147
+ var removeWhiteSpace = _a.removeWhiteSpace;
6148
+ var tokens = tokenStream.tokens
6149
+ .filter(function (token) {
6148
6150
  if (isP_CommentToken(token)
6149
6151
  || isA_CommentToken(token)
6150
6152
  || isA_MultiLineCommentToken(token)
6151
- || isA_WhitespaceToken(token)
6152
- || isP_WhitespaceToken(token)) {
6153
+ || (removeWhiteSpace && isA_WhitespaceToken(token))
6154
+ || (removeWhiteSpace && isP_WhitespaceToken(token))) {
6153
6155
  return false;
6154
6156
  }
6155
6157
  return true;
@@ -7675,7 +7677,7 @@ function parsePolishToken(tokenStream, parseState) {
7675
7677
  }
7676
7678
 
7677
7679
  function parse(tokenStream) {
7678
- tokenStream = minifyTokenStream(tokenStream);
7680
+ tokenStream = minifyTokenStream(tokenStream, { removeWhiteSpace: true });
7679
7681
  var algebraic = tokenStream.algebraic;
7680
7682
  var ast = {
7681
7683
  b: [],
@@ -8524,7 +8526,7 @@ var Lits = /** @class */ (function () {
8524
8526
  var debug = this.debug;
8525
8527
  var algebraic = this.algebraic;
8526
8528
  var tokenStream = tokenize(program, __assign(__assign({}, tokenizeParams), { debug: debug, algebraic: algebraic }));
8527
- return tokenizeParams.minify ? minifyTokenStream(tokenStream) : tokenStream;
8529
+ return tokenizeParams.minify ? minifyTokenStream(tokenStream, { removeWhiteSpace: false }) : tokenStream;
8528
8530
  };
8529
8531
  Lits.prototype.parse = function (tokenStream) {
8530
8532
  return parse(tokenStream);