Commit 95aa05e4 authored by Capostrophic's avatar Capostrophic

Tweaks to script parser messages and pathgrid warnings

parent 5a86554f
......@@ -56,8 +56,7 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (pointList[pathgrid.mEdges[i].mV0].mOtherIndex[j] == pathgrid.mEdges[i].mV1)
{
std::ostringstream ss;
ss << "Duplicate edge between points"
<< pathgrid.mEdges[i].mV0 << " and " << pathgrid.mEdges[i].mV1;
ss << "Duplicate edge between points #" << pathgrid.mEdges[i].mV0 << " and #" << pathgrid.mEdges[i].mV1;
messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Error);
break;
}
......@@ -70,7 +69,7 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
else
{
std::ostringstream ss;
ss << "An edge is connected to a non-existent point " << pathgrid.mEdges[i].mV0;
ss << "An edge is connected to a non-existent point #" << pathgrid.mEdges[i].mV0;
messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Error);
}
}
......@@ -93,7 +92,7 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (!foundReverse)
{
std::ostringstream ss;
ss << "Missing edge between points " << i << " and " << pointList[i].mOtherIndex[j];
ss << "Missing edge between points #" << i << " and #" << pointList[i].mOtherIndex[j];
messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Error);
}
}
......@@ -110,7 +109,7 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (it == duplList.end())
{
std::ostringstream ss;
ss << "Point " << i << " duplicates point " << j
ss << "Point #" << i << " duplicates point #" << j
<< " (" << pathgrid.mPoints[i].mX << ", " << pathgrid.mPoints[i].mY << ", " << pathgrid.mPoints[i].mZ << ")";
messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Warning);
......@@ -127,11 +126,10 @@ void CSMTools::PathgridCheckStage::perform (int stage, CSMDoc::Messages& message
if (pointList[i].mConnectionNum == 0)
{
std::ostringstream ss;
ss << "Point " << i << " ("
<< pathgrid.mPoints[i].mX << ", "
<< pathgrid.mPoints[i].mY << ", "
<< pathgrid.mPoints[i].mZ << ") "
<< "is disconnected from other points";
ss << "Point #" << i << " ("
<< pathgrid.mPoints[i].mX << ", "
<< pathgrid.mPoints[i].mY << ", "
<< pathgrid.mPoints[i].mZ << ") is disconnected from other points";
messages.add (id, ss.str(), "", CSMDoc::Message::Severity_Warning);
}
}
......
......@@ -30,7 +30,7 @@ void CSMTools::ScriptCheckStage::report (const std::string& message, const Compi
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Script, mId);
stream << "Line " << loc.mLine << ", column " << loc.mColumn << " (" << loc.mLiteral << "): " << message;
stream << "line " << loc.mLine << ", column " << loc.mColumn << ": " << message << " (" << loc.mLiteral << ")";
std::ostringstream hintStream;
......
......@@ -24,7 +24,7 @@ bool Compiler::DeclarationParser::parseName (const std::string& name, const Toke
if (type!=' ')
{
/// \todo add option to make re-declared local variables an error
getErrorHandler().warning ("can't re-declare local variable (ignoring declaration)",
getErrorHandler().warning ("ignoring local variable re-declaration",
loc);
mState = State_End;
......
......@@ -422,7 +422,7 @@ namespace Compiler
{
if (!hasExplicit)
{
getErrorHandler().warning ("stray explicit reference (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray explicit reference", loc);
mExplicit.clear();
}
......@@ -791,7 +791,7 @@ namespace Compiler
++optionalCount;
}
else
getErrorHandler().warning ("Ignoring extra argument",
getErrorHandler().warning ("ignoring extra argument",
stringParser.getTokenLoc());
}
else if (*iter=='X')
......@@ -805,7 +805,7 @@ namespace Compiler
if (parser.isEmpty())
break;
else
getErrorHandler().warning("Ignoring extra argument", parser.getTokenLoc());
getErrorHandler().warning("ignoring extra argument", parser.getTokenLoc());
}
else if (*iter=='z')
{
......@@ -817,7 +817,7 @@ namespace Compiler
if (discardParser.isEmpty())
break;
else
getErrorHandler().warning("Ignoring extra argument", discardParser.getTokenLoc());
getErrorHandler().warning("ignoring extra argument", discardParser.getTokenLoc());
}
else if (*iter=='j')
{
......
......@@ -29,7 +29,7 @@ bool Compiler::JunkParser::parseName (const std::string& name, const TokenLoc& l
bool Compiler::JunkParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
{
if (keyword==mIgnoreKeyword)
reportWarning ("found junk (ignoring it)", loc);
reportWarning ("ignoring found junk", loc);
else
scanner.putbackKeyword (keyword, loc);
......@@ -39,7 +39,7 @@ bool Compiler::JunkParser::parseKeyword (int keyword, const TokenLoc& loc, Scann
bool Compiler::JunkParser::parseSpecial (int code, const TokenLoc& loc, Scanner& scanner)
{
if (code==Scanner::S_member)
reportWarning ("found junk (ignoring it)", loc);
reportWarning ("ignoring found junk", loc);
else
scanner.putbackSpecial (code, loc);
......
......@@ -88,7 +88,7 @@ namespace Compiler
{
if (mState==PotentialEndState)
{
getErrorHandler().warning ("stray string argument (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray string argument", loc);
mState = EndState;
return true;
}
......@@ -233,7 +233,7 @@ namespace Compiler
if (mState==SetPotentialMemberVarState && keyword==Scanner::K_to)
{
getErrorHandler().warning ("unknown variable (ignoring set instruction)", loc);
getErrorHandler().warning ("unknown variable, ignoring set instruction", loc);
SkipParser skip (getErrorHandler(), getContext());
scanner.scan (skip);
return false;
......@@ -286,7 +286,7 @@ namespace Compiler
{
if (!hasExplicit && mState==ExplicitState)
{
getErrorHandler().warning ("stray explicit reference (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray explicit reference", loc);
mExplicit.clear();
}
......@@ -344,7 +344,7 @@ namespace Compiler
{
if (!hasExplicit && !mExplicit.empty())
{
getErrorHandler().warning ("stray explicit reference (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray explicit reference", loc);
mExplicit.clear();
}
......@@ -360,7 +360,7 @@ namespace Compiler
if (mState==ExplicitState)
{
// drop stray explicit reference
getErrorHandler().warning ("stray explicit reference (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray explicit reference", loc);
mState = BeginState;
mExplicit.clear();
}
......@@ -412,19 +412,19 @@ namespace Compiler
case Scanner::K_else:
getErrorHandler().warning ("stray else (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray else", loc);
mState = EndState;
return true;
case Scanner::K_endif:
getErrorHandler().warning ("stray endif (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray endif", loc);
mState = EndState;
return true;
case Scanner::K_begin:
getErrorHandler().warning ("stray begin (ignoring it)", loc);
getErrorHandler().warning ("ignoring stray begin", loc);
mState = EndState;
return true;
}
......@@ -491,7 +491,7 @@ namespace Compiler
{
if (mState==EndState && code==Scanner::S_open)
{
getErrorHandler().warning ("stray '[' or '(' at the end of the line (ignoring it)",
getErrorHandler().warning ("ignoring stray '[' or '(' at the end of the line",
loc);
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment