Skip to content

Commit

Permalink
improve exception abuse performance, update abstractsyntaxgen
Browse files Browse the repository at this point in the history
  • Loading branch information
Frotty committed Jul 1, 2021
1 parent 7e79146 commit 2e75e0a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion de.peeeq.wurstscript/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies {
antlr "org.antlr:antlr4:4.9.2"

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

// JUnit for testing
testCompile group: 'org.testng', name: 'testng', version: '6.14.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import org.eclipse.jdt.annotation.Nullable;

import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;

/**
*
Expand Down Expand Up @@ -414,6 +416,16 @@ public Element set(int i, Element newElement) {
return null;
}

@Override
public void forEachElement(Consumer<? super Element> action) {

}

@Override
public void trimToSize() {
NameDef.super.trimToSize();
}

@Override
public void setParent(Element parent) {

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

@Override
public List<Integer> pathTo(Element elem) {
return NameDef.super.pathTo(elem);
}

@Override
public Element followPath(Iterable<Integer> path) {
return NameDef.super.followPath(path);
}

@Override
public <T> T match(Element.Matcher<T> s) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public class NoSuchNativeException extends Exception {

public NoSuchNativeException(String msg) {
super(msg);
super(msg, null, true, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ReturnException extends Error {
private @Nullable ILconst val;

public ReturnException(@Nullable ILconst value) {
super(null, null, true, false);
this.val = value;
}

Expand Down

0 comments on commit 2e75e0a

Please sign in to comment.