asmrb 0.0.2.6.1.9 → 0.0.2.6.2.0

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/asmrb.rb +9 -10
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 151915b197bea335937f0343c7ad77572ac73a6d
4
- data.tar.gz: 1463da6367aba6932894de04415c1714fd012200
3
+ metadata.gz: 79a3be83135d9b7accc927496c57331b8000503f
4
+ data.tar.gz: 3552bee762676c442b75cc34c07b4357a1273c2f
5
5
  SHA512:
6
- metadata.gz: a38a19d27198ca21bdacb7a8aadb1e53437a9f1687802cacca44613877149051ac2bdd663eed9c2a71ff953dd24665512e3be45f78d861da3ab32ba877f484dd
7
- data.tar.gz: 656d66a30c6bbd441ddc3250d2bb2fd37874a6acaaa2b7ef5f831e1c6d0e1609e78f5b58691f33dd30e86771c0a82331087e556cd39abe76f876a71cfffd2b02
6
+ metadata.gz: dae555426663211d7f2e90eee12552d7463d3869e30292a9dbea3654313ec669ed8b6097b881af890320740a698037a38cd4e09ba22dbcf5d2c37b82a3051da4
7
+ data.tar.gz: ea5b941af24650381ae07ee1f38e8b4e9a546e6693c77f41849fcbaf8f4dada9c61623f23e7568de5bd4c2c744caa41cbdb5080241ce3279f2f7d5cf532eda87
data/lib/asmrb.rb CHANGED
@@ -270,7 +270,7 @@ class Asmrb
270
270
  },
271
271
 
272
272
  "pop" => lambda {|val|
273
- @variables[val] = @stack.pop
273
+ @stack.pop
274
274
  },
275
275
 
276
276
  "psh" => lambda {|src|
@@ -294,7 +294,7 @@ class Asmrb
294
294
 
295
295
  "dbg" => lambda {
296
296
  puts "#{@stack} > #{@program[@pc][0]}".light_green
297
- #binding.pry if @is_debug
297
+ binding.pry if @is_debug
298
298
  },
299
299
 
300
300
  "inv" => lambda { |obj, f|
@@ -528,7 +528,7 @@ class Asmrb
528
528
  end
529
529
 
530
530
  OPCODES = {
531
- :dbg => lambda {|_|},
531
+ :dbg => lambda {"binding.pry"},
532
532
  :req => lambda {|_|},
533
533
 
534
534
  :map => lambda {|op| "#{@compile_stack}.map &:#{op}" },
@@ -609,6 +609,7 @@ class Asmrb
609
609
  }
610
610
  end
611
611
 
612
+ # demo for testing
612
613
  # @x = Asmrb.new do
613
614
  # fun :play
614
615
  # arg :toy
@@ -660,7 +661,7 @@ end
660
661
  # # applying: argumented block ( lambda )
661
662
  # # should be "inline block" technique also,
662
663
  # # to improve performance and local variable sharing.
663
- # @y = Asmrb.new do
664
+ # @f = Asmrb.new do
664
665
  # fun :factorial
665
666
  # arg :acc, :n
666
667
  # los :n, 1
@@ -681,9 +682,7 @@ end
681
682
  # exi # no return yet, because return doesn't mean anything inside a block. we can't escape.
682
683
  # end
683
684
 
684
- # @y.all_opcodes
685
- # test = @y.to_ruby
686
- #puts test
687
- #eval test
688
- #puts "Start test:"
689
- #y = factorial 1, 1000
685
+ # source = @f.to_ruby
686
+ # puts source
687
+ # eval source
688
+ # factorial 1, 3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asmrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.6.1.9
4
+ version: 0.0.2.6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Trung