mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 08:46:53 +08:00
I initially tried to use the existing .clang-format file, but it does not match the code style (at least with clang-format 11) and the formatting is not consistent across files. Therefore, I decided to rewrite the .clang-format with some personal preferences. Used command find . -iname "*.hpp" -o -iname "*.cpp" | xargs clang-format -i -style=file
28 lines
510 B
C++
28 lines
510 B
C++
#include <chaiscript/chaiscript.hpp>
|
|
#include <chaiscript/dispatchkit/bootstrap_stl.hpp>
|
|
#include <chaiscript/dispatchkit/function_call.hpp>
|
|
|
|
int main(int /*argc*/, char * /*argv*/[]) {
|
|
chaiscript::ChaiScript ch;
|
|
|
|
try {
|
|
static const char script[] =
|
|
R""(
|
|
|
|
class Rectangle
|
|
{
|
|
def Rectangle() { }
|
|
}
|
|
|
|
var rect = Rectangle( );
|
|
|
|
)"";
|
|
|
|
ch.eval(script);
|
|
} catch (const std::exception &e) {
|
|
printf(" >>> Exception thrown: %s \n", e.what());
|
|
}
|
|
|
|
return 1;
|
|
}
|