texinfo-commits
[Top][All Lists]
Advanced

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

[6522] XSParagraph comment clean-up


From: Gavin D. Smith
Subject: [6522] XSParagraph comment clean-up
Date: Thu, 13 Aug 2015 18:58:57 +0000

Revision: 6522
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6522
Author:   gavin
Date:     2015-08-13 18:58:56 +0000 (Thu, 13 Aug 2015)
Log Message:
-----------
XSParagraph comment clean-up

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs
    trunk/tp/Texinfo/Convert/XSParagraph/xspara.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-08-13 18:37:20 UTC (rev 6521)
+++ trunk/ChangeLog     2015-08-13 18:58:56 UTC (rev 6522)
@@ -1,5 +1,11 @@
 2015-08-13  Gavin Smith  <address@hidden>
 
+       * tp/Texinfo/Convert/XSParagraph/XSParagraph.xs,
+       * tp/Texinfo/Convert/XSParagraph/xspara.c: Update some comments 
+       and remove some commented-out code.
+
+2015-08-13  Gavin Smith  <address@hidden>
+
        * doc/texinfo.texi (Info Format Specification): Uncomment 
        material on node quoting, and add advice not to use it until 
        it's more widely supported.

Modified: trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs 2015-08-13 18:37:20 UTC 
(rev 6521)
+++ trunk/tp/Texinfo/Convert/XSParagraph/XSParagraph.xs 2015-08-13 18:58:56 UTC 
(rev 6522)
@@ -135,26 +135,8 @@
         RETVAL
 
 
-
-#
-# Here's the code using 'char *'.
-# The ... is for the underlying_text argument.
-#char *
-#xspara_add_text (paragraph, text, ...)
-#        HV * paragraph
-#        char * text
-#    CODE:
-#        xspara_set_state (paragraph);
-#        RETVAL = xspara_add_text (text);
-#        xspara_get_state (paragraph);
-#    OUTPUT:
-#        RETVAL
-#
-
-
-# The ... is for the underlying_text argument.
 SV *
-xspara_add_text (paragraph, text_in, ...)
+xspara_add_text (paragraph, text_in)
         HV * paragraph
         SV * text_in
     PREINIT:
@@ -163,15 +145,9 @@
     CODE:
         /* Always convert the input to UTF8 with sv_utf8_upgrade, so we can 
            process it properly in xspara_add_next. */
-        /* "man perlguts" possibly says not to do this, but it's
-           hard to tell what it's talking about. */
-        /* It's about the dangers of changing your arguments. */
         if (!SvUTF8 (text_in))
-          {
-            //printf ("upgrading <%s>\n", SvPV_nolen (text_in));
-            sv_utf8_upgrade (text_in);
-            //printf ("got <%s>\n", SvPV_nolen (text_in));
-          }
+          sv_utf8_upgrade (text_in);
+
         text = SvPV_nolen (text_in);
 
         //xspara_set_state (paragraph);

Modified: trunk/tp/Texinfo/Convert/XSParagraph/xspara.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2015-08-13 18:37:20 UTC 
(rev 6521)
+++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2015-08-13 18:58:56 UTC 
(rev 6522)
@@ -286,10 +286,11 @@
   /* None of this is really needed, under the big assumption that
      we only have one "paragraph" object going at once. */
 
-  /* Alternatively, let the "paragraph" object be an integer giving
+  /* If we did need it, the "paragraph" object could be an integer giving
      an index into an array of PARAGRAPH objects. */
 
-  /* We could have multiple paragraphs going at once for a footnote. */
+  /* You might imagine we would have multiple paragraphs going at once for a 
+     footnote, but this appears not to happen.  */
 
   /* Fetch all these so they are set, and reset for each paragraph. */
   FETCH_INT("end_sentence", state.end_sentence);
@@ -322,27 +323,7 @@
       abort ();
     }
   return;
-#if  0
 
-  val = FETCH("word");
-  if (!val)
-    {
-      report ("word is null");
-      abort ();
-    }
-
-  //free (state.word);
-  //state.word = SvPV (*val, state.word_len);
-  /* FIXME: strdup etc. */
-
-  return;
-
-  val = FETCH("space");
-  state.space.text = SvPV (*val, state.space.end);
-
-#endif
-
-
 #undef FETCH
 #undef FETCH_INT
 }
@@ -392,8 +373,6 @@
     {
       xspara__end_line ();
 
-      /* Another option is to use Perl strings, and use
-         "sv_catpv" for this. */
       text_append (result, "\n");
     }
 }
@@ -521,7 +500,9 @@
 }
 
 /* Add WORD to paragraph in RESULT, not refilling WORD.  If we go past the end 
-   of the line start a new one. */
+   of the line start a new one.  TRANSPARENT means that the letters in WORD
+   are ignored for the purpose of deciding whether a full stop ends a sentence
+   or not. */
 void
 xspara__add_next (TEXT *result, char *word, int word_len, int transparent)
 {
@@ -825,8 +806,6 @@
                       size_t q_len;
                       int at_least_two = 0;
 
-                      //fprintf (stderr, "DOUBLING SPACE\n");
-
                       /* Check if the next character is whitespace as well. */
                       q_len = mbrtowc (&q_char, q, 10, NULL);
                       if ((long) q_len > 0)
@@ -928,7 +907,6 @@
                     }
                   else /* Not at end of sentence. */
                     {
-                      //fprintf (stderr, "NOT END S\n");
                       /* Only save the first space. */
                       if (state.space_counter < 1)
                         {
@@ -1000,9 +978,6 @@
                   /* Doesn't count if preceded by an upper-case letter. */
                   if (!iswupper (state.last_letter))
                     {
-                      //fprintf (stderr, "END_SENTENCE (%d)\n",
-                               //state.french_spacing);
-
                       if (state.french_spacing)
                         state.end_sentence = -1;
                       else
@@ -1045,9 +1020,6 @@
     return result.text;
   else
     return "";
-  /* TODO: I still don't know if Perl's PV's need unique storage, on the
-     heap or w/e. */
-
 }
 
 




reply via email to

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