Skip to content

Commit 2e75e0a

Browse files
committed
improve exception abuse performance, update abstractsyntaxgen
1 parent 7e79146 commit 2e75e0a

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

de.peeeq.wurstscript/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ dependencies {
8282
antlr "org.antlr:antlr4:4.9.2"
8383

8484
// tool for generating AST-classes
85-
compileOnly 'com.github.peterzeller:abstractsyntaxgen:3510802026'
85+
compileOnly 'com.github.peterzeller:abstractsyntaxgen:ef7fec791a'
8686

8787
// JUnit for testing
8888
testCompile group: 'org.testng', name: 'testng', version: '6.14.3'

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/attributes/names/OtherLink.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.eclipse.jdt.annotation.Nullable;
1414

1515
import java.util.Collections;
16+
import java.util.List;
17+
import java.util.function.Consumer;
1618

1719
/**
1820
*
@@ -414,6 +416,16 @@ public Element set(int i, Element newElement) {
414416
return null;
415417
}
416418

419+
@Override
420+
public void forEachElement(Consumer<? super Element> action) {
421+
422+
}
423+
424+
@Override
425+
public void trimToSize() {
426+
NameDef.super.trimToSize();
427+
}
428+
417429
@Override
418430
public void setParent(Element parent) {
419431

@@ -429,6 +441,16 @@ public boolean structuralEquals(Element elem) {
429441
return false;
430442
}
431443

444+
@Override
445+
public List<Integer> pathTo(Element elem) {
446+
return NameDef.super.pathTo(elem);
447+
}
448+
449+
@Override
450+
public Element followPath(Iterable<Integer> path) {
451+
return NameDef.super.followPath(path);
452+
}
453+
432454
@Override
433455
public <T> T match(Element.Matcher<T> s) {
434456
return null;

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/intermediatelang/interpreter/NoSuchNativeException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public class NoSuchNativeException extends Exception {
44

55
public NoSuchNativeException(String msg) {
6-
super(msg);
6+
super(msg, null, true, false);
77
}
88
}

de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/jassinterpreter/ReturnException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class ReturnException extends Error {
88
private @Nullable ILconst val;
99

1010
public ReturnException(@Nullable ILconst value) {
11+
super(null, null, true, false);
1112
this.val = value;
1213
}
1314

0 commit comments

Comments
 (0)