Implement the 'keywords' lua module
This commit is contained in:
@@ -518,10 +518,8 @@ private:
|
||||
int size_;
|
||||
|
||||
public:
|
||||
LuaExtraArgs() {
|
||||
index_ = 0;
|
||||
size_ = 0;
|
||||
}
|
||||
LuaExtraArgs() : index_(0), size_(0) {}
|
||||
LuaExtraArgs(int i, int s) : index_(i), size_(s) {}
|
||||
|
||||
LuaSpecial operator[] (int n) const { return LuaSpecial(index_ + n); }
|
||||
int size() const { return size_; }
|
||||
@@ -1186,7 +1184,9 @@ public:
|
||||
|
||||
~LuaExtStack() {
|
||||
if (!lua_isthrowing(L_)) {
|
||||
lua_settop(L_, oldtop_);
|
||||
if (lua_gettop(L_) > oldtop_) {
|
||||
lua_settop(L_, oldtop_);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1247,13 +1247,13 @@ public:
|
||||
// Fetch the value of the keyword. If the keyword is found, then the
|
||||
// keyword is added to the [FOUND] set, the value is returned in slot,
|
||||
// and returns true. Otherwise, sets slot to nil and returns false.
|
||||
bool optional(LuaSlot slot, const char *kw);
|
||||
bool optional(LuaSlot slot, std::string_view kw);
|
||||
|
||||
// Fetch the value of the keyword. If the keyword is found, then the
|
||||
// keyword is added to the [FOUND] set, the value is returned in slot,
|
||||
// and returns true. Otherwise, sets slot to nil, returns false, and
|
||||
// stores an [ERROR] report in the keyword table.
|
||||
bool required(LuaSlot slot, const char *kw);
|
||||
bool required(LuaSlot slot, std::string_view kw);
|
||||
|
||||
// Check if there are any errors so far. If any error has been
|
||||
// detected, returns an error message, otherwise, returns empty
|
||||
|
||||
Reference in New Issue
Block a user