[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6130] parsetexi misc fixes
From: |
Gavin D. Smith |
Subject: |
[6130] parsetexi misc fixes |
Date: |
Sun, 15 Feb 2015 23:57:39 +0000 |
Revision: 6130
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6130
Author: gavin
Date: 2015-02-15 23:57:38 +0000 (Sun, 15 Feb 2015)
Log Message:
-----------
parsetexi misc fixes
Modified Paths:
--------------
trunk/parsetexi/TODO
trunk/parsetexi/api.h
trunk/parsetexi/dump_perl.c
trunk/parsetexi/end_line.c
trunk/parsetexi/errors.c
trunk/parsetexi/parser.c
trunk/parsetexi/tree.c
Modified: trunk/parsetexi/TODO
===================================================================
--- trunk/parsetexi/TODO 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/TODO 2015-02-15 23:57:38 UTC (rev 6130)
@@ -1,11 +1,16 @@
-* Implement code passing error messages and warnings to the Perl code.
* @set/@value
-* @verb
* Counters for e.g. numbers of arguments read so far for a brace
command, or the row in a table.
* check valid nestings
* Implement parser options
* Character encoding issues - read and pass to Perl correctly.
+* gnulib integration for strrchr, strchrnul, asprintf, etc. Eliminate
+ #define _GNU_SOURCE.
+* gettext integration
+* figure out what to do with parse_texi_line, etc. Integration with the
+test suites.
+* find where "strlen" and "text_append" are used and try to remove them, for
+efficiency. Also newSVpv (..., 0);
Integration with rest of Perl code:
Modified: trunk/parsetexi/api.h
===================================================================
--- trunk/parsetexi/api.h 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/api.h 2015-02-15 23:57:38 UTC (rev 6130)
@@ -1,3 +1,4 @@
+/* In api.c */
extern ELEMENT *Root;
void parse_file (char *filename);
Modified: trunk/parsetexi/dump_perl.c
===================================================================
--- trunk/parsetexi/dump_perl.c 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/dump_perl.c 2015-02-15 23:57:38 UTC (rev 6130)
@@ -343,6 +343,9 @@
}
else
{
+ if (e->extra[i].type != extra_element)
+ abort ();
+
text_append_n (text, "'", 1);
text_append (text, e->extra[i].key);
text_append (text, "' => {},\n");
Modified: trunk/parsetexi/end_line.c
===================================================================
--- trunk/parsetexi/end_line.c 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/end_line.c 2015-02-15 23:57:38 UTC (rev 6130)
@@ -513,7 +513,7 @@
first->text.text = malloc (first->text.space);
memcpy (first->text.text,
trimmed->contents.list[0]->text.text + 1,
- trimmed->contents.list[0]->text.end - 1);
+ trimmed->contents.list[0]->text.end);
first->text.end--;
trimmed->contents.list[0] = first;
}
@@ -536,7 +536,7 @@
}
else /* ')' in text - possible end of filename component */
{
- /* Split the element in two, putting the part before the "("
+ /* Split the element in two, putting the part before the ")"
in the manual name, leaving the part afterwards for the
node name. */
ELEMENT *before, *after;
@@ -572,6 +572,11 @@
result->node_content = trimmed;
result->normalized = convert_to_normalized (trimmed);
}
+ else
+ {
+ result->node_content = 0;
+ result->normalized = "";
+ }
return result;
}
Modified: trunk/parsetexi/errors.c
===================================================================
--- trunk/parsetexi/errors.c 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/errors.c 2015-02-15 23:57:38 UTC (rev 6130)
@@ -14,8 +14,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#define _GNU_SOURCE
#include <stdlib.h>
#include <stdarg.h>
+#include <stdio.h>
#include "tree_types.h"
#include "input.h"
Modified: trunk/parsetexi/parser.c
===================================================================
--- trunk/parsetexi/parser.c 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/parser.c 2015-02-15 23:57:38 UTC (rev 6130)
@@ -468,6 +468,7 @@
text + text_len - trailing_spaces,
trailing_spaces);
text[text_len - trailing_spaces] = '\0';
+ indexed_elt->text.end -= trailing_spaces;
if (index == -1)
add_to_element_contents (current, new_spaces);
Modified: trunk/parsetexi/tree.c
===================================================================
--- trunk/parsetexi/tree.c 2015-02-15 10:47:40 UTC (rev 6129)
+++ trunk/parsetexi/tree.c 2015-02-15 23:57:38 UTC (rev 6130)
@@ -61,7 +61,7 @@
if (list->number + 1 >= list->space)
{
list->space += 10;
- list->list = realloc (list->list, list->space * sizeof (ELEMENT));
+ list->list = realloc (list->list, list->space * sizeof (ELEMENT *));
if (!list->list)
abort (); /* Out of memory. */
}
@@ -112,7 +112,7 @@
abort ();
memmove (&list->list[where + 1], &list->list[where],
- (list->number - where) * sizeof (ELEMENT));
+ (list->number - where) * sizeof (ELEMENT *));
list->list[where] = e;
e->parent = parent;
list->number++;
@@ -132,7 +132,7 @@
removed = list->list[where];
memmove (&list->list[where], &list->list[where + 1],
- (list->number - (where+1)) * sizeof (ELEMENT));
+ (list->number - (where+1)) * sizeof (ELEMENT *));
list->number--;
return removed;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6130] parsetexi misc fixes,
Gavin D. Smith <=