dtr_core 0.2.0 → 0.2.1
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/supported_attributes.rb +56 -0
- data/lib/dtr_core.rb +1 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 418d168f86346b48188db512dbc5980049b3a66550157500b613cd7f318605b1
|
4
|
+
data.tar.gz: c19f00a497602180987bc8337d738b738737e9d262339a864228654e08683d7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8107337a5ef32a7fa3dada9be8f9c4fae276755072512cf9b3afd7025d8a3e853e1b3118c2ec2cf60e7eb34b78cfe29e102b9344b9d7261790723443e64211f4
|
7
|
+
data.tar.gz: 346171c09102be20a9af5d9c65765fea1cae983148fd9586bfeb725756413a80058a730478030c16076b3332cbef4af71c62a7c5e5ac40001283591fa7703801
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DTRCore
|
4
|
+
module SupportedTypes
|
5
|
+
# Supported Instructions for DTR.
|
6
|
+
## Instruction Categories ##
|
7
|
+
INSTRUCTION_CATEGORY_BASIC = 'basic'
|
8
|
+
INSTRUCTION_CATEGORY_STATE = 'state'
|
9
|
+
INSTRUCTION_CATEGORY_NUMERIC = 'numeric'
|
10
|
+
INSTRUCTION_CATEGORY_STRING = 'string'
|
11
|
+
INSTRUCTION_CATEGORIES = [
|
12
|
+
INSTRUCTION_CATEGORY_BASIC,
|
13
|
+
INSTRUCTION_CATEGORY_STATE,
|
14
|
+
INSTRUCTION_CATEGORY_NUMERIC,
|
15
|
+
INSTRUCTION_CATEGORY_STRING
|
16
|
+
].freeze
|
17
|
+
## Instructions ##
|
18
|
+
INSTRUCTIONS = [
|
19
|
+
# basic operations
|
20
|
+
{ name: 'return', description: 'Return a value from a function.', category: INSTRUCTION_CATEGORY_BASIC },
|
21
|
+
# state operations
|
22
|
+
{ name: 'fetch_state', description: 'Fetch a value from the state.', category: INSTRUCTION_CATEGORY_STATE },
|
23
|
+
{ name: 'save_state', description: 'Save a value to the state.', category: INSTRUCTION_CATEGORY_STATE },
|
24
|
+
# numeric operations
|
25
|
+
{ name: 'add_numbers', description: 'Add two numbers.', category: INSTRUCTION_CATEGORY_NUMERIC },
|
26
|
+
{ name: 'subtract_numbers', description: 'Subtract two numbers.', category: INSTRUCTION_CATEGORY_NUMERIC },
|
27
|
+
{ name: 'multiply_numbers', description: 'Multiply two numbers.', category: INSTRUCTION_CATEGORY_NUMERIC },
|
28
|
+
{ name: 'divide_numbers', description: 'Divide two numbers.', category: INSTRUCTION_CATEGORY_NUMERIC },
|
29
|
+
# string operations
|
30
|
+
{ name: 'add_strings', description: 'Concatenate two strings.', category: INSTRUCTION_CATEGORY_STRING }
|
31
|
+
].freeze
|
32
|
+
|
33
|
+
# Supported Types for DTR.
|
34
|
+
TYPES = [
|
35
|
+
# basic types
|
36
|
+
'address',
|
37
|
+
'boolean',
|
38
|
+
# string types
|
39
|
+
'symbol',
|
40
|
+
# collection types
|
41
|
+
'array',
|
42
|
+
'map',
|
43
|
+
# numeric types
|
44
|
+
## signed
|
45
|
+
'i32',
|
46
|
+
'i64',
|
47
|
+
'i128',
|
48
|
+
'i256',
|
49
|
+
## unsigned
|
50
|
+
'u32',
|
51
|
+
'u64',
|
52
|
+
'u128',
|
53
|
+
'u256'
|
54
|
+
].freeze
|
55
|
+
end
|
56
|
+
end
|
data/lib/dtr_core.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.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-05-
|
11
|
+
date: 2024-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Core smart contract intermediate language (Digicus Textual Representation)
|
14
14
|
parser.
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- lib/dtr_core/number.rb
|
26
26
|
- lib/dtr_core/parser.rb
|
27
27
|
- lib/dtr_core/state.rb
|
28
|
+
- lib/dtr_core/supported_attributes.rb
|
28
29
|
- lib/dtr_core/type_validator.rb
|
29
30
|
homepage: https://spaced-out-thoughts-dev-foundation.github.io/digicus/
|
30
31
|
licenses:
|