Reworking the keyword parser, also fixed some dynamic linking issues

This commit is contained in:
2025-01-20 18:54:05 -05:00
parent a01f6f4e7b
commit 2d531b28b3
9 changed files with 243 additions and 118 deletions

View File

@@ -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();