diff options
Diffstat (limited to 'TurtleArt/tatype.py')
-rw-r--r-- | TurtleArt/tatype.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/TurtleArt/tatype.py b/TurtleArt/tatype.py index 1402014..46c5921 100644 --- a/TurtleArt/tatype.py +++ b/TurtleArt/tatype.py @@ -68,6 +68,7 @@ class TypeDisjunction(tuple,Type): return "".join(s) +# individual types TYPE_OBJECT = Type('TYPE_OBJECT', 0) TYPE_BOOL = Type('TYPE_BOOL', 5) TYPE_BOX = Type('TYPE_BOX', 8) # special type for the unknown content of a box @@ -81,10 +82,14 @@ TYPE_NUMBER = Type('TYPE_NUMBER', 6) # shortcut to avoid a TypeDisjunction TYPE_NUMERIC_STRING = Type('TYPE_NUMERIC_STRING', 7) TYPE_STRING = Type('TYPE_STRING', 9) +# groups/ classes of types +TYPES_NUMERIC = (TYPE_FLOAT, TYPE_INT, TYPE_NUMBER) + BOX_AST = ast.Name(id='BOX', ctx=ast.Load) ACTION_AST = ast.Name(id='ACTION', ctx=ast.Load) + def get_type(x): """ Return the most specific type in the type hierarchy that applies to x and a boolean indicating whether x is an AST. If the type cannot be |