git @ Cat's Eye Technologies SixtyPical / 27aca3d
Looks like, when we "goto", we should "pull in" the constraints. Chris Pressey 6 years ago
1 changed file(s) with 12 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
389389 print('-' * 79)
390390 print('')
391391
392 # even if we goto another routine, we can't trash an output.
392 # these all apply whether we encountered goto(s) in this routine, or not...:
393
394 # can't trash an output.
393395 for ref in trashed:
394396 if ref in type_.outputs:
395397 raise UnmeaningfulOutputError(routine, ref.name)
396398
397 if not context.encountered_gotos():
398 for ref in type_.outputs:
399 context.assert_meaningful(ref, exception_class=UnmeaningfulOutputError)
400 for ref in context.each_touched():
401 if ref not in type_.outputs and ref not in type_.trashes and not routine_has_static(routine, ref):
402 raise ForbiddenWriteError(routine, ref.name)
399 # all outputs are meaningful.
400 for ref in type_.outputs:
401 context.assert_meaningful(ref, exception_class=UnmeaningfulOutputError)
402
403 # if something was touched, then it should have been declared to be writable.
404 for ref in context.each_touched():
405 if ref not in type_.outputs and ref not in type_.trashes and not routine_has_static(routine, ref):
406 raise ForbiddenWriteError(routine, ref.name)
407
403408 self.current_routine = None
404409 return context
405410