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

Side by Side Diff: vm/parser_test.cc

Issue 10808064: Rename some of the enum definitions inside classes to avoid conflict with the ObjectKind enum. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « vm/parser.cc ('k') | vm/raw_object.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 5
6 #include "vm/ast_printer.h" 6 #include "vm/ast_printer.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/longjump.h" 8 #include "vm/longjump.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 " final f2; \n" 107 " final f2; \n"
108 " final int f3, f4; \n" 108 " final int f3, f4; \n"
109 " static String s1, s2; \n" 109 " static String s1, s2; \n"
110 " static final int s3 = 8675309; \n" 110 " static final int s3 = 8675309; \n"
111 " static bar(i, [var d = 5]) { return 77; } \n" 111 " static bar(i, [var d = 5]) { return 77; } \n"
112 " static foo() native \"native_function_name\"; \n" 112 " static foo() native \"native_function_name\"; \n"
113 "} \n"; 113 "} \n";
114 114
115 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); 115 String& url = String::Handle(String::New("dart-test:Parser_TopLevel"));
116 String& source = String::Handle(String::New(script_chars)); 116 String& source = String::Handle(String::New(script_chars));
117 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); 117 Script& script = Script::Handle(Script::New(url,
118 source,
119 RawScript::kSourceTag));
118 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); 120 Library& lib = Library::ZoneHandle(Library::CoreLibrary());
119 121
120 script.Tokenize(String::Handle(String::New(""))); 122 script.Tokenize(String::Handle(String::New("")));
121 123
122 Parser::ParseCompilationUnit(lib, script); 124 Parser::ParseCompilationUnit(lib, script);
123 EXPECT(ClassFinalizer::FinalizePendingClasses()); 125 EXPECT(ClassFinalizer::FinalizePendingClasses());
124 CheckField(lib, "A", "f1", false, false); 126 CheckField(lib, "A", "f1", false, false);
125 CheckField(lib, "A", "f2", false, true); 127 CheckField(lib, "A", "f2", false, true);
126 CheckField(lib, "A", "f3", false, true); 128 CheckField(lib, "A", "f3", false, true);
127 CheckField(lib, "A", "f4", false, true); 129 CheckField(lib, "A", "f4", false, true);
(...skipping 23 matching lines...) Expand all
151 " static foo() { return 42; } \n" 153 " static foo() { return 42; } \n"
152 " static baz(var i) { var q = 5; return i + q; } \n" 154 " static baz(var i) { var q = 5; return i + q; } \n"
153 "} \n" 155 "} \n"
154 " \n" 156 " \n"
155 "class B { \n" 157 "class B { \n"
156 " static bam(k) { return A.foo(); } \n" 158 " static bam(k) { return A.foo(); } \n"
157 "} \n"; 159 "} \n";
158 160
159 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); 161 String& url = String::Handle(String::New("dart-test:Parser_TopLevel"));
160 String& source = String::Handle(String::New(script_chars)); 162 String& source = String::Handle(String::New(script_chars));
161 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); 163 Script& script = Script::Handle(Script::New(url,
164 source,
165 RawScript::kSourceTag));
162 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); 166 Library& lib = Library::ZoneHandle(Library::CoreLibrary());
163 167
164 script.Tokenize(String::Handle(String::New(""))); 168 script.Tokenize(String::Handle(String::New("")));
165 169
166 Parser::ParseCompilationUnit(lib, script); 170 Parser::ParseCompilationUnit(lib, script);
167 EXPECT(ClassFinalizer::FinalizePendingClasses()); 171 EXPECT(ClassFinalizer::FinalizePendingClasses());
168 172
169 DumpFunction(lib, "A", "foo"); 173 DumpFunction(lib, "A", "foo");
170 DumpFunction(lib, "A", "bar"); 174 DumpFunction(lib, "A", "bar");
171 DumpFunction(lib, "A", "baz"); 175 DumpFunction(lib, "A", "baz");
172 DumpFunction(lib, "B", "bam"); 176 DumpFunction(lib, "B", "bam");
173 } 177 }
174 178
175 } // namespace dart 179 } // namespace dart
OLDNEW
« no previous file with comments | « vm/parser.cc ('k') | vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698