-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make last2 and last3 available in a break loop #2375
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2375 +/- ##
==========================================
- Coverage 73.61% 73.61% -0.01%
==========================================
Files 484 484
Lines 245759 245759
==========================================
- Hits 180910 180908 -2
- Misses 64849 64851 +2
|
While there are many other changes we could make, this fixes an obvious bug (at the moment we change last, but not last2 and last3 in break loops, which is just silly) |
Seems OK to me, though of course as always, a test case would be nice. I.e. add a new file to
Then, run the
That said, it's also fine to merge this as-is, and we'll add a test later. |
Made a test-error/last-access.g as described above, but ./regenerate_error_tests.sh messed up all the *.out files (and created *.out-e files) by putting brk> in place of gap> and brk-2> in place of brk>, e.g. last-access.g.out looks like this: |
Don't worry about it. |
This PR addresses issue #2374.
I came upon this by accident - it is not a feature that I particularly wish to use.
Only 'last' is currently available inside a break loop because LastDepth=1 is set there.
The fix suggested by @ChrisJefferson is to change '1' to '3' in lib/error.g line 240.
Alternatively we could add "(Note that last2 and last3 are not available inside a break loop.)" to the reference manual.
The additional suggestion by @stevelinton, "Would it be nicer if the old values of last* were reset on return from the break loop?", has not been addressed.