| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <iostream> | 8 #include <iostream> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 } | 422 } |
| 423 | 423 |
| 424 Example | 424 Example |
| 425 | 425 |
| 426 declare_args() { | 426 declare_args() { |
| 427 enable_teleporter = true | 427 enable_teleporter = true |
| 428 enable_doom_melon = false | 428 enable_doom_melon = false |
| 429 } | 429 } |
| 430 | 430 |
| 431 If you want to override the (default disabled) Doom Melon: | 431 If you want to override the (default disabled) Doom Melon: |
| 432 gn --args="enable_doom_melon=true enable_teleporter=false" | 432 gn --args="enable_doom_melon=true enable_teleporter=true" |
| 433 This also sets the teleporter, but it's already defaulted to on so it will | 433 This also sets the teleporter, but it's already defaulted to on so it will |
| 434 have no effect. | 434 have no effect. |
| 435 )"; | 435 )"; |
| 436 | 436 |
| 437 Value RunDeclareArgs(Scope* scope, | 437 Value RunDeclareArgs(Scope* scope, |
| 438 const FunctionCallNode* function, | 438 const FunctionCallNode* function, |
| 439 const std::vector<Value>& args, | 439 const std::vector<Value>& args, |
| 440 BlockNode* block, | 440 BlockNode* block, |
| 441 Err* err) { | 441 Err* err) { |
| 442 NonNestableBlock non_nestable(scope, function, "declare_args"); | 442 NonNestableBlock non_nestable(scope, function, "declare_args"); |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 // Otherwise it's a no-block function. | 1139 // Otherwise it's a no-block function. |
| 1140 if (!VerifyNoBlockForFunctionCall(function, block, err)) | 1140 if (!VerifyNoBlockForFunctionCall(function, block, err)) |
| 1141 return Value(); | 1141 return Value(); |
| 1142 return found_function->second.no_block_runner(scope, function, | 1142 return found_function->second.no_block_runner(scope, function, |
| 1143 args.list_value(), err); | 1143 args.list_value(), err); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 } // namespace functions | 1146 } // namespace functions |
| OLD | NEW |