| OLD | NEW |
| 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 library mock_compiler; | 5 library mock_compiler; |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 | 10 |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 if (visitor.scope is LibraryScope) { | 378 if (visitor.scope is LibraryScope) { |
| 379 visitor.scope = new MethodScope(visitor.scope, element); | 379 visitor.scope = new MethodScope(visitor.scope, element); |
| 380 } | 380 } |
| 381 visitor.visit(tree); | 381 visitor.visit(tree); |
| 382 visitor.scope = new LibraryScope(element.getLibrary()); | 382 visitor.scope = new LibraryScope(element.getLibrary()); |
| 383 return visitor.mapping; | 383 return visitor.mapping; |
| 384 } | 384 } |
| 385 | 385 |
| 386 resolverVisitor() { | 386 resolverVisitor() { |
| 387 Element mockElement = | 387 Element mockElement = |
| 388 new ElementX('', ElementKind.FUNCTION, | 388 new ElementX('', ElementKind.FUNCTION, mainApp.entryCompilationUnit); |
| 389 mainApp.entryCompilationUnit); | |
| 390 ResolverVisitor visitor = | 389 ResolverVisitor visitor = |
| 391 new ResolverVisitor(this, mockElement, | 390 new ResolverVisitor(this, mockElement, |
| 392 new CollectingTreeElements(mockElement)); | 391 new CollectingTreeElements(mockElement)); |
| 393 visitor.scope = new MethodScope(visitor.scope, mockElement); | 392 visitor.scope = new MethodScope(visitor.scope, mockElement); |
| 394 return visitor; | 393 return visitor; |
| 395 } | 394 } |
| 396 | 395 |
| 397 parseScript(String text, [LibraryElement library]) { | 396 parseScript(String text, [LibraryElement library]) { |
| 398 if (library == null) library = mainApp; | 397 if (library == null) library = mainApp; |
| 399 parseUnit(text, this, library, registerSource); | 398 parseUnit(text, this, library, registerSource); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 } else { | 499 } else { |
| 501 sourceFile = compiler.sourceFiles[uri.toString()]; | 500 sourceFile = compiler.sourceFiles[uri.toString()]; |
| 502 } | 501 } |
| 503 if (sourceFile != null && begin != null && end != null) { | 502 if (sourceFile != null && begin != null && end != null) { |
| 504 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); | 503 print(sourceFile.getLocationMessage(message, begin, end, true, (x) => x)); |
| 505 } else { | 504 } else { |
| 506 print(message); | 505 print(message); |
| 507 } | 506 } |
| 508 }; | 507 }; |
| 509 } | 508 } |
| OLD | NEW |