Marked the sync functions as noreturn so GCC knows this and fixed an incorrect function call to ParserExpectList.

This commit is contained in:
2025-06-29 23:00:23 -05:00
parent c86c424c6f
commit 1475601f6a
+6 -4
View File
@@ -23,9 +23,11 @@ Token* ParserExpect(TokenType type);
Token* ParserExpectList(int count, ...); Token* ParserExpectList(int count, ...);
Token* ParserWant(TokenType type); Token* ParserWant(TokenType type);
void ParserExpectLineEnd(void); void ParserExpectLineEnd(void);
void ParserSync(char* format, ...); //Some more on atrributes:
void ParserSyncExpect(TokenType expected, TokenType found); //https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Function-Attributes.html#Function%20Attributes
void ParserSyncMessage(char* message); void ParserSync(char* format, ...) __attribute__ ((noreturn));
void ParserSyncExpect(TokenType expected, TokenType found) __attribute__ ((noreturn));
void ParserSyncMessage(char* message) __attribute__ ((noreturn));
Instruction* ParserCreateInstruction(void); Instruction* ParserCreateInstruction(void);
Instructions* ParseTokens(Array* tokens) { Instructions* ParseTokens(Array* tokens) {
@@ -109,7 +111,7 @@ void ParserHandleMnemonic(Mnemonics mnemonic) {
case ADD: case ADD:
inst->ParameterCount = 2; inst->ParameterCount = 2;
PARSER_EXPECT_LIST(LineEnd, Colon, Comma); ParserExpects(LineEnd, Colon, Comma);
break; break;
default: default: