akaza 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/akaza.gemspec +2 -2
- data/lib/akaza/ruby2ws.rb +24 -24
- data/lib/akaza/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd7d9b53c61bf10ebaa6a27c85a9c1f37c8cf20992527697d7473d7cbb057f45
|
4
|
+
data.tar.gz: 5dc0570cea14d5d99a68cf166ed2104f07a60f6836914edf0a168aa42483e859
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d385ac18963a2f209075be36bbc6845a0b00500a1feff7d38b8ce2834804c9feaafb02526737737a5a08e4470b50adb8b5e6f5e4d7fe4cb16a724e34b7d08bf
|
7
|
+
data.tar.gz: 51e6f66a46fb278262548638cf696337ede8f3e925247380f3ed1faaafe34607b4de17b78b07c1b0b770f5e94ba4731e5415f775243016b36466ad410157991f
|
data/.travis.yml
ADDED
data/akaza.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Masataka Pocke Kuwabara"]
|
9
9
|
spec.email = ["kuwabara@pocke.me"]
|
10
10
|
|
11
|
-
spec.summary = %q{}
|
12
|
-
spec.description = %q{}
|
11
|
+
spec.summary = %q{A cool Whitespace language implementation in Ruby.}
|
12
|
+
spec.description = %q{A cool Whitespace language implementation in Ruby.}
|
13
13
|
spec.homepage = "https://github.com/pocke/akaza"
|
14
14
|
|
15
15
|
spec.license = 'CC-0-1.0'
|
data/lib/akaza/ruby2ws.rb
CHANGED
@@ -220,17 +220,17 @@ module Akaza
|
|
220
220
|
commands = []
|
221
221
|
|
222
222
|
case node
|
223
|
-
in [:FCALL, :put_as_number, [:
|
223
|
+
in [:FCALL, :put_as_number, [:LIST, arg, nil]]
|
224
224
|
commands.concat(compile_expr(arg))
|
225
225
|
commands.concat(UNWRAP_COMMANDS)
|
226
226
|
commands << [:io_write_num]
|
227
227
|
commands << [:stack_push, NIL]
|
228
|
-
in [:FCALL, :put_as_char, [:
|
228
|
+
in [:FCALL, :put_as_char, [:LIST, arg, nil]]
|
229
229
|
commands.concat(compile_expr(arg))
|
230
230
|
commands.concat(UNWRAP_COMMANDS)
|
231
231
|
commands << [:io_write_char]
|
232
232
|
commands << [:stack_push, NIL]
|
233
|
-
in [:FCALL, :raise, [:
|
233
|
+
in [:FCALL, :raise, [:LIST, [:STR, str], nil]]
|
234
234
|
commands.concat compile_raise(str, node)
|
235
235
|
in [:VCALL, :get_as_number]
|
236
236
|
commands << [:stack_push, TMP_ADDR]
|
@@ -244,11 +244,11 @@ module Akaza
|
|
244
244
|
commands << [:stack_push, TMP_ADDR]
|
245
245
|
commands << [:heap_load]
|
246
246
|
commands.concat(WRAP_NUMBER_COMMANDS)
|
247
|
-
in [:OPCALL, l, :==, [:
|
247
|
+
in [:OPCALL, l, :==, [:LIST, r, nil]]
|
248
248
|
commands.concat compile_expr(l)
|
249
249
|
commands.concat compile_expr(r)
|
250
250
|
commands << [:flow_call, op_eqeq_label]
|
251
|
-
in [:OPCALL, l, :!=, [:
|
251
|
+
in [:OPCALL, l, :!=, [:LIST, r, nil]]
|
252
252
|
commands.concat compile_expr(l)
|
253
253
|
commands.concat compile_expr(r)
|
254
254
|
commands << [:flow_call, op_eqeq_label]
|
@@ -256,7 +256,7 @@ module Akaza
|
|
256
256
|
in [:OPCALL, recv, :!, nil]
|
257
257
|
commands.concat compile_expr(recv)
|
258
258
|
commands << [:flow_call, op_not_label]
|
259
|
-
in [:OPCALL, l, :+ | :- | :* | :/ | :% => sym, [:
|
259
|
+
in [:OPCALL, l, :+ | :- | :* | :/ | :% => sym, [:LIST, r, nil]]
|
260
260
|
com = {'+': :calc_add, '-': :calc_sub, '*': :calc_multi, '/': :calc_div, '%': :calc_mod}[sym]
|
261
261
|
commands.concat(compile_expr(l))
|
262
262
|
commands.concat(UNWRAP_COMMANDS)
|
@@ -264,7 +264,7 @@ module Akaza
|
|
264
264
|
commands.concat(UNWRAP_COMMANDS)
|
265
265
|
commands << [com]
|
266
266
|
commands.concat(WRAP_NUMBER_COMMANDS)
|
267
|
-
in [:OPCALL, recv, op, [:
|
267
|
+
in [:OPCALL, recv, op, [:LIST, *args, nil]]
|
268
268
|
commands.concat compile_expr(recv)
|
269
269
|
commands.concat compile_call_with_recv(op, args, error_target_node: recv, explicit_self: true)
|
270
270
|
in [:VCALL, :exit]
|
@@ -283,7 +283,7 @@ module Akaza
|
|
283
283
|
commands << [:stack_push, var_addr]
|
284
284
|
commands << [:stack_swap]
|
285
285
|
commands << [:heap_save]
|
286
|
-
in [:ATTRASGN, recv, :[]=, [:
|
286
|
+
in [:ATTRASGN, recv, :[]=, [:LIST, index, value, nil]]
|
287
287
|
commands.concat compile_expr(recv)
|
288
288
|
commands.concat compile_call_with_recv(:[]=, [index, value], error_target_node: node, explicit_self: true)
|
289
289
|
in [:DEFN, name, [:SCOPE, lvar_table, [:ARGS, args_count ,*_], body]]
|
@@ -319,11 +319,11 @@ module Akaza
|
|
319
319
|
commands << [:stack_push, variable_name_to_addr(:self)]
|
320
320
|
commands << [:heap_load]
|
321
321
|
commands.concat compile_call_with_recv(name, [], error_target_node: node, explicit_self: false)
|
322
|
-
in [:FCALL, name, [:
|
322
|
+
in [:FCALL, name, [:LIST, *args, nil]]
|
323
323
|
commands << [:stack_push, variable_name_to_addr(:self)]
|
324
324
|
commands << [:heap_load]
|
325
325
|
commands.concat compile_call_with_recv(name, args, error_target_node: node, explicit_self: false)
|
326
|
-
in [:CALL, recv, :is_a?, [:
|
326
|
+
in [:CALL, recv, :is_a?, [:LIST, klass, nil]]
|
327
327
|
true_label = ident_to_label(nil)
|
328
328
|
end_label = ident_to_label(nil)
|
329
329
|
commands.concat compile_expr(recv)
|
@@ -344,7 +344,7 @@ module Akaza
|
|
344
344
|
commands << [:stack_push, TRUE]
|
345
345
|
|
346
346
|
commands << [:flow_def, end_label]
|
347
|
-
in [:CALL, recv, name, [:
|
347
|
+
in [:CALL, recv, name, [:LIST, *args, nil]]
|
348
348
|
commands.concat compile_expr(recv)
|
349
349
|
commands.concat compile_call_with_recv(name, args, error_target_node: recv, explicit_self: true)
|
350
350
|
in [:CALL, recv, name, nil]
|
@@ -384,7 +384,7 @@ module Akaza
|
|
384
384
|
in [:CONST, name]
|
385
385
|
commands << [:stack_push, variable_name_to_addr(name)]
|
386
386
|
commands << [:heap_load]
|
387
|
-
in [:
|
387
|
+
in [:LIST, *items, nil]
|
388
388
|
commands.concat allocate_array_commands(items.size)
|
389
389
|
# stack: [array]
|
390
390
|
|
@@ -405,12 +405,12 @@ module Akaza
|
|
405
405
|
end
|
406
406
|
commands << [:stack_pop]
|
407
407
|
|
408
|
-
in [:
|
408
|
+
in [:ZLIST]
|
409
409
|
# Allocate array ref
|
410
410
|
commands.concat allocate_array_commands(0)
|
411
411
|
in [:HASH, nil]
|
412
412
|
commands.concat initialize_hash
|
413
|
-
in [:HASH, [:
|
413
|
+
in [:HASH, [:LIST, *pairs, nil]]
|
414
414
|
commands.concat initialize_hash
|
415
415
|
commands << [:stack_dup]
|
416
416
|
commands.concat UNWRAP_COMMANDS
|
@@ -733,13 +733,13 @@ module Akaza
|
|
733
733
|
end
|
734
734
|
|
735
735
|
case cond
|
736
|
-
in [:OPCALL, [:LIT, 0], :==, [:
|
736
|
+
in [:OPCALL, [:LIT, 0], :==, [:LIST, x, nil]]
|
737
737
|
optimized_body.(x, :flow_jump_if_zero)
|
738
|
-
in [:OPCALL, x, :==, [:
|
738
|
+
in [:OPCALL, x, :==, [:LIST, [:LIT, 0], nil]]
|
739
739
|
optimized_body.(x, :flow_jump_if_zero)
|
740
|
-
in [:OPCALL, x, :<, [:
|
740
|
+
in [:OPCALL, x, :<, [:LIST, [:LIT, 0], nil]]
|
741
741
|
optimized_body.(x, :flow_jump_if_neg)
|
742
|
-
in [:OPCALL, [:LIT, 0], :<, [:
|
742
|
+
in [:OPCALL, [:LIT, 0], :<, [:LIST, x, nil]]
|
743
743
|
optimized_body.(x, :flow_jump_if_neg)
|
744
744
|
else
|
745
745
|
if_label = ident_to_label(nil)
|
@@ -783,7 +783,7 @@ module Akaza
|
|
783
783
|
|
784
784
|
first_when.each_when do |when_node|
|
785
785
|
case when_node
|
786
|
-
in [:WHEN, [:
|
786
|
+
in [:WHEN, [:LIST, *objs, nil], body, _]
|
787
787
|
bodies << body
|
788
788
|
body_labels << ident_to_label(nil)
|
789
789
|
|
@@ -843,13 +843,13 @@ module Akaza
|
|
843
843
|
commands.concat compile_expr(body)
|
844
844
|
commands << [:stack_pop]
|
845
845
|
commands << [:flow_jump, cond_label]
|
846
|
-
in [:OPCALL, [:LIT, 0], :==, [:
|
846
|
+
in [:OPCALL, [:LIT, 0], :==, [:LIST, x, nil]]
|
847
847
|
make_body.(x, :flow_jump_if_zero)
|
848
|
-
in [:OPCALL, x, :==, [:
|
848
|
+
in [:OPCALL, x, :==, [:LIST, [:LIT, 0], nil]]
|
849
849
|
make_body.(x, :flow_jump_if_zero)
|
850
|
-
in [:OPCALL, x, :<, [:
|
850
|
+
in [:OPCALL, x, :<, [:LIST, [:LIT, 0], nil]]
|
851
851
|
make_body.(x, :flow_jump_if_neg)
|
852
|
-
in [:OPCALL, [:LIT, 0], :<, [:
|
852
|
+
in [:OPCALL, [:LIT, 0], :<, [:LIST, x, nil]]
|
853
853
|
make_body.(x, :flow_jump_if_neg)
|
854
854
|
else
|
855
855
|
commands << [:flow_def, cond_label]
|
@@ -1697,7 +1697,7 @@ module Akaza
|
|
1697
1697
|
commands << [:stack_push, NIL]
|
1698
1698
|
commands << [:heap_save]
|
1699
1699
|
end
|
1700
|
-
@lvars_stack << addr_table.map{
|
1700
|
+
@lvars_stack << addr_table.map{_2}
|
1701
1701
|
lvars << variable_name_to_addr(:self)
|
1702
1702
|
commands
|
1703
1703
|
end
|
data/lib/akaza/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akaza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
69
|
+
description: A cool Whitespace language implementation in Ruby.
|
70
70
|
email:
|
71
71
|
- kuwabara@pocke.me
|
72
72
|
executables:
|
@@ -75,6 +75,7 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
78
79
|
- Gemfile
|
79
80
|
- LICENSE
|
80
81
|
- README.md
|
@@ -117,5 +118,5 @@ requirements: []
|
|
117
118
|
rubygems_version: 3.1.2
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
|
-
summary:
|
121
|
+
summary: A cool Whitespace language implementation in Ruby.
|
121
122
|
test_files: []
|