--- 3.0\JvHLEditor.pas	Thu Feb 24 13:26:10 2005
+++ JvHLEditor.pas	Thu Aug 18 11:35:52 2005
@@ -311,7 +311,7 @@
     case FHighlighter of
       hlPascal:
         Parser.Style := psPascal;
-      hlCBuilder, hlSql, hlJava, hlNQC, hlCSharp:
+      hlCBuilder, hlJava, hlNQC, hlCSharp:
         Parser.Style := psCpp;
       hlPython:
         Parser.Style := psPython;
@@ -327,6 +327,8 @@
         Parser.Style := psCocoR;
       hlPhp:
         Parser.Style := psPhp;
+      hlSql:
+        Parser.Style := psSql;
     end;
     RescanLong(0);
     Invalidate;
@@ -377,6 +379,7 @@
     ' int monitor repeat return signed start stop sub switch task true' +
     ' until void while ';
 
+    (* 17/08/05 - Eswar: REPLACE keyword added to the list *)
   SQLKeyWords =
     ' active as add asc after ascending all at alter auto' +
     ' and autoddl any avg based between basename blob' +
@@ -402,8 +405,8 @@
     ' open output_type option overflow page post_event pagelength  precision' +
     ' pages  prepare page_size procedure parameter  protected password  primary' +
     ' plan  privileges position  public quit' +
-    ' raw_partitions  retain rdb db_key  return read  returning_values real  returns' +
-    ' record_version revoke references  right release  rollback reserv runtime' +
+    ' raw_partitions  retain rdb db_key  return read replace returning_values real  returns' +
+    ' record_version revoke references  right release  rollback reserv runtime replace' +
     ' reserving schema  sql segment  sqlcode select  sqlerror set  sqlwarning' +
     ' shadow  stability shared  starting shell  starts show  statement' +
     ' singular  static size  statistics smallint  sub_type snapshot  sum' +
@@ -635,9 +638,17 @@
         Result := ((LS > 0) and (St[1] = '{')) or
           ((LS > 1) and (((St[1] = '(') and (St[2] = '*')) or
           ((St[1] = '/') and (St[2] = '/'))));
-      hlCBuilder, hlSql, hlJava, hlPhp, hlNQC, hlCSharp:
+      hlCBuilder, hlJava, hlPhp, hlNQC, hlCSharp:
         Result := (LS > 1) and (St[1] = '/') and
           ((St[2] = '*') or (St[2] = '/'));
+      (* 17/08 - Eswar: Support for SQL comment line beginning with -- *)
+      hlSql:
+        Result := (LS > 1) and ((St[1] = '-') and
+          (St[2] = '-'));
+      (* 17/08 - Eswar: HTML multi line comment support *)
+      hlHtml:
+        Result := (LS > 3) and (St[1] = '<') and (St[2] = '!')
+          and (St[3] = '-') and (St[4] = '-');
       hlVB:
         Result := (LS > 0) and (St[1] = '''');
       hlPython, hlPerl:
@@ -847,11 +858,11 @@
       C := Colors.Comment
     else
       C := Colors.PlainText;
-    if (FLong <> 0) and (FHighlighter <> hlHtml) then
+    if (FLong <> 0) {Eswar: and (FHighlighter <> hlHtml)} then
     begin
       Parser.pcPos := Parser.pcProgram + FindLongEnd + 1;
       case Highlighter of
-        hlCBuilder, hlPython, hlPerl, hlNQC, hlCSharp:
+        hlCBuilder, hlPython, hlPerl, hlNQC, hlCSharp, hlHtml:
           case FLong of
             lgString:
               C := Colors.Strings;
@@ -977,15 +988,34 @@
           hlHtml:
             if not InTag then
             begin
+              (* 18/08 - Eswar: Check for the comment starting
+                 with <!-- and force the hilighter to check for
+                 the comments *)
+              if Token = '<!--' then
+              begin
+                InTag := True;
+                SetColor(Colors.Comment);
+                F := False;
+              end
+              else
               if Token = '<' then
               begin
                 InTag := True;
-                SetColor(Colors.Reserved)
-              end;
-              F := True;
+                SetColor(Colors.Reserved);
+                F := True;
+              end
+              else
+                F := False;
             end
             else
             begin
+              if Token = '-->' then
+              begin
+                InTag := False;
+                SetColor(Colors.Reserved);
+                F := False;
+              end
+              else
               if Token = '>' then
               begin
                 InTag := False;
@@ -1394,13 +1424,28 @@
                       P := StrScan(F + I, Char('>'));
                       if P = nil then
                       begin
-                        FLong := lgTag;
+                        (* 17/08 - Eswar: Multiline comments in HTML *)
+                        if S[2] = '!' then
+                          FLong := lgComment1
+                        else
+                          FLong := lgTag;
                         Break;
                       end
                       else
                         I := P - F + 1;
                     end;
                 end;
+              (* 17/08 - Eswar: Multiline comments in HTML *)
+              lgComment1:
+                begin
+                  P := StrScan(F + I - 1, Char('>'));
+                  if P = nil then
+                    Break
+                  else
+                    if (P[-2] = '-') and (P[-1] = '-') then
+                      FLong := lgNone;
+                  I := P - F + 1;
+                end;
               lgTag: // html tag
                 begin
                   P := StrScan(F + I - 1, Char('>'));
@@ -1601,6 +1646,16 @@
       end;
     hlHtml:
       case FLong of
+        (* 18/08 - Eswar: HTML multiline comments *)
+        lgComment1:
+          begin
+            P := StrScan(P, Char('>'));
+            if P <> nil then
+              // check if the previous characters are
+              // --
+              if (P[-1] = '-') and (P[-2] = '-') then
+                Result := P - PChar(FLine);
+          end;
         lgTag:
           begin
             P := StrScan(P, Char('>'));
