dtr_core 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9d07ea7a38c72d9198df2495089bbf3722fc531ed745afcf48df6bc0a03030a
4
- data.tar.gz: 87a3774c28aca0c9971af4dc1be8d7de9a6002e87b2cb517f4cf5435903c9561
3
+ metadata.gz: 418d168f86346b48188db512dbc5980049b3a66550157500b613cd7f318605b1
4
+ data.tar.gz: c19f00a497602180987bc8337d738b738737e9d262339a864228654e08683d7b
5
5
  SHA512:
6
- metadata.gz: 225e0d639f677150e8b921e209adb6731b7e400facd61dbd9efed2d7cd3eb8dfe3b1d704ebf6c909062eb70b4eb172891beee69309bbc70ab048dd5042744f0a
7
- data.tar.gz: 55acd1a86a174b36500b603b9720a4f121cdcf8dc88934392e2ce7b62194412a6e14b658766254254c6aa2967ad8adf2c1e5114ea6edda417557a3a11de56361
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
@@ -8,6 +8,5 @@ module DTRCore
8
8
  autoload :Parser, 'dtr_core/parser'
9
9
  autoload :State, 'dtr_core/state'
10
10
  autoload :TypeValidator, 'dtr_core/type_validator'
11
-
12
- VERSION = '0.1.0'
11
+ autoload :SupportedAttributes, 'dtr_core/supported_attributes'
13
12
  end
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.0
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-12 00:00:00.000000000 Z
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: