texinfo-commits
[Top][All Lists]
Advanced

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

[7166] parsetexi more on conditionals


From: gavinsmith0123
Subject: [7166] parsetexi more on conditionals
Date: Sat, 14 May 2016 12:13:15 +0000 (UTC)

Revision: 7166
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7166
Author:   gavin
Date:     2016-05-14 12:13:14 +0000 (Sat, 14 May 2016)
Log Message:
-----------
parsetexi more on conditionals

Modified Paths:
--------------
    trunk/tp/parsetexi/api.c
    trunk/tp/parsetexi/close.c
    trunk/tp/parsetexi/end_line.c
    trunk/tp/parsetexi/parser.c
    trunk/tp/parsetexi/separator.c

Modified: trunk/tp/parsetexi/api.c
===================================================================
--- trunk/tp/parsetexi/api.c    2016-05-14 11:22:40 UTC (rev 7165)
+++ trunk/tp/parsetexi/api.c    2016-05-14 12:13:14 UTC (rev 7166)
@@ -53,8 +53,8 @@
   reset_context_stack ();
   reset_floats ();
   clear_expanded_formats ();
-  add_expanded_format ("plaintext");
-  add_expanded_format ("info");
+  //add_expanded_format ("plaintext");
+  //add_expanded_format ("info");
 
   current_node = current_section = 0;
 }

Modified: trunk/tp/parsetexi/close.c
===================================================================
--- trunk/tp/parsetexi/close.c  2016-05-14 11:22:40 UTC (rev 7165)
+++ trunk/tp/parsetexi/close.c  2016-05-14 12:13:14 UTC (rev 7166)
@@ -387,7 +387,7 @@
     }
   else if (closed_command)
     {
-      line_error ("unmatched @end %s", command_name(closed_command));
+      line_error ("unmatched address@hidden %s'", 
command_name(closed_command));
     }
 
   return current;

Modified: trunk/tp/parsetexi/end_line.c
===================================================================
--- trunk/tp/parsetexi/end_line.c       2016-05-14 11:22:40 UTC (rev 7165)
+++ trunk/tp/parsetexi/end_line.c       2016-05-14 12:13:14 UTC (rev 7166)
@@ -1364,13 +1364,18 @@
                           if (0)
                             {
                           conditional_stack_fail:
-                              command_error (current, "unmatched @end");
+                              command_error (current, "unmatched 
address@hidden'");
+                              end_command = 0;
                             }
                         }
-                      add_extra_string (current, "command_argument",
-                                        strdup (end_command));
-                      if (line[strspn (line, whitespace_chars)] != '\0')
+                      if (end_command)
                         {
+                          add_extra_string (current, "command_argument",
+                                            strdup (end_command));
+                        }
+                      if (end_command
+                          && line[strspn (line, whitespace_chars)] != '\0')
+                        {
                           command_error (current,
                                          "superfluous argument to @end %s: "
                                          "%s", end_command, line);

Modified: trunk/tp/parsetexi/parser.c
===================================================================
--- trunk/tp/parsetexi/parser.c 2016-05-14 11:22:40 UTC (rev 7165)
+++ trunk/tp/parsetexi/parser.c 2016-05-14 12:13:14 UTC (rev 7166)
@@ -1419,12 +1419,13 @@
         }
     }
 
-#if 0
   /* Check for unclosed conditionals */
-  while (...)
+  while (conditional_number > 0)
     {
+      line_error ("expected @end %s",
+                  command_name(conditional_stack[conditional_number - 1]));
+      conditional_number--;
     }
-#endif
 
     {
       ELEMENT *dummy; // 5254

Modified: trunk/tp/parsetexi/separator.c
===================================================================
--- trunk/tp/parsetexi/separator.c      2016-05-14 11:22:40 UTC (rev 7165)
+++ trunk/tp/parsetexi/separator.c      2016-05-14 12:13:14 UTC (rev 7166)
@@ -393,7 +393,9 @@
       enum context c;
 
       current = end_paragraph (current, 0, 0);
-      if (1)
+      if (current->parent
+          && (command_flags(current->parent) & CF_brace)
+          && (command_data(current->parent->cmd).data == BRACE_context))
         {
           enum command_id closed_command;
           c = pop_context ();
@@ -406,12 +408,12 @@
           if (close_preformatted_command(closed_command))
             current = begin_preformatted (current);
         }
-      else // 5224
-        {
-          /* error - misplaced } */
-          goto funexit;
-        }
     }
+  else // 5224
+    {
+      line_error ("misplaced }");
+      goto funexit;
+    }
   
 funexit:
   *line_inout = line;




reply via email to

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