mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
added new argument type: z (optional, any)
This commit is contained in:
parent
11a2c767cc
commit
aa8c0bccb4
5 changed files with 131 additions and 3 deletions
|
@ -16,6 +16,7 @@
|
|||
#include "stringparser.hpp"
|
||||
#include "extensions.hpp"
|
||||
#include "context.hpp"
|
||||
#include "discardparser.hpp"
|
||||
|
||||
namespace Compiler
|
||||
{
|
||||
|
@ -743,6 +744,7 @@ namespace Compiler
|
|||
|
||||
ExprParser parser (getErrorHandler(), getContext(), mLocals, mLiterals, true);
|
||||
StringParser stringParser (getErrorHandler(), getContext(), mLiterals);
|
||||
DiscardParser discardParser (getErrorHandler(), getContext());
|
||||
|
||||
std::stack<std::vector<Interpreter::Type_Code> > stack;
|
||||
|
||||
|
@ -785,7 +787,17 @@ namespace Compiler
|
|||
|
||||
scanner.scan (parser);
|
||||
|
||||
if (optional && parser.isEmpty())
|
||||
if (parser.isEmpty())
|
||||
break;
|
||||
}
|
||||
else if (*iter=='z')
|
||||
{
|
||||
discardParser.reset();
|
||||
discardParser.setOptional (true);
|
||||
|
||||
scanner.scan (discardParser);
|
||||
|
||||
if (discardParser.isEmpty())
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue