Skip to content

Instantly share code, notes, and snippets.

@mnemnion
Last active December 16, 2015 06:39
Show Gist options
  • 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