Revision 61cd09fa
Von Udo Spallek vor fast 18 Jahren hinzugefügt
scripts/create_tags_file.pl | ||
---|---|---|
1 |
######################################################## |
|
2 |
# |
|
3 |
# This script creates a 'tags' file in the style of ctags |
|
4 |
# out of the SL/ modules. |
|
5 |
# Tags file is usable in some editors (vim, joe, emacs, ...). |
|
6 |
# See your editors documentation for more information. |
|
7 |
# |
|
8 |
# (c) Udo Spallek, Aachen |
|
9 |
# Licenced under GNU/GPL. |
|
10 |
# |
|
11 |
######################################################## |
|
12 |
|
|
13 |
use Perl::Tags; |
|
14 |
use IO::Dir; |
|
15 |
use Data::Dumper; |
|
16 |
|
|
17 |
use strict; |
|
18 |
use warnings FATAL =>'all'; |
|
19 |
use diagnostics; |
|
20 |
|
|
21 |
my $dir = IO::Dir->new("SL/"); |
|
22 |
|
|
23 |
my @files = grep {/\.pm$/} $dir->read(); |
|
24 |
|
|
25 |
@files = grep { s{^}{SL\/}gxms } @files; |
|
26 |
|
|
27 |
#print Dumper(@files); |
|
28 |
|
|
29 |
#__END__ |
|
30 |
my $naive_tagger = Perl::Tags::Naive->new( max_level=>1 ); |
|
31 |
$naive_tagger->process( |
|
32 |
files => [@files], |
|
33 |
refresh=>1 |
|
34 |
); |
|
35 |
|
|
36 |
my $tagsfile="tags"; |
|
37 |
|
|
38 |
# of course, it may not even output, for example, if there's nothing new to process |
|
39 |
$naive_tagger->output( outfile => $tagsfile ); |
|
40 |
|
|
41 |
|
|
42 |
1; |
Auch abrufbar als: Unified diff
Skript zum Erzeugen eines tags-Files. Damit kann man im Editor direkt zu der Stelle im Code springen,
wo die gesuchte Funktion definiert ist. Praktisch fuer vi, joe, emacs...