Permalink
Browse files

- Makefile:

  - is now silent.
  - added Jon's suggestion (-f to clean target)

- bin/stattree:
  - the second line of output (filename:linenr) for each symbol found
    in the source (pragmas and global vars for now), now has one field
    more: " x:y", where x is context_prev, y is content_next.
    (then what follows is x+1+y lines of context where the symbol
    appears).
  - files parsing routine was enhanced (to be able to get context info,
    but it's generally better too).

- Wrongly added images/.xvpics directory was removed
  • Loading branch information...
1 parent 064ad92 commit 10780837d11403f8fce39cab13dc5d4ca0afd586 @docelic docelic committed Jul 13, 2004
View
@@ -13,6 +13,7 @@ DOCBOOKDIR = docbook
XSLT = xsltproc
XSLT_FLAGS = --xinclude
IC_VERSIONS = cvs-head
+.SILENT:
VPATH = guides
@@ -174,10 +175,10 @@ css:
#
#
distclean clean:
- -rm -r $(OUTPUT)
- -rm $(DOCBOOKDIR)/*.db
+ -rm -rf $(OUTPUT)
+ -rm -f $(DOCBOOKDIR)/*.db
-for p in $(IC_VERSIONS); do \
- rm $(CACHE)/$$p/* \
+ rm -f $(CACHE)/$$p/* \
; done
final:
View
@@ -79,6 +79,7 @@ O("
");
close (OUT);
+select STDOUT;
for my $p (qw/pragma globvar/) {
my $tfile = '';
@@ -90,7 +91,9 @@ for my $p (qw/pragma globvar/) {
$tfile .= "$k\n";
for my $fe ( @$v ) {
local $" = ":";
- $tfile .= "\t@$fe\n";
+ $tfile .= "\t@$fe[0,1] $$fe[2]\n";
+ local $" = "\t\t";
+ $tfile .= "\t\t@{@$fe[3]}\n";
}
}
open(OUT, "> $reportdir/$i{ver}/symbols.$p") or
View
@@ -27,6 +27,8 @@ my $verbose = 0;
my $cachedir = $ENV{CACHE} || "cache";
my %hash;
my $cpath = $ENV{PWD};
+my $ctx_p = 1; # How much context lines to show before
+my $ctx_n = 1; # after
# All types should be listed here or the stats wont. It should be
# reported if an unknown file is found in the archive
@@ -169,11 +171,12 @@ sub wanted {
# Open text file, parse contents
open IN, "< $file" or die "Can't open $file ($!)\n";
+ my @file = <IN>;
+ unshift @file, ""; # Match indices with line numbers
+ close IN;
- my $lnum = 0;
- while (<IN>) {
- my $line = $_;
- $lnum ++;
+ for (my $lnum = 1; $lnum < scalar @file; $lnum++) {
+ my $line = $file[$lnum];
$hash{tree}{$file}{lines}++ ;
$hash{total}{lines}++ ;
@@ -207,15 +210,21 @@ sub wanted {
# Ph33r, PH33R my MaD R3G3X skiLLz! ;-)
# This matches $::Pragma->{} or $$::Pragma{}
if ( $line =~ /(()|\$())\$::Pragma(->\2|\3){(\w+?)}/ ) {
- push @{ $hash{symbols}{pragma}{$5} }, [ $file, $lnum ];
+ push @{ $hash{symbols}{pragma}{$5} },
+ # TODO Here, and 2 places below: make sure if ctx is say, 5:5,
+ # it always shows that much (that is, workaround file beginning/
+ # file end problems).
+ [ $file, $lnum, "$ctx_p\:$ctx_n", [@file[$lnum-$ctx_p..$lnum+$ctx_n]] ];
}
# Diskover global variables
if ( $line =~ /(()|\$())\$Global::Variable(->\2|\3){(\w+?)}/ ) {
- push @{ $hash{symbols}{globvar}{$5} }, [ $file, $lnum ];
+ push @{ $hash{symbols}{globvar}{$5} },
+ [ $file, $lnum, "$ctx_p\:$ctx_n", [@file[$lnum-$ctx_p..$lnum+$ctx_n]] ];
}
if ( $line =~ /\$Tag->var\s*\(\s*(["'])(\S+?)\1(\s*,\s*(\d))?/ ) {
- push @{ $hash{symbols}{globvar}{$5} }, [ $file, $lnum ];
+ push @{ $hash{symbols}{globvar}{$5} },
+ [ $file, $lnum, "$ctx_p\:$ctx_n", [@file[$lnum-$ctx_p..$lnum+$ctx_n]] ];
warn "\$Tag->var syntax never used in .pl/.pm files by now.
I'll register that, but is it a mistake? ($2, $4)\n";
}
@@ -231,8 +240,6 @@ sub wanted {
# (adds 1 to both)
}
-
- close IN;
}
# Storable dumper
View
Binary file not shown.
View
@@ -15,5 +15,8 @@
<system systemId="iccattut-chunks-targets"
uri="iccattut-chunks-targets.db" />
+ <system systemId="xmldocs.css"
+ uri="xmldocs.css" />
+
</catalog>
Deleted file not rendered
@@ -1,5 +0,0 @@
-P7 332
-#IMGINFO:14x1 RGB (638 bytes)
-#END_OF_COMMENTS
-14 1 255
-�E�)����)�D�
View
Deleted file not rendered
View
Binary file not shown.
View
Deleted file not rendered
View
Binary file not shown.
Deleted file not rendered

0 comments on commit 1078083

Please sign in to comment.