[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[7293] @@ in misc text commands
From: |
gavinsmith0123 |
Subject: |
[7293] @@ in misc text commands |
Date: |
Mon, 1 Aug 2016 19:01:34 +0000 (UTC) |
Revision: 7293
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7293
Author: gavin
Date: 2016-08-01 19:01:33 +0000 (Mon, 01 Aug 2016)
Log Message:
-----------
@@ in misc text commands
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Parser.pm
trunk/tp/t/results/coverage/symbol_after_block.pl
trunk/tp/t/results/include/include_setfilename_on_setfilename_line.pl
trunk/tp/t/results/include/macro_and_commands_in_early_commands.pl
trunk/tp/t/results/misc_commands/bad_documentlanguage.pl
trunk/tp/t/results/misc_commands/invalid_documentencoding.pl
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2016-08-01 14:21:45 UTC (rev 7292)
+++ trunk/ChangeLog 2016-08-01 19:01:33 UTC (rev 7293)
@@ -1,3 +1,10 @@
+2016-08-01 Gavin Smith <address@hidden>
+
+ * tp/Texinfo/Parser.pm (_end_line) <"misc text" commands>:
+ Convert @@, @} and @{ commands, so there is a way to include
+ these characters in filenames. (Previously this was done by the
+ Texinfo::Convert::Text module.)
+
2016-08-01 Masamichi Hosoda <address@hidden>
* doc/texinfo.tex
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2016-08-01 14:21:45 UTC (rev 7292)
+++ trunk/tp/Texinfo/Parser.pm 2016-08-01 19:01:33 UTC (rev 7293)
@@ -3100,19 +3100,25 @@
} elsif ($self->{'misc_commands'}->{$command} eq 'text') {
my $text = '';
my $superfluous_arg = 0;
- if (defined $current->{'args'}->[0]->{'contents'}) {
- my @contents = @{$current->{'args'}->[0]->{'contents'}};
- _trim_spaces_comment_from_content (address@hidden);
- if (scalar(@contents) > 1
- or scalar(@contents) == 1
- and not defined $contents[0]->{'text'}) {
- # Too many arguments or @-commands used in argument.
- $superfluous_arg = 1; # Used below to issue an error message.
+ my @contents = @{$current->{'args'}->[0]->{'contents'}};
+ _trim_spaces_comment_from_content (address@hidden);
+ for my $c (@contents) {
+ # Allow @@, @{ and @} to give a way for @, { and } to appear in
+ # filenames (although it's not a good idea to use these characters
+ # in filenames).
+ if ($c->{'text'}) {
+ $text .= $c->{'text'};
+ } elsif ($c->{'cmdname'} and $c->{'cmdname'} eq '@') {
+ $text .= '@';
+ } elsif ($c->{'cmdname'} and $c->{'cmdname'} eq '{') {
+ $text .= '{';
+ } elsif ($c->{'cmdname'} and $c->{'cmdname'} eq '}') {
+ $text .= '}';
+ } else {
+ $superfluous_arg = 1;
}
- $text = $contents[0]->{'text'}
- if defined $contents[0]->{'text'};
}
- if (not defined $text or $text eq '') {
+ if ($text eq '') {
if (not $superfluous_arg) {
$self->_command_warn($current, $line_nr,
$self->__("address@hidden missing argument"),
$command);
Modified: trunk/tp/t/results/coverage/symbol_after_block.pl
===================================================================
--- trunk/tp/t/results/coverage/symbol_after_block.pl 2016-08-01 14:21:45 UTC
(rev 7292)
+++ trunk/tp/t/results/coverage/symbol_after_block.pl 2016-08-01 19:01:33 UTC
(rev 7293)
@@ -152,7 +152,7 @@
'command' => {},
'command_argument' => 'html',
'spaces_after_command' => {},
- 'text_arg' => 'html'
+ 'text_arg' => 'html@ On the line.'
},
'line_nr' => {
'file_name' => '',
@@ -618,7 +618,7 @@
'command' => {},
'command_argument' => 'table',
'spaces_after_command' => {},
- 'text_arg' => 'table'
+ 'text_arg' => 'table@'
},
'line_nr' => {
'file_name' => '',
@@ -901,7 +901,7 @@
'command' => {},
'command_argument' => 'itemize',
'spaces_after_command' => {},
- 'text_arg' => 'itemize'
+ 'text_arg' => 'itemize@'
},
'line_nr' => {
'file_name' => '',
@@ -1474,7 +1474,7 @@
'command' => {},
'command_argument' => 'multitable',
'spaces_after_command' => {},
- 'text_arg' => 'multitable'
+ 'text_arg' => 'multitable{'
},
'line_nr' => {
'file_name' => '',
@@ -1657,7 +1657,7 @@
'command' => {},
'command_argument' => 'flushleft',
'spaces_after_command' => {},
- 'text_arg' => 'flushleft'
+ 'text_arg' => 'flushleft@'
},
'line_nr' => {
'file_name' => '',
@@ -1842,7 +1842,7 @@
'command' => {},
'command_argument' => 'copying',
'spaces_after_command' => {},
- 'text_arg' => 'copying'
+ 'text_arg' => 'copying@'
},
'line_nr' => {
'file_name' => '',
Modified: trunk/tp/t/results/include/include_setfilename_on_setfilename_line.pl
===================================================================
--- trunk/tp/t/results/include/include_setfilename_on_setfilename_line.pl
2016-08-01 14:21:45 UTC (rev 7292)
+++ trunk/tp/t/results/include/include_setfilename_on_setfilename_line.pl
2016-08-01 19:01:33 UTC (rev 7293)
@@ -98,7 +98,7 @@
'extra' => {
'invalid_nesting' => 1,
'spaces_after_command' => {},
- 'text_arg' => 'other file'
+ 'text_arg' => 'other file '
},
'line_nr' => {},
'parent' => {}
@@ -111,7 +111,7 @@
'cmdname' => 'setfilename',
'extra' => {
'spaces_after_command' => {},
- 'text_arg' => 'file'
+ 'text_arg' => 'file '
},
'line_nr' => {},
'parent' => {}
Modified: trunk/tp/t/results/include/macro_and_commands_in_early_commands.pl
===================================================================
--- trunk/tp/t/results/include/macro_and_commands_in_early_commands.pl
2016-08-01 14:21:45 UTC (rev 7292)
+++ trunk/tp/t/results/include/macro_and_commands_in_early_commands.pl
2016-08-01 19:01:33 UTC (rev 7293)
@@ -95,7 +95,7 @@
'cmdname' => 'setfilename',
'extra' => {
'spaces_after_command' => {},
- 'text_arg' => 'macro_i--n_pass'
+ 'text_arg' => 'address@hidden'
},
'line_nr' => {
'file_name' => '',
@@ -192,7 +192,7 @@
'cmdname' => 'documentencoding',
'extra' => {
'spaces_after_command' => {},
- 'text_arg' => 'ISO-8859-1'
+ 'text_arg' => 'ISO-8859-1@'
},
'line_nr' => {
'file_name' => '',
@@ -392,51 +392,15 @@
'type' => 'empty_line_after_command'
},
{
- 'args' => [
+ 'contents' => [
{
- 'contents' => [
- {
- 'extra' => {
- 'command' => {}
- },
- 'parent' => {},
- 'text' => ' ',
- 'type' => 'empty_spaces_after_command'
- },
- {
- 'parent' => {},
- 'text' => 'inc_'
- },
- {
- 'cmdname' => '@',
- 'parent' => {}
- },
- {
- 'parent' => {},
- 'text' => 'f--ile.texi'
- },
- {
- 'parent' => {},
- 'text' => '
-',
- 'type' => 'spaces_at_end'
- }
- ],
'parent' => {},
- 'type' => 'misc_line_arg'
+ 'text' => 'In included file.
+'
}
],
- 'cmdname' => 'include',
- 'extra' => {
- 'spaces_after_command' => {},
- 'text_arg' => 'inc_'
- },
- 'line_nr' => {
- 'file_name' => '',
- 'line_nr' => 21,
- 'macro' => 'multiinclude'
- },
- 'parent' => {}
+ 'parent' => {},
+ 'type' => 'paragraph'
},
{
'parent' => {},
@@ -499,7 +463,7 @@
'cmdname' => 'verbatiminclude',
'extra' => {
'spaces_after_command' => {},
- 'text_arg' => 'inc_'
+ 'text_arg' => 'address@hidden'
},
'line_nr' => {
'file_name' => '',
@@ -589,14 +553,7 @@
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[1]{'parent'}
= $result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2];
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[2]{'extra'}{'command'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[1];
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[2]{'parent'}
= $result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[2]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[3]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[4]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3];
-$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'extra'}{'spaces_after_command'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'contents'}[0]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3];
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[3]{'parent'}
= $result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2];
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[4]{'parent'}
= $result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2];
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[5]{'contents'}[0]{'parent'}
=
$result_trees{'macro_and_commands_in_early_commands'}{'contents'}[2]{'contents'}[5];
@@ -638,7 +595,7 @@
@macro themacro
in themacro
@end macro
address@hidden inc_@@f--ile.texi
+In included file.
in themacro
@@ -654,6 +611,7 @@
top
***
+In included file.
in themacro
@@ -712,40 +670,22 @@
$result_errors{'macro_and_commands_in_early_commands'} = [
{
- 'error_line' => ':5: bad argument to @setfilename:
macro_i--n_pass@@texi_commands.info
+ 'error_line' => ':11: warning: encoding address@hidden' is not a canonical
texinfo encoding
',
'file_name' => '',
- 'line_nr' => 5,
+ 'line_nr' => 11,
'macro' => '',
- 'text' => 'bad argument to @setfilename:
macro_i--n_pass@@texi_commands.info',
- 'type' => 'error'
+ 'text' => 'encoding address@hidden' is not a canonical texinfo encoding',
+ 'type' => 'warning'
},
{
- 'error_line' => ':11: bad argument to @documentencoding: ISO-8859-1@@
+ 'error_line' => ':11: warning: unrecognized encoding name address@hidden'
',
'file_name' => '',
'line_nr' => 11,
'macro' => '',
- 'text' => 'bad argument to @documentencoding: ISO-8859-1@@',
- 'type' => 'error'
- },
- {
- 'error_line' => ':21: bad argument to @include: inc_@@f--ile.texi
(possibly involving @multiinclude)
-',
- 'file_name' => '',
- 'line_nr' => 21,
- 'macro' => 'multiinclude',
- 'text' => 'bad argument to @include: inc_@@f--ile.texi',
- 'type' => 'error'
- },
- {
- 'error_line' => ':25: bad argument to @verbatiminclude: inc_@@f--ile.texi
-',
- 'file_name' => '',
- 'line_nr' => 25,
- 'macro' => '',
- 'text' => 'bad argument to @verbatiminclude: inc_@@f--ile.texi',
- 'type' => 'error'
+ 'text' => 'unrecognized encoding name address@hidden'',
+ 'type' => 'warning'
}
];
Modified: trunk/tp/t/results/misc_commands/bad_documentlanguage.pl
===================================================================
--- trunk/tp/t/results/misc_commands/bad_documentlanguage.pl 2016-08-01
14:21:45 UTC (rev 7292)
+++ trunk/tp/t/results/misc_commands/bad_documentlanguage.pl 2016-08-01
19:01:33 UTC (rev 7293)
@@ -137,7 +137,7 @@
'cmdname' => 'documentlanguage',
'extra' => {
'spaces_after_command' => {},
- 'text_arg' => 'en'
+ 'text_arg' => 'en '
},
'line_nr' => {},
'parent' => {}
Modified: trunk/tp/t/results/misc_commands/invalid_documentencoding.pl
===================================================================
--- trunk/tp/t/results/misc_commands/invalid_documentencoding.pl
2016-08-01 14:21:45 UTC (rev 7292)
+++ trunk/tp/t/results/misc_commands/invalid_documentencoding.pl
2016-08-01 19:01:33 UTC (rev 7293)
@@ -335,8 +335,8 @@
],
'cmdname' => 'documentencoding',
'extra' => {
- 'missing_argument' => 1,
- 'spaces_after_command' => {}
+ 'spaces_after_command' => {},
+ 'text_arg' => '@'
},
'line_nr' => {
'file_name' => '',
@@ -663,15 +663,24 @@
'type' => 'warning'
},
{
- 'error_line' => ':9: bad argument to @documentencoding: @@
+ 'error_line' => ':9: warning: encoding address@hidden' is not a canonical
texinfo encoding
',
'file_name' => '',
'line_nr' => 9,
'macro' => '',
- 'text' => 'bad argument to @documentencoding: @@',
- 'type' => 'error'
+ 'text' => 'encoding address@hidden' is not a canonical texinfo encoding',
+ 'type' => 'warning'
},
{
+ 'error_line' => ':9: warning: unrecognized encoding name address@hidden'
+',
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => '',
+ 'text' => 'unrecognized encoding name address@hidden'',
+ 'type' => 'warning'
+ },
+ {
'error_line' => ':10: bad argument to @documentencoding: address@hidden
',
'file_name' => '',
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [7293] @@ in misc text commands,
gavinsmith0123 <=