Remove the error message `no text found in paragraph'. Aaron Brown
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 29 Sep 2005 13:04:26 +0000 (13:04 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 29 Sep 2005 13:04:26 +0000 (13:04 +0000)
points out that it's perfectly possible to generate an empty
paragraph using legal Halibut syntax: a paragraph containing nothing
but a \#{...} comment will do the job, and is quite likely to happen
if you've commented out a load of Halibut code. Therefore, an empty
paragraph is now silently ignored rather than being an error
condition in itself; if you create an empty paragraph due to it
containing an unrecognised directive, then you'll get an error for
_that_ and only that.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@6361 cda61777-01e9-0310-a592-d414129be87e

error.c
halibut.h
input.c
inputs/test.but

diff --git a/error.c b/error.c
index b1e74a1..3635f0f 100644 (file)
--- a/error.c
+++ b/error.c
@@ -278,11 +278,6 @@ static void do_error(int code, va_list ap) {
        flags = FILEPOS;
        sfree(sp);
        break;
-      case err_emptypara:
-       fpos = *va_arg(ap, filepos *);
-       sprintf(error, "found no text in paragraph");
-       flags = FILEPOS;
-       break;
       case err_whatever:
        sp = va_arg(ap, char *);
         vsprintf(error, sp, ap);
index 99b9a0e..ed2a0da 100644 (file)
--- a/halibut.h
+++ b/halibut.h
@@ -244,7 +244,6 @@ enum {
     err_text_codeline,                /* \c line too long in text backend */
     err_htmlver,                      /* unrecognised HTML version keyword */
     err_charset,                      /* unrecognised character set name */
-    err_emptypara,                    /* paragraph contains no actual text */
     err_whatever                       /* random error of another type */
 };
 
diff --git a/input.c b/input.c
index d8d44f9..1e132b4 100644 (file)
--- a/input.c
+++ b/input.c
@@ -1539,8 +1539,6 @@ static void read_file(paragraph ***ret, input *in, indexdata *idx,
         */
        if (par.words) {
            addpara(par, ret);
-       } else {
-           error(err_emptypara, &par.fpos);
        }
        if (t.type == tok_eof)
            already = TRUE;
index 4682d5f..2088de4 100644 (file)
@@ -43,6 +43,8 @@ has line\#{yet another one} breaks in   between words, multiple
   spaces (ignored), and \e{emphasised text} as well as \c{code
 fragments}.
 
+\#{This is an inline comment alone in a paragraph.}
+
 \cw{This} is weak code; \cq{this} is quoted code. And \k{head}
 contains some other stuff. \K{subhead} does too.