texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sun, 29 Sep 2024 06:45:58 -0400 (EDT)

branch: master
commit 31a31bb86814af4fdbbd95d6402fba0b76f2d953
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Jun 21 14:45:37 2024 +0200

    * tp/Texinfo/ParserNonXS.pm (_process_raw_block_contents): fix
    detection of @end to gather the whole command name.
    
    * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line)
    (_parse_texi), tp/Texinfo/XS/parsetexi/parser.c
    (process_remaining_on_line, parse_texi): use process_raw_block_contents
    to process ignored conditional block commands.
---
 ChangeLog                                          |  10 ++
 tp/Texinfo/ParserNonXS.pm                          |  79 +++----------
 tp/Texinfo/XS/parsetexi/parser.c                   |  96 ++--------------
 .../conditionals/empty_ifset_in_ifset_no_set.pl    |  64 +++--------
 tp/t/results/conditionals/nested_ifset_ifclear.pl  | 122 +++++----------------
 tp/t/results/conditionals/value_on_ifset.pl        |  60 +++-------
 tp/t/results/macro/bib_example.pl                  |  66 +++--------
 ..._expansion_end_in_ignored_nested_conditional.pl |  76 ++++---------
 8 files changed, 129 insertions(+), 444 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8ecb0a83c2..3bc2dafc0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-06-21  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_process_raw_block_contents): fix
+       detection of @end to gather the whole command name.
+
+       * tp/Texinfo/ParserNonXS.pm (_process_remaining_on_line)
+       (_parse_texi), tp/Texinfo/XS/parsetexi/parser.c
+       (process_remaining_on_line, parse_texi): use process_raw_block_contents
+       to process ignored conditional block commands.
+
 2024-06-21  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/ParserNonXS.pm (_process_raw_block_contents)
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 7a2ac6f097..7f71054f3e 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -6835,7 +6835,7 @@ sub _process_macro_block_contents($$)
             _new_macro($self, $name, $current);
           }
         }
-        print STDERR "CLOSED raw $current->{'cmdname'}\n"
+        print STDERR "CLOSED user-defined $current->{'cmdname'}\n"
                                      if ($self->{'conf'}->{'DEBUG'});
         # start a new line for the @end line (without the first spaces on
         # the line that have already been put in a raw container).
@@ -6891,7 +6891,8 @@ sub _process_raw_block_contents($$)
       $level++;
       print STDERR "RAW SECOND LEVEL \@$cmdname\n"
         if ($self->{'conf'}->{'DEBUG'});
-    } elsif ($line =~ /^(\s*?)\@end\s+($cmdname)/) {
+    } elsif ($line =~ /^(\s*?)\@end\s+([a-zA-Z][\w-]*)/
+             and $2 eq $cmdname) {
       $level--;
       if ($level == 0) {
         if ($line =~ s/^(\s+)//) {
@@ -6902,7 +6903,7 @@ sub _process_raw_block_contents($$)
                 __("\@end %s should only appear at the beginning of a line"),
                                    $cmdname), $source_info);
         }
-        print STDERR "CLOSED raw $current->{'cmdname'}\n"
+        print STDERR "CLOSED raw or ignored $cmdname\n"
                                      if ($self->{'conf'}->{'DEBUG'});
         # start a new line for the @end line (without the first spaces on
         # the line that have already been put in a raw container).
@@ -6978,53 +6979,9 @@ sub _process_remaining_on_line($$$$)
   #print STDERR "PROCESS "._debug_protect_eol($line)."\n"
   #    if ($self->{'conf'}->{'DEBUG'});
 
