dtr_core 0.2.6 → 0.2.8
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 +14 -2
- 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: b4c2bb162b6f7558a066ca08b82146f6934951c8b78a63f1ec2695df3582300c
|
4
|
+
data.tar.gz: e9afc8ec73ecddb50de3684f698aa19eebfcae7c59c236ef18f8785ac69e61e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3520c017ed2737f133654425373cf7dfa4f2aebf1e45637b2fa1e5189c48d5bb3ee57ba89c0089f75aa1d55dda0e6eb782d00506aca5b63963288494d05f67f
|
7
|
+
data.tar.gz: d28e1da96a73ac17085ce0b9ac746c4300c206320f24e19e938ac15672f6cc285c6d01840b5d311b2937e888b5f846d9178804120441a7065475c5aec441b171
|
@@ -6,25 +6,33 @@ module DTRCore
|
|
6
6
|
## Instruction Categories ##
|
7
7
|
INSTRUCTION_CATEGORY_BASIC = 'basic'
|
8
8
|
INSTRUCTION_CATEGORY_STATE = 'state'
|
9
|
+
INSTRUCTION_CATEGORY_UNTYPED = 'untyped'
|
9
10
|
INSTRUCTION_CATEGORY_NUMERIC = 'numeric'
|
10
11
|
INSTRUCTION_CATEGORY_STRING = 'string'
|
11
12
|
INSTRUCTION_CATEGORY_ENVIRONMENT = 'environment'
|
13
|
+
INSTRUCTION_CATEGORY_METHODS = 'methods'
|
14
|
+
INSTRUCTION_CATEGORY_OBJECTS = 'objects'
|
12
15
|
INSTRUCTION_CATEGORIES = [
|
13
16
|
INSTRUCTION_CATEGORY_BASIC,
|
14
17
|
INSTRUCTION_CATEGORY_STATE,
|
18
|
+
INSTRUCTION_CATEGORY_UNTYPED,
|
15
19
|
INSTRUCTION_CATEGORY_NUMERIC,
|
16
20
|
INSTRUCTION_CATEGORY_STRING,
|
17
|
-
INSTRUCTION_CATEGORY_ENVIRONMENT
|
21
|
+
INSTRUCTION_CATEGORY_ENVIRONMENT,
|
22
|
+
INSTRUCTION_CATEGORY_METHODS,
|
23
|
+
INSTRUCTION_CATEGORY_OBJECTS
|
18
24
|
].freeze
|
19
25
|
## Instructions ##
|
20
26
|
INSTRUCTIONS = [
|
21
27
|
# basic operations
|
22
28
|
{ name: 'return', description: 'Return a value from a function.', category: INSTRUCTION_CATEGORY_BASIC },
|
23
29
|
{ name: 'assign', description: 'Assign a value to a variable.', category: INSTRUCTION_CATEGORY_BASIC },
|
24
|
-
{ name: 'add', description: 'Add two things of unknown types together.', category: INSTRUCTION_CATEGORY_BASIC },
|
25
30
|
# state operations
|
26
31
|
{ name: 'fetch_state', description: 'Fetch a value from the state.', category: INSTRUCTION_CATEGORY_STATE },
|
27
32
|
{ name: 'save_state', description: 'Save a value to the state.', category: INSTRUCTION_CATEGORY_STATE },
|
33
|
+
# untyped operations
|
34
|
+
{ name: 'add', description: 'Add two things of unknown types together.', category: INSTRUCTION_CATEGORY_UNTYPED },
|
35
|
+
{ name: 'add_and_assign', description: 'Add two things of unknown types together and then assign to the first one.', category: INSTRUCTION_CATEGORY_UNTYPED },
|
28
36
|
# numeric operations
|
29
37
|
{ name: 'add_numbers', description: 'Add two numbers.', category: INSTRUCTION_CATEGORY_NUMERIC },
|
30
38
|
{ name: 'subtract_numbers', description: 'Subtract two numbers.', category: INSTRUCTION_CATEGORY_NUMERIC },
|
@@ -34,6 +42,10 @@ module DTRCore
|
|
34
42
|
{ name: 'add_strings', description: 'Concatenate two strings.', category: INSTRUCTION_CATEGORY_STRING },
|
35
43
|
# environment operations
|
36
44
|
{ name: 'contract_address', description: 'Get the contract address.', category: INSTRUCTION_CATEGORY_ENVIRONMENT }
|
45
|
+
# method operations
|
46
|
+
{ name: 'evaluate', description: 'Evaluate a method. Method name is the first input and arguments follow', category: INSTRUCTION_CATEGORY_METHODS }
|
47
|
+
# object operations
|
48
|
+
{ name: 'field', description: 'Reference an object field.', category: INSTRUCTION_CATEGORY_OBJECTS }
|
37
49
|
].freeze
|
38
50
|
|
39
51
|
# Supported Types for DTR.
|
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.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-05-
|
11
|
+
date: 2024-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Core smart contract intermediate language (Digicus Textual Representation)
|
14
14
|
parser.
|