Tighten up the specification to allow TableGen/nested-comment.td to pass

(fixing a bug where / in a /* */ comment would cause it to not close).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-09-06 21:23:09 +00:00
parent 5838b21cde
commit 9978332473

View File

@ -214,10 +214,10 @@ ${Identifier} { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
"/*" { BEGIN(comment); CommentDepth++; }
<comment>[^*/]* /* eat anything that's not a '*' or '/' */
<comment>"*"+[^*/]* /* eat up '*'s not followed by '/'s */
<comment>[^*/]* {} /* eat anything that's not a '*' or '/' */
<comment>"*"+[^*/]* {} /* eat up '*'s not followed by '/'s */
<comment>"/*" { ++CommentDepth; }
<comment>"/"+[^*]* /* eat up /'s not followed by *'s */
<comment>"/"+[^*/]* {} /* eat up /'s not followed by *'s */
<comment>"*"+"/" { if (!--CommentDepth) { BEGIN(INITIAL); } }
<comment><<EOF>> { err() << "Unterminated comment!\n"; exit(1); }