ruby2c 1.1.0 → 1.1.2
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.txt +16 -0
- data/Rakefile +4 -0
- data/lib/crewriter.rb +2 -2
- data/lib/rewriter.rb +4 -0
- data/lib/ruby_to_ansi_c.rb +9 -7
- data/lib/ruby_to_ruby_c.rb +3 -5
- data/lib/type.rb +2 -2
- data/lib/type_checker.rb +4 -0
- data/lib/typed_sexp.rb +1 -1
- data/test/r2ctestcase.rb +1 -1
- data.tar.gz.sig +2 -1
- metadata +32 -17
- 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: edfaadeab8599e6487d84d804fea2cb404d6fb1230155dfa0214dab0ed7e780a
|
4
|
+
data.tar.gz: f5fa1639e67da38cbf1bc8bd30ce96639f22530d814d899040b958698408efcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58d332bc3da77815ddca5b070c31e4c259b2abf90248f19df8ab6fc1aca2968f1fd0468d767c1ed864510cb122c02915cde9b990ebe512783765ece55d96c757
|
7
|
+
data.tar.gz: b24c9fbe26bfec9816f2f5486aa20e095dfc9c86fa0f24144ba5b37980908b24fb20fc62d37a66cdd0e24a397bc486ce47134bca2fe6e70080b7d1d8812d67d2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
=== 1.1.2 / 2024-11-11
|
2
|
+
|
3
|
+
* 4 bug fixes:
|
4
|
+
|
5
|
+
* Added license declaration to gemspec.
|
6
|
+
* Added racc as development dependency + isolate plugin.
|
7
|
+
* Fix errors created when string literals are frozen (in 2.7 only??).
|
8
|
+
* Fix errors created when string literals are frozen.
|
9
|
+
|
10
|
+
=== 1.1.1 / 2022-12-03
|
11
|
+
|
12
|
+
* 2 bug fixes:
|
13
|
+
|
14
|
+
* Added support for 3.0 parser
|
15
|
+
* Used ParseTreeTestCase#TEST_SUFFIX to make this always work when new versions added.
|
16
|
+
|
1
17
|
=== 1.1.0 / 2019-09-24
|
2
18
|
|
3
19
|
* 4 minor enhancements:
|
data/Rakefile
CHANGED
@@ -10,13 +10,17 @@ Hoe.add_include_dirs("../../ParseTree/dev/test",
|
|
10
10
|
"lib")
|
11
11
|
|
12
12
|
Hoe.plugin :seattlerb
|
13
|
+
Hoe.plugin :isolate
|
13
14
|
|
14
15
|
Hoe.spec "ruby2c" do
|
15
16
|
developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
|
16
17
|
developer 'Eric Hodel', 'drbrain@segment7.net'
|
17
18
|
|
19
|
+
license "MIT"
|
20
|
+
|
18
21
|
dependency "ruby_parser", "~> 3.0"
|
19
22
|
dependency "sexp_processor", "~> 4.1"
|
23
|
+
dependency "racc", ">0", :development
|
20
24
|
end
|
21
25
|
|
22
26
|
ENV["MT_NO_EXPECTATIONS"] = "1"
|
data/lib/crewriter.rb
CHANGED
data/lib/rewriter.rb
CHANGED
data/lib/ruby_to_ansi_c.rb
CHANGED
@@ -20,7 +20,7 @@ require 'r2cenvironment'
|
|
20
20
|
|
21
21
|
class RubyToAnsiC < SexpProcessor
|
22
22
|
|
23
|
-
VERSION = '1.1.
|
23
|
+
VERSION = '1.1.2'
|
24
24
|
|
25
25
|
# TODO: remove me
|
26
26
|
def no(exp) # :nodoc:
|
@@ -133,6 +133,10 @@ typedef char * str;
|
|
133
133
|
@prototypes = []
|
134
134
|
end
|
135
135
|
|
136
|
+
def process exp, _src = nil, _timeout = nil
|
137
|
+
super(exp)
|
138
|
+
end
|
139
|
+
|
136
140
|
##
|
137
141
|
# Logical And. Nothing exciting here
|
138
142
|
|
@@ -473,7 +477,7 @@ typedef char * str;
|
|
473
477
|
# TODO: figure out array issues and clean up.
|
474
478
|
|
475
479
|
def process_lasgn(exp) # TODO: audit against obfuscator
|
476
|
-
out =
|
480
|
+
out = []
|
477
481
|
|
478
482
|
var = exp.shift
|
479
483
|
value = exp.shift
|
@@ -504,9 +508,7 @@ typedef char * str;
|
|
504
508
|
out << "#{var} = #{process args}"
|
505
509
|
end
|
506
510
|
|
507
|
-
out.sub
|
508
|
-
|
509
|
-
return out
|
511
|
+
out.join.sub(/;\n\Z/, '')
|
510
512
|
end
|
511
513
|
|
512
514
|
##
|
@@ -644,7 +646,7 @@ typedef char * str;
|
|
644
646
|
result = yield
|
645
647
|
@env.current.sort_by { |v,_| v.to_s }.each do |var, (type,val)|
|
646
648
|
next if outer_scope.include? var
|
647
|
-
decl = "#{self.class.c_type type} #{var}"
|
649
|
+
decl = ["#{self.class.c_type type} #{var}"]
|
648
650
|
case val
|
649
651
|
when nil then
|
650
652
|
# do nothing
|
@@ -654,7 +656,7 @@ typedef char * str;
|
|
654
656
|
decl << " = #{val}"
|
655
657
|
end
|
656
658
|
decl << ';'
|
657
|
-
declarations << decl
|
659
|
+
declarations << decl.join
|
658
660
|
end
|
659
661
|
end
|
660
662
|
|
data/lib/ruby_to_ruby_c.rb
CHANGED
@@ -172,7 +172,7 @@ class RubyToRubyC < RubyToAnsiC
|
|
172
172
|
# TODO: figure out array issues and clean up.
|
173
173
|
|
174
174
|
def process_lasgn(exp) # TODO: audit against obfuscator
|
175
|
-
out =
|
175
|
+
out = []
|
176
176
|
|
177
177
|
var = exp.shift
|
178
178
|
value = exp.shift
|
@@ -199,9 +199,7 @@ class RubyToRubyC < RubyToAnsiC
|
|
199
199
|
out << "#{var} = #{process args}"
|
200
200
|
end
|
201
201
|
|
202
|
-
out.sub
|
203
|
-
|
204
|
-
return out
|
202
|
+
out.join.sub(/;\n\Z/, '')
|
205
203
|
end
|
206
204
|
|
207
205
|
##
|
@@ -316,7 +314,7 @@ class RubyToRubyC < RubyToAnsiC
|
|
316
314
|
if c_args == '()' then
|
317
315
|
c_args = '(VALUE self)'
|
318
316
|
else
|
319
|
-
c_args.sub
|
317
|
+
c_args = c_args.sub '(', '(VALUE self, '
|
320
318
|
end
|
321
319
|
end
|
322
320
|
|
data/lib/type.rb
CHANGED
data/lib/type_checker.rb
CHANGED
data/lib/typed_sexp.rb
CHANGED
@@ -48,7 +48,7 @@ class TypedSexp < Sexp
|
|
48
48
|
sexp_str = self.map {|x|x.inspect}.join(', ')
|
49
49
|
c_type_str = (sexp_str.empty? ? "" : ", ") + "#{array_type? ? c_types.inspect : c_type}" unless c_type.nil?
|
50
50
|
nnd = ")"
|
51
|
-
nnd
|
51
|
+
nnd += ".line(#{line})" if line && ENV["VERBOSE"]
|
52
52
|
"t(#{sexp_str}#{c_type_str}#{nnd}"
|
53
53
|
end
|
54
54
|
|
data/test/r2ctestcase.rb
CHANGED
@@ -19,7 +19,7 @@ class R2CTestCase < ParseTreeTestCase
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.add_skipped_tests19 *names
|
22
|
-
add_skipped_tests names.map { |s| "#{s}
|
22
|
+
add_skipped_tests names.map { |s| "#{s}_#{TEST_SUFFIX}" }
|
23
23
|
end
|
24
24
|
|
25
25
|
testcase_order.push(*%w(Ruby ParseTree Rewriter TypeChecker
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
�� �v�*Aq��t?!n��!#~T�K��>��}@�����%�� �;�e��n�tt�m
|
2
|
+
��-�_������{Mgts<����Y��p��B�;jY�G?�w6P"&�W�2����@3.�at�;��fȝX�zf�oQQ;ߜH���.�Z�9�Ȏ
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
8
8
|
- Eric Hodel
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- |
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
|
-
|
14
|
+
MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
|
15
15
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
16
|
-
|
16
|
+
GRYDY29tMB4XDTI0MDEwMjIxMjEyM1oXDTI1MDEwMTIxMjEyM1owRTETMBEGA1UE
|
17
17
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
18
18
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
19
19
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -23,14 +23,14 @@ cert_chain:
|
|
23
23
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
24
24
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
25
25
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
AQCygvpmncmkiSs9r/Kceo4bBPDszhTv6iBi4LwMReqnFrpNLMOWJw7xi8x+3eL2
|
27
|
+
XS09ZPNOt2zm70KmFouBMgOysnDY4k2dE8uF6B8JbZOO8QfalW+CoNBliefOTcn2
|
28
|
+
bg5IOP7UoGM5lC174/cbDJrJnRG9bzig5FAP0mvsgA8zgTRXQzIUAZEo92D5K7p4
|
29
|
+
B4/O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
|
30
|
+
S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
|
31
|
+
deKfBjgVAq7EYHu1AczzlUly
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2024-11-11 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: ruby_parser
|
@@ -60,6 +60,20 @@ dependencies:
|
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '4.1'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: racc
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
63
77
|
- !ruby/object:Gem::Dependency
|
64
78
|
name: rdoc
|
65
79
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +100,14 @@ dependencies:
|
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
103
|
+
version: '4.2'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
110
|
+
version: '4.2'
|
97
111
|
description: "ruby_to_c translates a static ruby subset to C. Hopefully it works.\n\n
|
98
112
|
\ NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE\n \n THIS
|
99
113
|
IS BETA SOFTWARE!\n \n NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE ! NOTE !
|
@@ -149,8 +163,9 @@ files:
|
|
149
163
|
homepage: https://github.com/seattlerb/ruby_to_c
|
150
164
|
licenses:
|
151
165
|
- MIT
|
152
|
-
metadata:
|
153
|
-
|
166
|
+
metadata:
|
167
|
+
homepage_uri: https://github.com/seattlerb/ruby_to_c
|
168
|
+
post_install_message:
|
154
169
|
rdoc_options:
|
155
170
|
- "--main"
|
156
171
|
- README.txt
|
@@ -167,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
182
|
- !ruby/object:Gem::Version
|
168
183
|
version: '0'
|
169
184
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
171
|
-
signing_key:
|
185
|
+
rubygems_version: 3.5.18
|
186
|
+
signing_key:
|
172
187
|
specification_version: 4
|
173
188
|
summary: ruby_to_c translates a static ruby subset to C
|
174
189
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|