Marked the sync functions as noreturn so GCC knows this and fixed an incorrect function call to ParserExpectList.
This commit is contained in:
+6
-4
@@ -23,9 +23,11 @@ Token* ParserExpect(TokenType type);
|
||||
Token* ParserExpectList(int count, ...);
|
||||
Token* ParserWant(TokenType type);
|
||||
void ParserExpectLineEnd(void);
|
||||
void ParserSync(char* format, ...);
|
||||
void ParserSyncExpect(TokenType expected, TokenType found);
|
||||
void ParserSyncMessage(char* message);
|
||||
//Some more on atrributes:
|
||||
//https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Function-Attributes.html#Function%20Attributes
|
||||
void ParserSync(char* format, ...) __attribute__ ((noreturn));
|
||||
void ParserSyncExpect(TokenType expected, TokenType found) __attribute__ ((noreturn));
|
||||
void ParserSyncMessage(char* message) __attribute__ ((noreturn));
|
||||
Instruction* ParserCreateInstruction(void);
|
||||
|
||||
Instructions* ParseTokens(Array* tokens) {
|
||||
@@ -109,7 +111,7 @@ void ParserHandleMnemonic(Mnemonics mnemonic) {
|
||||
case ADD:
|
||||
inst->ParameterCount = 2;
|
||||
|
||||
PARSER_EXPECT_LIST(LineEnd, Colon, Comma);
|
||||
ParserExpects(LineEnd, Colon, Comma);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user