texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve...
Date: Sun, 17 Oct 2010 15:51:32 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        10/10/17 15:51:32

Modified files:
        tp             : TODO 
        tp/Texinfo     : Parser.pm 
        tp/Texinfo/Convert: Text.pm 
        tp/t           : 02coverage.t 80include.t 
        tp/t/results/misc_commands: clickstyle.pl invalid_clickstyle.pl 

Log message:
        Keep the information of the current clickstyle in @click commands.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Text.pm?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/80include.t?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/misc_commands/clickstyle.pl?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/misc_commands/invalid_clickstyle.pl?cvsroot=texinfo&r1=1.8&r2=1.9

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- TODO        17 Oct 2010 10:50:45 -0000      1.18
+++ TODO        17 Oct 2010 15:51:31 -0000      1.19
@@ -30,8 +30,6 @@
 @c in menu lines (and maybe at other places) should be replaced by 
 \n and not eat the end of line.
 
-click should have a special arg, what command should be used.
-
 use definfoenclose information in Convert::Text?
 
 tests in test/macros, not incorporated

Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- Texinfo/Parser.pm   17 Oct 2010 13:43:42 -0000      1.74
+++ Texinfo/Parser.pm   17 Oct 2010 15:51:31 -0000      1.75
@@ -75,7 +75,8 @@
   'values' => {},
   'macros' => {},
   'expanded_formats' => [],
-  'include_directories' => [ '.' ]
+  'include_directories' => [ '.' ],
+  'clickstyle' => 'arrow'
 );
 
 my %no_brace_commands;             # commands never taking braces
@@ -213,7 +214,7 @@
 # accent commands. They may be called with and without braces.
 my %accent_commands;
 
-foreach my $no_arg_command 
('TeX','LaTeX','bullet','copyright','registeredsymbol','dots','enddots','equiv','error','expansion','arrow','minus','point','print','result','today','aa','AA','ae','oe','AE','OE','o','O','ss','l','L','DH','dh','TH','th','exclamdown','questiondown','pounds','ordf','ordm','comma','euro','geq','leq','tie','textdegree','quotedblleft','quotedblright','quoteleft','quoteright','quotedblbase','quotesinglbase','guillemetleft','guillemetright','guillemotleft','guillemotright','guilsinglleft','guilsinglright')
 {
+foreach my $no_arg_command 
('TeX','LaTeX','bullet','copyright','registeredsymbol','dots','enddots','equiv','error','expansion','arrow','minus','point','print','result','today','aa','AA','ae','oe','AE','OE','o','O','ss','l','L','DH','dh','TH','th','exclamdown','questiondown','pounds','ordf','ordm','comma','euro','geq','leq','tie','textdegree','quotedblleft','quotedblright','quoteleft','quoteright','quotedblbase','quotesinglbase','guillemetleft','guillemetright','guillemotleft','guillemotright','guilsinglleft','guilsinglright','click')
 {
   $brace_commands{$no_arg_command} = 0;
 }
 
@@ -224,7 +225,7 @@
   $brace_commands{$accent_command} = 1;
 }
 
-foreach my $one_arg_command 
('asis','b','cite','clicksequence','click','code','command','ctrl','dfn','dmn','emph','env','file','headitemfont','i','slanted','sansserif','kbd','key',,'option','r','samp','sc','strong','t','indicateurl','var','verb','titlefont','w','hyphenation','anchor','dotless')
 {
+foreach my $one_arg_command 
('asis','b','cite','clicksequence','code','command','ctrl','dfn','dmn','emph','env','file','headitemfont','i','slanted','sansserif','kbd','key',,'option','r','samp','sc','strong','t','indicateurl','var','verb','titlefont','w','hyphenation','anchor','dotless')
 {
   $brace_commands{$one_arg_command} = 1;
 }
 
@@ -2189,6 +2190,9 @@
                                               'parent' => $current, 
                                               'contents' => [] };
             $current = $current->{'contents'}->[-1];
