Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active November 12, 2015 21:33
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 havenwood/bd9fc2e475f4db3386e7 to your computer and use it in GitHub Desktop.
Save havenwood/bd9fc2e475f4db3386e7 to your computer and use it in GitHub Desktop.
Now look what you've done, shevy!
require 'ripper'
module Reveal
def self.code source
{
tokens: Ripper.tokenize(source),
lexed: Ripper.lex(source),
sexp_tree: Ripper.sexp(source),
bytecode: RubyVM::InstructionSequence.compile(source).to_a
}
end
end
Reveal.code 'x = 3..5'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment