File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed 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." )
You can’t perform that action at this time.
0 commit comments