texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6853] parsetexi update


From: Gavin D. Smith
Subject: [6853] parsetexi update
Date: Sat, 12 Dec 2015 19:33:51 +0000

Revision: 6853
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6853
Author:   gavin
Date:     2015-12-12 19:33:50 +0000 (Sat, 12 Dec 2015)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/parsetexi/Parsetexi/lib/Parsetexi.pm
    trunk/parsetexi/api.c
    trunk/parsetexi/close.c
    trunk/parsetexi/commands.c
    trunk/parsetexi/commands.h
    trunk/parsetexi/indices.c

Modified: trunk/parsetexi/Parsetexi/lib/Parsetexi.pm
===================================================================
--- trunk/parsetexi/Parsetexi/lib/Parsetexi.pm  2015-12-12 13:45:13 UTC (rev 
6852)
+++ trunk/parsetexi/Parsetexi/lib/Parsetexi.pm  2015-12-12 19:33:50 UTC (rev 
6853)
@@ -131,6 +131,7 @@
 
   wipe_values ();
   init_index_commands ();
+  # fixme: these are overwritten immediately after
   if (defined($conf)) {
     foreach my $key (keys (%$conf)) {
       if (ref($conf->{$key}) ne 'CODE' and $key ne 'values') {
@@ -445,7 +446,6 @@
     return undef if (!defined($text));
 
     $self = parser() if (!defined($self));
-    wipe_errors ();
     parse_text($text);
     my $tree = build_texinfo_tree ();
     my $INDEX_NAMES = build_index_data ();
@@ -485,8 +485,10 @@
 sub indices_information($)
 {
   my $self = shift;
-  my $INDEX_NAMES = build_index_data ();
-  $self->{'index_names'} = $INDEX_NAMES;
+  if (!$self->{'index_names'}) {
+    my $INDEX_NAMES = build_index_data ();
+    $self->{'index_names'} = $INDEX_NAMES;
+  }
   #for my $index (keys %$INDEX_NAMES) {
   #  if ($INDEX_NAMES->{$index}->{'merged_in'}) {
   #    $self->{'merged_indices'}-> {$index}

Modified: trunk/parsetexi/api.c
===================================================================
--- trunk/parsetexi/api.c       2015-12-12 13:45:13 UTC (rev 6852)
+++ trunk/parsetexi/api.c       2015-12-12 19:33:50 UTC (rev 6853)
@@ -36,14 +36,22 @@
 
 ELEMENT *Root;
 
+static void
+reset_parser ()
+{
+  wipe_user_commands ();
+  init_index_commands ();
+  wipe_errors ();
+  reset_context_stack ();
+  current_node = current_section = 0;
+}
+
 /* Set ROOT to root of tree obtained by parsing FILENAME. */
 void
 parse_file (char *filename)
 {
   debug_output = 0;
-  init_index_commands ();
-  wipe_errors ();
-  reset_context_stack ();
+  reset_parser ();
   parse_texi_file (filename);
 }
 
@@ -53,15 +61,6 @@
   return Root;
 }
 
-static void
-reset_parser ()
-{
-  init_index_commands ();
-  wipe_errors ();
-  reset_context_stack ();
-  current_node = current_section = 0;
-}
-
 /* Set ROOT to root of tree obtained by parsing the Texinfo code in STRING.
    Used for parse_texi_line. */
 void
@@ -236,7 +235,6 @@
       || (command_data(e->cmd).flags & CF_accent)
       || (command_data(e->cmd).flags & CF_brace
           && (command_data(e->cmd).data > 0       // 4838
-              || command_data(e->cmd).data == BRACE_style
               || command_data(e->cmd).data == BRACE_context))
       || e->cmd == CM_node) // FIXME special case
     {

Modified: trunk/parsetexi/close.c
===================================================================
--- trunk/parsetexi/close.c     2015-12-12 13:45:13 UTC (rev 6852)
+++ trunk/parsetexi/close.c     2015-12-12 19:33:50 UTC (rev 6853)
@@ -227,8 +227,8 @@
                 }
 
               if (empty_format)
-                line_warn ("@%s has text but no @item",
-                           command_name(current->cmd));
+                command_warn (current, "@%s has text but no @item",
+                              command_name(current->cmd));
             }
         }
 

Modified: trunk/parsetexi/commands.c
===================================================================
--- trunk/parsetexi/commands.c  2015-12-12 13:45:13 UTC (rev 6852)
+++ trunk/parsetexi/commands.c  2015-12-12 19:33:50 UTC (rev 6853)
@@ -84,6 +84,12 @@
   return ((enum command_id) user_defined_number++) | USER_COMMAND_BIT;
 }
 
+void
+wipe_user_commands (void)
+{
+  user_defined_number = 0;
+}
+
 /* Common.pm:841. */
 /* Commands that terminate a paragraph. */
 /* We may replace this function with a macro, or represent this infomation in

Modified: trunk/parsetexi/commands.h
===================================================================
--- trunk/parsetexi/commands.h  2015-12-12 13:45:13 UTC (rev 6852)
+++ trunk/parsetexi/commands.h  2015-12-12 19:33:50 UTC (rev 6853)
@@ -37,6 +37,7 @@
 #define command_name(cmd) (command_data(cmd).cmdname)
 
 enum command_id add_texinfo_command (char *name);
+void wipe_user_commands (void);
 
 /* In indices.c */
 void init_index_commands (void);

Modified: trunk/parsetexi/indices.c
===================================================================
--- trunk/parsetexi/indices.c   2015-12-12 13:45:13 UTC (rev 6852)
+++ trunk/parsetexi/indices.c   2015-12-12 19:33:50 UTC (rev 6853)
@@ -185,6 +185,7 @@
 #undef X
 
   number_of_indices = 0;
+  num_index_commands = 0;
 
   for (p = default_indices; p->name; p++)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]