From 713f308d0fda2cef2f171feac860e65d5483e56d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 8 May 2010 02:01:59 -0400 Subject: interactive_t now takes an "X" for expressions --- src/interactive.cc | 4 ++++ src/interactive.h | 13 +++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/interactive.cc b/src/interactive.cc index d0baf07a..9aeb5307 100644 --- a/src/interactive.cc +++ b/src/interactive.cc @@ -122,6 +122,10 @@ void interactive_t::verify_arguments() const label = _("a scope"); wrong_arg = ! next_arg->is_scope(); break; + case 'X': + label = _("an expression"); + wrong_arg = ! next_arg->is_expr(); + break; case 'S': label = _("a sequence"); wrong_arg = false; diff --git a/src/interactive.h b/src/interactive.h index fbc4ffeb..04c23ae5 100644 --- a/src/interactive.h +++ b/src/interactive.h @@ -120,6 +120,19 @@ inline const value_t::sequence_t& interactive_t::get(std::size_t index) { return value_at(index).as_sequence(); } +template <> +inline scope_t * +interactive_t::get(std::size_t index) { + return value_at(index).as_scope(); +} +template <> +inline expr_t& interactive_t::get(std::size_t index) { + return value_at(index).as_expr_lval(); +} +template <> +inline const expr_t& interactive_t::get(std::size_t index) { + return value_at(index).as_expr(); +} template class in_context_t : public interactive_t -- cgit v1.2.3