diff options
Diffstat (limited to 'library/cpp/lua/eval.cpp')
| -rw-r--r-- | library/cpp/lua/eval.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/library/cpp/lua/eval.cpp b/library/cpp/lua/eval.cpp index 5c78d0ad3f3..0d3fe3b0f13 100644 --- a/library/cpp/lua/eval.cpp +++ b/library/cpp/lua/eval.cpp @@ -109,6 +109,15 @@ TLuaEval::TExpression TLuaEval::CompileRaw(TStringBuf body, const TString& name) return { name }; } +TString TLuaEval::DumpStack() { + TString result; + { + TStringOutput so(result); + LuaState_.DumpStack(&so); + } + return result; +} + TString TLuaEval::GenerateName() { TGuard<TMutex> guard(LuaMutex_); return "dummy_" + ToString(FunctionNameCounter_++); @@ -167,6 +176,15 @@ TString TLuaEval::PreprocessOne(TStringBuf line) { return ToString(before) + res + ToString(after); } +bool TLuaEval::CheckEmptyStack() { + for (int i = 1; i <= LuaState_.on_stack(); ++i) { + if (!LuaState_.is_nil(-1 * i)) { + return false; + } + } + return true; +} + TString TLuaEval::Preprocess(TStringBuf line) { TString res = ToString(line); |
