texinfo-commits
[Top][All Lists]
Advanced

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

[8437] _next_text _new_line arguments


From: gavinsmith0123
Subject: [8437] _next_text _new_line arguments
Date: Sat, 27 Oct 2018 18:47:25 -0400 (EDT)

Revision: 8437
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8437
Author:   gavin
Date:     2018-10-27 18:47:25 -0400 (Sat, 27 Oct 2018)
Log Message:
-----------
_next_text _new_line arguments

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Parser.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-10-27 22:40:06 UTC (rev 8436)
+++ trunk/ChangeLog     2018-10-27 22:47:25 UTC (rev 8437)
@@ -1,5 +1,11 @@
 2018-10-27  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Parser.pm (_next_text, _new_line): Do not pass
+       $current as an argument, as it is not used any more now the
+       check for the #line directive has been moved out.
+
+2018-10-27  Gavin Smith  <address@hidden>
+
        * tp/t/80include.t (cpp_lines): Add test of macro where a
        line that looks like a #line directive is not the very first
        line, as these may be treated differently by Parser.pm.

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2018-10-27 22:40:06 UTC (rev 8436)
+++ trunk/tp/Texinfo/Parser.pm  2018-10-27 22:47:25 UTC (rev 8437)
@@ -1809,9 +1809,9 @@
 
 # returns next text fragment, be it pending from a macro expansion or 
 # text or file
-sub _next_text($$$)
+sub _next_text($$)
 {
-  my ($self, $line_nr, $current) = @_;
+  my ($self, $line_nr) = @_;
  
   while (@{$self->{'input'}}) {
     my $input = $self->{'input'}->[0];
@@ -1854,15 +1854,15 @@
 }
 
 # collect text and line numbers until an end of line is found.
-sub _new_line($$$)
+sub _new_line($$)
 {
-  my ($self, $line_nr, $current) = @_;
+  my ($self, $line_nr) = @_;
 
   my $new_line = '';
 
   while (1) {
     my $new_text;
-    ($new_text, $line_nr) = _next_text($self, $line_nr, $current);
+    ($new_text, $line_nr) = _next_text($self, $line_nr);
     if (!defined($new_text)) {
       $new_line = undef if ($new_line eq '');
       last;
@@ -1936,7 +1936,7 @@
       print STDERR "MACRO ARG end of line\n" if ($self->{'DEBUG'});
       $arguments->[-1] .= $line;
 
-      ($line, $line_nr) = _new_line($self, $line_nr, $macro);
+      ($line, $line_nr) = _new_line($self, $line_nr);
       if (!defined($line)) {
         $self->line_error(sprintf(__("address@hidden missing closing brace"), 
            $name), $line_nr_orig);
@@ -3479,7 +3479,7 @@
  NEXT_LINE:
   while (1) {
     my $line;
-    ($line, $line_nr) = _next_text($self, $line_nr, $current);
+    ($line, $line_nr) = _next_text($self, $line_nr);
     last if (!defined($line));
 
     if ($self->{'DEBUG'}) {
@@ -3628,7 +3628,7 @@
             }
             # Ignore until end of line
             if ($line !~ /\n/) {
-              ($line, $line_nr) = _new_line($self, $line_nr, $conditional);
+              ($line, $line_nr) = _new_line($self, $line_nr);
               print STDERR "IGNORE CLOSE line: $line" if ($self->{'DEBUG'});
             }
             print STDERR "CLOSED conditional $end_command\n" if 
($self->{'DEBUG'});
@@ -3692,7 +3692,7 @@
       while ($line eq '') {
         print STDERR "EMPTY TEXT\n"
           if ($self->{'DEBUG'});
-        ($line, $line_nr) = _next_text($self, $line_nr, $current);
+        ($line, $line_nr) = _next_text($self, $line_nr);
         if (!defined($line)) {
           # end of the file or of a text fragment.
           $current = _end_line ($self, $current, $line_nr);
@@ -3740,7 +3740,7 @@
              if ($args_number >= 2);
         } else {
           if ($line !~ /\n/) {
-            ($line, $line_nr) = _new_line($self, $line_nr, $expanded_macro);
+            ($line, $line_nr) = _new_line($self, $line_nr);
             $line = '' if (!defined($line));
           }
           $line =~ s/^\s*// if ($line =~ /\S/);
@@ -4198,8 +4198,7 @@
             if ($command eq 'indent'
                 or $command eq 'noindent') {
               if ($line !~ /\n/) {
-                my ($new_line, $new_line_nr) =
-                _new_line($self, $line_nr, undef);
+                my ($new_line, $new_line_nr) = _new_line($self, $line_nr);
                 $line .= $new_line if (defined($new_line));
               }
               $line =~ s/^(\s*)//;
@@ -4263,7 +4262,7 @@
 
             # complete the line if there was a user macro expansion
             if ($line !~ /\n/) {
-              my ($new_line, $new_line_nr) = _new_line($self, $line_nr, undef);
+              my ($new_line, $new_line_nr) = _new_line($self, $line_nr);
               $line .= $new_line if (defined($new_line));
             }
             $misc = {'cmdname' => $command,
@@ -4592,7 +4591,7 @@
                     'contents' => []
                   };
                   while (not $line =~ /address@hidden/) {
-                    ($line, $line_nr) = _new_line($self, $line_nr, $current);
+                    ($line, $line_nr) = _new_line($self, $line_nr);
                     if (!$line) {
                       # unclosed block
                       $line = '';
@@ -5150,8 +5149,7 @@
                     }
                   } else {
                     my $new_text;
-                    ($new_text, $line_nr) = _next_text($self,
-                                                       $line_nr, $current);
+                    ($new_text, $line_nr) = _next_text($self, $line_nr);
                     if (!$new_text) {
                       # ERROR - unbalanced brace
                     }
@@ -5186,8 +5184,7 @@
                   }
                 } else {
                   my $new_text;
-                  ($new_text, $line_nr) = _next_text($self,
-                                                     $line_nr, $current);
+                  ($new_text, $line_nr) = _next_text($self, $line_nr);
                   $line .= $new_text;
                   if (!$line) {
                     # ERROR - unbalanced brace




reply via email to

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