Skip to content

Instantly share code, notes, and snippets.

@ragnard
Last active December 12, 2015 02:29
Show Gist options
  • Save ragnard/4699524 to your computer and use it in GitHub Desktop.
Save ragnard/4699524 to your computer and use it in GitHub Desktop.
parsley
(def parse (p/parser parser-options
:start [:params? :line*]
:start :tag-line
:vspace #"[\n\r]+"
:params [:vspace :doctype]
:doctype ["!!! " :doctype-spec]
:doctype-spec- #".*"
:line [:tag-line]
:tag-line [:indent* :tag]
:indent " "
:tag ["%" :word]
:id ["#" :word]
:class ["." :word]
:word- #"[\w]+"
:nontag #{:text}
:a #" *"
:b #"[^\s#\.].*"
:text [:a?; :b
]
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment