Skip to content

Instantly share code, notes, and snippets.

@laurentpetit
Created September 29, 2011 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurentpetit/79584794121b77e11144 to your computer and use it in GitHub Desktop.
Save laurentpetit/79584794121b77e11144 to your computer and use it in GitHub Desktop.
Nouveau bug parsley
=> (def s (p/parser {:main :expr}
:expr- #{:list :atom}
:list ["(" :expr* ")"]
:atom "a"))
#'paredit.parser/s
=> (s "(a)")
#:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/root, :content [#:net.cgrand.parsley.Node{:tag :list, :content ["(" #:net.cgrand.parsley.Node{:tag :atom, :content ["a"]} ")"]}]}
=> (s "(b)")
#:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/root, :content [#:net.cgrand.parsley.Node{:tag :list, :content ["(" #:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unexpected, :content ["b"]} ")"]}]}
=> (s ")")
#:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unfinished, :content [#:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unexpected, :content [")"]}]}
=> (s ")b")
#:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unfinished, :content [#:net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unexpected, :content [")b"]}]}
=> (s ")a")
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment