* snarf.h, filter-doc-snarfage.c: more changes to cope with
authorMichael Livshin <mlivshin@bigfoot.com>
Fri, 8 Jun 2001 14:49:05 +0000 (14:49 +0000)
committerMichael Livshin <mlivshin@bigfoot.com>
Fri, 8 Jun 2001 14:49:05 +0000 (14:49 +0000)
space-happy C preprocessors.

libguile/ChangeLog
libguile/filter-doc-snarfage.c
libguile/snarf.h

index 3f48f61..ad4a3e8 100644 (file)
@@ -1,5 +1,8 @@
 2001-06-08  Michael Livshin  <mlivshin@bigfoot.com>
 
+       * snarf.h, filter-doc-snarfage.c: more changes to cope with
+       space-happy C preprocessors.
+
        * filter-doc-snarfage.c, guile-snarf.in: try to cope with spaces
        inside cookies.  thanks to Matthias Köppe!
 
index f1d2fd1..54ebc3c 100644 (file)
@@ -23,6 +23,7 @@ typedef enum state_t
     SKIP,
     SKIP_COOKIE,
         
+    MULTILINE_BEGINNING_OF_LINE,
     MULTILINE,
 
     MULTILINE_COOKIE,
@@ -68,11 +69,19 @@ process ()
         fputs ("(doc-block (\n", stdout);
         state = MULTILINE;
         break;
+      case ' ':
+        break;
       default:
         die ("bad snarf cookie");
         break;
       }
       break;
+    case MULTILINE_BEGINNING_OF_LINE:
+      if (c != ' ') {
+        state = MULTILINE;
+        putc (c, stdout);
+      }
+      break;
     case MULTILINE:
       if (c == '^') {
         if (want_cookie) {
@@ -92,13 +101,15 @@ process ()
       case '(':
         state = STRINGS;
         break;
-      case ' ':
-        state = MULTILINE;
+      case '%':
+        state = MULTILINE_BEGINNING_OF_LINE;
         break;
       case '}':
         fputs ("))\n", stdout);
         state = SKIP;
         break;
+      case ' ':
+        break;
       default:
         die ("bad snarf cookie in multiline context");
         break;
index 045e634..04c2a30 100644 (file)
 #  define SCM_SNARF_INIT(X)
 #  define SCM_SNARF_DOCS(TYPE, FNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING) \
 ^^{ \
-^^ fname . FNAME \
-^^ type . TYPE \
-^^ location __FILE__ . __LINE__ \
-^^ arglist . ARGLIST \
-^^ argsig REQ OPT VAR \
+^^%fname . FNAME \
+^^%type . TYPE \
+^^%location __FILE__ . __LINE__ \
+^^%arglist . ARGLIST \
+^^%argsig REQ OPT VAR \
 ^^(DOCSTRING) \
 ^^}
 # else