2021-03-23 23:29:32 +01:00
|
|
|
#ifndef LIBCUBESCRIPT_VM_HH
|
|
|
|
#define LIBCUBESCRIPT_VM_HH
|
2016-08-12 18:38:43 +02:00
|
|
|
|
2021-03-24 20:33:20 +01:00
|
|
|
#include <cubescript/cubescript.hh>
|
2016-08-12 18:38:43 +02:00
|
|
|
|
2021-03-23 01:11:21 +01:00
|
|
|
#include "cs_std.hh"
|
2021-03-22 22:33:01 +01:00
|
|
|
#include "cs_ident.hh"
|
2021-03-24 20:33:20 +01:00
|
|
|
#include "cs_thread.hh"
|
2016-09-08 23:42:14 +02:00
|
|
|
|
2021-05-13 04:48:55 +02:00
|
|
|
#include <utility>
|
|
|
|
|
2021-03-23 23:32:25 +01:00
|
|
|
namespace cubescript {
|
2016-08-12 18:38:43 +02:00
|
|
|
|
2021-03-24 02:21:27 +01:00
|
|
|
struct break_exception {
|
2016-09-14 23:24:13 +02:00
|
|
|
};
|
|
|
|
|
2021-03-24 02:21:27 +01:00
|
|
|
struct continue_exception {
|
2016-08-12 18:38:43 +02:00
|
|
|
};
|
|
|
|
|
2021-03-27 00:26:59 +01:00
|
|
|
void exec_command(
|
2021-04-03 03:14:52 +02:00
|
|
|
thread_state &ts, command_impl *id, ident *self, any_value *args,
|
|
|
|
any_value &res, std::size_t nargs, bool lookup = false
|
2021-03-27 00:26:59 +01:00
|
|
|
);
|
|
|
|
|
2021-05-14 23:31:27 +02:00
|
|
|
any_value exec_alias(
|
|
|
|
thread_state &ts, alias *a, any_value *args,
|
|
|
|
std::size_t callargs, alias_stack &astack
|
2021-03-27 00:26:59 +01:00
|
|
|
);
|
|
|
|
|
2021-05-14 02:54:29 +02:00
|
|
|
any_value exec_code_with_args(thread_state &ts, bcode_ref const &body);
|
|
|
|
|
2021-03-27 00:26:59 +01:00
|
|
|
std::uint32_t *vm_exec(
|
|
|
|
thread_state &ts, std::uint32_t *code, any_value &result
|
|
|
|
);
|
|
|
|
|
2021-03-23 23:32:25 +01:00
|
|
|
} /* namespace cubescript */
|
2016-08-12 18:38:43 +02:00
|
|
|
|
2021-03-23 23:29:32 +01:00
|
|
|
#endif /* LIBCUBESCRIPT_VM_HH */
|