generate glx enums
[clinton/guile-figl.git] / figl / parse.scm
index 3db44c0..54f4200 100644 (file)
     (string->number (substring num 2) 16))
    ((string-prefix? "GL_" num)
     (cons #f (mangle-name (substring num 3))))
+   ;; Hackety hack...
+   ((string-prefix? "GLX_" num)
+    (cons #f (mangle-name (substring num 4))))
    (else
     (string->number num))))
 
        ((string-index line #\:)
         => (lambda (pos)
              (let* ((ws (or (string-index-right line char-whitespace? 0 pos) 0))
-                    (headers (map string-trim-both
-                                  (string-split (substring line 0 ws) #\,)))
+                    (headers (filter
+                              (compose not string-null?)
+                              (map string-trim-both
+                                   (string-split (substring line 0 ws) #\,))))
                     (def (substring line (1+ ws) pos)))
                (match (cons def headers)
-                 (("define" headers ...)
+                 ((or ("define" _ ...)
+                      ((? (lambda (x) (string-suffix? "_future_use" x)))))
                   (lp '()
                       '()
                       (finish-block current-headers current-enums accum)))