From 8f8301a17e413fae51afdfcbdb1e9dee35070609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobranowski?= Date: Mon, 16 Dec 2024 16:21:02 +0100 Subject: [PATCH] Remove some comments --- semantic_analyser.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/semantic_analyser.py b/semantic_analyser.py index a70fdc4..ca86b39 100644 --- a/semantic_analyser.py +++ b/semantic_analyser.py @@ -83,7 +83,7 @@ def visitSimpleAssignment(self, ctx: MyParser.SimpleAssignmentContext): ctx.parser.notifyErrorListeners( "Incompatible types in an assignment", ctx.getChild(1).getSymbol() ) - else: ## a[0] = 1 + else: # a[0] = 1 reference = self.visit(ctx.elementReference()) new_type = self.visit(ctx.expression()) if isinstance(new_type, Int): @@ -97,7 +97,7 @@ def visitCompoundAssignment(self, ctx: MyParser.CompoundAssignmentContext): if ctx.id_(): # a = 1 old_type = self.visit(ctx.id_()) new_type = self.visit(ctx.expression()) - else: ## a[0] = 1 + else: # a[0] = 1 old_type = self.visit(ctx.elementReference()) new_type = self.visit(ctx.expression()) try: @@ -194,11 +194,9 @@ def visitSpecialMatrixFunction(self, ctx: MyParser.SpecialMatrixFunctionContext) if not all(isinstance(dim, Int) for dim in dims): ctx.parser.notifyErrorListeners( "Matrix dimentions must be integers", ctx.getChild(0).getSymbol() - ) # todo: add more specific symbol + ) return - return Vector( - tuple(dim.value for dim in dims), Int() - ) # todo: return Int(0) or Int(1) + return Vector(tuple(dim.value for dim in dims), Int()) def visitBreak(self, ctx: MyParser.BreakContext): if self.nested_loop_counter == 0: