texinfo-commits
[Top][All Lists]
Advanced

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

[8362] parsetexi update


From: gavinsmith0123
Subject: [8362] parsetexi update
Date: Sun, 21 Oct 2018 06:43:55 -0400 (EDT)

Revision: 8362
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8362
Author:   gavin
Date:     2018-10-21 06:43:55 -0400 (Sun, 21 Oct 2018)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/tp/Texinfo/XS/parsetexi/Makefile.am
    trunk/tp/Texinfo/XS/parsetexi/close.c
    trunk/tp/Texinfo/XS/parsetexi/command_data.txt
    trunk/tp/Texinfo/XS/parsetexi/command_ids.h
    trunk/tp/Texinfo/XS/parsetexi/commands.h
    trunk/tp/Texinfo/XS/parsetexi/def.c
    trunk/tp/Texinfo/XS/parsetexi/end_line.c
    trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
    trunk/tp/Texinfo/XS/parsetexi/handle_commands.h
    trunk/tp/Texinfo/XS/parsetexi/indices.c
    trunk/tp/Texinfo/XS/parsetexi/multitable.c
    trunk/tp/Texinfo/XS/parsetexi/parser.c
    trunk/tp/Texinfo/XS/parsetexi/separator.c

Modified: trunk/tp/Texinfo/XS/parsetexi/Makefile.am
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/Makefile.am   2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/Makefile.am   2018-10-21 10:43:55 UTC (rev 
8362)
@@ -104,5 +104,8 @@
 element_types.c element_types.h: element_types.txt element_types.awk
        awk -f element_types.awk element_types.txt >element_types.h
 
-command_data.c command_ids.h: command_data.txt command_data.awk
-       awk -f command_data.awk command_data.txt >command_ids.h
+$(srcdir)/command_data.c $(srcdir)/command_ids.h: command_data.txt 
command_data.awk
+       awk -f $(srcdir)/command_data.awk $(srcdir)/command_data.txt  \
+               >$(srcdir)/command_ids.h ; \
+       cp command_data.c $(srcdir)/command_data.c
+

Modified: trunk/tp/Texinfo/XS/parsetexi/close.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/close.c       2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/close.c       2018-10-21 10:43:55 UTC (rev 
8362)
@@ -289,7 +289,7 @@
             {
               pop_context ();
             }
-          if (command_data(cmd).flags & CF_region)
+          if (command_data(cmd).data == BLOCK_region)
             {
               pop_region ();
             }
@@ -407,8 +407,7 @@
             abort ();
         }
 
-      // 1784
-      if (command_data(current->cmd).flags & CF_region)
+      if (command_data(current->cmd).data == BLOCK_region)
         pop_region ();
 
       *closed_element = current;

Modified: trunk/tp/Texinfo/XS/parsetexi/command_data.txt
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/command_data.txt      2018-10-21 10:42:12 UTC 
(rev 8361)
+++ trunk/tp/Texinfo/XS/parsetexi/command_data.txt      2018-10-21 10:43:55 UTC 
(rev 8362)
@@ -1,5 +1,4 @@
-# Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
-# Free Software Foundation, Inc.
+# Copyright 2010-2018 Free Software Foundation, Inc.
 #
 # This file is part of GNU Texinfo.
 #
