[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8422] parsetexi update
From: |
gavinsmith0123 |
Subject: |
[8422] parsetexi update |
Date: |
Sat, 27 Oct 2018 06:12:29 -0400 (EDT) |
Revision: 8422
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8422
Author: gavin
Date: 2018-10-27 06:12:29 -0400 (Sat, 27 Oct 2018)
Log Message:
-----------
parsetexi update
Modified Paths:
--------------
trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
trunk/tp/Texinfo/XS/parsetexi/parser.c
Modified: trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/handle_commands.c 2018-10-27 10:01:41 UTC
(rev 8421)
+++ trunk/tp/Texinfo/XS/parsetexi/handle_commands.c 2018-10-27 10:12:29 UTC
(rev 8422)
@@ -1064,6 +1064,16 @@
e->line_nr = line_nr;
add_to_element_contents (current, e);
+
+ if (cmd == CM_sortas)
+ {
+ if (!(command_flags(current->parent) & CF_index_entry_command))
+ {
+ line_warn ("@%s should only appear in an index entry",
+ command_name(cmd));
+ }
+ }
+
current = e;
if (cmd == CM_click)
Modified: trunk/tp/Texinfo/XS/parsetexi/parser.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.c 2018-10-27 10:01:41 UTC (rev
8421)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.c 2018-10-27 10:12:29 UTC (rev
8422)
@@ -895,9 +895,11 @@
if (cmd == CM_c || cmd == CM_comment)
ok = 1;
}
- /* "full text commands" */
- else if ((outer_flags & CF_brace) && command_data(outer).data == BRACE_style
- /* "full line commands" */
+ else if (simple_text_command
+ /* "full text commands" */
+ || (outer_flags & CF_brace)
+ && command_data(outer).data == BRACE_style
+ /* "full line commands" */
|| outer == CM_center
|| outer == CM_exdent
|| outer == CM_item
@@ -908,12 +910,10 @@
// 420 "full line no refs commands"
|| (outer_flags & (CF_sectioning | CF_def))
// 4261
- || (!current->parent->cmd && current_context () == ct_def)
-
- // 409 "simple text commands"
- || simple_text_command)
+ || (!current->parent->cmd && current_context () == ct_def))
{
- // "in full text commands".
+ /* Start by checking if the command is allowed inside a "full text
+ command" - this is the most permissive. */
if (cmd_flags & CF_nobrace) // 370
ok = 1;
if (cmd_flags & CF_brace && !(cmd_flags & CF_INFOENCLOSE)) // 370
@@ -934,16 +934,8 @@
&& command_data(cmd).data == BLOCK_conditional)
ok = 1; // 384
- /* Additional commands allowed in indices only. */
- if (cmd == CM_sortas)
- {
- if (outer_flags & CF_index_entry_command)
- ok = 1;
- else
- ok = 0;
- }
-
- // 396 exceptions for "full line no refs" and "simple text"
+ /* Now add more restrictions for "full line no refs" commands and
"simple
+ text" commands. */
if (outer_flags & (CF_sectioning | CF_def)
// 4261
|| (!current->parent->cmd && current_context () == ct_def)
@@ -957,7 +949,7 @@
ok = 0;
}
- // 405 exceptions for "simple text commands" only
+ /* Exceptions for "simple text commands" only. */
if (simple_text_command)
{
if (cmd == CM_xref
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8422] parsetexi update,
gavinsmith0123 <=