texinfo-commits
[Top][All Lists]
Advanced

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

[8307] parsetexi error message for macro argument


From: gavinsmith0123
Subject: [8307] parsetexi error message for macro argument
Date: Wed, 17 Oct 2018 08:05:20 -0400 (EDT)

Revision: 8307
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8307
Author:   gavin
Date:     2018-10-17 08:05:20 -0400 (Wed, 17 Oct 2018)
Log Message:
-----------
parsetexi error message for macro argument

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

Modified: trunk/tp/Texinfo/XS/parsetexi/macro.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/macro.c       2018-10-17 12:03:53 UTC (rev 
8306)
+++ trunk/tp/Texinfo/XS/parsetexi/macro.c       2018-10-17 12:05:20 UTC (rev 
8307)
@@ -236,9 +236,9 @@
   return -1;
 }
 
-/* LINE points to after the opening brace in a macro invocation.  CMD is the
-   command identifier of the macro command.  Return array of the arguments.
-   Return value to be freed by caller.  */
+/* LINE points the first non-whitespace character after the opening brace in a 
+   macro invocation.  CMD is the command identifier of the macro command.  
+   Return array of the arguments.  Return value to be freed by caller.  */
 // 1984
 char **
 expand_macro_arguments (ELEMENT *macro, char **line_inout, enum command_id cmd)
@@ -336,7 +336,6 @@
               else
                 arg_list[arg_number++] = strdup ("");
               text_init (&arg);
-              // TODO: is "@m {     }" one empty argument or none?
 
               debug ("MACRO NEW ARG");
               pline = sep + 1;
@@ -359,6 +358,14 @@
   debug ("END MACRO ARGS EXPANSION");
   line = pline;
 
+  if (args_total == 0 && arg_number > 0
+      && arg_list[0] && *arg_list[0])
+    {
+      line_error
+        ("macro `%s' declared without argument called with an argument",
+         command_name(cmd));
+    }
+
 funexit:
   *line_inout = line;
   arg_list[arg_number] = 0;




reply via email to

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