dead_end 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/dead_end/lex_all.rb +4 -1
- data/lib/dead_end/lex_value.rb +9 -3
- data/lib/dead_end/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64abeaee0636d3ded8df0f0dc124674a70f954287b37302dff7151f04b746557
|
4
|
+
data.tar.gz: 02e6eea73a9e9e832b898f9294c1ce3f7f38f9b8996554a8f6527abf7027d115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7381458f44ef92f5053ac3171ac8bc59e89a805d793dde1c48ce1eda855dcea624ef6dc7a1faa3da9c20abc53983675fc66a7b08e3e02893801b4b4ff0edf65
|
7
|
+
data.tar.gz: 8b92dee56fac32777f31b76e25a0b778b2a4ffa1ff6914f24ef835bbf5ab79898f4a3a5607a9bebc641f86b05f2a88224504f0f8aaab83c3262b1d067ea32af0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
## HEAD (unreleased)
|
2
2
|
|
3
|
+
## 3.1.1
|
4
|
+
|
5
|
+
- Fix case where Ripper lexing identified incorrect code as a keyword (https://github.com/zombocom/dead_end/pull/122)
|
6
|
+
|
3
7
|
## 3.1.0
|
4
8
|
|
5
9
|
- Add support for Ruby 3.1 by updating `require_relative` logic (https://github.com/zombocom/dead_end/pull/120)
|
data/Gemfile.lock
CHANGED
data/lib/dead_end/lex_all.rb
CHANGED
@@ -25,7 +25,10 @@ module DeadEnd
|
|
25
25
|
lineno = @lex.last.pos.first + 1
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
last_lex = nil
|
29
|
+
@lex.map! { |elem|
|
30
|
+
last_lex = LexValue.new(elem.pos.first, elem.event, elem.tok, elem.state, last_lex)
|
31
|
+
}
|
29
32
|
end
|
30
33
|
|
31
34
|
def to_a
|
data/lib/dead_end/lex_value.rb
CHANGED
@@ -15,19 +15,21 @@ module DeadEnd
|
|
15
15
|
class LexValue
|
16
16
|
attr_reader :line, :type, :token, :state
|
17
17
|
|
18
|
-
def initialize(line, type, token, state)
|
18
|
+
def initialize(line, type, token, state, last_lex = nil)
|
19
19
|
@line = line
|
20
20
|
@type = type
|
21
21
|
@token = token
|
22
22
|
@state = state
|
23
23
|
|
24
|
-
set_kw_end
|
24
|
+
set_kw_end(last_lex)
|
25
25
|
end
|
26
26
|
|
27
|
-
private def set_kw_end
|
27
|
+
private def set_kw_end(last_lex)
|
28
28
|
@is_end = false
|
29
29
|
@is_kw = false
|
30
30
|
return if type != :on_kw
|
31
|
+
#
|
32
|
+
return if last_lex && last_lex.fname? # https://github.com/ruby/ruby/commit/776759e300e4659bb7468e2b97c8c2d4359a2953
|
31
33
|
|
32
34
|
case token
|
33
35
|
when "if", "unless", "while", "until"
|
@@ -41,6 +43,10 @@ module DeadEnd
|
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
46
|
+
def fname?
|
47
|
+
state.allbits?(Ripper::EXPR_FNAME)
|
48
|
+
end
|
49
|
+
|
44
50
|
def ignore_newline?
|
45
51
|
type == :on_ignored_nl
|
46
52
|
end
|
data/lib/dead_end/version.rb
CHANGED
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: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-04 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
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
83
|
+
rubygems_version: 3.2.32
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Find syntax errors in your source in a snap
|