From 2007a3e9027c640f1dc6d5ad4259ed632f04d1b8 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 15 Feb 2014 13:25:38 +0100 Subject: [PATCH] improved script check error messages --- apps/opencs/model/tools/scriptcheck.cpp | 4 +++- apps/opencs/model/tools/scriptcheck.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/tools/scriptcheck.cpp b/apps/opencs/model/tools/scriptcheck.cpp index 2ed8fe657..a5154d292 100644 --- a/apps/opencs/model/tools/scriptcheck.cpp +++ b/apps/opencs/model/tools/scriptcheck.cpp @@ -24,7 +24,8 @@ void CSMTools::ScriptCheckStage::report (const std::string& message, const Compi stream << "warning "; stream - << "line " << loc.mLine << ", column " << loc.mColumn + << "script " << mFile + << ", line " << loc.mLine << ", column " << loc.mColumn << " (" << loc.mLiteral << "): " << message; mMessages->push_back (stream.str()); @@ -74,6 +75,7 @@ void CSMTools::ScriptCheckStage::perform (int stage, std::vector& m try { + mFile = mData.getScripts().getRecord (stage).get().mId; std::istringstream input (mData.getScripts().getRecord (stage).get().mScriptText); Compiler::Scanner scanner (*this, input, mContext.getExtensions()); diff --git a/apps/opencs/model/tools/scriptcheck.hpp b/apps/opencs/model/tools/scriptcheck.hpp index 325280d7f..8de8e1a66 100644 --- a/apps/opencs/model/tools/scriptcheck.hpp +++ b/apps/opencs/model/tools/scriptcheck.hpp @@ -17,6 +17,7 @@ namespace CSMTools Compiler::Extensions mExtensions; CSMWorld::ScriptContext mContext; std::string mId; + std::string mFile; std::vector *mMessages; virtual void report (const std::string& message, const Compiler::TokenLoc& loc, Type type);