mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 00:58:04 +00:00
fix main method null check
This commit is contained in:
parent
0b720eedcd
commit
ec5cb4b490
@ -28,7 +28,7 @@ public class ASTGenerator {
|
|||||||
constructors.add(new Constructor(ctx.id().IDENTIFIER().getText(), List.of(), new Block(List.of())));
|
constructors.add(new Constructor(ctx.id().IDENTIFIER().getText(), List.of(), new Block(List.of())));
|
||||||
}
|
}
|
||||||
Block mainmeth = null;
|
Block mainmeth = null;
|
||||||
if (ctx.mainmeth().isEmpty()) {
|
if (!ctx.mainmeth().isEmpty()) {
|
||||||
if (ctx.mainmeth().size() > 1) {
|
if (ctx.mainmeth().size() > 1) {
|
||||||
throw new RuntimeException("Only one main method allowed!");
|
throw new RuntimeException("Only one main method allowed!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user