aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArne Georg Gleditsch <argggh@taniquetil.(none)>2009-08-09 13:35:06 +0200
committerArne Georg Gleditsch <argggh@taniquetil.(none)>2009-08-09 13:35:06 +0200
commit172a21f37471c7d8ad55318dcdc61c51986d4452 (patch)
treec9dd309a0a3e474cb049e0cb229d81613aa6e001 /lib
parenta51ceca67488f39ea7d888d73d38acc4148ed4ed (diff)
Don't do progress reports when not on tty, allow ctags-unsupported languages to implement independent indexing.
Diffstat (limited to 'lib')
-rw-r--r--lib/LXRng/Lang/Kconfig.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/LXRng/Lang/Kconfig.pm b/lib/LXRng/Lang/Kconfig.pm
index 7417236..2239a87 100644
--- a/lib/LXRng/Lang/Kconfig.pm
+++ b/lib/LXRng/Lang/Kconfig.pm
@@ -114,5 +114,33 @@ sub resolve_include {
return ();
}
+sub index_file {
+ my ($self, $context, $file, $add_ident) = @_;
+
+ my $handle = $file->handle();
+ my $parse = LXRng::Parse::Simple->new($handle, 8,
+ @{$self->parsespec});
+
+ my $line = 1;
+ while (1) {
+ my ($btype, $frag) = $parse->nextfrag;
+
+ return 1 unless defined $frag;
+
+ $btype ||= 'code';
+ if ($btype eq 'code') {
+ while ($frag =~ s/\A(.*)^config (\w+)//) {
+ my ($pref, $sym) = ($1, $2);
+ $line += $pref =~ tr/\n/\n/;
+ $add_ident->($self->mangle_sym($sym),
+ {'kind' => 'd',
+ 'line' => $line});
+ }
+ }
+ $line += $frag =~ tr/\n/\n/;
+ }
+}
+
+
1;