sardonyx 0.1.81 → 0.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sdx/vm/datatypes.rb +18 -20
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae3902bcee8c7322c0ead62c5c9e4f76fed8ff73c0bd326921360ff03f49f252
4
- data.tar.gz: 587f6306aa1042d1531e5ffb6b9498185252e2db2fb2855449041b557ee34ec3
3
+ metadata.gz: a384634a4bfdce5ea555978895b81d96a5d4d916375bc192a739493920d6d8bf
4
+ data.tar.gz: 38fc8ac4918a9cbbe7f3e4a06e7b053ee99132b4a49c2b434fe82384b78d2f9d
5
5
  SHA512:
6
- metadata.gz: c42b9e8cc520d5e360dd7d07314030246164034035715019fc975aa00b36e9b1be5d653d1e97380f87c0a1cce46a84a5b2d3d73a66b526a0cac689736fc7f0c4
7
- data.tar.gz: 6754b493b645962e86f18af568310f6291b3ef00ad8f6d01ef154202c29ef856187f284b85dc1bb0771d601f7e3a5258fde30ecd109a2f68e439ff2a1548ab76
6
+ metadata.gz: 6cc678adbf5ae8f5059b05934d8934e0c33e43cda2842bdf54e606238d221fba49c0133984cb7bcbe0de0a79a3cb692758c60797d3cad53732b6bc2ade48324d
7
+ data.tar.gz: 417c8e9ee3cf5cf62b3f95962712f60b72f156bd4cdbe9a685101c6df9fed101c7533be14037057481e273e5b7fb79efb57f87ea9e4f8fbbfc330b9e248dbcdf
@@ -83,22 +83,22 @@ class Int < DataType
83
83
  as_bool
84
84
  end)),
85
85
  "__add" => (NativeFnInternal.new (Proc.new do |other|
86
- add other
86
+ add other[0]
87
87
  end)),
88
88
  "__sub" => (NativeFnInternal.new (Proc.new do |other|
89
- sub other
89
+ sub other[0]
90
90
  end)),
91
91
  "__mul" => (NativeFnInternal.new (Proc.new do |other|
92
- mul other
92
+ mul other[0]
93
93
  end)),
94
94
  "__div" => (NativeFnInternal.new (Proc.new do |other|
95
- div other
95
+ div other[0]
96
96
  end)),
97
97
  "__mod" => (NativeFnInternal.new (Proc.new do |other|
98
- mod other
98
+ mod other[0]
99
99
  end)),
100
100
  "__pow" => (NativeFnInternal.new (Proc.new do |other|
101
- pow other
101
+ pow other[0]
102
102
  end))
103
103
  }
104
104
  end
@@ -149,10 +149,10 @@ class Str < DataType
149
149
  as_code_string
150
150
  end)),
151
151
  "__add" => (NativeFnInternal.new (Proc.new do |other|
152
- add other
152
+ add other[0]
153
153
  end)),
154
154
  "__mul" => (NativeFnInternal.new (Proc.new do |other|
155
- mul other
155
+ mul other[0]
156
156
  end))
157
157
  }
158
158
  end
@@ -190,22 +190,22 @@ class Num < DataType
190
190
  as_bool
191
191
  end)),
192
192
  "__add" => (NativeFnInternal.new (Proc.new do |other|
193
- add other
193
+ add other[0]
194
194
  end)),
195
195
  "__sub" => (NativeFnInternal.new (Proc.new do |other|
196
- sub other
196
+ sub other[0]
197
197
  end)),
198
198
  "__mul" => (NativeFnInternal.new (Proc.new do |other|
199
- mul other
199
+ mul other[0]
200
200
  end)),
201
201
  "__div" => (NativeFnInternal.new (Proc.new do |other|
202
- div other
202
+ div other[0]
203
203
  end)),
204
204
  "__mod" => (NativeFnInternal.new (Proc.new do |other|
205
- mod other
205
+ mod other[0]
206
206
  end)),
207
207
  "__pow" => (NativeFnInternal.new (Proc.new do |other|
208
- pow other
208
+ pow other[0]
209
209
  end))
210
210
  }
211
211
  end
@@ -272,10 +272,10 @@ class List < DataType
272
272
  iter
273
273
  end)),
274
274
  "__add" => (NativeFnInternal.new (Proc.new do |other|
275
- add other
275
+ add other[0]
276
276
  end)),
277
277
  "__mul" => (NativeFnInternal.new (Proc.new do |other|
278
- mul other
278
+ mul other[0]
279
279
  end)),
280
280
  "__arity" => (Int.new 1),
281
281
  "__call" => (NativeFnInternal.new (Proc.new do |args, scope|
@@ -285,21 +285,19 @@ class List < DataType
285
285
  end
286
286
 
287
287
  def as_string
288
- s = "["
289
288
  @internal.each do |item|
290
289
  s += (stringify item) + ", "
291
290
  end
292
- s = s[0..-3]
291
+ s = "[" + s[0..-3]
293
292
  s += "]"
294
293
  Str.new s
295
294
  end
296
295
 
297
296
  def as_code_string
298
- s = "["
299
297
  @internal.each do |item|
300
298
  s += (codify item) + ", "
301
299
  end
302
- s = s[0..-3]
300
+ s = "[" + s[0..-3]
303
301
  s += "]"
304
302
  Str.new s
305
303
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sardonyx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.81
4
+ version: 0.1.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - sugarfi