texinfo-commits
[Top][All Lists]
Advanced

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

[6814] parsetexi update


From: Gavin D. Smith
Subject: [6814] parsetexi update
Date: Mon, 30 Nov 2015 12:45:20 +0000

Revision: 6814
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6814
Author:   gavin
Date:     2015-11-30 12:45:13 +0000 (Mon, 30 Nov 2015)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/parsetexi/end_line.c
    trunk/parsetexi/handle_commands.c

Modified: trunk/parsetexi/end_line.c
===================================================================
--- trunk/parsetexi/end_line.c  2015-11-29 18:40:06 UTC (rev 6813)
+++ trunk/parsetexi/end_line.c  2015-11-30 12:45:13 UTC (rev 6814)
@@ -793,7 +793,7 @@
               new->type = ET_bracketed_multitable_prototype;
               add_to_element_contents (prototypes, new);
             }
-          else if (e->text.end > 0)
+          else if (e->text.end > 0) // 2893
             {
               /* TODO: Split the text up by whitespace. */
 
@@ -806,12 +806,15 @@
                   add_to_element_contents (prototypes, new);
                 }
             }
-          else
+          else // 2913
             {
               abort (); /*TODO*/
             }
         }
 
+      //add_extra_number (current->parent, "max_columns",
+            //prototypes->contents.number);
+
       add_extra_key_contents (current->parent, "prototypes", prototypes);
     }
   else

Modified: trunk/parsetexi/handle_commands.c
===================================================================
--- trunk/parsetexi/handle_commands.c   2015-11-29 18:40:06 UTC (rev 6813)
+++ trunk/parsetexi/handle_commands.c   2015-11-30 12:45:13 UTC (rev 6814)
@@ -238,28 +238,31 @@
                 }
               else
                 { /* 4480 */
-                  /* TODO - need the max_columns value for this
-                  if (counter_value (max_columns, parent) == 0)
+                  int max_columns = 0;
+                  KEY_PAIR *prototypes;
+
+                  prototypes = lookup_extra_key  (parent, "prototypes");
+                  if (prototypes)
+                    max_columns = prototypes->value->contents.number;
+
+                  if (max_columns == 0)
                     {
                       line_warnf ("@%s in empty multitable",
                                   command_name(cmd));
                     }
-                  else */ if (cmd == CM_tab)
+                  else if (cmd == CM_tab)
                     { // 4484
                       ELEMENT *row;
-
                       row = last_contents_child (parent);
                       if (row->type == ET_before_item)
                         line_error ("@tab before @item");
-                      /* TODO 4489
+                      // 4489
                       else if (counter_value (&count_cells, parent)
-                               >= counter_value (&max_columns, parent))
+                               >= max_columns)
                         {
-                          line_error ("too many columns in multitable item"
-                                      " (max %d)",
-                                      counter_value (&max_columns, parent));
+                          line_errorf ("too many columns in multitable item"
+                                       " (max %d)", max_columns);
                         }
-                      */
                       else // 4493
                         {
                           char *s;
@@ -271,7 +274,7 @@
                           debug ("TAB");
 
                           asprintf (&s, "%d",
-                                    counter_value (&count_cells, parent));
+                                    counter_value (&count_cells, row));
                           add_extra_string (current, "cell_number", s);
                         }
                     }
@@ -294,7 +297,7 @@
                         counter_pop (&count_cells);
                       counter_push (&count_cells, row, 1);
                       asprintf (&s, "%d",
-                                counter_value (&count_cells, parent));
+                                counter_value (&count_cells, row));
                       add_extra_string (current, "cell_number", s);
                     }
                 }




reply via email to

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