texinfo-commits
[Top][All Lists]
Advanced

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

[8145] parse_def


From: gavinsmith0123
Subject: [8145] parse_def
Date: Sat, 1 Sep 2018 16:01:15 -0400 (EDT)

Revision: 8145
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8145
Author:   gavin
Date:     2018-09-01 16:01:15 -0400 (Sat, 01 Sep 2018)
Log Message:
-----------
parse_def

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-09-01 19:55:25 UTC (rev 8144)
+++ trunk/ChangeLog     2018-09-01 20:01:15 UTC (rev 8145)
@@ -1,5 +1,11 @@
 2018-09-01  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Parser.pm (_parse_def): Do not handle a leading 
+       space specially.
+       (_end_line): Account for this change.
+
+2018-09-01  Gavin Smith  <address@hidden>
+
        * tp/Texinfo/Parser.pm (_parse_def): Set 'parent' on 
        'def_aggregate' element.
 

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2018-09-01 19:55:25 UTC (rev 8144)
+++ trunk/tp/Texinfo/Parser.pm  2018-09-01 20:01:15 UTC (rev 8145)
@@ -2375,13 +2375,6 @@
 
   $current->{'contents'} = address@hidden;
 
-  if (scalar(@contents) == 1 and $contents[0]->{'type'} eq 'spaces') {
-    # if there is no argument at all, the leading space is not associated
-    # to the @-command. We do not want to have this leading space appear in 
the 
-    # arguments ever, so we ignore it here.
-    @contents = ();
-  }
-
   my @result;
   my @args = @{$def_map{$command}};
   my $arg_type;
@@ -2778,9 +2771,9 @@
     }
     my $def_command = $current->{'parent'}->{'extra'}->{'def_command'};
     my $arguments = _parse_def($self, $def_command, $current);
+    my $def_parsed_hash;
     if (scalar(@$arguments)) {
       #$current->{'parent'}->{'extra'}->{'def_args'} = $arguments;
-      my $def_parsed_hash;
       foreach my $arg (@$arguments) {
         die if (!defined($arg->[0]));
         last if ($arg->[0] eq 'arg' or $arg->[0] eq 'typearg' 
@@ -2788,6 +2781,8 @@
         next if ($arg->[0] eq 'spaces');
         $def_parsed_hash->{$arg->[0]} = $arg->[1];
       }
+    }
+    if (scalar(%$def_parsed_hash)) {
       $current->{'parent'}->{'extra'}->{'def_parsed_hash'} = $def_parsed_hash;
       # do an standard index entry tree
       my $index_entry;




reply via email to

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