Skip to content
Prev Previous commit
Next Next commit
added an error msg.
  • Loading branch information
Jason Jackson committed Jun 4, 2011
commit b64434e504a841a842c251967d336d174e8fec0e
5 changes: 4 additions & 1 deletion src/eu/dnetlib/clojure/clarsec.clj
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@
`(lazy-invoke (delay @(force (delay (var ~p-fn))))))]
(cond
(seq? sexp) (apply lazy-p-fn-fn sexp)
(symbol? sexp) (lazy-p-fn sexp))))
(symbol? sexp) (lazy-p-fn sexp)
:else (throw (Exception. (str "Unsupported use of m-lazy. "
"Proper use: (m-lazy identifier) or "
"(my-lazy (m-lazy (symb \"foo\")"))))))

(defn parse [parser input]
((monad parser) input))
Expand Down
1 change: 1 addition & 0 deletions src/test/clarsec.clj
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@
(is (= (parse$ "{{{foo}}}") :fail))
(is (= (parse$ "{{{bar}}}") "bar"))))