texinfo-commits
[Top][All Lists]
Advanced

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

[7115] parsetexi update


From: Gavin D. Smith
Subject: [7115] parsetexi update
Date: Sun, 10 Apr 2016 17:18:55 +0000

Revision: 7115
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7115
Author:   gavin
Date:     2016-04-10 17:18:54 +0000 (Sun, 10 Apr 2016)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/tp/parsetexi/close.c
    trunk/tp/parsetexi/def.c
    trunk/tp/parsetexi/def.h
    trunk/tp/parsetexi/end_line.c
    trunk/tp/parsetexi/handle_commands.c

Modified: trunk/tp/parsetexi/close.c
===================================================================
--- trunk/tp/parsetexi/close.c  2016-04-10 09:43:31 UTC (rev 7114)
+++ trunk/tp/parsetexi/close.c  2016-04-10 17:18:54 UTC (rev 7115)
@@ -137,7 +137,7 @@
      container. */
   if (command_data(current->cmd).flags & CF_def)
     {
-      gather_def_item (current);
+      gather_def_item (current, 0);
     }
 
   if (current->cmd == CM_table

Modified: trunk/tp/parsetexi/def.c
===================================================================
--- trunk/tp/parsetexi/def.c    2016-04-10 09:43:31 UTC (rev 7114)
+++ trunk/tp/parsetexi/def.c    2016-04-10 17:18:54 UTC (rev 7115)
@@ -21,14 +21,16 @@
 
 // 1471
 void
-gather_def_item (ELEMENT *current /* , enum command_id next_command */ )
+gather_def_item (ELEMENT *current, enum command_id next_command)
 {
   enum element_type type;
   ELEMENT *def_item;
   int contents_count, i;
 
-  // TODO: ET_inter_def_item.
-  type = ET_def_item;
+  if (next_command)
+    type = ET_inter_def_item; /* Between @def*x and @def*. */
+  else
+    type = ET_def_item;
 
   if (!current->cmd)
     return;
@@ -73,8 +75,7 @@
 /* Used for definition line parsing.  Return next unit on the line after
    a definition command like @deffn.  The contents of E is what is remaining
    in the argument line.  *SPACES_OUT is set to an element with spaces before 
-   the line.  Both of the elements that are output have their `parent' field
-   nulled (because the parent element is eventually destroyed). */
+   the line. */
 static ELEMENT *
 next_bracketed_or_word (ELEMENT *e, ELEMENT **spaces_out)
 {
@@ -125,17 +126,16 @@
       // isolate_last_space (bracketed, ET_empty_space_at_end_def_bracketed);
 
       /* TODO: Why do we need the parent ? */
-      //returned->parent = bracketed->parent;
+      returned->parent = bracketed->parent;
       returned->contents = bracketed->contents;
       returned->parent_type = route_not_in_tree;
-      returned->parent = 0;
 
       return returned;
     }
   else if (e->contents.list[0]->cmd != CM_NONE) // 2363
     {
       ret = remove_from_contents (e, 0);
-      ret->parent = 0;
+      //ret->parent = 0;
       return ret;
     }
   else
@@ -154,7 +154,7 @@
           text_append_n (&spaces->text, text, space_len);
           text += space_len;
           *spaces_out = spaces;
-          (*spaces_out)->parent = 0;
+          //(*spaces_out)->parent = 0;
         }
       arg_len = strcspn (text, whitespace_chars);
       text_append_n (&returned->text, text, arg_len);
@@ -166,7 +166,7 @@
         shallow_destroy_element (remove_from_contents (e, 0));
 
       returned->parent_type = route_not_in_tree;
-      returned->parent = 0;
+      //returned->parent = 0;
       return returned;
     }
 }

Modified: trunk/tp/parsetexi/def.h
===================================================================
--- trunk/tp/parsetexi/def.h    2016-04-10 09:43:31 UTC (rev 7114)
+++ trunk/tp/parsetexi/def.h    2016-04-10 17:18:54 UTC (rev 7115)
@@ -1,2 +1,2 @@
-void gather_def_item (ELEMENT *current /* , enum command_id next_command */ );
+void gather_def_item (ELEMENT *current, enum command_id next_command);
 DEF_ARGS_EXTRA *parse_def (enum command_id command, ELEMENT_LIST contents);

Modified: trunk/tp/parsetexi/end_line.c
===================================================================
--- trunk/tp/parsetexi/end_line.c       2016-04-10 09:43:31 UTC (rev 7114)
+++ trunk/tp/parsetexi/end_line.c       2016-04-10 17:18:54 UTC (rev 7115)
@@ -1224,6 +1224,7 @@
 
               add_extra_string (current, "input_encoding_name",
                                 text); // 3199
+              add_extra_string (current, "input_perl_encoding", text);
 
               global_info.input_encoding_name = text; // 3210
 
@@ -1672,7 +1673,7 @@
       if (pop_context () != ct_def)
         abort ();
 
-      k = lookup_extra_key (current->parent, "def_command");
+      k = lookup_extra_key (current->parent, "original_def_cmdname");
       if (k)
         original_def_command = lookup_command ((char *) k->value);
       else

Modified: trunk/tp/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/parsetexi/handle_commands.c        2016-04-10 09:43:31 UTC (rev 
7114)
+++ trunk/tp/parsetexi/handle_commands.c        2016-04-10 17:18:54 UTC (rev 
7115)
@@ -416,8 +416,11 @@
               misc->type = ET_def_line; // 4553
               if (current->cmd == base_command)
                 {
-                  // Does this gather an "inter_def_item" ?
-                  // gather_def_item (current, cmd);
+                  ELEMENT *e = pop_element_from_contents (current);
+                  /* e should be the same as misc */
+                  /* Gather an "inter_def_item" element. */
+                  gather_def_item (current, cmd);
+                  add_to_element_contents (current, e);
                 }
               else
                 {




reply via email to

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