diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-24 19:38:20 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-24 19:38:20 +0000 |
commit | 29e85c811ddbf45cc8cb830012abefce8a92009a (patch) | |
tree | 0a1ef24f6ffc42389b48dd1f5a665ee9159b1561 /crawl-ref/source/luadgn.h | |
parent | 7a6a09598a661b45bb3d96f48281ea7520370590 (diff) | |
download | crawl-ref-29e85c811ddbf45cc8cb830012abefce8a92009a.tar.gz crawl-ref-29e85c811ddbf45cc8cb830012abefce8a92009a.zip |
Hackily rewrite Lua chunk errors to reflect line numbers from the original
.des file so that level-designers can find the lines that are causing the
problem.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1641 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/luadgn.h')
-rw-r--r-- | crawl-ref/source/luadgn.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/luadgn.h b/crawl-ref/source/luadgn.h index 199939dad2..f8b272f544 100644 --- a/crawl-ref/source/luadgn.h +++ b/crawl-ref/source/luadgn.h @@ -18,16 +18,19 @@ class dlua_chunk private: std::string file; std::string chunk; + std::string context; int first, last; // First and last lines of the original source. private: 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; public: std::string error; public: - dlua_chunk(); + dlua_chunk(const std::string &_context = "dlua_chunk"); void clear(); void add(int line, const std::string &line); void set_chunk(const std::string &s); @@ -38,7 +41,8 @@ public: const std::string &lua_string() const { return chunk; } std::string orig_error() const; - + bool rewrite_chunk_errors(std::string &err) const; + bool empty() const; }; |