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/fesm2015/mevento.mjs
CHANGED
|
@@ -349,7 +349,7 @@ class Lexer {
|
|
|
349
349
|
return new Token(TokenType.stringConst, ret, lastL, lastC);
|
|
350
350
|
}
|
|
351
351
|
_skipLineComment() {
|
|
352
|
-
while (!this._isLineEnd(this._currentChar) === true) {
|
|
352
|
+
while (!this._isLineEnd(this._currentChar) === true && this._currentChar != -1) {
|
|
353
353
|
this._advance();
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -1498,17 +1498,17 @@ class MEvento extends NodeVisitor {
|
|
|
1498
1498
|
if (isNum(lValue) && isNum(rValue)) {
|
|
1499
1499
|
return lValue - rValue;
|
|
1500
1500
|
}
|
|
1501
|
-
if (isString(lValue) && isNum(rValue)) {
|
|
1502
|
-
return lValue * rValue;
|
|
1503
|
-
}
|
|
1504
|
-
if (isNum(lValue) && isString(rValue)) {
|
|
1505
|
-
return rValue * lValue;
|
|
1506
|
-
}
|
|
1507
1501
|
throw new Error(`Operation ${op.value} not allowed no num value`);
|
|
1508
1502
|
case TokenType.mult:
|
|
1509
1503
|
if (isNum(lValue) && isNum(rValue)) {
|
|
1510
1504
|
return lValue * rValue;
|
|
1511
1505
|
}
|
|
1506
|
+
if (isString(lValue) && isNum(rValue)) {
|
|
1507
|
+
return lValue.repeat(rValue);
|
|
1508
|
+
}
|
|
1509
|
+
if (isNum(lValue) && isString(rValue)) {
|
|
1510
|
+
return rValue.repeat(lValue);
|
|
1511
|
+
}
|
|
1512
1512
|
throw new Error(`Operation ${op.value} not allowed no num value`);
|
|
1513
1513
|
case TokenType.div:
|
|
1514
1514
|
if (isNum(lValue) && isNum(rValue)) {
|
|
@@ -1928,10 +1928,10 @@ class MEventoAsync extends MEvento {
|
|
|
1928
1928
|
return lValue - rValue;
|
|
1929
1929
|
}
|
|
1930
1930
|
if (isString(lValue) && isNum(rValue)) {
|
|
1931
|
-
return lValue
|
|
1931
|
+
return lValue.repeat(rValue);
|
|
1932
1932
|
}
|
|
1933
1933
|
if (isNum(lValue) && isString(rValue)) {
|
|
1934
|
-
return rValue
|
|
1934
|
+
return rValue.repeat(lValue);
|
|
1935
1935
|
}
|
|
1936
1936
|
throw new Error(`Operation ${op.value} not allowed no num value`);
|
|
1937
1937
|
case TokenType.mult:
|