Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created June 10, 2024 09:58
Show Gist options
  • Select an option

  • Save igaiga/1a616d2aa53c4a78923218edf37ac95e to your computer and use it in GitHub Desktop.

Select an option

Save igaiga/1a616d2aa53c4a78923218edf37ac95e to your computer and use it in GitHub Desktop.

Revisions

  1. igaiga created this gist Jun 10, 2024.
    9 changes: 9 additions & 0 deletions prism_example.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    require "prism"
    code = <<~STR
    def foo
    1+2
    end
    STR

    p Prism.parse(code)
    #=> #<Prism::ParseResult:0x0000000101132048 @value=@ ProgramNode (location: (1,0)-(3,3)) ...