texinfo-commits
[Top][All Lists]
Advanced

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

[8357] remove if (1) conditional


From: gavinsmith0123
Subject: [8357] remove if (1) conditional
Date: Sat, 20 Oct 2018 12:44:18 -0400 (EDT)

Revision: 8357
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8357
Author:   gavin
Date:     2018-10-20 12:44:17 -0400 (Sat, 20 Oct 2018)
Log Message:
-----------
remove if (1) conditional

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

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2018-10-20 16:42:21 UTC (rev 8356)
+++ trunk/tp/Texinfo/Parser.pm  2018-10-20 16:44:17 UTC (rev 8357)
@@ -4415,53 +4415,49 @@
                 }
               }
             }
-            # a container for what is on the @-command line, considered to
-            # be the @-command argument
-            if (1) {
-              $current = $current->{'contents'}->[-1];
-              $current->{'args'} = [{ 'type' => 'misc_line_arg', 
-                                      'contents' => [], 
-                                      'parent' => $current }];
-              # @node is the only misc command with args separated with comma
-              # FIXME a 3 lingering here deep into the code may not
-              # be very wise...  However having a hash only for one @-command
-              # is not very appealing either...
-              if ($command eq 'node') {
-                $current->{'remaining_args'} = 3;
-              } elsif ($command eq 'author') {
-                my $parent = $current;
-                my $found;
-                while ($parent->{'parent'}) {
-                  $parent = $parent->{'parent'};
-                  last if ($parent->{'type'}
-                          and $parent->{'type'} eq 'brace_command_context');
-                  if ($parent->{'cmdname'}) {
-                    if ($parent->{'cmdname'} eq 'titlepage') {
-                      $current->{'extra'}->{'titlepage'} = $parent;
-                      $found = 1;
-                    } elsif ($parent->{'cmdname'} eq 'quotation' or
-                        $parent->{'cmdname'} eq 'smallquotation') {
-                      push @{$parent->{'extra'}->{'authors'}}, $current;
-                      $current->{'extra'}->{'quotation'} = $parent;
-                      $found = 1;
-                    }
-                    last if ($found);
+            $current = $current->{'contents'}->[-1];
+            $current->{'args'} = [{ 'type' => 'misc_line_arg', 
+                                    'contents' => [], 
+                                    'parent' => $current }];
+            # @node is the only misc command with args separated with comma
+            # FIXME a 3 lingering here deep into the code may not
+            # be very wise...  However having a hash only for one @-command
+            # is not very appealing either...
+            if ($command eq 'node') {
+              $current->{'remaining_args'} = 3;
+            } elsif ($command eq 'author') {
+              my $parent = $current;
+              my $found;
+              while ($parent->{'parent'}) {
+                $parent = $parent->{'parent'};
+                last if ($parent->{'type'}
+                        and $parent->{'type'} eq 'brace_command_context');
+                if ($parent->{'cmdname'}) {
+                  if ($parent->{'cmdname'} eq 'titlepage') {
+                    $current->{'extra'}->{'titlepage'} = $parent;
+                    $found = 1;
+                  } elsif ($parent->{'cmdname'} eq 'quotation' or
+                      $parent->{'cmdname'} eq 'smallquotation') {
+                    push @{$parent->{'extra'}->{'authors'}}, $current;
+                    $current->{'extra'}->{'quotation'} = $parent;
+                    $found = 1;
                   }
+                  last if ($found);
                 }
-                if (!$found) {
-                  $self->line_warn(sprintf(__(
-               "address@hidden not meaningful outside address@hidden' and 
address@hidden' environments"),
-                                 $command), $current->{'line_nr'});
-                }
-              } elsif ($command eq 'dircategory' and $self->{'current_node'}) {
-                  $self->line_warn(__("address@hidden after first node"),
-                               $line_nr);
               }
+              if (!$found) {
+                $self->line_warn(sprintf(__(
+             "address@hidden not meaningful outside address@hidden' and 
address@hidden' environments"),
+                               $command), $current->{'line_nr'});
+              }
+            } elsif ($command eq 'dircategory' and $self->{'current_node'}) {
+                $self->line_warn(__("address@hidden after first node"),
+                             $line_nr);
+            }
 
-              $current = $current->{'args'}->[-1];
-              push @{$self->{'context_stack'}}, 'line' 
-                unless ($def_commands{$command});
-            }
+            $current = $current->{'args'}->[-1];
+            push @{$self->{'context_stack'}}, 'line' 
+              unless ($def_commands{$command});
             $line = _start_empty_line_after_command($line, $current, $misc);
           }
           _mark_and_warn_invalid($self, $command, $invalid_parent,




reply via email to

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