From 7c461804ac6ae24d3026e803e7a0a04303a687c3 Mon Sep 17 00:00:00 2001 From: Nicolas Noble Date: Mon, 5 Aug 2013 17:06:19 -0700 Subject: Adding the LuaLoad function to Dalos. --- Dalos-modules | 2 +- Makefile | 1 + src/Dalos-cli.cc | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Dalos-modules b/Dalos-modules index d625e8c..3c10400 160000 --- a/Dalos-modules +++ b/Dalos-modules @@ -1 +1 @@ -Subproject commit d625e8c12de02e2c39d687b735e6e8d5a3fd0865 +Subproject commit 3c1040007a354ce55bd964beabac94b67c1f6fc7 diff --git a/Makefile b/Makefile index 5041205..09cc5d6 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ DALOS_CLI_SOURCES = \ Dalos-cli.cc \ \ Readline.cc \ +LuaLoad.cc \ ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(DALOS_CLI_SOURCES)))) ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(DALOS_CLI_SOURCES)))) diff --git a/src/Dalos-cli.cc b/src/Dalos-cli.cc index acc7ea3..5c7cc8a 100644 --- a/src/Dalos-cli.cc +++ b/src/Dalos-cli.cc @@ -5,6 +5,7 @@ #include #include #include "BReadline.h" +#include "LuaLoad.h" using namespace Balau; @@ -36,6 +37,16 @@ static void showhelp(const char * binname, bool longhelp) { ); } +namespace { + +class DalosInit : public LuaExecCell { + virtual void run(Lua & L) override { + registerLuaLoad(L); + } +}; + +}; + void MainTask::Do() { std::list execs; bool interactive = false; @@ -69,6 +80,12 @@ void MainTask::Do() { } } + { + DalosInit dalosInit; + dalosInit.exec(luaMainTask); + dalosInit.throwError(); + } + while (optind < argc) { todo = true; IO file(new Input(argv[optind++])); -- cgit v1.2.3