fix l2/3
This commit is contained in:
parent
6c82163589
commit
d68db68e6c
1 changed files with 14 additions and 1 deletions
15
l2/3.lex
15
l2/3.lex
|
@ -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>. { }
|
||||
%%
|
||||
|
||||
|
|
Loading…
Reference in a new issue