texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Common.pm (parse_node_manual): use s


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm (parse_node_manual): use same code as XS parser.
Date: Sat, 04 Mar 2023 11:47:35 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 841a7d303d * tp/Texinfo/Common.pm (parse_node_manual): use same code 
as XS parser.
841a7d303d is described below

commit 841a7d303d06e0cdbd47e1b33e291e3286de342a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Mar 4 17:44:06 2023 +0100

    * tp/Texinfo/Common.pm (parse_node_manual): use same code as XS
    parser.
    
    * tp/Texinfo/XS/parsetexi/end_line.c (parse_node_manual): minor change
    in code.
    
    * tp/t/60macro.t, tp/Makefile.tres: add macro_call_in_node_manual,
    demonstrating that source marks are lost in parse_node_manual.
---
 ChangeLog                                       |   13 +-
 tp/Makefile.tres                                |    1 +
 tp/Texinfo/Common.pm                            |  148 ++--
 tp/Texinfo/XS/parsetexi/end_line.c              |    4 +-
 tp/t/60macro.t                                  |   36 +
 tp/t/results/macro/macro_call_in_node_manual.pl | 1003 +++++++++++++++++++++++
 6 files changed, 1146 insertions(+), 59 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 76512f2508..b68b7f890d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-03-04  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (parse_node_manual): use same code as XS
+       parser.
+
+       * tp/Texinfo/XS/parsetexi/end_line.c (parse_node_manual): minor change
+       in code.
+
+       * tp/t/60macro.t, tp/Makefile.tres: add macro_call_in_node_manual,
+       demonstrating that source marks are lost in parse_node_manual.
+
 2023-03-04  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo.tex (\deflinex, \newdef): Remove.
@@ -26,7 +37,7 @@
 
        This is mainly intended for use with @defblock/@defline.
 
-2023-03-03  Patrice Dumas  <pertusus@free.fr>
+2023-03-04  Patrice Dumas  <pertusus@free.fr>
 
        Add alias_of info key for an alias used for an @-command element
 
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 1a497e348a..9f1e31125a 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -1234,6 +1234,7 @@ test_files_generated_list = 
$(test_tap_files_generated_list) \
   t/results/macro/macro_call_empty_two_arg.pl \
   t/results/macro/macro_call_in_ignored_inlinefmtifelse.pl \
   t/results/macro/macro_call_in_inlinefmtifelse_format.pl \
+  t/results/macro/macro_call_in_node_manual.pl \
   t/results/macro/macro_end_call_in_ignored_inlinefmt.pl \
   t/results/macro/macro_end_call_in_ignored_inlinefmtifelse.pl \
   t/results/macro/macro_end_call_in_ignored_inlinefmtifelse_else.pl \
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 7ce665c6f7..6b21eb1647 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1018,33 +1018,42 @@ sub parse_node_manual($;$)
   return (undef, undef)
      if (!$label_contents_container->{'contents'});
 
-  # the elements are not modified, when modifications are needed new elements
-  # are setup.
-  my @contents = @{$label_contents_container->{'contents'}};
+  my $contents = $label_contents_container->{'contents'};
+
+  my $idx = 0;
 
   my $manual;
   my $result;
-  my ($end_paren, $spaces_after);
+  my $node_content = [];
 
   # FIXME replace source marks
