texinfo-commits
[Top][All Lists]
Advanced

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

[6117] @c in @example followed by empty line


From: Gavin D. Smith
Subject: [6117] @c in @example followed by empty line
Date: Wed, 11 Feb 2015 10:06:17 +0000

Revision: 6117
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6117
Author:   gavin
Date:     2015-02-11 10:06:15 +0000 (Wed, 11 Feb 2015)
Log Message:
-----------
@c in @example followed by empty line

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/Plaintext.pm
    trunk/tp/t/20preformatted.t
    trunk/tp/t/README
    trunk/tp/t/results/preformatted/comments_in_example.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-02-10 19:06:31 UTC (rev 6116)
+++ trunk/ChangeLog     2015-02-11 10:06:15 UTC (rev 6117)
@@ -1,3 +1,13 @@
+2015-02-11  Gavin Smith  <address@hidden>
+
+       * tp/Texinfo/Convert/Plaintext.pm (_convert) <empty line>: Pass 
+       a "\n" into the active formatter so it can register an 
+       end-of-line if it needs to.
+       * tp/t/20preformatted.t (comments_in_example): Add a use of @c
+       in an @example followed by an empty line.
+       * tp/t/README: Elaborate on how tests are found, and how to run 
+       a single test by itself.
+
 2015-02-10  Karl Berry  <address@hidden>
 
        * tp/t/test_utils.pl (%outfile_preamble) <html_text>: update css.

Modified: trunk/tp/Texinfo/Convert/Plaintext.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Plaintext.pm       2015-02-10 19:06:31 UTC (rev 
6116)
+++ trunk/tp/Texinfo/Convert/Plaintext.pm       2015-02-11 10:06:15 UTC (rev 
6117)
@@ -1570,12 +1570,13 @@
     $self->{'empty_lines_count'}++;
     if ($self->{'empty_lines_count'} <= 1
         or 
$self->{'preformatted_context_commands'}->{$self->{'context'}->[-1]}) {
-      $result = "\n";
+      $result = "";
       if ($root->{'text'} =~ /\f/) {
-        $result = _get_form_feeds($root->{'text'}) .$result;
+        $result .= _get_form_feeds($root->{'text'});
+        $self->_add_text_count($result);
       }
-      $self->_add_text_count($result);
-      $self->_add_lines_count(1);
+      $result .= $self->_count_added($formatter->{'container'},
+                $formatter->{'container'}->add_text("\n"));
       return $result;
     } else {
       return '';

Modified: trunk/tp/t/20preformatted.t
===================================================================
--- trunk/tp/t/20preformatted.t 2015-02-10 19:06:31 UTC (rev 6116)
+++ trunk/tp/t/20preformatted.t 2015-02-11 10:06:15 UTC (rev 6117)
@@ -80,6 +80,13 @@
 @example
 line @c comment
 @end example
+
+Example with newline after comment
address@hidden
+line @c comment
+
+second line
address@hidden example
 '],
 ['nested_example_and_comment',
 '@example

Modified: trunk/tp/t/README
===================================================================
--- trunk/tp/t/README   2015-02-10 19:06:31 UTC (rev 6116)
+++ trunk/tp/t/README   2015-02-11 10:06:15 UTC (rev 6117)
@@ -1,6 +1,11 @@
-Most test files use a testing infrastructure from t/test_utils.pl.
+These tests are run by "make check" under tp/.  (The test files are 
+listed in tp/Makefile.tres, which is a generated file.)  A single .t 
+test file can be run on its own with
 
-In that case the reference output files for the test of a test category 
+  perl -w t/03coverage_braces.t
+
+Most test files use a testing infrastructure from t/test_utils.pl.  In
+that case the reference output files for the test of a test category 
 $test_category.t file are in t/results/$test_category/.  For example, if 
 after running "make check" test-suite.log contains a line like:
 
@@ -47,7 +52,7 @@
 
   perl -w t/60macro.t -c
 
-to create a file for each of the test in t/60macro.t, or for a specific
+to create a file for each of the tests in t/60macro.t, or for a specific
 test, here arg_body_expansion_order: 
 
   perl -w t/60macro.t -c arg_body_expansion_order

Modified: trunk/tp/t/results/preformatted/comments_in_example.pl
===================================================================
--- trunk/tp/t/results/preformatted/comments_in_example.pl      2015-02-10 
19:06:31 UTC (rev 6116)
+++ trunk/tp/t/results/preformatted/comments_in_example.pl      2015-02-11 
10:06:15 UTC (rev 6117)
@@ -242,6 +242,127 @@
         'macro' => ''
       },
       'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => 'Example with newline after comment
+'
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    },
+    {
+      'cmdname' => 'example',
+      'contents' => [
+        {
+          'extra' => {
+            'command' => {}
+          },
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line_after_command'
+        },
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'line '
+            },
+            {
+              'args' => [
+                {
+                  'parent' => {},
+                  'text' => ' comment
+',
+                  'type' => 'misc_arg'
+                }
+              ],
+              'cmdname' => 'c',
+              'extra' => {
+                'misc_args' => [
+                  ' comment
+'
+                ]
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'empty_line'
+            },
+            {
+              'parent' => {},
+              'text' => 'second line
+'
+            }
+          ],
+          'parent' => {},
+          'type' => 'preformatted'
+        },
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'extra' => {
+                    'command' => {}
+                  },
+                  'parent' => {},
+                  'text' => ' ',
+                  'type' => 'empty_spaces_after_command'
+                },
+                {
+                  'parent' => {},
+                  'text' => 'example'
+                },
+                {
+                  'parent' => {},
+                  'text' => '
+',
+                  'type' => 'spaces_at_end'
+                }
+              ],
+              'parent' => {},
+              'type' => 'misc_line_arg'
+            }
+          ],
+          'cmdname' => 'end',
+          'extra' => {
+            'command' => {},
+            'command_argument' => 'example',
+            'spaces_after_command' => {},
+            'text_arg' => 'example'
+          },
+          'line_nr' => {
+            'file_name' => '',
+            'line_nr' => 17,
+            'macro' => ''
+          },
+          'parent' => {}
+        }
+      ],
+      'extra' => {
+        'end_command' => {},
+        'spaces_after_command' => {}
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 13,
+        'macro' => ''
+      },
+      'parent' => {}
     }
   ],
   'type' => 'text_root'
