summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/util/levcomp.ypp
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-24 19:38:20 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-24 19:38:20 +0000
commit29e85c811ddbf45cc8cb830012abefce8a92009a (patch)
tree0a1ef24f6ffc42389b48dd1f5a665ee9159b1561 /crawl-ref/source/util/levcomp.ypp
parent7a6a09598a661b45bb3d96f48281ea7520370590 (diff)
downloadcrawl-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/util/levcomp.ypp')
-rw-r--r--crawl-ref/source/util/levcomp.ypp7
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp
index bedd60c7ba..daffae671c 100644
--- a/crawl-ref/source/util/levcomp.ypp
+++ b/crawl-ref/source/util/levcomp.ypp
@@ -32,7 +32,10 @@ static map_load_info_t loaded_maps;
void yyerror(const char *e)
{
- fprintf(stderr, "%s:%d: %s\n", lc_desfile.c_str(), yylineno, e);
+ if (strstr(e, lc_desfile.c_str()) == e)
+ fprintf(stderr, "%s\n", e);
+ else
+ fprintf(stderr, "%s:%d: %s\n", lc_desfile.c_str(), yylineno, e);
// Bail bail bail.
end(1);
}
@@ -100,13 +103,13 @@ defdepth : DEFAULT_DEPTH STRING
level : name metalines map_def metalines
{
+ lc_map.set_file(lc_desfile);
std::string err = lc_map.validate();
if (!err.empty())
yyerror(err.c_str());
if (!lc_map.has_depth() && !lc_default_depths.empty())
lc_map.add_depths(lc_default_depths.begin(),
lc_default_depths.end());
- lc_map.set_file(lc_desfile);
add_parsed_map(lc_map);
}
;