Index: vhdlcode.l
===================================================================
--- vhdlcode.l	(Revision 842)
+++ vhdlcode.l	(Arbeitskopie)
@@ -63,7 +63,7 @@
 static bool isComponent=FALSE;
 static bool isPackageBody=FALSE;
 static bool isProto = FALSE;
-
+static bool bStartCode = FALSE;
 static QCString   g_PrevString;
 static QCString   g_CurrClass;
 static QDict<QCString>g_vhdlKeyDict;   
@@ -183,8 +183,9 @@
 static void startCodeLine()
 {
   //if (g_currentFontClass) { g_code->endFontClass(); }
-  if (g_sourceFileDef)
+   if (g_sourceFileDef)
   {
+   bStartCode=TRUE;
     //QCString lineNumber,lineAnchor;
     //lineNumber.sprintf("%05d",g_yyLineNr);
     //lineAnchor.sprintf("l%05d",g_yyLineNr);
@@ -247,12 +248,13 @@
 
 static void nextCodeLine()
 {
+ if(bStartCode)
+ endCodeLine();    // </div>
   const char *fc = g_currentFontClass;
-  endCodeLine();
-  if (g_yyLineNr<g_inputLines) 
+   if (g_yyLineNr<g_inputLines) 
   {
     g_currentFontClass = fc;
-    startCodeLine();
+    startCodeLine();  //<div>
   }
 }
 
@@ -347,7 +349,7 @@
 /*! write a code fragment `text' that may span multiple lines, inserting
  * line numbers for each line.
  */
-static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE)
+static void codifyLines(const char *text,const char *cl=0,bool classlink=FALSE,bool comment=FALSE)
 {
   if (text==0) return;
   //printf("codifyLines(%d,\"%s\")\n",g_yyLineNr,text);
@@ -361,16 +363,21 @@
     if (c=='\n')
     {
       g_yyLineNr++;
-      QCString line = sp;
+     QCString line = sp;
       line = line.left((int)(p-sp)-1);
       //*(p-1)='\0';
       //g_code->codify(sp);
+      if(comment)
+         writeFont("keyword",line.data());
+      else
       writeWord(line,cl,classlink);
       nextCodeLine();
     }
     else
     {
-      //g_code->codify(sp);
+     if(comment)
+     writeFont("keyword",sp);
+      else
       writeWord(sp,cl,classlink);
       done=TRUE;
     }
@@ -1472,9 +1479,9 @@
 			   }  
 			   else // normal comment
 			   {
-			     startFontClass("keyword");
-			     codifyLines(text);
-			     endFontClass();
+			 //    startFontClass("keyword");
+			     codifyLines(text,0,FALSE,TRUE);
+			 //    endFontClass();
 			   }
                          }
 <*>{TEXTT}               { // found normal or special comment after something
@@ -1487,9 +1494,9 @@
 			   }  
 			   else // normal comment
 			   {
-			     startFontClass("keyword");
-			     codifyLines(text);
-			     endFontClass();
+			  //   startFontClass("keyword");
+			     codifyLines(text,0,FALSE,TRUE);
+			  //   endFontClass();
 			   }
                          }
 
@@ -1504,7 +1511,7 @@
   g_vhdlKeyDict.setAutoDelete(TRUE);
   g_vhdlKeyDict.clear();
 }
-
+  
 void parseVhdlCode(CodeOutputInterface &od,const char *className,const QCString &s, 
                   bool /*exBlock*/, const char *exName,FileDef *fd,
                   int startLine,int endLine,bool inlineFragment,
@@ -1515,7 +1522,7 @@
   if (memberDef)
   {
     ClassDef *dd=memberDef->getClassDef();
-    if (dd) g_CurrClass=dd->className();
+    if (dd) g_CurrClass=dd->name();
     startLine--;
   }
   resetVhdlCodeParserState();
@@ -1588,8 +1595,7 @@
     delete g_sourceFileDef;
     g_sourceFileDef=0;
   }
- 
-  return;
+  bStartCode=FALSE;
 }
 
 void codeFreeVhdlScanner()
