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

Unified Diff: trunk/src/tools/gn/function_template.cc

Issue 21084010: Revert 214254 "Add initial prototype for the GN meta-buildsystem." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/tools/gn/function_set_default_toolchain.cc ('k') | trunk/src/tools/gn/function_toolchain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/tools/gn/function_template.cc
===================================================================
--- trunk/src/tools/gn/function_template.cc (revision 214322)
+++ trunk/src/tools/gn/function_template.cc (working copy)
@@ -1,38 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "tools/gn/functions.h"
-
-#include "tools/gn/parse_tree.h"
-#include "tools/gn/scope.h"
-#include "tools/gn/value.h"
-
-Value ExecuteTemplate(Scope* scope,
- const FunctionCallNode* function,
- const std::vector<Value>& args,
- BlockNode* block,
- Err* err) {
- // TODO(brettw) determine if the function is built-in and throw an error if
- // it is.
- if (args.size() != 1) {
- *err = Err(function->function(),
- "Need exactly one string arg to template.");
- return Value();
- }
- if (!args[0].VerifyTypeIs(Value::STRING, err))
- return Value();
- std::string template_name = args[0].string_value();
-
- const FunctionCallNode* existing_template = scope->GetTemplate(template_name);
- if (existing_template) {
- *err = Err(function, "Duplicate template definition.",
- "A template with this name was already defined.");
- err->AppendSubErr(Err(existing_template->function(),
- "Previous definition."));
- return Value();
- }
-
- scope->AddTemplate(template_name, function);
- return Value();
-}
« no previous file with comments | « trunk/src/tools/gn/function_set_default_toolchain.cc ('k') | trunk/src/tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698