sexp_processor 4.16.1 → 4.17.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/History.rdoc +19 -0
- data/Rakefile +1 -1
- data/lib/pt_testcase.rb +3 -3
- data/lib/sexp.rb +8 -2
- data/lib/sexp_processor.rb +1 -1
- data/lib/strict_sexp.rb +6 -5
- data.tar.gz.sig +0 -0
- metadata +14 -14
- 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: 84e793115874bbbb3ca9d8970dff4d549d2d6c34b7e92ced84f04bc397e1c8fa
|
4
|
+
data.tar.gz: 9cced0bc88ebba617ec5ac8503f885df9e3d31a594e52d40c2013b1a69bb035d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ce5adc11c8dd07cfabeccf433fe560687f8a75aa61e5917e46be45cef28f9fbefbf952c4b1a83fdfcc8dcf9a66fec72dda9cc0ca8cc638159d9c689d966920a
|
7
|
+
data.tar.gz: 8b6b690cc7ed1428fd82cf6ccf4b9110bc3aa68dd7724affff8d91824667b5dcbcf7b625a28677a2c0d80fb228704928b52b2e76a481007feeca65069a244def
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
=== 4.17.1 / 2024-01-15
|
2
|
+
|
3
|
+
* 1 minor enhancement:
|
4
|
+
|
5
|
+
* Added 3.3 to pt_testcase.rb
|
6
|
+
|
7
|
+
=== 4.17.0 / 2023-05-03
|
8
|
+
|
9
|
+
* 2 minor enhancements:
|
10
|
+
|
11
|
+
* Added Sexp#line_max=.
|
12
|
+
* Will load strict_sexp if $SP_DEBUG is set.
|
13
|
+
|
14
|
+
* 3 bug fixes:
|
15
|
+
|
16
|
+
* Sexp#line_max lazy accessor now compacts.
|
17
|
+
* Sexp#new copies line_max if defined.
|
18
|
+
* strict_sexp.rb: #first can take an int arg. Fixed mutator wrappers to pass args.
|
19
|
+
|
1
20
|
=== 4.16.1 / 2022-04-09
|
2
21
|
|
3
22
|
* 1 minor enhancement:
|
data/Rakefile
CHANGED
data/lib/pt_testcase.rb
CHANGED
@@ -34,7 +34,7 @@ class Examples
|
|
34
34
|
end
|
35
35
|
|
36
36
|
class ParseTreeTestCase < Minitest::Test
|
37
|
-
all_versions = %w[18 19 20 21 22 23 24 25 26 27 30 31]
|
37
|
+
all_versions = %w[18 19 20 21 22 23 24 25 26 27 30 31 32 33]
|
38
38
|
most_versions = all_versions.drop(1)
|
39
39
|
|
40
40
|
TEST_SUFFIX = "_#{most_versions.join "_"}"
|
@@ -1072,7 +1072,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
1072
1072
|
"Ruby2Ruby" => "-(2 ** 31)")
|
1073
1073
|
|
1074
1074
|
add_tests("case",
|
1075
|
-
"Ruby" => "var = 2\nresult = \"\"\ncase var\nwhen 1 then\n puts(\"something\")\n result = \"red\"\nwhen 2, 3 then\n result = \"yellow\"\nwhen 4 then\n # do nothing\nelse\n result = \"green\"\nend\ncase result\nwhen \"red\" then\n var = 1\nwhen \"yellow\" then\n var = 2\nwhen \"green\" then\n var = 3\
|
1075
|
+
"Ruby" => "var = 2\nresult = \"\"\ncase var\nwhen 1 then\n puts(\"something\")\n result = \"red\"\nwhen 2, 3 then\n result = \"yellow\"\nwhen 4 then\n # do nothing\nelse\n result = \"green\"\nend\ncase result\nwhen \"red\" then\n var = 1\nwhen \"yellow\" then\n var = 2\nwhen \"green\" then\n var = 3\nend\n",
|
1076
1076
|
"ParseTree" => s(:block,
|
1077
1077
|
s(:lasgn, :var, s(:lit, 2)),
|
1078
1078
|
s(:lasgn, :result, s(:str, "")),
|
@@ -1124,7 +1124,7 @@ class ParseTreeTestCase < Minitest::Test
|
|
1124
1124
|
s(:lasgn, :result, s(:lit, 7)))))
|
1125
1125
|
|
1126
1126
|
add_tests("case_nested_inner_no_expr",
|
1127
|
-
"Ruby" => "case a\nwhen b then\n case\n when (d and e) then\n f\n
|
1127
|
+
"Ruby" => "case a\nwhen b then\n case\n when (d and e) then\n f\n end\nend",
|
1128
1128
|
"ParseTree" => s(:case, s(:call, nil, :a),
|
1129
1129
|
s(:when,
|
1130
1130
|
s(:array, s(:call, nil, :b)),
|
data/lib/sexp.rb
CHANGED
@@ -12,6 +12,11 @@ class Sexp < Array # ZenTest FULL
|
|
12
12
|
|
13
13
|
attr_writer :line
|
14
14
|
|
15
|
+
##
|
16
|
+
# Set the maximum line number for this sexp. Often set by ruby_parser.
|
17
|
+
|
18
|
+
attr_writer :line_max
|
19
|
+
|
15
20
|
##
|
16
21
|
# Accessors for the file. Usually set by ruby_parser.
|
17
22
|
|
@@ -59,6 +64,7 @@ class Sexp < Array # ZenTest FULL
|
|
59
64
|
r = self.class.new._concat(body) # ensures a sexp from map
|
60
65
|
r.file = self.file if self.file
|
61
66
|
r.line = self.line if self.line
|
67
|
+
r.line_max = self.line_max if defined?(@line_max)
|
62
68
|
r.comments = self.comments if self.comments
|
63
69
|
r
|
64
70
|
end
|
@@ -233,7 +239,7 @@ class Sexp < Array # ZenTest FULL
|
|
233
239
|
# Returns the maximum line number of the children of self.
|
234
240
|
|
235
241
|
def line_max
|
236
|
-
@line_max ||= self.deep_each.map(&:line).max
|
242
|
+
@line_max ||= self.deep_each.map(&:line).compact.max
|
237
243
|
end
|
238
244
|
|
239
245
|
##
|
@@ -388,4 +394,4 @@ def s *args, &blk
|
|
388
394
|
end
|
389
395
|
|
390
396
|
require "sexp_matcher" unless defined? Sexp::Matcher
|
391
|
-
require "strict_sexp" if ENV["STRICT_SEXP"].to_i > 0
|
397
|
+
require "strict_sexp" if ENV["SP_DEBUG"] || ENV["STRICT_SEXP"].to_i > 0
|
data/lib/sexp_processor.rb
CHANGED
data/lib/strict_sexp.rb
CHANGED
@@ -83,8 +83,9 @@ class Sexp
|
|
83
83
|
self.safe_asgn i, v
|
84
84
|
end
|
85
85
|
|
86
|
-
def first
|
87
|
-
raise "use sexp_type"
|
86
|
+
def first(n = nil)
|
87
|
+
raise "use sexp_type" unless n
|
88
|
+
super
|
88
89
|
end
|
89
90
|
|
90
91
|
nuke_method :collect!, 4
|
@@ -136,10 +137,10 @@ if ENV["SP_DEBUG"] && !ENV["STRICT_SEXP"] then
|
|
136
137
|
]
|
137
138
|
|
138
139
|
mutators.each do |method|
|
139
|
-
define_method method do
|
140
|
+
define_method method do |*args|
|
140
141
|
warn "Sexp modified by %p at %s" % [__method__, caller.first] if
|
141
|
-
|
142
|
-
super
|
142
|
+
ENV["VERBOSE"] or (defined?(@hash) and @hash)
|
143
|
+
super(*args)
|
143
144
|
end
|
144
145
|
end
|
145
146
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
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.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
|
14
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
-
|
15
|
+
GRYDY29tMB4XDTI0MDEwMjIxMjEyM1oXDTI1MDEwMTIxMjEyM1owRTETMBEGA1UE
|
16
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -22,14 +22,14 @@ cert_chain:
|
|
22
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
AQCygvpmncmkiSs9r/Kceo4bBPDszhTv6iBi4LwMReqnFrpNLMOWJw7xi8x+3eL2
|
26
|
+
XS09ZPNOt2zm70KmFouBMgOysnDY4k2dE8uF6B8JbZOO8QfalW+CoNBliefOTcn2
|
27
|
+
bg5IOP7UoGM5lC174/cbDJrJnRG9bzig5FAP0mvsgA8zgTRXQzIUAZEo92D5K7p4
|
28
|
+
B4/O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
|
29
|
+
S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
|
30
|
+
deKfBjgVAq7EYHu1AczzlUly
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rdoc
|
@@ -57,14 +57,14 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '4.2'
|
61
61
|
type: :development
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '4.2'
|
68
68
|
description: |-
|
69
69
|
sexp_processor branches from ParseTree bringing all the generic sexp
|
70
70
|
processing tools with it. Sexp, SexpProcessor, Environment, etc... all
|
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: '2.
|
111
|
+
version: '2.6'
|
112
112
|
- - "<"
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '4'
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.5.3
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: sexp_processor branches from ParseTree bringing all the generic sexp processing
|
metadata.gz.sig
CHANGED
Binary file
|