texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp/Texinfo Parser.pm


From: Patrice Dumas
Subject: texinfo/tp/Texinfo Parser.pm
Date: Mon, 18 Oct 2010 22:44:07 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        10/10/18 22:44:06

Modified files:
        tp/Texinfo     : Parser.pm 

Log message:
        Allow calling parser() without argument.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.81&r2=1.82

Patches:
Index: Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- Parser.pm   18 Oct 2010 22:09:09 -0000      1.81
+++ Parser.pm   18 Oct 2010 22:44:06 -0000      1.82
@@ -471,7 +471,7 @@
 }
 
 # initialize a parser
-sub parser($;$)
+sub parser(;$$)
 {
   my $class = shift;
   my $conf;
@@ -495,9 +495,12 @@
     bless $parser, $class;
     $conf = shift;
 
-  } else {
+  } elsif (defined($class)) {
     bless $parser, $class;
     $conf = shift;
+  } else {
+    bless $parser;
+    $conf = shift;
   }
 
   if (defined($conf)) {
@@ -766,22 +769,9 @@
     die "BUG: contents undef "._print_current($current) 
        if (!defined($current->{'contents'}));
 
-    # The code in comments takes a preceding empty line and put it in 
-    # the paragraph.
-
-    #my $previous_empty_text;
-    #if (@{$current->{'contents'}} 
-    #     and defined($current->{'contents'}->[-1]->{'text'})
-    #     and $current->{'contents'}->[-1]->{'text'} !~ /[\S\n]/) {
-    #  $previous_empty_text = pop @{$current->{'contents'}};
-    #}
     push @{$current->{'contents'}}, 
             { 'type' => 'paragraph', 'parent' => $current, 'contents' => [] };
     $current = $current->{'contents'}->[-1];
-    #if ($previous_empty_text) {
-    #  push @{$current->{'contents'}}, $previous_empty_text;
-    #  $previous_empty_text->{'parent'} = $current;
-    #}
     print STDERR "PARAGRAPH\n" if ($self->{'debug'});
     return $current;
   }



reply via email to

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