[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7836] gdt avoid issuing error messages
From: |
gavinsmith0123 |
Subject: |
[7836] gdt avoid issuing error messages |
Date: |
Sun, 18 Jun 2017 14:44:13 -0400 (EDT) |
Revision: 7836
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7836
Author: gavin
Date: 2017-06-18 14:44:13 -0400 (Sun, 18 Jun 2017)
Log Message:
-----------
gdt avoid issuing error messages
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Common.pm
trunk/tp/Texinfo/Parser.pm
trunk/tp/Texinfo/Report.pm
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2017-06-18 16:01:28 UTC (rev 7835)
+++ trunk/ChangeLog 2017-06-18 18:44:13 UTC (rev 7836)
@@ -1,5 +1,16 @@
2017-06-18 Gavin Smith <address@hidden>
+ * tp/Texinfo/Report.pm (gdt): Set an 'in_gdt' flag
+ on the parser.
+ * tp/Texinfo/Common.pm (%default_parser_state_configuration):
+ Allow 'in_gdt' as a config value.
+ * tp/Texinfo/Parser.pm (_parse_texi): Avoid issuing an error
+ message in a couple of situations when being called from 'gdt'.
+ (It would be thrown away anyway.) This avoids the need for the
+ error message to be translated, so is slightly faster.
+
+2017-06-18 Gavin Smith <address@hidden>
+
* tp/Texinfo/Report.pm (gdt): Remove code dealing with a
'translated_paragraph' argument. Condense code dealing
with subroutine arguments to a single line.
Modified: trunk/tp/Texinfo/Common.pm
===================================================================
--- trunk/tp/Texinfo/Common.pm 2017-06-18 16:01:28 UTC (rev 7835)
+++ trunk/tp/Texinfo/Common.pm 2017-06-18 18:44:13 UTC (rev 7836)
@@ -134,7 +134,8 @@
# argument. A Texinfo tree may also be used.
'info' => {
'novalidate' => 0, # same as setting @novalidate.
- }
+ },
+ 'in_gdt' => 0 # whether we are being called by gdt
);
# customization options
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2017-06-18 16:01:28 UTC (rev 7835)
+++ trunk/tp/Texinfo/Parser.pm 2017-06-18 18:44:13 UTC (rev 7836)
@@ -4218,8 +4218,10 @@
'type' => $value,
'contents' => [],
'parent' => $current };
- $self->line_warn(
- sprintf($self->__("undefined flag: %s"), $value), $line_nr);
+ if (!$self->{'in_gdt'}) {
+ $self->line_warn(
+ sprintf($self->__("undefined flag: %s"), $value), $line_nr);
+ }
}
} else {
$self->line_error($self->__("bad syntax for address@hidden"),
$line_nr);
@@ -5106,9 +5108,12 @@
if (defined($brace_commands{$closed_command})
and $brace_commands{$closed_command} == 0
and @{$current->{'contents'}}) {
- $self->line_warn(sprintf($self->__(
- "command address@hidden does not accept
arguments"),
- $closed_command), $line_nr);
+ if (!($self->{'in_gdt'} and $closed_command eq 'tie')) {
+ $self->line_warn(sprintf($self->__(
+ "command address@hidden does not accept
arguments"),
+ $closed_command), $line_nr);
+ }
+ # TODO: Change @tie{ } to @tie{} in Plaintext.pm
}
if ($current->{'parent'}->{'cmdname'} eq 'anchor') {
$current->{'parent'}->{'line_nr'} = $line_nr;
Modified: trunk/tp/Texinfo/Report.pm
===================================================================
--- trunk/tp/Texinfo/Report.pm 2017-06-18 16:01:28 UTC (rev 7835)
+++ trunk/tp/Texinfo/Report.pm 2017-06-18 18:44:13 UTC (rev 7836)
@@ -376,6 +376,7 @@
if (defined($current_parser->{$duplicated_conf}));
}
}
+ $parser_conf->{'in_gdt'} = 1;
#my $parser = Texinfo::Parser::parser($parser_conf);
my $parser = Texinfo::Parser::simple_parser($parser_conf);
if ($parser->{'DEBUG'}) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7836] gdt avoid issuing error messages,
gavinsmith0123 <=