muScript: clean up
This commit is contained in:
parent
4be87948a3
commit
51db36f53f
@ -6,7 +6,6 @@ import io.gitlab.jfronny.muscript.data.Scope;
|
||||
import io.gitlab.jfronny.muscript.data.dynamic.*;
|
||||
import io.gitlab.jfronny.muscript.error.LocationalException;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class Parser {
|
||||
} catch (RuntimeException e) {
|
||||
if (e instanceof ParseException) throw e;
|
||||
else if (e instanceof LocationalException le) {
|
||||
throw new ParseException(le.asPrintable(lexer.source));
|
||||
throw new ParseException(le.asPrintable(lexer.source), le.getCause());
|
||||
} else throw error(e.getMessage());
|
||||
}
|
||||
}
|
||||
@ -436,5 +436,10 @@ public class Parser {
|
||||
super(error.toString());
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public ParseException(LocationalError error, Throwable cause) {
|
||||
super(error.toString(), cause);
|
||||
this.error = error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class ReflectTest {
|
||||
class ReflectTest {
|
||||
private static final String CLASS_NAME = "some.other.location.ToConstruct";
|
||||
|
||||
@Test
|
||||
@ -67,7 +67,7 @@ public class ReflectTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void noArgFunction() { //TODO fix
|
||||
void noArgFunction() {
|
||||
assertEquals(assertDoesNotThrow(() -> Reflect.staticFunction(CLASS_NAME, "function", String.class).get()), InstanceConstruct.getLastProc().toString());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user