From a8ca0b376fe707459aefa2b9f575aee2487b0efc Mon Sep 17 00:00:00 2001 From: q66 Date: Thu, 13 Aug 2015 23:18:48 +0100 Subject: [PATCH] private --- cubescript.cc | 4 ++-- cubescript.hh | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cubescript.cc b/cubescript.cc index 7808c5e..98e2d30 100644 --- a/cubescript.cc +++ b/cubescript.cc @@ -4714,7 +4714,7 @@ void init_lib_string(CsState &cs) { cs.add_command("escape", "s", [](CsState &cs, char *s) { auto x = ostd::appender(); util::escape_string(x, s); - ostd::Size len = x.get().size(); + ostd::Size len = x.size(); cs.result->set_str(ostd::CharRange(x.get().disown(), len)); }); @@ -4763,7 +4763,7 @@ void init_lib_string(CsState &cs) { auto r = ostd::appender>(); ostd::format(r, "0x%.*X", ostd::max(*p, 1), *n); r.put('\0'); - ostd::Size len = r.get().size() - 1; + ostd::Size len = r.size() - 1; cs.result->set_str(ostd::CharRange(r.get().disown(), len)); }); diff --git a/cubescript.hh b/cubescript.hh index a14b04d..beeb367 100644 --- a/cubescript.hh +++ b/cubescript.hh @@ -433,30 +433,32 @@ inline bool check_alias(Ident *id) { } struct StackedValue: TaggedValue { - IdentStack stack; Ident *id; - bool pushed; StackedValue(Ident *id = nullptr): - TaggedValue(), stack(), id(id), pushed(false) {} + TaggedValue(), id(id), p_stack(), p_pushed(false) {} ~StackedValue() { pop(); } bool push() { - if (pushed || !id) return false; - id->push_arg(*this, stack); - pushed = true; + if (p_pushed || !id) return false; + id->push_arg(*this, p_stack); + p_pushed = true; return true; } bool pop() { - if (!pushed || !id) return false; + if (!p_pushed || !id) return false; id->pop_arg(); - pushed = false; + p_pushed = false; return true; } + +private: + IdentStack p_stack; + bool p_pushed; }; namespace util {