Skip to content

Instantly share code, notes, and snippets.

@ericnormand
Created February 22, 2010 22:22
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 ericnormand/311583 to your computer and use it in GitHub Desktop.
Save ericnormand/311583 to your computer and use it in GitHub Desktop.
(def end (p/not-followed-by p/anything))
(def lang1
(p/alt
(p/invisi-conc (term (partial = :a)) end)
(p/invisi-conc (term (partial = :a)) (term (partial = :a)) end)))
(def lang2
(p/invisi-conc (p/alt (term (partial = :a))
(p/invisi-conc (term (partial = :a)) (term (partial = :a))))
end))
(lang1 {:remainder [:a :a]})
; => [:a {:remainder nil}]
(lang2 {:remainder [:a :a]})
; => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment