Last active
December 12, 2015 02:29
-
-
Save ragnard/4699524 to your computer and use it in GitHub Desktop.
parsley
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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