Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: tools/gn/functions.cc

Issue 2714643005: GN docs: update the example of declare_args(). (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/docs/reference.md ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « tools/gn/docs/reference.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698