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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59db6864bb21ae55d428724e2b8b99a3098c00309a8ccdfb8e8cc05dabb82021
4
- data.tar.gz: 80a9a79d9ef68f29d1f9ee0ba5ba0259557b86aaa693fd0f06f70e7524c195b0
3
+ metadata.gz: 13decb62dc5a9e3ad356a489225d2aa3f36dab3ef63e29db89edda32ac60a04d
4
+ data.tar.gz: 39e9ff2e73bd2f69cdd5c1e7cd98d3da3e7c03c40657092533c8b82279031617
5
5
  SHA512:
6
- metadata.gz: b9a2677646cf9d7725d7ad05bb6270c0261668367e705dd22e898adb5021999ebf152e8a5d72bab167f1db3705e9b5dbb4e6d07d3bb0597382c0134626c00894
7
- data.tar.gz: c074793315c71fddfa9063eb28475fd205ef479c5049be668e47be4605144a7a0be36b421eb8e432f8a5f34e45089d61be947ee05ce0e352e11af7c213ae299c
6
+ metadata.gz: 2ca2ac2f02fd90558435f7631f0f995c6cdea2ed8ac7d0b28508e3df3f252613e75dcd194dc97a71c76391cd961251f8ad55a58ab78278caf18df31ed058d3a5
7
+ data.tar.gz: 5351c69b957632396798faae6f7d86eeb2cddbe499b017d3e44bb24e7feda951052d0d94031615b6a0bbee5de522ada528a75bb62ac4d43d40b2929304b76b94
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
@@ -11,7 +11,7 @@ Hoe.add_include_dirs("../../ruby_parser/dev/lib")
11
11
  Hoe.spec 'sexp_processor' do
12
12
  developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
13
13
 
14
- require_ruby_version "~> 2.2"
14
+ require_ruby_version [">= 2.1", "< 3.1"]
15
15
 
16
16
  license "MIT"
17
17
  end
@@ -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}__19_20_21_22_23_24_25_26", hash # HACK?
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[0123456])"
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
@@ -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 : "t" | "k" | "m" | "atom" | "not?" | "-" | "any"
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
- if child.satisfy? o
764
- true
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:
@@ -34,7 +34,7 @@ require "sexp"
34
34
  class SexpProcessor
35
35
 
36
36
  # duh
37
- VERSION = "4.14.1"
37
+ VERSION = "4.15.1"
38
38
 
39
39
  ##
40
40
  # Automatically shifts off the Sexp type before handing the
@@ -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.14.1
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-02-09 00:00:00.000000000 Z
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: '2.2'
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.0.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