[interchange-docs] xmldocs - docelic modified 2 files

docs at icdevgroup.org docs at icdevgroup.org
Mon Nov 12 21:44:19 EST 2007


User:      docelic
Date:      2007-11-13 02:44:18 GMT
Modified:  .        TODO
Modified:  bin      stattree
Log:
* Discover core tags from Interpolate.pm, so they show up in list of
  tags and can have docs and everything.
  Few rough edges will be polished, but it works already.

Revision  Changes    Path
1.110     +3 -0      xmldocs/TODO


rev 1.110, prev_rev 1.109
Index: TODO
===================================================================
RCS file: /var/cvs/xmldocs/TODO,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- TODO	12 Nov 2007 00:30:44 -0000	1.109
+++ TODO	13 Nov 2007 02:44:18 -0000	1.110
@@ -7,6 +7,9 @@
 - u CVS listi, da je fajl nejm link na CVS 
 - documentation for bounce and restrict is ignored
 - some small error in glossary/pragma at the bottom, [tag pragma]0[/tag]
+- see if the files we parse in bin/stattree in block (like parseVendConfig, parseVendInterpolate) allow some stuff to go unaccounted for mkreport
+- with tags from Interpolate.pm, context for systemtag is not always 'whole file', but can be x-y as well
+
 
 - order counter, Session->{mv_order_number}, cronjob -0001, or file da-te.counter, or session_id.time
 - in iccattut, s/item-field/item-param/ at least on some places. 



1.59      +68 -0     xmldocs/bin/stattree


rev 1.59, prev_rev 1.58
Index: stattree
===================================================================
RCS file: /var/cvs/xmldocs/bin/stattree,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- stattree	12 Nov 2007 00:30:44 -0000	1.58
+++ stattree	13 Nov 2007 02:44:18 -0000	1.59
@@ -702,6 +702,12 @@
 	if ( $c{file} eq 'lib/Vend/Config.pm' ) {
 		file_parseVendConfig(\%c, \@filedata);
 	}
+
+	####################################################################
+	# lib/Vend/Interpolate.pm
+	if ( $c{file} eq 'lib/Vend/Interpolate.pm' ) {
+		file_parseVendInterpolate(\%c, \@filedata);
+	}
 }
 
 # Format the context lines before saving to the db.
@@ -1087,8 +1093,70 @@
 	}
 }
 
+# Parse Interpolate.pm and take out some great stuff ;-)
+sub file_parseVendInterpolate {
+	my %c = %{ (shift) };
+	my $content = shift; # Complete lib/Vend/Interpolate.pm file
+
+	my $linenr = -1;     # Increases as we parse file (search "MINUS" above)
+	my $startline;       # Remember first line nr. of context, not last
+	my $context = "systemtag";
+	my @tags;            # List of tags found and line nrs at which they start
+
+	for my $line (@$content) {
+		$linenr++;
+		$startline = $linenr;
+		
+		# If we found a tag
+		if ( $line =~ /^sub\s+tag_(\S+)\s*{\s*$/ ) {
+			push @tags, [ $1, $startline ] ;
+			$hash{total}{systemtags}++;
+			$hash{total}{tags}++;
+		}
+	} # END for()
+
+	for my $itm (@tags) {
+		my ($tag, $lnum) = @$itm;
+		push @{ $hash{symbols}{$context}{$tag} }, {
+			%c,
+			lnum => $lnum,
+			ctx => [ '' ], #?format_ctx(split(/\n/, $tag)) ],
+		};
+
+		file_extractSub($tag, "Vend::Interpolate::tag_$tag",
+				\%c, {group => $context});
+
+		if ( $resolver_path{$context}{$tag} ) {
+			while (my $spath=shift @{ $resolver_path{$context}{$tag}}){
+				push @{ $hash{symbols}{$context}{$tag} }, {
+					ctx_p => 0,
+					ctx_n => 0,
+					%$spath,
+				};
+			}
+		}else{
+				push @{ $hash{symbols}{$context}{$tag} }, {
+					ctx_p => 0,
+					ctx_n => 0,
+					ctx => [ 'No extracted context' ],
+				};
+		}
+	}
+}
+
 
 # This is basically an excersize in bracket-matching
+# Invoke as:
+#  (
+#    symbol_this_function_belongs_to,
+#    Path::To::function(),
+#    \%c,
+#    { context_data }
+#  )
+# This will extract a function (function body) and push it
+# onto @{ $resolver_path{$$context_data{group}}{$funcname} }.
+# So after you call extractSub, check if anything was pushed
+# onto that variable for your processing.
 sub file_extractSub {
 	my ( $funcname, $func, $c, $context_data) = @_;
 








More information about the docs mailing list