ruby2c 1.1.1 → 1.1.2

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: 48c5fa6b1d9d0ad39fe767091b224848115e582c4c5ede88513206abdcb826da
4
- data.tar.gz: 698eddd47e434821160d610cf40ec9924eb0d7e70164cb94420e2eeff3ad86c9
3
+ metadata.gz: edfaadeab8599e6487d84d804fea2cb404d6fb1230155dfa0214dab0ed7e780a
4
+ data.tar.gz: f5fa1639e67da38cbf1bc8bd30ce96639f22530d814d899040b958698408efcb
5
5
  SHA512:
6
- metadata.gz: 5a8e9c38b1f1bd38e672400a540d5970fa44e0e369ad3549d0987333a7cae702b218a4d3b43a3de4d5dbb2c1dd30f71659e091080e45ef89982a4ff44428e5c6
7
- data.tar.gz: 5475db786970e48b1b5fa1d61129a7c1147d7e29f5e3ed5d4716facdf43bace6f329899d6498ce15bc1d90b9fed05c5c79b1456ca293d4b4cb6121478648e55f
6
+ metadata.gz: 58d332bc3da77815ddca5b070c31e4c259b2abf90248f19df8ab6fc1aca2968f1fd0468d767c1ed864510cb122c02915cde9b990ebe512783765ece55d96c757
7
+ data.tar.gz: b24c9fbe26bfec9816f2f5486aa20e095dfc9c86fa0f24144ba5b37980908b24fb20fc62d37a66cdd0e24a397bc486ce47134bca2fe6e70080b7d1d8812d67d2
checksums.yaml.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  === 1.1.1 / 2022-12-03
2
11
 
3
12
  * 2 bug fixes:
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"
@@ -20,7 +20,7 @@ require 'r2cenvironment'
20
20
 
21
21
  class RubyToAnsiC < SexpProcessor
22
22
 
23
- VERSION = '1.1.1'
23
+ VERSION = '1.1.2'
24
24
 
25
25
  # TODO: remove me
26
26
  def no(exp) # :nodoc:
@@ -477,7 +477,7 @@ typedef char * str;
477
477
  # TODO: figure out array issues and clean up.
478
478
 
479
479
  def process_lasgn(exp) # TODO: audit against obfuscator
480
- out = ""
480
+ out = []
481
481
 
482
482
  var = exp.shift
483
483
  value = exp.shift
@@ -508,9 +508,7 @@ typedef char * str;
508
508
  out << "#{var} = #{process args}"
509
509
  end
510
510
 
511
- out.sub!(/;\n\Z/, '')
512
-
513
- return out
511
+ out.join.sub(/;\n\Z/, '')
514
512
  end
515
513
 
516
514
  ##
@@ -648,7 +646,7 @@ typedef char * str;
648
646
  result = yield
649
647
  @env.current.sort_by { |v,_| v.to_s }.each do |var, (type,val)|
650
648
  next if outer_scope.include? var
651
- decl = "#{self.class.c_type type} #{var}"
649
+ decl = ["#{self.class.c_type type} #{var}"]
652
650
  case val
653
651
  when nil then
654
652
  # do nothing
@@ -658,7 +656,7 @@ typedef char * str;
658
656
  decl << " = #{val}"
659
657
  end
660
658
  decl << ';'
661
- declarations << decl
659
+ declarations << decl.join
662
660
  end
663
661
  end
664
662
 
@@ -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!(/;\n\Z/, '')
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! '(', '(VALUE self, '
317
+ c_args = c_args.sub '(', '(VALUE self, '
320
318
  end
321
319
  end
322
320
 
data/lib/type.rb CHANGED
@@ -136,9 +136,9 @@ class CType
136
136
  end
137
137
 
138
138
  def to_s
139
- str = "Type.#{self.type.contents}"
139
+ str = ["Type.#{self.type.contents}"]
140
140
  str << "_list" if self.list?
141
- str
141
+ str.join
142
142
  end
143
143
 
144
144
  def inspect
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 << ".line(#{line})" if line && ENV["VERBOSE"]
51
+ nnd += ".line(#{line})" if line && ENV["VERBOSE"]
52
52
  "t(#{sexp_str}#{c_type_str}#{nnd}"
53
53
  end
54
54
 
data.tar.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- j�� k���ƣ�lM���ֶv�_MŖ.�|$����r������C��4N%4�C48@���7Wa�������d��[ Pq #O֊,}���%�F�����'%�@��h"4���u"Vw��Ŧ���T��^����]
2
- ��|ʽ��u0��}����V��g>�C��|1ΩGEx0l{bTbqF�̋꘠i���~@L�$I�&�(iL`�RGn�.��� KZ�P�`f�1��[jprCY�f�y
1
+ �� �v�*Aq��t?!n��!#~TK��>��}@�����%�� �;�e��nttm
2
+ ��-�_������{Mgts<����Y�܏�p��B�;jYG?�w6P"&�W2����@3.�at�;��fȝXzfoQQ;ߜH���.�Z9�Ȏ
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -11,9 +11,9 @@ bindir: bin
11
11
  cert_chain:
12
12
  - |
13
13
  -----BEGIN CERTIFICATE-----
14
- MIIDPjCCAiagAwIBAgIBBjANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
+ MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
15
15
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
16
- GRYDY29tMB4XDTIxMTIyMzIzMTkwNFoXDTIyMTIyMzIzMTkwNFowRTETMBEGA1UE
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
- AQCKB5jfsuSnKb+t/Wrh3UpdkmX7TrEsjVmERC0pPqzQ5GQJgmEXDD7oMgaKXaAq
27
- x2m+KSZDrqk7c8uho5OX6YMqg4KdxehfSLqqTZGoeV78qwf/jpPQZKTf+W9gUSJh
28
- zsWpo4K50MP+QtdSbKXZwjAafpQ8hK0MnnZ/aeCsW9ov5vdXpYbf3dpg6ADXRGE7
29
- lQY2y1tJ5/chqu6h7dQmnm2ABUqx9O+JcN9hbCYoA5i/EeubUEtFIh2w3SpO6YfB
30
- JFmxn4h9YO/pVdB962BdBNNDia0kgIjI3ENnkLq0dKpYU3+F3KhEuTksLO0L6X/V
31
- YsuyUzsMz6GQA4khyaMgKNSD
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: 2022-12-03 00:00:00.000000000 Z
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: '3.25'
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: '3.25'
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 !
@@ -168,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
182
  - !ruby/object:Gem::Version
169
183
  version: '0'
170
184
  requirements: []
171
- rubygems_version: 3.3.12
185
+ rubygems_version: 3.5.18
172
186
  signing_key:
173
187
  specification_version: 4
174
188
  summary: ruby_to_c translates a static ruby subset to C
metadata.gz.sig CHANGED
Binary file