texinfo-commits
[Top][All Lists]
Advanced

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

[6826] parsetexi update


From: Gavin D. Smith
Subject: [6826] parsetexi update
Date: Wed, 02 Dec 2015 15:27:15 +0000

Revision: 6826
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6826
Author:   gavin
Date:     2015-12-02 15:27:14 +0000 (Wed, 02 Dec 2015)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/parsetexi/api.c
    trunk/parsetexi/close.c
    trunk/parsetexi/end_line.c
    trunk/parsetexi/handle_commands.c
    trunk/parsetexi/indices.c

Modified: trunk/parsetexi/api.c
===================================================================
--- trunk/parsetexi/api.c       2015-12-02 14:41:57 UTC (rev 6825)
+++ trunk/parsetexi/api.c       2015-12-02 15:27:14 UTC (rev 6826)
@@ -541,7 +541,7 @@
     }
 
   STORE("name", newSVpv (i->name, 0));
-  STORE("in_code", newSVpv ("0", 1));
+  STORE("in_code", newSVpv (i->in_code ? "1" : "0", 1));
 
   /* e.g. 'prefix' => ['k', 'ky'] */
   prefix_array = newAV ();
@@ -605,7 +605,7 @@
              newSVpv (command_name(e->index_type_command), 0));
       STORE2("command",
              newRV_inc ((SV *)e->command->hv));
-      STORE2("number", newSViv (j));
+      STORE2("number", newSViv (j + 1));
       if (e->content)
         {
           SV **contents_array;
@@ -620,6 +620,10 @@
 
           /* Copy the reference to the array. */
           STORE2("content", newRV_inc ((SV *)(AV *)SvRV(*contents_array)));
+
+          /* FIXME: Allow to be different. */
+          STORE2("content_normalized",
+                 newRV_inc ((SV *)(AV *)SvRV(*contents_array)));
         }
       if (e->node)
         STORE2("node", newRV_inc ((SV *)e->node->hv));

Modified: trunk/parsetexi/close.c
===================================================================
--- trunk/parsetexi/close.c     2015-12-02 14:41:57 UTC (rev 6825)
+++ trunk/parsetexi/close.c     2015-12-02 15:27:14 UTC (rev 6826)
@@ -75,10 +75,6 @@
 
       if (counter_value (&count_cells, current) != -1)
         counter_pop (&count_cells);
-      /* TODO
-      if (counter_value (&max_columns, current) != -1)
-        counter_pop (&count_cells);
-      */
     }
   else if (current->cmd == CM_itemize || current->cmd == CM_enumerate)
     {

Modified: trunk/parsetexi/end_line.c
===================================================================
--- trunk/parsetexi/end_line.c  2015-12-02 14:41:57 UTC (rev 6825)
+++ trunk/parsetexi/end_line.c  2015-12-02 15:27:14 UTC (rev 6826)
@@ -827,9 +827,11 @@
             }
         }
 
-      //add_extra_number (current->parent, "max_columns",
-            //prototypes->contents.number);
-
+      {
+      char *s; /* FIXME: could just use prototypes instead */
+      asprintf (&s, "%d", prototypes->contents.number);
+      add_extra_string (current->parent, "max_columns", s);
+      }
       add_extra_key_contents (current->parent, "prototypes", prototypes);
     }
   else
@@ -1274,10 +1276,13 @@
 
           current = current->parent;
 
-          if (misc_args = lookup_extra_key (misc_cmd, "misc_args"))
+          if ((misc_args = lookup_extra_key (misc_cmd, "misc_args")))
             {
+              char *s;
               add_extra_key_misc_args (current, "columnfractions", 
                                        misc_args->value);
+              asprintf (&s, "%d", misc_args->value->contents.number);
+              add_extra_string (current, "max_columns", s);
             }
 
           before_item = new_element (ET_before_item);

Modified: trunk/parsetexi/handle_commands.c
===================================================================
--- trunk/parsetexi/handle_commands.c   2015-12-02 14:41:57 UTC (rev 6825)
+++ trunk/parsetexi/handle_commands.c   2015-12-02 15:27:14 UTC (rev 6826)
@@ -285,9 +285,12 @@
                       debug ("ROW");
                       row = new_element (ET_row);
                       add_to_element_contents (parent, row);
-                      /* The Perl code sets the "row_number" extra value,
-                         although it doesn't look it is used anywhere. */
 
+                      /* FIXME:The "row_number" extra value,
+                         isn't actually used anywhere. */
+                      asprintf (&s, "%d", parent->contents.number-1);
+                      add_extra_string (row, "row_number", s);
+
                       misc = new_element (ET_NONE);
                       misc->cmd = cmd;
                       add_to_element_contents (row, misc);

Modified: trunk/parsetexi/indices.c
===================================================================
--- trunk/parsetexi/indices.c   2015-12-02 14:41:57 UTC (rev 6825)
+++ trunk/parsetexi/indices.c   2015-12-02 15:27:14 UTC (rev 6826)
@@ -225,7 +225,10 @@
    INDEX_AT_COMMAND is the Texinfo @-command defining the index entry.
    CONTENT is an element whose contents represent the text of the
    index entry.  CURRENT is the element in the main body of the manual that
-   the index entry refers to. */
+   the index entry refers to.
+
+   CONTENT_NORMALIZED would be "the index entry content, independent
+   of the current language." */
 void
 enter_index_entry (enum command_id index_type_command,
                    enum command_id index_at_command,




reply via email to

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