texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Common.pm Texinfo/Struc...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Common.pm Texinfo/Struc...
Date: Sun, 26 Feb 2012 15:44:34 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/02/26 15:44:34

Modified files:
        tp             : TODO 
        tp/Texinfo     : Common.pm Structuring.pm 
        tp/t           : automatic_nodes.t 

Log message:
        Protect leading parenthesis in added node.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.272&r2=1.273
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.135&r2=1.136
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/automatic_nodes.t?cvsroot=texinfo&r1=1.5&r2=1.6

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -b -r1.272 -r1.273
--- TODO        26 Feb 2012 01:45:40 -0000      1.272
+++ TODO        26 Feb 2012 15:44:21 -0000      1.273
@@ -7,8 +7,6 @@
 
 Document TEXTCONTENT_COMMENT.
 
-protect leading ( when adding nodes.
-
 
 Bugs
 ====

Index: Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -b -r1.135 -r1.136
--- Texinfo/Common.pm   26 Feb 2012 01:45:40 -0000      1.135
+++ Texinfo/Common.pm   26 Feb 2012 15:44:25 -0000      1.136
@@ -1706,6 +1706,7 @@
 sub protect_first_parenthesis($)
 {
   my $contents = shift;
+  return undef if (!defined ($contents));
   my @contents = @$contents;
   my $brace;
   if ($contents[0] and $contents->[0]{'text'} and $contents[0]->{'text'} =~ 
/^\(/) {

Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- Texinfo/Structuring.pm      26 Feb 2012 01:45:40 -0000      1.120
+++ Texinfo/Structuring.pm      26 Feb 2012 15:44:28 -0000      1.121
@@ -1246,13 +1246,14 @@
 }
 
 # prepare a new node and register it
-# FIXME protect punctuation?
 sub _new_node($$)
 {
   my $self = shift;
   my $node_tree = shift;
 
   $node_tree = Texinfo::Common::protect_comma_in_tree($node_tree);
+  $node_tree->{'contents'} 
+     = Texinfo::Common::protect_first_parenthesis($node_tree->{'contents'});
 
   return undef if (!$node_tree->{'contents'} 
                    or !scalar(@{$node_tree->{'contents'}}));

Index: t/automatic_nodes.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/automatic_nodes.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- t/automatic_nodes.t 25 Feb 2012 22:34:58 -0000      1.5
+++ t/automatic_nodes.t 26 Feb 2012 15:44:31 -0000      1.6
@@ -1,7 +1,7 @@
 use strict;
 
 use Test::More;
-BEGIN { plan tests => 15 };
+BEGIN { plan tests => 18 };
 
 use lib 'maintain/lib/Unicode-EastAsianWidth/lib/';
 use lib 'maintain/lib/libintl-perl/lib/';
@@ -45,6 +45,9 @@
 test_new_node ('a ,, node @code{a,b,}', 'a-_002c_002c-node-a_002cb_002c',
 '@node a @address@hidden node @address@hidden@comma{}}
 ', 'with comma');
+test_new_node ('(in paren(too  aaa', '_0028in-paren_0028too-aaa',
+'@node @asis{(}in paren(too  aaa
+', 'with parenthesis');
 
 my $parser = Texinfo::Parser::parser();
 my $tree = $parser->parse_texi_text('@node a node



reply via email to

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