dtr_core 0.7.2 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19a8e9e136ddf241763741eab8b5c9c1e561dc585b01fc880e3569755b6ab7a9
4
- data.tar.gz: 158427c0b5e4bc3cc9a50682d225cc0071984d2e7d86cc00c375b67ec5335fe9
3
+ metadata.gz: 2457b55c657b17f1c0f69183486c2dbb78ee0c7e68ed1572db089b10e285474b
4
+ data.tar.gz: e5aafcd885e48bfff0773db4ac961a48970b3f98648b3220abd29e3d34cc614c
5
5
  SHA512:
6
- metadata.gz: df4f33aac6008dc6c7b1ef616d1c35281f137127ef0d00ebc14bb643655755745b5aba94e1e7418c7914ddceb7134ebe3f314449321d6de02ccb76c20f339644
7
- data.tar.gz: 8eaaf4063a3f1887a0d0a5c755a75875fa23f0d434af392f30ffdf9df2cde8e30984b5710b812c88ace2af240a21eaae42f266abd4b97f6f361b1d447ff69d1e
6
+ metadata.gz: 1f7cd472023cbfe46625ba9afa0fc8d0146ccbd0b39af87bc4157ba7d58f37760f7b07c50f76e3d2be057d2cc4650312a8ef166d3e12d0a09e9e1f90395abb09
7
+ data.tar.gz: bd868a7ad8c5526624b925f5f168d828b2bafc66cc62c7d226c4f7cd59c3ff2af04e008fb7d33ecc048f8c167d8c65307b7e4d2318c4cc1df90739a2cf37b223
@@ -31,6 +31,8 @@ module DTRCore
31
31
  validate_object_operation!
32
32
  when 'add', 'subtract', 'multiply', 'divide'
33
33
  validate_binary_operation!
34
+ when 'increment'
35
+ true
34
36
  else
35
37
  false
36
38
  end
@@ -41,8 +41,6 @@ module DTRCore
41
41
  .split(/\n\s*\*\s*\[/).map { |x| "[#{x.strip}" }
42
42
  .map { |definition| DTRCore::State.from_definition(definition) }
43
43
 
44
- raise 'Empty state section.' if state_definitions.empty?
45
-
46
44
  @state_section ||= state_definitions
47
45
  end
48
46
 
@@ -59,8 +57,6 @@ module DTRCore
59
57
 
60
58
  function_definitions.reject! { |x| x.name.nil? }
61
59
 
62
- raise 'Empty interface section.' if function_definitions.empty?
63
-
64
60
  @interface_section ||= function_definitions
65
61
  end
66
62
 
@@ -93,8 +89,6 @@ module DTRCore
93
89
 
94
90
  function_definitions.reject! { |x| x.name.nil? }
95
91
 
96
- raise 'Empty helpers section.' if function_definitions.empty?
97
-
98
92
  @helpers_section ||= function_definitions
99
93
  end
100
94
  end
@@ -28,9 +28,15 @@ module DTRCore
28
28
  end
29
29
 
30
30
  def self.transform_attributes(capture_attribute_definition)
31
- capture_attribute_definition&.map { |x| x.split(':') }
32
- &.filter { |x| x.length > 1 }
33
- &.map { |x| { name: x[0].strip, type: x[1].strip } }
31
+ capture_attribute_definition&.map do |x|
32
+ splitted = x.split(':')
33
+ next { name: splitted[0].strip, type: splitted[1].strip } if splitted.length > 1
34
+
35
+ splitted = x.split('=')
36
+ next { name: splitted[0].strip, type: splitted[1].strip } if splitted.length > 1
37
+
38
+ nil
39
+ end&.compact
34
40
  end
35
41
 
36
42
  def self.capture_name(definition)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtr_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Durst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-22 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Core smart contract intermediate language (Digicus Textual Representation)
14
14
  parser.