Permalink
Browse files

Add the string convenience function to parse a string.

fixes #8
  • Loading branch information...
1 parent 62a199a commit f7e769f5acec0b3a4f4afdc478bbe6ced4c09fab @sjl committed Sep 13, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/the/parsatron.clj
View
@@ -234,6 +234,12 @@
[]
(token #(Character/isLetter %)))
+(defn string
+ "Consume the given string"
+ [s]
+ (reduce nxt (concat (map char s)
+ (list (always s)))))
+
(defn between
"Parse p after parsing open and before parsing close, returning the
value of p and discarding the values of open and close"

0 comments on commit f7e769f

Please sign in to comment.