texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (%parser_state_initia


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization) (_end_line_def_line, _process_remaining_on_line), tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf), tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line), tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line): add in_parsing_only state set when only parsing should process, not any processing (error message, rearranging of the tree...).
Date: Wed, 12 Jul 2023 17:48:30 -0400

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 81869905ba * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization) 
(_end_line_def_line, _process_remaining_on_line), tp/Texinfo/XS/parsetexi/api.c 
(reset_parser_except_conf), tp/Texinfo/XS/parsetexi/end_line.c 
(end_line_def_line), tp/Texinfo/XS/parsetexi/parser.c 
(process_remaining_on_line): add in_parsing_only state set when only parsing 
should process, not any processing (error message, rearranging of the tree...).
81869905ba is described below

commit 81869905ba633cd35c4e475771dae3c235c80299
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Jul 12 23:47:41 2023 +0200

    * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization)
    (_end_line_def_line, _process_remaining_on_line),
    tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf),
    tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line),
    tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line):
    add in_parsing_only state set when only parsing should process,
    not any processing (error message, rearranging of the tree...).
    
    * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization, _next_text)
    (_process_remaining_on_line): remove value_stack, use a simpler
    integer as indicator of the number of values expansion,
    value_expansion_nr, as in the XS parser.
    
    * tp/Texinfo/XS/parsetexi/close.c (close_commands): no debug message
    if stopping closing at ET_root_line.
    
    * tp/Texinfo/ParserNonXS.pm (_close_all_style_commands, _next_text)
    (_end_line_misc_line, _end_line_starting_block, _end_line)
    (_handle_other_command, _handle_open_brace, _parse_line_command_args),
    tp/Texinfo/XS/parsetexi/close.c (close_current),
    tp/Texinfo/XS/parsetexi/context_stack.c (context_name),
    tp/Texinfo/XS/parsetexi/end_line.c (parse_line_command_args)
    (end_line_starting_block, end_line_misc_line, end_line),
    tp/Texinfo/XS/parsetexi/handle_commands.c (handle_brace_command),
    tp/Texinfo/XS/parsetexi/parser.c (parent_of_command_as_argument)
    (process_remaining_on_line), tp/Texinfo/XS/parsetexi/separator.c
    (handle_open_brace, handle_close_brace),
    tp/Texinfo/XS/parsetexi/source_marks.c (place_source_mark):
    add context_name function in XS parser. Modify debug messages,
    synchronize debug messages across both parsers.
---
 ChangeLog                                 | 34 +++++++++++++++++++++
 tp/Texinfo/ParserNonXS.pm                 | 49 +++++++++++++------------------
 tp/Texinfo/XS/parsetexi/api.c             |  1 +
 tp/Texinfo/XS/parsetexi/close.c           |  5 ++--
 tp/Texinfo/XS/parsetexi/context_stack.c   | 18 ++++++++----
 tp/Texinfo/XS/parsetexi/context_stack.h   |  1 +
 tp/Texinfo/XS/parsetexi/end_line.c        | 21 +++++++++----
 tp/Texinfo/XS/parsetexi/handle_commands.c |  2 ++
 tp/Texinfo/XS/parsetexi/parser.c          |  7 +++--
 tp/Texinfo/XS/parsetexi/parser.h          |  2 ++
 tp/Texinfo/XS/parsetexi/separator.c       |  8 +++--
 tp/Texinfo/XS/parsetexi/source_marks.c    |  2 +-
 12 files changed, 104 insertions(+), 46 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cd9419f90f..cab8c394be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,40 @@
        * tp/Texinfo/XS/parsetexi/Parsetexi.xs:
        Move or add copyright notice further up in files.
 
