dead_end 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1e8a394d94d7d8f70138a9d80d7e660cca8dc06e3d3a5eb9b74334585f284aa
4
- data.tar.gz: 75296d7faaf4b117ad45bed40252566ee08752b622b2d90e4afa3be8b4a9b774
3
+ metadata.gz: 8e2b1b2c93acbc5dde38ac7da8fc9dee057389e676bde9eb95683395b6b78ad8
4
+ data.tar.gz: 0ef003bc94de8db02a1a0573bc77a0045b63207c6dd24557ec8f7b9dc76383f0
5
5
  SHA512:
6
- metadata.gz: f970086da7e3f662d2dabda9a59d89af73d503dc986a9d469d45b83f25184590892e5bdb0a4c174318b2d1bb201f112c81a0a281d0a530feb49dd7f0eb1fb144
7
- data.tar.gz: cc85e81a1d996320128d7656c0cea0727f9672060d7d2747e30e77d2aeb59d3549f4dd230835c5042988c53b1252f975c472774eb2ef7f258caebea5cd5eee40
6
+ metadata.gz: 8a6f4849d79629110326aba138ab290ca0bdc9eedf427b13b21ed1cbae084be28d017bf20644684552dbb660bd9547b514951eb909cc894304d25db8b020310b
7
+ data.tar.gz: 8f1056255fa656d206e1e2b4160b903b6d88d60043f150e1fbf943a852901488e52e0819fd29bb059109ff015e01a7167688010733d49b81057bb62d2d000bd0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## HEAD (unreleased)
2
2
 
3
+ ## 1.1.5
4
+
5
+ - Source code with multiple syntax errors will be indentified by their first syntax error (https://github.com/zombocom/dead_end/pull/57)
6
+
3
7
  ## 1.1.4
4
8
 
5
9
  - Avoid including demo gif in built gem (https://github.com/zombocom/dead_end/pull/53)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dead_end (1.1.4)
4
+ dead_end (1.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -33,4 +33,4 @@ DEPENDENCIES
33
33
  stackprof
34
34
 
35
35
  BUNDLED WITH
36
- 2.2.3
36
+ 2.2.9
@@ -82,7 +82,7 @@ module DeadEnd
82
82
  closed: `{ }`.
83
83
  EOM
84
84
  else
85
- "DeadEnd: Unmatched #{@invalid_obj.unmatched_symbol}` detected"
85
+ "DeadEnd: Unmatched `#{@invalid_obj.unmatched_symbol}` detected"
86
86
  end
87
87
  end
88
88
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeadEnd
4
- VERSION = "1.1.4"
4
+ VERSION = "1.1.5"
5
5
  end
@@ -42,22 +42,25 @@ module DeadEnd
42
42
  end
43
43
 
44
44
  def on_parse_error(msg)
45
+ return if @error_symbol && @unmatched_symbol
46
+
45
47
  @error = msg
46
48
  @unmatched_symbol = :unknown
47
49
 
48
- if @error.match?(/unexpected end-of-input/)
50
+ case @error
51
+ when /unexpected end-of-input/
49
52
  @error_symbol = :missing_end
50
- elsif @error.match?(/expecting end-of-input/)
53
+ when /expecting end-of-input/
51
54
  @error_symbol = :unmatched_syntax
52
55
  @unmatched_symbol = :end
53
- elsif @error.match?(/unexpected `end'/) || # Ruby 2.7 & 3.0
54
- @error.match?(/unexpected end,/) || # Ruby 2.6
55
- @error.match?(/unexpected keyword_end/) # Ruby 2.5
56
-
57
- @error_symbol = :unmatched_syntax
56
+ when /unexpected `end'/, # Ruby 2.7 and 3.0
57
+ /unexpected end/, # Ruby 2.6
58
+ /unexpected keyword_end/i # Ruby 2.5
58
59
 
59
60
  match = @error.match(/expecting '(?<unmatched_symbol>.*)'/)
60
61
  @unmatched_symbol = match[:unmatched_symbol].to_sym if match
62
+
63
+ @error_symbol = :unmatched_syntax
61
64
  else
62
65
  @error_symbol = :unknown
63
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dead_end
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - schneems
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: When you get an "unexpected end" in your syntax this gem helps you find
14
14
  it
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.0.3
78
+ rubygems_version: 3.2.3
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: Find syntax errors in your source in a snap