next = next->next;
if (next == NULL || next->token->type != IDENTIFIER) {
yyerror (&node->token->location, parser, "operator \"defined\" requires an identifier\n");
- exit (1);
+ /* Already flagged an error; fake it. */
+ node->token->type = INTEGER;
+ node->token->value.ival = 0;
+ return;
}
macro = hash_table_find (parser->defines,
next->token->value.str);
return NULL;
case FUNCTION_UNBALANCED_PARENTHESES:
glcpp_error (&node->token->location, parser, "Macro %s call has unbalanced parentheses\n", identifier);
- exit (1);
return NULL;
}
*/
if (strncmp(identifier, "__", 2) == 0) {
glcpp_error (loc, parser, "Macro names starting with \"__\" are reserved.\n");
- exit(1);
}
if (strncmp(identifier, "GL_", 3) == 0) {
glcpp_error (loc, parser, "Macro names starting with \"GL_\" are reserved.\n");
- exit(1);
}
}
{
if (parser->skip_stack == NULL) {
glcpp_error (loc, parser, "%s without #if\n", type);
- exit (1);
+ return;
}
if (parser->skip_stack->type == SKIP_TO_ELSE) {
if (parser->skip_stack == NULL) {
glcpp_error (loc, parser, "#endif without #if\n");
- exit (1);
+ return;
}
node = parser->skip_stack;