texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * doc/texi2any_api.texi (Error Reporting in User


From: Patrice Dumas
Subject: branch master updated: * doc/texi2any_api.texi (Error Reporting in User Defined Functions), tp/Texinfo/Report.pm (line_warn, line_error), tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_errors), tp/Texinfo/XS/parsetexi/errors.c (debug_error_warning_message) (line_error_internal): output directly some messages for warning/errors in XS parser as is done in perl parser, using the debug_error_warning_message function. To avoid a redundant message being output when calling Texinfo::Report::line_warn or line_error from Pa [...]
Date: Thu, 13 Jul 2023 08:01:02 -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 5ee2ca61e3 * doc/texi2any_api.texi (Error Reporting in User Defined 
Functions), tp/Texinfo/Report.pm (line_warn, line_error), 
tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_errors), 
tp/Texinfo/XS/parsetexi/errors.c (debug_error_warning_message) 
(line_error_internal): output directly some messages for warning/errors in XS 
parser as is done in perl parser, using the debug_error_warning_message 
function.  To avoid a redundant message being output when calling 
Texinfo::Report::line_warn  [...]
5ee2ca61e3 is described below

commit 5ee2ca61e37e967520ed8bfb1495489cd45ebe85
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jul 13 14:00:52 2023 +0200

    * doc/texi2any_api.texi (Error Reporting in User Defined Functions),
    tp/Texinfo/Report.pm (line_warn, line_error),
    tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_errors),
    tp/Texinfo/XS/parsetexi/errors.c (debug_error_warning_message)
    (line_error_internal): output directly some messages for
    warning/errors in XS parser as is done in perl parser, using
    the debug_error_warning_message function.  To avoid a redundant
    message being output when calling Texinfo::Report::line_warn or
    line_error from Parsetexi.pm _get_errors, add an argument to
    line_warn/line_error to silence the messages output normally when
    DEBUG is set.
    
    * tp/Texinfo/ParserNonXS.pm (parser, simple_parser)
    (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/close.c
    (close_container), tp/Texinfo/XS/parsetexi/debug.c (debug_protect_eol)
    (debug_print_protected_string), tp/Texinfo/XS/parsetexi/input.c
    (next_text), tp/Texinfo/XS/parsetexi/parser.c
    (process_remaining_on_line, parse_texi): synchronize debug messages.
---
 ChangeLog                            | 25 +++++++++++++++++--
 doc/texi2any_api.texi                | 14 ++++++++---
 tp/Texinfo/ParserNonXS.pm            | 33 +++++++++++++++++--------
 tp/Texinfo/Report.pm                 | 17 +++++++++----
 tp/Texinfo/XS/parsetexi/Parsetexi.pm |  9 +++++--
 tp/Texinfo/XS/parsetexi/close.c      |  2 +-
 tp/Texinfo/XS/parsetexi/debug.c      | 48 +++++++++++++++++++++++++++---------
 tp/Texinfo/XS/parsetexi/debug.h      |  1 +
 tp/Texinfo/XS/parsetexi/errors.c     | 21 ++++++++++++++++
 tp/Texinfo/XS/parsetexi/input.c      |  1 +
 tp/Texinfo/XS/parsetexi/parser.c     | 27 +++++++++++++++++---
 11 files changed, 158 insertions(+), 40 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cab8c394be..02d001d857 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2023-07-13  Patrice Dumas  <pertusus@free.fr>
+
+       * doc/texi2any_api.texi (Error Reporting in User Defined Functions),
+       tp/Texinfo/Report.pm (line_warn, line_error),
+       tp/Texinfo/XS/parsetexi/Parsetexi.pm (_get_errors), 
+       tp/Texinfo/XS/parsetexi/errors.c (debug_error_warning_message)
+       (line_error_internal): output directly some messages for
+       warning/errors in XS parser as is done in perl parser, using
+       the debug_error_warning_message function.  To avoid a redundant
+       message being output when calling Texinfo::Report::line_warn or
+       line_error from Parsetexi.pm _get_errors, add an argument to
+       line_warn/line_error to silence the messages output normally when
+       DEBUG is set.
+
+       * tp/Texinfo/ParserNonXS.pm (parser, simple_parser)
+       (_process_remaining_on_line), tp/Texinfo/XS/parsetexi/close.c
+       (close_container), tp/Texinfo/XS/parsetexi/debug.c (debug_protect_eol)
+       (debug_print_protected_string), tp/Texinfo/XS/parsetexi/input.c
+       (next_text), tp/Texinfo/XS/parsetexi/parser.c
+       (process_remaining_on_line, parse_texi): synchronize debug messages.
+
 2023-07-12  Gavin Smith <gavinsmith0123@gmail.com>
 
        * doc/texinfo-tex-test.texi (Definitions): Add a needed
@@ -39,7 +60,7 @@
        * tp/Texinfo/XS/parsetexi/Parsetexi.xs:
        Move or add copyright notice further up in files.
 
-2023-07-10  Patrice Dumas  <pertusus@free.fr>
+2023-07-12  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (%parser_state_initialization)
        (_end_line_def_line, _process_remaining_on_line),
@@ -73,7 +94,7 @@
        synchronize debug messages across both parsers.
 
 
-2023-07-10  Patrice Dumas  <pertusus@free.fr>
+2023-07-12  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/close.c (remove_empty_content)
        (close_container, close_commands), tp/Texinfo/XS/parsetexi/end_line.c
diff --git a/doc/texi2any_api.texi b/doc/texi2any_api.texi
index 77e7bbe6a4..3dfcb65f3c 100644
--- a/doc/texi2any_api.texi
+++ b/doc/texi2any_api.texi
@@ -1386,14 +1386,19 @@ as the second argument.
 
 To report a warning or an error in element conversion, use
 @code{line_warn} or @code{line_error}
-@defun @var{$converter}->line_error ($text, $converter, $location_info)
-@defunx @var{$converter}->line_warn ($text, $converter, $location_info)
+@defun @var{$converter}->line_error ($text, $converter, $location_info, 
$continuation, $silent)
+@defunx @var{$converter}->line_warn ($text, $converter, $location_info, 
$continuation, $silent)
 Register a warning or an error.  @var{$text} is the text of the
 error or warning.  The @var{$converter} object should be given
 as the second argument.  The optional
-@var{$error_location_info} holds the information on the error or
-warning location.  The @var{$error_location_info} reference on hash may be
+@var{$location_info} holds the information on the error or
+warning location.  The @var{$location_info} reference on hash may be
 obtained from Texinfo elements @code{source_info} keys.
+
+The optional @var{$continuation} argument, if set, conveys that the message
+is a continuation of the previous registered message.  The optional
+@var{$silent} argument, if set, suppresses the immediate output of a message
+if the @code{DEBUG} customization variable is set.
 @end defun
 
 In general, registering an error does not stop the processing, in
@@ -1844,6 +1849,7 @@ 
texinfo_register_file_id_setting_function('node_file_name',
 @menu
 * File: Customizing Output File Names.
 * Target: Customizing Output Target Names.
+* Special Elements: Customizing Special Elements Output Names.
 @end menu
 
 
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 0d1fa0a242..fbb2dd7fa9 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -564,6 +564,9 @@ sub parser(;$$)
   bless $parser;
 
   _setup_conf($parser, $conf);
+  # This is not very useful in perl, but mimics the XS parser
+  print STDERR "!!!!!!!!!!!!!!!! RESETTING THE PARSER !!!!!!!!!!!!!!!!!!!!!\n"
+    if ($parser->{'DEBUG'});
 
   # Initialize command hash that are dynamically modified, notably
   # those for index commands, and definoenclose, based on defaults
@@ -624,6 +627,9 @@ sub simple_parser(;$)
   bless $parser;
 
   _setup_conf($parser, $conf);
+  # This is not very useful in perl, but mimics the XS parser
+  print STDERR "!!!!!!!!!!!!!!!! RESETTING THE PARSER !!!!!!!!!!!!!!!!!!!!!\n"
+    if ($parser->{'DEBUG'});
 
   $parser->{'line_commands'} = $simple_parser_line_commands;
   $parser->{'brace_commands'} = $simple_parser_brace_commands;
@@ -6684,7 +6690,6 @@ sub _process_remaining_on_line($$$$)
   # it by replacing the array content.
   my @current_array_for_ref = ($current);
 
-  # this situation arises when after the $current->{'cmdname'}
   # Brace commands not followed immediately by a brace
   # opening.  In particular cases that may lead to "command closing"
   # or following character association with an @-command, for accent
@@ -6696,9 +6701,12 @@ sub _process_remaining_on_line($$$$)
   if ($current->{'cmdname'}
         and defined($self->{'brace_commands'}->{$current->{'cmdname'}})
         and !$open_brace) {
-    print STDERR "BRACE CMD: no brace after \@$current->{'cmdname'}: '$line'"
-     . ($line =~ /\n/ ? '' : "\n")
-      if $self->{'DEBUG'};
+    if ($self->{'DEBUG'}) {
+      my $line_str = $line;
+      $line_str =~ s/\n/\\n/g;
+      print STDERR "BRACE CMD: no brace after \@$current->{'cmdname'}"
+          ."||| $line_str\n";
+    }
     # Note that non ascii spaces do not count as spaces
     if ($line =~ /^(\s+)/
         and ($accent_commands{$current->{'cmdname'}}
@@ -6731,6 +6739,7 @@ sub _process_remaining_on_line($$$$)
       }
       if (!$current->{'contents'}) {
         $line =~ s/^(\s+)//;
+        my $spaces_after_command = $1;
         # The added element is only transiently present, it is removed
         # by calls of gather_spaces_after_cmd_before_arg, which transfer
         # the element to the info hash.  The contents allow to have source
@@ -6740,12 +6749,16 @@ sub _process_remaining_on_line($$$$)
         # appear anywhere in the tree.
         # Note that contents is transiently set for brace commands, which in
         # general only have args.
-        my $spaces_after_cmd_before_arg
+        my $e_spaces_after_cmd_before_arg
            = {'type' => 'internal_spaces_after_cmd_before_arg',
-              'text' => $1, 'parent' => $current};
-        $current->{'contents'} = [$spaces_after_cmd_before_arg];
-        print STDERR "BRACE CMD before brace init spaces '$added_space'\n"
-          if $self->{'DEBUG'};
+              'text' => $spaces_after_command, 'parent' => $current};
+        $current->{'contents'} = [$e_spaces_after_cmd_before_arg];
+        if ($self->{'DEBUG'}) {
+          my $spaces_after_command_str = $spaces_after_command;
+          $spaces_after_command_str =~ s/\n/\\n/g;
+          print STDERR "BRACE CMD before brace init spaces ".
+                 "'$spaces_after_command_str'\n";
+        }
       } else {
         # contents, at this point can only be for spaces_after_cmd_before_arg
         if ($additional_newline
@@ -6772,7 +6785,7 @@ sub _process_remaining_on_line($$$$)
     } elsif ($accent_commands{$current->{'cmdname'}}
              and $line =~ s/^([^@])//) {
       my $arg_char = $1;
-      print STDERR "ACCENT following_arg $arg_char \@$current->{'cmdname'}\n"
+      print STDERR "ACCENT \@$current->{'cmdname'} following_arg: $arg_char\n"
         if ($self->{'DEBUG'});
       if ($current->{'contents'}) {
         _gather_spaces_after_cmd_before_arg($self, $current);
diff --git a/tp/Texinfo/Report.pm b/tp/Texinfo/Report.pm
index d3bb528977..dc426be742 100644
--- a/tp/Texinfo/Report.pm
+++ b/tp/Texinfo/Report.pm
@@ -70,13 +70,14 @@ sub errors($)
 }
 
 # format a line warning
-sub line_warn($$$$;$)
+sub line_warn($$$$;$$)
 {
   my $self = shift;
   my $configuration_information = shift;
   my $text = shift;
   my $error_location_info = shift;
   my $continuation = shift;
+  my $silent = shift;
 
   return if (!defined($error_location_info));
 
@@ -95,7 +96,8 @@ sub line_warn($$$$;$)
                          $text);
   }
   warn $warn_line if (defined($configuration_information)
-                      and $configuration_information->get_conf('DEBUG'));
+                      and $configuration_information->get_conf('DEBUG')
+                      and not $silent);
   my %location_info = %{$error_location_info};
   delete $location_info{'file_name'} if (exists ($location_info{'file_name'})
                                   and not 
defined($location_info{'file_name'}));
@@ -114,6 +116,7 @@ sub line_error($$$$;$)
   my $text = shift;
   my $error_location_info = shift;
   my $continuation = shift;
+  my $silent = shift;
 
   chomp ($text);
 
@@ -123,7 +126,8 @@ sub line_error($$$$;$)
        if ($error_location_info->{'macro'} ne '');
     my $error_text = "$text$macro_text\n";
     warn $error_text if (defined($configuration_information)
-                         and $configuration_information->get_conf('DEBUG'));
+                         and $configuration_information->get_conf('DEBUG')
+                         and not $silent);
     my %location_info = %{$error_location_info};
     delete $location_info{'file_name'} if (exists ($location_info{'file_name'})
                                   and not 
defined($location_info{'file_name'}));
@@ -287,9 +291,9 @@ the error or warning.
 
 =back
 
-=item $registrar->line_warn($text, $configuration_information, 
$error_location_info, $continuation)
+=item $registrar->line_warn($text, $configuration_information, 
$error_location_info, $continuation, $silent)
 
-=item $registrar->line_error($text, $configuration_information, 
$error_location_info, $continuation)
+=item $registrar->line_error($text, $configuration_information, 
$error_location_info, $continuation, $silent)
 X<C<line_warn>>
 X<C<line_error>>
 
@@ -306,6 +310,9 @@ should be a binary string.
 The I<$continuation> optional arguments, if true, conveys that
 the line is a continuation line of a message.
 
+The I<$silent> optional arguments, if true, suppresses the output of
+a message that is output immediatly if debugging is set.
+
 The I<source_info> key of Texinfo tree elements is described
 in more details in L<Texinfo::Parser/source_info>.
 
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm 
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index 92c9d2ecc4..ddc5ff0bef 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -291,12 +291,17 @@ sub _get_errors($)
   my $ERRORS = get_errors ();
 
   for my $error (@{$ERRORS}) {
+    # The message output in case of debugging set is already issued by
+    # the parser, therefore we set the optional argument to silence
+    # the same message that could be output here.
     if ($error->{'type'} eq 'error') {
       $registrar->line_error ($configuration_information,
-                              $error->{'message'}, $error->{'source_info'});
+                              $error->{'message'}, $error->{'source_info'},
+                              undef, 1);
     } else {
       $registrar->line_warn ($configuration_information,
-                             $error->{'message'}, $error->{'source_info'});
+                             $error->{'message'}, $error->{'source_info'},
+                             undef, 1);
     }
   }
 }
