[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8373] check for unknown command right after reading the command
From: |
gavinsmith0123 |
Subject: |
[8373] check for unknown command right after reading the command |
Date: |
Mon, 22 Oct 2018 06:39:55 -0400 (EDT) |
Revision: 8373
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8373
Author: gavin
Date: 2018-10-22 06:39:54 -0400 (Mon, 22 Oct 2018)
Log Message:
-----------
check for unknown command right after reading the command
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Parser.pm
trunk/tp/t/results/macro/unknown_macro_on_line_command.pl
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2018-10-22 08:29:10 UTC (rev 8372)
+++ trunk/ChangeLog 2018-10-22 10:39:54 UTC (rev 8373)
@@ -1,3 +1,8 @@
+2018-10-22 Gavin Smith <address@hidden>
+
+ * tp/Texinfo/Parser.pm (_parse_texi): Check for unknown command
+ right after reading the command.
+
2018-10-21 Gavin Smith <address@hidden>
* tp/tests/sectioning/list-of-tests
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2018-10-22 08:29:10 UTC (rev 8372)
+++ trunk/tp/Texinfo/Parser.pm 2018-10-22 10:39:54 UTC (rev 8373)
@@ -3963,12 +3963,26 @@
$command = $at_command;
substr($line, 0, $at_command_length) = '';
}
+
+ print STDERR "COMMAND $command\n" if ($self->{'DEBUG'});
+ if (!$all_commands{$command}
+ and !$self->{'macros'}->{$command}
+ and !$self->{'definfoenclose'}->{$command}
+ and !$self->{'aliases'}->{$command}
+ and !$self->{'command_index'}->{$command}) {
+ $self->line_error(sprintf(__("unknown command `%s'"),
+ $command), $line_nr);
+ _abort_empty_line($self, $current);
+ my $paragraph = _begin_paragraph($self, $current, $line_nr);
+ $current = $paragraph if ($paragraph);
+ next;
+ }
+
my $alias_command;
if (exists($self->{'aliases'}->{$command})) {
$alias_command = $command;
$command = $self->{'aliases'}->{$command};
}
- print STDERR "COMMAND $command\n" if ($self->{'DEBUG'});
if ($command eq 'value') {
$line =~ s/^\s*//
@@ -4712,9 +4726,6 @@
$current = _end_line($self, $current, $line_nr);
last;
}
- } else {
- $self->line_error(sprintf(__("unknown command `%s'"),
- $command), $line_nr);
}
} elsif ($separator_match) {
my $separator = $separator_match;
Modified: trunk/tp/t/results/macro/unknown_macro_on_line_command.pl
===================================================================
--- trunk/tp/t/results/macro/unknown_macro_on_line_command.pl 2018-10-22
08:29:10 UTC (rev 8372)
+++ trunk/tp/t/results/macro/unknown_macro_on_line_command.pl 2018-10-22
10:39:54 UTC (rev 8373)
@@ -46,15 +46,6 @@
$result_errors{'unknown_macro_on_line_command'} = [
{
- 'error_line' => ':1: warning: @begin should not appear in @setfilename
-',
- 'file_name' => '',
- 'line_nr' => 1,
- 'macro' => '',
- 'text' => '@begin should not appear in @setfilename',
- 'type' => 'warning'
- },
- {
'error_line' => ':1: unknown command `begin\'
',
'file_name' => '',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8373] check for unknown command right after reading the command,
gavinsmith0123 <=