texinfo-commits
[Top][All Lists]
Advanced

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

[8372] parsetexi no mark_and_warn_invalid


From: gavinsmith0123
Subject: [8372] parsetexi no mark_and_warn_invalid
Date: Mon, 22 Oct 2018 04:29:10 -0400 (EDT)

Revision: 8372
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8372
Author:   gavin
Date:     2018-10-22 04:29:10 -0400 (Mon, 22 Oct 2018)
Log Message:
-----------
parsetexi no mark_and_warn_invalid

Modified Paths:
--------------
    trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
    trunk/tp/Texinfo/XS/parsetexi/handle_commands.h
    trunk/tp/Texinfo/XS/parsetexi/parser.c
    trunk/tp/Texinfo/XS/parsetexi/parser.h

Modified: trunk/tp/Texinfo/XS/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/handle_commands.c     2018-10-21 21:18:13 UTC 
(rev 8371)
+++ trunk/tp/Texinfo/XS/parsetexi/handle_commands.c     2018-10-22 08:29:10 UTC 
(rev 8372)
@@ -83,8 +83,7 @@
 /* noarg skipspace */
 ELEMENT *
 handle_other_command (ELEMENT *current, char **line_inout,
-                     enum command_id cmd, int *status,
-                     enum command_id invalid_parent)
+                     enum command_id cmd, int *status)
 {
   ELEMENT *misc = 0;
   char *line = *line_inout;
@@ -107,7 +106,6 @@
       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);
     }
@@ -304,7 +302,6 @@
               goto funexit;
             }
         }
-      mark_and_warn_invalid (cmd, invalid_parent, misc);
     }
 
 funexit:
@@ -316,8 +313,7 @@
    2 if we should stop processing completely. */
 ELEMENT *
 handle_line_command (ELEMENT *current, char **line_inout,
-                     enum command_id cmd, int *status,
-                     enum command_id invalid_parent)
+                     enum command_id cmd, int *status)
 {
   ELEMENT *misc = 0;
   char *line = *line_inout;
@@ -511,7 +507,6 @@
         {
         }
 
-      mark_and_warn_invalid (cmd, invalid_parent, misc);
       register_global_command (misc); // 4423
 
       if (arg_spec != LINE_special || !has_comment)
@@ -679,9 +674,6 @@
       start_empty_line_after_command (current, &line, misc);
     }
 
-  mark_and_warn_invalid (cmd == CM_item_LINE ? CM_item : cmd,
-                         invalid_parent, misc);
-
   if (misc)
     register_global_command (misc);
   if (cmd == CM_dircategory)
@@ -754,8 +746,7 @@
    "end_line_misc_line" in end_line.c processes the @end command. */
 ELEMENT *
 handle_block_command (ELEMENT *current, char **line_inout,
-                      enum command_id cmd, int *get_new_line,
-                      enum command_id invalid_parent)
+                      enum command_id cmd, int *get_new_line)
 {
   char *line = *line_inout;
   unsigned long flags = command_data(cmd).flags;
@@ -766,8 +757,6 @@
       ELEMENT *macro;
       macro = parse_macro_command_line (cmd, &line, current);
       add_to_element_contents (current, macro);
-      mark_and_warn_invalid (cmd, invalid_parent,
-                             last_contents_child(current));
       current = macro;
 
       /* 4640 */
@@ -1045,9 +1034,8 @@
                contents in 'end_line'. */
 
           }
-        } /* 4827 */
+        }
       block->line_nr = line_nr;
-      mark_and_warn_invalid (cmd, invalid_parent, block);
       register_global_command (block);
       start_empty_line_after_command (current, &line, block);
     }
@@ -1059,9 +1047,7 @@
 
 /* 4835 */
 ELEMENT *
-handle_brace_command (ELEMENT *current, char **line_inout,
-                      enum command_id cmd,
-                      enum command_id invalid_parent)
+handle_brace_command (ELEMENT *current, char **line_inout, enum command_id cmd)
 {
   char *line = *line_inout;
   ELEMENT *e;
@@ -1080,7 +1066,6 @@
   add_to_element_contents (current, e);
   current = e;
 
-  mark_and_warn_invalid (cmd, invalid_parent, e);
   if (cmd == CM_click)
     {
       add_extra_string_dup (e, "clickstyle", global_clickstyle);

Modified: trunk/tp/Texinfo/XS/parsetexi/handle_commands.h
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/handle_commands.h     2018-10-21 21:18:13 UTC 
(rev 8371)
+++ trunk/tp/Texinfo/XS/parsetexi/handle_commands.h     2018-10-22 08:29:10 UTC 
(rev 8372)
@@ -1,16 +1,12 @@
 
 ELEMENT *handle_other_command (ELEMENT *current, char **line_inout,
-                     enum command_id cmd_id, int *status,
-                     enum command_id invalid_parent);
+                     enum command_id cmd_id, int *status);
 ELEMENT *handle_line_command (ELEMENT *current, char **line_inout,
-                     enum command_id cmd_id, int *status,
-                     enum command_id invalid_parent);
+                     enum command_id cmd_id, int *status);
 ELEMENT *handle_block_command (ELEMENT *current, char **line_inout,
-                      enum command_id cmd_id, int *new_line,
-                      enum command_id invalid_parent);
+                      enum command_id cmd_id, int *new_line);
 ELEMENT *handle_brace_command (ELEMENT *current, char **line_inout,
-                               enum command_id cmd_id,
-                               enum command_id invalid_parent);
+                               enum command_id cmd_id);
 int check_no_text (ELEMENT *current);
 
 void clear_expanded_formats (void);

Modified: trunk/tp/Texinfo/XS/parsetexi/parser.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-10-21 21:18:13 UTC (rev 
8371)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-10-22 08:29:10 UTC (rev 
8372)
@@ -791,27 +791,6 @@
   // all non-whitespace characters??
 }
 
-// 3633
-/* If INVALID_PARENT is defined, then that command was used in the input
-   document and contained, incorrectly, a COMMAND command. Issue
-   a warning message. */
-void
-mark_and_warn_invalid (enum command_id command,
-                       enum command_id invalid_parent,
-                       ELEMENT *marked_as_invalid_command)
-{
-  if (invalid_parent)
-    {
-      line_warn ("@%s should not appear in @%s",
-                 command_name(command),
-                 command_name(invalid_parent));
-      if (marked_as_invalid_command)
-        add_extra_string_dup (marked_as_invalid_command, "invalid_nesting",
-                              "1");
-    }
-}
-
-/* Used at line 3755 */
 /* Check if line is "@end ..." for current command.  If so, advance LINE. */
 int
 is_end_current_command (ELEMENT *current, char **line,
@@ -1670,8 +1649,13 @@
                 }
             }
         }
+      if (invalid_parent)
+        {
+          line_warn ("@%s should not appear in @%s",
+                     command_name(cmd),
+                     command_name(invalid_parent));
+        }
 
-      /* 4274 */
       if (def_line_continuation)
         {
           retval = GET_A_NEW_LINE;
@@ -1690,7 +1674,7 @@
             || cmd == CM_anchor
             || cmd == CM_errormsg
             || (command_data(cmd).flags & CF_index_entry_command)))
-          {
+        {
           ELEMENT *paragraph;
           paragraph = begin_paragraph (current);
           if (paragraph)
@@ -1719,8 +1703,7 @@
       if (command_data(cmd).flags & CF_other)
         {
           int status;
-          current = handle_other_command (current, &line, cmd, &status,
-                                         invalid_parent);
+          current = handle_other_command (current, &line, cmd, &status);
         if (status == 1)
           {
             retval = GET_A_NEW_LINE;
@@ -1735,8 +1718,7 @@
       else if (command_data(cmd).flags & CF_line)
         {
           int status;
-          current = handle_line_command (current, &line, cmd, &status,
-                                         invalid_parent);
+          current = handle_line_command (current, &line, cmd, &status);
           if (status == 1)
             {
               retval = GET_A_NEW_LINE;
@@ -1748,13 +1730,10 @@
               goto funexit;
             }
         }
-
-      /* line 4632 */
       else if (command_data(cmd).flags & CF_block)
         {
           int new_line = 0;
-          current = handle_block_command (current, &line, cmd, &new_line,
-                                          invalid_parent);
+          current = handle_block_command (current, &line, cmd, &new_line);
           if (new_line)
             {
               /* For @macro, to get a new line.  This is done instead of
@@ -1762,14 +1741,11 @@
               retval = GET_A_NEW_LINE; goto funexit;
             }
         }
-
       else if (command_data(cmd).flags & CF_brace
                || command_data(cmd).flags & CF_accent) /* line 4835 */
         {
-          current = handle_brace_command (current, &line,
-                                          cmd, invalid_parent);
+          current = handle_brace_command (current, &line, cmd);
         }
-
       /* No-brace command */
       else if (command_data(cmd).flags & CF_nobrace) /* 4864 */
         {

Modified: trunk/tp/Texinfo/XS/parsetexi/parser.h
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.h      2018-10-21 21:18:13 UTC (rev 
8371)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.h      2018-10-22 08:29:10 UTC (rev 
8372)
@@ -58,9 +58,6 @@
                         enum command_id interrupting_command);
 void isolate_last_space (ELEMENT *current);
 int command_with_command_as_argument (ELEMENT *current);
-void mark_and_warn_invalid (enum command_id command,
-                            enum command_id invalid_parent,
-                            ELEMENT *marked_as_invalid_command);
 ELEMENT *begin_preformatted (ELEMENT *current);
 ELEMENT *end_preformatted (ELEMENT *current,
                            enum command_id closed_command,




reply via email to

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