diff --git a/components/compiler/fileparser.cpp b/components/compiler/fileparser.cpp index f8b3d0e61..6e3e1de69 100644 --- a/components/compiler/fileparser.cpp +++ b/components/compiler/fileparser.cpp @@ -59,6 +59,15 @@ namespace Compiler return true; } + if (mState==NameState) + { + // keywords can be used as script names too. Thank you Morrowind for another + // syntactic perversity :( + mName = loc.mLiteral; + mState = BeginCompleteState; + return true; + } + return Parser::parseKeyword (keyword, loc, scanner); }