texinfo-commits
[Top][All Lists]
Advanced

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

[8158] parsetexi update


From: gavinsmith0123
Subject: [8158] parsetexi update
Date: Sat, 8 Sep 2018 11:59:04 -0400 (EDT)

Revision: 8158
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8158
Author:   gavin
Date:     2018-09-08 11:59:04 -0400 (Sat, 08 Sep 2018)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/tp/Texinfo/XS/parsetexi/close.c
    trunk/tp/Texinfo/XS/parsetexi/convert.c
    trunk/tp/Texinfo/XS/parsetexi/end_line.c
    trunk/tp/Texinfo/XS/parsetexi/extra.c
    trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
    trunk/tp/Texinfo/XS/parsetexi/indices.c
    trunk/tp/Texinfo/XS/parsetexi/parser.c
    trunk/tp/Texinfo/XS/parsetexi/parser.h
    trunk/tp/Texinfo/XS/parsetexi/separator.c

Modified: trunk/tp/Texinfo/XS/parsetexi/close.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/close.c       2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/close.c       2018-09-08 15:59:04 UTC (rev 
8158)
@@ -31,7 +31,7 @@
 
   if (current->cmd != CM_verb)
     goto yes;
-  k = lookup_extra_key (current, "delimiter");
+  k = lookup_extra (current, "delimiter");
   if (!k || !*(char *)k->value)
     goto yes;
   if (0)
@@ -185,7 +185,7 @@
       // 1585
       /* Reparent @end from a ET_before_item to the block command */
       {
-      KEY_PAIR *k = lookup_extra_key (current, "end_command");
+      KEY_PAIR *k = lookup_extra (current, "end_command");
       ELEMENT *e = k ? k->value : 0;
       if (k && last_contents_child (before_item)
           && last_contents_child (before_item) == e)

Modified: trunk/tp/Texinfo/XS/parsetexi/convert.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/convert.c     2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/convert.c     2018-09-08 15:59:04 UTC (rev 
8158)
@@ -73,7 +73,7 @@
     {
       KEY_PAIR *k;
       char *s = 0;
-      k = lookup_extra_key (e, "arg_line");
+      k = lookup_extra (e, "arg_line");
       if (k)
         s = (char *)k->value;
       if (s)
@@ -98,7 +98,7 @@
 
       if (e->cmd == CM_verb)
         {
-          k = lookup_extra_key (e, "delimiter");
+          k = lookup_extra (e, "delimiter");
           ADD((char *)k->value);
         }
 
@@ -111,11 +111,11 @@
                 ADD(",");
               arg_nr++;
             }
-          k = lookup_extra_key (e->args.list[i], "spaces_before_argument");
+          k = lookup_extra (e->args.list[i], "spaces_before_argument");
           if (k)
             ADD((char *)k->value);
           convert_to_texinfo_internal (e->args.list[i], result);
-          k = lookup_extra_key (e->args.list[i], "spaces_after_argument");
+          k = lookup_extra (e->args.list[i], "spaces_after_argument");
           if (k)
             ADD((char *)k->value);
         }
@@ -122,7 +122,7 @@
 
       if (e->cmd == CM_verb)
         {
-          k = lookup_extra_key (e, "delimiter");
+          k = lookup_extra (e, "delimiter");
           ADD((char *)k->value);
         }
 
@@ -153,7 +153,7 @@
         {
           KEY_PAIR *k;
           ADD("{");
-          k = lookup_extra_key (e, "spaces_before_argument");
+          k = lookup_extra (e, "spaces_before_argument");
           if (k)
             ADD((char *)k->value);
         }

Modified: trunk/tp/Texinfo/XS/parsetexi/end_line.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/end_line.c    2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/end_line.c    2018-09-08 15:59:04 UTC (rev 
8158)
@@ -1157,7 +1157,7 @@
               free (float_label);
             }
           parse_float_type (f);
