mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Handle preprocessor parsing errors.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
cdfca2fab7
commit
5304cabf46
@@ -24,6 +24,8 @@
|
||||
#include "vkd3d_shader_private.h"
|
||||
#include "preproc.h"
|
||||
|
||||
#define PREPROC_YYLTYPE struct vkd3d_shader_location
|
||||
|
||||
}
|
||||
|
||||
%code provides
|
||||
@@ -36,9 +38,22 @@ int preproc_yylex(PREPROC_YYSTYPE *yylval_param, PREPROC_YYLTYPE *yylloc_param,
|
||||
%code
|
||||
{
|
||||
|
||||
#define YYLLOC_DEFAULT(cur, rhs, n) (cur) = YYRHSLOC(rhs, !!n)
|
||||
|
||||
static void preproc_error(struct preproc_ctx *ctx, const struct vkd3d_shader_location *loc,
|
||||
enum vkd3d_shader_error error, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
vkd3d_shader_verror(ctx->message_context, loc, error, format, args);
|
||||
va_end(args);
|
||||
ctx->error = true;
|
||||
}
|
||||
|
||||
static void yyerror(const YYLTYPE *loc, void *scanner, struct preproc_ctx *ctx, const char *string)
|
||||
{
|
||||
FIXME("Error reporting is not implemented.\n");
|
||||
preproc_error(ctx, loc, VKD3D_SHADER_ERROR_PP_INVALID_SYNTAX, "%s", string);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user