List:Internals« Previous MessageNext Message »
From:paul Date:October 17 2005 6:57pm
Subject:svn commit - mysqldoc@docsrva: r72 - in trunk: . tools
View as plain text  
Author: paul
Date: 2005-10-17 20:57:38 +0200 (Mon, 17 Oct 2005)
New Revision: 72

Log:
 r2790@frost:  paul | 2005-10-17 13:47:01 -0500
 Update to help tag processor.


Modified:
   trunk/
   trunk/tools/fill_help_tables2.pl


Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:2699
   + b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:2790

Modified: trunk/tools/fill_help_tables2.pl
===================================================================
--- trunk/tools/fill_help_tables2.pl	2005-10-16 11:20:03 UTC (rev 71)
+++ trunk/tools/fill_help_tables2.pl	2005-10-17 18:57:38 UTC (rev 72)
@@ -245,16 +245,18 @@
 
 Input consists of category blocks, each of which looks like::
 
-@HELP-CATEGORY-BEGIN catval[@parent-catval]
+@HELP-CATEGORY catval[@parent-catval]
 ... category contents ...
-@HELP-CATEGORY-END
 
+(implicitly terminated by another @HELP-CATEGORY or EOF)
+
 Each category block contains topic blocks, each of which looks like:
 
-@HELP-TOPIC-BEGIN topic
+@HELP-TOPIC topic
 ... topic contents ...
-@HELP-TOPIC-END
 
+(implicitly terminated by another @HELP-TOPIC, @HELP-CATEGORY, or EOF)
+
 Each topic block contains keyword, syntax, description, and example
 blocks.  They look like this:
 
@@ -285,8 +287,8 @@
 
 Example:
 
-@HELP-CATEGORY-BEGIN Comparison operators@Functions
-@HELP-TOPIC-BEGIN =
+@HELP-CATEGORY Comparison operators@Functions
+@HELP-TOPIC =
 @HELP-SYNTAX-BEGIN
 @HELP-TEXT-BEGIN WRAP
 =
@@ -313,8 +315,6 @@
         -> 1    
 @HELP-TEXT-END
 @HELP-EXAMPLE-END
-@HELP-TOPIC-END
-@HELP-CATEGORY-END
 
 =cut
 
@@ -343,11 +343,14 @@
   die "$.:Unrecognized line\n" unless /^\@HELP-(\S+)\s*(.*)/;
   my $tag = $1;
   my $rest = $2;
-  if ($tag eq "CATEGORY-BEGIN")
+  warn "$.:in:$_\n" if $debug;
+  warn "$.:tag:$tag\n" if $debug;
+  if ($tag eq "CATEGORY")
   {
     die "$.:\@HELP-$tag found with no category value\n" unless $rest ne "";
-    die "$.:\@HELP-$tag found while category is open\n" if defined $c_cat;
-    die "$.:\@HELP-$tag found while topic is open\n" if defined $c_topic;
+    #die "$.:\@HELP-$tag found while category is open\n" if defined $c_cat;
+    #die "$.:\@HELP-$tag found while topic is open\n" if defined $c_topic;
+    end_topic () if defined $c_topic;
     # category syntax can be catval or catval@parent-catval
     ($c_cat, $pc_cat) = split (/\@/, $rest);
     $pc_cat = "Contents" unless defined $pc_cat;
@@ -356,39 +359,20 @@
 $current_parent_category = $pc_cat;
     next;
   }
-  if ($tag eq "CATEGORY-END")
-  {
-    $c_cat = undef;
-    $pc_cat = undef;
-    next;
-  }
 
   # All other tags occur within category and REQUIRE the category to be known
   die "$.:\@HELP-$tag found but category unknown\n" unless defined $c_cat;
 
-  if ($tag eq "TOPIC-BEGIN")
+  if ($tag eq "TOPIC")
   {
     die "$.:\@HELP-$tag with no topic value\n" unless $rest ne "";
-    die "$.:\@HELP-$tag found while topic is open\n" if defined $c_topic;
+    #die "$.:\@HELP-$tag found while topic is open\n" if defined $c_topic;
+    end_topic () if defined $c_topic;
     $c_topic = $rest;
     warn "Change topic to $c_topic\n" if $debug;
     next;
   }
-  if ($tag eq "TOPIC-END")
-  {
-    # TODO: check for missing parts.  keywords are optional, but
-    # description (and maybe syntax) are not.
 
-    die "$.:No description for topic $c_topic\n" unless defined $c_description;
-
-    $c_topic = undef;
-    $c_keywords = undef;
-    $c_syntax = undef;
-    $c_description = undef;
-    $c_example = undef;
-    next;
-  }
-
   # All other tags occur within topic and REQUIRE the topic to be known
   die "$.:\@HELP-$tag found but topic unknown\n" unless defined $c_topic;
 
@@ -433,12 +417,29 @@
   die "$.:Unrecognized line (matches no known \@HELP- tag: $_\n";
 }
 
+end_topic () if defined $c_topic;
+
 #exit (0);
 
 # ----------------------------------------------------------------------
 
+# Close current topic
 
+# TODO: check for missing parts.  keywords are optional, but
+# description (and maybe syntax) are not.
 
+sub end_topic
+{
+  die "$.:No description for topic $c_topic\n" unless defined $c_description;
+
+  $c_topic = undef;
+  $c_keywords = undef;
+  $c_syntax = undef;
+  $c_description = undef;
+  $c_example = undef;
+}
+
+
 # Read lines until a line with the given tag is found.
 # Return lines up through that line.
 

Thread
svn commit - mysqldoc@docsrva: r72 - in trunk: . toolspaul17 Oct