Skip to content

Commit

Permalink
Merge pull request #10 from sjl/master
Browse files Browse the repository at this point in the history
Add a 'string' convenience function.
  • Loading branch information
youngnh committed Sep 13, 2012
2 parents 62a199a + e58f0db commit 94feadd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,5 @@ pom.xml
*jar *jar
lib lib
classes classes
.lein* .lein*
target/
6 changes: 6 additions & 0 deletions src/the/parsatron.clj
Expand Up @@ -234,6 +234,12 @@
[] []
(token #(Character/isLetter %))) (token #(Character/isLetter %)))


(defn string
"Consume the given string"
[s]
(reduce nxt (concat (map char s)
(list (always s)))))

(defn between (defn between
"Parse p after parsing open and before parsing close, returning the "Parse p after parsing open and before parsing close, returning the
value of p and discarding the values of open and close" value of p and discarding the values of open and close"
Expand Down
File renamed without changes.

0 comments on commit 94feadd

Please sign in to comment.