Index: trunk/matching.lisp
===================================================================
--- trunk/matching.lisp	(revision trunk,24)
+++ trunk/matching.lisp	(revision trunk,25)
@@ -234,25 +234,31 @@
     (list
      (destructuring-bind (head . tail) rule
-       (symcase head
-	 (^ (destructuring-bind (regex) tail
-	      `(if-matches-regex ,input ,regex (,next ,match) ,then ,else)))
-	 (/ `(if-matches-choice ,input ,tail (,next ,match) ,then ,else))
-	 ({} (destructuring-bind (mincount maxcount subrule) tail
-	       `(if-matches-count ,input ,mincount ,maxcount ,subrule
-		 (,next ,match) ,then ,else)))
-	 (* (destructuring-bind (sub) tail
-	      `(if-matches-count ,input 0 nil ,sub (,next ,match)
-		,then ,else)))
-	 (? (destructuring-bind (sub) tail
-	      `(if-matches-count ,input 0 1 ,sub (,next ,match) ,then ,else)))
-	 (+ (destructuring-bind (sub) tail
-	      `(if-matches-count ,input 1 nil ,sub (,next ,match)
-		,then ,else)))
-	 (& (destructuring-bind (sub) tail
-	      `(if-matches-required ,input ,sub (,next ,match) ,then ,else)))
-	 (! (destructuring-bind (sub) tail
-	      `(if-matches-forbidden ,input ,sub (,next ,match) ,then ,else)))
-	 (= (destructuring-bind (sub) tail
-	      `(if-matches-only ,input ,sub (,next ,match) ,then ,else)))
-	 (t `(if-matches-sequence ,input ,rule (,next ,match)
-	      ,then ,else)))))))
+       (if (symbolp head)
+	   (symcase head
+	     (^ (destructuring-bind (regex) tail
+		  `(if-matches-regex ,input ,regex (,next ,match)
+		    ,then ,else)))
+	     (/ `(if-matches-choice ,input ,tail (,next ,match) ,then ,else))
+	     ({} (destructuring-bind (mincount maxcount subrule) tail
+		   `(if-matches-count ,input ,mincount ,maxcount ,subrule
+		     (,next ,match) ,then ,else)))
+	     (* (destructuring-bind (sub) tail
+		  `(if-matches-count ,input 0 nil ,sub (,next ,match)
+		    ,then ,else)))
+	     (? (destructuring-bind (sub) tail
+		  `(if-matches-count ,input 0 1 ,sub (,next ,match)
+		    ,then ,else)))
+	     (+ (destructuring-bind (sub) tail
+		  `(if-matches-count ,input 1 nil ,sub (,next ,match)
+		    ,then ,else)))
+	     (& (destructuring-bind (sub) tail
+		  `(if-matches-required ,input ,sub (,next ,match)
+		    ,then ,else)))
+	     (! (destructuring-bind (sub) tail
+		  `(if-matches-forbidden ,input ,sub (,next ,match)
+		    ,then ,else)))
+	     (= (destructuring-bind (sub) tail
+		  `(if-matches-only ,input ,sub (,next ,match) ,then ,else)))
+	     (t `(if-matches-sequence ,input ,rule (,next ,match)
+		  ,then ,else)))
+	   `(if-matches-sequence ,input ,rule (,next ,match) ,then ,else))))))
Index: trunk/package.lisp
===================================================================
--- trunk/package.lisp	(revision trunk,21)
+++ trunk/package.lisp	(revision trunk,25)
@@ -35,3 +35,5 @@
 	   #:if-matches-forbidden
 	   #:if-matches-only
-	   #:if-matches))
+	   #:if-matches
+	   #:defparser
+	   #:defgrammar))
