[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/ParserNonXS.pm (parser): remove a ch
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/ParserNonXS.pm (parser): remove a check and handling of user-provided state in parser. Both codes were not active. |
Date: |
Sat, 18 Feb 2023 17:22:41 -0500 |
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 bf9c42f0dd * tp/Texinfo/ParserNonXS.pm (parser): remove a check and
handling of user-provided state in parser. Both codes were not active.
bf9c42f0dd is described below
commit bf9c42f0dd9a90cb460d147cf7cfbc221e156dc5
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Feb 18 23:22:33 2023 +0100
* tp/Texinfo/ParserNonXS.pm (parser): remove a check and handling of
user-provided state in parser. Both codes were not active.
---
ChangeLog | 5 +++
tp/Texinfo/ParserNonXS.pm | 95 -----------------------------------------------
2 files changed, 5 insertions(+), 95 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4b8a661012..00b688a32c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-18 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/ParserNonXS.pm (parser): remove a check and handling of
+ user-provided state in parser. Both codes were not active.
+
2023-02-18 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (%default_no_paragraph_commands, parser):
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index a7809655df..2874eac164 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -540,54 +540,6 @@ foreach my $name (keys(%index_names)) {
}
}
-if (0) {
- # FIXME this seems to be obsolete, should be removed or updated for
- # the changes with the nesting context.
- # check that all the commands either are in %default_valid_nestings,
- # do not have arguments at all, have special parsing of their arguments
- # or accept any command
- my %all_commands_nesting_check = %Texinfo::Common::all_commands;
- foreach my $command (keys(%default_valid_nestings)) {
- if (not exists($all_commands_nesting_check{$command})) {
- die "In \%default_valid_nestings: Not a command $command\n";
- }
- delete $all_commands_nesting_check{$command};
- }
- # no argument
- foreach my $command (keys(%Texinfo::Commands::nobrace_commands)) {
- delete $all_commands_nesting_check{$command};
- }
- foreach my $command (keys(%Texinfo::Commands::block_commands)) {
- # remove block commands without argument, they should have
- # an error message for any content
- delete $all_commands_nesting_check{$command}
- if (not $commands_args_number{$command}
- and not $variadic_commands{$command});
- }
- foreach my $brace_command(keys(%brace_commands)) {
- delete $all_commands_nesting_check{$brace_command}
- # no argument
- if ($brace_commands{$brace_command} eq 'noarg'
- # @inline* can contain anything in their second argument
- or $inline_format_commands{$brace_command}
- or $Texinfo::Commands::inline_conditional_commands{$brace_command});
- }
- foreach my $command (keys(%line_commands)) {
- delete $all_commands_nesting_check{$command}
- # special formatting, commands on line are not parsed as usual
- if ($line_commands{$command} eq 'skipline'
- or $line_commands{$command} eq 'special'
- or $line_commands{$command} eq 'lineraw');
- }
- # U, value and verb have special checks of argument.
- # caption and footnotes can contain any command.
- foreach my $command ('U', 'value', 'verb', 'caption', 'footnote') {
- delete $all_commands_nesting_check{$command};
- }
-
- print STDERR "".join('|', sort(keys(%all_commands_nesting_check)))."\n";
-}
-
foreach my $other_forbidden_index_name ('info','ps','pdf','htm',
'html', 'log','aux','dvi','texi','txi','texinfo','tex','bib') {
$forbidden_index_name{$other_forbidden_index_name} = 1;
@@ -650,53 +602,6 @@ sub parser(;$$)
$parser->{'nesting_context'}->{'regions_stack'} = [];
$parser->{'basic_inline_commands'} = {%default_basic_inline_commands};
- # handle user provided state.
-
- # Currently not done, as none of the user provided configuration
- # keys of interest are in %parser_state_configuration. If this
- # changes, the if (0) could be removed. However, this setting of
- # configuration is also not handled by the XS parser, which is
- # again in favor of keeping the code ignored.
- if (0) {
- # REMARK the following code will not be used for user defined state
- # if the corresponding key is ignored in _setup_conf()
- #
- # a hash is simply concatenated. It should be like %index_names.
- if (ref($parser->{'indices'}) eq 'HASH') {
- %{$parser->{'index_names'}} = (%{$parser->{'index_names'}},
- %{$parser->{'indices'}});
- } else { # an array holds index names defined with @defindex
- foreach my $name (@{$parser->{'indices'}}) {
- $parser->{'index_names'}->{$name} = {'in_code' => 0};
- }
- }
- foreach my $index (keys (%{$parser->{'index_names'}})) {
- if (!exists($parser->{'index_names'}->{$index}->{'name'})) {
- $parser->{'index_names'}->{$index}->{'name'} = $index;
- }
- if (!exists($parser->{'index_names'}->{$index}->{'contained_indices'})) {
- $parser->{'index_names'}->{$index}->{'contained_indices'}->{$index} =
1;
- }
- foreach my $prefix ($index, substr($index, 0, 1)) {
- $parser->{'line_commands'}->{$prefix.'index'} = 'line';
- $parser->{'close_paragraph_commands'}->{$prefix.'index'} = 1;
- $parser->{'no_paragraph_commands'}->{$prefix.'index'} = 1;
- $parser->{'command_index'}->{$prefix.'index'} = $index;
- }
- }
- if ($parser->{'merged_indices'}) {
- foreach my $index_from (keys (%{$parser->{'merged_indices'}})) {
- my $index_to = $parser->{'merged_indices'}->{$index_from};
- if (defined($parser->{'index_names'}->{$index_from})
- and defined($parser->{'index_names'}->{$index_to})) {
- $parser->{'index_names'}->{$index_from}->{'merged_in'} = $index_to;
- $parser->{'index_names'}->{$index_to}->{'contained_indices'}
- ->{$index_from} = 1;
- }
- }
- }
- }
-
# following is common with simple_parser
$parser->_init_context_stack();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/ParserNonXS.pm (parser): remove a check and handling of user-provided state in parser. Both codes were not active.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (%default_no_paragraph_commands, parser): (_parse_line_command_args), tp/Texinfo/XS/parsetexi/command_data.awk, tp/Texinfo/XS/parsetexi/indices.c (add_index_command), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line), tp/Texinfo/command_data.txt, tp/maintain/regenerate_commands_perl_info.pl: add no_paragraph flag. Put the flag explicitly for brace and nobrace commands in command_data.txt and add automatically for line and block commands. Add default i [...]
- Next by Date:
branch master updated: * tp/Texinfo/Common.pm (@variable_string_settables), tp/ext/highlight_syntax.pm (_get_language), tp/texi2any.pl, tp/Makefile.am (dist_extensions_DATA): load highlight_syntax.pm in main program if HIGHLIGHT_SYNTAX is set. Rename HIGHLIGHT_SYNTAX_DEFAULT as HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE. Setup highlight_syntax.pm as an internal extension.
- Previous by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (%default_no_paragraph_commands, parser): (_parse_line_command_args), tp/Texinfo/XS/parsetexi/command_data.awk, tp/Texinfo/XS/parsetexi/indices.c (add_index_command), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line), tp/Texinfo/command_data.txt, tp/maintain/regenerate_commands_perl_info.pl: add no_paragraph flag. Put the flag explicitly for brace and nobrace commands in command_data.txt and add automatically for line and block commands. Add default i [...]
- Next by thread:
branch master updated: * tp/Texinfo/Common.pm (@variable_string_settables), tp/ext/highlight_syntax.pm (_get_language), tp/texi2any.pl, tp/Makefile.am (dist_extensions_DATA): load highlight_syntax.pm in main program if HIGHLIGHT_SYNTAX is set. Rename HIGHLIGHT_SYNTAX_DEFAULT as HIGHLIGHT_SYNTAX_DEFAULT_LANGUAGE. Setup highlight_syntax.pm as an internal extension.
- Index(es):