texinfo-commits
[Top][All Lists]
Advanced

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

[8138] parsetexi update


From: gavinsmith0123
Subject: [8138] parsetexi update
Date: Sat, 1 Sep 2018 10:26:20 -0400 (EDT)

Revision: 8138
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8138
Author:   gavin
Date:     2018-09-01 10:26:20 -0400 (Sat, 01 Sep 2018)
Log Message:
-----------
parsetexi update

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

Modified: trunk/tp/Texinfo/XS/parsetexi/def.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/def.c 2018-09-01 14:07:32 UTC (rev 8137)
+++ trunk/tp/Texinfo/XS/parsetexi/def.c 2018-09-01 14:26:20 UTC (rev 8138)
@@ -74,11 +74,12 @@
       if (*i == current->contents.number)
         return 0;
       if (current->contents.list[*i]->type != ET_spaces
-          && current->contents.list[*i]->type != ET_spaces_inserted)
+          && current->contents.list[*i]->type != ET_spaces_inserted
+          && current->contents.list[*i]->type != ET_empty_spaces_after_command)
         break;
       (*i)++;
     }
-  return current->contents.list[(*i)];
+  return current->contents.list[(*i)++];
 }
 
 typedef struct {
@@ -117,6 +118,8 @@
       int len;
       if (e->text.end == 0)
         continue;
+      if (e->type == ET_empty_spaces_after_command)
+        continue;
       p = e->text.text;
 
       len = strspn (p, whitespace_chars);
@@ -125,24 +128,29 @@
           new = new_element (ET_spaces);
           text_append_n (&new->text, p, len);
           insert_into_contents (current, new, i++);
+          add_extra_string_dup (new, "def_role", "spaces");
           p += len;
         }
 
       while (1)
         {
-          len = strspn (p, whitespace_chars);
-          new = new_element (ET_spaces);
+          len = strcspn (p, whitespace_chars);
+          new = new_element (ET_NONE);
           text_append_n (&new->text, p, len);
           insert_into_contents (current, new, i++);
           if (!*(p += len))
             break;
 
-          len = strcspn (p, whitespace_chars);
-          new = new_element (ET_NONE);
+          len = strspn (p, whitespace_chars);
+          new = new_element (ET_spaces);
           text_append_n (&new->text, p, len);
           insert_into_contents (current, new, i++);
+          add_extra_string_dup (new, "def_role", "spaces");
           if (!*(p += len))
-            break;
+            {
+              new->type = ET_spaces_at_end;
+              break;
+            }
         }
       destroy_element (remove_from_contents (current, i--));
     }




reply via email to

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