dtr_core 0.6.2 → 0.7.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.
- checksums.yaml +4 -4
- data/lib/dtr_core/function.rb +32 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0584cb1bf0567407eff28788610d660286408ccccf17e5843b1f72fd98d3f7d3'
|
4
|
+
data.tar.gz: 5897559b0b36b5915e20d308e53d460f976284670430257026037a9b3cf8f2b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b5e437c961502e02ff53e97c9e3772913d266d803eb692292e31cafacfa91a26e1251e5c7cedfb18d7e23504f452f3b163037ef3a755bcec612f70c8120be9e
|
7
|
+
data.tar.gz: 816d7449f668c9df06eef603a954fe78064d6afd5b03e4e00e5c69fbd782cff26a150e2ad957a79b314497637524e64531bb9ef2af37a18675f21ce888a5ac9f
|
data/lib/dtr_core/function.rb
CHANGED
@@ -107,8 +107,38 @@ module DTRCore
|
|
107
107
|
end
|
108
108
|
|
109
109
|
def parse_function_instruction_input(definition)
|
110
|
-
definition[/\s*input:\s*\((?<all>[^\)]+)\)/, 1]
|
111
|
-
|
110
|
+
raw_inputs = definition[/\s*input:\s*\((?<all>[^\)]+)\)/, 1]
|
111
|
+
return nil if raw_inputs.nil?
|
112
|
+
|
113
|
+
cur_word = ''
|
114
|
+
inputs_to_return = []
|
115
|
+
in_string = false
|
116
|
+
|
117
|
+
raw_inputs.each_char do |char|
|
118
|
+
if in_string
|
119
|
+
if char == '"'
|
120
|
+
in_string = false
|
121
|
+
inputs_to_return.push("\"#{cur_word}\"")
|
122
|
+
cur_word = ''
|
123
|
+
else
|
124
|
+
cur_word += char
|
125
|
+
end
|
126
|
+
elsif cur_word.empty? && char == '"'
|
127
|
+
in_string = true
|
128
|
+
elsif char == ','
|
129
|
+
inputs_to_return.push(cur_word)
|
130
|
+
cur_word = ''
|
131
|
+
in_string = false
|
132
|
+
else
|
133
|
+
cur_word += char
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
inputs_to_return.push(cur_word) unless cur_word.empty?
|
138
|
+
|
139
|
+
inputs_to_return.filter! { |x| !x.empty? }
|
140
|
+
|
141
|
+
inputs_to_return&.map(&:strip)
|
112
142
|
end
|
113
143
|
end
|
114
144
|
end
|
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.
|
4
|
+
version: 0.7.0
|
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-
|
11
|
+
date: 2024-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Core smart contract intermediate language (Digicus Textual Representation)
|
14
14
|
parser.
|
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
50
|
- !ruby/object:Gem::Version
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
|
-
rubygems_version: 3.
|
53
|
+
rubygems_version: 3.5.13
|
54
54
|
signing_key:
|
55
55
|
specification_version: 4
|
56
56
|
summary: Core smart contract intermediate language (Digicus Textual Representation)
|