Replaced old expect messages with new `expect(string)`

expression_parsing.sync-conflict-20210316-090018-O3W7KWN
Tristan B. V. Kildaire 2021-03-05 12:03:31 +02:00
parent 4ed0b385cf
commit bfdbaaeee7
1 changed files with 4 additions and 8 deletions

View File

@ -193,8 +193,7 @@ public final class Parser
/* TODO: We can sometimes run out of tokens before getting our closing brace, we should fix that here */ /* TODO: We can sometimes run out of tokens before getting our closing brace, we should fix that here */
if(!closedBeforeExit) if(!closedBeforeExit)
{ {
gprintln("Expected closing } but ran out of tokens", DebugType.ERROR); expect("Expected closing } but ran out of tokens");
exit(0);
} }
gprintln("parseBody(): Leave", DebugType.WARNING); gprintln("parseBody(): Leave", DebugType.WARNING);
@ -240,8 +239,7 @@ public final class Parser
else else
{ {
/* TODO: Error */ /* TODO: Error */
gprintln("Expecting either ) or , but got "~getCurrentToken().getToken(), DebugType.ERROR); expect("Expecting either ) or , but got "~getCurrentToken().getToken());
exit(0);
} }
gprintln("ParseFuncDef: ParameterDec: (Type: "~type~", Identifier: "~identifier~")",DebugType.WARNING); gprintln("ParseFuncDef: ParameterDec: (Type: "~type~", Identifier: "~identifier~")",DebugType.WARNING);
@ -371,8 +369,7 @@ public final class Parser
} }
else else
{ {
gprintln("Expected one of the following: (, ; or =", DebugType.ERROR); expect("Expected one of the following: (, ; or =");
exit(0);
} }
/* TODO: If we outta tokens we should not call this */ /* TODO: If we outta tokens we should not call this */
@ -477,8 +474,7 @@ public final class Parser
} }
else else
{ {
gprintln("parse(): Unknown '"~tok.getToken()~"'", DebugType.ERROR); expect("parse(): Unknown '"~tok.getToken()~"'");
exit(0);
} }
} }
} }