diff --git a/tp/Texinfo/XS/parsetexi/close.c b/tp/Texinfo/XS/parsetexi/close.c
index 3ce348ab5f..402ee1bca5 100644
--- a/tp/Texinfo/XS/parsetexi/close.c
+++ b/tp/Texinfo/XS/parsetexi/close.c
@@ -146,7 +146,7 @@ close_container (ELEMENT *current)
     {
       debug_nonl ("CONTAINER EMPTY ");
       debug_print_element (current, 1);
-      debug_nonl (" %d source marks)",
+      debug_nonl (" (%d source marks)",
                   current->source_mark_list.number); debug ("");
       if (current->source_mark_list.number > 0)
         {
diff --git a/tp/Texinfo/XS/parsetexi/debug.c b/tp/Texinfo/XS/parsetexi/debug.c
index 1c5d92bfd0..b8b63112f1 100644
--- a/tp/Texinfo/XS/parsetexi/debug.c
+++ b/tp/Texinfo/XS/parsetexi/debug.c
@@ -58,6 +58,25 @@ debug_command_name (enum command_id cmd)
     return command_name(cmd);
 }
 
+char *
+debug_protect_eol (char *input_string, int *allocated)
+{
+  char *end_of_line = strchr (input_string, '\n');
+  char *protected_string = input_string;
+  *allocated = 0;
+  if (end_of_line) {
+    char *p;
+    protected_string = malloc ((strlen(input_string) + 2) * sizeof(char));
+    *allocated = 1;
+    memcpy (protected_string, input_string, strlen(input_string));
+    p = protected_string + (end_of_line - input_string);
+    *p = '\\';
+    *(p+1) = 'n';
+    *(p+2) = '\0';
+  }
+  return protected_string;
+}
+
 char *
 print_element_debug (ELEMENT *e, int print_parent)
 {
@@ -72,19 +91,10 @@ print_element_debug (ELEMENT *e, int print_parent)
     text_printf (&text, "(%s)", element_type_names[e->type]);
   if (e->text.end > 0)
     {
-      char *end_of_line = strchr (e->text.text, '\n');
-      char *element_text = e->text.text;
-      if (end_of_line) {
-        char *p;
-        element_text = malloc ((e->text.end + 2) * sizeof(char));
-        memcpy (element_text, e->text.text, e->text.end);
-        p = element_text + (end_of_line - e->text.text);
-        *p = '\\';
-        *(p+1) = 'n';
-        *(p+2) = '\0';
-      }
+      int allocated = 0;
+      char *element_text = debug_protect_eol (e->text.text, &allocated);
       text_printf (&text, "[T: %s]", element_text);
-      if (end_of_line)
+      if (allocated)
         free (element_text);
     }
   if (e->args.number)
@@ -115,3 +125,17 @@ debug_print_element (ELEMENT *e, int print_parent)
       free (result);
     }
 }
+
+void
+debug_print_protected_string (char *input_string)
+{
+  if (debug_output)
+    {
+      int allocated = 0;
+      char *result = debug_protect_eol (input_string, &allocated);
+      debug_nonl (result);
+      if (allocated)
+        free (result);
+    }
+}
+
diff --git a/tp/Texinfo/XS/parsetexi/debug.h b/tp/Texinfo/XS/parsetexi/debug.h
index 780d7139c3..42d5a87218 100644
--- a/tp/Texinfo/XS/parsetexi/debug.h
+++ b/tp/Texinfo/XS/parsetexi/debug.h
@@ -13,5 +13,6 @@ extern int debug_output;
 void debug_print_element (ELEMENT *e, int print_parent);
 char *print_element_debug (ELEMENT *e, int print_parent);
 char *debug_command_name (enum command_id cmd);
+void debug_print_protected_string (char *input_string);
 
 #endif
diff --git a/tp/Texinfo/XS/parsetexi/errors.c b/tp/Texinfo/XS/parsetexi/errors.c
index fafaf9c9d4..bfecfa9665 100644
--- a/tp/Texinfo/XS/parsetexi/errors.c
+++ b/tp/Texinfo/XS/parsetexi/errors.c
@@ -27,6 +27,7 @@
 #include "errors.h"
 #include "input.h"
 #include "text.h"
+#include "debug.h"
 
 /* wrappers for asprintf and vasprintf */
 int
@@ -59,6 +60,22 @@ void fatal (char *message)
   abort ();
 }
 
