mevento 2.0.3 → 2.0.4

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.
@@ -879,14 +879,16 @@ class Parser {
879
879
  return this._arrayExpression();
880
880
  case TokenType.lbrace:
881
881
  return this._objectExpression();
882
+ case TokenType.IF:
883
+ return this._ifStatement();
882
884
  default:
883
885
  return this._variable();
884
886
  }
885
887
  }
886
888
  _term() {
887
889
  let node = this._factor();
888
- node = this._tryParsingMemberExpression(node);
889
890
  node = this._tryParsingFunctionCall(node);
891
+ node = this._tryParsingMemberExpression(node);
890
892
  return node;
891
893
  }
892
894
  _expression() {
@@ -1221,8 +1223,8 @@ class Parser {
1221
1223
  case TokenType.eol:
1222
1224
  this._eatEOL();
1223
1225
  return this._statement();
1224
- case TokenType.IF:
1225
- return this._ifStatement();
1226
+ // case TokenType.IF:
1227
+ // return this._ifStatement();
1226
1228
  case TokenType.WHILE_TILL:
1227
1229
  return this._whileLoop();
1228
1230
  case TokenType.FOR_LOOP:
@@ -1556,7 +1558,7 @@ class MEvento extends NodeVisitor {
1556
1558
  if (op.type === TokenType.not) {
1557
1559
  return _boolValue(argValue) === false;
1558
1560
  }
1559
- if (isNum(argValue)) {
1561
+ if (!isNum(argValue)) {
1560
1562
  throw new Error(`Operation ${op.value} not allowed no num value`);
1561
1563
  }
1562
1564
  if (op.type === TokenType.plus) {
@@ -1987,7 +1989,7 @@ class MEventoAsync extends MEvento {
1987
1989
  if (op.type === TokenType.not) {
1988
1990
  return _boolValue(argValue) === false;
1989
1991
  }
1990
- if (isNum(argValue)) {
1992
+ if (!isNum(argValue)) {
1991
1993
  throw new Error(`Operation ${op.value} not allowed no num value`);
1992
1994
  }
1993
1995
  if (op.type === TokenType.plus) {