Mirror of https://github.com/leanprover/lean2 in case it ever disappears
Find a file
Leonardo de Moura d87ad9eb7e refactor(util/lua): propagate C++ Lean exceptions in Lua
The following call sequence is possible:
C++ -> Lua -> C++ -> Lua -> C++

The first block of C++ is the Lean main function.
The main function invokes the Lua interpreter.
The Lua interpreter invokes a C++ Lean API.
Then the Lean API invokes a callback implemented in Lua.
The Lua callback invokes another Lean API.
Now, suppose the Lean API throws an exception.
We want the C++ exception to propagate over the mixed C++/Lua call stack.
We use the clone/rethrow exception idiom to achieve this goal.

Before this commit, the C++ exceptions were converted into strings
using the method what(), and then they were propagated over the Lua
stack using lua_error. A lua_error was then converted into a lua_exception when going back to C++.
This solution was very unsatisfactory, since all C++ exceptions were being converted into a lua_exception, and consequently the structure of the exception was being lost.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 12:25:29 -08:00
doc refactor(shell): combine lean and leanlua executables in a single executable 2013-11-19 16:48:21 -08:00
examples/lean Fix typo 2013-09-05 19:18:55 -07:00
script fix(script/demangle_cpptype): process line-by-line, instead of waiting for EOF 2013-09-29 18:36:01 -07:00
src refactor(util/lua): propagate C++ Lean exceptions in Lua 2013-11-27 12:25:29 -08:00
tests refactor(util/lua): propagate C++ Lean exceptions in Lua 2013-11-27 12:25:29 -08:00
.gitignore chore(.gitignore): hide '*.md.lua' files 2013-11-18 14:14:23 -08:00
.travis.osx.yml chore(travis): fix .travis.osx.yml 2013-11-12 23:15:03 -05:00
.travis.windows.yml chore(travis): fix dropbox_key in windows build 2013-11-16 23:44:31 -05:00
.travis.yml chore(travis): restore multiple builds 2013-11-17 03:04:37 -05:00
LICENSE Add LICENSE file 2013-07-15 18:55:48 -07:00
README.md doc(README.md): "Code coverage" => "Coverage" to fit in one line 2013-11-11 20:42:15 -05:00

UbuntuOS XWindowsCoverageBuilds / UnitTests / Dynamic Analyses
http://build.leanprover.net

About

Requirements

Installing required packages at

Build Instructions

Miscellaneous