AutoTest -> 93.78%

This commit is contained in:
jeffcheasey88 2023-08-14 13:59:16 +02:00
parent f88f5c9d3d
commit f1d843df46

View file

@ -124,6 +124,7 @@ public class JavaParser extends Parser<JavaElement> {
type_generic_split.then(type_generic);
StateTree<JavaElement> type_generic_unknow = type_begin.then((validator) -> validator.validate((token) -> token.getValue().equals("?")));
type_generic_unknow.then(type_generic_end);
StateTree<JavaElement> type_generic_unknow_extends = type_generic_unknow.then((validator) -> validator.validate((token) -> token.getValue().equals("extends")))
.then(new RedirectStateTree<>(type, (global, local) -> global.set(null)));
type_generic_unknow_extends.then(type_generic_end);
@ -226,6 +227,9 @@ public class JavaParser extends Parser<JavaElement> {
.then((validator) -> validator.validate((token) -> token.getValue().equals(":")))
.then(new RedirectStateTree<>(value_container, (global, local) -> global.set(null)))
.end((a,b) -> a);
value_left.then((validator) -> validator.validate((token) -> token.getValue().equals("instanceof")))
.then(new RedirectStateTree<>(type, (global, local) -> global.set(null)))
.end((a,b) -> a);
StateTree<JavaElement> value_instance = value.then((validator) -> validator.validate((token) -> token.getValue().equals("new")));
StateTree<JavaElement> value_name = new StateTree<JavaElement>();
@ -322,6 +326,7 @@ public class JavaParser extends Parser<JavaElement> {
return false;
}).end((a,b) -> a);
braces_container.then(clazz_container);
StateTree<JavaElement> braces_array = braces_container.then(new RedirectStateTree<>(value_container, (global, local) -> global.set(null)));
braces_array.then((validator) -> validator.validate((token) -> token.getValue().equals(",")))
.then(braces_array);
@ -535,8 +540,11 @@ public class JavaParser extends Parser<JavaElement> {
function_static.multiple(function_container);
function_static.unique((validator) -> validator.validate((token) -> token.getValue().equals("}"))).end((a,b) -> a);
StateTree<JavaElement> function_mod = function.then(new RedirectStateTree<>(modifier, (global, local) -> global.set("modifier", local)));
StateTree<JavaElement> function_generic = function.then(new RedirectStateTree<>(type_begin, (global, local) -> global.set("generic", local)));
StateTree<JavaElement> function_type = function.then(new RedirectStateTree<>(type, (global, local) -> global.set("type", local)));
function_mod.then(function_generic);
function_mod.then(function_type);
function_generic.then(function_type);
StateTree<JavaElement> function_name = function_type.then((validator) -> validator.validate(
(token) -> token.getType().equals(TokenType.NAME),
@ -726,7 +734,7 @@ public class JavaParser extends Parser<JavaElement> {
}
public static void main(String[] args) throws Exception{
File file = new File("C:\\Users\\jeffc\\eclipse-workspace\\B2MATH-1S2122-LhoistXavier\\src\\crypto\\Adfgvx.java");
File file = new File("C:\\Users\\jeffc\\eclipse-workspace\\BotDiscordSql\\src\\be\\jeffcheasey\\challenge\\bot\\parser\\region\\RegionContainer.java");
BufferedReader reader = new BufferedReader(new FileReader(file));