From c2de63be255998b9aee6ecd250732839e321c012 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Sun, 4 Apr 2021 19:53:59 +0200 Subject: [PATCH] re-expose new_ident in a restricted way --- include/cubescript/cubescript.hh | 2 ++ src/cs_state.cc | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index 29e06fb..319eb9a 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -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); diff --git a/src/cs_state.cc b/src/cs_state.cc index 2fb6ce8..5a08b1b 100644 --- a/src/cs_state.cc +++ b/src/cs_state.cc @@ -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) {