texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: @deftypeline in texi2any


From: Gavin D. Smith
Subject: branch master updated: @deftypeline in texi2any
Date: Mon, 03 Apr 2023 16:46:42 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 33051667da @deftypeline in texi2any
33051667da is described below

commit 33051667daf89a7c3a6044dfa99c94b0241a429a
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Mon Apr 3 21:46:28 2023 +0100

    @deftypeline in texi2any
    
    * tp/Texinfo/command_data.txt,
    * tp/Texinfo/Common.pm (%def_map),
    * tp/Texinfo/XS/parsetexi/def.c (def_maps):
    Add @deftypeline.
    
    * tp/Texinfo/ParserNonXS.pm (_gather_def_item, _end_line_def_line),
    * tp/Texinfo/XS/parsetexi/def.c (gather_def_item),
    * tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line),
    * tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command):
    Treat @deftypeline the same as @defline.
    
    * tp/Texinfo/Convert/DocBook.pm (%defcommand_name_type),
    * tp/Texinfo/Convert/LaTeX.pm (_convert),
    * tp/Texinfo/Convert/Plaintext.pm (_convert),
    * tp/Texinfo/Convert/TexinfoMarkup.pm (%defcommand_name_type):
    Handle @deftypeline.
---
 ChangeLog                                 | 21 +++++++++++++++++++++
 tp/Texinfo/Common.pm                      |  3 ++-
 tp/Texinfo/Convert/DocBook.pm             |  1 +
 tp/Texinfo/Convert/LaTeX.pm               |  1 +
 tp/Texinfo/Convert/Plaintext.pm           |  5 +++--
 tp/Texinfo/Convert/TexinfoMarkup.pm       |  1 +
 tp/Texinfo/ParserNonXS.pm                 |  6 ++++--
 tp/Texinfo/XS/parsetexi/command_ids.h     |  1 +
 tp/Texinfo/XS/parsetexi/def.c             |  7 +++++--
 tp/Texinfo/XS/parsetexi/end_line.c        |  2 +-
 tp/Texinfo/XS/parsetexi/handle_commands.c |  2 +-
 tp/Texinfo/command_data.txt               |  1 +
 12 files changed, 42 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4fa22e73bf..edaf5fb4f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2023-04-03  Gavin Smith <gavinsmith0123@gmail.com>
