From ea1642b3f969463a49e5a671478c92e4ef129665 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 13 Jun 2010 05:02:14 -0400 Subject: Completely reworked argument passing in expressions --- src/item.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/item.cc') diff --git a/src/item.cc b/src/item.cc index f59c9e29..f0273e59 100644 --- a/src/item.cc +++ b/src/item.cc @@ -32,7 +32,6 @@ #include #include "item.h" -#include "interactive.h" namespace ledger { @@ -256,9 +255,9 @@ namespace { if (args.size() == 1) { if (args[0].is_string()) - return item.has_tag(args[0].as_string()); + return item.has_tag(args.get(0)); else if (args[0].is_mask()) - return item.has_tag(args[0].as_mask()); + return item.has_tag(args.get(0)); else throw_(std::runtime_error, _("Expected string or mask for argument 1, but received %1") @@ -266,7 +265,7 @@ namespace { } else if (args.size() == 2) { if (args[0].is_mask() && args[1].is_mask()) - return item.has_tag(args[0].to_mask(), args[1].to_mask()); + return item.has_tag(args.get(0), args.get(1)); else throw_(std::runtime_error, _("Expected masks for arguments 1 and 2, but received %1 and %2") @@ -288,9 +287,9 @@ namespace { if (args.size() == 1) { if (args[0].is_string()) - val = item.get_tag(args[0].as_string()); + val = item.get_tag(args.get(0)); else if (args[0].is_mask()) - val = item.get_tag(args[0].as_mask()); + val = item.get_tag(args.get(0)); else throw_(std::runtime_error, _("Expected string or mask for argument 1, but received %1") @@ -298,7 +297,7 @@ namespace { } else if (args.size() == 2) { if (args[0].is_mask() && args[1].is_mask()) - val = item.get_tag(args[0].to_mask(), args[1].to_mask()); + val = item.get_tag(args.get(0), args.get(1)); else throw_(std::runtime_error, _("Expected masks for arguments 1 and 2, but received %1 and %2") -- cgit v1.2.3