This commit is contained in:
jacekpoz 2024-11-09 15:48:43 +01:00
parent 6c82163589
commit d68db68e6c
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -6,8 +6,18 @@
%x SINGLE_LINE
%x MULTI_LINE
%x STRING
%x INCLUDE
%%
<INITIAL>"#include <" { ECHO; BEGIN(INCLUDE); }
<INCLUDE>">" { ECHO; BEGIN(INITIAL); }
<INITIAL>\" { ECHO; BEGIN(STRING); }
<STRING>\\\" { ECHO; }
<STRING>\" { ECHO; BEGIN(INITIAL); }
<STRING>. { ECHO; }
<INITIAL>"///"|"//!" {
if (leave_docs) {
ECHO;
@ -16,6 +26,8 @@
}
}
<INITIAL>"/**/" { putchar(' '); }
<INITIAL>"/**"|"/*!" {
if (leave_docs) {
ECHO;
@ -26,11 +38,12 @@
<INITIAL>"//" { BEGIN(SINGLE_LINE); }
<INITIAL>. { ECHO; }
<SINGLE_LINE>"\\\n" { }
<SINGLE_LINE>\n { BEGIN(INITIAL); }
<SINGLE_LINE>. { }
<INITIAL>"/*" { BEGIN(MULTI_LINE); }
<MULTI_LINE>"*/" { BEGIN(INITIAL); }
<MULTI_LINE>"*/" { putchar(' '); BEGIN(INITIAL); }
<MULTI_LINE>. { }
%%