texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/tp TODO Texinfo/Parser.pm t/55condition...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Parser.pm t/55condition...
Date: Sat, 15 Sep 2012 18:26:17 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/09/15 18:26:17

Modified files:
        tp             : TODO 
        tp/Texinfo     : Parser.pm 
        tp/t           : 55conditionals.t 
Added files:
        tp/t/results/conditionals: command_conditionals_user_defined.pl 

Log message:
        @ifcommanddefined is true for user defined macros, @alias, 
@definfoenclose
        and @xxxxindex defined through @defindex xxxx.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.299&r2=1.300
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.399&r2=1.400
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/55conditionals.t?cvsroot=texinfo&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/conditionals/command_conditionals_user_defined.pl?cvsroot=texinfo&rev=1.1

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -b -r1.299 -r1.300
--- TODO        9 Sep 2012 09:46:23 -0000       1.299
+++ TODO        15 Sep 2012 18:26:16 -0000      1.300
@@ -104,6 +104,11 @@
 
 Implement what is proposed in HTML Cross Reference Mismatch.
 
+add an option like --check-htmlxref (or a customization variable?)
+which would check that every cross-manual xref is included in
+htmlxref.cnf?  That would give a way for people to know if their HTML is
+going to have broken links.  Use warnings.
+
 Protection of punctuation in nodes.
 in @ref. First : is searched.  if followed by a : the node name is found
 and there is no label. When parsing a node a filename with ( is searched for.

Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.399
retrieving revision 1.400
diff -u -b -r1.399 -r1.400
--- Texinfo/Parser.pm   15 Sep 2012 12:19:42 -0000      1.399
+++ Texinfo/Parser.pm   15 Sep 2012 18:26:16 -0000      1.400
@@ -4429,9 +4429,16 @@
               # REMACRO
               if ($line =~ /^\s+([[:alnum:]][[:alnum:]\-]*)/) {
                 my $name = $1;
-                if ((exists($Texinfo::Common::all_commands{$name}) 
+                my $command_is_defined = (
+                  exists($Texinfo::Common::all_commands{$name})
+                  or $self->{'macros'}->{$name}
+                  or $self->{'definfoenclose'}->{$name}
+                  or $self->{'aliases'}->{$name}
+                  or $self->{'command_index_prefix'}->{$name}
+                );
+                if (($command_is_defined
                      and $command eq 'ifcommanddefined')
-                    or (!exists($Texinfo::Common::all_commands{$name})
+                    or (! $command_is_defined
                          and $command eq 'ifcommandnotdefined')) {
                   $ifvalue_true = 1;
                 }

Index: t/55conditionals.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/55conditionals.t,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- t/55conditionals.t  10 Jul 2012 22:32:31 -0000      1.15
+++ t/55conditionals.t  15 Sep 2012 18:26:16 -0000      1.16
@@ -374,6 +374,45 @@
 Happily, @@mathcode is not defined.
 @end ifcommandnotdefined
 '],
+['command_conditionals_user_defined',
+'@macro truc
+machin
address@hidden macro
+
address@hidden auth
+
address@hidden infoencl, :,:
+
address@hidden strongalias = strong
+
address@hidden truc
+@@macro truc is defined.
address@hidden ifcommanddefined
address@hidden truc
+@@macro truc is wrongly not defined
address@hidden ifcommandnotdefined
+
address@hidden authindex
+index command @@authindex is defined.
address@hidden ifcommanddefined
address@hidden authindex
+index command @@authindex is wrongly not defined
address@hidden ifcommandnotdefined
+
address@hidden infoencl
+definfoenclose @@infoencl is defined.
address@hidden ifcommanddefined
address@hidden infoencl
+definfoenclose @@infoencl is wrongly not defined
address@hidden ifcommandnotdefined
+
address@hidden strongalias
+strongalias @@alias is defined.
address@hidden ifcommanddefined
address@hidden strongalias
+strongalias @@alias is wrongly not defined
address@hidden ifcommandnotdefined
+'],
 );
 
 our ($arg_test_case, $arg_generate, $arg_debug);

Index: t/results/conditionals/command_conditionals_user_defined.pl
===================================================================
RCS file: t/results/conditionals/command_conditionals_user_defined.pl
diff -N t/results/conditionals/command_conditionals_user_defined.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/results/conditionals/command_conditionals_user_defined.pl 15 Sep 2012 
18:26:16 -0000      1.1
@@ -0,0 +1,418 @@
+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{'command_conditionals_user_defined'} = {
+  'contents' => [
+    {
+      'args' => [
+        {
+          'parent' => {},
+          'text' => 'truc',
+          'type' => 'macro_name'
+        }
+      ],
+      'cmdname' => 'macro',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => 'machin',
+          'type' => 'raw'
+        },
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'last_raw_newline'
+        }
+      ],
+      'extra' => {
+        'arg_line' => ' truc
+',
+        'macrobody' => 'machin
+',
+        'spaces_after_command' => {
+          'extra' => {
+            'command' => {}
+          },
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line_after_command'
+        }
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 1,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {},
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'extra' => {
+                'command' => {}
+              },
+              'parent' => {},
+              'text' => ' ',
+              'type' => 'empty_spaces_after_command'
+            },
+            {
+              'parent' => {},
+              'text' => 'auth'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'spaces_at_end'
+            }
+          ],
+          'parent' => {},
+          'type' => 'misc_line_arg'
+        }
+      ],
+      'cmdname' => 'defindex',
+      'extra' => {
+        'misc_args' => [
+          'auth'
+        ],
+        'spaces_after_command' => {}
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 5,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'extra' => {
+                'command' => {}
+              },
+              'parent' => {},
+              'text' => ' ',
+              'type' => 'empty_spaces_after_command'
+            },
+            {
+              'parent' => {},
+              'text' => 'infoencl, :,:'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'spaces_at_end'
+            }
+          ],
+          'parent' => {},
+          'type' => 'misc_line_arg'
+        }
+      ],
+      'cmdname' => 'definfoenclose',
+      'extra' => {
+        'misc_args' => [
+          'infoencl',
+          ':',
+          ':'
+        ],
+        'spaces_after_command' => {}
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 7,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'extra' => {
+                'command' => {}
+              },
+              'parent' => {},
+              'text' => ' ',
+              'type' => 'empty_spaces_after_command'
+            },
+            {
+              'parent' => {},
+              'text' => 'strongalias = strong'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'spaces_at_end'
+            }
+          ],
+          'parent' => {},
+          'type' => 'misc_line_arg'
+        }
+      ],
+      'cmdname' => 'alias',
+      'extra' => {
+        'misc_args' => [
+          'strongalias',
+          'strong'
+        ],
+        'spaces_after_command' => {}
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 9,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'contents' => [
+        {
+          'cmdname' => '@',
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => 'macro truc is defined.
+'
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => 'index command '
+        },
+        {
+          'cmdname' => '@',
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => 'authindex is defined.
+'
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => 'definfoenclose '
+        },
+        {
+          'cmdname' => '@',
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => 'infoencl is defined.
+'
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => 'strongalias '
+        },
+        {
+          'cmdname' => '@',
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => 'alias is defined.
+'
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    }
+  ],
+  'type' => 'text_root'
+};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'args'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'extra'}{'spaces_after_command'}{'extra'}{'command'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'extra'}{'spaces_after_command'}{'parent'}
 = $result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[1] = 
