[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Parser.pm t/58alias.t t/60ma...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Parser.pm t/58alias.t t/60ma... |
Date: |
Wed, 06 Oct 2010 22:26:13 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 10/10/06 22:26:12
Modified files:
tp/Texinfo : Parser.pm
tp/t : 58alias.t 60macro.t
tp/t/results/alias: bad_line.pl simple.pl
tp/t/results/macro: bad_formal_arg.pl macro_in_line_commands.pl
no_macrobody.pl two_macros_on_a_line.pl
Log message:
No _ in @-command names.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/58alias.t?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/60macro.t?cvsroot=texinfo&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/alias/bad_line.pl?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/alias/simple.pl?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/bad_formal_arg.pl?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/macro_in_line_commands.pl?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/no_macrobody.pl?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/macro/two_macros_on_a_line.pl?cvsroot=texinfo&r1=1.2&r2=1.3
Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- Texinfo/Parser.pm 6 Oct 2010 21:22:47 -0000 1.48
+++ Texinfo/Parser.pm 6 Oct 2010 22:26:12 -0000 1.49
@@ -665,8 +665,8 @@
my $line_nr = shift;
my $macro = { 'cmdname' => $command, 'parent' => $parent, 'contents' => [],
'special' => {'macro_line' => $line} };
- #if ($line =~ /^\s+(\w[\w-]*)\s*(.*)/) {
- if ($line =~ /^\s+([\w\-]+)\s*(.*)/) {
+ # REMACRO
+ if ($line =~ /^\s+([[:alnum:]][[:alnum:]-]*)\s*(.*)/) {
my $macro_name = $1;
my $args_def = $2;
my @args;
@@ -1378,11 +1378,11 @@
# handle user defined macros before anything else since
# their expansion may lead to changes in the line
# REMACRO
- if ($line =~ /^\@(\w[\w-]*)/
+ if ($line =~ /^\@([[:alnum:]][[:alnum:]-]*)/
and ($self->{'macros'}->{$1}
or (exists $self->{'aliases'}->{$1} and
$self->{'macros'}->{$self->{'aliases'}->{$1}}))) {
- $line =~ s/^\@(\w[\w-]*)//o;
+ $line =~ s/^\@([[:alnum:]][[:alnum:]-]*)//o;
my $command = $1;
$command = $self->{'aliases'}->{$command}
if (exists($self->{'aliases'}->{$command}));
@@ -1483,8 +1483,9 @@
$current->{'cmdname'}), $line_nr);
$current = $current->{'parent'};
}
+ # REMACRO
} elsif ($line =~ s/^\@(["'address@hidden,\.!\?\s\*\-\^`=:\|\/\\])//o
- or $line =~ s/^\@(\w[\w-]*)//o) {
+ or $line =~ s/^\@([[:alnum:]][[:alnum:]-]*)//o) {
my $command = $1;
$command = $self->{'aliases'}->{$command}
if (exists($self->{'aliases'}->{$command}));
@@ -1522,7 +1523,8 @@
}
if ($command eq 'end') {
- if ($line =~ s/^\s+(\w[\w-]*)//) {
+ # REMACRO
+ if ($line =~ s/^\s+([[:alnum:]][[:alnum:]-]*)//) {
my $end_command = $1;
print STDERR "END $end_command\n" if ($self->{'debug'});
if (!exists $block_commands{$end_command}) {
@@ -2141,7 +2143,7 @@
$line = '';
} elsif ($command eq 'unmacro') {
# REMACRO
- if ($line =~ /^\s+(\w[\w\-]*)/) {
+ if ($line =~ /^\s+([[:alnum:]][[:alnum:]\-]*)/) {
$args = [$1];
delete $self->{'macros'}->{$1};
print STDERR "UNMACRO $1\n" if ($self->{'debug'});
@@ -2152,7 +2154,7 @@
$line = '';
} elsif ($command eq 'clickstyle') {
# REMACRO
- if ($line =~ s/^\s+@(\w[\w\-]*)({})?\s*//) {
+ if ($line =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*//) {
$args = ['@'.$1];
_line_warn ($self, sprintf($self->__("Remaining argument on
address@hidden line: %s"), $command, $line), $line_nr) if ($line);
} else {
@@ -2237,7 +2239,7 @@
if ($command eq 'alias') {
# REMACRO
- if ($line =~ s/^(\w[\w-]*)(\s*=\s*)(\w[\w-]*)(\s*)//) {
+ if ($line =~
s/^([[:alnum:]][[:alnum:]-]*)(\s*=\s*)([[:alnum:]][[:alnum:]-]*)(\s*)//) {
$self->{'aliases'}->{$1} = $3;
$args = [$1, $3];
} else {
@@ -2247,7 +2249,7 @@
} elsif ($command eq 'definfoenclose') {
# REMACRO
- if ($line =~ s/^(\w[\w\-]*)\s*,\s*([^\s,]+)\s*,\s*([^\s,]+)//) {
+ if ($line =~
s/^([[:alnum:]][[:alnum:]\-]*)\s*,\s*([^\s,]+)\s*,\s*([^\s,]+)//) {
$args = [$1, $2, $3 ];
$self->{'definfoenclose'}->{$1} = [ $2, $3 ];
print STDERR "DEFINFOENCLOSE address@hidden: $2, $3\n" if
($self->{'debug'});
@@ -2273,7 +2275,7 @@
}
} elsif ($command eq 'defindex' || $command eq 'defcodeindex') {
# REMACRO
- if ($line =~ /^(\w[\w\-]*)\s*/) {
+ if ($line =~ /^([[:alnum:]][[:alnum:]\-]*)\s*/) {
my $name = $1;
if ($forbidden_index_name{$name}) {
_line_error($self, sprintf($self->
@@ -2289,7 +2291,7 @@
}
} elsif ($command eq 'synindex' || $command eq 'syncodeindex') {
# REMACRO
- if ($line =~ /^(\w[\w\-]*)\s+(\w[\w\-]*)/) {
+ if ($line =~ /^([[:alnum:]][[:alnum:]\-]*)\s+([[:alnum:]][[:alnum:]\-]*)/)
{
my $index_from = $1;
my $index_to = $2;
_line_error ($self, sprintf($self->__("Unknown from index `%s' in
address@hidden"), $index_from, $command), $line_nr)
Index: t/58alias.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/58alias.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- t/58alias.t 3 Oct 2010 17:58:03 -0000 1.1
+++ t/58alias.t 6 Oct 2010 22:26:12 -0000 1.2
@@ -8,11 +8,11 @@
[ 'simple',
'@alias myalias = code
address@hidden o-ther_alias=verb @c comment
address@hidden o-theralias=verb @c comment
Should be code: @myalias{code}
-Should be verb: @o-ther_alias{!verb!}
+Should be verb: @o-theralias{!verb!}
@table @myalias
@item table item (code)
@@ -20,9 +20,9 @@
'],
['bad_line',
'
address@hidden garbage_on_line =cmd garbage
address@hidden garbage-on-line =cmd garbage
address@hidden garbage_on_line =cmd @code{in code}
address@hidden garbage-on-line =cmd @code{in code}
']
);
Index: t/60macro.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/60macro.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- t/60macro.t 6 Oct 2010 21:22:48 -0000 1.11
+++ t/60macro.t 6 Oct 2010 22:26:12 -0000 1.12
@@ -19,12 +19,12 @@
@end macro after
'],
['no_macrobody',
-'@macro no_macrobody {arg}
+'@macro no-macrobody {arg}
@end macro
address@hidden line arg
address@hidden line arg
address@hidden brace}.
address@hidden brace}.
'],
['empty_end','@macro foo {aaa, }
in foo
@@ -47,7 +47,7 @@
in bad macro
@end macro
address@hidden bad_space{first, in 2arg}
address@hidden bad-space{first, in 2arg}
bad space
@end macro
@@ -193,7 +193,7 @@
in mymacro
@end macro
address@hidden mymacro_with_args{arg}
address@hidden mymacro-with-args{arg}
in with args
now the arg \arg\
after
@@ -210,7 +210,7 @@
@mymacro{} @mymacro
with args
address@hidden {an
address@hidden {an
arg
in macro} @mymacro{}
@@ -395,24 +395,24 @@
@macro fn
fn
@end macro
address@hidden syncodeindex_command
address@hidden syncodeindex-command
@syncodeindex
@end macro
@syncodeindex @cp{} @fn{}
address@hidden cp fn
address@hidden cp fn
@macro en
en
@end macro
address@hidden documentlanguage_command
address@hidden documentlanguage-command
@documentlanguage
@end macro
documentlanguage @documentlanguage @en{}
documentlanguage on its line
address@hidden en
address@hidden en
line following documentlanguage
@macro truc
@@ -423,11 +423,11 @@
@defindex @truc{}
after
address@hidden trucindex_command
address@hidden trucindex-command
@trucindex
@end macro
address@hidden index truc
address@hidden index truc
@macro codeidx
codeidx
@@ -435,11 +435,11 @@
@defcodeindex @codeidx{}
address@hidden defcodeindex_entry
address@hidden defcodeindex-entry
a @var{index entry} address@hidden'e @address@hidden
@end macro
address@hidden @defcodeindex_entry{}
address@hidden @defcodeindex-entry{}
@cindex cindex entry
Index: t/results/alias/bad_line.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/alias/bad_line.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/results/alias/bad_line.pl 4 Oct 2010 07:02:40 -0000 1.2
+++ t/results/alias/bad_line.pl 6 Oct 2010 22:26:12 -0000 1.3
@@ -14,7 +14,7 @@
'contents' => [
{
'parent' => {},
- 'text' => 'garbage_on_line =cmd garbage
+ 'text' => 'garbage-on-line =cmd garbage
'
}
],
@@ -26,7 +26,7 @@
'parent' => {},
'special' => {
'misc_args' => [
- 'garbage_on_line',
+ 'garbage-on-line',
'cmd'
]
}
@@ -43,7 +43,7 @@
'contents' => [
{
'parent' => {},
- 'text' => 'garbage_on_line =cmd '
+ 'text' => 'garbage-on-line =cmd '
},
{
'args' => [
@@ -77,7 +77,7 @@
'parent' => {},
'special' => {
'misc_args' => [
- 'garbage_on_line',
+ 'garbage-on-line',
'cmd'
]
}
@@ -98,9 +98,9 @@
$result_trees{'bad_line'}{'contents'}[3]{'parent'} = $result_trees{'bad_line'};
$result_texts{'bad_line'} = '
address@hidden garbage_on_line =cmd garbage
address@hidden garbage-on-line =cmd garbage
address@hidden garbage_on_line =cmd @code{in code}
address@hidden garbage-on-line =cmd @code{in code}
';
$result_errors{'bad_line'} = [
Index: t/results/alias/simple.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/alias/simple.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/results/alias/simple.pl 4 Oct 2010 07:02:40 -0000 1.2
+++ t/results/alias/simple.pl 6 Oct 2010 22:26:12 -0000 1.3
@@ -37,7 +37,7 @@
'contents' => [
{
'parent' => {},
- 'text' => 'o-ther_alias=verb '
+ 'text' => 'o-theralias=verb '
},
{
'args' => [
@@ -60,7 +60,7 @@
'parent' => {},
'special' => {
'misc_args' => [
- 'o-ther_alias',
+ 'o-theralias',
'verb'
]
}
@@ -235,7 +235,7 @@
$result_texts{'simple'} = '@alias myalias = code
address@hidden o-ther_alias=verb @c comment
address@hidden o-theralias=verb @c comment
Should be code: @code{code}
Index: t/results/macro/bad_formal_arg.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/macro/bad_formal_arg.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/results/macro/bad_formal_arg.pl 30 Sep 2010 05:35:14 -0000 1.2
+++ t/results/macro/bad_formal_arg.pl 6 Oct 2010 22:26:12 -0000 1.3
@@ -57,7 +57,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'bad_space',
+ 'text' => 'bad-space',
'type' => 'macro_name'
},
{
@@ -86,7 +86,7 @@
'first' => 0,
'in 2arg' => 1
},
- 'macro_line' => ' bad_space{first, in 2arg}
+ 'macro_line' => ' bad-space{first, in 2arg}
',
'macrobody' => 'bad space
'
@@ -177,7 +177,7 @@
in bad macro
@end macro
address@hidden bad_space{first, in 2arg}
address@hidden bad-space{first, in 2arg}
bad space
@end macro
Index: t/results/macro/macro_in_line_commands.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/macro/macro_in_line_commands.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- t/results/macro/macro_in_line_commands.pl 6 Oct 2010 21:22:48 -0000
1.1
+++ t/results/macro/macro_in_line_commands.pl 6 Oct 2010 22:26:12 -0000
1.2
@@ -56,7 +56,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'syncodeindex_command',
+ 'text' => 'syncodeindex-command',
'type' => 'macro_name'
}
],
@@ -71,7 +71,7 @@
],
'parent' => {},
'special' => {
- 'macro_line' => ' syncodeindex_command
+ 'macro_line' => ' syncodeindex-command
',
'macrobody' => '@syncodeindex
'
@@ -164,7 +164,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'documentlanguage_command',
+ 'text' => 'documentlanguage-command',
'type' => 'macro_name'
}
],
@@ -179,7 +179,7 @@
],
'parent' => {},
'special' => {
- 'macro_line' => ' documentlanguage_command
+ 'macro_line' => ' documentlanguage-command
',
'macrobody' => '@documentlanguage
'
@@ -342,7 +342,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'trucindex_command',
+ 'text' => 'trucindex-command',
'type' => 'macro_name'
}
],
@@ -357,7 +357,7 @@
],
'parent' => {},
'special' => {
- 'macro_line' => ' trucindex_command
+ 'macro_line' => ' trucindex-command
',
'macrobody' => '@trucindex
'
@@ -455,7 +455,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'defcodeindex_entry',
+ 'text' => 'defcodeindex-entry',
'type' => 'macro_name'
}
],
@@ -470,7 +470,7 @@
],
'parent' => {},
'special' => {
- 'macro_line' => ' defcodeindex_entry
+ 'macro_line' => ' defcodeindex-entry
',
'macrobody' => 'a @var{index entry} address@hidden'e @address@hidden
'
@@ -1334,7 +1334,7 @@
@macro fn
fn
@end macro
address@hidden syncodeindex_command
address@hidden syncodeindex-command
@syncodeindex
@end macro
@@ -1344,7 +1344,7 @@
@macro en
en
@end macro
address@hidden documentlanguage_command
address@hidden documentlanguage-command
@documentlanguage
@end macro
@@ -1362,7 +1362,7 @@
@defindex truc
after
address@hidden trucindex_command
address@hidden trucindex-command
@trucindex
@end macro
@@ -1374,7 +1374,7 @@
@defcodeindex codeidx
address@hidden defcodeindex_entry
address@hidden defcodeindex-entry
a @var{index entry} address@hidden'e @address@hidden
@end macro
Index: t/results/macro/no_macrobody.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/macro/no_macrobody.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/results/macro/no_macrobody.pl 6 Oct 2010 21:22:48 -0000 1.2
+++ t/results/macro/no_macrobody.pl 6 Oct 2010 22:26:12 -0000 1.3
@@ -6,7 +6,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'no_macrobody',
+ 'text' => 'no-macrobody',
'type' => 'macro_name'
},
{
@@ -22,7 +22,7 @@
'args_index' => {
'arg' => 0
},
- 'macro_line' => ' no_macrobody {arg}
+ 'macro_line' => ' no-macrobody {arg}
',
'macrobody' => ''
}
@@ -66,7 +66,7 @@
$result_trees{'no_macrobody'}{'contents'}[4]{'contents'}[0]{'parent'} =
$result_trees{'no_macrobody'}{'contents'}[4];
$result_trees{'no_macrobody'}{'contents'}[4]{'parent'} =
$result_trees{'no_macrobody'};
-$result_texts{'no_macrobody'} = '@macro no_macrobody {arg}
+$result_texts{'no_macrobody'} = '@macro no-macrobody {arg}
@end macro
Index: t/results/macro/two_macros_on_a_line.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/macro/two_macros_on_a_line.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- t/results/macro/two_macros_on_a_line.pl 6 Oct 2010 21:22:48 -0000
1.2
+++ t/results/macro/two_macros_on_a_line.pl 6 Oct 2010 22:26:12 -0000
1.3
@@ -37,7 +37,7 @@
'args' => [
{
'parent' => {},
- 'text' => 'mymacro_with_args',
+ 'text' => 'mymacro-with-args',
'type' => 'macro_name'
},
{
@@ -72,7 +72,7 @@
'args_index' => {
'arg' => 0
},
- 'macro_line' => ' mymacro_with_args{arg}
+ 'macro_line' => ' mymacro-with-args{arg}
',
'macrobody' => 'in with args
now the arg \\arg\\
@@ -351,7 +351,7 @@
in mymacro
@end macro
address@hidden mymacro_with_args{arg}
address@hidden mymacro-with-args{arg}
in with args
now the arg \\arg\\
after
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Parser.pm t/58alias.t t/60ma...,
Patrice Dumas <=