From 90b38cbfbebc2bcb5a5f4b36305f783749da3191 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 27 Apr 2013 14:06:23 +0200 Subject: [PATCH] fixed parsing of end statements in scripts with IDs matching keywords --- components/compiler/fileparser.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/compiler/fileparser.cpp b/components/compiler/fileparser.cpp index 98be2d3d1f..185af4a513 100644 --- a/components/compiler/fileparser.cpp +++ b/components/compiler/fileparser.cpp @@ -71,6 +71,19 @@ namespace Compiler return true; } + if (mState==EndNameState) + { + // optional repeated name after end statement + if (mName!=loc.mLiteral) + reportWarning ("Names for script " + mName + " do not match", loc); + + mState = EndCompleteState; + return false; // we are stopping here, because there might be more garbage on the end line, + // that we must ignore. + // + /// \todo allow this workaround to be disabled for newer scripts + } + return Parser::parseKeyword (keyword, loc, scanner); }