Skip to content

Instantly share code, notes, and snippets.

@hugoduncan
Created May 31, 2012 16:48
Show Gist options
  • Save hugoduncan/2844691 to your computer and use it in GitHub Desktop.
Save hugoduncan/2844691 to your computer and use it in GitHub Desktop.
Trying to parse nested lists with cgrand's parsley
;; parse nested, punctuated lists in parsley
(def nested-list-parser
(parser
:expr #{:e1 [:expr "," :e1]}
:e1 #{"e" [:e1 ";" "e"]}))
(clojure.pprint/pprint (nested-list-parser "e;e;e,e;e"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment