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/parse_tree.h" | 5 #include "tools/gn/parse_tree.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <tuple> | 8 #include <tuple> |
9 | 9 |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 *err = Err(member_.get(), "No value named \"" + | 246 *err = Err(member_.get(), "No value named \"" + |
247 member_->value().value() + "\" in scope \"" + base_.value() + "\""); | 247 member_->value().value() + "\" in scope \"" + base_.value() + "\""); |
248 return Value(); | 248 return Value(); |
249 } | 249 } |
250 return *result; | 250 return *result; |
251 } | 251 } |
252 | 252 |
253 void AccessorNode::SetNewLocation(int line_number) { | 253 void AccessorNode::SetNewLocation(int line_number) { |
254 Location old = base_.location(); | 254 Location old = base_.location(); |
255 base_.set_location( | 255 base_.set_location( |
256 Location(old.file(), line_number, old.char_offset(), old.byte())); | 256 Location(old.file(), line_number, old.column_number(), old.byte())); |
257 } | 257 } |
258 | 258 |
259 // BinaryOpNode --------------------------------------------------------------- | 259 // BinaryOpNode --------------------------------------------------------------- |
260 | 260 |
261 BinaryOpNode::BinaryOpNode() { | 261 BinaryOpNode::BinaryOpNode() { |
262 } | 262 } |
263 | 263 |
264 BinaryOpNode::~BinaryOpNode() { | 264 BinaryOpNode::~BinaryOpNode() { |
265 } | 265 } |
266 | 266 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 } | 473 } |
474 | 474 |
475 void IdentifierNode::Print(std::ostream& out, int indent) const { | 475 void IdentifierNode::Print(std::ostream& out, int indent) const { |
476 out << IndentFor(indent) << "IDENTIFIER(" << value_.value() << ")\n"; | 476 out << IndentFor(indent) << "IDENTIFIER(" << value_.value() << ")\n"; |
477 PrintComments(out, indent); | 477 PrintComments(out, indent); |
478 } | 478 } |
479 | 479 |
480 void IdentifierNode::SetNewLocation(int line_number) { | 480 void IdentifierNode::SetNewLocation(int line_number) { |
481 Location old = value_.location(); | 481 Location old = value_.location(); |
482 value_.set_location( | 482 value_.set_location( |
483 Location(old.file(), line_number, old.char_offset(), old.byte())); | 483 Location(old.file(), line_number, old.column_number(), old.byte())); |
484 } | 484 } |
485 | 485 |
486 // ListNode ------------------------------------------------------------------- | 486 // ListNode ------------------------------------------------------------------- |
487 | 487 |
488 ListNode::ListNode() : prefer_multiline_(false) { | 488 ListNode::ListNode() : prefer_multiline_(false) { |
489 } | 489 } |
490 | 490 |
491 ListNode::~ListNode() { | 491 ListNode::~ListNode() { |
492 STLDeleteContainerPointers(contents_.begin(), contents_.end()); | 492 STLDeleteContainerPointers(contents_.begin(), contents_.end()); |
493 } | 493 } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 } | 732 } |
733 | 733 |
734 void LiteralNode::Print(std::ostream& out, int indent) const { | 734 void LiteralNode::Print(std::ostream& out, int indent) const { |
735 out << IndentFor(indent) << "LITERAL(" << value_.value() << ")\n"; | 735 out << IndentFor(indent) << "LITERAL(" << value_.value() << ")\n"; |
736 PrintComments(out, indent); | 736 PrintComments(out, indent); |
737 } | 737 } |
738 | 738 |
739 void LiteralNode::SetNewLocation(int line_number) { | 739 void LiteralNode::SetNewLocation(int line_number) { |
740 Location old = value_.location(); | 740 Location old = value_.location(); |
741 value_.set_location( | 741 value_.set_location( |
742 Location(old.file(), line_number, old.char_offset(), old.byte())); | 742 Location(old.file(), line_number, old.column_number(), old.byte())); |
743 } | 743 } |
744 | 744 |
745 // UnaryOpNode ---------------------------------------------------------------- | 745 // UnaryOpNode ---------------------------------------------------------------- |
746 | 746 |
747 UnaryOpNode::UnaryOpNode() { | 747 UnaryOpNode::UnaryOpNode() { |
748 } | 748 } |
749 | 749 |
750 UnaryOpNode::~UnaryOpNode() { | 750 UnaryOpNode::~UnaryOpNode() { |
751 } | 751 } |
752 | 752 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 | 828 |
829 Err EndNode::MakeErrorDescribing(const std::string& msg, | 829 Err EndNode::MakeErrorDescribing(const std::string& msg, |
830 const std::string& help) const { | 830 const std::string& help) const { |
831 return Err(value_, msg, help); | 831 return Err(value_, msg, help); |
832 } | 832 } |
833 | 833 |
834 void EndNode::Print(std::ostream& out, int indent) const { | 834 void EndNode::Print(std::ostream& out, int indent) const { |
835 out << IndentFor(indent) << "END(" << value_.value() << ")\n"; | 835 out << IndentFor(indent) << "END(" << value_.value() << ")\n"; |
836 PrintComments(out, indent); | 836 PrintComments(out, indent); |
837 } | 837 } |
OLD | NEW |