changeset 478:42bb160e9ea7

New decl split test
author tehtmi
date Thu, 06 Jan 2022 23:28:58 -0800
parents 8280e6bfafc0
children 278697a52a3b
files src/unluac/decompile/Declaration.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/unluac/decompile/Declaration.java	Thu Jan 06 23:28:47 2022 -0800
+++ b/src/unluac/decompile/Declaration.java	Thu Jan 06 23:28:58 2022 -0800
@@ -41,8 +41,11 @@
   }
   
   public boolean isSplitBy(int line, int begin, int end) {
-    return (begin <= this.begin && this.begin < end && end <= this.end)
-      || (begin <= this.end && this.end < end - 1 && this.begin < begin);
+    int scopeEnd = end - 1;
+    return this.begin >= line && this.begin < begin
+      || this.end >= line && this.end < begin
+      || this.begin < begin && this.end >= begin && this.end < scopeEnd
+      || this.begin >= begin && this.begin <= scopeEnd && this.end > scopeEnd;
   }
   
 }