texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/parsetexi/parser.c (process_remai


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line) <accent commands>: use an element string to get a whole UTF-8 character in error message on dotless argument.
Date: Sat, 15 Jul 2023 12:39:34 -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 79108ce9d5 * tp/Texinfo/XS/parsetexi/parser.c 
(process_remaining_on_line) <accent commands>: use an element string to get a 
whole UTF-8 character in error message on dotless argument.
79108ce9d5 is described below

commit 79108ce9d5b09c40f5db148a7979c3be35cf85e9
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jul 15 18:39:24 2023 +0200

    * tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line)
    <accent commands>: use an element string to get a whole UTF-8
    character in error message on dotless argument.
    
    * tp/Makefile.tres, tp/t/formats_encodings.t
    (dotless_argument_non_ascii): new test to test the dotless incorrect
    argument error message with a non-ascii character.
---
 ChangeLog                                          |  10 +
 tp/Makefile.tres                                   |   1 +
 tp/Texinfo/XS/parsetexi/parser.c                   |   2 +-
 tp/t/formats_encodings.t                           |   8 +
 .../dotless_argument_non_ascii.pl                  | 370 +++++++++++++++++++++
 5 files changed, 390 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2a9c70deb4..b5dccb4563 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2023-07-15  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/parser.c (process_remaining_on_line)
+       <accent commands>: use an element string to get a whole UTF-8
+       character in error message on dotless argument.
+
+       * tp/Makefile.tres, tp/t/formats_encodings.t
+       (dotless_argument_non_ascii): new test to test the dotless incorrect
+       argument error message with a non-ascii character.
+
 2023-07-15  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/t/formats_encodings.t (accent_argument_non_ascii): Enable.
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 6feb24da43..978e0185f2 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -508,6 +508,7 @@ test_files_generated_list = 
$(test_tap_files_generated_list) \
   t/results/formats_encodings/char_latin2_latin2_in_refs/res_html \
   t/results/formats_encodings/char_latin2_latin2_in_refs/res_info \
   t/results/formats_encodings/documentencoding_utf8_and_insertions.pl \
+  t/results/formats_encodings/dotless_argument_non_ascii.pl \
   t/results/formats_encodings/japanese_shift_jis.pl \
   t/results/formats_encodings/japanese_shift_jis/res_html \
   t/results/formats_encodings/japanese_shift_jis/res_info \
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index 4b8639419f..6c0fbc6852 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -2053,7 +2053,7 @@ process_remaining_on_line (ELEMENT **current_inout, char 
**line_inout)
               && *line != 'i' && *line != 'j')
             {
               line_error ("@dotless expects `i' or `j' as argument, "
-                          "not `%c'", *line);
+                          "not `%s'", e2->text.text);
             }
           line += char_len;
           current = current->parent;
diff --git a/tp/t/formats_encodings.t b/tp/t/formats_encodings.t
index d28fe6754d..d959ad4945 100644
--- a/tp/t/formats_encodings.t
+++ b/tp/t/formats_encodings.t
@@ -335,6 +335,14 @@ $accents_text, {'ENABLE_ENCODING' => 1}, 
{'OUTPUT_CHARACTERS' => 1}
 '."\@'{\x{00EA}}
 \@'\x{00EA}
 "],
+['dotless_argument_non_ascii',
+'@node Top
+@top top
+
+@node chap
+@chapter Chapter
+'."\@dotless \x{00EA}
+"],
 # numerous LaTeX formatting errors
 ['at_commands_in_refs',
 $at_commands_in_refs_text, 
diff --git a/tp/t/results/formats_encodings/dotless_argument_non_ascii.pl 
b/tp/t/results/formats_encodings/dotless_argument_non_ascii.pl
new file mode 100644
index 0000000000..50b3829366
--- /dev/null
+++ b/tp/t/results/formats_encodings/dotless_argument_non_ascii.pl
@@ -0,0 +1,370 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'dotless_argument_non_ascii'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'contents' => [],
+          'type' => 'preamble_before_content'
+        }
+      ],
+      'type' => 'before_node_section'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'Top'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'extra' => {
+        'normalized' => 'Top'
+      },
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 1,
+        'macro' => ''
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'top'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'top',
+      'contents' => [
+        {
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {},
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 2,
+        'macro' => ''
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'chap'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'extra' => {
+        'normalized' => 'chap'
+      },
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 4,
+        'macro' => ''
+      }
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'text' => 'Chapter'
+            }
+          ],
+          'info' => {
+            'spaces_after_argument' => {
+              'text' => '
+'
+            }
+          },
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'chapter',
+      'contents' => [
+        {
+          'contents' => [
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'text' => "\x{ea}"
+                    }
+                  ],
+                  'type' => 'following_arg'
+                }
+              ],
+              'cmdname' => 'dotless',
+              'info' => {
+                'spaces_after_cmd_before_arg' => {
+                  'text' => ' '
+                }
+              },
+              'source_info' => {
+                'file_name' => '',
+                'line_nr' => 6,
+                'macro' => ''
+              }
+            },
+            {
+              'text' => '
+'
+            }
+          ],
+          'type' => 'paragraph'
+        }
+      ],
+      'extra' => {},
+      'info' => {
+        'spaces_before_argument' => {
+          'text' => ' '
+        }
+      },
+      'source_info' => {
+        'file_name' => '',
+        'line_nr' => 5,
+        'macro' => ''
+      }
+    }
+  ],
+  'type' => 'document_root'
+};
+
+$result_texis{'dotless_argument_non_ascii'} = '@node Top
+@top top
+
+@node chap
+@chapter Chapter
+@dotless ê
+';
+
+
+$result_texts{'dotless_argument_non_ascii'} = 'top
+***
+
+1 Chapter
+*********
+ê
+';
+
+$result_sectioning{'dotless_argument_non_ascii'} = {
+  'structure' => {
+    'section_childs' => [
+      {
+        'cmdname' => 'top',
+        'extra' => {
+          'associated_node' => {
+            'cmdname' => 'node',
+            'extra' => {
+              'normalized' => 'Top'
+            },
+            'structure' => {}
+          }
+        },
+        'structure' => {
+          'section_childs' => [
+            {
+              'cmdname' => 'chapter',
+              'extra' => {
+                'associated_node' => {
+                  'cmdname' => 'node',
+                  'extra' => {
+                    'normalized' => 'chap'
+                  },
+                  'structure' => {}
+                }
+              },
+              'structure' => {
+                'section_level' => 1,
+                'section_number' => 1,
+                'section_up' => {},
+                'toplevel_prev' => {},
+                'toplevel_up' => {}
+              }
+            }
+          ],
+          'section_level' => 0,
+          'section_up' => {}
+        }
+      }
+    ],
+    'section_level' => -1
+  }
+};
+$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
 = 
