summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/luadgn.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-27 07:49:52 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-27 07:49:52 +0000
commit9ba7349f93aeca1bb45a083235f3576f5096a995 (patch)
tree278d98ebd1d6811ef8d2e5496e3630cb87054c2c /crawl-ref/source/luadgn.h
parentea6a050bf6b67faf4f9cce0cd8ee802f75ba21e3 (diff)
downloadcrawl-ref-9ba7349f93aeca1bb45a083235f3576f5096a995.tar.gz
crawl-ref-9ba7349f93aeca1bb45a083235f3576f5096a995.zip
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
Diffstat (limited to 'crawl-ref/source/luadgn.h')
-rw-r--r--crawl-ref/source/luadgn.h13
1 files changed, 11 insertions, 2 deletions
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;