$result_trees{'command_conditionals_user_defined'}{'contents'}[0]{'extra'}{'spaces_after_command'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[2]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[3];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[3];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'extra'}{'spaces_after_command'}
 = 
$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[3]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[4]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[5];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[5];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'extra'}{'spaces_after_command'}
 = 
$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'args'}[0]{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[5]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[6]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[7];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[7];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'extra'}{'spaces_after_command'}
 = 
$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'args'}[0]{'contents'}[0];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[7]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[8]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[9]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[9];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[9]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[9];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[9]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[10]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[11]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[11];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[11]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[11];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[11]{'contents'}[2]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[11];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[11]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[12]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[13]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[13];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[13]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[13];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[13]{'contents'}[2]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[13];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[13]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[14]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+$result_trees{'command_conditionals_user_defined'}{'contents'}[15]{'contents'}[0]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[15];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[15]{'contents'}[1]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[15];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[15]{'contents'}[2]{'parent'}
 = $result_trees{'command_conditionals_user_defined'}{'contents'}[15];
+$result_trees{'command_conditionals_user_defined'}{'contents'}[15]{'parent'} = 
$result_trees{'command_conditionals_user_defined'};
+
+$result_texis{'command_conditionals_user_defined'} = '@macro truc
+machin
address@hidden macro
+
address@hidden auth
+
address@hidden infoencl, :,:
+
address@hidden strongalias = strong
+
+@@macro truc is defined.
+
+index command @@authindex is defined.
+
+definfoenclose @@infoencl is defined.
+
+strongalias @@alias is defined.
+';
+
+
+$result_texts{'command_conditionals_user_defined'} = '
+
+
+
address@hidden truc is defined.
+
+index command @authindex is defined.
+
+definfoenclose @infoencl is defined.
+
+strongalias @alias is defined.
+';
+
+$result_errors{'command_conditionals_user_defined'} = [];
+
+
+$result_indices{'command_conditionals_user_defined'} = {
+  'index_names' => {
+    'auth' => {
+      'auth' => 0
+    },
+    'cp' => {
+      'c' => 0,
+      'cp' => 0
+    },
+    'fn' => {
+      'f' => 1,
+      'fn' => 1
+    },
+    'ky' => {
+      'k' => 1,
+      'ky' => 1
+    },
+    'pg' => {
+      'p' => 1,
+      'pg' => 1
+    },
+    'tp' => {
+      't' => 1,
+      'tp' => 1
+    },
+    'vr' => {
+      'v' => 1,
+      'vr' => 1
+    }
+  }
+};
+
+
+1;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]