-  if ($contents[0] and $contents[0]->{'text'} and $contents[0]->{'text'} =~ 
/^\(/) {
+  if ($contents->[0] and $contents->[0]->{'text'}
+      and $contents->[0]->{'text'} =~ /^\(/) {
+    my ($new_first, $opening_brace);
     $manual = [];
-    # remove the leading ( from @contents, it is not in manual_content.
-    my $braces_count = 1;
-    if ($contents[0]->{'text'} ne '(') {
-      my $first_element = shift @contents;
-      my $brace_text = $first_element->{'text'};
+    my $braces_count = 1; # Number of ( seen minus number of ) seen.
+    # the leading ( from @$contents is not in manual.
+    # If the first contents element is "(" followed by more text, split
+    # the leading "(" into its own element.
+    my $first = $contents->[0];
+    if ($first->{'text'} ne '(') {
+      if ($modify_node) {
+        $opening_brace = {'text' => '(', 'parent' => 
$label_contents_container};
+      }
+      my $brace_text = $first->{'text'};
       $brace_text =~ s/^\(//;
-      my $new_element = { 'text' => $brace_text,
-                          'parent' => $first_element->{'parent'} };
-      $new_element->{'type'} = $first_element->{'type'}
-         if defined($first_element->{'type'});
-      unshift @contents, $new_element;
+      $new_first = { 'text' => $brace_text};
     } else {
-      shift @contents;
+      # first element is "(", it is not part of the manual, keep it
+      $idx++;
     }
-    while (@contents) {
-      my $content = shift @contents;
+    for (; $idx < scalar(@$contents); $idx++) {
+      my $content;
+      if ($idx == 0) {
+        $content = $new_first;
+      } else {
+        $content = $contents->[$idx];
+      }
       if (!defined($content->{'text'}) or $content->{'text'} !~ /\)/) {
         push @$manual, $content;
         $braces_count = _count_opened_tree_braces($content, $braces_count);
@@ -1057,16 +1066,60 @@ sub parse_node_manual($;$)
         ($before, $after, $braces_count) = _find_end_brace($content->{'text'},
                                                               $braces_count);
         if ($braces_count == 0) {
+          # At this point, we are sure that there is a manual part,
+          # so the pending removal/addition of elements at the beginning
+          # of the manual can proceed (if modify_node).
+          if ($modify_node) {
+            if ($opening_brace) {
+              # remove the original first element and prepend the
+              # split "(" and text elements
+              shift @$contents;
+              $new_first ->{'parent'} = $label_contents_container;
+              unshift @$contents, $new_first;
+              unshift @$contents, $opening_brace;
+              $idx++;
+            }
+            # Remove current element $content with closing brace from the tree.
+            splice(@$contents, $idx, 1);
+          }
+
           # remove the closing ), it is not in manual_content
           $before =~ s/(\))$//;
-          $end_paren = $1;
-          push @$manual, { 'text' => $before, 'parent' => $content->{'parent'} 
}
-            if ($before ne '');
+          my $end_paren = $1;
+          if ($before ne '') {
+            # text before ), part of the manual name
+            my $last_manual_element = { 'text' => $before };
+            push @$manual, $last_manual_element;
+            if ($modify_node) {
+              $last_manual_element->{'parent'} = $content->{'parent'};
+              splice(@$contents, $idx, 0, $last_manual_element);
+              $idx++;
+            }
+          }
+          if ($modify_node) {
+            my $closing_brace = {'text' => ')',
+                                 'parent' => $content->{'parent'}};
+            splice(@$contents, $idx, 0, $closing_brace);
+            $idx++;
+          }
           $after =~ s/^(\s*)//;
-          $spaces_after = $1;
-          # put back everything appearing after the )
-          unshift @contents,  { 'text' => $after, 'parent' => 
$content->{'parent'} }
-            if ($after ne '');
+          my $spaces_after = $1;
+          if ($spaces_after and $modify_node) {
+            my $spaces_element = {'text' => $spaces_after,
+                                  'parent' => $content->{'parent'}};
+            splice(@$contents, $idx, 0, $spaces_element);
+            $idx++;
+          }
+          if ($after ne '') {
+            # text after ), part of the node name.
+            my $leading_node_content = {'text' => $after};
+            push @$node_content, $leading_node_content;
+            if ($modify_node) {
+              $leading_node_content->{'parent'} = $content->{'parent'};
+              splice(@$contents, $idx, 0, $leading_node_content);
+            }
+            $idx++;
+          }
           last;
         } else {
           push @$manual, $content;
@@ -1074,41 +1127,22 @@ sub parse_node_manual($;$)
       }
     }
     if ($braces_count != 0) {
-      # unclosed brace, reset @contents
-      @contents = @{$label_contents_container->{'contents'}};
+      # unclosed brace, reset
       $manual = undef;
+      $idx = 0;
+    } else {
+      $result = {};
+      $result->{'manual_content'} = $manual;
     }
   }
-  my $node_content;
-  if (scalar(@contents) > 0) {
-    $node_content = \@contents;
-  }
-
-  if (($manual and scalar(@$manual)) or $node_content) {
-    $result = {};
-    $result->{'node_content'} = $node_content if ($node_content);
-    $result->{'manual_content'} = $manual if ($manual and scalar(@$manual));
-  }
-
-  if ($modify_node) {
-    # contents array in which all the elements in 'manual_content'
-    # and 'node_content' have been put, replacing the argument
-    # element contents.
-    my $new_contents = [];
-    if (defined($result) and defined($result->{'manual_content'})) {
-      @$new_contents = ({ 'text' => '(', 'parent' => $label_contents_container 
},
-                        @$manual);
-      push @$new_contents, {  'text' => ')',
-                              'parent' => $label_contents_container }
-        if $end_paren;
-      push @$new_contents, { 'text' => $spaces_after,
-                             'parent' => $label_contents_container }
-        if $spaces_after;
-    }
-    if (@contents) {
-      @$new_contents = (@$new_contents, @contents);
-    }
-    $label_contents_container->{'contents'} = $new_contents;
+
+  if ($idx < scalar(@$contents)) {
+    push(@$node_content, @$contents[$idx .. scalar(@$contents)-1]);
+  }
+
+  if (scalar(@$node_content)) {
+    $result = {} if (!$result);
+    $result->{'node_content'} = $node_content;
   }
 
   return $result;
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 1636c63b5f..e3ece6a5f4 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -907,11 +907,13 @@ parse_node_manual (ELEMENT *node, int modify_node)
 
       for (; idx < node->contents.number; idx++)
         {
-          ELEMENT *e = node->contents.list[idx];
+          ELEMENT *e;
           char *p, *q;
 
           if (idx == 0)
             e = new_first;
+          else
+            e = node->contents.list[idx];
 
           if (e->text.end == 0)
             {
diff --git a/tp/t/60macro.t b/tp/t/60macro.t
index bd723967c0..029b5e7604 100644
--- a/tp/t/60macro.t
+++ b/tp/t/60macro.t
@@ -615,6 +615,42 @@ Toto @inlineifclear{fl@clearargendignored{}}. After.
 
 Again with space @inlineifclear{fl@clearargendignored{} }. After.
 '],
+['macro_call_in_node_manual',
+'@macro openbrace
+(
+@end macro
+
+@macro openbracetext
+(begin
+@end macro
+
+@macro manualnameend
+last
+@end macro
+
+@macro manualnameendbrace
+last)
+@end macro
+
+@macro manualnameendbracespace
+last)   
+@end macro
+
+@macro manualnameendbracespacetext
+last)  mynode
+@end macro
+
+@menu
+* @openbrace{}a_man)::
+* @openbracetext{})::
+* @openbracetext{})the node::
+* @openbracetext{}@manualnameend{})::
+* (nom@manualnameendbrace{} distant::
+* @openbracetext{}@code{in code}@manualnameendbrace{}::
+* (nom@manualnameendbracespace{} thenode::
+* (nom@manualnameendbracespacetext{}and after::
+@end menu
+'],
 ['nested_macro_call',
 '@macro machin{}
 (machin)
diff --git a/tp/t/results/macro/macro_call_in_node_manual.pl 
b/tp/t/results/macro/macro_call_in_node_manual.pl
new file mode 100644
index 0000000000..306f886290
--- /dev/null
+++ b/tp/t/results/macro/macro_call_in_node_manual.pl
@@ -0,0 +1,1003 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'macro_call_in_node_manual'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'args' => [
+            {
+              'text' => 'openbrace',
+              'type' => 'macro_name'
+            }
+          ],
+          'cmdname' => 'macro',
+          'contents' => [
+            {
+              'text' => '(
+',
+              'type' => 'raw'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'macro'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'macro'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 3,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'arg_line' => ' openbrace
+'
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 1,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'text' => 'openbracetext',
+              'type' => 'macro_name'
+            }
+          ],
+          'cmdname' => 'macro',
+          'contents' => [
+            {
+              'text' => '(begin
+',
+              'type' => 'raw'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'macro'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'macro'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 7,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'arg_line' => ' openbracetext
+'
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 5,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'text' => 'manualnameend',
+              'type' => 'macro_name'
+            }
+          ],
+          'cmdname' => 'macro',
+          'contents' => [
+            {
+              'text' => 'last
+',
+              'type' => 'raw'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'macro'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'macro'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 11,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'arg_line' => ' manualnameend
+'
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 9,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'text' => 'manualnameendbrace',
+              'type' => 'macro_name'
+            }
+          ],
+          'cmdname' => 'macro',
+          'contents' => [
+            {
+              'text' => 'last)
+',
+              'type' => 'raw'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'macro'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'macro'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 15,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'arg_line' => ' manualnameendbrace
+'
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 13,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'text' => 'manualnameendbracespace',
+              'type' => 'macro_name'
+            }
+          ],
+          'cmdname' => 'macro',
+          'contents' => [
+            {
+              'text' => 'last)   
+',
+              'type' => 'raw'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'macro'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'macro'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 19,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'arg_line' => ' manualnameendbracespace
+'
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 17,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'text' => 'manualnameendbracespacetext',
+              'type' => 'macro_name'
+            }
+          ],
+          'cmdname' => 'macro',
+          'contents' => [
+            {
+              'text' => 'last)  mynode
+',
+              'type' => 'raw'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'macro'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'macro'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 23,
+                'macro' => ''
+              }
+            }
+          ],
+          'info' => {
+            'arg_line' => ' manualnameendbracespacetext
+'
+          },
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 21,
+            'macro' => ''
+          }
+        },
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'args' => [
+            {
+              'info' => {
+                'spaces_after_argument' => {
+                  'text' => '
+'
+                }
+              },
+              'type' => 'block_line_arg'
+            }
+          ],
+          'cmdname' => 'menu',
+          'contents' => [
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'a_man'
+                    },
+                    {
+                      'text' => ')'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ]
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 26,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'begin'
+                    },
+                    {
+                      'text' => ')'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ]
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 27,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'begin'
+                    },
+                    {
+                      'text' => ')'
+                    },
+                    {
+                      'text' => 'the node'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ],
+                    'node_content' => [
+                      {}
+                    ],
+                    'normalized' => 'the-node'
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 28,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'beginlast'
+                    },
+                    {
+                      'text' => ')'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ]
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 29,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'nomlast'
+                    },
+                    {
+                      'text' => ')'
+                    },
+                    {
+                      'text' => ' '
+                    },
+                    {
+                      'text' => 'distant'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ],
+                    'node_content' => [
+                      {}
+                    ],
+                    'normalized' => 'distant'
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 30,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'begin'
+                    },
+                    {
+                      'args' => [
+                        {
+                          'contents' => [
+                            {
+                              'text' => 'in code'
+                            }
+                          ],
+                          'type' => 'brace_command_arg'
+                        }
+                      ],
+                      'cmdname' => 'code',
+                      'source_info' => {
+                        'file_name' => '',
+                        'line_nr' => 31,
+                        'macro' => ''
+                      },
+                      'source_marks' => [
+                        {
+                          'counter' => 8,
+                          'element' => {
+                            'args' => [
+                              {
+                                'type' => 'brace_command_arg'
+                              }
+                            ],
+                            'extra' => {
+                              'name' => 'manualnameendbrace'
+                            },
+                            'type' => 'macro_call'
+                          },
+                          'sourcemark_type' => 'macro_expansion',
+                          'status' => 'start'
+                        }
+                      ]
+                    },
+                    {
+                      'text' => 'last'
+                    },
+                    {
+                      'text' => ')'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {},
+                      {},
+                      {}
+                    ]
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 31,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'nomlast'
+                    },
+                    {
+                      'text' => ')'
+                    },
+                    {
+                      'text' => '    '
+                    },
+                    {
+                      'text' => 'thenode'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ],
+                    'node_content' => [
+                      {}
+                    ],
+                    'normalized' => 'thenode'
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 32,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'contents' => [
+                {
+                  'text' => '* ',
+                  'type' => 'menu_entry_leading_text'
+                },
+                {
+                  'contents' => [
+                    {
+                      'text' => '('
+                    },
+                    {
+                      'text' => 'nomlast'
+                    },
+                    {
+                      'text' => ')'
+                    },
+                    {
+                      'text' => '  '
+                    },
+                    {
+                      'text' => 'mynodeand after'
+                    }
+                  ],
+                  'extra' => {
+                    'manual_content' => [
+                      {}
+                    ],
+                    'node_content' => [
+                      {}
+                    ],
+                    'normalized' => 'mynodeand-after'
+                  },
+                  'type' => 'menu_entry_node'
+                },
+                {
+                  'text' => '::',
+                  'type' => 'menu_entry_separator'
+                },
+                {
+                  'contents' => [
+                    {
+                      'contents' => [
+                        {
+                          'text' => '
+'
+                        }
+                      ],
+                      'type' => 'preformatted'
+                    }
+                  ],
+                  'type' => 'menu_entry_description'
+                }
+              ],
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 33,
+                'macro' => ''
+              },
+              'type' => 'menu_entry'
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => 'menu'
+                    }
+                  ],
+                  'info' => {
+                    'spaces_after_argument' => {
+                      'text' => '
+'
+                    }
+                  },
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'end',
+              'extra' => {
+                'text_arg' => 'menu'
+              },
+              'info' => {
+                'spaces_before_argument' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 34,
+                'macro' => ''
+              }
+            }
+          ],
+          'source_info' => {
+            'file_name' => '',
+            'line_nr' => 25,
+            'macro' => ''
+          }
+        }
+      ],
+      'type' => 'before_node_section'
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[0]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[0]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[1]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[1]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[2]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[2]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[2]{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[2]{'contents'}[1]{'contents'}[3];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[3]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[3]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[4]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[4]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[4]{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[4]{'contents'}[1]{'contents'}[4];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[5]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[5]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[5]{'contents'}[1]{'extra'}{'manual_content'}[1]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[5]{'contents'}[1]{'contents'}[2];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[5]{'contents'}[1]{'extra'}{'manual_content'}[2]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[5]{'contents'}[1]{'contents'}[3];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[6]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[6]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[6]{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[6]{'contents'}[1]{'contents'}[4];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[7]{'contents'}[1]{'extra'}{'manual_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[7]{'contents'}[1]{'contents'}[1];
+$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[7]{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'macro_call_in_node_manual'}{'contents'}[0]{'contents'}[12]{'contents'}[7]{'contents'}[1]{'contents'}[4];
+
+$result_texis{'macro_call_in_node_manual'} = '@macro openbrace
+(
+@end macro
+
+@macro openbracetext
+(begin
+@end macro
+
+@macro manualnameend
+last
+@end macro
+
+@macro manualnameendbrace
+last)
+@end macro
+
+@macro manualnameendbracespace
+last)   
+@end macro
+
+@macro manualnameendbracespacetext
+last)  mynode
+@end macro
+
+@menu
+* (a_man)::
+* (begin)::
+* (begin)the node::
+* (beginlast)::
+* (nomlast) distant::
+* (begin@code{in code}last)::
+* (nomlast)    thenode::
+* (nomlast)  mynodeand after::
+@end menu
+';
+
+
+$result_texts{'macro_call_in_node_manual'} = '
+
+
+
+
+
+* (a_man)::
+* (begin)::
+* (begin)the node::
+* (beginlast)::
+* (nomlast) distant::
+* (beginin codelast)::
+* (nomlast)    thenode::
+* (nomlast)  mynodeand after::
+';
+
+$result_errors{'macro_call_in_node_manual'} = [];
+
+
+$result_floats{'macro_call_in_node_manual'} = {};
+
+
+1;



reply via email to

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