texinfo-commits
[Top][All Lists]
Advanced

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

[7096] parsetexi update


From: Gavin D. Smith
Subject: [7096] parsetexi update
Date: Sun, 03 Apr 2016 19:41:46 +0000

Revision: 7096
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7096
Author:   gavin
Date:     2016-04-03 19:41:46 +0000 (Sun, 03 Apr 2016)
Log Message:
-----------
parsetexi update

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

Modified: trunk/tp/parsetexi/close.c
===================================================================
--- trunk/tp/parsetexi/close.c  2016-04-03 16:34:34 UTC (rev 7095)
+++ trunk/tp/parsetexi/close.c  2016-04-03 19:41:46 UTC (rev 7096)
@@ -40,7 +40,7 @@
                         command_name(current->cmd));
       else
         command_error (current,
-                        "@%s missing close brace",
+                        "@%s missing closing brace",
                         command_name(current->cmd));
     }
   else

Modified: trunk/tp/parsetexi/end_line.c
===================================================================
--- trunk/tp/parsetexi/end_line.c       2016-04-03 16:34:34 UTC (rev 7095)
+++ trunk/tp/parsetexi/end_line.c       2016-04-03 19:41:46 UTC (rev 7096)
@@ -59,6 +59,14 @@
   return 1;
 }
 
+static int
+is_whole_number (char *string)
+{
+  if (string[strspn (string, digit_chars)] == '\0')
+    return 1;
+  return 0;
+}
+
 /* Process argument to special line command. */
 // 5377
 ELEMENT *
@@ -525,7 +533,7 @@
             ADD_ARG (line);
           }
         else
-          line_error ("@%s argument must be `top' or `bottom', not `%s'",
+          line_error ("@%s arg must be `top' or `bottom', not `%s'",
                        command_name(cmd), line);
 
         break;
@@ -560,7 +568,7 @@
             ADD_ARG(line);
           }
         else
-          line_error ("@setchapternewpage argument must be "
+          line_error ("@setchapternewpage arg must be "
                        "`on', `off' or `odd', not `%s'", line);
         break;
       }
@@ -577,8 +585,12 @@
       }
     case CM_paragraphindent:
       {
-        /*TODO*/
-
+        if (!strcmp (line, "none") || !strcmp (line, "asis")
+            || is_whole_number (line))
+          ADD_ARG(line);
+        else
+          line_error ("@paragraphindent arg must be "
+                       "numeric/`none'/`asis', not `%s'", line);
         break;
       }
     case CM_firstparagraphindent:
@@ -588,15 +600,18 @@
             ADD_ARG(line);
           }
         else
-          line_error ("@firstparagraph argument must be "
+          line_error ("@firstparagraph arg must be "
                        "`none' or `insert', not `%s'", line);
 
         break;
       }
     case CM_exampleindent:
       {
-        /*TODO */
-
+        if (!strcmp (line, "asis") || is_whole_number (line))
+          ADD_ARG(line);
+        else
+          line_error ("@exampleindent arg must be "
+                       "numeric/`asis', not `%s'", line);
         break;
       }
     case CM_frenchspacing:
@@ -664,7 +679,13 @@
     default:
       ;
     }
-  return line_args;
+  if (line_args->contents.number == 0)
+    {
+      destroy_element (line_args);
+      return 0;
+    }
+  else
+    return line_args;
 
 #undef ADD_ARG
 }
@@ -1093,7 +1114,8 @@
   if (arg_type > 0)
     {
       ELEMENT *args = parse_line_command_args (current);
-      add_extra_misc_args (current, "misc_args", args);
+      if (args)
+        add_extra_misc_args (current, "misc_args", args);
     }
   else if (arg_type == MISC_text) /* 3118 */
     {

Modified: trunk/tp/parsetexi/macro.c
===================================================================
--- trunk/tp/parsetexi/macro.c  2016-04-03 16:34:34 UTC (rev 7095)
+++ trunk/tp/parsetexi/macro.c  2016-04-03 19:41:46 UTC (rev 7096)
@@ -217,7 +217,7 @@
           line = new_line ();
           if (!line)
             {
-              line_error ("@%s missing close brace", command_name(cmd));
+              line_error ("@%s missing closing brace", command_name(cmd));
               line = "\n";
               goto funexit;
             }

Modified: trunk/tp/parsetexi/parser.c
===================================================================
--- trunk/tp/parsetexi/parser.c 2016-04-03 16:34:34 UTC (rev 7095)
+++ trunk/tp/parsetexi/parser.c 2016-04-03 19:41:46 UTC (rev 7096)
@@ -1154,7 +1154,7 @@
                   && cmd != CM_vskip)
               || (command_data(cmd).flags & CF_in_heading)))
         {
-          line_warn ("@%s should only appear at a line beginning",
+          line_warn ("@%s should only appear at the beginning of a line", 
                      command_name(cmd));
         }
 




reply via email to

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