texinfo-commits
[Top][All Lists]
Advanced

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

[7518] parsetexi set_on_item_line test


From: gavinsmith0123
Subject: [7518] parsetexi set_on_item_line test
Date: Sun, 20 Nov 2016 11:14:47 +0000 (UTC)

Revision: 7518
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7518
Author:   gavin
Date:     2016-11-20 11:14:47 +0000 (Sun, 20 Nov 2016)
Log Message:
-----------
parsetexi set_on_item_line test

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

Modified: trunk/tp/parsetexi/end_line.c
===================================================================
--- trunk/tp/parsetexi/end_line.c       2016-11-19 19:28:16 UTC (rev 7517)
+++ trunk/tp/parsetexi/end_line.c       2016-11-20 11:14:47 UTC (rev 7518)
@@ -100,7 +100,7 @@
 
 /* Return end of argument before comment and whitespace. */
 char *
-skip_comment (char *q)
+skip_comment (char *q, int *has_comment)
 {
   char *q1;
   while (1)
@@ -120,6 +120,7 @@
       if (*q == '@' || strchr (whitespace_chars, *q))
         {
           q = q1;
+          *has_comment = 1;
           break;
         }
     }
@@ -135,8 +136,7 @@
 /* Process argument to special line command. */
 // 5377
 ELEMENT *
-parse_special_misc_command (char *line, enum command_id cmd
-                           /* , int *has_comment */)
+parse_special_misc_command (char *line, enum command_id cmd, int *has_comment)
 {
 #define ADD_ARG(string, len) do { \
   ELEMENT *E = new_element (ET_NONE); \
@@ -162,7 +162,7 @@
                    " \t\f\r\n"       /* whitespace */
                    "{\\}~^+\"<>|@"); /* other bytes that aren't allowed */
 
-      r = skip_comment (p);
+      r = skip_comment (p, has_comment);
 
       if (!strchr (whitespace_chars, *q) && *q != '@')
         goto set_invalid;

Modified: trunk/tp/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/parsetexi/handle_commands.c        2016-11-19 19:28:16 UTC (rev 
7517)
+++ trunk/tp/parsetexi/handle_commands.c        2016-11-20 11:14:47 UTC (rev 
7518)
@@ -281,6 +281,8 @@
     {
       ELEMENT *args = 0;
       enum command_id equivalent_cmd = 0;
+      int has_comment = 0;
+
       /* 4350 If the current input is the result of a macro expansion,
          it may not be a complete line.  Check for this and acquire the rest
          of the line if necessary. */
@@ -306,7 +308,7 @@
         }
       else /* arg_spec == MISC_special */
         {
-          args = parse_special_misc_command (line, cmd); //4362
+          args = parse_special_misc_command (line, cmd, &has_comment); //4362
           add_extra_string (misc, "arg_line", strdup (line));
         }
 
@@ -414,7 +416,7 @@
       mark_and_warn_invalid (cmd, invalid_parent, misc);
       register_global_command (cmd, misc); // 4423
 
-      if (arg_spec != MISC_special /* || !has_comment */ )
+      if (arg_spec != MISC_special || !has_comment)
         current = end_line (current);
 
       // 4429

Modified: trunk/tp/parsetexi/parser.h
===================================================================
--- trunk/tp/parsetexi/parser.h 2016-11-19 19:28:16 UTC (rev 7517)
+++ trunk/tp/parsetexi/parser.h 2016-11-20 11:14:47 UTC (rev 7518)
@@ -24,7 +24,8 @@
 /* In end_line.c */
 NODE_SPEC_EXTRA *parse_node_manual (ELEMENT *node);
 ELEMENT *end_line (ELEMENT *current);
-ELEMENT *parse_special_misc_command (char *line, enum command_id cmd);
+ELEMENT *parse_special_misc_command (char *line, enum command_id cmd,
+                                     int *has_commment);
 int check_node_label (NODE_SPEC_EXTRA *nse, enum command_id cmd);
 
 typedef struct {




reply via email to

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