+            if ($command eq 'click') {
+              $current->{'special'}->{'clickstyle'} = $self->{'clickstyle'};
+            }
             if ($self->{'definfoenclose'}->{$command}) {
               $current->{'type'} = 'definfoenclose_command';
               $current->{'special'} = { 
@@ -2501,6 +2505,7 @@
     # REMACRO
     if ($line =~ /^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*/) {
       $args = ['@'.$1];
+      $self->{'clickstyle'} = $1;
       my $remaining = $line;
       $remaining =~ s/^\s+@([[:alnum:]][[:alnum:]\-]*)({})?\s*//;
       _line_warn ($self, sprintf($self->__("Remaining argument on 
address@hidden line: %s"), $command, $remaining), $line_nr) if ($remaining);

Index: Texinfo/Convert/Text.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Text.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- Texinfo/Convert/Text.pm     17 Oct 2010 13:43:42 -0000      1.3
+++ Texinfo/Convert/Text.pm     17 Oct 2010 15:51:31 -0000      1.4
@@ -120,6 +120,7 @@
                'guillemotright'          => '>>',
                'guilsinglleft'          => '<',
                'guilsinglright'          => '>',
+               'click'                => '', # specially treated
 );
 
 my %no_brace_commands = (
@@ -239,10 +240,15 @@
     $result =~ s/^\s*// if ($state->{'trim_begin_space'});
   }
   if ($root->{'cmdname'}) {
-    if ($no_brace_commands{$root->{'cmdname'}}) {
+    my $command = $root->{'cmdname'};
+    if (defined($no_brace_commands{$root->{'cmdname'}})) {
       return $no_brace_commands{$root->{'cmdname'}};
-    } elsif ($brace_no_arg_commands{$root->{'cmdname'}}) {
-      return $brace_no_arg_commands{$root->{'cmdname'}};
+    } elsif (defined($brace_no_arg_commands{$root->{'cmdname'}})) {
+      $command = $root->{'special'}->{'clickstyle'}
+         if ($root->{'special'}
+          and defined($root->{'special'}->{'clickstyle'})
+          and 
defined($brace_no_arg_commands{$root->{'special'}->{'clickstyle'}}));
+      return $brace_no_arg_commands{$command};
     # commands with braces
     } elsif ($accent_commands{$root->{'cmdname'}}) {
       return '' if (!$root->{'args'});

Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- t/02coverage.t      16 Oct 2010 10:11:49 -0000      1.16
+++ t/02coverage.t      17 Oct 2010 15:51:31 -0000      1.17
@@ -5,6 +5,7 @@
 my @test_cases = (
 ['commands','@@ @TeX{} @
 @"e @address@hidden @~{a} @ringaccent a
address@hidden @click{} address@hidden
 @email{a, b}
 
 @cindex index entry in text @LaTeX{}

Index: t/80include.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/80include.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- t/80include.t       17 Oct 2010 13:43:42 -0000      1.1
+++ t/80include.t       17 Oct 2010 15:51:31 -0000      1.2
@@ -1,7 +1,5 @@
 use strict;
 
-use Test::More;
-
 require 't/test_utils.pl';
 
 my @test_cases = (

Index: t/results/misc_commands/clickstyle.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/misc_commands/clickstyle.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- t/results/misc_commands/clickstyle.pl       17 Oct 2010 10:50:47 -0000      
1.8
+++ t/results/misc_commands/clickstyle.pl       17 Oct 2010 15:51:31 -0000      
1.9
@@ -40,7 +40,9 @@
           'cmdname' => 'click',
           'contents' => [],
           'parent' => {},
-          'remaining_args' => 0
+          'special' => {
+            'clickstyle' => 'result'
+          }
         },
         {
           'parent' => {},
@@ -69,7 +71,7 @@
 
 
 $result_texts{'clickstyle'} = '
-A  (result).
+A => (result).
 ';
 
 $result_errors{'clickstyle'} = [];

Index: t/results/misc_commands/invalid_clickstyle.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/misc_commands/invalid_clickstyle.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- t/results/misc_commands/invalid_clickstyle.pl       17 Oct 2010 10:50:47 
-0000      1.8
+++ t/results/misc_commands/invalid_clickstyle.pl       17 Oct 2010 15:51:31 
-0000      1.9
@@ -46,7 +46,9 @@
           'cmdname' => 'click',
           'contents' => [],
           'parent' => {},
-          'remaining_args' => 0
+          'special' => {
+            'clickstyle' => 'result'
+          }
         },
         {
           'parent' => {},
@@ -101,7 +103,9 @@
           'cmdname' => 'click',
           'contents' => [],
           'parent' => {},
-          'remaining_args' => 0
+          'special' => {
+            'clickstyle' => 'nocmd'
+          }
         },
         {
           'parent' => {},
@@ -149,7 +153,9 @@
           'cmdname' => 'click',
           'contents' => [],
           'parent' => {},
-          'remaining_args' => 0
+          'special' => {
+            'clickstyle' => 'nocmd'
+          }
         },
         {
           'parent' => {},
@@ -206,7 +212,7 @@
 
 $result_texts{'invalid_clickstyle'} = '
 
-A  (result on the same line).
+A => (result on the same line).
 
 
 A  (nocmd).



reply via email to

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