tealrb 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tealrb/if_block.rb +5 -4
- data/lib/tealrb/opcode_modules.rb +18 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e87d9c19e3fb930116e5a3a3d598140987feb20a0571b2f2fd70f1beb752b3b
|
4
|
+
data.tar.gz: 67b114fc5e032b9b9f733fb033bc619d209a4b1da4438606064f88306cd0fa2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61974eeb0c5454eb434ac0e36308c01ddc4ac51d7dfb8745a7b991e837e208589fbf9d014b47d2b66b876391052b2616ec2e26cffa1f92c0ab2e74db23fd01d4
|
7
|
+
data.tar.gz: 5f35f5248e16f6a684d3a37ab9d4a76f97f32ee24bcee43c1da7dc3082c044da1037da42a1495b3b8a1a3843d46a681f4a905b0d283ace884131b5815c60fe12
|
data/lib/tealrb/if_block.rb
CHANGED
@@ -6,16 +6,17 @@ module TEALrb
|
|
6
6
|
attr_accessor :id
|
7
7
|
end
|
8
8
|
|
9
|
-
@id =
|
9
|
+
@id = {}
|
10
10
|
|
11
11
|
def initialize(teal, _cond, &blk)
|
12
|
+
self.class.id[teal] ||= 0
|
12
13
|
@teal = teal
|
13
14
|
@else_count = 0
|
14
|
-
@id = self.class.id
|
15
|
+
@id = self.class.id[@teal]
|
15
16
|
@end_label = "if#{@id}_end:"
|
16
17
|
|
17
|
-
@id = self.class.id
|
18
|
-
self.class.id += 1
|
18
|
+
@id = self.class.id[@teal]
|
19
|
+
self.class.id[@teal] += 1
|
19
20
|
|
20
21
|
@teal << "bz if#{@id}_else0"
|
21
22
|
blk.call
|
@@ -664,6 +664,20 @@ module TEALrb
|
|
664
664
|
end
|
665
665
|
end
|
666
666
|
|
667
|
+
class TxnArrayIndex
|
668
|
+
include Opcodes
|
669
|
+
include TxnFields
|
670
|
+
|
671
|
+
def initialize(index)
|
672
|
+
@index = index
|
673
|
+
end
|
674
|
+
|
675
|
+
def opcode(field)
|
676
|
+
@teal = TEALrb::TEAL.current[Thread.current]
|
677
|
+
txna field, @index
|
678
|
+
end
|
679
|
+
end
|
680
|
+
|
667
681
|
module Txna
|
668
682
|
extend Opcodes
|
669
683
|
extend TxnFields
|
@@ -672,6 +686,10 @@ module TEALrb
|
|
672
686
|
@teal = TEALrb::TEAL.current[Thread.current]
|
673
687
|
txna field, index
|
674
688
|
end
|
689
|
+
|
690
|
+
def self.[](index)
|
691
|
+
TxnArrayIndex.new(index)
|
692
|
+
end
|
675
693
|
end
|
676
694
|
|
677
695
|
module Global
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tealrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Polny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.19.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.6.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.6.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: yard
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|