-          k = lookup_extra_key (f, "type");
+          k = lookup_extra (f, "type");
           if (k)
             {
               eft = (EXTRA_FLOAT_TYPE *) k->value;
@@ -1198,7 +1198,7 @@
           char *spec = "1";
           KEY_PAIR *k;
 
-          k = lookup_extra_key (current, "block_command_line_contents");
+          k = lookup_extra (current, "block_command_line_contents");
           if (k)
             {
               ELEMENT *e = k->value;
@@ -1229,7 +1229,7 @@
       else if (item_line_command (current->cmd)) // 3002
         {
           KEY_PAIR *k;
-          k = lookup_extra_key (current, "command_as_argument");
+          k = lookup_extra (current, "command_as_argument");
           if (!k)
             command_error (current,
                            "%s requires an argument: the formatter for @item",
@@ -1258,7 +1258,7 @@
       if (current->cmd == CM_itemize) // 3019
         {
           KEY_PAIR *k;
-          k = lookup_extra_key (current, "command_as_argument");
+          k = lookup_extra (current, "command_as_argument");
           if (k)
             {
               int i;
@@ -1293,7 +1293,7 @@
       // 3040 Check if command_as_argument isn't an accent command
       if (current->cmd == CM_itemize || item_line_command(current->cmd))
         {
-          KEY_PAIR *k = lookup_extra_key (current, "command_as_argument");
+          KEY_PAIR *k = lookup_extra (current, "command_as_argument");
           if (k && k->value)
             {
               enum command_id cmd = k->value->cmd;
@@ -1306,7 +1306,7 @@
                   k->key = "";
                   k->value = 0;
                   k->type = extra_deleted;
-                  k = lookup_extra_key (current,
+                  k = lookup_extra (current,
                                         "block_command_line_contents");
                   if (k)
                     {
@@ -1319,7 +1319,7 @@
       /* 3052 - if no command_as_argument given, default to @bullet for
          @itemize, and @asis for @table. */
       if (current->cmd == CM_itemize
-        && !lookup_extra_key (current, "block_command_line_contents"))
+        && !lookup_extra (current, "block_command_line_contents"))
         {
           ELEMENT *e, *contents, *contents2;
 
@@ -1338,7 +1338,7 @@
                                         contents);
         }
       else if (item_line_command (current->cmd)
-          && !lookup_extra_key (current, "command_as_argument"))
+          && !lookup_extra (current, "command_as_argument"))
         { // 3064
           ELEMENT *e, *contents, *contents2;
 
@@ -1951,7 +1951,7 @@
 
           current = current->parent;
 
-          if ((misc_args = lookup_extra_key (misc_cmd, "misc_args")))
+          if ((misc_args = lookup_extra (misc_cmd, "misc_args")))
             {
               char *s;
               add_extra_misc_args (current, "columnfractions", 
@@ -1982,7 +1982,7 @@
         {
           if (current_node)
             {
-              if (!lookup_extra_key (current_node, "associated_section"))
+              if (!lookup_extra (current_node, "associated_section"))
                 {
                   add_extra_element
                     (current_node, "associated_section", current);
@@ -2011,7 +2011,7 @@
         {
           current_part = current;
           if (current_node
-              && !lookup_extra_key (current_node, "associated_section"))
+              && !lookup_extra (current_node, "associated_section"))
             {
               line_warn ("@node precedes @part, but parts may not be "
                          "associated with nodes");
@@ -2231,7 +2231,7 @@
       if (pop_context () != ct_def)
         abort ();
 
-      k = lookup_extra_key (current->parent, "original_def_cmdname");
+      k = lookup_extra (current->parent, "original_def_cmdname");
       if (k)
         original_def_command = lookup_command ((char *) k->value);
       else

Modified: trunk/tp/Texinfo/XS/parsetexi/extra.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/extra.c       2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/extra.c       2018-09-08 15:59:04 UTC (rev 
8158)
@@ -142,7 +142,7 @@
 }
 
 KEY_PAIR *
-lookup_extra_key (ELEMENT *e, char *key)
+lookup_extra (ELEMENT *e, char *key)
 {
   int i;
   for (i = 0; i < e->extra_number; i++)

Modified: trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/handle_commands.c     2018-09-02 12:08:04 UTC 
(rev 8157)
+++ trunk/tp/Texinfo/XS/parsetexi/handle_commands.c     2018-09-08 15:59:04 UTC 
(rev 8158)
@@ -526,12 +526,12 @@
                   int max_columns = 0;
                   KEY_PAIR *prototypes;
 
-                  prototypes = lookup_extra_key  (parent, "prototypes");
+                  prototypes = lookup_extra  (parent, "prototypes");
                   if (prototypes)
                     max_columns = prototypes->value->contents.number;
                   else
                     {
-                      prototypes = lookup_extra_key(parent, "columnfractions");
+                      prototypes = lookup_extra(parent, "columnfractions");
                       if (prototypes)
                         max_columns = prototypes->value->contents.number;
                     }
@@ -711,7 +711,7 @@
                            || parent->cmd == CM_smallquotation)
                     {
                       KEY_PAIR *k; ELEMENT *e;
-                      k = lookup_extra_key (parent, "authors");
+                      k = lookup_extra (parent, "authors");
                       if (k)
                         e = k->value;
                       else

Modified: trunk/tp/Texinfo/XS/parsetexi/indices.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/indices.c     2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/indices.c     2018-09-08 15:59:04 UTC (rev 
8158)
@@ -130,9 +130,14 @@
 wipe_index (INDEX *idx)
 {
   int i;
+  INDEX_ENTRY *ie;
   for (i = 0; i < idx->index_number; i++)
     {
+      ie = &idx->index_entries[i];
+      //destroy_element (ie->content);
       ; /* all data is referenced elsewhere */
+      // FIXME: the content is referenced for commands like @cindex
+      // in the "misc_content" array, but not for commands like @deffn.
     }
   free (idx->index_entries);
 }
@@ -286,7 +291,7 @@
   entry->command = current;
   entry->number = idx->index_number;
 
-  k = lookup_extra_key (current, "sortas");
+  k = lookup_extra (current, "sortas");
   if (k)
     {
       entry->sortas = (char *) k->value;

Modified: trunk/tp/Texinfo/XS/parsetexi/parser.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-09-08 15:59:04 UTC (rev 
8158)
@@ -428,7 +428,7 @@
       e = current;
       if (current)
         {
-          k = lookup_extra_key (current, "spaces_before_argument_elt");
+          k = lookup_extra (current, "spaces_before_argument_elt");
           if (k && k->value == last_contents_child (current))
             goto owning_element_found;
         }
@@ -436,7 +436,7 @@
       e = current->parent;
       if (current->parent)
         {
-          k = lookup_extra_key (current->parent, 
+          k = lookup_extra (current->parent, 
                                 "spaces_before_argument_elt");
           if (k && k->value == last_contents_child (current))
             goto owning_element_found;
@@ -445,7 +445,7 @@
       e = current;
       if (current)
         {
-          k = lookup_extra_key (current, "spaces_after_command");
+          k = lookup_extra (current, "spaces_after_command");
           if (k && k->value == last_contents_child (current))
             goto owning_element_found;
         }
@@ -453,7 +453,7 @@
       e = current->parent;
       if (current->parent)
         {
-          k = lookup_extra_key (current->parent, "spaces_after_command");
+          k = lookup_extra (current->parent, "spaces_after_command");
           if (k && k->value == last_contents_child (current))
             goto owning_element_found;
         }
@@ -938,7 +938,7 @@
                             name);
                         }
                     }
-                  if (!lookup_extra_key (current, "invalid_syntax"))
+                  if (!lookup_extra (current, "invalid_syntax"))
                     {
                       new_macro (name, current); // 3808
                     }
@@ -1013,7 +1013,7 @@
       char *q;
       KEY_PAIR *k;
 
-      k = lookup_extra_key (current->parent, "delimiter");
+      k = lookup_extra (current->parent, "delimiter");
 
       c = *(char *)k->value;
       if (c)
@@ -1180,7 +1180,7 @@
                   char *p; char *s;
                   KEY_PAIR *k;
                   p = line + strspn (line, whitespace_chars_except_newline);
-                  k = lookup_extra_key (current, "spaces");
+                  k = lookup_extra (current, "spaces");
                   if (!k)
                     {
                       asprintf (&s, "%.*s", (int) (p - line), line);

Modified: trunk/tp/Texinfo/XS/parsetexi/parser.h
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.h      2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.h      2018-09-08 15:59:04 UTC (rev 
8158)
@@ -114,7 +114,7 @@
 void add_extra_float_type (ELEMENT *e, char *key, EXTRA_FLOAT_TYPE *value);
 void add_extra_string (ELEMENT *e, char *key, char *value);
 void add_extra_string_dup (ELEMENT *e, char *key, char *value);
-KEY_PAIR *lookup_extra_key (ELEMENT *e, char *key);
+KEY_PAIR *lookup_extra (ELEMENT *e, char *key);
 
 /* In menus.c */
 int handle_menu (ELEMENT **current_inout, char **line_inout);

Modified: trunk/tp/Texinfo/XS/parsetexi/separator.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/separator.c   2018-09-02 12:08:04 UTC (rev 
8157)
+++ trunk/tp/Texinfo/XS/parsetexi/separator.c   2018-09-08 15:59:04 UTC (rev 
8158)
@@ -48,7 +48,7 @@
 
   /* FIXME: Could we add all the command args together, instead of one-by-one,
      to avoid having to look for the extra value every time? */
-  k = lookup_extra_key (current->parent, key);
+  k = lookup_extra (current->parent, key);
   if (k)
     value = k->value;
   else
@@ -129,7 +129,7 @@
                 float = current->parent->parent;
               if (float)
                 {
-                  if (lookup_extra_key (float, command_name(command)))
+                  if (lookup_extra (float, command_name(command)))
                     line_warn ("ignoring multiple @%s",
                                command_name(command));
                   else
@@ -649,7 +649,7 @@
 {
   KEY_PAIR *k;
 
-  k = lookup_extra_key (current, "block_command_line_contents");
+  k = lookup_extra (current, "block_command_line_contents");
   if (!k)
     return;
 
@@ -714,7 +714,7 @@
       KEY_PAIR *k;
       int expandp = 0;
       debug ("THE INLINE PART");
-      k = lookup_extra_key (current, "format");
+      k = lookup_extra (current, "format");
       if (!k)
         {
           ELEMENT *arg = 0;




reply via email to

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