jrincayc / ucblogo-code

Berkeley Logo interpreter
https://people.eecs.berkeley.edu/~bh/logo.html
GNU General Public License v3.0
190 stars 34 forks source link

ISSUE-50: Indicate correct error line when GOTO has a nonexistent tag #136

Closed dmalec closed 2 years ago

dmalec commented 2 years ago

resolves #50

Summary

Logo scans to the end of the procedure before raising the error that a GOTO references a nonexistent tag. This change:

  1. Saves the value of the current line prior to running the code looking for the tag.
  2. If the tag is not found, it restores the current line prior to printing an error message.

Test Environment