+2023-07-10  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization)
+       (_end_line_def_line, _process_remaining_on_line),
+       tp/Texinfo/XS/parsetexi/api.c (reset_parser_except_conf),
+       tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line),
+       tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line):
+       add in_parsing_only state set when only parsing should process,
+       not any processing (error message, rearranging of the tree...).
+
+       * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization, _next_text)
+       (_process_remaining_on_line): remove value_stack, use a simpler
+       integer as indicator of the number of values expansion,
+       value_expansion_nr, as in the XS parser.
+
+       * tp/Texinfo/XS/parsetexi/close.c (close_commands): no debug message
+       if stopping closing at ET_root_line.
+
+       * tp/Texinfo/ParserNonXS.pm (_close_all_style_commands, _next_text)
+       (_end_line_misc_line, _end_line_starting_block, _end_line)
+       (_handle_other_command, _handle_open_brace, _parse_line_command_args),
+       tp/Texinfo/XS/parsetexi/close.c (close_current),
+       tp/Texinfo/XS/parsetexi/context_stack.c (context_name),
+       tp/Texinfo/XS/parsetexi/end_line.c (parse_line_command_args)
+       (end_line_starting_block, end_line_misc_line, end_line),
+       tp/Texinfo/XS/parsetexi/handle_commands.c (handle_brace_command),
+       tp/Texinfo/XS/parsetexi/parser.c (parent_of_command_as_argument)
+       (process_remaining_on_line), tp/Texinfo/XS/parsetexi/separator.c
+       (handle_open_brace, handle_close_brace),
+       tp/Texinfo/XS/parsetexi/source_marks.c (place_source_mark):
+       add context_name function in XS parser. Modify debug messages,
+       synchronize debug messages across both parsers.
+
+
 2023-07-10  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/close.c (remove_empty_content)
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 0240e5375f..0d1fa0a242 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -141,11 +141,12 @@ my %parser_state_initialization = (
                               # value is the reference on a macro element
                               # as obtained by parsing the @macro
   'macro_expansion_nr' => 0,  # number of macros being expanded
-  'value_stack' => [],        # stack of values being expanded (more recent
-                              # first)
+  'value_expansion_nr' => 0,  # number of values being expanded
   'merged_indices' => {},     # the key is merged in the value
   'sections_level' => 0,      # modified by raise/lowersections
   'targets' => [],            # array of elements used to build 'labels'
+  'in_parsing_only' => 0,     # if set, parse only, no error message, no
+                              # rearranging...
   # initialization of information returned by global_information()
   'info' => {
     'input_encoding_name' => 'utf-8',
@@ -1497,7 +1498,7 @@ sub _close_all_style_commands($$$;$$)
                                       ->{$current->{'parent'}->{'cmdname'}})
           and $self->{'brace_commands'}
                            ->{$current->{'parent'}->{'cmdname'}} ne 'context') 
{
-    print STDERR "CLOSING(_close_all_style_commands) "
+    print STDERR "CLOSING(all_style_commands) "
       ."\@$current->{'parent'}->{'cmdname'}\n"
          if ($self->{'DEBUG'});
     $current = _close_brace_command($self, $current->{'parent'}, $source_info,
@@ -2386,10 +2387,7 @@ sub _next_text($;$)
       if ($input->{'input_source_info'}->{'macro'} ne '') {
         $self->{'macro_expansion_nr'}--;
       } elsif (defined($input->{'value_flag'})) {
-        my $top_value = shift @{$self->{'value_stack'}};
-        print STDERR "SHIFT VALUE_STACK(@{$self->{'value_stack'}}):"
-          . "$top_value\n"
-            if ($self->{'DEBUG'});
+        $self->{'value_expansion_nr'}--;
       }
     } elsif ($input->{'fh'}) {
       # Don't close STDIN
@@ -3557,8 +3555,7 @@ sub _end_line_misc_line($$$)
       # case of a conditional not ignored
       my $cond_info = pop @{$self->{'conditional_stack'}};
       my ($cond_command, $cond_source_mark) = @$cond_info;
-      print STDERR "POP END COND $end_command $cond_command "
-           ._debug_show_source_mark($cond_source_mark)." $cond_source_mark\n"
+      print STDERR "POP END COND $end_command $cond_command\n"
         if ($self->{'DEBUG'});
       my $end_source_mark = {'sourcemark_type' =>
                                  $cond_source_mark->{'sourcemark_type'},
@@ -3666,6 +3663,7 @@ sub _end_line_def_line($$$)
   if ($top_context eq 'ct_def') {
     $def_command = $current->{'parent'}->{'extra'}->{'def_command'};
   } else {
+    $self->{'in_parsing_only'}--;
     $def_command = $context_command;
     # or
     # $def_command = $current->{'parent'}->{'extra'}->{'name'};
@@ -4129,8 +4127,7 @@ sub _end_line_starting_block($$$)
                          'status' => 'start',
                          'element' => $conditional_command};
       _register_source_mark($self, $current, $source_mark);
-      print STDERR "PUSH BEGIN COND $command, "
-        ._debug_show_source_mark($source_mark)." $source_mark\n"
+      print STDERR "PUSH BEGIN COND $command\n"
           if ($self->{'DEBUG'});
       push @{$self->{'conditional_stack'}}, [$command, $source_mark];
     }
@@ -4368,13 +4365,13 @@ sub _end_line($$$)
       # if in a linemacro command call nested on a line, we do not close
       # the preceding commands yet, as they might use the expansion
       print STDERR "Expanded \@$in_macro_expansion still line/block"
-       ." command $top_context:"
-       .Texinfo::Common::debug_print_element($current)."\n"
+       ." command $top_context: "
+       .Texinfo::Common::debug_print_element($current, 1)."\n"
         if ($self->{'DEBUG'});
       return $current;
     }
-    print STDERR "Still opened line/block command $top_context:"
-      .Texinfo::Common::debug_print_element($current)."\n"
+    print STDERR "Still opened line/block command $top_context: "
+      .Texinfo::Common::debug_print_element($current, 1)."\n"
         if ($self->{'DEBUG'});
     if ($top_context eq 'ct_def') {
       while ($current->{'parent'} and !($current->{'parent'}->{'type'}
@@ -5114,7 +5111,7 @@ sub _handle_other_command($$$$$)
       # @itemize or @enumerate
       if ($parent = _item_container_parent($current)) {
         if ($command eq 'item') {
-          print STDERR "ITEM_CONTAINER\n" if ($self->{'DEBUG'});
+          print STDERR "ITEM CONTAINER\n" if ($self->{'DEBUG'});
           $parent->{'items_count'}++;
           $command_e = { 'cmdname' => $command, 'parent' => $parent,
                          'extra' =>
@@ -5802,8 +5799,8 @@ sub _handle_open_brace($$$$)
     }
     print STDERR "OPENED \@$current->{'parent'}->{'cmdname'}, remaining: "
       .(defined($current->{'parent'}->{'remaining_args'})
-          ? "remaining: $current->{'parent'}->{'remaining_args'}, " : '')
-      .($current->{'type'} ? "type: $current->{'type'}" : '')."\n"
+          ? $current->{'parent'}->{'remaining_args'} : '0')
+      .' '.Texinfo::Common::debug_print_element($current)."\n"
        if ($self->{'DEBUG'});
   } elsif ($current->{'parent'}
             and (($current->{'parent'}->{'cmdname'}
@@ -6599,7 +6596,7 @@ sub _process_remaining_on_line($$$$)
         my $value = $1;
         if (exists($self->{'values'}->{$value})) {
           if ($self->{'MAX_MACRO_CALL_NESTING'}
-             and scalar(@{$self->{'value_stack'}}) >= 
$self->{'MAX_MACRO_CALL_NESTING'}) {
+             and $self->{'value_expansion_nr'} >= 
$self->{'MAX_MACRO_CALL_NESTING'}) {
             $self->_line_warn(sprintf(__(
   "value call nested too deeply (set MAX_MACRO_CALL_NESTING to override; 
current value %d)"),
                               $self->{'MAX_MACRO_CALL_NESTING'}), 
$source_info);
@@ -6607,7 +6604,7 @@ sub _process_remaining_on_line($$$$)
             return ($current, $line, $source_info, $retval);
             # goto funexit;  # used in XS code
           }
-          unshift @{$self->{'value_stack'}}, $value;
+          $self->{'value_expansion_nr'}++;
           _input_push_text($self, $remaining_line, $source_info->{'line_nr'},
                            $source_info->{'macro'});
           _input_push_text($self, $self->{'values'}->{$value},
@@ -6853,6 +6850,7 @@ sub _process_remaining_on_line($$$$)
       push @{$current->{'contents'}}, $macro_call_element;
       $macro_call_element->{'parent'} = $current;
       $self->_push_context('ct_linecommand', $command);
+      $self->{'in_parsing_only'}++;
       $current = $macro_call_element;
       $current->{'args'} = [];
       my $line_arg = { 'type' => 'line_arg',
@@ -7312,16 +7310,11 @@ sub _parse_line_command_args($$$)
 
   if ($self->{'DEBUG'}) {
     print STDERR "MISC ARGS \@$command\n";
-    if ($arg->{'contents'} and @{$arg->{'contents'}}) {
+    if ($arg->{'contents'}) {
       my $idx = 0;
       foreach my $content (@{$arg->{'contents'}}) {
-        my $name = '';
-        $name = '@' . $content->{'cmdname'} if ($content->{'cmdname'});
-        my $type = ', t: ';
-        $type .= $content->{'type'} if ($content->{'type'});
-        my $text = ', ';
-        $type .= $content->{'text'} if ($content->{'text'});
-        print STDERR "   -> $idx $name $type $text\n";
+        print STDERR "   -> $idx "
+           .Texinfo::Common::debug_print_element($content, 0)."\n";
         $idx++;
       }
     }
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 52bc6f82b9..dfc7237fb7 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -148,6 +148,7 @@ reset_parser_except_conf (void)
 
   reset_obstacks ();
 
+  in_parsing_only = 0;
   current_node = current_section = current_part = 0;
 }
 
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index 78735ea5ec..3ce348ab5f 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -381,7 +381,7 @@ close_current (ELEMENT *current,
   if (current->cmd)
     {
       enum command_id cmd = current->cmd;
-      debug ("CLOSING (close_current) %s", command_name(cmd));
+      debug ("CLOSING(close_current) @%s", command_name(cmd));
       if (command_flags(current) & CF_brace)
         {
           current = close_brace_command (current, closed_block_command,
@@ -514,7 +514,8 @@ close_commands (ELEMENT *current, enum command_id 
closed_block_command,
       if (closed_block_command)
         line_error ("unmatched `@end %s'", command_name(closed_block_command));
       if (! ((current->cmd && command_flags(current) & CF_root)
-             || (current->type == ET_before_node_section)))
+             || (current->type == ET_before_node_section)
+             || (current->type == ET_root_line)))
         {
           debug_nonl ("close_commands unexpectedly stopped ");
           debug_print_element (current, 1); debug ("");
diff --git a/tp/Texinfo/XS/parsetexi/context_stack.c 
b/tp/Texinfo/XS/parsetexi/context_stack.c
index 9bf214d3e7..35d92a5239 100644
--- a/tp/Texinfo/XS/parsetexi/context_stack.c
+++ b/tp/Texinfo/XS/parsetexi/context_stack.c
@@ -95,6 +95,17 @@ reset_context_stack (void)
   reset_command_stack (&command_stack);
 }
 
+char *
+context_name (enum context c)
+{
+  return c == ct_preformatted ? "ct_preformatted"
+         : c == ct_line ? "ct_line"
+         : c == ct_def ? "ct_def"
+         : c == ct_brace_command ? "ct_brace_command"
+         : c == ct_linecommand ? "ct_linemacro_command"
+         : "";
+}
+
 void
 push_context (enum context c, enum command_id cmd)
 {
@@ -104,12 +115,7 @@ push_context (enum context c, enum command_id cmd)
 
   /* debug not in perl parser
   debug (">>>>>>>>>>>>>>>>>PUSHING STACK AT %d  -- %s @%s", top,
-         c == ct_preformatted ? "preformatted"
-         : c == ct_line ? "line"
-         : c == ct_def ? "def"
-         : c == ct_brace_command ? "brace_command"
-         : c == ct_linecommand ? "linemacro_command"
-         : "", command_name(cmd));
+         context_name (c), command_name(cmd));
    */
   context_stack[top] = c;
   top++;
diff --git a/tp/Texinfo/XS/parsetexi/context_stack.h 
b/tp/Texinfo/XS/parsetexi/context_stack.h
index db111b2007..dcf1c1a7b4 100644
--- a/tp/Texinfo/XS/parsetexi/context_stack.h
+++ b/tp/Texinfo/XS/parsetexi/context_stack.h
@@ -44,6 +44,7 @@ enum context pop_context (void);
 enum context current_context (void);
 void reset_context_stack (void);
 int in_context (enum context context);
+char *context_name (enum context c);
 
 
 
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 4c6786387a..8a63bd66f2 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -219,6 +219,7 @@ parse_line_command_args (ELEMENT *line_command)
         /* Remember it. */
         new_cmd = add_texinfo_command (new_command);
         add_infoenclose (new_cmd, start, end);
+        debug ("DEFINFOENCLOSE @%s: %s, %s", new_command, start, end);
         new_cmd &= ~USER_COMMAND_BIT;
 
         user_defined_command_data[new_cmd].flags
@@ -658,6 +659,7 @@ end_line_def_line (ELEMENT *current)
     }
   else
     {
+      in_parsing_only--;
       /* The following also works
       k = lookup_extra (current->parent, "name");
       def_command = lookup_command ((char *) k->value);
@@ -1225,6 +1227,8 @@ end_line_starting_block (ELEMENT *current)
                               if (command == CM_ifcommandnotdefined)
                                 iftrue = !iftrue;
                             }
+                          debug ("CONDITIONAL @%s %s: %d",
+                                 command_name(command), flag, iftrue);
                         }
                       free (flag);
                     }
@@ -1257,11 +1261,12 @@ end_line_starting_block (ELEMENT *current)
             }
           if (!memcmp (command_name(command), "ifnot", 5))
             iftrue = !iftrue;
+          debug ("CONDITIONAL @%s format %s: %d", command_name(command),
+                 p, iftrue);
         }
       else
         bug_message ("unknown conditional command @%s", command_name(command));
 
-      debug ("CONDITIONAL %s %d", command_name(command), iftrue);
       if (iftrue)
         {
           ELEMENT *e;
@@ -1272,8 +1277,9 @@ end_line_starting_block (ELEMENT *current)
           source_mark = new_source_mark (SM_type_expanded_conditional_command);
           source_mark->status = SM_status_start;
           source_mark->element = e;
-          push_conditional_stack (command, source_mark);
           register_source_mark (current, source_mark);
+          debug ("PUSH BEGIN COND %s", command_name(command));
+          push_conditional_stack (command, source_mark);
         }
     }
 
@@ -1807,6 +1813,10 @@ end_line_misc_line (ELEMENT *current)
           CONDITIONAL_STACK_ITEM *cond_info = pop_conditional_stack ();
           SOURCE_MARK *end_source_mark;
           SOURCE_MARK *cond_source_mark = cond_info->source_mark;
+
+          debug ("POP END COND %s %s", command_name(end_id),
+                 command_name(cond_info->command));
+
           end_source_mark = new_source_mark (cond_source_mark->type);
           end_source_mark->counter = cond_source_mark->counter;
           end_source_mark->status = SM_status_end;
@@ -1996,12 +2006,13 @@ end_line (ELEMENT *current)
         /* if in a linemacro command call nested on a line, we do not close
            the preceding commands yet, as they might use the expansion */
         {
-          debug ("Expanded @%s still line/block %d:", in_macro_expansion,
-                 current_context ());
+          debug_nonl ("Expanded @%s still line/block %s: ", in_macro_expansion,
+                      context_name (current_context ()));
           debug_print_element (current, 1); debug("");
           return current;
         }
-      debug_nonl ("Still opened line command %d:", current_context ());
+      debug_nonl ("Still opened line/block command %s: ",
+                  context_name (current_context ()));
       debug_print_element (current, 1); debug("");
       if (current_context () == ct_def)
         {
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index 814bcb2456..2cb868b461 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -1143,6 +1143,8 @@ handle_brace_command (ELEMENT *current, char 
**line_inout, enum command_id cmd,
   char *line = *line_inout;
   ELEMENT *command_e;
 
+  debug ("OPEN BRACE @%s", command_name(cmd));
+
   command_e = new_element (ET_NONE);
   command_e->cmd = cmd;
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 517064be0d..0d6cede3e5 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -154,6 +154,7 @@ check_space_element (ELEMENT *e)
   return 1;
 }
 
+int in_parsing_only = 0;
 
 
 /* Current node, section and part. */
@@ -1024,7 +1025,7 @@ parent_of_command_as_argument (ELEMENT *current)
 void
 register_command_as_argument (ELEMENT *cmd_as_arg)
 {
-  debug ("FOR PARENT @%s command_as_argument @%s",
+  debug ("FOR PARENT @%s command_as_argument %s",
          command_name(cmd_as_arg->parent->parent->cmd),
          command_name(cmd_as_arg->cmd));
   if (!cmd_as_arg->type)
@@ -1659,7 +1660,8 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
   while (*line == '\0')
     {
       static char *allocated_text;
-      debug ("EMPTY TEXT");
+      debug_nonl ("EMPTY TEXT in: ");
+      debug_print_element (current, 0); debug ("");
 
       /* Each place we supply Texinfo input we store the supplied
          input in a static variable like allocated_text, to prevent
@@ -2126,6 +2128,7 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
 
           add_to_element_contents (current, macro_call_element);
           push_context (ct_linecommand, cmd);
+          in_parsing_only++;
           current = macro_call_element;
           add_to_element_args (current, line_arg);
           current = line_arg;
diff --git a/tp/Texinfo/XS/parsetexi/parser.h b/tp/Texinfo/XS/parsetexi/parser.h
index 644f861dd2..a44fe74cfa 100644
--- a/tp/Texinfo/XS/parsetexi/parser.h
+++ b/tp/Texinfo/XS/parsetexi/parser.h
@@ -196,6 +196,8 @@ void gather_spaces_after_cmd_before_arg (ELEMENT *current);
 extern const char *whitespace_chars, *whitespace_chars_except_newline;
 extern const char *digit_chars;
 
+extern int in_parsing_only;
+
 extern ELEMENT *current_node;
 extern ELEMENT *current_section;
 extern ELEMENT *current_part;
diff --git a/tp/Texinfo/XS/parsetexi/separator.c 
b/tp/Texinfo/XS/parsetexi/separator.c
index 940e4adb81..9c62801a48 100644
--- a/tp/Texinfo/XS/parsetexi/separator.c
+++ b/tp/Texinfo/XS/parsetexi/separator.c
@@ -163,7 +163,11 @@ handle_open_brace (ELEMENT *current, char **line_inout)
                 push_context (ct_inlineraw, command);
             }
         }
-      debug ("OPENED");
+      debug_nonl ("OPENED @%s, remaining: %d ",
+                  command_name (current->parent->cmd),
+                  counter_value (&count_remaining_args, current->parent) > 0 ?
+                   counter_value (&count_remaining_args, current->parent) : 0);
+      debug_print_element (current, 0); debug ("");
     }
   else if (current->parent && (current->parent->cmd == CM_multitable
                                || current->parent->type == ET_def_line
@@ -274,7 +278,7 @@ handle_close_brace (ELEMENT *current, char **line_inout)
         isolate_last_space (current);
 
       closed_command = current->parent->cmd;
-      debug ("CLOSING(brace) %s", command_data(closed_command).cmdname);
+      debug ("CLOSING(brace) @%s", command_data(closed_command).cmdname);
       counter_pop (&count_remaining_args);
 
       if (current->contents.number > 0
diff --git a/tp/Texinfo/XS/parsetexi/source_marks.c 
b/tp/Texinfo/XS/parsetexi/source_marks.c
index b7d6480c2a..7efb410057 100644
--- a/tp/Texinfo/XS/parsetexi/source_marks.c
+++ b/tp/Texinfo/XS/parsetexi/source_marks.c
@@ -112,7 +112,7 @@ place_source_mark (ELEMENT *e, SOURCE_MARK *source_mark)
          source_mark->counter, source_mark->position,
          source_mark->status == SM_status_start ? "start"
           : source_mark->status == SM_status_end ? "end"
-          : "SM_status UNKNOWN", add_element_string);
+          : "UNDEF", add_element_string);
   debug_print_element(mark_element, 0); debug_nonl (" ");
   debug_print_element(e, 0); debug ("");
 



reply via email to

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