From c82d01762778baeb71c26365479e3c1cddcfbf13 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 26 Mar 2015 17:03:07 -0700 Subject: 973 --- cpp/013run | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpp/013run') diff --git a/cpp/013run b/cpp/013run index 5173f6f3..33385e00 100644 --- a/cpp/013run +++ b/cpp/013run @@ -118,9 +118,8 @@ recipes_added_by_test.clear(); //: beware: overridden in later layers vector read_memory(reagent x) { //? cout << "read_memory: " << x.to_string() << '\n'; //? 1 - static const int LITERAL = Type_number["literal"]; vector result; - if (x.types[0] == LITERAL) { + if (isa_literal(x)) { result.push_back(x.value); return result; } @@ -157,6 +156,10 @@ bool is_dummy(const reagent& x) { return x.name == "_"; } +bool isa_literal(const reagent& r) { + return r.types.size() == 1 && r.types[0] == 0; +} + :(scenario run_label) recipe main [ +foo -- cgit 1.4.1-2-gfad0