@@ -42,138 +41,143 @@
 {      nobrace
 \\     nobrace
 
-##############################################################
-# line 405 - misc commands. line commands without an @end.
-node                   misc            MISC_line
-bye                    misc            MISC_skipline
-end                    misc            MISC_text
+##########################################################
+#
+# line commands
+#
+##########################################################
+node                   line            LINE_line
+bye                    line            LINE_skipline
+end                    line            LINE_text
 # set, clear
-set                    misc            MISC_special
-clear                  misc            MISC_special
-unmacro                misc            MISC_special
+set                    line            LINE_special
+clear                  line            LINE_special
+unmacro                line            LINE_special
 # comments
-c                      misc            MISC_lineraw
-comment                misc            MISC_lineraw
+c                      line            LINE_lineraw
+comment                line            LINE_lineraw
 # special
-definfoenclose         misc            3
-alias                  misc            2
+definfoenclose         line            3
+alias                  line            2
 # number of arguments is not known in advance.
-columnfractions                misc            1
+columnfractions                line            1
 # file names
-setfilename            misc,global_unique              MISC_text
-verbatiminclude                misc            MISC_text
-include                misc            MISC_text
+setfilename            line,global_unique              LINE_text
+verbatiminclude                line            LINE_text
+include                line            LINE_text
 
-raisesections                  misc            MISC_skipline
-lowersections                  misc            MISC_skipline
-contents                       misc,global             MISC_skipline
-shortcontents                  misc,global             MISC_skipline
-summarycontents                        misc,global             MISC_skipline
-insertcopying                  misc,global             MISC_noarg
-clickstyle                     misc,global             MISC_special
+raisesections                  line            LINE_skipline
+lowersections                  line            LINE_skipline
+contents                       line,global             LINE_skipline
+shortcontents                  line,global             LINE_skipline
+summarycontents                        line,global             LINE_skipline
+insertcopying                  line,global             LINE_skipline
+clickstyle                     line,global             LINE_special
 # more relevant in preamble
-setcontentsaftertitlepage      misc,deprecated         MISC_skipline
-setshortcontentsaftertitlepage misc,deprecated         MISC_skipline
-documentencoding               misc,global             MISC_text
-novalidate                     misc,global_unique      MISC_skipline
-validatemenus                  misc,global_unique      1
-dircategory                    misc            MISC_line
+setcontentsaftertitlepage      line,deprecated         LINE_skipline
+setshortcontentsaftertitlepage line,deprecated         LINE_skipline
+documentencoding               line,global             LINE_text
+novalidate                     line,global_unique      LINE_skipline
+validatemenus                  line,global_unique      1
+dircategory                    line            LINE_line
 # with direntry is significant
-pagesizes                      misc,global_unique      MISC_line
+pagesizes                      line,global_unique      LINE_line
 # or one? 200mm,150mm 11.5in
-finalout                       misc            MISC_skipline
-paragraphindent                        misc,global             1
+finalout                       line            LINE_skipline
+paragraphindent                        line,global             1
 # or a number and forbids anything else on the line
-firstparagraphindent           misc,global             1
-frenchspacing                  misc,global             1
-codequoteundirected            misc,global             1
-codequotebacktick              misc,global             1
-xrefautomaticsectiontitle      misc,global             1
-deftypefnnewline               misc,global             1
-fonttextsize                   misc,global_unique              1
-allowcodebreaks                        misc,global                     1
-exampleindent                  misc,global             1
-footnotestyle                  misc,global_unique              1
-urefbreakstyle                 misc,global             1
-afourpaper                     misc            MISC_skipline
-afivepaper                     misc            MISC_skipline
-afourlatex                     misc            MISC_skipline
-afourwide                      misc            MISC_skipline
-headings                       misc,global             1
-setchapternewpage              misc,global_unique              1
+firstparagraphindent           line,global             1
+frenchspacing                  line,global             1
+codequoteundirected            line,global             1
+codequotebacktick              line,global             1
+xrefautomaticsectiontitle      line,global             1
+deftypefnnewline               line,global             1
+fonttextsize                   line,global_unique              1
+allowcodebreaks                        line,global                     1
+exampleindent                  line,global             1
+footnotestyle                  line,global_unique              1
+urefbreakstyle                 line,global             1
+afourpaper                     line            LINE_skipline
+afivepaper                     line            LINE_skipline
+afourlatex                     line            LINE_skipline
+afourwide                      line            LINE_skipline
+headings                       line,global             1
+setchapternewpage              line,global_unique              1
 
 # only relevant in TeX, and special
-everyheading                   misc,global_unique              MISC_lineraw
-everyfooting                   misc,global_unique              MISC_lineraw
-evenheading                    misc,global_unique              MISC_lineraw
-evenfooting                    misc,global_unique              MISC_lineraw
-oddheading                     misc,global_unique              MISC_lineraw
-oddfooting                     misc,global_unique              MISC_lineraw
+everyheading                   line,global_unique              LINE_lineraw
+everyfooting                   line,global_unique              LINE_lineraw
+evenheading                    line,global_unique              LINE_lineraw
+evenfooting                    line,global_unique              LINE_lineraw
+oddheading                     line,global_unique              LINE_lineraw
+oddfooting                     line,global_unique              LINE_lineraw
 
-smallbook                      misc            MISC_skipline
-syncodeindex                   misc            2
-synindex                       misc            2
-defindex                       misc            1
-defcodeindex                   misc            1
-documentlanguage               misc,global             MISC_text
-kbdinputstyle                  misc,global             1
-everyheadingmarks              misc,global_unique              1
-everyfootingmarks              misc,global_unique              1
-evenheadingmarks               misc,global_unique              1
-oddheadingmarks                        misc,global_unique              1
-evenfootingmarks               misc,global_unique              1
-oddfootingmarks                        misc,global_unique              1
+smallbook                      line            LINE_skipline
+syncodeindex                   line            2
+synindex                       line            2
+defindex                       line            1
+defcodeindex                   line            1
+documentlanguage               line,global             LINE_text
+kbdinputstyle                  line,global             1
+everyheadingmarks              line,global_unique              1
+everyfootingmarks              line,global_unique              1
+evenheadingmarks               line,global_unique              1
+oddheadingmarks                        line,global_unique              1
+evenfootingmarks               line,global_unique              1
+oddfootingmarks                        line,global_unique              1
 # not valid for info (should be in @iftex)
-cropmarks                      misc            MISC_skipline
+cropmarks                      line            LINE_skipline
 
 # formatting
-center                         misc            MISC_line
-printindex                     misc,global             1
-listoffloats                   misc,global             MISC_line
+center                         line            LINE_line
+printindex                     line,global             1
+listoffloats                   line,global             LINE_line
 # especially in titlepage
 #  shorttitle
-shorttitlepage                 misc,global_unique      MISC_line
-settitle                       misc,global_unique      MISC_line
-author                         misc,global             MISC_line
-subtitle                       misc,global             MISC_line
-title                          misc,global_unique      MISC_line
-sp                             misc            1
-page                           misc            MISC_skipline
-need                           misc            1
+shorttitlepage                 line,global_unique      LINE_line
+settitle                       line,global_unique      LINE_line
+author                         line,global             LINE_line
+subtitle                       line,global             LINE_line
+title                          line,global_unique      LINE_line
+sp                             line            1
+page                           line            LINE_skipline
+need                           line            1
+
+# not valid for info (should be in @iftex)
+vskip                          line            LINE_lineraw
+
+exdent                         line            LINE_line
+
+item_LINE                      line            LINE_line
+itemx                          line            LINE_line
+
+##########################################################
+#
+# miscellaneous commands
+#
+##########################################################
+
 # formatting
-noindent                       misc            MISC_skipspace
-indent                         misc            MISC_skipspace
-exdent                         misc            MISC_line
-headitem                       misc            MISC_skipspace
-item                           misc            MISC_skipspace
-itemx                          misc            MISC_skipspace
-tab                            misc            MISC_skipspace
+noindent                       other           OTHER_skipspace
+indent                         other           OTHER_skipspace
+headitem                       other           OTHER_skipspace
+item                           other           OTHER_skipspace
+tab                            other           OTHER_skipspace
 # only valid in heading or footing
-thischapter                    misc,in_heading         MISC_noarg
-thischaptername                        misc,in_heading         MISC_noarg
-thischapternum                 misc,in_heading         MISC_noarg
-thisfile                       misc,in_heading         MISC_noarg
-thispage                       misc,in_heading         MISC_noarg
-thistitle                      misc,in_heading         MISC_noarg
-# not valid for info (should be in @iftex)
-vskip                          misc            MISC_lineraw
+thischapter                    other,in_heading        OTHER_noarg
+thischaptername                        other,in_heading        OTHER_noarg
+thischapternum                 other,in_heading        OTHER_noarg
+thisfile                       other,in_heading        OTHER_noarg
+thispage                       other,in_heading        OTHER_noarg
+thistitle                      other,in_heading        OTHER_noarg
 # obsolete @-commands.
-refill                         misc            MISC_noarg
-# Remove spaces and end of lines after the 
-# commands? If no, they can lead to empty lines
-# TODO: Check what these two are.
-# They were obsolete and undocumented commands for macro definitions,
-# never supported in texinfo.tex.
-#quote-arg                     misc,deprecated         MISC_skipline
-#allow-recursion               misc,deprecated         MISC_skipline
+refill                         other           OTHER_noarg
 
-# line 515
-##########################################################
 
 
 ##########################################################
 #
-# line 555 - brace commands
+# brace commands
 #
 ##########################################################
 
@@ -273,12 +277,12 @@
 var            brace   BRACE_style
 headitemfont   brace   BRACE_style
 code           brace,code_style        BRACE_style
-command                brace,code_style,code_style     BRACE_style
-env            brace,code_style,code_style     BRACE_style
-file           brace,code_style,code_style     BRACE_style
-kbd            brace,code_style,code_style     BRACE_style
-option         brace,code_style,code_style     BRACE_style
-samp           brace,code_style,code_style     BRACE_style
+command                brace,code_style        BRACE_style
+env            brace,code_style        BRACE_style
+file           brace,code_style        BRACE_style
+kbd            brace,code_style        BRACE_style
+option         brace,code_style        BRACE_style
+samp           brace,code_style        BRACE_style
 strong         brace   BRACE_style
 sub            brace   BRACE_style
 sup            brace   BRACE_style
@@ -372,27 +376,27 @@
 deftypemethod          block,def,def_alias
 
 # def*x
-deffnx                 misc,def                MISC_line
-defvrx                 misc,def                MISC_line
-deftypefnx             misc,def                MISC_line
-deftypeopx             misc,def                MISC_line
-deftypevrx             misc,def                MISC_line
-defcvx                 misc,def                MISC_line
-deftypecvx             misc,def                MISC_line
-defopx                 misc,def                MISC_line
-deftpx                 misc,def                MISC_line
+deffnx                 line,def                LINE_line
+defvrx                 line,def                LINE_line
+deftypefnx             line,def                LINE_line
+deftypeopx             line,def                LINE_line
+deftypevrx             line,def                LINE_line
+defcvx                 line,def                LINE_line
+deftypecvx             line,def                LINE_line
+defopx                 line,def                LINE_line
+deftpx                 line,def                LINE_line
 #   shortcuts
-defunx                 misc,def,def_alias              MISC_line
-defmacx                        misc,def,def_alias              MISC_line
-defspecx               misc,def,def_alias              MISC_line
-defvarx                        misc,def,def_alias              MISC_line
-defoptx                        misc,def,def_alias              MISC_line
-deftypefunx            misc,def,def_alias              MISC_line
-deftypevarx            misc,def,def_alias              MISC_line
-defivarx               misc,def,def_alias              MISC_line
-deftypeivarx           misc,def,def_alias              MISC_line
-defmethodx             misc,def,def_alias              MISC_line
-deftypemethodx         misc,def,def_alias              MISC_line
+defunx                 line,def,def_alias              LINE_line
+defmacx                        line,def,def_alias              LINE_line
+defspecx               line,def,def_alias              LINE_line
+defvarx                        line,def,def_alias              LINE_line
+defoptx                        line,def,def_alias              LINE_line
+deftypefunx            line,def,def_alias              LINE_line
+deftypevarx            line,def,def_alias              LINE_line
+defivarx               line,def,def_alias              LINE_line
+deftypeivarx           line,def,def_alias              LINE_line
+defmethodx             line,def,def_alias              LINE_line
+deftypemethodx         line,def,def_alias              LINE_line
 
 # 760
 multitable             block,blockitem         BLOCK_multitable
@@ -414,9 +418,9 @@
 smallindentedblock     block
 
 # region commands
-titlepage              block,global_unique,region
-copying                        block,global_unique,region
-documentdescription    block,global_unique,region
+titlepage              block,global_unique     BLOCK_region
+copying                        block,global_unique     BLOCK_region
+documentdescription    block,global_unique     BLOCK_region
 
 # preformatted commands
 example                        block,preformatted,preformatted_code
@@ -474,27 +478,27 @@
 
 ##########################################################
 # Root commands - line 887
-node                   root,misc                       MISC_line
-top                    root,misc,sectioning,global_unique      MISC_line
-chapter                        root,misc,sectioning            MISC_line
-unnumbered             root,misc,sectioning            MISC_line
-chapheading            misc,sectioning                 MISC_line
-appendix               root,misc,sectioning            MISC_line
-section                        root,misc,sectioning            MISC_line
-unnumberedsec          root,misc,sectioning            MISC_line
-heading                        misc,sectioning                 MISC_line
-appendixsec            root,misc,sectioning            MISC_line
-subsection             root,misc,sectioning            MISC_line
-unnumberedsubsec       root,misc,sectioning            MISC_line
-subheading             misc,sectioning                 MISC_line
-appendixsubsec         root,misc,sectioning            MISC_line
-subsubsection          root,misc,sectioning            MISC_line
-unnumberedsubsubsec    root,misc,sectioning            MISC_line
-subsubheading          misc,sectioning                 MISC_line
-appendixsubsubsec      root,misc,sectioning            MISC_line
+node                   root,line                       LINE_line
+top                    root,line,sectioning,global_unique      LINE_line
+chapter                        root,line,sectioning            LINE_line
+unnumbered             root,line,sectioning            LINE_line
+chapheading            line,sectioning                 LINE_line
+appendix               root,line,sectioning            LINE_line
+section                        root,line,sectioning            LINE_line
+unnumberedsec          root,line,sectioning            LINE_line
+heading                        line,sectioning                 LINE_line
+appendixsec            root,line,sectioning            LINE_line
+subsection             root,line,sectioning            LINE_line
+unnumberedsubsec       root,line,sectioning            LINE_line
+subheading             line,sectioning                 LINE_line
+appendixsubsec         root,line,sectioning            LINE_line
+subsubsection          root,line,sectioning            LINE_line
+unnumberedsubsubsec    root,line,sectioning            LINE_line
+subsubheading          line,sectioning                 LINE_line
+appendixsubsubsec      root,line,sectioning            LINE_line
 
-part                   root,misc,sectioning,global     MISC_line
-appendixsection                root,misc,sectioning    MISC_line
-majorheading           misc,sectioning         MISC_line
-centerchap             root,misc,sectioning    MISC_line
+part                   root,line,sectioning,global     LINE_line
+appendixsection                root,line,sectioning    LINE_line
+majorheading           line,sectioning         LINE_line
+centerchap             root,line,sectioning    LINE_line
 

Modified: trunk/tp/Texinfo/XS/parsetexi/command_ids.h
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/command_ids.h 2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/command_ids.h 2018-10-21 10:43:55 UTC (rev 
8362)
@@ -245,6 +245,7 @@
 CM_inlineraw,
 CM_insertcopying,
 CM_item,
+CM_item_LINE,
 CM_itemize,
 CM_itemx,
 CM_kbd,

Modified: trunk/tp/Texinfo/XS/parsetexi/commands.h
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/commands.h    2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/commands.h    2018-10-21 10:43:55 UTC (rev 
8362)
@@ -43,9 +43,9 @@
 /* In indices.c */
 void init_index_commands (void);
 
-/* Available command flags.  Based on tp/Texinfo/Common.pm. */
+/* Available command flags. */
 
-#define CF_misc                                0x0001
+#define CF_line                                0x0001
 #define CF_deprecated                  0x0002
 #define CF_root                                0x0004
 #define CF_sectioning                  0x0008
@@ -67,7 +67,7 @@
 #define CF_def_alias                   0x00040000
 #define CF_menu                                0x00080000
 #define CF_align                       0x00100000
-#define CF_region                      0x00200000
+#define CF_other                       0x00200000
 #define CF_preformatted                        0x00400000
 #define CF_preformatted_code           0x00800000
 #define CF_item_container              0x01000000
@@ -80,8 +80,7 @@
 #define CF_global_unique               0x80000000
 
 /* NOTE: We've run out of spaces for flags, but some of these may not
-   be used, or may not be necessary. For example, region could be done
-   as BLOCK_region in data instead.
+   be used, or may not be necessary.
      CF_code_style, CF_deprecated are hardly used.
 
    Candidates for flags:
@@ -90,20 +89,22 @@
    Could combine CF_MACRO, CF_ALIAS, and CF_INFOENCLOSE into 2 bits.
  */
 
-/* Types of misc command (has CF_misc flag).  Values for COMMAND.data. */
-/* See Common.pm:376 */
-#define MISC_special -1
-#define MISC_lineraw -2
-#define MISC_skipline -3
-#define MISC_skipspace -4
-#define MISC_noarg -5
-#define MISC_text -6
-#define MISC_line -7
+/* Types of line command (has CF_line flag).  Values for COMMAND.data. */
+#define LINE_special -1
+#define LINE_lineraw -2
+#define LINE_skipline -3
+#define LINE_text -6
+#define LINE_line -7
 
-/* Types of block command (CF_block).  Common.pm:687. */
+/* Types of other command (has CF_other flag). */
+#define OTHER_skipspace -1
+#define OTHER_noarg -2
+
+/* Types of block command (CF_block). */
 #define BLOCK_conditional -1
 #define BLOCK_raw -2
 #define BLOCK_multitable -3
+#define BLOCK_region -4
 
 /* Types of brace command (CF_brace). */
 #define BRACE_context -1 /* Can enclose paragraph breaks. */

Modified: trunk/tp/Texinfo/XS/parsetexi/def.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/def.c 2018-10-21 10:42:12 UTC (rev 8361)
+++ trunk/tp/Texinfo/XS/parsetexi/def.c 2018-10-21 10:43:55 UTC (rev 8362)
@@ -1,5 +1,4 @@
-/* Copyright 2010, 2011, 2012, 2013, 2014, 2015
-   Free Software Foundation, Inc.
+/* Copyright 2010-2018 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
@@ -19,7 +18,6 @@
 #include "parser.h"
 #include "text.h"
 
-// 1471
 void
 gather_def_item (ELEMENT *current, enum command_id next_command)
 {
@@ -39,7 +37,7 @@
      "This may happen for a construct like:
      @deffnx a b @section
      but otherwise the end of line will lead to the command closing." */
-  if (command_data(current->cmd).flags & CF_misc)
+  if (command_data(current->cmd).flags & CF_line)
     return;
 
   def_item = new_element (type);

Modified: trunk/tp/Texinfo/XS/parsetexi/end_line.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/end_line.c    2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/end_line.c    2018-10-21 10:43:55 UTC (rev 
8362)
@@ -1327,7 +1327,7 @@
       if (args)
         add_extra_misc_args (current, "misc_args", args);
     }
