[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Full coverage of contain_plain_text and contain_s
From: |
Patrice Dumas |
Subject: |
branch master updated: Full coverage of contain_plain_text and contain_simple_text |
Date: |
Sat, 22 Oct 2022 03:49:38 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 6aa545f28d Full coverage of contain_plain_text and contain_simple_text
6aa545f28d is described below
commit 6aa545f28d51ca406d3073be6be9d8ebd76bee7b
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 22 09:48:20 2022 +0200
Full coverage of contain_plain_text and contain_simple_text
* tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/ParserNonXS.pm,
tp/Texinfo/XS/parsetexi/parser.c (check_valid_nesting): add explicit
contain_plain_text and contain_simple_text flags to all commands
instead of using conditionals. Use contain_plain_text instead of
contain_simple_text for LINE_text and LINE_specific.
---
ChangeLog | 10 +
tp/Texinfo/ParserNonXS.pm | 67 +---
tp/Texinfo/XS/parsetexi/command_data.txt | 211 +++++++------
tp/Texinfo/XS/parsetexi/parser.c | 42 +--
tp/t/20preformatted.t | 4 +
tp/t/results/alias/bad_line.pl | 9 +
tp/t/results/columnfractions/wrong_command.pl | 9 +
tp/t/results/coverage/command_in_end.pl | 63 ++++
.../command_in_end_expanded_raw_command_after.pl | 9 +
...mand_in_end_expanded_raw_command_empty_after.pl | 9 +
.../command_in_end_expanded_raw_in_command.pl | 9 +
..._in_end_expanded_raw_one_char_before_command.pl | 9 +
..._in_end_expanded_raw_one_char_not_in_command.pl | 9 +
..._in_end_expanded_raw_two_char_before_command.pl | 9 +
..._in_end_expanded_raw_two_char_not_in_command.pl | 9 +
.../command_in_end_ignored_raw_command_after.pl | 9 +
.../end_bad_end_argument_and_superfluous_arg.pl | 9 +
.../command_not_closed_in_documentencoding.pl | 9 +
.../misc_commands/invalid_documentencoding.pl | 18 ++
.../example_invalid_at_commands_arguments.pl | 337 +++++++++++++++++++++
20 files changed, 676 insertions(+), 184 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 678553dd00..094910f7a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-10-22 Patrice Dumas <pertusus@free.fr>
+
+ Full coverage of contain_plain_text and contain_simple_text
+
+ * tp/Texinfo/XS/parsetexi/command_data.txt, tp/Texinfo/ParserNonXS.pm,
+ tp/Texinfo/XS/parsetexi/parser.c (check_valid_nesting): add explicit
+ contain_plain_text and contain_simple_text flags to all commands
+ instead of using conditionals. Use contain_plain_text instead of
+ contain_simple_text for LINE_text and LINE_specific.
+
2022-10-21 Gavin Smith <gavinsmith0123@gmail.com>
Save and restore LC_MESSAGES
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index dcdcb40d09..203ab6d63d 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -400,7 +400,7 @@ foreach my $block_command (keys(%block_commands)) {
# if ($brace_commands{$format_raw_command}) eq 'format_raw');
}
-# commands that may appear in accents
+# commands that may appear in commands containing plain text only
my %in_plain_text_commands = %accent_commands;
foreach my $brace_command(keys(%brace_commands)) {
$in_plain_text_commands{$brace_command} = 1
@@ -419,25 +419,29 @@ $in_plain_text_commands{'comment'} = 1;
# commands that may appear in any text argument, similar constraints
# as in paragraphs.
my %in_full_text_commands;
+# start from all the brace commands
foreach my $command (keys(%brace_commands), keys(%symbol_nobrace_commands)) {
$in_full_text_commands{$command} = 1;
}
+# selected line commands
foreach my $in_full_text_command ('c', 'comment', 'refill', 'subentry',
'columnfractions', 'set', 'clear', 'end') {
$in_full_text_commands{$in_full_text_command} = 1;
}
-
-foreach my $out_format (grep {$block_commands{$_} eq 'format_raw'}
- keys(%block_commands)) {
- $in_full_text_commands{$out_format} = 1;
-}
-delete $in_full_text_commands{'caption'};
-delete $in_full_text_commands{'shortcaption'};
+# selected block commands
foreach my $block_command (keys(%block_commands)) {
$in_full_text_commands{$block_command} = 1
- if ($block_commands{$block_command} eq 'conditional');
+ if ($block_commands{$block_command} eq 'conditional'
+ or $block_commands{$block_command} eq 'format_raw');
}
+# sort out brace commmands and setup command list appearing in more
+# restricted context.
+
+# those two commands are not allowed in any command except for @float */
+delete $in_full_text_commands{'caption'};
+delete $in_full_text_commands{'shortcaption'};
+
# commands that may appear inside sectioning commands
my %in_simple_text_with_refs_commands = %in_full_text_commands;
foreach my $not_in_simple_text_with_refs_commands ('titlefont',
@@ -467,48 +471,16 @@ foreach my $in_full_text_not_in_simple_text
(keys(%in_heading_spec_commands)) {
# commands that only accept plain text, ie only accent, symbol and glyph
commands
-my %plain_text_commands;
-
-foreach my $command (keys(%accent_commands),
- keys(%contain_plain_text_commands)) {
- $plain_text_commands{$command} = 1;
-}
+my %plain_text_commands = %contain_plain_text_commands;
# commands that only accept simple text as argument in any context.
-my %simple_text_commands;
-foreach my $line_command(keys(%line_commands)) {
- if ($line_commands{$line_command} eq 'specific'
- or ($line_commands{$line_command} eq 'line'
- and !($sectioning_heading_commands{$line_command}
- or $def_commands{$line_command}
- or $heading_spec_commands{$line_command}))
- or $line_commands{$line_command} eq 'text') {
- $simple_text_commands{$line_command} = 1;
- }
-}
+my %simple_text_commands = %contain_simple_text_commands;
my %simple_text_heading_spec_commands = (%heading_spec_commands);
my %simple_text_with_refs_commands = (%sectioning_heading_commands,
%def_commands);
-delete $simple_text_commands{'center'};
-delete $simple_text_commands{'exdent'};
-
-foreach my $command (keys (%brace_commands)) {
- if ($brace_commands{$command} eq 'arguments'
- and not $contain_plain_text_commands{$command}) {
- $simple_text_commands{$command} = 1;
- }
- $simple_text_commands{$command} = 1
- if $contain_simple_text_commands{$command};
-}
-
-# %brace_commands 'context'
-foreach my $command ('shortcaption', 'math') {
- $simple_text_commands{$command} = 1;
-}
-
# commands that accept full text, but no block or top-level commands
my %full_text_commands;
foreach my $brace_command (keys (%brace_commands)) {
@@ -552,15 +524,6 @@ foreach my $command
(keys(%simple_text_with_refs_commands)) {
$default_valid_nestings{$command} = \%in_simple_text_with_refs_commands;
}
-# Only for block commands with line arguments
-foreach my $command (keys(%block_commands)) {
- if ($block_commands{$command} and $block_commands{$command} ne 'raw'
- and $block_commands{$command} ne 'conditional'
- and !$def_commands{$command}) {
- $default_valid_nestings{$command} = \%in_simple_text_commands;
- }
-}
-
# default indices
my %index_names = %Texinfo::Commands::index_names;
diff --git a/tp/Texinfo/XS/parsetexi/command_data.txt
b/tp/Texinfo/XS/parsetexi/command_data.txt
index b9226340f9..ddc82dbd2e 100644
--- a/tp/Texinfo/XS/parsetexi/command_data.txt
+++ b/tp/Texinfo/XS/parsetexi/command_data.txt
@@ -71,7 +71,7 @@ txiinternalvalue internal,brace
INTERNAL_brace
# analysed
# skipline: no argument, everything else on the line is skipped
# text: the line is parsed as texinfo, and the argument is converted
-# to simple text (in _end_line)
+# to simple text with convert_to_text allowing only a few
@-commands
# line: the line is parsed as texinfo
# specific: the line is parsed as texinfo and the result should be plain
# text maybe followed by a comment; the result is analysed
@@ -82,9 +82,8 @@ txiinternalvalue internal,brace
INTERNAL_brace
# line commands number of arguments is only set for LINE_specific commands
# and is not used anywhere in the code, it is here as documentation only
-node line LINE_line
bye line LINE_skipline
-end line LINE_text
+end line,contain_plain_text LINE_text
# set, clear, special argument
set line LINE_special
clear line LINE_special
@@ -93,56 +92,56 @@ unmacro line
LINE_special
c line LINE_lineraw
comment line LINE_lineraw
# special
-definfoenclose line,deprecated LINE_specific 3
-alias line LINE_specific 2
+definfoenclose line,contain_plain_text,deprecated LINE_specific 3
+alias line,contain_plain_text LINE_specific 2
# number of arguments is not known in advance.
-columnfractions line LINE_specific
-# file names
-setfilename line,close_paragraph,global_unique LINE_text
-verbatiminclude line,close_paragraph LINE_text
-include line LINE_text
-
-raisesections line LINE_skipline
-lowersections line LINE_skipline
-contents line,close_paragraph,global LINE_skipline
-shortcontents line,close_paragraph,global LINE_skipline
-summarycontents line,close_paragraph,global LINE_skipline
-insertcopying line,close_paragraph,global LINE_skipline
+columnfractions line,contain_plain_text LINE_specific
+# file names.
+setfilename line,close_paragraph,global_unique,contain_plain_text
LINE_text
+verbatiminclude line,close_paragraph,contain_plain_text
LINE_text
+include line,contain_plain_text
LINE_text
+
+raisesections line LINE_skipline
+lowersections line LINE_skipline
+contents line,close_paragraph,global LINE_skipline
+shortcontents line,close_paragraph,global LINE_skipline
+summarycontents line,close_paragraph,global LINE_skipline
+insertcopying line,close_paragraph,global LINE_skipline
# arg should be an @-command
-clickstyle line,global LINE_special
+clickstyle line,global LINE_special
# more relevant in preamble
-documentencoding line,global LINE_text
-novalidate line,global_unique LINE_skipline
+documentencoding line,global,contain_plain_text LINE_text
+novalidate line,global_unique LINE_skipline
# Position with regard with direntry is significant
-dircategory line,close_paragraph LINE_line
+dircategory line,close_paragraph,contain_simple_text LINE_line
# arg like 200mm,150mm or 11.5in
-pagesizes line,global_unique LINE_line
+pagesizes line,global_unique,contain_plain_text LINE_line
finalout line LINE_skipline
# arg none asis
# or a number and forbids anything else on the line
-paragraphindent line,global LINE_specific 1
+paragraphindent line,global,contain_plain_text LINE_specific 1
# arg none insert
-firstparagraphindent line,global LINE_specific 1
+firstparagraphindent line,global,contain_plain_text LINE_specific 1
# arg on off
-frenchspacing line,global LINE_specific 1
+frenchspacing line,global,contain_plain_text LINE_specific 1
# arg on off
-codequoteundirected line,global LINE_specific 1
+codequoteundirected line,global,contain_plain_text LINE_specific 1
# arg on off
-codequotebacktick line,global LINE_specific 1
+codequotebacktick line,global,contain_plain_text LINE_specific 1
# arg on off
-xrefautomaticsectiontitle line,global LINE_specific 1
+xrefautomaticsectiontitle line,global,contain_plain_text LINE_specific 1
# arg on off
-deftypefnnewline line,global LINE_specific 1
+deftypefnnewline line,global,contain_plain_text LINE_specific 1
# arg 10 11
-fonttextsize line,global_unique LINE_specific 1
+fonttextsize line,global_unique,contain_plain_text LINE_specific
1
# arg false or true
-allowcodebreaks line,global LINE_specific 1
+allowcodebreaks line,global,contain_plain_text LINE_specific 1
# arg asis or a number
-exampleindent line,global LINE_specific 1
+exampleindent line,global,contain_plain_text LINE_specific 1
# args end and separate, nothing else on the line
-footnotestyle line,global_unique LINE_specific 1
+footnotestyle line,global_unique,contain_plain_text LINE_specific
1
# arg after|before|none
-urefbreakstyle line,global LINE_specific 1
+urefbreakstyle line,global,contain_plain_text LINE_specific 1
smallbook line,global_unique LINE_skipline
afourpaper line,global_unique LINE_skipline
afivepaper line,global_unique LINE_skipline
@@ -151,11 +150,11 @@ afourwide line,global_unique
LINE_skipline
bsixpaper line,global_unique LINE_skipline
# arg off on single double singleafter doubleafter
# interacts with setchapternewpage
-headings line,global LINE_specific 1
+headings line,global,contain_plain_text LINE_specific 1
# arg off on odd
-setchapternewpage line,global_unique LINE_specific 1
+setchapternewpage line,global_unique,contain_plain_text LINE_specific
1
# arg on off
-microtype line,global LINE_specific 1
+microtype line,global,contain_plain_text LINE_specific 1
everyheading line,global,heading_spec LINE_line
everyfooting line,global,heading_spec LINE_line
@@ -165,40 +164,40 @@ oddheading line,global,heading_spec
LINE_line
oddfooting line,global,heading_spec LINE_line
# args are index identifiers
-syncodeindex line LINE_specific 2
-synindex line LINE_specific 2
+syncodeindex line,contain_plain_text LINE_specific 2
+synindex line,contain_plain_text LINE_specific 2
# one identifier arg
-defindex line LINE_specific 1
+defindex line,contain_plain_text LINE_specific 1
# one identifier arg
-defcodeindex line LINE_specific 1
+defcodeindex line,contain_plain_text LINE_specific 1
# language code arg
-documentlanguage line,global LINE_text
+documentlanguage line,global,contain_plain_text,contain_plain_text
LINE_text
# arg code example distinct
-kbdinputstyle line,global LINE_specific 1
+kbdinputstyle line,global,contain_plain_text LINE_specific 1
# arg top bottom
-everyheadingmarks line,global_unique LINE_specific 1
-everyfootingmarks line,global_unique LINE_specific 1
-evenheadingmarks line,global_unique LINE_specific 1
-oddheadingmarks line,global_unique LINE_specific 1
-evenfootingmarks line,global_unique LINE_specific 1
-oddfootingmarks line,global_unique LINE_specific 1
+everyheadingmarks line,global_unique,contain_plain_text
LINE_specific 1
+everyfootingmarks line,global_unique,contain_plain_text
LINE_specific 1
+evenheadingmarks line,global_unique,contain_plain_text
LINE_specific 1
+oddheadingmarks line,global_unique,contain_plain_text
LINE_specific 1
+evenfootingmarks line,global_unique,contain_plain_text
LINE_specific 1
+oddfootingmarks line,global_unique,contain_plain_text
LINE_specific 1
# formatting
center line,close_paragraph LINE_line
-printindex line,close_paragraph,global LINE_specific 1
-listoffloats line,close_paragraph,global LINE_line
+printindex line,close_paragraph,global,contain_plain_text
LINE_specific 1
+listoffloats line,close_paragraph,global,contain_simple_text
LINE_line
# especially in titlepage
# shorttitle
-shorttitlepage line,global_unique LINE_line
-settitle line,global_unique LINE_line
-author line,global LINE_line
-subtitle line,global LINE_line
-title line,global_unique LINE_line
+shorttitlepage line,global_unique,contain_simple_text LINE_line
+settitle line,global_unique,contain_simple_text LINE_line
+author line,global,contain_simple_text LINE_line
+subtitle line,global,contain_simple_text LINE_line
+title line,global_unique,contain_simple_text LINE_line
# numerical arg
-sp line,close_paragraph LINE_specific 1
+sp line,close_paragraph,contain_plain_text
LINE_specific 1
page line,close_paragraph LINE_skipline
# one numerical/real arg
-need line,close_paragraph LINE_specific 1
+need line,close_paragraph,contain_plain_text
LINE_specific 1
# not valid for info (should be in @iftex)
vskip line LINE_lineraw
@@ -206,10 +205,10 @@ vskip line
LINE_lineraw
exdent line,close_paragraph LINE_line
# or nobrace skipspace, depending on the context
-item_LINE line,close_paragraph LINE_line
-itemx line,close_paragraph LINE_line
+item_LINE line,close_paragraph,contain_simple_text LINE_line
+itemx line,close_paragraph,contain_simple_text LINE_line
-subentry line LINE_line
+subentry line,contain_simple_text LINE_line
##########################################################
#
@@ -310,23 +309,23 @@ guilsinglleft brace
BRACE_noarg
guilsinglright brace BRACE_noarg
# accent commands - can be called with or without braces
-\" brace,accent BRACE_accent
-~ brace,accent BRACE_accent
-^ brace,accent BRACE_accent
-` brace,accent BRACE_accent
-' brace,accent BRACE_accent
-, brace,accent BRACE_accent
-= brace,accent BRACE_accent
-ringaccent brace,accent BRACE_accent
-H brace,accent BRACE_accent
-dotaccent brace,accent BRACE_accent
-u brace,accent BRACE_accent
-ubaraccent brace,accent BRACE_accent
-udotaccent brace,accent BRACE_accent
-v brace,accent BRACE_accent
-ogonek brace,accent BRACE_accent
-tieaccent brace,accent BRACE_accent
-dotless brace,accent BRACE_accent
+\" brace,accent,contain_plain_text BRACE_accent
+~ brace,accent,contain_plain_text BRACE_accent
+^ brace,accent,contain_plain_text BRACE_accent
+` brace,accent,contain_plain_text BRACE_accent
+' brace,accent,contain_plain_text BRACE_accent
+, brace,accent,contain_plain_text BRACE_accent
+= brace,accent,contain_plain_text BRACE_accent
+ringaccent brace,accent,contain_plain_text BRACE_accent
+H brace,accent,contain_plain_text BRACE_accent
+dotaccent brace,accent,contain_plain_text BRACE_accent
+u brace,accent,contain_plain_text BRACE_accent
+ubaraccent brace,accent,contain_plain_text BRACE_accent
+udotaccent brace,accent,contain_plain_text BRACE_accent
+v brace,accent,contain_plain_text BRACE_accent
+ogonek brace,accent,contain_plain_text BRACE_accent
+tieaccent brace,accent,contain_plain_text BRACE_accent
+dotless brace,accent,contain_plain_text BRACE_accent
# Style commands
asis brace BRACE_style_other
@@ -367,11 +366,11 @@ r brace
BRACE_style_no_code
# Parsers have specific checks for U content.
U brace BRACE_arguments 1
hyphenation brace,global,contain_plain_text BRACE_arguments 1
-anchor brace BRACE_arguments 1
-errormsg brace BRACE_arguments 1
+anchor brace,contain_simple_text BRACE_arguments 1
+errormsg brace,contain_simple_text BRACE_arguments 1
sortas brace,contain_plain_text BRACE_arguments 1
-seeentry brace BRACE_arguments 1
-seealso brace BRACE_arguments 1
+seeentry brace,contain_simple_text BRACE_arguments 1
+seealso brace,contain_simple_text BRACE_arguments 1
# Leading and trailing spaces kept in main text.
# verb is treated especially, it should not matter much in which category it
is.
@@ -382,20 +381,20 @@ w brace,contain_simple_text
BRACE_special
# other brace commands, leading and trailing spaces kept in main text
dmn brace,contain_plain_text BRACE_other 1
-titlefont brace,close_paragraph,global BRACE_other 1
+titlefont brace,close_paragraph,global,contain_simple_text
BRACE_other 1
# context brace commands - commands that enclose full texts
# not in the main document context. They can contain multiple paragraphs.
footnote brace,global BRACE_context
caption brace,close_paragraph BRACE_context
-shortcaption brace,close_paragraph BRACE_context
+shortcaption brace,close_paragraph,contain_simple_text
BRACE_context
# Commands that enclose math content, and, because of that, are not in the
# main document context.
-math brace,math BRACE_context
+math brace,math,contain_simple_text BRACE_context
# explained commands
-abbr brace BRACE_arguments 2
-acronym brace BRACE_arguments 2
+abbr brace,contain_simple_text BRACE_arguments 2
+acronym brace,contain_simple_text BRACE_arguments 2
# leading space is ignored in inline brace commands, not trailing space
# inline format command
@@ -407,16 +406,16 @@ inlinefmtifelse brace
BRACE_inline 3
inlineifclear brace BRACE_inline 2
inlineifset brace BRACE_inline 2
-email brace BRACE_arguments 2
+email brace,contain_simple_text BRACE_arguments 2
-uref brace BRACE_arguments 3
-url brace BRACE_arguments 3
-inforef brace,ref,deprecated BRACE_arguments 3
+uref brace,contain_simple_text BRACE_arguments 3
+url brace,contain_simple_text BRACE_arguments 3
+inforef brace,ref,contain_simple_text,deprecated
BRACE_arguments 3
-xref brace,ref BRACE_arguments 5
-ref brace,ref BRACE_arguments 5
-pxref brace,ref BRACE_arguments 5
-image brace BRACE_arguments 5
+xref brace,ref,contain_simple_text BRACE_arguments 5
+ref brace,ref,contain_simple_text BRACE_arguments 5
+pxref brace,ref,contain_simple_text BRACE_arguments 5
+image brace,contain_simple_text BRACE_arguments 5
##########################################################
@@ -468,7 +467,7 @@ deftypeivarx line,def,def_alias,close_paragraph
LINE_line
defmethodx line,def,def_alias,close_paragraph LINE_line
deftypemethodx line,def,def_alias,close_paragraph LINE_line
-multitable block,close_paragraph,blockitem BLOCK_multitable
+multitable block,close_paragraph,blockitem,contain_simple_text
BLOCK_multitable
# menu commands in which menu entry and menu comments appear
menu block,close_paragraph BLOCK_menu
@@ -491,7 +490,7 @@ copying block,close_paragraph,global_unique
BLOCK_region
documentdescription block,close_paragraph,global_unique BLOCK_region
# preformatted commands
-example
block,close_paragraph,preformatted,preformatted_code,variadic
BLOCK_preformatted
+example
block,close_paragraph,preformatted,preformatted_code,variadic,contain_simple_text
BLOCK_preformatted
smallexample block,close_paragraph,preformatted,preformatted_code
BLOCK_preformatted
lisp block,close_paragraph,preformatted,preformatted_code
BLOCK_preformatted
smalllisp block,close_paragraph,preformatted,preformatted_code
BLOCK_preformatted
@@ -513,15 +512,15 @@ ignore block
BLOCK_raw
macro block BLOCK_raw
rmacro block BLOCK_raw
-table block,close_paragraph,blockitem BLOCK_item_line
1
-ftable block,close_paragraph,blockitem BLOCK_item_line
1
-vtable block,close_paragraph,blockitem BLOCK_item_line
1
-itemize block,close_paragraph,blockitem BLOCK_item_container
1
-enumerate block,close_paragraph,blockitem BLOCK_item_container
1
-quotation block,close_paragraph BLOCK_quotation
1
-smallquotation block,close_paragraph BLOCK_quotation
1
+table block,close_paragraph,blockitem,contain_simple_text
BLOCK_item_line 1
+ftable block,close_paragraph,blockitem,contain_simple_text
BLOCK_item_line 1
+vtable block,close_paragraph,blockitem,contain_simple_text
BLOCK_item_line 1
+itemize block,close_paragraph,blockitem,contain_simple_text
BLOCK_item_container 1
+enumerate block,close_paragraph,blockitem,contain_simple_text
BLOCK_item_container 1
+quotation block,close_paragraph,contain_simple_text
BLOCK_quotation 1
+smallquotation block,close_paragraph,contain_simple_text
BLOCK_quotation 1
-float block,close_paragraph BLOCK_float
2
+float block,close_paragraph,contain_simple_text
BLOCK_float 2
displaymath block,close_paragraph,math BLOCK_math
@@ -548,7 +547,7 @@ ifcommandnotdefined block
BLOCK_conditional
##########################################################
# Root commands
-node line,root LINE_line
4
+node line,root,contain_simple_text LINE_line
4
top line,root,sectioning_heading,global_unique LINE_line
chapter line,root,sectioning_heading LINE_line
unnumbered line,root,sectioning_heading LINE_line
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index e0b18b35bb..3f5f27d636 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -926,27 +926,14 @@ check_valid_nesting (ELEMENT *current, enum command_id
cmd)
if (outer_flags & CF_contain_simple_text
|| (outer_flags & CF_line
- && (command_data(outer).data == LINE_specific
- || (command_data(outer).data == LINE_line
- && !(outer_flags & (CF_def | CF_sectioning_heading)))
- || command_data(outer).data == LINE_text
- || outer_flags & CF_heading_spec)
- && outer != CM_center
- && outer != CM_exdent)
- || ((outer_flags & CF_brace)
- && command_data(outer).data == BRACE_arguments
- && !(outer_flags & CF_contain_plain_text))
- || outer == CM_shortcaption
- || outer == CM_math
- || (outer_flags & CF_index_entry_command)
- || (outer_flags & CF_block
- && !(outer_flags & CF_def)
- && command_data(outer).data != BLOCK_raw
- && command_data(outer).data != BLOCK_conditional))
+ && outer_flags & CF_heading_spec)
+ || (outer_flags & CF_index_entry_command))
{
simple_text_command = 1;
}
+ /* first three conditions check if in the main contents of the commands
+ or in the arguments where there is checking of nesting */
if (outer_flags & CF_root && current->type != ET_line_arg)
ok = 1;
else if (outer_flags & CF_block
@@ -956,7 +943,7 @@ check_valid_nesting (ELEMENT *current, enum command_id cmd)
|| outer == CM_itemx)
&& current->type != ET_line_arg)
ok = 1;
- else if (outer_flags & (CF_accent | CF_contain_plain_text))
+ else if (outer_flags & CF_contain_plain_text)
{
if ((cmd_flags & CF_accent)
|| (cmd_flags & CF_nobrace
@@ -988,10 +975,13 @@ check_valid_nesting (ELEMENT *current, enum command_id
cmd)
{
/* Start by checking if the command is allowed inside a "full text
command" - this is the most permissive. */
- if (cmd_flags & CF_nobrace && command_data(cmd).data == NOBRACE_symbol)
- ok = 1;
+ /* all the brace commands */
+ /* FIXME except of CF_INFOENCLOSE, seems different from perl Parser? */
if (cmd_flags & CF_brace && !(cmd_flags & CF_INFOENCLOSE))
ok = 1;
+ if (cmd_flags & CF_nobrace && command_data(cmd).data == NOBRACE_symbol)
+ ok = 1;
+ /* selected line commands */
else if (cmd == CM_c
|| cmd == CM_comment
|| cmd == CM_refill
@@ -1001,14 +991,14 @@ check_valid_nesting (ELEMENT *current, enum command_id
cmd)
|| cmd == CM_clear
|| cmd == CM_end)
ok = 1;
+ /* selected block commands */
else if (cmd_flags & CF_block
- && command_data(cmd).data == BLOCK_format_raw)
+ && (command_data(cmd).data == BLOCK_format_raw
+ || command_data(cmd).data == BLOCK_conditional))
ok = 1;
+ /* not valid in these commands, only right in @float */
if (cmd == CM_caption || cmd == CM_shortcaption)
ok = 0;
- if (cmd_flags & CF_block
- && command_data(cmd).data == BLOCK_conditional)
- ok = 1;
if (cmd_flags & CF_in_heading_spec)
{ /* in heading commands can only appear in headings and style
@@ -1023,7 +1013,7 @@ check_valid_nesting (ELEMENT *current, enum command_id
cmd)
}
/* Now add more restrictions for "full line no refs" commands and
"simple
- text" commands. */
+ text" commands on valid brace commands. */
if (outer_flags & (CF_sectioning_heading | CF_def)
|| (!current->parent->cmd && current_context () == ct_def)
|| simple_text_command)
@@ -1036,7 +1026,7 @@ check_valid_nesting (ELEMENT *current, enum command_id
cmd)
ok = 0;
}
- /* Exceptions for "simple text commands" only. */
+ /* Exceptions for "simple text commands" only for brace commands. */
if (simple_text_command)
{
if (cmd == CM_xref
diff --git a/tp/t/20preformatted.t b/tp/t/20preformatted.t
index 7b33708d61..eff5d57711 100644
--- a/tp/t/20preformatted.t
+++ b/tp/t/20preformatted.t
@@ -234,6 +234,10 @@ example with empty and non empty args mix
example with @@-commands and other special characters
@end example
'],
+['example_invalid_at_commands_arguments',
+'@example @ref{a,b,c,d} fa, @anchor{an anchor} on example line, @center in
center
+@end example
+'],
);
my @test_invalid = (
diff --git a/tp/t/results/alias/bad_line.pl b/tp/t/results/alias/bad_line.pl
index 8e67f2e0a1..b7503ce392 100644
--- a/tp/t/results/alias/bad_line.pl
+++ b/tp/t/results/alias/bad_line.pl
@@ -139,6 +139,15 @@ $result_errors{'bad_line'} = [
'text' => 'bad argument to @alias',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @code should not appear in @alias
+',
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => '',
+ 'text' => '@code should not appear in @alias',
+ 'type' => 'warning'
+ },
{
'error_line' => 'superfluous argument to @alias
',
diff --git a/tp/t/results/columnfractions/wrong_command.pl
b/tp/t/results/columnfractions/wrong_command.pl
index 64769baca6..cc7d660fa8 100644
--- a/tp/t/results/columnfractions/wrong_command.pl
+++ b/tp/t/results/columnfractions/wrong_command.pl
@@ -128,6 +128,15 @@ $result_texis{'wrong_command'} = '@multitable
@columnfractions @b{3.4}
$result_texts{'wrong_command'} = '';
$result_errors{'wrong_command'} = [
+ {
+ 'error_line' => 'warning: @b should not appear in @columnfractions
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@b should not appear in @columnfractions',
+ 'type' => 'warning'
+ },
{
'error_line' => 'superfluous argument to @columnfractions
',
diff --git a/tp/t/results/coverage/command_in_end.pl
b/tp/t/results/coverage/command_in_end.pl
index 9cfdc676a9..f682f7ff0c 100644
--- a/tp/t/results/coverage/command_in_end.pl
+++ b/tp/t/results/coverage/command_in_end.pl
@@ -795,6 +795,15 @@ In verbatim
';
$result_errors{'command_in_end'} = [
+ {
+ 'error_line' => 'warning: @code should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@code should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: @code{quotation}
',
@@ -804,6 +813,15 @@ $result_errors{'command_in_end'} = [
'text' => 'bad argument to @end: @code{quotation}',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @code should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => '',
+ 'text' => '@code should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'warning: unknown @end q
',
@@ -822,6 +840,15 @@ $result_errors{'command_in_end'} = [
'text' => 'bad argument to @end: q@code{uotation}',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @code should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => '',
+ 'text' => '@code should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'warning: unknown @end qu
',
@@ -840,6 +867,15 @@ $result_errors{'command_in_end'} = [
'text' => 'bad argument to @end: qu@code{otation}',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 15,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'warning: unknown @end quotn
',
@@ -858,6 +894,15 @@ $result_errors{'command_in_end'} = [
'text' => 'bad argument to @end: quot@asis{atio}n',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 19,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: q@asis{}uotation
',
@@ -867,6 +912,15 @@ $result_errors{'command_in_end'} = [
'text' => 'bad argument to @end: q@asis{}uotation',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 23,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: qu@asis{}otation
',
@@ -876,6 +930,15 @@ $result_errors{'command_in_end'} = [
'text' => 'bad argument to @end: qu@asis{}otation',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 27,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: quot@asis{}ation
',
diff --git a/tp/t/results/coverage/command_in_end_expanded_raw_command_after.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_command_after.pl
index 5ec03f0588..61f7b06a45 100644
--- a/tp/t/results/coverage/command_in_end_expanded_raw_command_after.pl
+++ b/tp/t/results/coverage/command_in_end_expanded_raw_command_after.pl
@@ -119,6 +119,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_command_after'} = '';
$result_errors{'command_in_end_expanded_raw_command_after'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: tex@asis{asis}
',
diff --git
a/tp/t/results/coverage/command_in_end_expanded_raw_command_empty_after.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_command_empty_after.pl
index 71fe2823d1..d77abf6024 100644
--- a/tp/t/results/coverage/command_in_end_expanded_raw_command_empty_after.pl
+++ b/tp/t/results/coverage/command_in_end_expanded_raw_command_empty_after.pl
@@ -112,6 +112,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_command_empty_after'} = '';
$result_errors{'command_in_end_expanded_raw_command_empty_after'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: tex@asis{}
',
diff --git a/tp/t/results/coverage/command_in_end_expanded_raw_in_command.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_in_command.pl
index 33740045ee..c1a86b3b15 100644
--- a/tp/t/results/coverage/command_in_end_expanded_raw_in_command.pl
+++ b/tp/t/results/coverage/command_in_end_expanded_raw_in_command.pl
@@ -114,6 +114,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_in_command'} = '';
$result_errors{'command_in_end_expanded_raw_in_command'} = [
+ {
+ 'error_line' => 'warning: @code should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@code should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: @code{tex}
',
diff --git
a/tp/t/results/coverage/command_in_end_expanded_raw_one_char_before_command.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_one_char_before_command.pl
index 5c339d31fe..c8c25a2b75 100644
---
a/tp/t/results/coverage/command_in_end_expanded_raw_one_char_before_command.pl
+++
b/tp/t/results/coverage/command_in_end_expanded_raw_one_char_before_command.pl
@@ -117,6 +117,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_one_char_before_command'} = '';
$result_errors{'command_in_end_expanded_raw_one_char_before_command'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: t@asis{}ex
',
diff --git
a/tp/t/results/coverage/command_in_end_expanded_raw_one_char_not_in_command.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_one_char_not_in_command.pl
index b3e120ff28..fc140f64b8 100644
---
a/tp/t/results/coverage/command_in_end_expanded_raw_one_char_not_in_command.pl
+++
b/tp/t/results/coverage/command_in_end_expanded_raw_one_char_not_in_command.pl
@@ -119,6 +119,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_one_char_not_in_command'} = '';
$result_errors{'command_in_end_expanded_raw_one_char_not_in_command'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'warning: unknown @end t
',
diff --git
a/tp/t/results/coverage/command_in_end_expanded_raw_two_char_before_command.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_two_char_before_command.pl
index 1d0452eb15..5dae19a102 100644
---
a/tp/t/results/coverage/command_in_end_expanded_raw_two_char_before_command.pl
+++
b/tp/t/results/coverage/command_in_end_expanded_raw_two_char_before_command.pl
@@ -117,6 +117,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_two_char_before_command'} = '';
$result_errors{'command_in_end_expanded_raw_two_char_before_command'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: te@asis{}x
',
diff --git
a/tp/t/results/coverage/command_in_end_expanded_raw_two_char_not_in_command.pl
b/tp/t/results/coverage/command_in_end_expanded_raw_two_char_not_in_command.pl
index 124fd33903..358b32b038 100644
---
a/tp/t/results/coverage/command_in_end_expanded_raw_two_char_not_in_command.pl
+++
b/tp/t/results/coverage/command_in_end_expanded_raw_two_char_not_in_command.pl
@@ -119,6 +119,15 @@ In TeX
$result_texts{'command_in_end_expanded_raw_two_char_not_in_command'} = '';
$result_errors{'command_in_end_expanded_raw_two_char_not_in_command'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'warning: unknown @end te
',
diff --git a/tp/t/results/coverage/command_in_end_ignored_raw_command_after.pl
b/tp/t/results/coverage/command_in_end_ignored_raw_command_after.pl
index cef833810f..8e7610335f 100644
--- a/tp/t/results/coverage/command_in_end_ignored_raw_command_after.pl
+++ b/tp/t/results/coverage/command_in_end_ignored_raw_command_after.pl
@@ -110,6 +110,15 @@ $result_texis{'command_in_end_ignored_raw_command_after'}
= '@html
$result_texts{'command_in_end_ignored_raw_command_after'} = '';
$result_errors{'command_in_end_ignored_raw_command_after'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: html@asis{asis}
',
diff --git a/tp/t/results/coverage/end_bad_end_argument_and_superfluous_arg.pl
b/tp/t/results/coverage/end_bad_end_argument_and_superfluous_arg.pl
index 1cc5a18fb6..1813ffb584 100644
--- a/tp/t/results/coverage/end_bad_end_argument_and_superfluous_arg.pl
+++ b/tp/t/results/coverage/end_bad_end_argument_and_superfluous_arg.pl
@@ -120,6 +120,15 @@ $result_texts{'end_bad_end_argument_and_superfluous_arg'}
= 'In quotation
';
$result_errors{'end_bad_end_argument_and_superfluous_arg'} = [
+ {
+ 'error_line' => 'warning: @code should not appear in @end
+',
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => '',
+ 'text' => '@code should not appear in @end',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @end: : @code{in c}
',
diff --git
a/tp/t/results/misc_commands/command_not_closed_in_documentencoding.pl
b/tp/t/results/misc_commands/command_not_closed_in_documentencoding.pl
index 1393ccdca3..b8a5ce87ba 100644
--- a/tp/t/results/misc_commands/command_not_closed_in_documentencoding.pl
+++ b/tp/t/results/misc_commands/command_not_closed_in_documentencoding.pl
@@ -64,6 +64,15 @@ $result_texis{'command_not_closed_in_documentencoding'} =
'@documentencoding @st
$result_texts{'command_not_closed_in_documentencoding'} = '';
$result_errors{'command_not_closed_in_documentencoding'} = [
+ {
+ 'error_line' => 'warning: @strong should not appear in @documentencoding
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@strong should not appear in @documentencoding',
+ 'type' => 'warning'
+ },
{
'error_line' => '@strong missing closing brace
',
diff --git a/tp/t/results/misc_commands/invalid_documentencoding.pl
b/tp/t/results/misc_commands/invalid_documentencoding.pl
index ed71374255..feadf550b3 100644
--- a/tp/t/results/misc_commands/invalid_documentencoding.pl
+++ b/tp/t/results/misc_commands/invalid_documentencoding.pl
@@ -450,6 +450,15 @@ $result_texts{'invalid_documentencoding'} = '
@documentencoding ';
$result_errors{'invalid_documentencoding'} = [
+ {
+ 'error_line' => 'warning: @asis should not appear in @documentencoding
+',
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @documentencoding',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @documentencoding: us-ascii@asis{}
',
@@ -459,6 +468,15 @@ $result_errors{'invalid_documentencoding'} = [
'text' => 'bad argument to @documentencoding: us-ascii@asis{}',
'type' => 'error'
},
+ {
+ 'error_line' => 'warning: @asis should not appear in @documentencoding
+',
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => '',
+ 'text' => '@asis should not appear in @documentencoding',
+ 'type' => 'warning'
+ },
{
'error_line' => 'bad argument to @documentencoding: latin1@asis{a}
',
diff --git a/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl
b/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl
new file mode 100644
index 0000000000..a03443ec88
--- /dev/null
+++ b/tp/t/results/preformatted/example_invalid_at_commands_arguments.pl
@@ -0,0 +1,337 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'example_invalid_at_commands_arguments'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'a'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'b'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'c'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'd'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'ref',
+ 'extra' => {
+ 'node_argument' => {
+ 'node_content' => [
+ {}
+ ]
+ }
+ },
+ 'parent' => {},
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'parent' => {},
+ 'text' => ' fa'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'an anchor'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'anchor',
+ 'extra' => {
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'an-anchor'
+ },
+ 'parent' => {},
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'spaces_after_close_brace'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'on example line'
+ }
+ ],
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'in center'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'parent' => {},
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'center',
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'parent' => {},
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'example',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'example'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'parent' => {},
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'spaces_before_argument' => ' ',
+ 'text_arg' => 'example'
+ },
+ 'parent' => {},
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'parent' => {},
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[1];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[1]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[2]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[2];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[2]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[3];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[3]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'extra'}{'node_argument'}{'node_content'}[0]
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'args'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'extra'}{'node_content'}[0]
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[1]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'contents'}[2]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[1]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2]{'contents'}[0]{'args'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'args'}[2]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0];
+$result_trees{'example_invalid_at_commands_arguments'}{'contents'}[0]{'parent'}
= $result_trees{'example_invalid_at_commands_arguments'};
+
+$result_texis{'example_invalid_at_commands_arguments'} = '@example
@ref{a,b,c,d} fa, @anchor{an anchor} on example line, @center in center
+@end example
+';
+
+
+$result_texts{'example_invalid_at_commands_arguments'} = '';
+
+$result_errors{'example_invalid_at_commands_arguments'} = [
+ {
+ 'error_line' => 'warning: @ref should not appear in @example
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@ref should not appear in @example',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: @anchor should not appear in @example
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@anchor should not appear in @example',
+ 'type' => 'warning'
+ },
+ {
+ 'error_line' => 'warning: @center should not appear in @example
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => '@center should not appear in @example',
+ 'type' => 'warning'
+ }
+];
+
+
+$result_floats{'example_invalid_at_commands_arguments'} = {};
+
+
+
+$result_converted{'plaintext'}->{'example_invalid_at_commands_arguments'} = '';
+
+
+$result_converted{'html'}->{'example_invalid_at_commands_arguments'} =
'<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+
+
+</head>
+
+<body lang="en">
+
+
+
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'example_invalid_at_commands_arguments'} = [
+ {
+ 'error_line' => 'warning: must specify a title with a title command or @top
+',
+ 'file_name' => 'example_invalid_at_commands_arguments.texi',
+ 'text' => 'must specify a title with a title command or @top',
+ 'type' => 'warning'
+ }
+];
+
+
+
+$result_converted{'docbook'}->{'example_invalid_at_commands_arguments'} = '';
+
+
+$result_converted{'xml'}->{'example_invalid_at_commands_arguments'} =
'<example spaces=" " endspaces=" "><examplelanguage><ref label="a"
manual="d"><xrefnodename>a</xrefnodename><xrefinfoname>b</xrefinfoname><xrefprinteddesc>c</xrefprinteddesc><xrefinfofile>d</xrefinfofile></ref>
fa</examplelanguage><examplearg spaces=" "><anchor name="an-anchor">an
anchor</anchor> on example line</examplearg><examplearg spaces=" "><center
spaces=" ">in center</center>
+</examplearg></example>
+';
+
+
+$result_converted{'latex_text'}->{'example_invalid_at_commands_arguments'} =
'\\begin{Texinfoindented}
+\\end{Texinfoindented}
+';
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Full coverage of contain_plain_text and contain_simple_text,
Patrice Dumas <=