From 5066005a384b8f3ea2baa4dbf18d10b9c491e843 Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 05 Sep 2013 21:59:04 +0000 Subject: add ord() and chr() to Call ASTs recognized by get_type(...) --- (limited to 'TurtleArt/tatype.py') diff --git a/TurtleArt/tatype.py b/TurtleArt/tatype.py index cf75e44..055fc2f 100644 --- a/TurtleArt/tatype.py +++ b/TurtleArt/tatype.py @@ -122,8 +122,10 @@ def get_type(x): if isinstance(x.func, ast.Name): if x.func.id == 'float': return (TYPE_FLOAT, True) - if x.func.id == 'int': + elif x.func.id in ('int', 'ord'): return (TYPE_INT, True) + elif x.func.id == 'chr': + return (TYPE_CHAR, True) elif x.func.id in ('repr', 'str', 'unicode'): return (TYPE_STRING, True) # unary operands never change the type of their argument -- cgit v0.9.1