Created
January 22, 2019 14:25
-
-
Save hanneskaeufler/a24c6af41b7442ab238a6a01904b64f1 to your computer and use it in GitHub Desktop.
Getting AST from string
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 "compiler/crystal/syntax/*" | |
code = <<-CODE | |
def hello | |
puts "hello" | |
end | |
CODE | |
ast = Crystal::Parser.parse(code) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment