dtr_to_rust 0.0.7 → 0.0.8
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/generator.rb +1 -1
- data/lib/instruction/evaluate.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75a4155b6f5e591a764deb02cca02bd05cb781481ae4d5602f2b784219d90837
|
4
|
+
data.tar.gz: 111292133a70c1c1b81b402d263837b271655445262cc62c26ebbead2bdfb398
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dd217b90fd5aa4480c8932ddc95abf57630837aaf0f870248911233e23c093216c131eb18f431e5e65aaa48558c2fb051d480009048fb98bbd1aee7cb916d63
|
7
|
+
data.tar.gz: 12a427b6a3f01d2afd76886168a8078d8cf9c7c090830f0e97250e9df71ae923e65b04f3bd43988c53027d147c560398764ea7a9d9882f37686e2874f902a1f9
|
data/lib/generator.rb
CHANGED
@@ -34,7 +34,7 @@ module DTRToRust
|
|
34
34
|
|
35
35
|
def generate_contract_header
|
36
36
|
# TODO: don't hardcode imports
|
37
|
-
@content += "#![no_std]\nuse soroban_sdk::{contract, contractimpl, symbol_short, vec, Env, Symbol, Vec};\n\n"
|
37
|
+
@content += "#![no_std]\nuse soroban_sdk::{contract, contractimpl, symbol_short, vec, Env, Symbol, Vec, log};\n\n"
|
38
38
|
end
|
39
39
|
|
40
40
|
def generate_contract_name
|
data/lib/instruction/evaluate.rb
CHANGED
@@ -5,7 +5,11 @@ module DTRToRust
|
|
5
5
|
# This class is responsible for generating Rust code for the Evaluate instruction.
|
6
6
|
class Evaluate < Handler
|
7
7
|
def handle
|
8
|
-
rust_string =
|
8
|
+
rust_string = if @instruction[:assign].nil?
|
9
|
+
"#{@instruction[:inputs][0]}(#{@instruction[:inputs][1..].join(', ')});"
|
10
|
+
else
|
11
|
+
"let mut #{@instruction[:assign]} = #{@instruction[:inputs][0]}(#{@instruction[:inputs][1..].join(', ')});"
|
12
|
+
end
|
9
13
|
|
10
14
|
form_rust_string(rust_string, @instruction[:scope])
|
11
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dtr_to_rust
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rust to DTR translator (Digicus Textual Representation).
|
14
14
|
email:
|