| 3 | #include <chaiscript/dispatchkit/function_call.hpp> |
| 4 | |
| 5 | int main( int /*argc*/ , char * /*argv*/[] ) |
| 6 | { |
| 7 | chaiscript::ChaiScript ch; |
| 8 | |
| 9 | |
| 10 | try |
| 11 | { |
| 12 | static const char script[ ] = |
| 13 | R""( |
| 14 | |
| 15 | class Rectangle |
| 16 | { |
| 17 | def Rectangle() { } |
| 18 | } |
| 19 | |
| 20 | var rect = Rectangle( ); |
| 21 | |
| 22 | )""; |
| 23 | |
| 24 | |
| 25 | ch.eval( script ); |
| 26 | } |
| 27 | catch ( const std::exception &e ) |
| 28 | { |
| 29 | printf( " >>> Exception thrown: %s \n" , e.what( ) ); |
| 30 | } |
| 31 | |
| 32 | return 1; |
| 33 | } |