+/* these are not full line messages, but the part that are output along
+   with debug messages, as is done in Texinfo::Register::line_warn/line_error
+   called by the perl parser.  Here without using the gettext framework
+   for the translation of 'warning'*/
+void
+debug_error_warning_message (ERROR_MESSAGE *error_message)
+{
+  if (error_message->type == warning)
+    fprintf (stderr, "warning: ");
+
+  if (error_message->source_info.macro)
+    fprintf (stderr, "%s (possibly involving @%s)\n",
+             error_message->message, error_message->source_info.macro);
+  else
+    fprintf (stderr, "%s\n", error_message->message);
+}
 
 ERROR_MESSAGE *error_list = 0;
 size_t error_number = 0;
@@ -93,6 +110,9 @@ line_error_internal (enum error_type type, SOURCE_INFO 
*cmd_source_info,
     }
   else
     error_list[error_number++].source_info = current_source_info;
+
+  if (debug_output)
+    debug_error_warning_message (&error_list[error_number -1]);
 }
 
 void
@@ -176,3 +196,4 @@ bug_message (char *format, ...)
   va_start (v, format);
   bug_message_internal (format, v);
 }
+
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index afd4ed77b6..11d510584c 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -545,6 +545,7 @@ next_text (ELEMENT *current)
         }
       input_number--;
     }
