@@ -83,7 +83,7 @@ def visitSimpleAssignment(self, ctx: MyParser.SimpleAssignmentContext):
83
83
ctx .parser .notifyErrorListeners (
84
84
"Incompatible types in an assignment" , ctx .getChild (1 ).getSymbol ()
85
85
)
86
- else : ## a[0] = 1
86
+ else : # a[0] = 1
87
87
reference = self .visit (ctx .elementReference ())
88
88
new_type = self .visit (ctx .expression ())
89
89
if isinstance (new_type , Int ):
@@ -97,7 +97,7 @@ def visitCompoundAssignment(self, ctx: MyParser.CompoundAssignmentContext):
97
97
if ctx .id_ (): # a = 1
98
98
old_type = self .visit (ctx .id_ ())
99
99
new_type = self .visit (ctx .expression ())
100
- else : ## a[0] = 1
100
+ else : # a[0] = 1
101
101
old_type = self .visit (ctx .elementReference ())
102
102
new_type = self .visit (ctx .expression ())
103
103
try :
@@ -194,11 +194,9 @@ def visitSpecialMatrixFunction(self, ctx: MyParser.SpecialMatrixFunctionContext)
194
194
if not all (isinstance (dim , Int ) for dim in dims ):
195
195
ctx .parser .notifyErrorListeners (
196
196
"Matrix dimentions must be integers" , ctx .getChild (0 ).getSymbol ()
197
- ) # todo: add more specific symbol
197
+ )
198
198
return
199
- return Vector (
200
- tuple (dim .value for dim in dims ), Int ()
201
- ) # todo: return Int(0) or Int(1)
199
+ return Vector (tuple (dim .value for dim in dims ), Int ())
202
200
203
201
def visitBreak (self , ctx : MyParser .BreakContext ):
204
202
if self .nested_loop_counter == 0 :
0 commit comments