mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
allow use of IDs as function arguments, even if the ID matches a keyword (Fixes #2830)
This commit is contained in:
parent
8c8c5328dc
commit
cbf9f83b85
4 changed files with 48 additions and 2 deletions
|
@ -222,6 +222,23 @@ namespace Compiler
|
|||
|
||||
bool LineParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
|
||||
{
|
||||
if (mState==MessageState || mState==MessageCommaState)
|
||||
{
|
||||
if (const Extensions *extensions = getContext().getExtensions())
|
||||
{
|
||||
std::string argumentType; // ignored
|
||||
bool hasExplicit = false; // ignored
|
||||
if (extensions->isInstruction (keyword, argumentType, hasExplicit))
|
||||
{
|
||||
// pretend this is not a keyword
|
||||
std::string name = loc.mLiteral;
|
||||
if (name.size()>=2 && name[0]=='"' && name[name.size()-1]=='"')
|
||||
name = name.substr (1, name.size()-2);
|
||||
return parseName (name, loc, scanner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mState==SetMemberVarState)
|
||||
{
|
||||
mMemberName = loc.mLiteral;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue