diff options
author | bugaevskiy <bugaevskiy@yandex-team.com> | 2022-07-27 10:10:14 +0300 |
---|---|---|
committer | bugaevskiy <bugaevskiy@yandex-team.com> | 2022-07-27 10:10:14 +0300 |
commit | 9762d6d10b478ec2dadd9d91e716738ea937e3a3 (patch) | |
tree | 8787d9155ad149a40855e65e7cff01fc426f6464 /library/cpp/lua/eval.cpp | |
parent | d4b783618812c097262c0d2a002fa96698c8607f (diff) | |
download | ydb-9762d6d10b478ec2dadd9d91e716738ea937e3a3.tar.gz |
Reimport boost/crc as a separate project
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); |