File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 fail-fast : false
3333 matrix :
3434 ruby : ${{ fromJson(needs.ruby-versions.outputs.versions) }}
35+ prism_version :
36+ - 1.2.0 # Shipped with Ruby 3.4 as default parser https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/
37+ - 1.8.0
38+ - head
39+ env :
40+ PRISM_VERSION : ${{ matrix.prism_version }}
3541 steps :
3642 - name : Checkout code
3743 uses : actions/checkout@v6
4046 with :
4147 ruby-version : ${{ matrix.ruby }}
4248 bundler-cache : true
49+ - name : Use latest prism version (head only)
50+ if : matrix.prism_version == 'head'
51+ run : bundle update prism
4352 - name : test
4453 run : bin/rake test
4554 continue-on-error : ${{ matrix.ruby == 'head' }}
Original file line number Diff line number Diff line change 11## HEAD (unreleased)
22
3+ - Fix: Correctly identify trailing slashes when using Prism > 1.8.0. (https://github.com/ruby/syntax_suggest/pull/243 )
4+ - Internal: Add tests to multiple versions of prism
5+
36## 2.0.2
47
58- Fix: Separate multiple parser errors by newline. (https://github.com/ruby/syntax_suggest/pull/232 )
Original file line number Diff line number Diff line change @@ -12,4 +12,12 @@ gem "standard"
1212gem "ruby-prof"
1313
1414gem "benchmark-ips"
15- gem "prism"
15+
16+ case ENV [ "PRISM_VERSION" ] &.strip &.downcase
17+ when "head"
18+ gem "prism" , github : "ruby/prism"
19+ when nil , ""
20+ gem "prism"
21+ else
22+ gem "prism" , ENV [ "PRISM_VERSION" ]
23+ end
Original file line number Diff line number Diff line change @@ -180,18 +180,17 @@ def ignore_newline_not_beg?
180180 # EOM
181181 # expect(lines.first.trailing_slash?).to eq(true)
182182 #
183- if SyntaxSuggest . use_prism_parser?
184- def trailing_slash?
185- last = @lex . last
186- last &.type == :on_tstring_end
187- end
188- else
189- def trailing_slash?
190- last = @lex . last
191- return false unless last
192- return false unless last . type == :on_sp
183+ def trailing_slash?
184+ last = @lex . last
193185
186+ # Older versions of prism diverged slightly from Ripper in compatibility mode
187+ case last &.type
188+ when :on_sp
194189 last . token == TRAILING_SLASH
190+ when :on_tstring_end
191+ true
192+ else
193+ false
195194 end
196195 end
197196
You can’t perform that action at this time.
0 commit comments