void fxDebug(txMachine* the, txError theError, txString theFormat, ...) { c_va_list arguments; txSlot* aSlot; txString aPath = C_NULL; txID aLine = 0; c_va_start(arguments, theFormat); if (fxIsConnected(the) && (theError != XS_NO_ERROR)) fxDebugLoopV(the, theFormat, arguments); else { if ((aSlot = the->frame - 1) && (aSlot->next)) { if (the->frame->flag & XS_C_FLAG) aPath = (txString)aSlot->next; else aPath = aSlot->next->value.symbol.string; aLine = aSlot->ID; } if (theError != XS_NO_ERROR) fxVReportError(the, aPath, aLine, theFormat, arguments); else fxVReportWarning(the, aPath, aLine, theFormat, arguments); } c_va_end(arguments); if (theError != XS_NO_ERROR) fxThrowError(the, theError); }
void fxReportLineError(txParser* parser, txInteger line, txString theFormat, ...) { c_va_list arguments; parser->errorCount++; c_va_start(arguments, theFormat); fxVReportError(parser->console, parser->path ? parser->path->string : C_NULL, line, theFormat, arguments); c_va_end(arguments); }
void fxReportParserWarning(txParser* parser, txString theFormat, ...) { c_va_list arguments; parser->warningCount++; c_va_start(arguments, theFormat); fxVReportWarning(parser->console, parser->path ? parser->path->string : C_NULL, parser->line, theFormat, arguments); c_va_end(arguments); }
void fxReportLineError(txParser* parser, txInteger line, txString theFormat, ...) { c_va_list arguments; parser->errorCount++; if (!parser->errorSymbol) parser->errorSymbol = parser->SyntaxErrorSymbol; c_va_start(arguments, theFormat); (*parser->reportError)(parser->console, parser->path ? parser->path->string : C_NULL, line, theFormat, arguments); c_va_end(arguments); }
void fxReportError(txLinker* linker, txString theFormat, ...) { c_va_list arguments; fprintf(stderr, "### "); c_va_start(arguments, theFormat); vfprintf(stderr, theFormat, arguments); c_va_end(arguments); fprintf(stderr, "!\n"); linker->error = C_EINVAL; c_longjmp(linker->jmp_buf, 1); }