Skip to content

mascarenhas/lua52-in-leave

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a patched version of Lua 5.2 (work2) that, on exiting
an in <env> do ... end block, checks if <env> has a __leave
metamethod and calls it if it exists, passing <env>.

The metamethod is called on normal exits, returns, breaks, and
errors. In the latter case the error object is passed as the
second argument to __leave. Currently an error inside a __leave
handler shadows the error that caused it to be called.

See leave-example/in.lua for several examples of __leave in
action.

The original README is below the fold. The license of this
derived work is the same as Lua's.

-------

This is Lua 5.2 (work2), released on 13 Jan 2010.

For information about Lua, including installation instructions and
license details, see doc/readme.html.

About

Patch for Lua 5.2's in <env> do ... end that calls a metamethod __leave of <env> if it exists on scope exit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published