mirror of
https://github.com/correl/rebar.git
synced 2024-11-14 19:19:30 +00:00
A switch variable can have multiple values
This commit is contained in:
parent
0e39dc4149
commit
51584caa3e
1 changed files with 4 additions and 3 deletions
|
@ -385,10 +385,11 @@ execute_template(Files, [{'if', Cond, True, False} | Rest], TemplateType,
|
|||
execute_template(Files, prepend_instructions(Instructions, Rest),
|
||||
TemplateType, TemplateName, Context, Force,
|
||||
ExistingFiles);
|
||||
execute_template(Files, [{'case', Variable, Value, Instructions} | Rest], TemplateType,
|
||||
execute_template(Files, [{'case', Variable, Values, Instructions} | Rest], TemplateType,
|
||||
TemplateName, Context, Force, ExistingFiles) ->
|
||||
Instructions2 = case dict:find(Variable, Context) of
|
||||
{ok, Value} ->
|
||||
{ok, Value} = dict:find(Variable, Context),
|
||||
Instructions2 = case lists:member(Value, Values) of
|
||||
true ->
|
||||
Instructions;
|
||||
_ ->
|
||||
[]
|
||||
|
|
Loading…
Reference in a new issue