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

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

Issue 547063004: Allow GN template collisions if they're the same. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | tools/gn/scope.cc » ('j') | 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/parse_tree.h" 5 #include "tools/gn/parse_tree.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 333
334 const FunctionCallNode* FunctionCallNode::AsFunctionCall() const { 334 const FunctionCallNode* FunctionCallNode::AsFunctionCall() const {
335 return this; 335 return this;
336 } 336 }
337 337
338 Value FunctionCallNode::Execute(Scope* scope, Err* err) const { 338 Value FunctionCallNode::Execute(Scope* scope, Err* err) const {
339 return functions::RunFunction(scope, this, args_.get(), block_.get(), err); 339 return functions::RunFunction(scope, this, args_.get(), block_.get(), err);
340 } 340 }
341 341
342 LocationRange FunctionCallNode::GetRange() const { 342 LocationRange FunctionCallNode::GetRange() const {
343 if (function_.type() == Token::INVALID)
344 return LocationRange(); // This will be null in some tests.
343 if (block_) 345 if (block_)
344 return function_.range().Union(block_->GetRange()); 346 return function_.range().Union(block_->GetRange());
345 return function_.range().Union(args_->GetRange()); 347 return function_.range().Union(args_->GetRange());
346 } 348 }
347 349
348 Err FunctionCallNode::MakeErrorDescribing(const std::string& msg, 350 Err FunctionCallNode::MakeErrorDescribing(const std::string& msg,
349 const std::string& help) const { 351 const std::string& help) const {
350 return Err(function_, msg, help); 352 return Err(function_, msg, help);
351 } 353 }
352 354
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 526
525 Err UnaryOpNode::MakeErrorDescribing(const std::string& msg, 527 Err UnaryOpNode::MakeErrorDescribing(const std::string& msg,
526 const std::string& help) const { 528 const std::string& help) const {
527 return Err(op_, msg, help); 529 return Err(op_, msg, help);
528 } 530 }
529 531
530 void UnaryOpNode::Print(std::ostream& out, int indent) const { 532 void UnaryOpNode::Print(std::ostream& out, int indent) const {
531 out << IndentFor(indent) << "UNARY(" << op_.value() << ")\n"; 533 out << IndentFor(indent) << "UNARY(" << op_.value() << ")\n";
532 operand_->Print(out, indent + 1); 534 operand_->Print(out, indent + 1);
533 } 535 }
OLDNEW
« no previous file with comments | « no previous file | tools/gn/scope.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698