-  # in ignored conditional block command
-  if ($current->{'cmdname'}
-      and $block_commands{$current->{'cmdname'}}
-      and ($block_commands{$current->{'cmdname'}} eq 'conditional')) {
-    # check for nested @ifset (so that @end ifset doesn't end the
-    # outermost @ifset).
-    if (($current->{'cmdname'} eq 'ifclear'
-         or $current->{'cmdname'} eq 'ifset'
-         or $current->{'cmdname'} eq 'ifcommanddefined'
-         or $current->{'cmdname'} eq 'ifcommandnotdefined')
-        and ($line =~ /^\s*\@([a-zA-Z][\w-]*)/
-             and ($1 eq $current->{'cmdname'}))) {
-      push @{$current->{'contents'}}, { 'cmdname' => $current->{'cmdname'},
-                                        'parent' => $current,
-                                      };
-      $current = $current->{'contents'}->[-1];
-      return ($current, $line, $source_info, $GET_A_NEW_LINE);
-      # goto funexit;  # used in XS code
-    } elsif ($line =~ /^(\s*?)\@end\s+([a-zA-Z][\w-]*)/
-             and ($2 eq $current->{'cmdname'})) {
-      my $end_command = $current->{'cmdname'};
-      if ($line =~ s/^(\s+)//) {
-        push @{$current->{'contents'}},
-          { 'text' => $1,
-            'type' => 'raw', 'parent' => $current };
-        $self->_line_warn(sprintf(
-              __("\@end %s should only appear at the beginning of a line"),
-                                 $current->{'cmdname'}), $source_info);
-      }
-
-      print STDERR "CLOSED conditional $end_command\n"
-                                  if ($self->{'conf'}->{'DEBUG'});
-      # see comment above for raw output formats
-      push @{$current->{'contents'}}, { 'type' => 'empty_line',
-                                        'text' => '',
-                                        'parent' => $current };
-      # the line beginning by @end is processed like any line beginning
-      # with @end below
-    } else {
-      push @{$current->{'contents'}}, { 'type' => 'raw', 'text' => $line,
-                                        'parent' => $current, };
-      return ($current, $line, $source_info, $GET_A_NEW_LINE);
-      # goto funexit;  # used in XS code
-    }
   # in @verb. type should be 'brace_container'
-  } elsif ($current->{'parent'} and $current->{'parent'}->{'cmdname'}
-         and $current->{'parent'}->{'cmdname'} eq 'verb') {
+  if ($current->{'parent'} and $current->{'parent'}->{'cmdname'}
+      and $current->{'parent'}->{'cmdname'} eq 'verb') {
     my $char = quotemeta($current->{'parent'}->{'info'}->{'delimiter'});
     if ($line =~ s/^(.*?)$char\}/\}/) {
       push @{$current->{'contents'}},
@@ -7509,11 +7466,13 @@ sub _process_remaining_on_line($$$$)
         ($line, $source_info)
            = _process_ignored_raw_format_block_contents($self, $current);
         $retval = $STILL_MORE_TO_PROCESS;
-      # in a 'raw' verbatim, ignore followed by a comment
+      # in a 'raw' verbatim or ignore or ignored conditional followed by
+      # a comment
       } elsif ($retval == $GET_A_NEW_LINE
           and $current->{'cmdname'}
           and $block_commands{$current->{'cmdname'}}
-          and ($block_commands{$current->{'cmdname'}} eq 'raw')) {
+          and ($block_commands{$current->{'cmdname'}} eq 'raw'
+               or $block_commands{$current->{'cmdname'}} eq 'conditional')) {
         ($line, $source_info) = _process_raw_block_contents($self, $current);
         $retval = $STILL_MORE_TO_PROCESS;
       }
