xmp2assert 5 → 6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xmp2assert/converter.rb +15 -1
- data/lib/xmp2assert/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a3d094937f1507beb58f9131f1779863df91f7e
|
4
|
+
data.tar.gz: cc3f457c3d31739bc235222aa6b9fa1adbdd5287
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b86def4caf24dfc2a2e656f3359bd66b77ebf1a3d6b5507b06d05435ba4e6e4692d0d601e6a2ba733fe0cce4f2a42f1d5ac729d5c3a8e0442d279666184ea14
|
7
|
+
data.tar.gz: e1d3a2fdb734ba4d1f653c40d0ff727d006bc332370d4ebd713d8d664a0ba24a2e739639086e21ab58ab3cd01d9d30f99a24e2d6f1520e5b884c26cd410ca2df
|
data/lib/xmp2assert/converter.rb
CHANGED
@@ -108,6 +108,20 @@ class XMP2Assert::Converter
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
def beginning_of_expr? tok
|
112
|
+
case tok.to_sym
|
113
|
+
when :sp then return false
|
114
|
+
when :kw then
|
115
|
+
case tok.to_s
|
116
|
+
when 'return' then return false
|
117
|
+
when 'next' then return false
|
118
|
+
when 'break' then return false
|
119
|
+
else return true
|
120
|
+
end
|
121
|
+
else return true
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
111
125
|
def find_stop xmp
|
112
126
|
pos = @tokens.index xmp
|
113
127
|
(pos - 1).downto 0 do |i|
|
@@ -133,7 +147,7 @@ class XMP2Assert::Converter
|
|
133
147
|
line = @program.same_line_as stop
|
134
148
|
line.sort!
|
135
149
|
line.select! {|i| i.__COLUMN__ <= stop.__COLUMN__ }
|
136
|
-
line = line.drop_while {|i|
|
150
|
+
line = line.drop_while {|i| not beginning_of_expr? i }
|
137
151
|
until valid? line do
|
138
152
|
line.shift
|
139
153
|
end
|
data/lib/xmp2assert/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmp2assert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Urabe, Shyouhei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
245
|
version: '0'
|
246
246
|
requirements: []
|
247
247
|
rubyforge_project:
|
248
|
-
rubygems_version: 2.6.
|
248
|
+
rubygems_version: 2.6.11
|
249
249
|
signing_key:
|
250
250
|
specification_version: 4
|
251
251
|
summary: auto-generate assertions from `# =>` comments
|