fix multiline comment bug

This commit is contained in:
anon 2024-09-16 17:34:27 +02:00
parent 60ae8dd6d6
commit 1da01fbc57
2 changed files with 4 additions and 3 deletions

View File

@ -58,7 +58,7 @@ leave[[:space:]] { return LEAVE; }
return IDENTIFIER; return IDENTIFIER;
} }
\/\/ { BEGIN IN_COMMENT; } \/\/ { BEGIN IN_COMMENT; }
\/\* { BEGIN IN_COMMENT; } \/\* { BEGIN IN_MULTILINE_COMMENT; }
\%\% { \%\% {
BEGIN IN_CODE_SECTION; BEGIN IN_CODE_SECTION;
return SEPARATOR; return SEPARATOR;
@ -71,7 +71,7 @@ leave[[:space:]] { return LEAVE; }
} }
<IN_MULTILINE_COMMENT>{ <IN_MULTILINE_COMMENT>{
. { ; } .|\n { ; }
\*\/ { BEGIN IN_RULE_SECTION; } \*\/ { BEGIN IN_RULE_SECTION; }
} }

View File

@ -11,7 +11,8 @@
%% %%
// this is a comment // this is a comment
/* so is this */ /* so is this
*/
enter function_definition { enter function_definition {
char * name = tbget_node_text($$->"declarator"->"declarator"); char * name = tbget_node_text($$->"declarator"->"declarator");
functions.insert(name); functions.insert(name);