From 7f6f70853c8a2730fca2e95d5968ad52cf470bda Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 7 Nov 2018 14:42:05 -0200 Subject: To-be-closed variable in 'for' loop separated from the state The variable to be closed in a generic 'for' loop now is the 4th value produced in the loop initialization, instead of being the loop state (the 2nd value produced). That allows a loop to use a state with a '__toclose' metamethod but do not close it. (As an example, 'f:lines()' might use the file 'f' as a state for the loop, but it should not close the file when the loop ends.) --- lopcodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index 5a38f767..7bb83a1e 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -279,9 +279,9 @@ OP_FORLOOP,/* A Bx R(A)+=R(A+2); if R(A)