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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b601b1a9ea3ca3f47651dbd2cfd90d563244994bdccb0aa7b44ec2882219067
4
- data.tar.gz: a480b70e8c6bfb2421900f5b82db3c2f8c83d1194954a78683b30db78a67a860
3
+ metadata.gz: 75a4155b6f5e591a764deb02cca02bd05cb781481ae4d5602f2b784219d90837
4
+ data.tar.gz: 111292133a70c1c1b81b402d263837b271655445262cc62c26ebbead2bdfb398
5
5
  SHA512:
6
- metadata.gz: d2497d871d595c64552926cde73f20dc574e342ba769de4961baef8c595c31d78f2b9080d3c6793b8ecc28aa981d4ced0c00fa9ff7f1ebbc6335765e4983309d
7
- data.tar.gz: 5c2eb5673bff37de5fe02a64456eae6b60a2b89182b75fc4a22489e29c016d0fd9f1e3f1fe8ebb30888efa2f4f89f308da9942276d3e4bc1bccd461cdc167654
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
@@ -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 = "#{@instruction[:assign]} = #{@instruction[:inputs][0]}(#{@instruction[:inputs][1..].join(', ')});"
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.7
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-02 00:00:00.000000000 Z
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: