mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Suppressed print statements during tests
This commit is contained in:
@@ -184,7 +184,7 @@ static int writeNodeCompoundToCache(Compiler* compiler, Node* node) {
|
||||
freeLiteral(literal);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, ERROR "[Internal] Unrecognized compound type in writeNodeCompoundToCache()" RESET);
|
||||
fprintf(stderr, ERROR "[internal] Unrecognized compound type in writeNodeCompoundToCache()" RESET);
|
||||
}
|
||||
|
||||
return index;
|
||||
@@ -279,7 +279,7 @@ static void writeCompilerWithJumps(Compiler* compiler, Node* node, void* breakAd
|
||||
//determine node type
|
||||
switch(node->type) {
|
||||
case NODE_ERROR: {
|
||||
fprintf(stderr, ERROR "[Internal] NODE_ERROR encountered in writeCompilerWithJumps()\n" RESET);
|
||||
fprintf(stderr, ERROR "[internal] NODE_ERROR encountered in writeCompilerWithJumps()\n" RESET);
|
||||
compiler->bytecode[compiler->count++] = OP_EOF; //1 byte
|
||||
}
|
||||
break;
|
||||
@@ -338,7 +338,7 @@ static void writeCompilerWithJumps(Compiler* compiler, Node* node, void* breakAd
|
||||
break;
|
||||
|
||||
case NODE_PAIR:
|
||||
fprintf(stderr, ERROR "[Internal] NODE_PAIR encountered in writeCompilerWithJumps()\n" RESET);
|
||||
fprintf(stderr, ERROR "[internal] NODE_PAIR encountered in writeCompilerWithJumps()\n" RESET);
|
||||
break;
|
||||
|
||||
case NODE_VAR_DECL: {
|
||||
|
||||
@@ -308,6 +308,7 @@ static void trim(char** s, int* l) { //all this to remove a newline?
|
||||
while(**s && isspace( **(unsigned char**)(s)) ) { (*s)++; (*l)--; }
|
||||
}
|
||||
|
||||
//for debugging
|
||||
void printToken(Token* token) {
|
||||
if (token->type == TOKEN_ERROR) {
|
||||
printf(ERROR "Error\t%d\t%.*s\n" RESET, token->line, token->length, token->lexeme);
|
||||
|
||||
@@ -22,4 +22,5 @@ typedef struct {
|
||||
void initLexer(Lexer* lexer, char* source);
|
||||
Token scanLexer(Lexer* lexer);
|
||||
|
||||
//for debugging
|
||||
void printToken(Token* token);
|
||||
Reference in New Issue
Block a user