mevento 1.9.0 → 1.9.1

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.
@@ -883,11 +883,14 @@ class Parser {
883
883
  _objectProperties() {
884
884
  const properties = [];
885
885
  if (this.currentToken?.type != TokenType.rbrace) {
886
+ this._eatEOL();
886
887
  properties.push(this._property());
887
888
  }
888
889
  while (this.currentToken?.type === TokenType.comma) {
889
890
  this._eat(TokenType.comma);
891
+ this._eatEOL();
890
892
  properties.push(this._property());
893
+ this._eatEOL();
891
894
  }
892
895
  return properties;
893
896
  }
@@ -1265,7 +1268,7 @@ class MEventScope {
1265
1268
  this.parent = parent;
1266
1269
  }
1267
1270
  resolve(key) {
1268
- return Object.keys(this.memory).includes(key) ? this.memory[key] : (this.parent ? this.parent.resolve(key) : null);
1271
+ return Object.keys(this.memory).includes(key) ? this.memory[key] : (this.parent?.resolve(key) ?? null);
1269
1272
  }
1270
1273
  change(key, value, declare = true) {
1271
1274
  if (Object.keys(this.memory).includes(key)) {
@@ -1287,27 +1290,27 @@ class MEvento extends NodeVisitor {
1287
1290
  constructor() {
1288
1291
  super();
1289
1292
  this.rootScope = new MEventScope("Program", {});
1290
- this.currentScrope = this.rootScope;
1293
+ this.currentScope = this.rootScope;
1291
1294
  this.debug = false;
1292
1295
  this._functionsRegistry = {};
1293
1296
  this._functionsRegistry = { ...MEvento._globalFunctionsRegistry };
1294
1297
  }
1295
1298
  resolve(name) {
1296
- return this.currentScrope?.resolve(name) ?? null;
1299
+ return this.currentScope?.resolve(name) ?? null;
1297
1300
  }
1298
1301
  changeVariable(name, value) {
1299
- if (this.currentScrope?.change(name, value)) {
1302
+ if (this.currentScope?.change(name, value)) {
1300
1303
  return value;
1301
1304
  }
1302
1305
  else
1303
1306
  return null;
1304
1307
  }
1305
1308
  pushScope(name) {
1306
- const scope = new MEventScope(name, {}, this.currentScrope);
1307
- this.currentScrope = scope;
1309
+ const scope = new MEventScope(name, {}, this.currentScope);
1310
+ this.currentScope = scope;
1308
1311
  }
1309
1312
  popScope() {
1310
- this.currentScrope = this.currentScrope?.parent;
1313
+ this.currentScope = this.currentScope?.parent;
1311
1314
  }
1312
1315
  log(message) {
1313
1316
  if (this.debug) {
@@ -1337,7 +1340,7 @@ class MEvento extends NodeVisitor {
1337
1340
  }
1338
1341
  visitIdentifierAST(node) {
1339
1342
  const id = node.value;
1340
- return this.currentScrope?.resolve(id) ?? null;
1343
+ return this?.resolve(id) ?? null;
1341
1344
  }
1342
1345
  visitLiteralAST(node) {
1343
1346
  const value = node.value;