Skip to content

Commit

Permalink
Remove some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbrnowski committed Dec 16, 2024
1 parent 1d3f597 commit 8f8301a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions semantic_analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 8f8301a

Please sign in to comment.