From cfb142b9601cc648f15bf5738a3df09a23835e41 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 2 Aug 2015 22:18:19 -0700 Subject: 1923 Still iterating on the right way to handle incorrect number of ingredients. My first idea of creating null results doesn't really work once they're used in later instructions. Just add a warning at one place in the run loop, but otherwise only add products when there's something to save in them. Undoes some work around commit 1886. --- 064random.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '064random.cc') diff --git a/064random.cc b/064random.cc index cdc519c9..bd171132 100644 --- a/064random.cc +++ b/064random.cc @@ -27,7 +27,6 @@ ROUND, Recipe_ordinal["round"] = ROUND; :(before "End Primitive Recipe Implementations") case ROUND: { - products.resize(1); if (SIZE(ingredients) != 1) { raise << current_recipe_name() << ": 'round' requires exactly one ingredient, but got " << current_instruction().to_string() << '\n' << end(); break; @@ -36,6 +35,7 @@ case ROUND: { raise << current_recipe_name() << ": first ingredient of 'round' should be a number, but got " << current_instruction().ingredients.at(0).original_string << '\n' << end(); break; } + products.resize(1); products.at(0).push_back(rint(ingredients.at(0).at(0))); break; } -- cgit 1.4.1-2-gfad0