File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1+ IF m$(s(1 )- vm,s(2 )- hm)= "\c" THEN REM
2+
3+
Original file line number Diff line number Diff line change 1+ IF k$<> s$ THEN REM
2+ IF m$(s(1 ),s(2 ))= "\b" THEN LET m$(s(1 ),s(2 ))= "\c"
Original file line number Diff line number Diff line change @@ -1166,10 +1166,17 @@ def p_substr_assignment(p):
11661166 if entry .class_ == CLASS .unknown :
11671167 entry .class_ = CLASS .var
11681168
1169- assert entry .class_ == CLASS .var and entry .type_ == TYPE .string
1169+ if entry .class_ != CLASS .var :
1170+ api .errmsg .syntax_error_cannot_assign_not_a_var (p .lineno (2 ), p [2 ])
1171+ return
1172+
1173+ if entry .type_ != TYPE .string :
1174+ api .errmsg .syntax_error_expected_string (p .lineno (2 ), entry .type_ )
1175+ return
11701176
11711177 if p [5 ].type_ != TYPE .string :
11721178 api .errmsg .syntax_error_expected_string (p .lineno (4 ), p [5 ].type_ )
1179+ return
11731180
11741181 if len (p [3 ]) > 1 :
11751182 syntax_error (p .lineno (2 ), "Accessing string with too many indexes. Expected only one." )
@@ -2583,6 +2590,10 @@ def p_expr_funccall(p):
25832590def p_idcall_expr (p ):
25842591 """ func_call : ID arg_list %prec UMINUS
25852592 """ # This can be a function call or a string index
2593+ if p [2 ] is None :
2594+ p [0 ] = None
2595+ return
2596+
25862597 p [0 ] = make_call (p [1 ], p .lineno (1 ), p [2 ])
25872598 if p [0 ] is None :
25882599 return
You can’t perform that action at this time.
0 commit comments