mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 16:18:02 +00:00
fix main method null check
This commit is contained in:
parent
fd35b4583e
commit
0b720eedcd
@ -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() != null) {
|
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