+  debug ("INPUT FINISHED");
   return 0;
 }
 
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 0d6cede3e5..2ac2f2f9ff 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1672,6 +1672,7 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
       if (!line)
         {
           /* End of the file or of a text fragment. */
+          debug ("NO MORE LINE for empty text");
           goto funexit;
         }
     }
@@ -1912,6 +1913,10 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
      command container. */
   if (command_flags(current) & CF_brace && *line != '{')
     {
+      debug_nonl ("BRACE CMD: no brace after @%s||| ",
+                  command_name (current->cmd));
+      debug_print_protected_string (line); debug ("");
+
       if (strchr (whitespace_chars, *line)
                && ((command_flags(current) & CF_accent)
                    || conf.ignore_space_after_braced_command_name))
@@ -1967,11 +1972,17 @@ process_remaining_on_line (ELEMENT **current_inout, 
char **line_inout)
 
            if (current->contents.number == 0)
              {
-               ELEMENT *spaces_after_cmd_before_arg
+               ELEMENT *e_spaces_after_cmd_before_arg
                  = new_element (ET_internal_spaces_after_cmd_before_arg);
-               text_append_n (&(spaces_after_cmd_before_arg->text),
+               text_append_n (&(e_spaces_after_cmd_before_arg->text),
                               line, whitespaces_len);
-               add_to_element_contents (current, spaces_after_cmd_before_arg);
+               add_to_element_contents (current, 
e_spaces_after_cmd_before_arg);
+
+               debug_nonl ("BRACE CMD before brace init spaces '");
+               debug_print_protected_string
+                                  (e_spaces_after_cmd_before_arg->text.text);
+               debug ("'");
+
                line += whitespaces_len;
              }
            else
@@ -1982,6 +1993,7 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
                char *previous_value = current->contents.list[0]->text.text;
                if (additional_newline && strchr ("\n", *previous_value))
                  {
+                   debug ("BRACE CMD before brace second newline stops 
spaces");
                    line_error ("@%s expected braces",
                                command_name(current->cmd));
                    gather_spaces_after_cmd_before_arg (current);
@@ -1991,6 +2003,10 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
                  {
                    text_append_n (&(current->contents.list[0]->text),
                                   line, whitespaces_len);
+                   debug ("BRACE CMD before brace add spaces '%s'",
+                          current->contents.list[0]->text.text
+                            + strlen(current->contents.list[0]->text.text)
+                                                         - whitespaces_len);
                    line += whitespaces_len;
                  }
              }
@@ -2001,13 +2017,15 @@ process_remaining_on_line (ELEMENT **current_inout, 
char **line_inout)
                && *line != '@')
         {
           ELEMENT *e, *e2;
-          debug ("ACCENT following_arg");
           if (current->contents.number > 0)
             gather_spaces_after_cmd_before_arg (current);
           e = new_element (ET_following_arg);
           add_to_element_args (current, e);
           e2 = new_element (ET_NONE);
+          /* FIXME what if the next character is not ASCII? */
           text_append_n (&e2->text, line, 1);
+          debug ("ACCENT @%s following_arg: %s", command_name(current->cmd),
+                 e2->text.text);
           add_to_element_contents (e, e2);
 
           if (current->cmd == CM_dotless
@@ -2467,6 +2485,7 @@ parse_texi (ELEMENT *root_elt, ELEMENT *current_elt)
       line = allocated_line = next_text (current);
       if (!allocated_line)
         {
+          debug ("NEXT_LINE NO MORE");
           if (in_context (ct_linecommand))
             {
               /*



reply via email to

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