[Lxr-commits] CVS: lxr/lib/LXR/Lang Generic.pm,1.10,1.11 generic.conf,1.9,1.10
Brought to you by:
ajlittoz
|
From: Malcolm B. <mb...@us...> - 2002-02-26 15:56:26
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang
In directory usw-pr-cvs1:/tmp/cvs-serv21557
Modified Files:
Generic.pm generic.conf
Log Message:
Add Package type for Perl
Added version check for ctags
Index: Generic.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Generic.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Generic.pm 6 Dec 2001 14:36:43 -0000 1.10
+++ Generic.pm 26 Feb 2002 15:56:23 -0000 1.11
@@ -52,6 +52,9 @@
return $self;
}
+# This is only executed once, saving the overhead of processing the
+# config file each time. Because it is only done once, we also use
+# this to check the version of ctags.
sub read_config {
open (CONF, $config->genericconf) || die "Can't open ".$config->genericconf.", $!";
@@ -72,6 +75,13 @@
$typemap->{$type});
}
}
+
+ my $ctags = $config->ectagsbin;
+ my $version = `$ctags --version`;
+ $version=~ /Exuberant ctags +(\d+)/i;
+ if($1 < 5 ) {
+ die "Exuberant ctags version 5 or above required, found $version\n";
+ }
}
sub indexfile {
@@ -99,6 +109,10 @@
$line =~ s/;\"$//;
$ext =~ /language:(\w+)/;
$type = $typemap->{$type};
+ if(!defined $type) {
+ print "Warning: Unknown type ", (split(/\t/,$_))[3], "\n";
+ next;
+ }
# TODO: can we make it more generic in parsing the extension fields?
if (defined($ext) && $ext =~ /^(struct|union|class|enum):(.*)/) {
Index: generic.conf
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- generic.conf 19 Jan 2002 07:20:00 -0000 1.9
+++ generic.conf 26 Feb 2002 15:56:23 -0000 1.10
@@ -172,6 +172,7 @@
'string' => ("'", "'")],
'typemap' => {
's' => 'subroutine',
+ 'p' => 'package',
},
'langid' => '7',
|