-
-
Save havenwood/bd9fc2e475f4db3386e7 to your computer and use it in GitHub Desktop.
Now look what you've done, shevy!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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