texinfo-commits
[Top][All Lists]
Advanced

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

[8374] parsetexi update


From: gavinsmith0123
Subject: [8374] parsetexi update
Date: Mon, 22 Oct 2018 10:21:33 -0400 (EDT)

Revision: 8374
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8374
Author:   gavin
Date:     2018-10-22 10:21:33 -0400 (Mon, 22 Oct 2018)
Log Message:
-----------
parsetexi update

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

Modified: trunk/tp/Texinfo/XS/parsetexi/parser.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-10-22 10:39:54 UTC (rev 
8373)
+++ trunk/tp/Texinfo/XS/parsetexi/parser.c      2018-10-22 14:21:33 UTC (rev 
8374)
@@ -1169,28 +1169,33 @@
         {
           char *command = read_command_name (&line_after_command);
 
+          cmd = 0;
           if (command)
             {
+              ELEMENT *paragraph;
+
               cmd = lookup_command (command);
               if (!cmd)
                 {
-                  line_error ("unknown command `%s'", command); // 4877
+                  line_error ("unknown command `%s'", command);
+                  debug ("COMMAND (UNKNOWN) %s", command);
+                  free (command);
+
+                  abort_empty_line (&current, 0);
+                  paragraph = begin_paragraph (current);
+                  if (paragraph)
+                    current = paragraph;
+
                   line = line_after_command;
-                  debug ("COMMAND (UNKNOWN) %s", command);
+                  retval = STILL_MORE_TO_PROCESS;
+                  goto funexit;
                 }
+              free (command);
             }
-          free (command);
-          if (!cmd)
+          else
             {
-              ELEMENT *paragraph;
-              // 4226
-              abort_empty_line (&current, 0);
-
-              // 4276
-              paragraph = begin_paragraph (current);
-              if (paragraph)
-                current = paragraph;
-              //goto funexit;
+              /* @ was followed by gibberish.  "unexpected @" is printed
+                 below. */
             }
         }
       if (cmd && (command_data(cmd).flags & CF_ALIAS))
@@ -1681,8 +1686,7 @@
             current = paragraph;
         }
 
-      // 4281
-      if (cmd != 0)
+      if (cmd)
         {
           if (close_paragraph_command (cmd))
             current = end_paragraph (current, 0, 0);
@@ -1690,13 +1694,7 @@
             current = end_preformatted (current, 0, 0);
         }
 
-      if (cmd == 0)
-        {
-          // 4287 Unknown command
-          retval = 1;
-          goto funexit;
-        }
-
+      /* TODO: do this before nesting check? */
       if (cmd == CM_item && item_line_parent (current))
         cmd = CM_item_LINE;
 
@@ -1766,14 +1764,8 @@
               goto funexit;
             }
         }
-#if 0
-      else
-        {
-          /* TODO: error: unknown command */
-        }
-#endif
     }
-  /* "Separator" - line 4881 */
+  /* "Separator" character */
   else if (*line != '\0' && strchr ("{}@,:\t.\f", *line))
     {
       char separator = *line++;




reply via email to

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