Skip to content

Commit 0d7ee65

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 1a3576c commit 0d7ee65

4 files changed

Lines changed: 21426 additions & 16674 deletions

File tree

Gemfile.lock

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PATH
99
constant_resolver (>= 0.3)
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

@@ -106,7 +106,7 @@ GEM
106106
pp (0.6.2)
107107
prettyprint
108108
prettyprint (0.2.0)
109-
prism (0.27.0)
109+
prism (1.6.0)
110110
psych (5.2.6)
111111
date
112112
stringio
@@ -136,9 +136,11 @@ GEM
136136
zeitwerk (~> 2.6)
137137
rainbow (3.1.1)
138138
rake (13.2.1)
139-
rbi (0.1.12)
140-
prism (>= 0.18.0, < 0.28)
141-
sorbet-runtime (>= 0.5.9204)
139+
rbi (0.3.7)
140+
prism (~> 1.0)
141+
rbs (>= 3.4.4)
142+
rbs (3.9.5)
143+
logger
142144
rdoc (6.14.0)
143145
erb
144146
psych (>= 4.0.0)
@@ -186,11 +188,12 @@ GEM
186188
thor (>= 0.19.2)
187189
spring (4.0.0)
188190
stringio (3.1.7)
189-
tapioca (0.13.3)
191+
tapioca (0.16.11)
192+
benchmark
190193
bundler (>= 2.2.25)
191194
netrc (>= 0.11.0)
192195
parallel (>= 1.21.0)
193-
rbi (>= 0.1.4, < 0.2)
196+
rbi (~> 0.2)
194197
sorbet-static-and-runtime (>= 0.5.11087)
195198
spoom (>= 1.2.0)
196199
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)