From: Chris Lattner Date: Tue, 6 Sep 2005 21:23:09 +0000 (+0000) Subject: Tighten up the specification to allow TableGen/nested-comment.td to pass X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;ds=sidebyside;h=997833247376a710e09b946e8a96c50859622c75;p=oota-llvm.git 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 --- diff --git a/utils/TableGen/FileLexer.l b/utils/TableGen/FileLexer.l index a4335879961..caed04e2eb9 100644 --- a/utils/TableGen/FileLexer.l +++ b/utils/TableGen/FileLexer.l @@ -214,10 +214,10 @@ ${Identifier} { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng); "/*" { BEGIN(comment); CommentDepth++; } -[^*/]* /* eat anything that's not a '*' or '/' */ -"*"+[^*/]* /* eat up '*'s not followed by '/'s */ +[^*/]* {} /* eat anything that's not a '*' or '/' */ +"*"+[^*/]* {} /* eat up '*'s not followed by '/'s */ "/*" { ++CommentDepth; } -"/"+[^*]* /* eat up /'s not followed by *'s */ +"/"+[^*/]* {} /* eat up /'s not followed by *'s */ "*"+"/" { if (!--CommentDepth) { BEGIN(INITIAL); } } <> { err() << "Unterminated comment!\n"; exit(1); }