| 278 | } |
| 279 | |
| 280 | void fxReportParserError(txParser* parser, txInteger line, txString theFormat, ...) |
| 281 | { |
| 282 | c_va_list arguments; |
| 283 | parser->error = C_EINVAL; |
| 284 | parser->errorCount++; |
| 285 | c_va_start(arguments, theFormat); |
| 286 | (*parser->reportError)(parser->console, parser->path ? parser->path->string : C_NULL, line, theFormat, arguments); |
| 287 | c_va_end(arguments); |
| 288 | if (parser->console) { |
| 289 | parser->errorSymbol = parser->SyntaxErrorSymbol; |
| 290 | if (parser->buffer != theFormat) { |
| 291 | c_va_start(arguments, theFormat); |
| 292 | c_vsnprintf(parser->buffer, parser->bufferSize, theFormat, arguments); |
| 293 | c_va_end(arguments); |
| 294 | } |
| 295 | parser->errorMessage = fxNewParserString(parser, parser->buffer, mxStringLength(parser->buffer)); |
| 296 | c_longjmp(parser->firstJump->jmp_buf, 1); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | void fxTerminateParser(txParser* parser) |
| 301 | { |
no test coverage detected