From ed83b86f12e6ad5b8362d96bbe512303b2141d55 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Wed, 28 Oct 2009 12:48:41 +0100 Subject: Luaterp: introductory comments and renaming. To use, set "delay_message_clear = true" and call wizard mode Ctrl+T. To echo return values from statements, prefix them with '=' and define the global __echo. (__echo = crawl.mpr will work for single return values.) --- crawl-ref/source/acr.cc | 2 +- crawl-ref/source/luaterp.cc | 10 ++++++++-- crawl-ref/source/luaterp.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 5548e9ae3d..9171b9bbcb 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -479,7 +479,7 @@ static void _do_wizard_command(int wiz_command, bool silent_fail) case CONTROL('H'): wizard_set_hunger_state(); break; case CONTROL('I'): debug_item_statistics(); break; case CONTROL('L'): wizard_set_xl(); break; - case CONTROL('T'): debug_call_dlua(); break; + case CONTROL('T'): debug_terp_dlua(); break; case 'O': debug_test_explore(); break; case 'S': wizard_set_skill_level(); break; diff --git a/crawl-ref/source/luaterp.cc b/crawl-ref/source/luaterp.cc index 5ccbfffbc1..1b60e1d013 100644 --- a/crawl-ref/source/luaterp.cc +++ b/crawl-ref/source/luaterp.cc @@ -3,6 +3,13 @@ * Summary: An interactive lua interpreter. * * Based heavily on lua.c from the Lua distribution. + * + * Deficiencies: + * - Currently requires defining a global function __echo + * to echo results. + * - Currently requires prefixing with '=' if you want results echoed. + * - Appears to require delay_message_clear = true. + * - Old input lines are not visible. */ #include "AppHdr.h" @@ -122,8 +129,7 @@ void run_clua_interpreter(lua_State *ls) lua_settop(ls, 0); // clear stack } -void debug_call_dlua() +void debug_terp_dlua() { run_clua_interpreter(dlua); } - diff --git a/crawl-ref/source/luaterp.h b/crawl-ref/source/luaterp.h index aa8cd6b9cf..6e8a2b7d74 100644 --- a/crawl-ref/source/luaterp.h +++ b/crawl-ref/source/luaterp.h @@ -1,7 +1,7 @@ #ifndef DEBUGLUA_H #define DEBUGLUA_H -void debug_call_dlua(); +void debug_terp_dlua(); #endif -- cgit v1.2.3-54-g00ecf