| 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 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 gen.Run(); | 244 gen.Run(); |
| 245 if (err->has_error()) | 245 if (err->has_error()) |
| 246 return Value(); | 246 return Value(); |
| 247 | 247 |
| 248 // Save the generated item. | 248 // Save the generated item. |
| 249 Scope::ItemVector* collector = scope->GetItemCollector(); | 249 Scope::ItemVector* collector = scope->GetItemCollector(); |
| 250 if (!collector) { | 250 if (!collector) { |
| 251 *err = Err(function, "Can't define a config in this context."); | 251 *err = Err(function, "Can't define a config in this context."); |
| 252 return Value(); | 252 return Value(); |
| 253 } | 253 } |
| 254 collector->push_back(new scoped_ptr<Item>(config.PassAs<Item>())); | 254 collector->push_back(config.release()); |
| 255 | 255 |
| 256 return Value(); | 256 return Value(); |
| 257 } | 257 } |
| 258 | 258 |
| 259 // declare_args ---------------------------------------------------------------- | 259 // declare_args ---------------------------------------------------------------- |
| 260 | 260 |
| 261 const char kDeclareArgs[] = "declare_args"; | 261 const char kDeclareArgs[] = "declare_args"; |
| 262 const char kDeclareArgs_HelpShort[] = | 262 const char kDeclareArgs_HelpShort[] = |
| 263 "declare_args: Declare build arguments."; | 263 "declare_args: Declare build arguments."; |
| 264 const char kDeclareArgs_Help[] = | 264 const char kDeclareArgs_Help[] = |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 return Value(); | 781 return Value(); |
| 782 return result; | 782 return result; |
| 783 } | 783 } |
| 784 | 784 |
| 785 // Otherwise it's a no-block function. | 785 // Otherwise it's a no-block function. |
| 786 return found_function->second.no_block_runner(scope, function, | 786 return found_function->second.no_block_runner(scope, function, |
| 787 args.list_value(), err); | 787 args.list_value(), err); |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace functions | 790 } // namespace functions |
| OLD | NEW |