texinfo-commits
[Top][All Lists]
Advanced

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

[8129] use def_parsed_hash instead of def_role


From: gavinsmith0123
Subject: [8129] use def_parsed_hash instead of def_role
Date: Sun, 26 Aug 2018 07:28:58 -0400 (EDT)

Revision: 8129
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8129
Author:   gavin
Date:     2018-08-26 07:28:57 -0400 (Sun, 26 Aug 2018)
Log Message:
-----------
use def_parsed_hash instead of def_role

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-08-26 10:29:47 UTC (rev 8128)
+++ trunk/ChangeLog     2018-08-26 11:28:57 UTC (rev 8129)
@@ -1,5 +1,11 @@
 2018-08-26  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Common.pm (definition_arguments_content)
+       (definition_category): Refer to 'def_parsed_hash' instead
+       of 'def_args'.
+
+2018-08-26  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Parser.pm (_parse_def): Copy the element label in
        a 'def_args' pair into the 'def_role' extra value on the 
        element.

Modified: trunk/tp/Texinfo/Common.pm
===================================================================
--- trunk/tp/Texinfo/Common.pm  2018-08-26 10:29:47 UTC (rev 8128)
+++ trunk/tp/Texinfo/Common.pm  2018-08-26 11:28:57 UTC (rev 8129)
@@ -1183,7 +1183,8 @@
   my $self = shift;
   my $current = shift;
 
-  return undef if (!$current->{'extra'} or !$current->{'extra'}->{'def_args'});
+  return undef if (!$current->{'extra'}
+      or !$current->{'extra'}->{'def_parsed_hash'});
 
   my $arg_category = $current->{'extra'}->{'def_parsed_hash'}->{'category'};
   my $arg_class = $current->{'extra'}->{'def_parsed_hash'}->{'class'};
@@ -1282,19 +1283,21 @@
   my $result;
 
   return undef if (!defined($root->{'extra'}) 
-                    or !defined($root->{'extra'}->{'def_args'}));
-  my @args = @{$root->{'extra'}->{'def_args'}};
+                    or !defined($root->{'extra'}->{'def_parsed_hash'}));
+  my @args = @{$root->{'args'}->[0]->{'contents'}};
   while (@args) {
-    last if ($args[0]->[0] ne 'spaces'
-             and !$root->{'extra'}->{'def_parsed_hash'}->{$args[0]->[0]});
+    last if (defined($args[0]->{'extra'})
+             and defined($args[0]->{'extra'}->{'def_role'})
+             and $args[0]->{'extra'}->{'def_role'} ne 'spaces'
+             and !$root->{'extra'}->{'def_parsed_hash'}
+                       ->{$args[0]->{'extra'}->{'def_role'}});
     shift @args;
   }
-  if (@args) {
-    foreach my $arg (@args) {
-      push @$result, $arg->[1];
-    }
+  if (scalar(@args) > 0) {
+    return address@hidden;
+  } else {
+    return undef;
   }
-  return $result;
 }
 
 # find the accent commands stack and the innermost text contents
@@ -1789,7 +1792,6 @@
 # extra->node_argument
 # extra->explanation_contents
 # extra->menu_entry_node
-# extra->def_arg
 
 
 sub _copy_tree($$$);
@@ -2433,7 +2435,9 @@
 
 use Data::Dumper;
 
-my @kept_keys = ('contents', 'cmdname', 'type', 'text', 'args');
+my @kept_keys = ('contents', 'cmdname', 'type', 'text', 'args',
+  'extra', 'def_role'
+);
 my %kept_keys;
 foreach my $key (@kept_keys) {
   $kept_keys{$key} = 1;




reply via email to

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