@@ -7611,10 +7570,12 @@ sub _process_remaining_on_line($$$$)
         and $block_commands{$current->{'cmdname'}} eq 'format_raw') {
       ($line, $source_info)
          = _process_ignored_raw_format_block_contents($self, $current);
-    # in a 'raw' verbatim, ignore followed by an end of line
+    # in a 'raw' verbatim or ignore or ignored conditional followed by an
+    # end of line
     } elsif ($current->{'cmdname'}
              and $block_commands{$current->{'cmdname'}}
-             and ($block_commands{$current->{'cmdname'}} eq 'raw')) {
+             and ($block_commands{$current->{'cmdname'}} eq 'raw'
+                  or $block_commands{$current->{'cmdname'}} eq 'conditional')) 
{
       ($line, $source_info) = _process_raw_block_contents($self, $current);
     } else {
       $retval = $GET_A_NEW_LINE;
@@ -7673,16 +7634,8 @@ sub _parse_texi($$$)
     #  next;
     #}
 
-    if (not
-        # all the format handled early that have specific containers
-        # 'raw' command or ignored conditional or verb or ignored raw format
-          (($current->{'cmdname'}
-           and $block_commands{$current->{'cmdname'}}
-           and $block_commands{$current->{'cmdname'}} eq 'conditional')
-          or
-           ($current->{'parent'} and $current->{'parent'}->{'cmdname'}
-            and $current->{'parent'}->{'cmdname'} eq 'verb')
-          )
+    if (not ($current->{'parent'} and $current->{'parent'}->{'cmdname'}
+             and $current->{'parent'}->{'cmdname'} eq 'verb')
         # not def line
         and $self->_top_context() ne 'ct_def') {
       next NEXT_LINE if _check_line_directive ($self, $line, $source_info);
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 374757d782..e6823398c9 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -1548,7 +1548,7 @@ process_macro_block_contents (ELEMENT *current)
                           new_macro (name, current);
                         }
                     }
-                  debug ("CLOSED raw %s", command_name(end_cmd));
+                  debug ("CLOSED user-defined %s", command_name(end_cmd));
            /* start a new line for the @end line (without the first spaces on
               the line that have already been put in a raw container).
               This is normally done at the beginning of a line, but not here,
@@ -1643,7 +1643,7 @@ process_raw_block_contents (ELEMENT *current)
                   line_warn ("@end %s should only appear at the "
                              "beginning of a line", command_name(end_cmd));
                 }
-              debug ("CLOSED raw %s", command_name(end_cmd));
+              debug ("CLOSED raw or ignored %s", command_name(end_cmd));
        /* start a new line for the @end line (without the first spaces on
           the line that have already been put in a raw container).
           This is normally done at the beginning of a line, but not here,
@@ -1744,7 +1744,6 @@ process_remaining_on_line (ELEMENT **current_inout, const 
char **line_inout)
   const char *line = *line_inout;
   const char *line_after_command;
   int retval = STILL_MORE_TO_PROCESS;
-  enum command_id end_cmd;
   enum command_id from_alias = CM_NONE;
 
   enum command_id cmd = CM_NONE;
@@ -1755,81 +1754,8 @@ process_remaining_on_line (ELEMENT **current_inout, 
const char **line_inout)
   debug_nonl ("PROCESS "); debug_print_protected_string (line); debug ("");
   */
 
-  /* at this point we are necessarily in a command or container */
-  /********* (ignored) BLOCK_conditional ******************/
-  if (command_flags(current) & CF_block
-      && (command_data(current->e.c->cmd).data == BLOCK_conditional))
-    {
-      const char *p = line;
-
-      /* check for nested @ifset (so that @end ifset doesn't end the
-         the outermost @ifset). */
-      if (current->e.c->cmd == CM_ifclear || current->e.c->cmd == CM_ifset
-          || current->e.c->cmd == CM_ifcommanddefined
-          || current->e.c->cmd == CM_ifcommandnotdefined)
-        {
-          ELEMENT *e;
-          p += strspn (p, whitespace_chars);
-          if (*p == '@')
-            {
-              char *command;
-              p++;
-              command = read_command_name (&p);
-              if (command)
-                {
-                  cmd = lookup_command (command);
-                  free (command);
-                  if (cmd == current->e.c->cmd)
-                    {
-                       /*
-                      debug ("CONDITIONAL SECOND LEVEL %s",
-                             command_name(cmd));
-                        */
-                      e = new_command_element (ET_block_command, cmd);
-                      add_to_element_contents (current, e);
-                      current = e;
-                      retval = GET_A_NEW_LINE;
-                      goto funexit;
-                    }
-                }
-            }
-        }
-
-      p = line;
-      /* Else check if line is "@end ..." for current command. */
-      if (is_end_current_command (current->e.c->cmd, &p, &end_cmd))
-        {
-          ELEMENT *e;
-
-          if (strchr (whitespace_chars, *line))
-            {
-              ELEMENT *e;
-              int n = strspn (line, whitespace_chars);
-              e = new_text_element (ET_raw);
-              text_append_n (e->e.text, line, n);
-              add_to_element_contents (current, e);
-              line += n;
-              line_warn ("@end %s should only appear at the "
-                         "beginning of a line", command_name(end_cmd));
-            }
-
-          debug ("CLOSED conditional %s", command_name(end_cmd));
-
-          e = new_text_element (ET_empty_line);
-          add_to_element_contents (current, e);
-        }
-      else
-        {
-          ELEMENT *e = new_text_element (ET_raw);
-          text_append (e->e.text, line);
-          add_to_element_contents (current, e);
-          retval = GET_A_NEW_LINE;
-          goto funexit;
-        }
-    } /********* (ignored) BLOCK_conditional *************/
-
   /* Check if parent element is 'verb' */
-  else if (current->parent && current->parent->e.c->cmd == CM_verb)
+  if (current->parent && current->parent->e.c->cmd == CM_verb)
     {
       const char *q;
       const char *delimiter
@@ -2504,9 +2430,11 @@ process_remaining_on_line (ELEMENT **current_inout, 
const char **line_inout)
                                          &command_element);
           if (status == GET_A_NEW_LINE)
             {
-              /* @ignore or @verbatim followed by a comment */
+              /* @ignore or @verbatim and ignored conditionals
+                 followed by a comment */
               if (command_flags(current) & CF_block
-                  && command_data(current->e.c->cmd).data == BLOCK_raw)
+                  && (command_data(current->e.c->cmd).data == BLOCK_raw
+             || command_data(current->e.c->cmd).data == BLOCK_conditional))
                 {
                   line = process_raw_block_contents (current);
                 }
@@ -2637,9 +2565,11 @@ process_remaining_on_line (ELEMENT **current_inout, 
const char **line_inout)
         {
           line = process_ignored_raw_format_block_contents (current);
         }
-      /* @ignore and @verbatim followed by an end of line */
+      /* @ignore and @verbatim followed by an end of line
+         and ignored conditionals */
       else if (command_flags(current) & CF_block
-          && command_data(current->e.c->cmd).data == BLOCK_raw)
+          && (command_data(current->e.c->cmd).data == BLOCK_raw
+             || command_data(current->e.c->cmd).data == BLOCK_conditional))
         {
           line = process_raw_block_contents (current);
         }
