Skip to content

Commit

Permalink
Proof of concept: Use prism parser
Browse files Browse the repository at this point in the history
  • Loading branch information
exterm committed Feb 1, 2024
1 parent cc72e73 commit 1ff77c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PATH
constant_resolver (>= 0.2.0)
parallel
parser
parser-prism
sorbet-runtime (>= 0.5.9914)
zeitwerk (>= 2.6.1)

Expand Down Expand Up @@ -60,23 +61,23 @@ GEM
method_source (>= 0.6.7)
rake (>= 0.9.2.2)
method_source (1.0.0)
mini_portile2 (2.8.4)
minitest (5.16.2)
minitest-focus (1.3.1)
minitest (>= 4, < 6)
mocha (1.14.0)
netrc (0.11.0)
nokogiri (1.15.3)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.15.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.3-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.2.2.0)
ast (~> 2.4.1)
parser-prism (0.1.0)
parser
prism
prettier_print (0.1.0)
prism (0.20.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -179,7 +180,6 @@ GEM
zeitwerk (2.6.4)

PLATFORMS
ruby
x86_64-darwin
x86_64-darwin-20
x86_64-linux
Expand Down
4 changes: 2 additions & 2 deletions lib/packwerk/parsers/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# frozen_string_literal: true

require "parser"
require "parser/current"
require "parser/prism"

module Packwerk
module Parsers
Expand All @@ -11,7 +11,7 @@ class Ruby

include ParserInterface

class RaiseExceptionsParser < Parser::CurrentRuby
class RaiseExceptionsParser < Parser::Prism
extend T::Sig

sig { params(builder: T.untyped).void }
Expand Down
1 change: 1 addition & 0 deletions packwerk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Gem::Specification.new do |spec|
# For Ruby parsing
spec.add_dependency("ast")
spec.add_dependency("parser")
spec.add_dependency("parser-prism")

# For ERB parsing
spec.add_dependency("better_html")
Expand Down

0 comments on commit 1ff77c3

Please sign in to comment.