Reworking the keyword parser, also fixed some dynamic linking issues
This commit is contained in:
@@ -243,13 +243,14 @@ public:
|
||||
void PrettyPrintOptions::parse(LuaKeywordParser &kp) {
|
||||
LuaVar option;
|
||||
LuaExtStack LS(kp.state(), option);
|
||||
if (kp.parse(option, "indent")) {
|
||||
kp.check_throw();
|
||||
if (kp.optional(option, "indent")) {
|
||||
indent = LS.ckboolean(option);
|
||||
}
|
||||
if (kp.parse(option, "level")) {
|
||||
if (kp.optional(option, "level")) {
|
||||
level = LS.ckint(option);
|
||||
}
|
||||
if (kp.parse(option, "expand")) {
|
||||
if (kp.optional(option, "expand")) {
|
||||
expand = LS.ckboolean(option);
|
||||
}
|
||||
}
|
||||
@@ -306,7 +307,7 @@ LuaDefine(string_pprintx, "options",
|
||||
PrettyPrintOptions options;
|
||||
LuaKeywordParser kp(LS, loptions);
|
||||
options.parse(kp);
|
||||
if (!kp.parse(value, "value")) {
|
||||
if (!kp.optional(value, "value")) {
|
||||
LS.set(value, LuaNil);
|
||||
}
|
||||
kp.final_check_throw();
|
||||
|
||||
Reference in New Issue
Block a user