sexp_processor 4.12.0 → 4.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.rdoc +12 -0
- data/lib/pt_testcase.rb +13 -15
- data/lib/sexp.rb +5 -2
- data/lib/sexp_processor.rb +2 -2
- data/test/test_sexp_processor.rb +2 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fe32dcd3e36da0a96d86a6a1a7fd60dd8cef96ebd1e0d1b0d87338e3d7fee85
|
4
|
+
data.tar.gz: d55a40a0ed66d6d84cf653efba498f01d64fba61e7fd4a9eb87caa04f8dcb396
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8574bf015b701313f58aa5650b963ab35f9119567826606190658640ee32c870ce957ad73e0b2e17b6350c9217fb691383f8794d91d152a4ff2c18873cb18d5b
|
7
|
+
data.tar.gz: 4a0a6754c29ac19d5654a3a8909a1fd233bfa1831fce155e9c4bee3e25143923693d84a2019079965f507fef34e0502ac412621a671076ba45ce42a312ccbac3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 4.12.1 / 2019-06-03
|
2
|
+
|
3
|
+
* 1 minor enhancement:
|
4
|
+
|
5
|
+
* Sexp#line now raises if setting w/ non-integer (eg nil).
|
6
|
+
|
7
|
+
* 3 bug fixes:
|
8
|
+
|
9
|
+
* Fixed pt_testcase.rb for block args w/ trailing commas.
|
10
|
+
* Fixed pt_testcase.rb for stabby proc sexps.
|
11
|
+
* Simple fixes for STRICT_SEXP=1.
|
12
|
+
|
1
13
|
=== 4.12.0 / 2019-03-12
|
2
14
|
|
3
15
|
* 3 bug fixes:
|
data/lib/pt_testcase.rb
CHANGED
@@ -363,26 +363,26 @@ class ParseTreeTestCase < Minitest::Test
|
|
363
363
|
###
|
364
364
|
# 1.9 specific tests
|
365
365
|
|
366
|
-
add_19edgecases("
|
366
|
+
add_19edgecases("-> () { (x + 1) }",
|
367
367
|
s(:iter,
|
368
|
-
s(:
|
368
|
+
s(:lambda),
|
369
369
|
s(:args),
|
370
370
|
s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
|
371
371
|
"stabby_args" => "->() { (x + 1) }",
|
372
372
|
"stabby_args_doend" => "->() do (x + 1) end")
|
373
373
|
|
374
|
-
add_19edgecases("
|
374
|
+
add_19edgecases("-> { (x + 1) }",
|
375
375
|
s(:iter,
|
376
|
-
s(:
|
376
|
+
s(:lambda),
|
377
377
|
0,
|
378
378
|
s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
|
379
379
|
"stabby_args_0_no_parens" => "-> { (x + 1) }",
|
380
380
|
"stabby_args_0_no_parens_doend" => "-> do (x + 1) end",
|
381
381
|
"stabby_args_0_spacebar_broken" => "->{x+1}") # I hate you
|
382
382
|
|
383
|
-
add_19edgecases("
|
383
|
+
add_19edgecases("-> (x, y) { (x + y) }",
|
384
384
|
s(:iter,
|
385
|
-
s(:
|
385
|
+
s(:lambda),
|
386
386
|
s(:args, :x, :y),
|
387
387
|
s(:call, s(:lvar, :x), :+, s(:lvar, :y))),
|
388
388
|
"stabby_args_2" => "->(x, y) { (x + y) }",
|
@@ -390,9 +390,9 @@ class ParseTreeTestCase < Minitest::Test
|
|
390
390
|
"stabby_args_2_no_parens" => "-> x, y { (x + y) }",
|
391
391
|
"stabby_args_2_no_parens_doend" => "-> x, y do (x + y) end")
|
392
392
|
|
393
|
-
add_19edgecases("
|
393
|
+
add_19edgecases("-> (x) { (x + 1) }",
|
394
394
|
s(:iter,
|
395
|
-
s(:
|
395
|
+
s(:lambda),
|
396
396
|
s(:args, :x),
|
397
397
|
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
398
398
|
"stabby_args_1" => "->(x) { (x + 1) }",
|
@@ -2080,17 +2080,15 @@ class ParseTreeTestCase < Minitest::Test
|
|
2080
2080
|
"Ruby" => "lambda { |a,| a }",
|
2081
2081
|
"ParseTree" => s(:iter,
|
2082
2082
|
s(:call, nil, :lambda),
|
2083
|
-
s(:args, :a),
|
2084
|
-
s(:lvar, :a))
|
2085
|
-
"Ruby2Ruby" => "lambda { |a| a }")
|
2083
|
+
s(:args, :a, nil),
|
2084
|
+
s(:lvar, :a)))
|
2086
2085
|
|
2087
2086
|
add_tests("lambda_args_norm_comma2",
|
2088
|
-
"Ruby" => "lambda { |a,b,| a }",
|
2087
|
+
"Ruby" => "lambda { |a, b,| a }",
|
2089
2088
|
"ParseTree" => s(:iter,
|
2090
2089
|
s(:call, nil, :lambda),
|
2091
|
-
s(:args, :a, :b),
|
2092
|
-
s(:lvar, :a))
|
2093
|
-
"Ruby2Ruby" => "lambda { |a, b| a }")
|
2090
|
+
s(:args, :a, :b, nil),
|
2091
|
+
s(:lvar, :a)))
|
2094
2092
|
|
2095
2093
|
add_tests("lambda_args_norm_star",
|
2096
2094
|
"Ruby" => "lambda { |a, *star| star }",
|
data/lib/sexp.rb
CHANGED
@@ -202,13 +202,16 @@ class Sexp < Array # ZenTest FULL
|
|
202
202
|
each_sexp.find_all { |sexp| sexp.sexp_type == name }
|
203
203
|
end
|
204
204
|
|
205
|
+
UNASSIGNED = Object.new
|
206
|
+
|
205
207
|
##
|
206
208
|
# If passed a line number, sets the line and returns self. Otherwise
|
207
209
|
# returns the line number. This allows you to do message cascades
|
208
210
|
# and still get the sexp back.
|
209
211
|
|
210
|
-
def line n =
|
211
|
-
if n then
|
212
|
+
def line n = UNASSIGNED
|
213
|
+
if n != UNASSIGNED then
|
214
|
+
raise ArgumentError, "setting %p.line %p" % [self, n] unless Integer === n
|
212
215
|
@line = n
|
213
216
|
self
|
214
217
|
else
|
data/lib/sexp_processor.rb
CHANGED
@@ -34,7 +34,7 @@ require "sexp"
|
|
34
34
|
class SexpProcessor
|
35
35
|
|
36
36
|
# duh
|
37
|
-
VERSION = "4.12.
|
37
|
+
VERSION = "4.12.1"
|
38
38
|
|
39
39
|
##
|
40
40
|
# Automatically shifts off the Sexp type before handing the
|
@@ -317,7 +317,7 @@ class SexpProcessor
|
|
317
317
|
|
318
318
|
def assert_type list, typ
|
319
319
|
raise SexpTypeError, "Expected type #{typ.inspect} in #{list.inspect}" if
|
320
|
-
not Array === list or list.
|
320
|
+
not Array === list or list.sexp_type != typ
|
321
321
|
end
|
322
322
|
|
323
323
|
def error_handler type, exp = nil # :nodoc:
|
data/test/test_sexp_processor.rb
CHANGED
@@ -247,12 +247,12 @@ class TestSexpProcessor < Minitest::Test
|
|
247
247
|
end
|
248
248
|
|
249
249
|
def test_assert_type_hit
|
250
|
-
assert_nil @processor.assert_type(
|
250
|
+
assert_nil @processor.assert_type(s(:blah, 1, 2, 3), :blah)
|
251
251
|
end
|
252
252
|
|
253
253
|
def test_assert_type_miss
|
254
254
|
assert_raises SexpTypeError do
|
255
|
-
@processor.assert_type(
|
255
|
+
@processor.assert_type(s(:thingy, 1, 2, 3), :blah)
|
256
256
|
end
|
257
257
|
end
|
258
258
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sexp_processor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.12.
|
4
|
+
version: 4.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
Em82dBUFsipwMLCYj39kcyHWAxyl6Ae1Cn9r/ItVBCxoeFdrHjfavnrIEoXUt4bU
|
30
30
|
UfBugfLD19bu3nvL+zTAGx/U
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2019-
|
32
|
+
date: 2019-06-04 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
metadata.gz.sig
CHANGED
Binary file
|