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 | |
parent | d4b783618812c097262c0d2a002fa96698c8607f (diff) | |
download | ydb-9762d6d10b478ec2dadd9d91e716738ea937e3a3.tar.gz |
Reimport boost/crc as a separate project
-rw-r--r-- | CMakeLists.darwin.txt | 1 | ||||
-rw-r--r-- | CMakeLists.linux.txt | 1 | ||||
-rw-r--r-- | contrib/restricted/boost/CMakeLists.txt | 1 | ||||
-rw-r--r-- | contrib/restricted/boost/crc/CMakeLists.txt | 19 | ||||
-rw-r--r-- | contrib/restricted/boost/crc/include/boost/crc.hpp (renamed from contrib/restricted/boost/boost/crc.hpp) | 0 | ||||
-rw-r--r-- | library/cpp/lua/eval.cpp | 18 | ||||
-rw-r--r-- | library/cpp/lua/eval.h | 2 |
7 files changed, 42 insertions, 0 deletions
diff --git a/CMakeLists.darwin.txt b/CMakeLists.darwin.txt index 417873248a..fe3c9772a8 100644 --- a/CMakeLists.darwin.txt +++ b/CMakeLists.darwin.txt @@ -141,6 +141,7 @@ add_subdirectory(contrib/restricted/boost/static_assert) add_subdirectory(contrib/restricted/boost/throw_exception) add_subdirectory(contrib/restricted/boost/array) add_subdirectory(contrib/restricted/boost/bind) +add_subdirectory(contrib/restricted/boost/crc) add_subdirectory(contrib/restricted/boost/integer) add_subdirectory(contrib/restricted/boost/io) add_subdirectory(contrib/restricted/boost/logic) diff --git a/CMakeLists.linux.txt b/CMakeLists.linux.txt index ea5cc0499c..bc1866b557 100644 --- a/CMakeLists.linux.txt +++ b/CMakeLists.linux.txt @@ -219,6 +219,7 @@ add_subdirectory(contrib/restricted/boost/static_assert) add_subdirectory(contrib/restricted/boost/throw_exception) add_subdirectory(contrib/restricted/boost/array) add_subdirectory(contrib/restricted/boost/bind) +add_subdirectory(contrib/restricted/boost/crc) add_subdirectory(contrib/restricted/boost/integer) add_subdirectory(contrib/restricted/boost/io) add_subdirectory(contrib/restricted/boost/logic) diff --git a/contrib/restricted/boost/CMakeLists.txt b/contrib/restricted/boost/CMakeLists.txt index c8d4b64981..551f2d373a 100644 --- a/contrib/restricted/boost/CMakeLists.txt +++ b/contrib/restricted/boost/CMakeLists.txt @@ -19,6 +19,7 @@ target_link_libraries(contrib-restricted-boost INTERFACE restricted-boost-bind restricted-boost-config restricted-boost-core + restricted-boost-crc restricted-boost-integer restricted-boost-io restricted-boost-logic diff --git a/contrib/restricted/boost/crc/CMakeLists.txt b/contrib/restricted/boost/crc/CMakeLists.txt new file mode 100644 index 0000000000..3629d2b911 --- /dev/null +++ b/contrib/restricted/boost/crc/CMakeLists.txt @@ -0,0 +1,19 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(restricted-boost-crc INTERFACE) +target_include_directories(restricted-boost-crc INTERFACE + ${CMAKE_SOURCE_DIR}/contrib/restricted/boost/crc/include +) +target_link_libraries(restricted-boost-crc INTERFACE + contrib-libs-cxxsupp + yutil + restricted-boost-config + restricted-boost-integer +) diff --git a/contrib/restricted/boost/boost/crc.hpp b/contrib/restricted/boost/crc/include/boost/crc.hpp index 6be5aa1d8b..6be5aa1d8b 100644 --- a/contrib/restricted/boost/boost/crc.hpp +++ b/contrib/restricted/boost/crc/include/boost/crc.hpp diff --git a/library/cpp/lua/eval.cpp b/library/cpp/lua/eval.cpp index 5c78d0ad3f..0d3fe3b0f1 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); diff --git a/library/cpp/lua/eval.h b/library/cpp/lua/eval.h index 77c59d7efd..4a925ec223 100644 --- a/library/cpp/lua/eval.h +++ b/library/cpp/lua/eval.h @@ -36,6 +36,7 @@ public: void ParseChunk(TStringBuf code); TString Preprocess(TStringBuf line); TString PreprocessOne(TStringBuf line); + bool CheckEmptyStack(); struct TExpression { TString Name; @@ -44,6 +45,7 @@ public: TExpression Compile(TStringBuf expression); TExpression CompileFunction(TStringBuf expression); TExpression CompileRaw(TStringBuf body, const TString& name); + TString DumpStack(); TString EvalCompiled(const TExpression& compiled); void EvalCompiledRaw(const TExpression& compiled); bool EvalCompiledCondition(const TExpression& compiled); |