Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. 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 #include "tools/gn/functions.h" | 5 #include "tools/gn/functions.h" |
| 6 #include "tools/gn/parse_tree.h" | 6 #include "tools/gn/parse_tree.h" |
| 7 #include "tools/gn/scope.h" | 7 #include "tools/gn/scope.h" |
| 8 #include "tools/gn/settings.h" | 8 #include "tools/gn/settings.h" |
| 9 #include "tools/gn/substitution_list.h" | 9 #include "tools/gn/substitution_list.h" |
| 10 #include "tools/gn/substitution_writer.h" | 10 #include "tools/gn/substitution_writer.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 list.push_back(template_arg.string_value()); | 84 list.push_back(template_arg.string_value()); |
| 85 if (!subst.Parse(list, template_arg.origin(), err)) | 85 if (!subst.Parse(list, template_arg.origin(), err)) |
| 86 return Value(); | 86 return Value(); |
| 87 } else if (template_arg.type() == Value::LIST) { | 87 } else if (template_arg.type() == Value::LIST) { |
| 88 if (!subst.Parse(template_arg, err)) | 88 if (!subst.Parse(template_arg, err)) |
| 89 return Value(); | 89 return Value(); |
| 90 } else { | 90 } else { |
| 91 *err = Err(template_arg, "Not a string or a list."); | 91 *err = Err(template_arg, "Not a string or a list."); |
| 92 return Value(); | 92 return Value(); |
| 93 } | 93 } |
| 94 | 94 |
|
brettw
2016/10/05 19:47:50
Here can you check that subst.required_types() doe
Petr Hosek
2016/10/11 00:59:49
Done.
| |
| 95 SubstitutionWriter::ApplyListToSourcesAsString( | 95 SubstitutionWriter::ApplyListToSourcesAsString( |
| 96 scope->settings(), subst, input_files, &result_files); | 96 nullptr, scope->settings(), subst, input_files, &result_files); |
| 97 | 97 |
| 98 // Convert the list of strings to the return Value. | 98 // Convert the list of strings to the return Value. |
| 99 Value ret(function, Value::LIST); | 99 Value ret(function, Value::LIST); |
| 100 ret.list_value().reserve(result_files.size()); | 100 ret.list_value().reserve(result_files.size()); |
| 101 for (const auto& file : result_files) | 101 for (const auto& file : result_files) |
| 102 ret.list_value().push_back(Value(function, file)); | 102 ret.list_value().push_back(Value(function, file)); |
| 103 | 103 |
| 104 return ret; | 104 return ret; |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace functions | 107 } // namespace functions |
| OLD | NEW |