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 | |
9 #include <iostream> | 8 #include <iostream> |
| 9 #include <utility> |
10 | 10 |
11 #include "base/environment.h" | 11 #include "base/environment.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "tools/gn/config.h" | 13 #include "tools/gn/config.h" |
14 #include "tools/gn/config_values_generator.h" | 14 #include "tools/gn/config_values_generator.h" |
15 #include "tools/gn/err.h" | 15 #include "tools/gn/err.h" |
16 #include "tools/gn/input_file.h" | 16 #include "tools/gn/input_file.h" |
17 #include "tools/gn/parse_tree.h" | 17 #include "tools/gn/parse_tree.h" |
18 #include "tools/gn/scheduler.h" | 18 #include "tools/gn/scheduler.h" |
19 #include "tools/gn/scope.h" | 19 #include "tools/gn/scope.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 Value RunSetSourcesAssignmentFilter(Scope* scope, | 666 Value RunSetSourcesAssignmentFilter(Scope* scope, |
667 const FunctionCallNode* function, | 667 const FunctionCallNode* function, |
668 const std::vector<Value>& args, | 668 const std::vector<Value>& args, |
669 Err* err) { | 669 Err* err) { |
670 if (args.size() != 1) { | 670 if (args.size() != 1) { |
671 *err = Err(function, "set_sources_assignment_filter takes one argument."); | 671 *err = Err(function, "set_sources_assignment_filter takes one argument."); |
672 } else { | 672 } else { |
673 scoped_ptr<PatternList> f(new PatternList); | 673 scoped_ptr<PatternList> f(new PatternList); |
674 f->SetFromValue(args[0], err); | 674 f->SetFromValue(args[0], err); |
675 if (!err->has_error()) | 675 if (!err->has_error()) |
676 scope->set_sources_assignment_filter(f.Pass()); | 676 scope->set_sources_assignment_filter(std::move(f)); |
677 } | 677 } |
678 return Value(); | 678 return Value(); |
679 } | 679 } |
680 | 680 |
681 // print ----------------------------------------------------------------------- | 681 // print ----------------------------------------------------------------------- |
682 | 682 |
683 const char kPrint[] = "print"; | 683 const char kPrint[] = "print"; |
684 const char kPrint_HelpShort[] = | 684 const char kPrint_HelpShort[] = |
685 "print: Prints to the console."; | 685 "print: Prints to the console."; |
686 const char kPrint_Help[] = | 686 const char kPrint_Help[] = |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 } | 919 } |
920 | 920 |
921 // Otherwise it's a no-block function. | 921 // Otherwise it's a no-block function. |
922 if (!VerifyNoBlockForFunctionCall(function, block, err)) | 922 if (!VerifyNoBlockForFunctionCall(function, block, err)) |
923 return Value(); | 923 return Value(); |
924 return found_function->second.no_block_runner(scope, function, | 924 return found_function->second.no_block_runner(scope, function, |
925 args.list_value(), err); | 925 args.list_value(), err); |
926 } | 926 } |
927 | 927 |
928 } // namespace functions | 928 } // namespace functions |
OLD | NEW |