dtr_core 0.4.1 → 0.5.1
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/parser.rb +1 -1
- data/lib/dtr_core/supported_attributes.rb +12 -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: 567cfc936d95095b577f5f92b9e07328c3b3225186d40bb3d04bc0e2d678eaa6
|
4
|
+
data.tar.gz: f01122597f91ecc1db9c108a2effa96ac734a318dde48f14e54441bf10e31ced
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e05a81b1d527c88bd2e5b172b662d12a12519ce85d6aa7648a66360160c32a47bb1ab5df6176d44a2d70af69c5ea761056da3ce23b979d32212801fa39c1396
|
7
|
+
data.tar.gz: ea2f450d0a1873f217797dc1021ffe62778189d3c16df20c04038d7c3c9f715728223389dedd3c6a267e0f322d1263337a31d580e25a874d914699c2afdc217e
|
data/lib/dtr_core/parser.rb
CHANGED
@@ -49,7 +49,7 @@ module DTRCore
|
|
49
49
|
def function_section
|
50
50
|
return @function_definitions if @function_definitions
|
51
51
|
|
52
|
-
function_section = first_match_for_content(/\[
|
52
|
+
function_section = first_match_for_content(/\[InternalFunctions\]:(?<all>.*):\[InternalFunctions\]/m)
|
53
53
|
|
54
54
|
return nil if function_section.nil?
|
55
55
|
|
@@ -12,6 +12,8 @@ module DTRCore
|
|
12
12
|
INSTRUCTION_CATEGORY_ENVIRONMENT = 'environment'
|
13
13
|
INSTRUCTION_CATEGORY_METHODS = 'methods'
|
14
14
|
INSTRUCTION_CATEGORY_OBJECTS = 'objects'
|
15
|
+
INSTRUCTION_CATEGORY_CONDITIONAL = 'conditional'
|
16
|
+
INSTRUCTION_CATEGORY_LOGICAL = 'logical'
|
15
17
|
INSTRUCTION_CATEGORIES = [
|
16
18
|
INSTRUCTION_CATEGORY_BASIC,
|
17
19
|
INSTRUCTION_CATEGORY_STATE,
|
@@ -20,13 +22,16 @@ module DTRCore
|
|
20
22
|
INSTRUCTION_CATEGORY_STRING,
|
21
23
|
INSTRUCTION_CATEGORY_ENVIRONMENT,
|
22
24
|
INSTRUCTION_CATEGORY_METHODS,
|
23
|
-
INSTRUCTION_CATEGORY_OBJECTS
|
25
|
+
INSTRUCTION_CATEGORY_OBJECTS,
|
26
|
+
INSTRUCTION_CATEGORY_CONDITIONAL,
|
27
|
+
INSTRUCTION_CATEGORY_LOGICAL
|
24
28
|
].freeze
|
25
29
|
## Instructions ##
|
26
30
|
INSTRUCTIONS = [
|
27
31
|
# basic operations
|
28
32
|
{ name: 'return', description: 'Return a value from a function.', category: INSTRUCTION_CATEGORY_BASIC },
|
29
33
|
{ name: 'assign', description: 'Assign a value to a variable.', category: INSTRUCTION_CATEGORY_BASIC },
|
34
|
+
{ name: 'panic', description: 'Exit, quickly, and loudly.', category: INSTRUCTION_CATEGORY_BASIC },
|
30
35
|
# state operations
|
31
36
|
{ name: 'fetch_state', description: 'Fetch a value from the state.', category: INSTRUCTION_CATEGORY_STATE },
|
32
37
|
{ name: 'save_state', description: 'Save a value to the state.', category: INSTRUCTION_CATEGORY_STATE },
|
@@ -51,6 +56,12 @@ module DTRCore
|
|
51
56
|
# object operations
|
52
57
|
{ name: 'field', description: 'Reference an object field.', category: INSTRUCTION_CATEGORY_OBJECTS },
|
53
58
|
{ name: 'initialize_udt', description: 'Instantiate UDT object.', category: INSTRUCTION_CATEGORY_OBJECTS }
|
59
|
+
# conditional operations
|
60
|
+
{ name: 'conditional_jump', description: 'Jump to a label if first input is true.', category: INSTRUCTION_CATEGORY_CONDITIONAL }
|
61
|
+
{ name: 'unconditional_jump', description: 'Jump to a no matter what.', category: INSTRUCTION_CATEGORY_CONDITIONAL }
|
62
|
+
# logical operations
|
63
|
+
{ name: 'and', description: 'Logical AND.', category: INSTRUCTION_CATEGORY_LOGICAL }
|
64
|
+
{ name: 'or', description: 'Logical OR.', category: INSTRUCTION_CATEGORY_LOGICAL }
|
54
65
|
].freeze
|
55
66
|
|
56
67
|
# 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.
|
4
|
+
version: 0.5.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-06-
|
11
|
+
date: 2024-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Core smart contract intermediate language (Digicus Textual Representation)
|
14
14
|
parser.
|