+
+       @deftypeline in texi2any
+
+       * tp/Texinfo/command_data.txt,
+       * tp/Texinfo/Common.pm (%def_map),
+       * tp/Texinfo/XS/parsetexi/def.c (def_maps):
+       Add @deftypeline.
+
+       * tp/Texinfo/ParserNonXS.pm (_gather_def_item, _end_line_def_line),
+       * tp/Texinfo/XS/parsetexi/def.c (gather_def_item),
+       * tp/Texinfo/XS/parsetexi/end_line.c (end_line_def_line),
+       * tp/Texinfo/XS/parsetexi/handle_commands.c (handle_line_command):
+       Treat @deftypeline the same as @defline.
+
+       * tp/Texinfo/Convert/DocBook.pm (%defcommand_name_type),
+       * tp/Texinfo/Convert/LaTeX.pm (_convert),
+       * tp/Texinfo/Convert/Plaintext.pm (_convert),
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (%defcommand_name_type):
+       Handle @deftypeline.
+
 2023-04-03  Gavin Smith <gavinsmith0123@gmail.com>
 
        * install-info/Makefile.am (LDADD): Add $(GETRANDOM) in attempt
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index fb665ab5b8..e9cb54d8c4 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -571,7 +571,8 @@ our %def_map = (
     # basic commands.
     # 'arg' and 'argtype' are for everything appearing after the other
     # arguments.
-    'defline',   [ 'category', 'name', 'arg' ],
+    'defline',     [ 'category', 'name', 'arg' ],
+    'deftypeline', [ 'category', 'type', 'name', 'argtype' ],
     'deffn',     [ 'category', 'name', 'arg' ],
     'defvr',     [ 'category', 'name' ],
     'deftypefn', [ 'category', 'type', 'name', 'argtype' ],
diff --git a/tp/Texinfo/Convert/DocBook.pm b/tp/Texinfo/Convert/DocBook.pm
index 3e274a6832..be54678f67 100644
--- a/tp/Texinfo/Convert/DocBook.pm
+++ b/tp/Texinfo/Convert/DocBook.pm
@@ -194,6 +194,7 @@ my %default_args_code_style
 
 my %defcommand_name_type = (
  'defline'   => 'varname',
+ 'deftypeline' => 'varname',
  'defcv'     => 'property',
  'deffn'     => 'function',
  'defop'     => 'methodname',
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 8d2715dcc7..eb78878ab4 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -4004,6 +4004,7 @@ sub _convert($$)
         # condition
         and !($def_commands{$cmdname}
               and ($cmdname eq 'defline'
+                   or $cmdname eq 'deftypeline'
                    or $cmdname =~ /x$/))) {
       warn "Unhandled $cmdname\n";
       #$result .= "!!!!!!!!! Unhandled $cmdname !!!!!!!!!\n";
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 3e1b7696b1..cb24875476 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -3034,7 +3034,7 @@ sub _convert($$)
         # are not considered as index entries either so they have a specific
         # condition
         and !($def_commands{$command}
-              and ($command eq 'defline'
+              and ($command eq 'defline' or $command eq 'deftypeline'
                     or $command =~ /x$/))) {
       warn "Unhandled $command\n";
       $result .= "!!!!!!!!! Unhandled $command !!!!!!!!!\n";
@@ -3121,7 +3121,8 @@ sub _convert($$)
                  'category' => $category,
                  'name' => $name});
           }
