@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/cli/cli.js +9 -7
- package/dist/cli/src/tokenizer/minifyTokenStream.d.ts +3 -1
- package/dist/index.esm.js +8 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/lits.iife.js +8 -6
- package/dist/lits.iife.js.map +1 -1
- package/dist/src/tokenizer/minifyTokenStream.d.ts +3 -1
- package/dist/testFramework.esm.js +8 -6
- package/dist/testFramework.esm.js.map +1 -1
- package/dist/testFramework.js +8 -6
- package/dist/testFramework.js.map +1 -1
- package/package.json +1 -1
package/dist/lits.iife.js
CHANGED
|
@@ -6144,13 +6144,15 @@ var Lits = (function (exports) {
|
|
|
6144
6144
|
};
|
|
6145
6145
|
}
|
|
6146
6146
|
|
|
6147
|
-
function minifyTokenStream(tokenStream) {
|
|
6148
|
-
var
|
|
6147
|
+
function minifyTokenStream(tokenStream, _a) {
|
|
6148
|
+
var removeWhiteSpace = _a.removeWhiteSpace;
|
|
6149
|
+
var tokens = tokenStream.tokens
|
|
6150
|
+
.filter(function (token) {
|
|
6149
6151
|
if (isP_CommentToken(token)
|
|
6150
6152
|
|| isA_CommentToken(token)
|
|
6151
6153
|
|| isA_MultiLineCommentToken(token)
|
|
6152
|
-
|| isA_WhitespaceToken(token)
|
|
6153
|
-
|| isP_WhitespaceToken(token)) {
|
|
6154
|
+
|| (removeWhiteSpace && isA_WhitespaceToken(token))
|
|
6155
|
+
|| (removeWhiteSpace && isP_WhitespaceToken(token))) {
|
|
6154
6156
|
return false;
|
|
6155
6157
|
}
|
|
6156
6158
|
return true;
|
|
@@ -7676,7 +7678,7 @@ var Lits = (function (exports) {
|
|
|
7676
7678
|
}
|
|
7677
7679
|
|
|
7678
7680
|
function parse(tokenStream) {
|
|
7679
|
-
tokenStream = minifyTokenStream(tokenStream);
|
|
7681
|
+
tokenStream = minifyTokenStream(tokenStream, { removeWhiteSpace: true });
|
|
7680
7682
|
var algebraic = tokenStream.algebraic;
|
|
7681
7683
|
var ast = {
|
|
7682
7684
|
b: [],
|
|
@@ -8525,7 +8527,7 @@ var Lits = (function (exports) {
|
|
|
8525
8527
|
var debug = this.debug;
|
|
8526
8528
|
var algebraic = this.algebraic;
|
|
8527
8529
|
var tokenStream = tokenize(program, __assign(__assign({}, tokenizeParams), { debug: debug, algebraic: algebraic }));
|
|
8528
|
-
return tokenizeParams.minify ? minifyTokenStream(tokenStream) : tokenStream;
|
|
8530
|
+
return tokenizeParams.minify ? minifyTokenStream(tokenStream, { removeWhiteSpace: false }) : tokenStream;
|
|
8529
8531
|
};
|
|
8530
8532
|
Lits.prototype.parse = function (tokenStream) {
|
|
8531
8533
|
return parse(tokenStream);
|