Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created June 10, 2024 09:58
Show Gist options
  • Save igaiga/1a616d2aa53c4a78923218edf37ac95e to your computer and use it in GitHub Desktop.
Save igaiga/1a616d2aa53c4a78923218edf37ac95e to your computer and use it in GitHub Desktop.
require "prism"
code = <<~STR
def foo
1+2
end
STR
p Prism.parse(code)
#=> #<Prism::ParseResult:0x0000000101132048 @value=@ ProgramNode (location: (1,0)-(3,3)) ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment