Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed defparser to allow for recursive parser definitions

  • Loading branch information...
commit 62cc2b7f5ea60b2809e156418ba5791ab5f3e0ca 1 parent a54987c
@youngnh authored
Showing with 5 additions and 2 deletions.
  1. +2 −1  src/parsatron/languages/bf.clj
  2. +3 −1 src/the/parsatron.clj
View
3  src/parsatron/languages/bf.clj
@@ -1,4 +1,5 @@
-(ns parsatron.languages.bf)
+(ns parsatron.languages.bf
+ (:use [the.parsatron]))
(defparser instruction []
(choice (char \>)
View
4 src/the/parsatron.clj
@@ -55,7 +55,9 @@
(defmacro defparser [name args & body]
`(defn ~name ~args
- (>> ~@body)))
+ (fn [state# cok# cerr# eok# eerr#]
+ (let [p# (>> ~@body)]
+ (p# state# cok# cerr# eok# eerr#)))))
(defmacro >>
([m] m)
Please sign in to comment.
Something went wrong with that request. Please try again.