texinfo-commits
[Top][All Lists]
Advanced

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

[6092] parsetexi update


From: Gavin D. Smith
Subject: [6092] parsetexi update
Date: Mon, 02 Feb 2015 22:54:59 +0000

Revision: 6092
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6092
Author:   gavin
Date:     2015-02-02 22:54:58 +0000 (Mon, 02 Feb 2015)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/parsetexi/ChangeLog
    trunk/parsetexi/TODO
    trunk/parsetexi/parser.c
    trunk/parsetexi/separator.c

Modified: trunk/parsetexi/ChangeLog
===================================================================
--- trunk/parsetexi/ChangeLog   2015-02-02 21:35:08 UTC (rev 6091)
+++ trunk/parsetexi/ChangeLog   2015-02-02 22:54:58 UTC (rev 6092)
@@ -1,5 +1,15 @@
 2015-02-02  Gavin Smith  <address@hidden>
 
+       * parser.c (isolate_last_space, start_empty_line_after_command): 
+       Add comments.
+       (big_loop, process_remaining_on_line): Function renamed.
+       <no brace after brace command>: Add commented-out code and 
+       comment.
+       * separator.c (handle_open_brace): Set "spaces_before_argument" 
+       extra value.
+
+2015-02-02  Gavin Smith  <address@hidden>
+
        * end_line.c (parse_line_command_args): More complete 
        implementation.
        (is_decimal_numer): New function split from 

Modified: trunk/parsetexi/TODO
===================================================================
--- trunk/parsetexi/TODO        2015-02-02 21:35:08 UTC (rev 6091)
+++ trunk/parsetexi/TODO        2015-02-02 22:54:58 UTC (rev 6092)
@@ -3,6 +3,7 @@
 * @verb
 * Counters for e.g. numbers of arguments read so far for a brace 
 command, or the row in a table.
+* check valid nestings
 * Implement parser options
 * Character encoding issues - read and pass to Perl correctly.
 

Modified: trunk/parsetexi/parser.c
===================================================================
--- trunk/parsetexi/parser.c    2015-02-02 21:35:08 UTC (rev 6091)
+++ trunk/parsetexi/parser.c    2015-02-02 22:54:58 UTC (rev 6092)
@@ -24,6 +24,7 @@
 #include "input.h"
 #include "tree.h"
 #include "api.h"
+#include "errors.h"
 
 /* Parser state - see Parser.pm:135. */
 
@@ -379,6 +380,12 @@
 }
 
 /* 2149 */
+/* Split any trailing whitespace on the last element in a line into its
+   own element, ET_spaces_at_end by default.  This helps with line
+   argument parsing as there will be no leading or trailing spaces.
+
+   Also, "to help expansion disregard unuseful spaces".  Could that mean
+   macro expansion? */
 void
 isolate_last_space (ELEMENT *current, enum element_type element_type)
 {
@@ -392,8 +399,9 @@
       int index = -1;
       ELEMENT *indexed_elt;
 
-      /* Ignore space before a misc command that is last on line.  (I don't 
-         understand this. ) */
+      /* If a "misc" (i.e. line) command is last on line, isolate the space in 
+         the element before it.  This covers the case of a "@c" at the end
+         of a line. */
       if (element_contents_number (current) > 1)
         {
           if (last->cmd)
@@ -450,7 +458,12 @@
     }
 }
 
-
+/* 3491 */
+/* Add an "ET_empty_line_after_command" element containing the whitespace at 
+   the beginning of the rest of the line.  This element can be later changed 
to 
+   a "ET_empty_spaces_after_command" element in 'abort_empty_line' if more
+   text follows on the line.  Used after line commmands or commands starting
+   a block. */
 void
 start_empty_line_after_command (ELEMENT *current, char **line_inout)
 {
@@ -466,6 +479,7 @@
 
   *line_inout = line;
 }
+
 
 /* Parts of parse_texi lines 3676 - 5372 */
 
@@ -514,7 +528,7 @@
 /* *LINEP is a pointer into the line being processed.  It is advanced past any
    bytes processed.  Return 0 when we need to read a new line. */
 int
-big_loop (ELEMENT **current_inout, char **line_inout)
+process_remaining_on_line (ELEMENT **current_inout, char **line_inout)
 {
   ELEMENT *current = *current_inout;
   char *line = *line_inout;
@@ -692,9 +706,11 @@
         }
       else // 4041
         {
-          // error - braces expected
+          /* TODO: Check 'IGNORE_SPACES_AFTER_BRACED_COMMAND_NAME' config
+             variable. */
           // broken by lack of @verb processing ATM
-          //abort ();
+          //line_errorf ("@%s expected braces",
+          //  command_data(current->cmd).cmdname);
           current = current->parent;
         }
     }
@@ -916,7 +932,7 @@
          of line. */
       while (1)
         {
-          if (!big_loop (&current, &line))
+          if (!process_remaining_on_line (&current, &line))
             break;
         }
     }

Modified: trunk/parsetexi/separator.c
===================================================================
--- trunk/parsetexi/separator.c 2015-02-02 21:35:08 UTC (rev 6091)
+++ trunk/parsetexi/separator.c 2015-02-02 22:54:58 UTC (rev 6092)
@@ -93,7 +93,10 @@
               ELEMENT *e;
               e = new_element (ET_empty_spaces_before_argument);
               add_to_element_contents (current, e);
+              add_extra_key_element (current->parent,
+                                     "spaces_before_argument", e);
             }
+          /* 4956 - TODO inline commands */
         }
 
     }




reply via email to

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