comment support in rule section

This commit is contained in:
anon
2024-09-16 11:08:26 +02:00
parent 0762199f88
commit 8d9b6c5256
2 changed files with 15 additions and 0 deletions

View File

@ -12,6 +12,7 @@
identifier [a-zA-z][-a-zA-z0-9_]*
%x IN_DEFINITION_SECTION IN_RULE_SECTION IN_CODE_SECTION
%x IN_COMMENT IN_MULTILINE_COMMENT
%x IN_CODE
%option nodefault
@ -56,12 +57,24 @@ leave[[:space:]] { return LEAVE; }
yylval.strval = strdup(yytext);
return IDENTIFIER;
}
\/\/ { BEGIN IN_COMMENT; }
\/\* { BEGIN IN_COMMENT; }
\%\% {
BEGIN IN_CODE_SECTION;
return SEPARATOR;
}
}
<IN_COMMENT>{
. { ; }
\n { BEGIN IN_RULE_SECTION; }
}
<IN_MULTILINE_COMMENT>{
. { ; }
\*\/ { BEGIN IN_RULE_SECTION; }
}
<IN_CODE>{
\{ { ++code_nesting; }
\} {