Skip to content

Instantly share code, notes, and snippets.

@mnemnion
Last active December 16, 2015 06:39
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 mnemnion/5393177 to your computer and use it in GitHub Desktop.
Save mnemnion/5393177 to your computer and use it in GitHub Desktop.
A bit of Clojure to make case-insensitive token match rules in ANTLR
(defn caseify [string]
(apply str (map (fn [foo] (apply str ["(" "'" (upper-case foo) "'" "|" "'" foo "'" ")"]))
(rest (split string #"")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment