summaryrefslogtreecommitdiff
path: root/grc/core/Constants.py
diff options
context:
space:
mode:
authorRyan Volz <ryan.volz@gmail.com>2021-10-11 15:02:55 -0400
committermormj <34754695+mormj@users.noreply.github.com>2021-10-12 06:24:01 -0400
commit06dc1a9fca3bd1a2421e1a19fd6374519349d8d9 (patch)
tree15e563fcd5af95ff8b54ddbdcb3a362f6b8b966b /grc/core/Constants.py
parente50c3f80dd68c29f0f1331692dedefb95ab46ca7 (diff)
grc: Look up type aliases as a set instead of a single value.
After #5127, we inadvertently had duplicate dictionary keys, meaning the last entry is the only one that actually existed and some desired aliases were missing. This changes the ALIAS_OF dictionary to ALIASES_OF where the values are now a set of aliases instead of a single string value. The one use of the ALIAS_OF dictionary was changed to operate on the returned set. Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
Diffstat (limited to 'grc/core/Constants.py')
-rw-r--r--grc/core/Constants.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/grc/core/Constants.py b/grc/core/Constants.py
index 7d27db104c..953676ffde 100644
--- a/grc/core/Constants.py
+++ b/grc/core/Constants.py
@@ -116,24 +116,22 @@ ALIAS_TYPES = {
'bits': (1, GRC_COLOR_PURPLE_A100),
}
-ALIAS_OF = {
- 'complex': 'fc32',
- 'float': 'f32',
- 'int': 's32',
- 'short': 's16',
- 'short': 'sc16',
- 'byte': 's8',
- 'byte': 'sc8',
- 'bits': 'bit',
-
- 'fc32': 'complex',
- 'f32': 'float',
- 's32': 'int',
- 's16': 'short',
- 'sc16': 'short',
- 's8': 'byte',
- 'sc8': 'byte',
- 'bit': 'bits',
+ALIASES_OF = {
+ 'complex': {'fc32'},
+ 'float': {'f32'},
+ 'int': {'s32'},
+ 'short': {'s16', 'sc16'},
+ 'byte': {'s8', 'sc8'},
+ 'bits': {'bit'},
+
+ 'fc32': {'complex'},
+ 'f32': {'float'},
+ 's32': {'int'},
+ 's16': {'short'},
+ 'sc16': {'short'},
+ 's8': {'byte'},
+ 'sc8': {'byte'},
+ 'bit': {'bits'},
}
TYPE_TO_SIZEOF = {key: sizeof for name, key, sizeof, color in CORE_TYPES}