re-expose new_ident in a restricted way

master
Daniel Kolesa 2021-04-04 19:53:59 +02:00
parent 1624938c0b
commit c2de63be25
2 changed files with 6 additions and 0 deletions

View File

@ -371,6 +371,8 @@ struct LIBCUBESCRIPT_EXPORT state {
std::string_view n, std::string_view v, bool read_only = false,
var_type vtp = var_type::DEFAULT
);
ident *new_ident(std::string_view n);
void reset_var(std::string_view name);
void touch_var(std::string_view name);

View File

@ -464,6 +464,10 @@ LIBCUBESCRIPT_EXPORT string_var *state::new_svar(
return sv;
}
LIBCUBESCRIPT_EXPORT ident *state::new_ident(std::string_view n) {
return p_tstate->istate->new_ident(*this, n, IDENT_FLAG_UNKNOWN);
}
LIBCUBESCRIPT_EXPORT void state::reset_var(std::string_view name) {
ident *id = get_ident(name);
if (!id) {