Skip to content

Commit

Permalink
fix: Prism.parse accepts only source
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Dec 4, 2023
1 parent bd00146 commit 4d9fc00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ GEM
unicode-display_width (2.5.0)

PLATFORMS
arm64-darwin-21
arm64-darwin-22
x86_64-linux

Expand Down
4 changes: 2 additions & 2 deletions lib/parser/prism.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def yyerror
def parse(source_buffer)
@source_buffer = source_buffer

build_ast(::Prism.parse(source_buffer.source, source_buffer.name).value)
build_ast(::Prism.parse(source_buffer.source).value)
ensure
@source_buffer = nil
end
Expand All @@ -42,7 +42,7 @@ def parse(source_buffer)
def parse_with_comments(source_buffer)
@source_buffer = source_buffer

result = ::Prism.parse(source_buffer.source, source_buffer.name)
result = ::Prism.parse(source_buffer.source)
[build_ast(result.value), build_comments(result.comments)]
ensure
@source_buffer = nil
Expand Down

0 comments on commit 4d9fc00

Please sign in to comment.