[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6082] parsetexi update
From: |
Gavin D. Smith |
Subject: |
[6082] parsetexi update |
Date: |
Fri, 30 Jan 2015 20:05:05 +0000 |
Revision: 6082
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6082
Author: gavin
Date: 2015-01-30 20:05:03 +0000 (Fri, 30 Jan 2015)
Log Message:
-----------
parsetexi update
Modified Paths:
--------------
trunk/parsetexi/ChangeLog
trunk/parsetexi/Makefile.am
trunk/parsetexi/Parsetexi/lib/Parsetexi.pm
trunk/parsetexi/command_data.txt
trunk/parsetexi/command_ids.h
trunk/parsetexi/end_line.c
trunk/parsetexi/handle_commands.c
Modified: trunk/parsetexi/ChangeLog
===================================================================
--- trunk/parsetexi/ChangeLog 2015-01-30 16:27:21 UTC (rev 6081)
+++ trunk/parsetexi/ChangeLog 2015-01-30 20:05:03 UTC (rev 6082)
@@ -1,5 +1,20 @@
2015-01-24 Gavin Smith <address@hidden>
+ * end_line.c (end_line_misc_line): Set "misc_content" key as
+ intended, instead of "misc_args".
+ <sectioning commands>: Set "level" extra value.
+ * handle_commands.c (handle_misc_command): Add comment.
+
+ * command_data.txt: Add "sectioning" flag for sectioning
+ commands. Add "majorheading". Say that "@printindex" takes 1
+ argument.
+ * end_line.c (parse_line_command_args) <printindex>: Handle.
+
+ * Parsetexi/lib/Parsetexi.pm (_add_parents): Set 'level' value
+ on elements.
+
+2015-01-24 Gavin Smith <address@hidden>
+
* end_line.c (end_line_starting_block, end_line_misc_line):
Split functions out of end_line.
@@ -7,7 +22,6 @@
* dump_perl.c: In all functions, output to a TEXT object instead
of printing to standard output.
- (dump_indent): Check if 'dumping_indent' is on.
* parser.c (parse_texi_file): Return type changed.
* dump_perl.c, Parsetexi/Parsetexi.xs (dump_tree_to_string_1)
Modified: trunk/parsetexi/Makefile.am
===================================================================
--- trunk/parsetexi/Makefile.am 2015-01-30 16:27:21 UTC (rev 6081)
+++ trunk/parsetexi/Makefile.am 2015-01-30 20:05:03 UTC (rev 6082)
@@ -1,5 +1,7 @@
AUTOMAKE_OPTIONS=foreign
+SUBDIRS=. Parsetexi
+
bin_PROGRAMS=parsetexi
lib_LIBRARIES=libparsetexi.a
Modified: trunk/parsetexi/Parsetexi/lib/Parsetexi.pm
===================================================================
--- trunk/parsetexi/Parsetexi/lib/Parsetexi.pm 2015-01-30 16:27:21 UTC (rev
6081)
+++ trunk/parsetexi/Parsetexi/lib/Parsetexi.pm 2015-01-30 20:05:03 UTC (rev
6082)
@@ -156,6 +156,11 @@
_add_parents ($child);
}
}
+
+ # 'level' is set in Parser.pm, but not under 'extra'.
+ if (defined ($elt->{'extra'}) and defined $elt->{'extra'}{'level'}) {
+ $elt->{'level'} = $elt->{'extra'}{'level'};
+ }
}
# Set the 'menu_entry' extra key on each menu entry. This was the
@@ -274,7 +279,7 @@
eval $tree_stream;
print "Read tree.\n";
}
-
+
print "Adjusting tree...\n";
_add_parents ($TREE);
_complete_node_list ($self, $TREE);
Modified: trunk/parsetexi/command_data.txt
===================================================================
--- trunk/parsetexi/command_data.txt 2015-01-30 16:27:21 UTC (rev 6081)
+++ trunk/parsetexi/command_data.txt 2015-01-30 20:05:03 UTC (rev 6082)
@@ -127,7 +127,7 @@
# formatting
center misc MISC_line
-printindex misc
+printindex misc 1
listoffloats misc MISC_line
# especially in titlepage
# shorttitle
@@ -470,26 +470,27 @@
##########################################################
# Root commands - line 887
-node root,misc MISC_line
-top root,misc MISC_line
-chapter root,misc MISC_line
-unnumbered root,misc MISC_line
-chapheading misc MISC_line
-appendix root,misc MISC_line
-section root,misc MISC_line
-unnumberedsec root,misc MISC_line
-heading misc MISC_line
-appendixsec root,misc MISC_line
-subsection root,misc MISC_line
-unnumberedsubsec root,misc MISC_line
-subheading misc MISC_line
-appendixsubsec root,misc MISC_line
-subsubsection root,misc MISC_line
-unnumberedsubsubsec root,misc MISC_line
-subsubheading misc MISC_line
-appendixsubsubsec root,misc MISC_line
+node root,misc MISC_line
+top root,misc,sectioning MISC_line
+chapter root,misc,sectioning MISC_line
+unnumbered root,misc,sectioning MISC_line
+chapheading misc,sectioning MISC_line
+appendix root,misc,sectioning MISC_line
+section root,misc,sectioning MISC_line
+unnumberedsec root,misc,sectioning MISC_line
+heading misc,sectioning MISC_line
+appendixsec root,misc,sectioning MISC_line
+subsection root,misc,sectioning MISC_line
+unnumberedsubsec root,misc,sectioning MISC_line
+subheading misc,sectioning MISC_line
+appendixsubsec root,misc,sectioning MISC_line
+subsubsection root,misc,sectioning MISC_line
+unnumberedsubsubsec root,misc,sectioning MISC_line
+subsubheading misc,sectioning MISC_line
+appendixsubsubsec root,misc,sectioning MISC_line
-part root,misc MISC_line
-appendixsection root,misc MISC_line
-centerchap root,misc MISC_line
+part root,misc,sectioning MISC_line
+appendixsection root,misc,sectioning MISC_line
+majorheading misc,sectioning MISC_line
+centerchap root,misc,sectioning MISC_line
Modified: trunk/parsetexi/command_ids.h
===================================================================
--- trunk/parsetexi/command_ids.h 2015-01-30 16:27:21 UTC (rev 6081)
+++ trunk/parsetexi/command_ids.h 2015-01-30 20:05:03 UTC (rev 6082)
@@ -254,6 +254,7 @@
CM_listoffloats,
CM_lowersections,
CM_macro,
+CM_majorheading,
CM_math,
CM_menu,
CM_minus,
Modified: trunk/parsetexi/end_line.c
===================================================================
--- trunk/parsetexi/end_line.c 2015-01-30 16:27:21 UTC (rev 6081)
+++ trunk/parsetexi/end_line.c 2015-01-30 20:05:03 UTC (rev 6082)
@@ -126,7 +126,7 @@
p = q;
add_to_element_contents (line_args, new);
}
-
+ break;
}
case CM_sp:
case CM_defindex:
@@ -134,6 +134,14 @@
case CM_synindex:
case CM_syncodeindex:
case CM_printindex:
+ {
+ /* TODO: Check and interpret argument. */
+ ELEMENT *new;
+ new = new_element (ET_NONE);
+ text_append (&new->text, line);
+ add_to_element_contents (line_args, new);
+ break;
+ }
case CM_everyheadingmarks:
case CM_everyfootingmarks:
case CM_evenheadingmarks:
@@ -563,12 +571,12 @@
}
else
{
- ELEMENT *misc_args;
+ ELEMENT *misc_content;
- misc_args = trim_spaces_comment_from_content
+ misc_content = trim_spaces_comment_from_content
(last_args_child(current));
- add_extra_key_misc_args (current, "misc_args", misc_args);
+ add_extra_key_contents (current, "misc_content", misc_content);
/* All the other "line" commands" */
// 3273 - warning about missing argument
@@ -577,7 +585,7 @@
if (command_flags(current) & CF_index_entry_command)
{
/* TODO: Trim space elements from contents. Note we aren't
- using the misc_args variable yet, because we have not
+ using the misc_content variable yet, because we have not
got a way to serialize a pointer from the index information
to a detached extra key that is not part of the main tree. */
ELEMENT *contents;
@@ -588,6 +596,14 @@
contents);
current->type = ET_index_entry_command;
}
+
+ if (command_flags(current) & CF_sectioning)
+ {
+ /* TODO: Set the right level. */
+ /* Alternatively, maybe the receiving code could lookup the
+ sectioning level. */
+ add_extra_string (current, "level", "1");
+ }
}
current = current->parent; /* 3285 */
Modified: trunk/parsetexi/handle_commands.c
===================================================================
--- trunk/parsetexi/handle_commands.c 2015-01-30 16:27:21 UTC (rev 6081)
+++ trunk/parsetexi/handle_commands.c 2015-01-30 20:05:03 UTC (rev 6082)
@@ -110,6 +110,9 @@
/* @END IS SOMEWHERE IN HERE ('text') */
/* 4439 */
+ /* Special handling of @item because it can appear
+ in several contents: in an @itemize, a @table, or
+ a @multitable. */
if (cmd_id == CM_item || cmd_id == CM_itemx
|| cmd_id == CM_headitem || cmd_id == CM_tab)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6082] parsetexi update,
Gavin D. Smith <=