|
|
@ -1,5 +1,7 @@
|
|
|
|
#include "fileparser.hpp"
|
|
|
|
#include "fileparser.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <components/misc/strings/algorithm.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include "scanner.hpp"
|
|
|
|
#include "scanner.hpp"
|
|
|
|
#include "tokenloc.hpp"
|
|
|
|
#include "tokenloc.hpp"
|
|
|
|
|
|
|
|
|
|
|
@ -12,11 +14,6 @@ namespace Compiler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string FileParser::getName() const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return mName;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Interpreter::Program FileParser::getProgram() const
|
|
|
|
Interpreter::Program FileParser::getProgram() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return mScriptParser.getProgram();
|
|
|
|
return mScriptParser.getProgram();
|
|
|
@ -39,7 +36,7 @@ namespace Compiler
|
|
|
|
if (mState == EndNameState)
|
|
|
|
if (mState == EndNameState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// optional repeated name after end statement
|
|
|
|
// optional repeated name after end statement
|
|
|
|
if (mName != name)
|
|
|
|
if (!Misc::StringUtils::ciEqual(mName, name))
|
|
|
|
reportWarning("Names for script " + mName + " do not match", loc);
|
|
|
|
reportWarning("Names for script " + mName + " do not match", loc);
|
|
|
|
|
|
|
|
|
|
|
|
mState = EndCompleteState;
|
|
|
|
mState = EndCompleteState;
|
|
|
@ -79,7 +76,7 @@ namespace Compiler
|
|
|
|
if (mState == EndNameState)
|
|
|
|
if (mState == EndNameState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// optional repeated name after end statement
|
|
|
|
// optional repeated name after end statement
|
|
|
|
if (mName != loc.mLiteral)
|
|
|
|
if (!Misc::StringUtils::ciEqual(mName, loc.mLiteral))
|
|
|
|
reportWarning("Names for script " + mName + " do not match", loc);
|
|
|
|
reportWarning("Names for script " + mName + " do not match", loc);
|
|
|
|
|
|
|
|
|
|
|
|
mState = EndCompleteState;
|
|
|
|
mState = EndCompleteState;
|
|
|
|