Skip to content

Instantly share code, notes, and snippets.

@ToxicFrog
Created July 9, 2012 13:22
Show Gist options
  • Save ToxicFrog/3076539 to your computer and use it in GitHub Desktop.
Save ToxicFrog/3076539 to your computer and use it in GitHub Desktop.
(def sfs-lexer
(lexer
["\\s+" :whitespace :drop-token]
["//.*" :comment :drop-token]
["\\{" :open-brace]
["\\}" :close-brace]
["[A-Z]+" :type]
["[a-zA-Z0-9]+" :key]
["=\\s*(.*)" :value #(-> %2)]))
(defn -main
[& args]
(dorun (map (partial println "TOKEN") (lex-seq sfs-lexer (slurp "test.sfs")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment