Breaking State Property
If the "break" state is "breaking" at time t, and LW Python is currently inside an "if/elif/else" block, then at time t + 1, the "break" state stays in "breaking." More formally,
if the following are true:
- the line at time t = i
- the tab at time t = j
- "break" state at t = "breaking"
- value at (j - 1) in map (Control Map at time t) = control_value
- control_value describes a loop = False
then "break" state at (t + 1) = "breaking"
How do we know whether Python is currently inside an "if/elif/else" block? If the "Control" map has an entry at current tab - 1, and the value has an "if" in it, then we know that there was an "if/elif/else" statement at current tab - 1.
For example,
if the following are true:
- the line at time 82 = 6
- the tab at time 82 = 2
- "break" state at 82 = "breaking"
- value at (2 - 1) in map (Control Map at time 82) = pair ("if", True)
then "break" state at (82 + 1) = "breaking"
Try stepping through the simulator to see the "Breaking State" remain in "breaking" while LW Python is breaking.
Current Line | 1 | Current Tab | 0 | Time | 0 |
Comments
Please log in to add comments