$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_prev'}
 = 
$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_up'}
 = 
$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'dotless_argument_non_ascii'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
 = $result_sectioning{'dotless_argument_non_ascii'};
+
+$result_nodes{'dotless_argument_non_ascii'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'associated_section' => {
+      'cmdname' => 'top',
+      'extra' => {},
+      'structure' => {}
+    },
+    'normalized' => 'Top'
+  },
+  'structure' => {
+    'node_next' => {
+      'cmdname' => 'node',
+      'extra' => {
+        'associated_section' => {
+          'cmdname' => 'chapter',
+          'extra' => {},
+          'structure' => {
+            'section_number' => 1
+          }
+        },
+        'normalized' => 'chap'
+      },
+      'structure' => {
+        'node_prev' => {},
+        'node_up' => {}
+      }
+    }
+  }
+};
+$result_nodes{'dotless_argument_non_ascii'}{'structure'}{'node_next'}{'structure'}{'node_prev'}
 = $result_nodes{'dotless_argument_non_ascii'};
+$result_nodes{'dotless_argument_non_ascii'}{'structure'}{'node_next'}{'structure'}{'node_up'}
 = $result_nodes{'dotless_argument_non_ascii'};
+
+$result_menus{'dotless_argument_non_ascii'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top'
+  },
+  'structure' => {}
+};
+
+$result_errors{'dotless_argument_non_ascii'} = [
+  {
+    'error_line' => "\@dotless expects `i' or `j' as argument, not `\x{ea}'
+",
+    'file_name' => '',
+    'line_nr' => 6,
+    'macro' => '',
+    'text' => "\@dotless expects `i' or `j' as argument, not `\x{ea}'",
+    'type' => 'error'
+  }
+];
+
+
+$result_floats{'dotless_argument_non_ascii'} = {};
+
+
+
+$result_converted{'plaintext'}->{'dotless_argument_non_ascii'} = 'top
+***
+
+1 Chapter
+*********
+
+ê
+';
+
+
+$result_converted{'html_text'}->{'dotless_argument_non_ascii'} = '<div 
class="top-level-extent" id="Top">
+<div class="nav-panel">
+<p>
+ &nbsp; </p>
+</div>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top"> 
&para;</a></span></h1>
+
+<ul class="mini-toc">
+<li><a href="#chap" accesskey="1">Chapter</a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" id="chap">
+<div class="nav-panel">
+<p>
+ &nbsp; </p>
+</div>
+<h2 class="chapter" id="Chapter"><span>1 Chapter<a class="copiable-link" 
href="#Chapter"> &para;</a></span></h2>
+<p>ê
+</p></div>
+</div>
+';
+
+
+$result_converted{'xml'}->{'dotless_argument_non_ascii'} = '<node name="Top" 
spaces=" "><nodename>Top</nodename><nodenext 
automatic="on">chap</nodenext></node>
+<top spaces=" "><sectiontitle>top</sectiontitle>
+
+</top>
+<node name="chap" spaces=" "><nodename>chap</nodename><nodeprev 
automatic="on">Top</nodeprev><nodeup automatic="on">Top</nodeup></node>
+<chapter spaces=" "><sectiontitle>Chapter</sectiontitle>
+<para><dotless spacesaftercmd=" ">ê</dotless>
+</para></chapter>
+';
+
+
+$result_converted{'docbook'}->{'dotless_argument_non_ascii'} = '<chapter 
label="1" id="chap">
+<title>Chapter</title>
+<para>ê
+</para></chapter>
+';
+
+
+$result_converted{'latex_text'}->{'dotless_argument_non_ascii'} = 
'\\begin{document}
+\\label{anchor:Top}%
+\\chapter{{Chapter}}
+\\label{anchor:chap}%
+ê
+';
+
+1;



reply via email to

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