texinfo-commits
[Top][All Lists]
Advanced

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

[8424] parsetexi comments


From: gavinsmith0123
Subject: [8424] parsetexi comments
Date: Sat, 27 Oct 2018 08:26:31 -0400 (EDT)

Revision: 8424
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8424
Author:   gavin
Date:     2018-10-27 08:26:31 -0400 (Sat, 27 Oct 2018)
Log Message:
-----------
parsetexi comments

Modified Paths:
--------------
    trunk/tp/Texinfo/XS/parsetexi/api.c
    trunk/tp/Texinfo/XS/parsetexi/end_line.c

Modified: trunk/tp/Texinfo/XS/parsetexi/api.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/api.c 2018-10-27 10:21:55 UTC (rev 8423)
+++ trunk/tp/Texinfo/XS/parsetexi/api.c 2018-10-27 12:26:31 UTC (rev 8424)
@@ -204,7 +204,7 @@
       e->hv = newHV ();
     }
 
-  if (e->parent) // && e->parent_type != route_not_in_tree)
+  if (e->parent)
     {
       if (!e->parent->hv)
         e->parent->hv = newHV ();
@@ -211,12 +211,6 @@
       sv = newRV_inc ((SV *) e->parent->hv);
       hv_store (e->hv, "parent", strlen ("parent"), sv, 0);
     }
-  /* This assumes we don't have nested out-of-tree subtrees,
-     i.e. the only out-of-tree elements are simple text elements
-     (or other elements with no children) - otherwise we shall fail
-     to set "parent" properly. */
-  /* FIXME: Sometimes extra values have parent set - try to remove this
-     in the Perl code as well. */
 
   if (e->type)
     {
@@ -232,7 +226,9 @@
       /* TODO: Same optimizations as for 'type'. */
     }
 
-  /* TODO sort out all these special cases */
+  /* TODO sort out all these special cases.
+     Makes no sense to have 'contents' created for glyph commands like
+     @arrow{} or for accent commands. */
   if (e->contents.number > 0
       || e->type == ET_text_root
       || e->type == ET_root_line
@@ -263,9 +259,7 @@
               || command_data(e->cmd).data == BRACE_other
               || command_data(e->cmd).data == BRACE_accent
               ))
-      || e->cmd == CM_node) // TODO special case
-    // TODO: Makes no sense to have 'contents' created for glyph commands like
-    // @arrow{} or for accent commands.
+      || e->cmd == CM_node)
     {
       AV *av;
       int i;
@@ -670,15 +664,14 @@
 
       if (i->contained_hv)
         {
+          /* This is unlikely to happen, as if this index is merged into
+             another one, any indices merged into this index would have been
+             recorded under that one, and not this one. */
           hv_delete (i->hv,
                      "contained_indices", strlen ("contained_indices"),
                      G_DISCARD);
           i->contained_hv = 0;
         }
-
-      /* See also code in end_line.c (parse_line_command_args) <CM_synindex>.
-         FIXME: Do we need to keep the original values of contained_indices?
-         I don't think so. */
     }
   else
     {
@@ -745,7 +738,6 @@
               /* 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)));
             }
@@ -755,6 +747,9 @@
               STORE2("content_normalized", newRV_inc ((SV *)newAV ()));
             }
         }
+      else
+        ; /* will be set in Texinfo::Common::complete_indices */
+
       if (e->node)
         STORE2("node", newRV_inc ((SV *)e->node->hv));
       if (e->sortas)

Modified: trunk/tp/Texinfo/XS/parsetexi/end_line.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/end_line.c    2018-10-27 10:21:55 UTC (rev 
8423)
+++ trunk/tp/Texinfo/XS/parsetexi/end_line.c    2018-10-27 12:26:31 UTC (rev 
8424)
@@ -569,6 +569,9 @@
                 from_index->in_code = (cmd == CM_syncodeindex);
                 ADD_ARG(from);
                 ADD_ARG(to);
+                /* Note that 'current_to' may not end up as the index
+                   'from_index' merges into if there are further @synindex 
+                   commands. */
               }
             else
               line_warn ("@%s leads to a merging of %s in itself, ignoring",




reply via email to

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