From 67e4837345d6b3127ddd0ae281434d40f3b6b377 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Thu, 5 Nov 2020 11:09:29 -0700 Subject: fix type checking --- crowbar_reference_compiler/ast.py | 1 + mypy.ini | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 mypy.ini diff --git a/crowbar_reference_compiler/ast.py b/crowbar_reference_compiler/ast.py index bb5a4e1..86e64fe 100644 --- a/crowbar_reference_compiler/ast.py +++ b/crowbar_reference_compiler/ast.py @@ -532,6 +532,7 @@ class ASTBuilder(NodeVisitor): return ConstantExpression(body.type) if body.type == 'string_literal': return ConstantExpression(body.data) + raise NotImplementedError('atomic expression ' + repr(body)) def visit_StructPointerElementSuffix(self, node, visited_children): separator, element = visited_children diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..d2b82d6 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,5 @@ +[mypy] +python_version = 3.7 +check_untyped_defs = True +allow_redefinition = True +disable_error_code = no-redef -- cgit v1.2.3