Skip to content

Commit

Permalink
remove state::get_idents
Browse files Browse the repository at this point in the history
this was never going to be good from API standpoint, and is no
longer necessary (can use ident_count + get_ident by index with
a loop, for example)
  • Loading branch information
q66 committed May 15, 2021
1 parent 4fb6b9a commit d748b0e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
6 changes: 0 additions & 6 deletions include/cubescript/cubescript/state.hh
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,6 @@ struct LIBCUBESCRIPT_EXPORT state {
);
}

/** @brief Get a span of all idents */
span_type<ident *> get_idents();

/** @brief Get a span of all idents */
span_type<ident const *> get_idents() const;

/** @brief Compile a string.
*
* This compiles the given string, optionally using `source` as a filename
Expand Down
13 changes: 0 additions & 13 deletions src/cs_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,19 +346,6 @@ LIBCUBESCRIPT_EXPORT ident const &state::get_ident(std::size_t index) const {
return *p_tstate->istate->identmap[index];
}


LIBCUBESCRIPT_EXPORT span_type<ident *> state::get_idents() {
return span_type<ident *>{
p_tstate->istate->identmap.data(),
p_tstate->istate->identmap.size()
};
}

LIBCUBESCRIPT_EXPORT span_type<ident const *> state::get_idents() const {
auto ptr = const_cast<ident const **>(p_tstate->istate->identmap.data());
return span_type<ident const *>{ptr, p_tstate->istate->identmap.size()};
}

LIBCUBESCRIPT_EXPORT void state::clear_override(ident &id) {
if (!id.is_overridden(*this)) {
return;
Expand Down

0 comments on commit d748b0e

Please sign in to comment.