Tighten up the specification to allow TableGen/nested-comment.td to pass
authorChris Lattner <sabre@nondot.org>
Tue, 6 Sep 2005 21:23:09 +0000 (21:23 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 6 Sep 2005 21:23:09 +0000 (21:23 +0000)
(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

utils/TableGen/FileLexer.l

index a43358799618e6347a162700439d129d1c27d920..caed04e2eb9702cf083b1c15cc724121fd326891 100644 (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); }