@@ -288,6 +409,28 @@
 $result_trees{'comments_in_example'}{'contents'}[4]{'extra'}{'end_command'} = 
$result_trees{'comments_in_example'}{'contents'}[4]{'contents'}[2];
 
$result_trees{'comments_in_example'}{'contents'}[4]{'extra'}{'spaces_after_command'}
 = $result_trees{'comments_in_example'}{'contents'}[4]{'contents'}[0];
 $result_trees{'comments_in_example'}{'contents'}[4]{'parent'} = 
$result_trees{'comments_in_example'};
+$result_trees{'comments_in_example'}{'contents'}[5]{'parent'} = 
$result_trees{'comments_in_example'};
+$result_trees{'comments_in_example'}{'contents'}[6]{'contents'}[0]{'parent'} = 
$result_trees{'comments_in_example'}{'contents'}[6];
+$result_trees{'comments_in_example'}{'contents'}[6]{'parent'} = 
$result_trees{'comments_in_example'};
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'comments_in_example'}{'contents'}[7];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[0]{'parent'} = 
$result_trees{'comments_in_example'}{'contents'}[7];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'}
 = 
$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'contents'}[1];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'contents'}[1]{'parent'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'contents'}[2]{'parent'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'contents'}[3]{'parent'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[1]{'parent'} = 
$result_trees{'comments_in_example'}{'contents'}[7];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0]{'contents'}[1]{'parent'}
 = 
$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0]{'contents'}[2]{'parent'}
 = 
$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0]{'parent'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'extra'}{'command'}
 = $result_trees{'comments_in_example'}{'contents'}[7];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'extra'}{'spaces_after_command'}
 = 
$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2]{'parent'} = 
$result_trees{'comments_in_example'}{'contents'}[7];
+$result_trees{'comments_in_example'}{'contents'}[7]{'extra'}{'end_command'} = 
$result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[2];
+$result_trees{'comments_in_example'}{'contents'}[7]{'extra'}{'spaces_after_command'}
 = $result_trees{'comments_in_example'}{'contents'}[7]{'contents'}[0];
+$result_trees{'comments_in_example'}{'contents'}[7]{'parent'} = 
$result_trees{'comments_in_example'};
 
 $result_texis{'comments_in_example'} = 'Example with comments 2 lines
 @example 
@@ -299,13 +442,24 @@
 @example
 line @c comment
 @end example
+
+Example with newline after comment
address@hidden
+line @c comment
+
+second line
address@hidden example
 ';
 
 
 $result_texts{'comments_in_example'} = 'Example with comments 2 lines
 line second line 
 Example with comments 1 line
-line ';
+line 
+Example with newline after comment
+line 
+second line
+';
 
 $result_errors{'comments_in_example'} = [];
 
@@ -316,6 +470,10 @@
 
    Example with comments 1 line
      line 
+
+   Example with newline after comment
+     line 
+     second line
 ';
 
 
@@ -326,6 +484,12 @@
 <p>Example with comments 1 line
 </p><div class="example">
 <pre class="example">line </pre></div>
+
+<p>Example with newline after comment
+</p><div class="example">
+<pre class="example">line 
+second line
+</pre></div>
 ';
 
 
@@ -335,6 +499,11 @@
 </screen>
 <para>Example with comments 1 line
 </para><screen>line <!-- comment -->
+</screen>
+<para>Example with newline after comment
+</para><screen>line <!-- comment -->
+
+second line
 </screen>';
 
 
@@ -348,6 +517,13 @@
 </para><example endspaces=" ">
 <pre xml:space="preserve">line <!-- c comment -->
 </pre></example>
+
+<para>Example with newline after comment
+</para><example endspaces=" ">
+<pre xml:space="preserve">line <!-- c comment -->
+
+second line
+</pre></example>
 ';
 
 1;




reply via email to

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