[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8315] fix @columnfractions regex
From: |
gavinsmith0123 |
Subject: |
[8315] fix @columnfractions regex |
Date: |
Wed, 17 Oct 2018 10:38:15 -0400 (EDT) |
Revision: 8315
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8315
Author: gavin
Date: 2018-10-17 10:38:14 -0400 (Wed, 17 Oct 2018)
Log Message:
-----------
fix @columnfractions regex
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Parser.pm
trunk/tp/t/06columnfractions.t
Added Paths:
-----------
trunk/tp/t/results/columnfractions/invalid.pl
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2018-10-17 14:22:34 UTC (rev 8314)
+++ trunk/ChangeLog 2018-10-17 14:38:14 UTC (rev 8315)
@@ -1,5 +1,11 @@
2018-10-17 Gavin Smith <address@hidden>
+ * tp/t/06columnfractions.t (invalid): New test.
+ * tp/Texinfo/Parser.pm (_parse_line_command_args) <@columnfractions>:
+ Change regex for a valid column fraction.
+
+2018-10-17 Gavin Smith <address@hidden>
+
* tp/Texinfo/Parser.pm (_parse_line_command_args) <@definfoenclose>:
Add new command to %brace_commands. This avoids having to check
whether a command has been added with @definfoenclose in several
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2018-10-17 14:22:34 UTC (rev 8314)
+++ trunk/tp/Texinfo/Parser.pm 2018-10-17 14:38:14 UTC (rev 8315)
@@ -5460,7 +5460,7 @@
$line_nr);
} else {
foreach my $fraction (@possible_fractions) {
- if ($fraction =~ /^(\d*\.\d+)|(\d+)\.?$/) {
+ if ($fraction =~ /^\d*\.\d+$|^\d+\.?$/) {
push @$args, $fraction;
} else {
$self->line_error (sprintf(
Modified: trunk/tp/t/06columnfractions.t
===================================================================
--- trunk/tp/t/06columnfractions.t 2018-10-17 14:22:34 UTC (rev 8314)
+++ trunk/tp/t/06columnfractions.t 2018-10-17 14:38:14 UTC (rev 8315)
@@ -15,6 +15,8 @@
@end multitable' ],
[ 'not_fraction','@multitable @columnfractions aaa
@end multitable' ],
+[ 'invalid','@multitable @columnfractions 2x.2 2.23x
address@hidden multitable' ],
[ 'empty', '@multitable @columnfractions
@end multitable' ],
[ 'empty_comment', '@multitable @columnfractions @c
Added: trunk/tp/t/results/columnfractions/invalid.pl
===================================================================
--- trunk/tp/t/results/columnfractions/invalid.pl
(rev 0)
+++ trunk/tp/t/results/columnfractions/invalid.pl 2018-10-17 14:38:14 UTC
(rev 8315)
@@ -0,0 +1,126 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'invalid'} = {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '2x.2 2.23x'
+ }
+ ],
+ 'extra' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'columnfractions',
+ 'extra' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'multitable',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'multitable'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'command_argument' => 'multitable',
+ 'spaces_before_argument' => ' ',
+ 'text_arg' => 'multitable'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'extra' => {
+ 'end_command' => {},
+ 'max_columns' => 0,
+ 'spaces_before_argument' => ' '
+ },
+ 'line_nr' => {},
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'args'}[0]{'parent'}
= $result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'} =
$result_trees{'invalid'}{'contents'}[0]{'args'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'invalid'}{'contents'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'invalid'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'} =
$result_trees{'invalid'}{'contents'}[0]{'contents'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'invalid'}{'contents'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'extra'}{'end_command'} =
$result_trees{'invalid'}{'contents'}[0]{'contents'}[0];
+$result_trees{'invalid'}{'contents'}[0]{'line_nr'} =
$result_trees{'invalid'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'line_nr'};
+$result_trees{'invalid'}{'contents'}[0]{'parent'} = $result_trees{'invalid'};
+
+$result_texis{'invalid'} = '@multitable @columnfractions 2x.2 2.23x
address@hidden multitable';
+
+
+$result_texts{'invalid'} = '';
+
+$result_errors{'invalid'} = [
+ {
+ 'error_line' => ':1: column fraction not a number: 2x.2
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'column fraction not a number: 2x.2',
+ 'type' => 'error'
+ },
+ {
+ 'error_line' => ':1: column fraction not a number: 2.23x
+',
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => '',
+ 'text' => 'column fraction not a number: 2.23x',
+ 'type' => 'error'
+ }
+];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8315] fix @columnfractions regex,
gavinsmith0123 <=