2075
Thanks Caleb Couch for bugfixes 2072-2075.
This commit is contained in:
parent
0cfc678fdc
commit
e85cb85b68
16
040brace.cc
16
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user