OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from compiler.ast import Const | 5 from compiler.ast import Const |
6 from compiler.ast import Dict | 6 from compiler.ast import Dict |
7 from compiler.ast import Discard | 7 from compiler.ast import Discard |
8 from compiler.ast import List | 8 from compiler.ast import List |
9 from compiler.ast import Module | 9 from compiler.ast import Module |
10 from compiler.ast import Node | 10 from compiler.ast import Node |
(...skipping 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 | 2271 |
2272 list_key = key[:-1] | 2272 list_key = key[:-1] |
2273 if list_key not in the_dict: | 2273 if list_key not in the_dict: |
2274 # This happens when there's a list like "sources!" but no corresponding | 2274 # This happens when there's a list like "sources!" but no corresponding |
2275 # "sources" list. Since there's nothing for it to operate on, queue up | 2275 # "sources" list. Since there's nothing for it to operate on, queue up |
2276 # the "sources!" list for deletion now. | 2276 # the "sources!" list for deletion now. |
2277 del_lists.append(key) | 2277 del_lists.append(key) |
2278 continue | 2278 continue |
2279 | 2279 |
2280 if not isinstance(the_dict[list_key], list): | 2280 if not isinstance(the_dict[list_key], list): |
| 2281 value = the_dict[list_key] |
2281 raise ValueError, name + ' key ' + list_key + \ | 2282 raise ValueError, name + ' key ' + list_key + \ |
2282 ' must be list, not ' + \ | 2283 ' must be list, not ' + \ |
2283 value.__class__.__name__ + ' when applying ' + \ | 2284 value.__class__.__name__ + ' when applying ' + \ |
2284 {'!': 'exclusion', '/': 'regex'}[operation] | 2285 {'!': 'exclusion', '/': 'regex'}[operation] |
2285 | 2286 |
2286 if not list_key in lists: | 2287 if not list_key in lists: |
2287 lists.append(list_key) | 2288 lists.append(list_key) |
2288 | 2289 |
2289 # Delete the lists that are known to be unneeded at this point. | 2290 # Delete the lists that are known to be unneeded at this point. |
2290 for del_list in del_lists: | 2291 for del_list in del_lists: |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2800 ValidateRunAsInTarget(target, target_dict, build_file) | 2801 ValidateRunAsInTarget(target, target_dict, build_file) |
2801 ValidateActionsInTarget(target, target_dict, build_file) | 2802 ValidateActionsInTarget(target, target_dict, build_file) |
2802 | 2803 |
2803 # Generators might not expect ints. Turn them into strs. | 2804 # Generators might not expect ints. Turn them into strs. |
2804 TurnIntIntoStrInDict(data) | 2805 TurnIntIntoStrInDict(data) |
2805 | 2806 |
2806 # TODO(mark): Return |data| for now because the generator needs a list of | 2807 # TODO(mark): Return |data| for now because the generator needs a list of |
2807 # build files that came in. In the future, maybe it should just accept | 2808 # build files that came in. In the future, maybe it should just accept |
2808 # a list, and not the whole data dict. | 2809 # a list, and not the whole data dict. |
2809 return [flat_list, targets, data] | 2810 return [flat_list, targets, data] |
OLD | NEW |