diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-08-24 20:25:37 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-08-24 20:25:37 -0700 |
commit | e85cb85b68cb844484bf842a5837a72869942a17 (patch) | |
tree | beb18593ca76bab14a034c422f98730fe97382aa | |
parent | 0cfc678fdc686c0216ea238ff197e0e54e4a3f8c (diff) | |
download | mu-e85cb85b68cb844484bf842a5837a72869942a17.tar.gz |
2075
Thanks Caleb Couch for bugfixes 2072-2075.
-rw-r--r-- | 040brace.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/040brace.cc b/040brace.cc index 7819cd58..9615ba58 100644 --- a/040brace.cc +++ b/040brace.cc @@ -75,6 +75,13 @@ void transform_braces(const recipe_ordinal r) { trace("after-brace") << inst.name << " ..." << end(); continue; } + // check for errors + if (inst.name.find("-if") != string::npos || inst.name.find("-unless") != string::npos) { + if (inst.ingredients.empty()) { + raise << inst.name << " expects 1 or 2 ingredients, but got none\n" << end(); + continue; + } + } // update instruction operation if (inst.name.find("-if") != string::npos) inst.operation = Recipe_ordinal["jump-if"]; @@ -363,3 +370,12 @@ recipe main [ break ] +warn: break needs a '{' before + +:(scenario break_conditional_without_ingredient_warns) +% Hide_warnings = true; +recipe main [ + { + break-if + } +] ++warn: break-if expects 1 or 2 ingredients, but got none |