mevento 2.0.4 → 2.0.6
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/esm2020/lib/mevento.mjs +10 -10
- package/fesm2015/mevento.mjs +9 -9
- package/fesm2015/mevento.mjs.map +1 -1
- package/fesm2020/mevento.mjs +9 -9
- package/fesm2020/mevento.mjs.map +1 -1
- package/lib/mevento.d.ts +1 -2
- package/package.json +1 -1
package/fesm2020/mevento.mjs
CHANGED
|
@@ -345,7 +345,7 @@ class Lexer {
|
|
|
345
345
|
return new Token(TokenType.stringConst, ret, lastL, lastC);
|
|
346
346
|
}
|
|
347
347
|
_skipLineComment() {
|
|
348
|
-
while (!this._isLineEnd(this._currentChar) === true) {
|
|
348
|
+
while (!this._isLineEnd(this._currentChar) === true && this._currentChar != -1) {
|
|
349
349
|
this._advance();
|
|
350
350
|
}
|
|
351
351
|
}
|
|
@@ -1477,17 +1477,17 @@ class MEvento extends NodeVisitor {
|
|
|
1477
1477
|
if (isNum(lValue) && isNum(rValue)) {
|
|
1478
1478
|
return lValue - rValue;
|
|
1479
1479
|
}
|
|
1480
|
-
if (isString(lValue) && isNum(rValue)) {
|
|
1481
|
-
return lValue * rValue;
|
|
1482
|
-
}
|
|
1483
|
-
if (isNum(lValue) && isString(rValue)) {
|
|
1484
|
-
return rValue * lValue;
|
|
1485
|
-
}
|
|
1486
1480
|
throw new Error(`Operation ${op.value} not allowed no num value`);
|
|
1487
1481
|
case TokenType.mult:
|
|
1488
1482
|
if (isNum(lValue) && isNum(rValue)) {
|
|
1489
1483
|
return lValue * rValue;
|
|
1490
1484
|
}
|
|
1485
|
+
if (isString(lValue) && isNum(rValue)) {
|
|
1486
|
+
return lValue.repeat(rValue);
|
|
1487
|
+
}
|
|
1488
|
+
if (isNum(lValue) && isString(rValue)) {
|
|
1489
|
+
return rValue.repeat(lValue);
|
|
1490
|
+
}
|
|
1491
1491
|
throw new Error(`Operation ${op.value} not allowed no num value`);
|
|
1492
1492
|
case TokenType.div:
|
|
1493
1493
|
if (isNum(lValue) && isNum(rValue)) {
|
|
@@ -1889,10 +1889,10 @@ class MEventoAsync extends MEvento {
|
|
|
1889
1889
|
return lValue - rValue;
|
|
1890
1890
|
}
|
|
1891
1891
|
if (isString(lValue) && isNum(rValue)) {
|
|
1892
|
-
return lValue
|
|
1892
|
+
return lValue.repeat(rValue);
|
|
1893
1893
|
}
|
|
1894
1894
|
if (isNum(lValue) && isString(rValue)) {
|
|
1895
|
-
return rValue
|
|
1895
|
+
return rValue.repeat(lValue);
|
|
1896
1896
|
}
|
|
1897
1897
|
throw new Error(`Operation ${op.value} not allowed no num value`);
|
|
1898
1898
|
case TokenType.mult:
|