mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader: Parse comments in the preprocessor.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
f544cb38e5
commit
741c332658
@ -36,16 +36,33 @@
|
|||||||
%option never-interactive
|
%option never-interactive
|
||||||
%option noinput
|
%option noinput
|
||||||
%option nounput
|
%option nounput
|
||||||
|
%option noyy_top_state
|
||||||
%option noyywrap
|
%option noyywrap
|
||||||
%option prefix="preproc_yy"
|
%option prefix="preproc_yy"
|
||||||
%option reentrant
|
%option reentrant
|
||||||
|
%option stack
|
||||||
|
|
||||||
|
/* Because these can both be terminated by EOF, we need states for them. */
|
||||||
|
%s C_COMMENT
|
||||||
|
%s CXX_COMMENT
|
||||||
|
|
||||||
WS [ \t]
|
WS [ \t]
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
{WS}+ {}
|
<INITIAL>"//" {yy_push_state(CXX_COMMENT, yyscanner);}
|
||||||
. {return T_TEXT;}
|
<INITIAL>"/*" {yy_push_state(C_COMMENT, yyscanner);}
|
||||||
|
<CXX_COMMENT>\\\r?\n {}
|
||||||
|
<CXX_COMMENT>\n {
|
||||||
|
yy_pop_state(yyscanner);
|
||||||
|
return T_TEXT;
|
||||||
|
}
|
||||||
|
<C_COMMENT>"*/" {yy_pop_state(yyscanner);}
|
||||||
|
<C_COMMENT,CXX_COMMENT><<EOF>> {yy_pop_state(yyscanner);}
|
||||||
|
<C_COMMENT,CXX_COMMENT>. {}
|
||||||
|
|
||||||
|
<INITIAL>{WS}+ {}
|
||||||
|
<INITIAL>. {return T_TEXT;}
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user