From daca1cce37256b8845a8e1e56e574ec6543cab0d Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Fri, 16 Feb 2018 12:42:13 +0100 Subject: [PATCH] fix some errors --- il65/constantfold.py | 2 +- il65/emit/__init__.py | 3 ++- testsource/dtypes.ill | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/il65/constantfold.py b/il65/constantfold.py index f9fe11f21..887afc953 100644 --- a/il65/constantfold.py +++ b/il65/constantfold.py @@ -42,7 +42,7 @@ class ConstantFold: self._constant_folding() def _constant_folding(self) -> None: - for expression in list(self.module.all_nodes(Expression)): + for expression in self.module.all_nodes(Expression): if expression.parent is None or expression.parent.parent is None: # stale expression node (was part of an expression that was constant-folded away) continue diff --git a/il65/emit/__init__.py b/il65/emit/__init__.py index 0de064138..eaec41a47 100644 --- a/il65/emit/__init__.py +++ b/il65/emit/__init__.py @@ -8,7 +8,7 @@ Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0 import contextlib import math import attr -from typing import Set, Callable +from typing import Set, Callable, no_type_check from ..datatypes import FLOAT_MAX_POSITIVE, FLOAT_MAX_NEGATIVE from ..plyparse import Scope, AstNode from ..compile import Zeropage @@ -129,6 +129,7 @@ def preserving_registers(registers: Set[str], scope: Scope, out: Callable, loads yield +@no_type_check def scoped_name(node_with_name: AstNode, current_scope: Scope) -> str: node_scope = node_with_name.my_scope() return node_with_name.name if node_scope is current_scope else node_scope.name + "." + node_with_name.name diff --git a/testsource/dtypes.ill b/testsource/dtypes.ill index 437e7e59f..db8e3df61 100644 --- a/testsource/dtypes.ill +++ b/testsource/dtypes.ill @@ -132,7 +132,7 @@ ; (constant) expressions var .word expr_byte1b = -1-2-3-4-$22+$80+ZP.zpconst - var .byte expr_fault2 = 1 + (8/3)+sin(33) + max(1,2,3) + var .byte expr_fault2 = 1 + (8/3)+sin(33) + len("abc") sin: