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

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

Issue 23452043: Introduce newline tokens into the token stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase (fingerprints) Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.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) 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/assembler.h" 5 #include "vm/assembler.h"
6 #include "vm/bigint_operations.h" 6 #include "vm/bigint_operations.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 2073
2074 script.GetTokenLocation(4, &line, &col); // Token 'return' 2074 script.GetTokenLocation(4, &line, &col); // Token 'return'
2075 EXPECT_EQ(4, line); // 'return' is in line 4. 2075 EXPECT_EQ(4, line); // 'return' is in line 4.
2076 EXPECT_EQ(5, col); // Four spaces before 'return'. 2076 EXPECT_EQ(5, col); // Four spaces before 'return'.
2077 2077
2078 intptr_t first_idx, last_idx; 2078 intptr_t first_idx, last_idx;
2079 script.TokenRangeAtLine(3, &first_idx, &last_idx); 2079 script.TokenRangeAtLine(3, &first_idx, &last_idx);
2080 EXPECT_EQ(0, first_idx); // Token 'main' is first token. 2080 EXPECT_EQ(0, first_idx); // Token 'main' is first token.
2081 EXPECT_EQ(3, last_idx); // Token { is last token. 2081 EXPECT_EQ(3, last_idx); // Token { is last token.
2082 script.TokenRangeAtLine(5, &first_idx, &last_idx); 2082 script.TokenRangeAtLine(5, &first_idx, &last_idx);
2083 EXPECT_EQ(7, first_idx); // Token } is first and only token. 2083 EXPECT_EQ(9, first_idx); // Token } is first and only token.
2084 EXPECT_EQ(7, last_idx); 2084 EXPECT_EQ(9, last_idx);
2085 } 2085 }
2086 2086
2087 2087
2088 TEST_CASE(Context) { 2088 TEST_CASE(Context) {
2089 const int kNumVariables = 5; 2089 const int kNumVariables = 5;
2090 const Context& parent_context = Context::Handle(Context::New(0)); 2090 const Context& parent_context = Context::Handle(Context::New(0));
2091 EXPECT_EQ(parent_context.isolate(), Isolate::Current()); 2091 EXPECT_EQ(parent_context.isolate(), Isolate::Current());
2092 const Context& context = Context::Handle(Context::New(kNumVariables)); 2092 const Context& context = Context::Handle(Context::New(kNumVariables));
2093 context.set_parent(parent_context); 2093 context.set_parent(parent_context);
2094 const Context& check_parent_context = Context::Handle(context.parent()); 2094 const Context& check_parent_context = Context::Handle(context.parent());
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
3450 cls = Object::dynamic_class(); 3450 cls = Object::dynamic_class();
3451 array = cls.fields(); 3451 array = cls.fields();
3452 EXPECT(!array.IsNull()); 3452 EXPECT(!array.IsNull());
3453 EXPECT(array.IsArray()); 3453 EXPECT(array.IsArray());
3454 array = cls.functions(); 3454 array = cls.functions();
3455 EXPECT(!array.IsNull()); 3455 EXPECT(!array.IsNull());
3456 EXPECT(array.IsArray()); 3456 EXPECT(array.IsArray());
3457 } 3457 }
3458 3458
3459 } // namespace dart 3459 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698