DescriptionAdd support for "else if" in gyp conditions
Right now, a gyp condition consists of exactly two or three parts:
[cond_expr, true_dict]
[cond_expr, true_dict, false_dict]
This means if we want to have an "else if" condition, it needs to be inside a
nested 'conditions' list inside the false_dict. This leads to unnecessarily
deep levels of nesting in gyp files.
This commit makes it so that if the 'false_dict' is not a dict, then we will
treat it as another cond_expr. We keep looping like this until we find a
false_dict, or until we reach the end of the list.
This means we can now have conditions that look like this:
[cond_expr1, true_dict1, cond_expr2, true_dict2, false_dict]
or:
[cond_expr1, true_dict1, cond_expr2, true_dict2, cond_expr3, true_dict3]
BUG=
R=scottmg@chromium.org
Committed: https://code.google.com/p/gyp/source/detail?r=2004
Patch Set 1 #
Total comments: 6
Patch Set 2 : Rebase #Patch Set 3 : Add some validation #Patch Set 4 : Better tests #
Messages
Total messages: 18 (4 generated)
|