Improves performance in skipping comment.
This commit is contained in:
parent
967dc2cf3f
commit
c5cf9aa530
2
TODO.TXT
2
TODO.TXT
@ -1,4 +1,4 @@
|
|||||||
resolve all TODO in source codes
|
X resolve all TODO in source codes
|
||||||
remove f16/f32/f64 types
|
remove f16/f32/f64 types
|
||||||
partial code generation for C (divide decls and functions)
|
partial code generation for C (divide decls and functions)
|
||||||
release v1.0.1
|
release v1.0.1
|
||||||
|
9
biner.l
9
biner.l
@ -20,11 +20,18 @@ D [0-9]
|
|||||||
I [A-Za-z_]
|
I [A-Za-z_]
|
||||||
H [0-9A-Fa-f]
|
H [0-9A-Fa-f]
|
||||||
|
|
||||||
|
%x IN_COMMENT
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
[ \t\r\n]+ count_();
|
[ \t\r\n]+ count_();
|
||||||
"//".* count_();
|
"//".* count_();
|
||||||
[/][*][^*]*[*]+([^*/][^*]*[*]+)*[/] count_(); /* TODO: detect unterminated comment */
|
|
||||||
|
<INITIAL>"/*" { count_(); BEGIN(IN_COMMENT); }
|
||||||
|
<IN_COMMENT>"*/" { count_(); BEGIN(INITIAL); }
|
||||||
|
<IN_COMMENT>[^\*\n]+ count_();
|
||||||
|
<IN_COMMENT>"*" count_();
|
||||||
|
<IN_COMMENT>"\n" count_();
|
||||||
|
|
||||||
"==" { count_(); return EQUAL; }
|
"==" { count_(); return EQUAL; }
|
||||||
"!=" { count_(); return NEQUAL; }
|
"!=" { count_(); return NEQUAL; }
|
||||||
|
Loading…
Reference in New Issue
Block a user