[Lxr-commits] CVS: lxr/lib/LXR/Lang Generic.pm,1.17,1.18 Java.pm,1.6,1.7
Brought to you by:
ajlittoz
From: Dave B. <bro...@us...> - 2004-08-10 16:13:15
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6451/lib/LXR/Lang Modified Files: Generic.pm Java.pm Log Message: highlight reserved words; different colors for comments and strings Index: Generic.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Generic.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Generic.pm 21 Jul 2004 20:44:31 -0000 1.17 +++ Generic.pm 10 Aug 2004 16:13:02 -0000 1.18 @@ -149,7 +149,6 @@ # $code - reference to the code to markup # @itag - ??? # TODO : Make the handling of identifier recognition language dependant - sub processcode { my ($self, $code) = @_; my ($start, $id); @@ -157,10 +156,10 @@ # Replace identifier by link unless it's a reserved word { $1. - ((!grep(/^$2$/, $self->langinfo('reserved')) && - $index->issymbol($2, $$self{'release'})) ? - join($2, @{$$self{'itag'}}) : - $2); + ( + grep(/^$2$/, $self->langinfo('reserved')) ? "<span class='reserved'>$2</span>" : + ($index->issymbol($2, $$self{'release'}) ? join($2, @{$$self{'itag'}}) : $2) + ); }ge; } Index: Java.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Java.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Java.pm 21 Jul 2004 20:44:31 -0000 1.6 +++ Java.pm 10 Aug 2004 16:13:03 -0000 1.7 @@ -40,7 +40,7 @@ # Deal with package declaration of the form # "package java.lang.util" $$frag =~ s#(package\s+)([\w.]+)# - $1. + "<span class='reserved'>$1</span>". ($index->issymbol($2, $$self{'release'}) ? join($2, @{$$self{'itag'}}) : $2) #e; @@ -48,7 +48,7 @@ # Deal with import declaration of the form # "import java.awt.*" by providing link to the package $$frag =~ s#(import\s+)([\w.]+)(\.\*)# - $1. + "<span class='reserved'>$1</span>". ($index->issymbol($2, $$self{'release'}) ? join($2, @{$$self{'itag'}}) : $2) . $3 #e; @@ -57,7 +57,7 @@ # "import java.awt.classname" by providing links to the # package and the class $$frag =~ s#(import\s+)([\w.]+)\.(\w+)(\W)# - $1. + "<span class='reserved'>$1</span>". ($index->issymbol($2, $$self{'release'}) ? join($2, @{$$self{'itag'}}) : $2) . "." . ($index->issymbol($3, $$self{'release'}) ? |