sexp_processor 4.14.1 → 4.15.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/Rakefile +1 -1
- data/lib/pt_testcase.rb +2 -2
- data/lib/sexp_matcher.rb +4 -7
- data/lib/sexp_processor.rb +1 -1
- data/test/test_sexp.rb +4 -1
- metadata +8 -5
- 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: 13decb62dc5a9e3ad356a489225d2aa3f36dab3ef63e29db89edda32ac60a04d
|
4
|
+
data.tar.gz: 39e9ff2e73bd2f69cdd5c1e7cd98d3da3e7c03c40657092533c8b82279031617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ca2ac2f02fd90558435f7631f0f995c6cdea2ed8ac7d0b28508e3df3f252613e75dcd194dc97a71c76391cd961251f8ad55a58ab78278caf18df31ed058d3a5
|
7
|
+
data.tar.gz: 5351c69b957632396798faae6f7d86eeb2cddbe499b017d3e44bb24e7feda951052d0d94031615b6a0bbee5de522ada528a75bb62ac4d43d40b2929304b76b94
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 4.15.1 / 2020-08-31
|
2
|
+
|
3
|
+
* 1 bug fix:
|
4
|
+
|
5
|
+
* Bumped ruby version to include 3.0 (trunk).
|
6
|
+
|
7
|
+
=== 4.15.0 / 2020-06-09
|
8
|
+
|
9
|
+
* 1 minor enhancement:
|
10
|
+
|
11
|
+
* Added `child` and `include` to Sexp::Matcher.parse language.
|
12
|
+
|
1
13
|
=== 4.14.1 / 2020-02-09
|
2
14
|
|
3
15
|
* 2 bug fixes:
|
data/Rakefile
CHANGED
data/lib/pt_testcase.rb
CHANGED
@@ -77,7 +77,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def self.add_19tests name, hash
|
80
|
-
add_tests "#{name}
|
80
|
+
add_tests "#{name}__19_20_21_22_23_24_25_26_27", hash # HACK?
|
81
81
|
end
|
82
82
|
|
83
83
|
def self.add_19edgecases ruby, sexp, cases
|
@@ -102,7 +102,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
102
102
|
testcases[verbose][klass] = testcases[nonverbose][klass]
|
103
103
|
end
|
104
104
|
|
105
|
-
VER_RE = "(1[89]|2[
|
105
|
+
VER_RE = "(1[89]|2[01234567])"
|
106
106
|
|
107
107
|
def self.generate_test klass, node, data, input_name, output_name
|
108
108
|
klass.send :define_method, "test_#{node}" do
|
data/lib/sexp_matcher.rb
CHANGED
@@ -455,7 +455,7 @@ class Sexp #:nodoc:
|
|
455
455
|
# | NAME:name => name.to_sym
|
456
456
|
# UP_NAME: /[A-Z]\w*/
|
457
457
|
# NAME : /:?[\w?!=~-]+/
|
458
|
-
# CMD :
|
458
|
+
# CMD : t | k | m | atom | not? | - | any | child | include
|
459
459
|
|
460
460
|
def parse_sexp
|
461
461
|
token = next_token
|
@@ -505,7 +505,7 @@ class Sexp #:nodoc:
|
|
505
505
|
##
|
506
506
|
# A collection of allowed commands to convert into matchers.
|
507
507
|
|
508
|
-
ALLOWED = [:t, :m, :k, :atom, :not?, :-, :any].freeze
|
508
|
+
ALLOWED = [:t, :m, :k, :atom, :not?, :-, :any, :child, :include].freeze
|
509
509
|
|
510
510
|
##
|
511
511
|
# Parses a balanced command. A command is denoted by square
|
@@ -760,11 +760,8 @@ class Sexp #:nodoc:
|
|
760
760
|
# +child+.
|
761
761
|
|
762
762
|
def satisfy? o
|
763
|
-
|
764
|
-
|
765
|
-
elsif o.kind_of? Sexp
|
766
|
-
o.search_each(child).any?
|
767
|
-
end
|
763
|
+
child.satisfy?(o) ||
|
764
|
+
(o.kind_of?(Sexp) && o.search_each(child).any?)
|
768
765
|
end
|
769
766
|
|
770
767
|
def == o # :nodoc:
|
data/lib/sexp_processor.rb
CHANGED
data/test/test_sexp.rb
CHANGED
@@ -906,7 +906,7 @@ class TestChild < MatcherTestCase
|
|
906
906
|
end
|
907
907
|
|
908
908
|
def sexp
|
909
|
-
s(:x, s(:a))
|
909
|
+
s(:x, s(:b), s(:a))
|
910
910
|
end
|
911
911
|
|
912
912
|
def bad_sexp
|
@@ -926,6 +926,8 @@ class TestChild < MatcherTestCase
|
|
926
926
|
|
927
927
|
def test_satisfy_eh_by_child
|
928
928
|
assert_satisfy matcher, s(:a)
|
929
|
+
assert_satisfy matcher, sexp
|
930
|
+
refute_satisfy matcher, bad_sexp
|
929
931
|
end
|
930
932
|
end
|
931
933
|
|
@@ -1602,6 +1604,7 @@ class TestSexpMatcherParser < Minitest::Test
|
|
1602
1604
|
test_parse "not?", delay{ not?(m(/^_$/)) }, "[not? [m /^_$/]]"
|
1603
1605
|
test_parse "not2", delay{ -_ }, "[- _]"
|
1604
1606
|
test_parse "any", delay{ q(:a) | q(:b) }, "[any (a) (b)]"
|
1607
|
+
test_parse "child", delay{ child(q(:str, m(/woot/))) }, "[child (str [m /woot/])]"
|
1605
1608
|
|
1606
1609
|
test_parse "klass", delay{ q(:lit, k(Float)) }, "(lit [k Float])"
|
1607
1610
|
test_parse "const", delay{ q(:const, :Float) }, "(const :Float)"
|
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.
|
4
|
+
version: 4.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN
|
30
30
|
h7iEjga8iM1LbZUfiISZ+WrB
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2020-
|
32
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
@@ -106,16 +106,19 @@ require_paths:
|
|
106
106
|
- lib
|
107
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- - "
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '2.1'
|
112
|
+
- - "<"
|
110
113
|
- !ruby/object:Gem::Version
|
111
|
-
version: '
|
114
|
+
version: '3.1'
|
112
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
116
|
requirements:
|
114
117
|
- - ">="
|
115
118
|
- !ruby/object:Gem::Version
|
116
119
|
version: '0'
|
117
120
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.1.4
|
119
122
|
signing_key:
|
120
123
|
specification_version: 4
|
121
124
|
summary: sexp_processor branches from ParseTree bringing all the generic sexp processing
|
metadata.gz.sig
CHANGED
Binary file
|