mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-03 10:03:49 -04:00
some argument parsing cleanup
This commit is contained in:
parent
a9f9dec923
commit
11a2c767cc
@ -777,11 +777,22 @@ namespace Compiler
|
|||||||
++optionalCount;
|
++optionalCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (*iter=='X')
|
||||||
|
{
|
||||||
|
parser.reset();
|
||||||
|
|
||||||
|
parser.setOptional (true);
|
||||||
|
|
||||||
|
scanner.scan (parser);
|
||||||
|
|
||||||
|
if (optional && parser.isEmpty())
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parser.reset();
|
parser.reset();
|
||||||
|
|
||||||
if (optional || *iter == 'X')
|
if (optional)
|
||||||
parser.setOptional (true);
|
parser.setOptional (true);
|
||||||
|
|
||||||
scanner.scan (parser);
|
scanner.scan (parser);
|
||||||
@ -789,8 +800,6 @@ namespace Compiler
|
|||||||
if (optional && parser.isEmpty())
|
if (optional && parser.isEmpty())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (*iter != 'X')
|
|
||||||
{
|
|
||||||
std::vector<Interpreter::Type_Code> tmp;
|
std::vector<Interpreter::Type_Code> tmp;
|
||||||
|
|
||||||
char type = parser.append (tmp);
|
char type = parser.append (tmp);
|
||||||
@ -804,7 +813,6 @@ namespace Compiler
|
|||||||
++optionalCount;
|
++optionalCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
while (!stack.empty())
|
while (!stack.empty())
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ namespace Compiler
|
|||||||
s - Short <BR>
|
s - Short <BR>
|
||||||
S - String, case preserved <BR>
|
S - String, case preserved <BR>
|
||||||
x - Optional, ignored string argument
|
x - Optional, ignored string argument
|
||||||
X - Optional, ignored integer argument
|
X - Optional, ignored float argument
|
||||||
**/
|
**/
|
||||||
typedef std::string ScriptArgs;
|
typedef std::string ScriptArgs;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user