[docs] xmldocs - docelic modified 2 files

docs at icdevgroup.org docs at icdevgroup.org
Thu Sep 30 17:57:16 EDT 2004


User:      docelic
Date:      2004-09-30 21:57:16 GMT
Modified:  bin      refs-autogen stattree
Log:
- bin/refs-autogen:
 - Made sure context numbers now match. (It now properly says, say,
   "Line 1-14" where before it was "Line 0-15".
 - Don't display "<sbr/>Line x (context shows y-z)" for files that we
   show in whole, and not just in excerpts. (Tags, for example).

- bin/stattree:
 - remove TODO warning unless $verbose is set
 - add missing %c. When constructing new entry, I forgot to pass-on
   unmodified fields, which resulted in emptyness of some of the fields
   I relied on.

Revision  Changes    Path
1.37      +28 -5     xmldocs/bin/refs-autogen


rev 1.37, prev_rev 1.36
Index: refs-autogen
===================================================================
RCS file: /var/cvs/xmldocs/bin/refs-autogen,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- refs-autogen	30 Sep 2004 10:49:05 -0000	1.36
+++ refs-autogen	30 Sep 2004 21:57:16 -0000	1.37
@@ -148,6 +148,17 @@
 			# %symbol_lists.
 			push @{ $symbol_lists{$gkey} }, $key
 				unless grep {/^$key$/} @{ $symbol_lists{$gkey} };
+			# CRAP
+			#my $marker = 0;
+			#for my $gk ( keys %symbol_lists ) {
+			#	next if $gkey eq $gk;
+			#	if ( grep {/^$key$/} @{ $symbol_lists{$gk}} ) {
+			#		print "$key IN $gk\n";
+			#		$marker++;
+			#		die;
+			#	}
+			#}
+			#!$marker and do { push @{ $symbol_lists{$gkey} }, $key };
 
 			# Define basic hash for the item ( $autogenerated{<name>} ), and
 			# load values from files. The function returns if
@@ -207,23 +218,35 @@
 				for my $arr ( @{ $covered{$key}{$fi} } ) {
 					goto DONELOOP if $ln > $$arr[0] and $ln < $$arr[1];
 				}
+				# We 'shift' here because we unshifted 1 row to match line
+				# numbers with array indexes
 				my $ctxsdata = join "\n", @{ $$ctx{ctx} };
+				$ctxsdata =~ s/^\n//;
 				if ( length $ctxsdata ) {
 					my $ls = $$ctx{ctxs}; # line start nr.
 					( my $plf = $$ctx{file} ) =~ s#.+?/##;
 					#my $loc = "$$ctx{file}:$$ctx{lnum}";
 					my $loc = $$ctx{file};
 					
-					my $cstart = $$ctx{lnum}-$$ctx{ctxpre};
+					my ( $cstart, $cend, $ctxmeta ) = ("", "", "");
+					#if (0) { use Data::Dumper; print Dumper $ctx; sleep 10; }
+					if ( $$ctx{fsubtype} !~ /tag$/ ) {
+						# WE SHOW ONLY PART OF CONTEXT FOR THOSE
+						$cstart = 1;
+						$cend = scalar @{$$ctx{ctx}}-1;
+						$ctxmeta = "<sbr/>Line $$ctx{lnum} (context shows lines " .
+							( $cstart . "-" .  $cend );
+					} else {
+						# WE SHOW ALL FOR THOSE
+						$cstart = $$ctx{lnum}-$$ctx{ctxpre};
+						$cend = $$ctx{lnum}+$$ctx{ctxpost}-1;
+					}
 					# XXX - eliminate negative numbers in source context spans
 					# ( 0-6 == OK, -4-6 != OK )
 					#if ( $cstart < 0 ) {
 					#	print STDERR "CSTART IS $cstart FOR $$ag{name}\n";
 					#	$cstart = 0 ;
 					#}
-					my $cend = $$ctx{lnum}+$$ctx{ctxpost};
-					my $ctxmeta = "Line $$ctx{lnum} (context shows lines " .
-						( $cstart . "-" .  $cend );
 					
 					$ctxmeta .= " in $$ctx{func}():$$ctx{funclnum}" if $$ctx{funclnum};
 					$ctxmeta .= ")";
@@ -235,7 +258,7 @@
 <para>
 </para>
 <example>
-<title>$loc (rev. $r from $d)<sbr/>$ctxmeta</title>
+<title>$loc (rev. $r from $d)$ctxmeta</title>
 
 <screen linenumbering='numbered' startinglinenumber='$ls'><![CDATA[
 $ctxsdata



1.18      +4 -1      xmldocs/bin/stattree


rev 1.18, prev_rev 1.17
Index: stattree
===================================================================
RCS file: /var/cvs/xmldocs/bin/stattree,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- stattree	22 Sep 2004 06:55:58 -0000	1.17
+++ stattree	30 Sep 2004 21:57:16 -0000	1.18
@@ -345,7 +345,7 @@
 				}
 				
 				if ( "@lis" =~ /<</ and $tagopt !~ /^routine/i ) {
-					warn "TODO: Unsupported << in $tn (in $i{ver})\n";
+					warn "TODO: Unsupported << in $tn (in $i{ver})\n" if $verbose;
 					next;
 				}
 
@@ -361,6 +361,7 @@
 			# For each tag found in the file, create appropriate data in hash.
 			for my $tagname ( @tags ) {
 				push @{ $hash{symbols}{$c{fsubtype}}{$tagname} }, {
+					%c,
 					file => "$i{ver}/$c{file}",
 					lnum => scalar @filedata,
 					ctxpre => $ctx_p,
@@ -430,6 +431,7 @@
 	# 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 - pad with empty lines or something).
+		%ptr,
 		file => "$i{ver}/$ptr{file}",
 		lnum => $ptr{lnum},
 		func => ${$ptr{gfunc}}[0],
@@ -450,6 +452,7 @@
 	if ( ( $c{line} =~ /(()|\$())\$Global::Variable(->\2|\3){(\w+?)}/ or
 		$c{line} =~ /\$Tag->var\s*\(\s*(["'])(\S+?)\1(\s*,\s*(\d))?/ ) and $5 ) {
 		push @{ $hash{symbols}{globvar}{$5} }, {
+			%c,
 			file => "$i{ver}/$c{file}",
 			lnum => $c{lnum},
 			func => ${$c{gfunc}}[0],








More information about the docs mailing list