ti.token = SL_PP_LINE;
ti.data.line = context->line - 1;
if (sl_pp_process_out(&state, &ti)) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
ti.token = SL_PP_NEWLINE;
if (sl_pp_process_out(&state, &ti)) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
}
}
if (sl_pp_process_out(&state, &endof)) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
context->line++;
case SL_PP_NEWLINE:
/* Empty directive. */
if (sl_pp_process_out(&state, &input[i])) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
context->line++;
case SL_PP_EOF:
/* Empty directive. */
if (sl_pp_process_out(&state, &input[i])) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
i++;
break;
default:
+ strcpy(context->error_msg, "expected a directive name");
return -1;
}
} else {
case SL_PP_NEWLINE:
/* Preserve newline just for the sake of line numbering. */
if (sl_pp_process_out(&state, &input[i])) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
context->line++;
case SL_PP_EOF:
if (sl_pp_process_out(&state, &input[i])) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
i++;
default:
if (context->if_value) {
if (sl_pp_process_out(&state, &input[i])) {
+ strcpy(context->error_msg, "out of memory");
return -1;
}
}
}
if (context->if_ptr != SL_PP_MAX_IF_NESTING) {
- /* #endif expected. */
+ strcpy(context->error_msg, "expected `#endif' directive");
return -1;
}