overpy 9.5.3 → 9.5.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.
Files changed (2) hide show
  1. package/overpy.js +10 -1
  2. package/package.json +1 -1
package/overpy.js CHANGED
@@ -44669,7 +44669,7 @@ astParsingFunctions.__elif__ = function(content) {
44669
44669
  if (["__if__", "__elif__", "__else__"].includes(content.parent.name)) {
44670
44670
  error("Found 'elif', but no 'if' or 'elif' before it");
44671
44671
  }
44672
- warn("w_lone_else", "Found 'else', but no 'if' or 'elif' before it");
44672
+ warn("w_lone_else", "Found 'elif', but no 'if' or 'elif' before it");
44673
44673
  }
44674
44674
  if (content.parent.childIndex === 0 || ["__else__"].includes(content.parent.children[content.parent.childIndex - 1].name)) {
44675
44675
  warn("w_lone_elif", "Found 'elif' directly after an 'else'");
@@ -45411,6 +45411,15 @@ astParsingFunctions.__rule__ = function(content) {
45411
45411
  }
45412
45412
  }
45413
45413
  }
45414
+ if (children[i2].name === "__elif__") {
45415
+ if (isDefinitelyFalsy(children[i2].args[0]) && (children[i2].children.length === 0 || !isGotoEncountered)) {
45416
+ if (i2 > 0 && (children[i2 - 1].name === "__if__" || children[i2 - 1].name === "__elif__")) {
45417
+ children.splice(i2, 1);
45418
+ i2--;
45419
+ continue;
45420
+ }
45421
+ }
45422
+ }
45414
45423
  if (children[i2].name === "__if__" || children[i2].name === "__elif__") {
45415
45424
  if (isDefinitelyTruthy(children[i2].args[0]) && !isGotoEncountered) {
45416
45425
  while (i2 < children.length - 1 && (children[i2 + 1].name === "__else__" || children[i2 + 1].name === "__elif__" || children[i2 + 1].name === "__end__")) {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/Zezombye/overpy"
8
8
  },
9
9
  "description": "High-level language for the Overwatch Workshop, with decompilation and compilation.",
10
- "version": "9.5.3",
10
+ "version": "9.5.4",
11
11
  "readme": "README.md",
12
12
  "keywords": [
13
13
  "overpy",