From 9ba7349f93aeca1bb45a083235f3576f5096a995 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Wed, 27 Jun 2007 07:49:52 +0000 Subject: The dungeon builder now caches compiled Lua chunks instead of Lua source in the .dsc to save on compile time (at the expense of larger .dsc files). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1663 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/luadgn.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/luadgn.h') diff --git a/crawl-ref/source/luadgn.h b/crawl-ref/source/luadgn.h index 6c619af05e..241983c0ba 100644 --- a/crawl-ref/source/luadgn.h +++ b/crawl-ref/source/luadgn.h @@ -21,14 +21,23 @@ class dlua_chunk private: std::string file; std::string chunk; + std::string compiled; std::string context; int first, last; // First and last lines of the original source. + enum chunk_t + { + CT_EMPTY, + CT_SOURCE, + CT_COMPILED + }; + private: - int check_op(CLua *, int); + int check_op(CLua &, int); std::string rewrite_chunk_prefix(const std::string &line) const; std::string get_chunk_prefix(const std::string &s) const; - + void release_compiled_chunk(); + public: mutable std::string error; -- cgit v1.2.3-54-g00ecf