chore(travis): use cmake-2.8.7 for windows build
chore(travis): split a memcheck build into two builds using range option (-I)
feat(kernel/environment): add environment extension objects, the environment can be extended with frontend specific objects

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
refactor(frontends/lean): use extension objects to store lean default frontend data in the environment

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
refactor(kernel/metavar): avoid using unique names for default metavariable prefix

The problem is that unique names depend on the order compilation units are initialized. The order of initialization is not specified by the C++ standard. Then, different compilers (or even the same compiler) may produce different initialization orders, and consequently the metavariable prefix is going to be different for different builds. This is not a bug, but it makes unit tests to fail since the output produced by different builds is different for the same input file.
Avoiding unique name feature in the default metavariable prefix avoids this problem.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(kernel/environment): add weak reference to environment objects

We need weak references to environment objects because the environment has a reference to the type_checker and the type_checker has a reference back to the environment. Before, we were breaking the cycle using an "environment const &". This was a dangerous hack because the environment smart pointer passed to the type_checker could be on the stack. The weak_ref is much safer.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(kernel/environment): warning produced by clang

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(frontends/lean): add support for embedded Lua scripts in Lean files

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): add lua_exception for wrapping lua errors, and improve Lua error messages in the Lean frontend

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(todo): update todo list
chore(todo): update todo list
chore(todo): update todo list
feat(lua): make Lua use our malloc/realloc, catch error when initializing Lua

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): expose format objects in the Lua bindings

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(build): check if the Lua installed in the system supports lua_newstate

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): add set_global_function template, and to_name_ext function

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
feat(lua): expose basic API for Lean expressions in the Lua bindings

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(build): add CheckLuaObjlen.cc test, not every Lua version has the function lua_objlen

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(memory): realloc must behave like malloc when ptr is nullptr

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
doc(README): add lua

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>