summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/luaterp.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-28 11:22:08 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-10-28 11:44:55 +0100
commit0f91bf2a787fe86632491d1cb62dbcee33085cd0 (patch)
treeb341f11b68325ac08b31eff973283cc57066a409 /crawl-ref/source/luaterp.cc
parent4f1035708a954c767ceb4a59f1e23f7547a79620 (diff)
downloadcrawl-ref-0f91bf2a787fe86632491d1cb62dbcee33085cd0.tar.gz
crawl-ref-0f91bf2a787fe86632491d1cb62dbcee33085cd0.zip
Partial lua interpreter.
Diffstat (limited to 'crawl-ref/source/luaterp.cc')
-rw-r--r--crawl-ref/source/luaterp.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/crawl-ref/source/luaterp.cc b/crawl-ref/source/luaterp.cc
new file mode 100644
index 0000000000..a2c4ec8b42
--- /dev/null
+++ b/crawl-ref/source/luaterp.cc
@@ -0,0 +1,33 @@
+#include "AppHdr.h"
+
+#include "luaterp.h"
+
+#include "cio.h"
+#include "clua.h"
+#include "dlua.h"
+
+void _debug_call_lua(lua_State *ls)
+{
+ char specs[80];
+ while (true)
+ {
+ mpr("> ", MSGCH_PROMPT);
+ get_input_line(specs, sizeof(specs));
+ std::string s = specs;
+
+ if (s.empty())
+ return;
+
+ int err = 0;
+ if (err = luaL_dostring(ls, s.c_str()))
+ {
+ mprf(MSGCH_ERROR, "lua error: %d", err);
+ }
+ }
+}
+
+void debug_call_dlua()
+{
+ _debug_call_lua(dlua);
+}
+