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

Side by Side Diff: runtime/vm/object.cc

Issue 196653004: - Fix formatting of generated sources. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | runtime/vm/object_test.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 6764 matching lines...) Expand 10 before | Expand all | Expand 10 after
6775 } 6775 }
6776 literals.Add(literal); 6776 literals.Add(literal);
6777 } else { 6777 } else {
6778 literals.Add(literal); 6778 literals.Add(literal);
6779 } 6779 }
6780 // Determine the separation text based on this current token. 6780 // Determine the separation text based on this current token.
6781 const String* separator = NULL; 6781 const String* separator = NULL;
6782 switch (curr) { 6782 switch (curr) {
6783 case Token::kLBRACE: 6783 case Token::kLBRACE:
6784 case Token::kRBRACE: 6784 case Token::kRBRACE:
6785 if (next != Token::kNEWLINE) {
6786 separator = &Symbols::Blank();
6787 }
6788 break;
6785 case Token::kPERIOD: 6789 case Token::kPERIOD:
6786 case Token::kLBRACK: 6790 case Token::kLBRACK:
6787 case Token::kINTERPOL_VAR: 6791 case Token::kINTERPOL_VAR:
6788 case Token::kINTERPOL_START: 6792 case Token::kINTERPOL_START:
6789 case Token::kINTERPOL_END: 6793 case Token::kINTERPOL_END:
6790 case Token::kBIT_NOT: 6794 case Token::kBIT_NOT:
6795 case Token::kNOT:
6791 break; 6796 break;
6792 // In case we see an opening parentheses '(' we increase the indent to 6797 // In case we see an opening parentheses '(' we increase the indent to
6793 // align multi-line parameters accordingly. The indent will be removed as 6798 // align multi-line parameters accordingly. The indent will be removed as
6794 // soon as we see the matching closing parentheses ')'. 6799 // soon as we see the matching closing parentheses ')'.
6795 // 6800 //
6796 // Example: 6801 // Example:
6797 // SomeVeryLongMethod( 6802 // SomeVeryLongMethod(
6798 // "withVeryLongParameter", 6803 // "withVeryLongParameter",
6799 // "andAnotherVeryLongParameter", 6804 // "andAnotherVeryLongParameter",
6800 // "andAnotherVeryLongParameter2") { ... 6805 // "andAnotherVeryLongParameter2") { ...
(...skipping 15 matching lines...) Expand all
6816 default: 6821 default:
6817 separator = &Symbols::Blank(); 6822 separator = &Symbols::Blank();
6818 break; 6823 break;
6819 } 6824 }
6820 6825
6821 // Determine whether the separation text needs to be updated based on the 6826 // Determine whether the separation text needs to be updated based on the
6822 // next token. 6827 // next token.
6823 switch (next) { 6828 switch (next) {
6824 case Token::kRBRACE: 6829 case Token::kRBRACE:
6825 break; 6830 break;
6831 case Token::kNEWLINE:
6826 case Token::kSEMICOLON: 6832 case Token::kSEMICOLON:
6827 case Token::kPERIOD: 6833 case Token::kPERIOD:
6828 case Token::kCOMMA: 6834 case Token::kCOMMA:
6829 case Token::kLPAREN:
6830 case Token::kRPAREN: 6835 case Token::kRPAREN:
6831 case Token::kLBRACK: 6836 case Token::kLBRACK:
6832 case Token::kRBRACK: 6837 case Token::kRBRACK:
6833 case Token::kINTERPOL_VAR: 6838 case Token::kINTERPOL_VAR:
6834 case Token::kINTERPOL_START: 6839 case Token::kINTERPOL_START:
6835 case Token::kINTERPOL_END: 6840 case Token::kINTERPOL_END:
6836 separator = NULL; 6841 separator = NULL;
6837 break; 6842 break;
6843 case Token::kLPAREN:
6844 if (curr == Token::kCATCH) {
6845 separator = &Symbols::Blank();
6846 } else {
6847 separator = NULL;
6848 }
6849 break;
6838 case Token::kELSE: 6850 case Token::kELSE:
6839 separator = &Symbols::Blank(); 6851 separator = &Symbols::Blank();
6840 break; 6852 break;
6841 default: 6853 default:
6842 // Do nothing. 6854 // Do nothing.
6843 break; 6855 break;
6844 } 6856 }
6845 6857
6846 // Update the few cases where both tokens need to be taken into account. 6858 // Update the few cases where both tokens need to be taken into account.
6847 if (((curr == Token::kIF) || (curr == Token::kFOR)) && 6859 if (((curr == Token::kIF) || (curr == Token::kFOR)) &&
(...skipping 10736 matching lines...) Expand 10 before | Expand all | Expand 10 after
17584 return "_MirrorReference"; 17596 return "_MirrorReference";
17585 } 17597 }
17586 17598
17587 17599
17588 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { 17600 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const {
17589 Instance::PrintToJSONStream(stream, ref); 17601 Instance::PrintToJSONStream(stream, ref);
17590 } 17602 }
17591 17603
17592 17604
17593 } // namespace dart 17605 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object_test.cc » ('j') | runtime/vm/object_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698