Skip to content

Instantly share code, notes, and snippets.

View zachpendleton's full-sized avatar

Zach Pendleton zachpendleton

View GitHub Profile
@mrb
mrb / parse_ruby.clj
Last active December 14, 2015 17:29
Using JRuby's Ruby Parser from Clojure
(ns graaaph.core
(:import (org.jrubyparser Parser
CompatVersion)
(org.jrubyparser.parser ParserConfiguration)
(org.jrubyparser.ast Node)
(java.io.StringReader))
(:require [clojure.zip :as z]))
(defn parse-ruby [ruby-string]
(let [config (ParserConfiguration. 0 (CompatVersion/RUBY1_9))