mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Remove duplicate GetSquareRoot implementation
This commit is contained in:
parent
d3f5be0950
commit
6d7cb38834
10 changed files with 19 additions and 65 deletions
|
@ -421,42 +421,26 @@ namespace Compiler
|
|||
|
||||
if (mNextOperand)
|
||||
{
|
||||
if (keyword==Scanner::K_getsquareroot)
|
||||
// check for custom extensions
|
||||
if (const Extensions *extensions = getContext().getExtensions())
|
||||
{
|
||||
start();
|
||||
|
||||
mTokenLoc = loc;
|
||||
parseArguments ("f", scanner);
|
||||
char returnType;
|
||||
std::string argumentType;
|
||||
|
||||
Generator::squareRoot (mCode);
|
||||
mOperands.push_back ('f');
|
||||
bool hasExplicit = false;
|
||||
|
||||
mNextOperand = false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// check for custom extensions
|
||||
if (const Extensions *extensions = getContext().getExtensions())
|
||||
if (extensions->isFunction (keyword, returnType, argumentType, hasExplicit))
|
||||
{
|
||||
start();
|
||||
mTokenLoc = loc;
|
||||
int optionals = parseArguments (argumentType, scanner);
|
||||
|
||||
char returnType;
|
||||
std::string argumentType;
|
||||
extensions->generateFunctionCode (keyword, mCode, mLiterals, "", optionals);
|
||||
mOperands.push_back (returnType);
|
||||
|
||||
bool hasExplicit = false;
|
||||
|
||||
if (extensions->isFunction (keyword, returnType, argumentType, hasExplicit))
|
||||
{
|
||||
mTokenLoc = loc;
|
||||
int optionals = parseArguments (argumentType, scanner);
|
||||
|
||||
extensions->generateFunctionCode (keyword, mCode, mLiterals, "", optionals);
|
||||
mOperands.push_back (returnType);
|
||||
|
||||
mNextOperand = false;
|
||||
return true;
|
||||
}
|
||||
mNextOperand = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,11 +104,6 @@ namespace
|
|||
code.push_back (Compiler::Generator::segment5 (17));
|
||||
}
|
||||
|
||||
void opSquareRoot (Compiler::Generator::CodeContainer& code)
|
||||
{
|
||||
code.push_back (Compiler::Generator::segment5 (19));
|
||||
}
|
||||
|
||||
void opReturn (Compiler::Generator::CodeContainer& code)
|
||||
{
|
||||
code.push_back (Compiler::Generator::segment5 (20));
|
||||
|
@ -452,11 +447,6 @@ namespace Compiler::Generator
|
|||
}
|
||||
}
|
||||
|
||||
void squareRoot (CodeContainer& code)
|
||||
{
|
||||
opSquareRoot (code);
|
||||
}
|
||||
|
||||
void exit (CodeContainer& code)
|
||||
{
|
||||
opReturn (code);
|
||||
|
|
|
@ -74,8 +74,6 @@ namespace Compiler
|
|||
|
||||
void convert (CodeContainer& code, char fromType, char toType);
|
||||
|
||||
void squareRoot (CodeContainer& code);
|
||||
|
||||
void exit (CodeContainer& code);
|
||||
|
||||
void message (CodeContainer& code, Literals& literals, const std::string& message,
|
||||
|
|
|
@ -265,7 +265,6 @@ namespace Compiler
|
|||
"return",
|
||||
"messagebox",
|
||||
"set", "to",
|
||||
"getsquareroot",
|
||||
nullptr
|
||||
};
|
||||
|
||||
|
|
|
@ -205,8 +205,7 @@ namespace Compiler
|
|||
K_while, K_endwhile,
|
||||
K_return,
|
||||
K_messagebox,
|
||||
K_set, K_to,
|
||||
K_getsquareroot
|
||||
K_set, K_to
|
||||
};
|
||||
|
||||
enum special
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Compiler
|
|||
keyword==Scanner::K_elseif || keyword==Scanner::K_while ||
|
||||
keyword==Scanner::K_endwhile || keyword==Scanner::K_return ||
|
||||
keyword==Scanner::K_messagebox || keyword==Scanner::K_set ||
|
||||
keyword==Scanner::K_to || keyword==Scanner::K_getsquareroot)
|
||||
keyword==Scanner::K_to)
|
||||
{
|
||||
// pretend this is not a keyword
|
||||
std::string name = loc.mLiteral;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue