texinfo-commits
[Top][All Lists]
Advanced

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

[8133] do not use def_args array


From: gavinsmith0123
Subject: [8133] do not use def_args array
Date: Sun, 26 Aug 2018 13:18:58 -0400 (EDT)

Revision: 8133
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8133
Author:   gavin
Date:     2018-08-26 13:18:58 -0400 (Sun, 26 Aug 2018)
Log Message:
-----------
do not use def_args array

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/DocBook.pm
    trunk/tp/Texinfo/Convert/TexinfoXML.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-08-26 16:26:04 UTC (rev 8132)
+++ trunk/ChangeLog     2018-08-26 17:18:58 UTC (rev 8133)
@@ -1,5 +1,11 @@
 2018-08-26  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Convert/TexinfoXML.pm (_convert),
+       * tp/Texinfo/Convert/DocBook.pm (_convert): Use the def args in
+       the main tree instead of the 'def_args' extra array.
+
+2018-08-26  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Parser.pm (_parse_def): Include inserted content on
        def line in main tree.
        * tp/Texinfo/Convert/Texinfo.pm (convert): Ignore this inserted 

Modified: trunk/tp/Texinfo/Convert/DocBook.pm
===================================================================
--- trunk/tp/Texinfo/Convert/DocBook.pm 2018-08-26 16:26:04 UTC (rev 8132)
+++ trunk/tp/Texinfo/Convert/DocBook.pm 2018-08-26 17:18:58 UTC (rev 8133)
@@ -1292,7 +1292,8 @@
       $result .= $self->_index_entry($root);
       push @{$self->{'document_context'}}, {'monospace' => [1], 'upper_case' 
=> [0]};
       $self->{'document_context'}->[-1]->{'inline'}++;
-      if ($root->{'extra'} and $root->{'extra'}->{'def_args'}) {
+      if ($root->{'args'} and @{$root->{'args'}}
+          and $root->{'args'}->[0]->{'contents'}) {
         my $main_command;
         if ($Texinfo::Common::def_aliases{$root->{'extra'}->{'def_command'}}) {
           $main_command = 
$Texinfo::Common::def_aliases{$root->{'extra'}->{'def_command'}};
@@ -1299,9 +1300,13 @@
         } else {
           $main_command = $root->{'extra'}->{'def_command'};
         }
-        foreach my $arg (@{$root->{'extra'}->{'def_args'}}) {
-          my $type = $arg->[0];
-          my $content = $self->_convert($arg->[1]);
+        foreach my $arg (@{$root->{'args'}->[0]->{'contents'}}) {
+          next if $arg->{'type'}
+                   and $arg->{'type'} eq 'empty_spaces_after_command';
+          my $type = $arg->{'extra'}->{'def_role'};
+          next if !$type and $arg->{'type'} eq 'spaces';
+
+          my $content = $self->_convert($arg);
           if ($type eq 'spaces' or $type eq 'delimiter') {
             $result .= $content;
           } elsif ($type eq 'category') {

Modified: trunk/tp/Texinfo/Convert/TexinfoXML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/TexinfoXML.pm      2018-08-26 16:26:04 UTC (rev 
8132)
+++ trunk/tp/Texinfo/Convert/TexinfoXML.pm      2018-08-26 17:18:58 UTC (rev 
8133)
@@ -1489,7 +1489,8 @@
       $result .= $self->open_element('definitionterm');
       $result .= $self->_index_entry($root);
       push @{$self->{'document_context'}->[-1]->{'monospace'}}, 1;
-      if ($root->{'extra'} and $root->{'extra'}->{'def_args'}) {
+      if ($root->{'args'} and @{$root->{'args'}}
+          and $root->{'args'}->[0]->{'contents'}) {
         my $main_command;
         my $alias;
         if ($Texinfo::Common::def_aliases{$root->{'extra'}->{'def_command'}}) {
@@ -1499,9 +1500,12 @@
           $main_command = $root->{'extra'}->{'def_command'};
           $alias = 0;
         }
-        foreach my $arg (@{$root->{'extra'}->{'def_args'}}) {
-          my $type = $arg->[0];
-          my $content = $self->_convert($arg->[1]);
+        foreach my $arg (@{$root->{'args'}->[0]->{'contents'}}) {
+          next if $arg->{'type'}
+                   and $arg->{'type'} eq 'empty_spaces_after_command';
+          my $type = $arg->{'extra'}->{'def_role'};
+          next if !$type and $arg->{'type'} eq 'spaces';
+          my $content = $self->_convert($arg);
           if ($type eq 'spaces') {
             $content =~ s/\n$//;
             $result .= $content;
@@ -1520,11 +1524,11 @@
             } else {
               $element = $type;
             }
-            if ($arg->[1]->{'type'}
-                and ($arg->[1]->{'type'} eq 'bracketed_def_content'
-                  or ($arg->[1]->{'type'} eq 'bracketed_inserted'))) {
+            if ($arg->{'type'}
+                and ($arg->{'type'} eq 'bracketed_def_content'
+                  or ($arg->{'type'} eq 'bracketed_inserted'))) {
               push @$attribute, ('bracketed', 'on');
-              push @$attribute, _leading_spaces_before_argument($arg->[1]);
+              push @$attribute, _leading_spaces_before_argument($arg);
             }
             $result .= $self->open_element("def$element", $attribute).$content
                       .$self->close_element("def$element");




reply via email to

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