From f08d697699573b034f1cc87015af15e30cf808fd Mon Sep 17 00:00:00 2001 From: Antoine Viallon Date: Wed, 24 May 2023 00:13:56 +0200 Subject: [PATCH] nodes: assignments are not pure if the value is not None --- compiler/nodes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/nodes.py b/compiler/nodes.py index b0c0982..b9918a1 100644 --- a/compiler/nodes.py +++ b/compiler/nodes.py @@ -400,6 +400,10 @@ class Assignment(Node): def _values(self) -> list[Node | Any]: return [self.identifier, self.value] + @property + def pure(self) -> bool: + return self.value is None + def semantic_analysis(self, context: semantic.Context): super(Assignment, self).semantic_analysis(context) name = self.identifier.value