File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 11## HEAD (unreleased)
22
3+ - Expand explanations coming from additional Ripper errors (https://github.com/zombocom/dead_end/pull/117 )
34- Fix explanation involving shorthand syntax for literals like ` %w[] ` and ` %Q{} ` (https://github.com/zombocom/dead_end/pull/116 )
45
56## 3.0.2
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ def on_parse_error(msg)
1818 @errors << msg
1919 end
2020
21+ alias_method :on_alias_error , :on_parse_error
22+ alias_method :on_assign_error , :on_parse_error
23+ alias_method :on_class_name_error , :on_parse_error
24+ alias_method :on_param_error , :on_parse_error
25+ alias_method :compile_error , :on_parse_error
26+
2127 def call
2228 @run_once ||= begin
2329 @errors = [ ]
Original file line number Diff line number Diff line change 44
55module DeadEnd
66 RSpec . describe "ExplainSyntax" do
7+ it "handles shorthand syntaxes with non-bracket characters" do
8+ source = <<~EOM
9+ %Q* lol
10+ EOM
11+
12+ explain = ExplainSyntax . new (
13+ code_lines : CodeLine . from_source ( source )
14+ ) . call
15+
16+ expect ( explain . missing ) . to eq ( [ ] )
17+ expect ( explain . errors . join ) . to include ( "unterminated string" )
18+ end
19+
720 it "handles %w[]" do
821 source = <<~EOM
922 node.is_a?(Op) && %w[| ||].include?(node.value) &&
You can’t perform that action at this time.
0 commit comments