Skip to content

Commit a8a5f08

Browse files
committed
Use the prism builder when available
prism requires its own builder class in order to emit ast for versions that the parser gem doesn't support. The next prism version will warn when a incorrect builder class is used, it wasn't previously enforced.
1 parent b03d5bb commit a8a5f08

File tree

4 files changed

+21428
-16674
lines changed

4 files changed

+21428
-16674
lines changed

Gemfile.lock

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PATH
99
constant_resolver (>= 0.2.0)
1010
parallel
1111
parser
12-
prism (>= 0.25.0)
12+
prism (>= 1.4.0)
1313
sorbet-runtime (>= 0.5.9914)
1414
zeitwerk (>= 2.6.1)
1515

@@ -35,6 +35,7 @@ GEM
3535
minitest (>= 5.1)
3636
tzinfo (~> 2.0)
3737
ast (2.4.2)
38+
benchmark (0.5.0)
3839
better_html (2.1.1)
3940
actionview (>= 6.0)
4041
activesupport (>= 6.0)
@@ -52,6 +53,7 @@ GEM
5253
concurrent-ruby (~> 1.0)
5354
json (2.7.2)
5455
language_server-protocol (3.17.0.3)
56+
logger (1.7.0)
5557
loofah (2.24.0)
5658
crass (~> 1.0.2)
5759
nokogiri (>= 1.12.0)
@@ -77,7 +79,7 @@ GEM
7779
parser (3.3.3.0)
7880
ast (~> 2.4.1)
7981
racc
80-
prism (0.27.0)
82+
prism (1.4.0)
8183
racc (1.8.1)
8284
rack (2.2.13)
8385
rack-test (2.2.0)
@@ -98,9 +100,11 @@ GEM
98100
zeitwerk (~> 2.5)
99101
rainbow (3.1.1)
100102
rake (13.0.6)
101-
rbi (0.1.12)
102-
prism (>= 0.18.0, < 0.28)
103-
sorbet-runtime (>= 0.5.9204)
103+
rbi (0.3.7)
104+
prism (~> 1.0)
105+
rbs (>= 3.4.4)
106+
rbs (3.9.5)
107+
logger
104108
regexp_parser (2.9.2)
105109
rexml (3.3.9)
106110
rubocop (1.64.1)
@@ -141,11 +145,12 @@ GEM
141145
sorbet-static-and-runtime (>= 0.5.10187)
142146
thor (>= 0.19.2)
143147
spring (4.0.0)
144-
tapioca (0.13.3)
148+
tapioca (0.16.11)
149+
benchmark
145150
bundler (>= 2.2.25)
146151
netrc (>= 0.11.0)
147152
parallel (>= 1.21.0)
148-
rbi (>= 0.1.4, < 0.2)
153+
rbi (~> 0.2)
149154
sorbet-static-and-runtime (>= 0.5.11087)
150155
spoom (>= 1.2.0)
151156
thor (>= 1.2.0)

lib/packwerk/parsers/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def valid_error?(error)
2828
end
2929
end
3030

31-
class TolerateInvalidUtf8Builder < Parser::Builders::Default
31+
class TolerateInvalidUtf8Builder < Prism::Translation::Parser::Builder
3232
extend T::Sig
3333

3434
sig { params(token: T.untyped).returns(T.untyped) }

packwerk.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Gem::Specification.new do |spec|
4848
# For Ruby parsing
4949
spec.add_dependency("ast")
5050
spec.add_dependency("parser")
51-
spec.add_dependency("prism", ">= 0.25.0")
51+
spec.add_dependency("prism", ">= 1.4.0")
5252

5353
# For ERB parsing
5454
spec.add_dependency("better_html")

0 commit comments

Comments
 (0)