-  else if (arg_type == MISC_text) /* 3118 */
+  else if (arg_type == LINE_text) /* 3118 */
     {
       char *text = 0;
       int superfluous_arg = 0;
@@ -2146,7 +2146,7 @@
 
       def_command = original_def_command;
       /* Strip an trailing x from the command, e.g. @deffnx -> @deffn */
-      if (command_data(def_command).flags & CF_misc)
+      if (command_data(def_command).flags & CF_line)
         {
           char *stripped = strdup (command_name(def_command));
           stripped[strlen (stripped) - 1] = '\0';

Modified: trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/handle_commands.c     2018-10-21 10:42:12 UTC 
(rev 8361)
+++ trunk/tp/Texinfo/XS/parsetexi/handle_commands.c     2018-10-21 10:43:55 UTC 
(rev 8362)
@@ -81,11 +81,242 @@
   return after_paragraph;
 }
 
-/* Line 4289 */
+/* noarg skipspace */
+ELEMENT *
+handle_other_command (ELEMENT *current, char **line_inout,
+                     enum command_id cmd, int *status,
+                     enum command_id invalid_parent)
+{
+  ELEMENT *misc = 0;
+  char *line = *line_inout;
+  int arg_spec;
+
+  arg_spec = command_data(cmd).data;
+  if (arg_spec == OTHER_noarg)
+    {
+      int only_in_headings = 0;
+      if (command_data(cmd).flags & CF_in_heading)
+        {
+          line_error ("@%s should only appear in heading or footing",
+                      command_name(cmd));
+          only_in_headings = 1;
+        }
+
+      misc = new_element (ET_NONE);
+      misc->cmd = cmd;
+      add_to_element_contents (current, misc);
+      if (only_in_headings)
+        add_extra_integer (misc, "invalid_nesting", 1);
+      register_global_command (misc);
+      mark_and_warn_invalid (cmd, invalid_parent, misc);
+      if (close_preformatted_command(cmd))
+        current = begin_preformatted (current);
+    }
+  else
+    {
+      /* @item can occur in several contents: in an @itemize, a @table, or
+         a @multitable. */
+      if (cmd == CM_item || cmd == CM_headitem || cmd == CM_tab)
+        {
+          ELEMENT *parent;
+
+          /* @itemize or @enumerate */
+          if ((parent = item_container_parent (current)))
+            {
+              if (cmd == CM_item)
+                {
+                  debug ("ITEM CONTAINER");
+                  counter_inc (&count_items);
+                  misc = new_element (ET_NONE);
+                  misc->cmd = CM_item;
+
+                  add_extra_integer (misc, "item_number",
+                                     counter_value (&count_items, parent));
+
+                  add_to_element_contents (parent, misc);
+                  current = misc;
+                }
+              else
+                {
+                  line_error ("@%s not meaningful inside address@hidden' 
block",
+                              command_name(cmd),
+                              command_name(parent->cmd));
+                }
+              current = begin_preformatted (current);
+            }
+          /* @table, @vtable, @ftable */
+          else if ((parent = item_line_parent (current)))
+            {
+              line_error ("@%s not meaningful inside address@hidden' block",
+                          command_name(cmd),
+                          command_name(parent->cmd));
+              current = begin_preformatted (current);
+            }
+          /* In a @multitable */
+          else if ((parent = item_multitable_parent (current))) // 4477
+            {
+              if (cmd != CM_item && cmd != CM_headitem
+                  && cmd != CM_tab)
+                {
+                  line_error ("@%s not meaningful inside @%s block",
+                              command_name(cmd),
+                              command_name(parent->cmd)); // 4521
+                }
+              else
+                { /* 4480 */
+                  int max_columns = 0;
+                  KEY_PAIR *prototypes;
+
+                  prototypes = lookup_extra  (parent, "prototypes");
+                  if (prototypes)
+                    max_columns = prototypes->value->contents.number;
+                  else
+                    {
+                      prototypes = lookup_extra(parent, "columnfractions");
+                      if (prototypes)
+                        {
+                          prototypes = lookup_extra((ELEMENT *) 
prototypes->value,
+                                                    "misc_args");
+                          if (prototypes)
+                            max_columns = prototypes->value->contents.number;
+                        }
+                    }
+
+                  if (max_columns == 0)
+                    {
+                      line_warn ("@%s in empty multitable",
+                                 command_name(cmd));
+                    }
+                  else if (cmd == CM_tab)
+                    {
+                      ELEMENT *row;
+                      row = last_contents_child (parent);
+                      if (row->type == ET_before_item)
+                        line_error ("@tab before @item");
+                      else if (counter_value (&count_cells, row)
+                               >= max_columns)
+                        {
+                          line_error ("too many columns in multitable item"
+                                      " (max %d)", max_columns);
+                        }
+                      else
+                        {
+                          counter_inc (&count_cells);
+                          misc = new_element (ET_NONE);
+                          misc->cmd = cmd;
+                          add_to_element_contents (row, misc);
+                          current = misc;
+                          debug ("TAB");
+
+                          add_extra_integer (current, "cell_number",
+                                             counter_value (&count_cells, 
row));
+                        }
+                    }
+                  else /* 4505 @item or @headitem */
+                    {
+                      ELEMENT *row; char *s;
+
+                      debug ("ROW");
+                      row = new_element (ET_row);
+                      add_to_element_contents (parent, row);
+
+                      /* FIXME:The "row_number" extra value,
+                         isn't actually used anywhere. */
+                      asprintf (&s, "%d", parent->contents.number-1);
+                      add_extra_string (row, "row_number", s);
+
+                      misc = new_element (ET_NONE);
+                      misc->cmd = cmd;
+                      add_to_element_contents (row, misc);
+                      current = misc;
+
+                      if (counter_value (&count_cells, parent) != -1)
+                        counter_pop (&count_cells);
+                      counter_push (&count_cells, row, 1);
+                      asprintf (&s, "%d",
+                                counter_value (&count_cells, row));
+                      add_extra_string (current, "cell_number", s);
+                    }
+                }
+              current = begin_preformatted (current);
+            } /* In @multitable */
+          else if (cmd == CM_tab) // 4526
+            {
+              line_error ("ignoring @tab outside of multitable");
+              current = begin_preformatted (current);
+            }
+          else
+            {
+              line_error ("@%s outside of table or list",
+                          command_name(cmd));
+              current = begin_preformatted (current);
+            }
+          if (misc)
+            misc->line_nr = line_nr; // 4535
+        }
+      else
+        {
+          misc = new_element (ET_NONE);
+          misc->cmd = cmd;
+          misc->line_nr = line_nr;
+          add_to_element_contents (current, misc);
+        }
+      start_empty_line_after_command (current, &line, misc);
+      if (cmd == CM_indent || cmd == CM_noindent)
+        {
+          /* Start a new paragraph if not in one already. */
+          int spaces;
+          enum element_type t;
+          ELEMENT *paragraph;
+
+          /* Check if if we should change an ET_empty_line_after_command
+             element to ET_empty_spaces_after_command by looking ahead
+             to see what comes next. */
+          if (!strchr (line, '\n'))
+            {
+              char *line2;
+              input_push_text (strdup (line), 0);
+              line2 = new_line (current);
+              if (line2)
+                line = line2;
+            }
+          spaces = strspn (line, whitespace_chars);
+          if (spaces > 0)
+            {
+              char saved = line[spaces];
+              line[spaces] = '\0';
+              current = merge_text (current, line);
+              line[spaces] = saved;
+              line += spaces;
+            }
+          if (*line
+              && last_contents_child(current)->type
+              == ET_empty_line_after_command)
+            {
+              last_contents_child(current)->type
+                = ET_empty_spaces_after_command;
+            }
+          paragraph = begin_paragraph (current);
+          if (paragraph)
+            current = paragraph;
+          if (!*line)
+            {
+              *status = 1; /* Get a new line. */
+              goto funexit;
+            }
+        }
+      mark_and_warn_invalid (cmd, invalid_parent, misc);
+    }
+
+funexit:
+  *line_inout = line;
+  return current;
+}
+
 /* STATUS is set to 1 if we should get a new line after this,
    2 if we should stop processing completely. */
 ELEMENT *
-handle_misc_command (ELEMENT *current, char **line_inout,
+handle_line_command (ELEMENT *current, char **line_inout,
                      enum command_id cmd, int *status,
                      enum command_id invalid_parent)
 {
@@ -117,15 +348,20 @@
         }
     }
 
-  /* Look up information about this command ( noarg skipline skipspace text 
-     line lineraw /^\d$/). */
+  /* Look up information about this command ( skipline text 
+     line lineraw (a number) ). */
   arg_spec = command_data(cmd).data;
 
-  /* noarg 4312 */
-  if (arg_spec == MISC_noarg)
+  /* All the cases using the raw line.
+     TODO: I don't understand what the difference is between these. */
+  if (arg_spec == LINE_skipline || arg_spec == LINE_lineraw
+           || arg_spec == LINE_special)
     {
+      ELEMENT *args = 0;
+      enum command_id equivalent_cmd = 0;
+      int has_comment = 0;
       int ignored = 0;
-      int only_in_headings = 0;
+
       if (cmd == CM_insertcopying)
         {
           ELEMENT *p = current;
@@ -141,36 +377,7 @@
               p = p->parent;
             }
         }
-      else if (command_data(cmd).flags & CF_in_heading)
-        {
-          line_error ("@%s should only appear in heading or footing",
-                      command_name(cmd));
-          only_in_headings = 1;
-        }
 
-      if (!ignored)
-        {
-          misc = new_element (ET_NONE);
-          misc->cmd = cmd;
-          add_to_element_contents (current, misc);
-          if (only_in_headings)
-            add_extra_integer (misc, "invalid_nesting", 1);
-          register_global_command (misc);
-        }
-      mark_and_warn_invalid (cmd, invalid_parent, misc);
-      if (close_preformatted_command(cmd))
-        current = begin_preformatted (current);
-    }
-  /* All the cases using the raw line.
-     I don't understand what the difference is between these. */
-  else if (arg_spec == MISC_skipline /* 4347 */
-           || arg_spec == MISC_lineraw
-           || arg_spec == MISC_special)
-    {
-      ELEMENT *args = 0;
-      enum command_id equivalent_cmd = 0;
-      int has_comment = 0;
-
       /* 4350 If the current input is the result of a macro expansion,
          it may not be a complete line.  Check for this and acquire the rest
          of the line if necessary. */
@@ -193,7 +400,7 @@
       misc = new_element (ET_NONE);
       misc->cmd = cmd;
 
-      if (arg_spec == MISC_skipline || arg_spec == MISC_lineraw)
+      if (arg_spec == LINE_skipline || arg_spec == LINE_lineraw)
         {
           ELEMENT *arg;
           args = new_element (ET_NONE);
@@ -201,7 +408,7 @@
           add_to_element_contents (args, arg);
           text_append (&arg->text, line);
         }
-      else /* arg_spec == MISC_special */
+      else /* arg_spec == LINE_special */
         {
           args = parse_special_misc_command (line, cmd, &has_comment); //4362
           add_extra_string (misc, "arg_line", strdup (line));
@@ -208,7 +415,7 @@
         }
 
       /* Handle @set txicodequoteundirected as an
-         obsolete alternative to @codequoteundirected. */
+         alternative to @codequoteundirected. */
       if (cmd == CM_set || cmd == CM_clear)
         {
           if (args->contents.number > 0
@@ -266,19 +473,22 @@
       else // 4402
         {
           int i;
-          add_to_element_contents (current, misc);
+          if (!ignored)
+            {
+              add_to_element_contents (current, misc);
 
-          for (i = 0; i < args->contents.number; i++)
-            {
-              ELEMENT *misc_arg = new_element (ET_misc_arg);
-              text_append_n (&misc_arg->text, 
-                             args->contents.list[i]->text.text,
-                             args->contents.list[i]->text.end);
-              add_to_element_args (misc, misc_arg);
+              for (i = 0; i < args->contents.number; i++)
+                {
+                  ELEMENT *misc_arg = new_element (ET_misc_arg);
+                  text_append_n (&misc_arg->text, 
+                                 args->contents.list[i]->text.text,
+                                 args->contents.list[i]->text.end);
+                  add_to_element_args (misc, misc_arg);
+                }
+              /* TODO: Could we have just set misc->args directly as args? */
             }
-          /* TODO: Could we have just set misc->args directly as args? */
 
-          if (args->contents.number > 0 && arg_spec != MISC_skipline)
+          if (args->contents.number > 0 && arg_spec != LINE_skipline)
             add_extra_misc_args (misc, "misc_args", args);
           else
             {
@@ -305,7 +515,7 @@
       mark_and_warn_invalid (cmd, invalid_parent, misc);
       register_global_command (misc); // 4423
 
-      if (arg_spec != MISC_special || !has_comment)
+      if (arg_spec != LINE_special || !has_comment)
         current = end_line (current);
 
       // 4429
@@ -323,177 +533,31 @@
     }
   else
     {
-      /* line 4435 - text, line, skipspace or a number.
-         (This includes handling of "@end", which is MISC_text.) */
+      ELEMENT *arg;
 
-      int line_arg = 0;
-
-      if (arg_spec != MISC_skipspace)
-        line_arg = 1;
-
-      /* 4439 */
-      /*************************************************************/
-      /* Special handling of @item because it can appear
-         in several contents: in an @itemize, a @table, or
-         a @multitable. */
-      if (cmd == CM_item || cmd == CM_itemx
-          || cmd == CM_headitem || cmd == CM_tab)
+      /* line 4435 - text, line, or a number.
+         (This includes handling of "@end", which is LINE_text.) */
+      if (cmd == CM_item_LINE || cmd == CM_itemx)
         {
           ELEMENT *parent;
-
-          /* @itemize or @enumerate */ // 4443
-          if ((parent = item_container_parent (current)))
+          if (parent = item_line_parent (current))
             {
-              if (cmd == CM_item)
-                {
-                  char *s;
-                  debug ("ITEM CONTAINER");
-                  counter_inc (&count_items);
-                  misc = new_element (ET_NONE);
-                  misc->cmd = CM_item;
-
-                  asprintf (&s, "%d", counter_value (&count_items, parent));
-                  add_extra_string (misc, "item_number", s);
-
-                  add_to_element_contents (parent, misc);
-                  current = misc;
-                }
-              else
-                {
-                  line_error ("@%s not meaningful inside address@hidden' 
block",
-                              command_name(cmd),
-                              command_name(parent->cmd));
-                }
-              current = begin_preformatted (current);
+              debug ("ITEM_LINE");
+              current = parent;
+              gather_previous_item (current, cmd);
             }
-          /* @table, @vtable, @ftable */
-          else if ((parent = item_line_parent (current)))
-            {
-              if (cmd == CM_item || cmd == CM_itemx)
-                {
-                  debug ("ITEM_LINE");
-                  current = parent;
-                  gather_previous_item (current, cmd);
-                  misc = new_element (ET_NONE);
-                  misc->cmd = cmd;
-                  add_to_element_contents (current, misc);
-                  line_arg = 1;
-                }
-              else
-                {
-                  line_error ("@%s not meaningful inside address@hidden' 
block",
-                              command_name(cmd),
-                              command_name(parent->cmd));
-                  current = begin_preformatted (current);
-                }
-            }
-          /* In a @multitable */
-          else if ((parent = item_multitable_parent (current))) // 4477
-            {
-              if (cmd != CM_item && cmd != CM_headitem
-                  && cmd != CM_tab)
-                {
-                  line_error ("@%s not meaningful inside @%s block",
-                              command_name(cmd),
-                              command_name(parent->cmd)); // 4521
-                }
-              else
-                { /* 4480 */
-                  int max_columns = 0;
-                  KEY_PAIR *prototypes;
-
-                  prototypes = lookup_extra  (parent, "prototypes");
-                  if (prototypes)
-                    max_columns = prototypes->value->contents.number;
-                  else
-                    {
-                      prototypes = lookup_extra(parent, "columnfractions");
-                      if (prototypes)
-                        {
-                          prototypes = lookup_extra((ELEMENT *) 
prototypes->value,
-                                                    "misc_args");
-                          if (prototypes)
-                            max_columns = prototypes->value->contents.number;
-                        }
-                    }
-
-                  if (max_columns == 0)
-                    {
-                      line_warn ("@%s in empty multitable",
-                                 command_name(cmd));
-                    }
-                  else if (cmd == CM_tab)
-                    { // 4484
-                      ELEMENT *row;
-                      row = last_contents_child (parent);
-                      if (row->type == ET_before_item)
-                        line_error ("@tab before @item");
-                      // 4489
-                      else if (counter_value (&count_cells, row)
-                               >= max_columns)
-                        {
-                          line_error ("too many columns in multitable item"
-                                      " (max %d)", max_columns);
-                        }
-                      else // 4493
-                        {
-                          char *s;
-                          counter_inc (&count_cells);
-                          misc = new_element (ET_NONE);
-                          misc->cmd = cmd;
-                          add_to_element_contents (row, misc);
-                          current = misc;
-                          debug ("TAB");
-
-                          asprintf (&s, "%d",
-                                    counter_value (&count_cells, row));
-                          add_extra_string (current, "cell_number", s);
-                        }
-                    }
-                  else /* 4505 @item or @headitem */
-                    {
-                      ELEMENT *row; char *s;
-
-                      debug ("ROW");
-                      row = new_element (ET_row);
-                      add_to_element_contents (parent, row);
-
-                      /* FIXME:The "row_number" extra value,
-                         isn't actually used anywhere. */
-                      asprintf (&s, "%d", parent->contents.number-1);
-                      add_extra_string (row, "row_number", s);
-
-                      misc = new_element (ET_NONE);
-                      misc->cmd = cmd;
-                      add_to_element_contents (row, misc);
-                      current = misc;
-
-                      if (counter_value (&count_cells, parent) != -1)
-                        counter_pop (&count_cells);
-                      counter_push (&count_cells, row, 1);
-                      asprintf (&s, "%d",
-                                counter_value (&count_cells, row));
-                      add_extra_string (current, "cell_number", s);
-                    }
-                }
-              current = begin_preformatted (current);
-            } /* In @multitable */
-          else if (cmd == CM_tab) // 4526
-            {
-              line_error ("ignoring @tab outside of multitable");
-              current = begin_preformatted (current);
-            }
           else
             {
               line_error ("@%s outside of table or list",
-                          command_name(cmd));
+                          cmd == CM_item_LINE ? "item" : "itemx");
               current = begin_preformatted (current);
             }
-          if (misc)
-            misc->line_nr = line_nr; // 4535
+          misc = new_element (ET_NONE);
+          misc->cmd = (cmd == CM_item_LINE) ? CM_item : CM_itemx;
+          misc->line_nr = line_nr;
+          add_to_element_contents (current, misc);
         }
-      /*************************************************************/
-      else /* Not @item, @itemx, @headitem, nor @tab 4536 */
+      else
         {
           /* Add to contents */
           misc = new_element (ET_NONE);
@@ -555,117 +619,67 @@
             }
         } /* 4571 */
 
-      // Rest of the line is the argument - true unless is MISC_skipspace. */
-      if (line_arg)
+      /* 4576 - change 'current' to its last child.  This is ELEMENT *misc 
+         above.  */
+      current = last_contents_child (current);
+      arg = new_element (ET_misc_line_arg);
+      add_to_element_args (current, arg);
+
+      if (cmd == CM_node) // 4584
         {
-          ELEMENT *arg;
-          /* 4576 - change 'current' to its last child.  This is ELEMENT *misc 
-             above.  */
-          current = last_contents_child (current);
-          arg = new_element (ET_misc_line_arg);
-          add_to_element_args (current, arg);
-
-          if (cmd == CM_node) // 4584
+          /* At most three comma-separated arguments to @node.  This
+             is the only (non-block) line command taking comma-separated
+             arguments.  Its arguments will be gathered the same as
+             those of some block line commands and brace commands. */
+          counter_push (&count_remaining_args, current, 3);
+        }
+      else if (cmd == CM_author)
+        {
+          ELEMENT *parent = current;
+          int found = 0;
+          while (parent->parent)
             {
-              /* At most three comma-separated arguments to @node.  This
-                 is the only (non-block) line command taking comma-separated
-                 arguments.  Its arguments will be gathered the same as
-                 those of some block line commands and brace commands. */
-              counter_push (&count_remaining_args, current, 3);
-            }
-          else if (cmd == CM_author)
-            {
-              ELEMENT *parent = current;
-              int found = 0;
-              while (parent->parent)
+              parent = parent->parent;
+              if (parent->type == ET_brace_command_context)
+                break;
+              if (parent->cmd == CM_titlepage)
                 {
-                  parent = parent->parent;
-                  if (parent->type == ET_brace_command_context)
-                    break;
-                  if (parent->cmd == CM_titlepage)
+                  add_extra_element (current, "titlepage", parent);
+                  found = 1; break;
+                }
+              else if (parent->cmd == CM_quotation
+                       || parent->cmd == CM_smallquotation)
+                {
+                  KEY_PAIR *k; ELEMENT *e;
+                  k = lookup_extra (parent, "authors");
+                  if (k)
+                    e = k->value;
+                  else
                     {
-                      add_extra_element (current, "titlepage", parent);
-                      found = 1; break;
+                      e = new_element (ET_NONE);
+                      add_extra_contents (parent, "authors", e);
                     }
-                  else if (parent->cmd == CM_quotation
-                           || parent->cmd == CM_smallquotation)
-                    {
-                      KEY_PAIR *k; ELEMENT *e;
-                      k = lookup_extra (parent, "authors");
-                      if (k)
-                        e = k->value;
-                      else
-                        {
-                          e = new_element (ET_NONE);
-                          add_extra_contents (parent, "authors", e);
-                        }
-                      add_to_contents_as_array (e, current);
-                      add_extra_element (current, "quotation", parent);
-                      found = 1; break;
-                    }
+                  add_to_contents_as_array (e, current);
+                  add_extra_element (current, "quotation", parent);
+                  found = 1; break;
                 }
-              if (!found)
-                line_warn ("@author not meaningful outside "
-                           "address@hidden' and address@hidden' environments");
             }
-          else if (cmd == CM_dircategory && current_node)
-            line_warn ("@dircategory after first node");
-
-          current = last_args_child (current); /* arg */
-
-          /* add 'line' to context_stack (Parser.pm:141).  This will be the
-             case while we read the argument on this line. */
-          if (!(command_data(cmd).flags & CF_def))
-            push_context (ct_line);
+          if (!found)
+            line_warn ("@author not meaningful outside "
+                       "address@hidden' and address@hidden' environments");
         }
-      start_empty_line_after_command (current, &line, misc); //4621
+      else if (cmd == CM_dircategory && current_node)
+        line_warn ("@dircategory after first node");
 
-      if (cmd == CM_indent || cmd == CM_noindent)
-        {
-          /* Start a new paragraph if not in one already. */
-          int spaces;
-          enum element_type t;
-          ELEMENT *paragraph;
+      current = last_args_child (current);
 
-          /* Check if if we should change an ET_empty_line_after_command
-             element to ET_empty_spaces_after_command by looking ahead
-             to see what comes next. */
-          if (!strchr (line, '\n'))
-            {
-              char *line2;
-              input_push_text (strdup (line), 0);
-              line2 = new_line (current);
-              if (line2)
-                line = line2;
-            }
-          spaces = strspn (line, whitespace_chars);
-          if (spaces > 0)
-            {
-              char saved = line[spaces];
-              line[spaces] = '\0';
-              current = merge_text (current, line);
-              line[spaces] = saved;
-              line += spaces;
-            }
-          if (*line
-              && last_contents_child(current)->type
-                == ET_empty_line_after_command)
-            {
-              last_contents_child(current)->type
-                                              = ET_empty_spaces_after_command;
-            }
-          paragraph = begin_paragraph (current);
-          if (paragraph)
-            current = paragraph;
-          if (!*line)
-            {
-              *status = 1; /* Get a new line. */
-              goto funexit;
-            }
-        }
+      /* add 'line' to context_stack.  This will be the
+         case while we read the argument on this line. */
+      if (!(command_data(cmd).flags & CF_def))
+        push_context (ct_line);
+      start_empty_line_after_command (current, &line, misc);
     }
 
-  // 4622
   mark_and_warn_invalid (cmd, invalid_parent, misc);
 
   if (misc)
@@ -956,7 +970,7 @@
             }
 
           // 4775
-          if (command_data(cmd).flags & CF_region)
+          else if (command_data(cmd).data == BLOCK_region)
             {
               if (current_region_cmd ())
                 {

Modified: trunk/tp/Texinfo/XS/parsetexi/handle_commands.h
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/handle_commands.h     2018-10-21 10:42:12 UTC 
(rev 8361)
+++ trunk/tp/Texinfo/XS/parsetexi/handle_commands.h     2018-10-21 10:43:55 UTC 
(rev 8362)
@@ -1,7 +1,10 @@
 
-ELEMENT *handle_misc_command (ELEMENT *current, char **line_inout,
+ELEMENT *handle_other_command (ELEMENT *current, char **line_inout,
                      enum command_id cmd_id, int *status,
                      enum command_id invalid_parent);
+ELEMENT *handle_line_command (ELEMENT *current, char **line_inout,
+                     enum command_id cmd_id, int *status,
+                     enum command_id invalid_parent);
 ELEMENT *handle_block_command (ELEMENT *current, char **line_inout,
                       enum command_id cmd_id, int *new_line,
                       enum command_id invalid_parent);

Modified: trunk/tp/Texinfo/XS/parsetexi/indices.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/indices.c     2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/indices.c     2018-10-21 10:43:55 UTC (rev 
8362)
@@ -1,4 +1,4 @@
-/* Copyright 2010, 2011, 2012, 2013, 2014, 2015
+/* Copyright 2010-2018
    Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -71,8 +71,8 @@
 {
   enum command_id new = add_texinfo_command (cmdname);
   user_defined_command_data[new & ~USER_COMMAND_BIT].flags
-    = CF_misc | CF_index_entry_command;
-  user_defined_command_data[new & ~USER_COMMAND_BIT].data = MISC_line;
+    = CF_line | CF_index_entry_command;
+  user_defined_command_data[new & ~USER_COMMAND_BIT].data = LINE_line;
   associate_command_to_index (new, idx);
 }
 

Modified: trunk/tp/Texinfo/XS/parsetexi/multitable.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/multitable.c  2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/multitable.c  2018-10-21 10:43:55 UTC (rev 
8362)
@@ -1,5 +1,4 @@
-/* Copyright 2010, 2011, 2012, 2013, 2014, 2015
-   Free Software Foundation, Inc.
+/* Copyright 2010-2018 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
@@ -21,9 +20,7 @@
 ELEMENT *
 item_line_parent (ELEMENT *current)
 {
-  if (current->cmd == CM_item || current->cmd == CM_itemx)
-    current = current->parent->parent;
-  else if (current->type == ET_before_item && current->parent)
+  if (current->type == ET_before_item && current->parent)
     current = current->parent;
 
   if (item_line_command (current->cmd))

Modified: trunk/tp/Texinfo/XS/parsetexi/parser.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-10-21 10:43:55 UTC (rev 
8362)
@@ -1,5 +1,4 @@
-/* Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
-   Free Software Foundation, Inc.
+/* Copyright 2010-2018 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
@@ -1461,22 +1460,16 @@
           && !abort_empty_line (&current, NULL)
           && ((cmd == CM_node || cmd == CM_bye)
               || (command_data(cmd).flags & CF_block)
-              || ((command_data(cmd).flags & CF_misc)
+              || ((command_data(cmd).flags & CF_line)
                   && cmd != CM_comment
                   && cmd != CM_c
                   && cmd != CM_sp
-                  && cmd != CM_refill
-                  && cmd != CM_noindent
-                  && cmd != CM_indent
                   && cmd != CM_columnfractions
-                  && cmd != CM_tab
                   && cmd != CM_item
-                  && cmd != CM_headitem
                   && cmd != CM_verbatiminclude
                   && cmd != CM_set
                   && cmd != CM_clear
-                  && cmd != CM_vskip
-                  && !(command_data(cmd).flags & CF_in_heading))))
+                  && cmd != CM_vskip)))
         {
           line_warn ("@%s should only appear at the beginning of a line", 
                      command_name(cmd));
@@ -1509,11 +1502,11 @@
           // much TODO here.
 
           /* 409 "simple text commands" */
-          if ((outer_flags & CF_misc
+          if ((outer_flags & CF_line
                     && (command_data(outer).data >= 0
-                        || (command_data(outer).data == MISC_line
+                        || (command_data(outer).data == LINE_line
                             && !(outer_flags & (CF_def | CF_sectioning)))
-                        || command_data(outer).data == MISC_text)
+                        || command_data(outer).data == LINE_text)
                     && outer != CM_center
                     && outer != CM_exdent) // 423
               || outer == CM_titlefont // 425
@@ -1686,9 +1679,8 @@
         }
 
       /* 4276 check command doesn't start a paragraph */
-      /* TODO store this in cmd->flags.  Or better, change the meaning
-         of CF_misc. */
-      if (!(command_data(cmd).flags & (CF_misc | CF_block)
+      /* TODO store this in cmd->flags. */
+      if (!(command_data(cmd).flags & (CF_line | CF_other | CF_block)
             || cmd == CM_titlefont
             || cmd == CM_caption
             || cmd == CM_shortcaption
@@ -1699,15 +1691,6 @@
             || cmd == CM_errormsg
             || (command_data(cmd).flags & CF_index_entry_command)))
           {
-          /*
-             Unless no paragraph commands (line 311):
-             All misc commands
-             All block commands
-             'titlefont', 'caption', 'shortcaption',
-             'image', '*', 'hyphenation', 'anchor', 'errormsg'
-             Index commands
-           */
-
           ELEMENT *paragraph;
           paragraph = begin_paragraph (current);
           if (paragraph)
@@ -1729,15 +1712,31 @@
           retval = 1;
           goto funexit;
         }
-      /* line 4289 */
-      /* the 'misc-commands' - no braces and not block commands (includes
-         @end).  Mostly taking a line argument, except for a small number
-         of exceptions, like @tab. */
-      else if (command_data(cmd).flags & CF_misc)
+
+      if (cmd == CM_item && item_line_parent (current))
+        cmd = CM_item_LINE;
+
+      if (command_data(cmd).flags & CF_other)
         {
           int status;
-          current = handle_misc_command (current, &line, cmd, &status,
+          current = handle_other_command (current, &line, cmd, &status,
                                          invalid_parent);
+        if (status == 1)
+          {
+            retval = GET_A_NEW_LINE;
+            goto funexit;
+          }
+        else if (status == 2)
+          {
+            retval = FINISHED_TOTALLY;
+            goto funexit;
+          }
+        }
+      else if (command_data(cmd).flags & CF_line)
+        {
+          int status;
+          current = handle_line_command (current, &line, cmd, &status,
+                                         invalid_parent);
           if (status == 1)
             {
               retval = GET_A_NEW_LINE;

Modified: trunk/tp/Texinfo/XS/parsetexi/separator.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/separator.c   2018-10-21 10:42:12 UTC (rev 
8361)
+++ trunk/tp/Texinfo/XS/parsetexi/separator.c   2018-10-21 10:43:55 UTC (rev 
8362)
@@ -1,5 +1,4 @@
-/* Copyright 2010, 2011, 2012, 2013, 2014, 2015
-   Free Software Foundation, Inc.
+/* Copyright 2010-2018 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




reply via email to

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