dtr_core 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- 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: 71bccd1d29aa41c5c4dc2dde511c843ac74ff7916d93fb16322f6364c8350266
|
4
|
+
data.tar.gz: aaf146e8016a71caa1d55613d60597ec6f699c8c880c5b329d6ea0d08651714e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cba2273b9d641fd20d4e37bca355114b72b0e4b0bd09994c93732907f78c7d14ef538d3beb890aad61786c8396b9c39c4d47c8f5e9096d2a578052637bbb635
|
7
|
+
data.tar.gz: f64e6e165115dcd0f5dc3d583a27bb2d7c7e7567bb7955454f6493e4c1a12f233c599d0b5185e1089ddf9ac95919835091aa9aafa4c3df220fbff9fb5d4460c6
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DTRCore
|
4
|
+
module SupportedAttributes
|
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.2
|
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:
|