@@ -2709,9 +2639,7 @@ parse_texi (ELEMENT *root_elt, ELEMENT *current_elt)
          leading whitespace and save as an "ET_empty_line" element.  This
          element type can be changed in 'abort_empty_line' when more text is
          read. */
-      if (!((command_flags(current) & CF_block
-             && command_data(current->e.c->cmd).data == BLOCK_conditional)
-            || (current->parent && current->parent->e.c->cmd == CM_verb))
+      if (!(current->parent && current->parent->e.c->cmd == CM_verb)
           && current_context () != ct_def)
         {
           ELEMENT *e;
diff --git a/tp/t/results/conditionals/empty_ifset_in_ifset_no_set.pl 
b/tp/t/results/conditionals/empty_ifset_in_ifset_no_set.pl
index cb99294176..44e1749e67 100644
--- a/tp/t/results/conditionals/empty_ifset_in_ifset_no_set.pl
+++ b/tp/t/results/conditionals/empty_ifset_in_ifset_no_set.pl
@@ -12,7 +12,7 @@ $result_trees{'empty_ifset_in_ifset_no_set'} = {
         {
           'source_marks' => [
             {
-              'counter' => 2,
+              'counter' => 1,
               'element' => {
                 'args' => [
                   {
@@ -33,54 +33,22 @@ $result_trees{'empty_ifset_in_ifset_no_set'} = {
                 'cmdname' => 'ifset',
                 'contents' => [
                   {
-                    'source_marks' => [
-                      {
-                        'counter' => 1,
-                        'element' => {
-                          'cmdname' => 'ifset',
-                          'contents' => [
-                            {
-                              'text' => '@end verbatim
-',
-                              'type' => 'raw'
-                            },
-                            {
-                              'args' => [
-                                {
-                                  'contents' => [
-                                    {
-                                      'text' => 'ifset'
-                                    }
-                                  ],
-                                  'info' => {
-                                    'spaces_after_argument' => {
-                                      'text' => '
-'
-                                    }
-                                  },
-                                  'type' => 'line_arg'
-                                }
-                              ],
-                              'cmdname' => 'end',
-                              'extra' => {
-                                'text_arg' => 'ifset'
-                              },
-                              'info' => {
-                                'spaces_before_argument' => {
-                                  'text' => ' '
-                                }
-                              },
-                              'source_info' => {
-                                'line_nr' => 6
-                              }
-                            }
-                          ]
-                        },
-                        'position' => 10,
-                        'sourcemark_type' => 'ignored_conditional_block'
-                      }
-                    ],
                     'text' => '@verbatim
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@ifset
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@end verbatim
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@end ifset
 ',
                     'type' => 'raw'
                   }
diff --git a/tp/t/results/conditionals/nested_ifset_ifclear.pl 
b/tp/t/results/conditionals/nested_ifset_ifclear.pl
index 46be051fe1..0a911b5294 100644
--- a/tp/t/results/conditionals/nested_ifset_ifclear.pl
+++ b/tp/t/results/conditionals/nested_ifset_ifclear.pl
@@ -723,7 +723,7 @@ $result_trees{'nested_ifset_ifclear'} = {
               'status' => 'start'
             },
             {
-              'counter' => 4,
+              'counter' => 3,
               'element' => {
                 'args' => [
                   {
@@ -744,54 +744,19 @@ $result_trees{'nested_ifset_ifclear'} = {
                 'cmdname' => 'ifset',
                 'contents' => [
                   {
-                    'source_marks' => [
-                      {
-                        'counter' => 3,
-                        'element' => {
-                          'cmdname' => 'ifset',
-                          'contents' => [
-                            {
-                              'text' => 'Both somevar and anothervar are set.
+                    'text' => '@ifset anothervar
 ',
-                              'type' => 'raw'
-                            },
-                            {
-                              'args' => [
-                                {
-                                  'contents' => [
-                                    {
-                                      'text' => 'ifset'
-                                    }
-                                  ],
-                                  'info' => {
-                                    'spaces_after_argument' => {
-                                      'text' => '
-'
-                                    }
-                                  },
-                                  'type' => 'line_arg'
-                                }
-                              ],
-                              'cmdname' => 'end',
-                              'extra' => {
-                                'text_arg' => 'ifset'
-                              },
-                              'info' => {
-                                'spaces_before_argument' => {
-                                  'text' => ' '
-                                }
-                              },
-                              'source_info' => {
-                                'line_nr' => 23,
-                                'macro' => 'conditionals'
-                              }
-                            }
-                          ]
-                        },
-                        'sourcemark_type' => 'ignored_conditional_block'
-                      }
-                    ],
-                    'text' => ''
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => 'Both somevar and anothervar are set.
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@end ifset
+',
+                    'type' => 'raw'
                   },
                   {
                     'text' => '@ifclear anothervar
@@ -910,7 +875,7 @@ $result_trees{'nested_ifset_ifclear'} = {
               'status' => 'start'
             },
             {
-              'counter' => 6,
+              'counter' => 4,
               'element' => {
                 'args' => [
                   {
@@ -931,54 +896,19 @@ $result_trees{'nested_ifset_ifclear'} = {
                 'cmdname' => 'ifset',
                 'contents' => [
                   {
-                    'source_marks' => [
-                      {
-                        'counter' => 5,
-                        'element' => {
-                          'cmdname' => 'ifset',
-                          'contents' => [
-                            {
-                              'text' => 'Both somevar and anothervar are set.
+                    'text' => '@ifset anothervar
 ',
-                              'type' => 'raw'
-                            },
-                            {
-                              'args' => [
-                                {
-                                  'contents' => [
-                                    {
-                                      'text' => 'ifset'
-                                    }
-                                  ],
-                                  'info' => {
-                                    'spaces_after_argument' => {
-                                      'text' => '
-'
-                                    }
-                                  },
-                                  'type' => 'line_arg'
-                                }
-                              ],
-                              'cmdname' => 'end',
-                              'extra' => {
-                                'text_arg' => 'ifset'
-                              },
-                              'info' => {
-                                'spaces_before_argument' => {
-                                  'text' => ' '
-                                }
-                              },
-                              'source_info' => {
-                                'line_nr' => 27,
-                                'macro' => 'conditionals'
-                              }
-                            }
-                          ]
-                        },
-                        'sourcemark_type' => 'ignored_conditional_block'
-                      }
-                    ],
-                    'text' => ''
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => 'Both somevar and anothervar are set.
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@end ifset
+',
+                    'type' => 'raw'
                   },
                   {
                     'text' => '@ifclear anothervar
diff --git a/tp/t/results/conditionals/value_on_ifset.pl 
b/tp/t/results/conditionals/value_on_ifset.pl
index 02f1bed153..7f90d11756 100644
--- a/tp/t/results/conditionals/value_on_ifset.pl
+++ b/tp/t/results/conditionals/value_on_ifset.pl
@@ -163,7 +163,7 @@ $result_trees{'value_on_ifset'} = {
         {
           'source_marks' => [
             {
-              'counter' => 2,
+              'counter' => 1,
               'element' => {
                 'args' => [
                   {
@@ -184,53 +184,19 @@ $result_trees{'value_on_ifset'} = {
                 'cmdname' => 'ifset',
                 'contents' => [
                   {
-                    'source_marks' => [
-                      {
-                        'counter' => 1,
-                        'element' => {
-                          'cmdname' => 'ifset',
-                          'contents' => [
-                            {
-                              'text' => 'INTERNALXV
+                    'text' => '@ifset @value{xval}
 ',
-                              'type' => 'raw'
-                            },
-                            {
-                              'args' => [
-                                {
-                                  'contents' => [
-                                    {
-                                      'text' => 'ifset'
-                                    }
-                                  ],
-                                  'info' => {
-                                    'spaces_after_argument' => {
-                                      'text' => '
-'
-                                    }
-                                  },
-                                  'type' => 'line_arg'
-                                }
-                              ],
-                              'cmdname' => 'end',
-                              'extra' => {
-                                'text_arg' => 'ifset'
-                              },
-                              'info' => {
-                                'spaces_before_argument' => {
-                                  'text' => ' '
-                                }
-                              },
-                              'source_info' => {
-                                'line_nr' => 11
-                              }
-                            }
-                          ]
-                        },
-                        'sourcemark_type' => 'ignored_conditional_block'
-                      }
-                    ],
-                    'text' => ''
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => 'INTERNALXV
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@end ifset
+',
+                    'type' => 'raw'
                   },
                   {
                     'args' => [
diff --git a/tp/t/results/macro/bib_example.pl 
b/tp/t/results/macro/bib_example.pl
index 88e3e30806..00e01f1a15 100644
--- a/tp/t/results/macro/bib_example.pl
+++ b/tp/t/results/macro/bib_example.pl
@@ -3506,7 +3506,7 @@ $result_trees{'bib_example'} = {
                       'status' => 'start'
                     },
                     {
-                      'counter' => 4,
+                      'counter' => 3,
                       'element' => {
                         'args' => [
                           {
@@ -3527,55 +3527,19 @@ $result_trees{'bib_example'} = {
                         'cmdname' => 'ifclear',
                         'contents' => [
                           {
-                            'source_marks' => [
-                              {
-                                'counter' => 3,
-                                'element' => {
-                                  'cmdname' => 'ifclear',
-                                  'contents' => [
-                                    {
-                                      'text' => '@set mybiblist true
-',
-                                      'type' => 'raw'
-                                    },
-                                    {
-                                      'args' => [
-                                        {
-                                          'contents' => [
-                                            {
-                                              'text' => 'ifclear'
-                                            }
-                                          ],
-                                          'info' => {
-                                            'spaces_after_argument' => {
-                                              'text' => '
-'
-                                            }
-                                          },
-                                          'type' => 'line_arg'
-                                        }
-                                      ],
-                                      'cmdname' => 'end',
-                                      'extra' => {
-                                        'text_arg' => 'ifclear'
-                                      },
-                                      'info' => {
-                                        'spaces_before_argument' => {
-                                          'text' => ' '
-                                        }
-                                      },
-                                      'source_info' => {
-                                        'file_name' => 'bib-example.texi',
-                                        'line_nr' => 51,
-                                        'macro' => 'mybibitem'
-                                      }
-                                    }
-                                  ]
-                                },
-                                'sourcemark_type' => 
'ignored_conditional_block'
-                              }
-                            ],
-                            'text' => ''
+                            'text' => '@ifclear mybibtable
+',
+                            'type' => 'raw'
+                          },
+                          {
+                            'text' => '@set mybiblist true
+',
+                            'type' => 'raw'
+                          },
+                          {
+                            'text' => '@end ifclear
+',
+                            'type' => 'raw'
                           },
                           {
                             'args' => [
@@ -3754,7 +3718,7 @@ $result_trees{'bib_example'} = {
                       'cmdname' => 'c',
                       'source_marks' => [
                         {
-                          'counter' => 5,
+                          'counter' => 4,
                           'element' => {
                             'args' => [
                               {
diff --git 
a/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl 
b/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl
index 60aa61710c..a6e42ff53e 100644
--- a/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl
+++ b/tp/t/results/macro/macro_expansion_end_in_ignored_nested_conditional.pl
@@ -92,7 +92,7 @@ 
$result_trees{'macro_expansion_end_in_ignored_nested_conditional'} = {
               'status' => 'start'
             },
             {
-              'counter' => 2,
+              'counter' => 1,
               'element' => {
                 'args' => [
                   {
@@ -112,66 +112,32 @@ 
$result_trees{'macro_expansion_end_in_ignored_nested_conditional'} = {
                 ],
                 'cmdname' => 'ifset',
                 'contents' => [
+                  {
+                    'text' => '@ifset b
+',
+                    'type' => 'raw'
+                  },
                   {
                     'source_marks' => [
                       {
                         'counter' => 1,
-                        'element' => {
-                          'cmdname' => 'ifset',
-                          'contents' => [
-                            {
-                              'source_marks' => [
-                                {
-                                  'counter' => 1,
-                                  'position' => 2,
-                                  'sourcemark_type' => 'macro_expansion',
-                                  'status' => 'end'
-                                }
-                              ],
-                              'text' => 'GG',
-                              'type' => 'raw'
-                            },
-                            {
-                              'text' => '
-',
-                              'type' => 'raw'
-                            },
-                            {
-                              'args' => [
-                                {
-                                  'contents' => [
-                                    {
-                                      'text' => 'ifset'
-                                    }
-                                  ],
-                                  'info' => {
-                                    'spaces_after_argument' => {
-                                      'text' => '
-'
-                                    }
-                                  },
-                                  'type' => 'line_arg'
-                                }
-                              ],
-                              'cmdname' => 'end',
-                              'extra' => {
-                                'text_arg' => 'ifset'
-                              },
-                              'info' => {
-                                'spaces_before_argument' => {
-                                  'text' => ' '
-                                }
-                              },
-                              'source_info' => {
-                                'line_nr' => 8
-                              }
-                            }
-                          ]
-                        },
-                        'sourcemark_type' => 'ignored_conditional_block'
+                        'position' => 2,
+                        'sourcemark_type' => 'macro_expansion',
+                        'status' => 'end'
                       }
                     ],
-                    'text' => ''
+                    'text' => 'GG',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '
+',
+                    'type' => 'raw'
+                  },
+                  {
+                    'text' => '@end ifset
+',
+                    'type' => 'raw'
                   },
                   {
                     'args' => [



reply via email to

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