xmp2assert 5 → 6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ead66153d54037ddd64a7d9f6249abd0e35bfc38
4
- data.tar.gz: f041305358aa731b972e1a730033b8bc3732fbcd
3
+ metadata.gz: 0a3d094937f1507beb58f9131f1779863df91f7e
4
+ data.tar.gz: cc3f457c3d31739bc235222aa6b9fa1adbdd5287
5
5
  SHA512:
6
- metadata.gz: 06611e88009ad40fa0c8a08a71c3fd2f83e8f211881a14f4218ee44aa134e26a8f554e3f285e23f9038e931081a5fec7056ae67998fe4233eb7e478d2b3d2581
7
- data.tar.gz: 1ab5fb590fc8e7bd845b26834f5c8c9838e19e0f9ce5a6dc4e192ae52b8c47eeb8ecb8e1a95b26575f6e3271395284bfb7532582618e7e23ba63dcf87f770dea
6
+ metadata.gz: 8b86def4caf24dfc2a2e656f3359bd66b77ebf1a3d6b5507b06d05435ba4e6e4692d0d601e6a2ba733fe0cce4f2a42f1d5ac729d5c3a8e0442d279666184ea14
7
+ data.tar.gz: e1d3a2fdb734ba4d1f653c40d0ff727d006bc332370d4ebd713d8d664a0ba24a2e739639086e21ab58ab3cd01d9d30f99a24e2d6f1520e5b884c26cd410ca2df
@@ -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| i.to_sym == :sp }
150
+ line = line.drop_while {|i| not beginning_of_expr? i }
137
151
  until valid? line do
138
152
  line.shift
139
153
  end
@@ -24,4 +24,4 @@
24
24
  # SOFTWARE.
25
25
  ;
26
26
 
27
- XMP2Assert::VERSION = 5
27
+ XMP2Assert::VERSION = 6
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: '5'
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-08 00:00:00.000000000 Z
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.12
248
+ rubygems_version: 2.6.11
249
249
  signing_key:
250
250
  specification_version: 4
251
251
  summary: auto-generate assertions from `# =>` comments