-        } elsif ($command eq 'deftypefn'
+        } elsif ($command eq 'deftypeline'
+                 or $command eq 'deftypefn'
                  or $command eq 'deftypevr') {
           if ($arguments) {
             my $strings = {
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index dece3dd88f..4165ba8b57 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -222,6 +222,7 @@ foreach my $brace_command 
(keys(%Texinfo::Commands::brace_commands)) {
 
 my %defcommand_name_type = (
  'defline'   => 'symbol',
+ 'deftypeline' => 'symbol',
  'deffn'     => 'function',
  'defvr'     => 'variable',
  'deftypefn' => 'function',
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index fe0fdc6e3a..460de14e1f 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1795,7 +1795,8 @@ sub _gather_def_item($$;$)
 
   my $type;
   # means that we are between a @def*x and a @def
-  if ($next_command and $next_command ne 'defline') {
+  if ($next_command
+        and $next_command ne 'defline' and $next_command ne 'deftypeline') {
     $type = 'inter_def_item';
   } else {
     $type = 'def_item';
@@ -3801,7 +3802,8 @@ sub _end_line_def_line($$$)
       _enter_index_entry($self,
         $current->{'extra'}->{'def_command'},
         $current, $source_info)
-           if $current->{'extra'}->{'def_command'} ne 'defline';
+           if $current->{'extra'}->{'def_command'} ne 'defline'
+             and $current->{'extra'}->{'def_command'} ne 'deftypeline';
     } else {
       $self->_command_warn($current, $source_info,
                            __('missing name for @%s'),
diff --git a/tp/Texinfo/XS/parsetexi/command_ids.h 
b/tp/Texinfo/XS/parsetexi/command_ids.h
index 820941ac2a..a1792e3aec 100644
--- a/tp/Texinfo/XS/parsetexi/command_ids.h
+++ b/tp/Texinfo/XS/parsetexi/command_ids.h
@@ -142,6 +142,7 @@ CM_deftypefun,
 CM_deftypefunx,
 CM_deftypeivar,
 CM_deftypeivarx,
+CM_deftypeline,
 CM_deftypemethod,
 CM_deftypemethodx,
 CM_deftypeop,
diff --git a/tp/Texinfo/XS/parsetexi/def.c b/tp/Texinfo/XS/parsetexi/def.c
index 7c6ff85a42..69c1250f02 100644
--- a/tp/Texinfo/XS/parsetexi/def.c
+++ b/tp/Texinfo/XS/parsetexi/def.c
@@ -1,4 +1,4 @@
-/* Copyright 2010-2019 Free Software Foundation, Inc.
+/* Copyright 2010-2023 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -31,7 +31,8 @@ gather_def_item (ELEMENT *current, enum command_id 
next_command)
   ELEMENT *def_item;
   int contents_count, i;
 
-  if (next_command && next_command != CM_defline)
+  if (next_command
+      && next_command != CM_defline && next_command != CM_deftypeline)
     type = ET_inter_def_item; /* Between @def*x and @def*. */
   else
     type = ET_def_item;
@@ -157,6 +158,7 @@ typedef struct {
      ARGUMENTS - arguments to a function or macro                  */
 
 char *defline_arguments[] = {"category", "name", "arg", 0};
+char *deftypeline_arguments[] = {"category", "type", "name", "argtype", 0};
 char *defvr_arguments[] = {"category", "name", 0};
 char *deftypefn_arguments[] = {"category", "type", "name", "argtype", 0};
 char *deftypeop_arguments[] = {"category", "class" , "type", "name", 
"argtype", 0};
@@ -168,6 +170,7 @@ char *deftp_arguments[] = {"category", "name", "argtype", 
0};
 
 DEF_MAP def_maps[] = {
   CM_defline, defline_arguments,
+  CM_deftypeline, deftypeline_arguments,
   CM_deffn, defline_arguments,
   CM_defvr, defvr_arguments,
   CM_deftypefn, deftypefn_arguments,
diff --git a/tp/Texinfo/XS/parsetexi/end_line.c 
b/tp/Texinfo/XS/parsetexi/end_line.c
index 735e45b5fd..b52291ced9 100644
--- a/tp/Texinfo/XS/parsetexi/end_line.c
+++ b/tp/Texinfo/XS/parsetexi/end_line.c
@@ -852,7 +852,7 @@ end_line_def_line (ELEMENT *current)
                                  index_entry);
             }
 
-          if (def_command != CM_defline)
+          if (def_command != CM_defline && def_command != CM_deftypeline)
             enter_index_entry (def_command, current);
         }
       else
diff --git a/tp/Texinfo/XS/parsetexi/handle_commands.c 
b/tp/Texinfo/XS/parsetexi/handle_commands.c
index b9a07a026a..9020e29af0 100644
--- a/tp/Texinfo/XS/parsetexi/handle_commands.c
+++ b/tp/Texinfo/XS/parsetexi/handle_commands.c
@@ -787,7 +787,7 @@ handle_line_command (ELEMENT *current, char **line_inout,
               enum command_id cmdname;
               char *val;
 
-              if (cmd == CM_defline)
+              if (cmd == CM_defline || cmd == CM_deftypeline)
                 {
                   base_command = cmd;
                   add_extra_string_dup (command_e, "original_def_cmdname",
diff --git a/tp/Texinfo/command_data.txt b/tp/Texinfo/command_data.txt
index e68cc7e8f2..c9d4f3d381 100644
--- a/tp/Texinfo/command_data.txt
+++ b/tp/Texinfo/command_data.txt
@@ -494,6 +494,7 @@ deftypemethod           
block,def,contain_basic_inline,def_alias,close_paragraph
 # generic, no automatic index
 defblock                block,contain_basic_inline,close_paragraph       
BLOCK_def
 defline                 line,def,contain_basic_inline,close_paragraph        
LINE_line
+deftypeline             line,def,contain_basic_inline,close_paragraph        
LINE_line
 
 # def*x
 deffnx                  line,def,contain_basic_inline,close_paragraph        
LINE_line



reply via email to

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