akaza 0.3.1 → 0.3.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fc15f4ef3206316ff8442860cfdf299df509950c1c0e0fcd0b9d18d3a9fefaa
4
- data.tar.gz: 3b469607be6b9140e53ce6fc5262e0d627f60aefaf41678b460e0caf5b7da330
3
+ metadata.gz: dd7d9b53c61bf10ebaa6a27c85a9c1f37c8cf20992527697d7473d7cbb057f45
4
+ data.tar.gz: 5dc0570cea14d5d99a68cf166ed2104f07a60f6836914edf0a168aa42483e859
5
5
  SHA512:
6
- metadata.gz: 6037c290d1c51de1d5a0b540af8a4790d4548f2ed76d16e2284e570d5287890804f19e5138967a04d5f7684a740331db3e70d41a5ab49cdeb244992211839ae6
7
- data.tar.gz: c7c80cc6cc76a324deecdea9f715898cc0f9a44c33954ce005217bee56cab71001cec3e4551531ab464fc45367734535b4d3f0952516a28315233cdbf3dfaa8f
6
+ metadata.gz: 2d385ac18963a2f209075be36bbc6845a0b00500a1feff7d38b8ce2834804c9feaafb02526737737a5a08e4470b50adb8b5e6f5e4d7fe4cb16a724e34b7d08bf
7
+ data.tar.gz: 51e6f66a46fb278262548638cf696337ede8f3e925247380f3ed1faaafe34607b4de17b78b07c1b0b770f5e94ba4731e5415f775243016b36466ad410157991f
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.7.0
4
+ - ruby-head
@@ -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'
@@ -220,17 +220,17 @@ module Akaza
220
220
  commands = []
221
221
 
222
222
  case node
223
- in [:FCALL, :put_as_number, [:ARRAY, arg, nil]]
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, [:ARRAY, arg, nil]]
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, [:ARRAY, [:STR, str], nil]]
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, :==, [:ARRAY, r, nil]]
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, :!=, [:ARRAY, r, nil]]
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, [:ARRAY, r, nil]]
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, [:ARRAY, *args, nil]]
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, :[]=, [:ARRAY, index, value, nil]]
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, [:ARRAY, *args, nil]]
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?, [:ARRAY, klass, nil]]
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, [:ARRAY, *args, nil]]
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 [:ARRAY, *items, nil]
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 [:ZARRAY]
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, [:ARRAY, *pairs, nil]]
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], :==, [:ARRAY, x, nil]]
736
+ in [:OPCALL, [:LIT, 0], :==, [:LIST, x, nil]]
737
737
  optimized_body.(x, :flow_jump_if_zero)
738
- in [:OPCALL, x, :==, [:ARRAY, [:LIT, 0], nil]]
738
+ in [:OPCALL, x, :==, [:LIST, [:LIT, 0], nil]]
739
739
  optimized_body.(x, :flow_jump_if_zero)
740
- in [:OPCALL, x, :<, [:ARRAY, [:LIT, 0], nil]]
740
+ in [:OPCALL, x, :<, [:LIST, [:LIT, 0], nil]]
741
741
  optimized_body.(x, :flow_jump_if_neg)
742
- in [:OPCALL, [:LIT, 0], :<, [:ARRAY, x, nil]]
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, [:ARRAY, *objs, nil], body, _]
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], :==, [:ARRAY, x, nil]]
846
+ in [:OPCALL, [:LIT, 0], :==, [:LIST, x, nil]]
847
847
  make_body.(x, :flow_jump_if_zero)
848
- in [:OPCALL, x, :==, [:ARRAY, [:LIT, 0], nil]]
848
+ in [:OPCALL, x, :==, [:LIST, [:LIT, 0], nil]]
849
849
  make_body.(x, :flow_jump_if_zero)
850
- in [:OPCALL, x, :<, [:ARRAY, [:LIT, 0], nil]]
850
+ in [:OPCALL, x, :<, [:LIST, [:LIT, 0], nil]]
851
851
  make_body.(x, :flow_jump_if_neg)
852
- in [:OPCALL, [:LIT, 0], :<, [:ARRAY, x, nil]]
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{@2}
1700
+ @lvars_stack << addr_table.map{_2}
1701
1701
  lvars << variable_name_to_addr(:self)
1702
1702
  commands
1703
1703
  end
@@ -1,3 +1,3 @@
1
1
  module Akaza
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
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.1
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: []