| 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("../../../../lib/uri/uri.dart"); | 7 #import("../../../../lib/uri/uri.dart"); |
| 8 | 8 |
| 9 #import("../../../leg/elements/elements.dart"); | 9 #import("../../../leg/elements/elements.dart"); |
| 10 #import("../../../leg/io/io.dart", prefix: 'io'); | 10 #import("../../../leg/io/io.dart", prefix: 'io'); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 void reportWarning(Node node, var message) { | 70 void reportWarning(Node node, var message) { |
| 71 warnings.add(new WarningMessage(node, message.message)); | 71 warnings.add(new WarningMessage(node, message.message)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void reportError(Node node, var message) { | 74 void reportError(Node node, var message) { |
| 75 errors.add(new WarningMessage(node, message.message)); | 75 errors.add(new WarningMessage(node, message.message)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void reportDiagnostic(SourceSpan span, String message, bool fatal) { |
| 79 print(message); |
| 80 } |
| 81 |
| 78 void clearWarnings() { | 82 void clearWarnings() { |
| 79 warnings = []; | 83 warnings = []; |
| 80 } | 84 } |
| 81 | 85 |
| 82 void clearErrors() { | 86 void clearErrors() { |
| 83 errors = []; | 87 errors = []; |
| 84 } | 88 } |
| 85 | 89 |
| 86 TreeElementMapping resolveStatement(String text) { | 90 TreeElementMapping resolveStatement(String text) { |
| 87 parsedTree = parseStatement(text); | 91 parsedTree = parseStatement(text); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 importLibrary(library, compiler.coreLibrary, compiler); | 176 importLibrary(library, compiler.coreLibrary, compiler); |
| 173 return library; | 177 return library; |
| 174 } | 178 } |
| 175 | 179 |
| 176 class StringScript extends Script { | 180 class StringScript extends Script { |
| 177 final String code; | 181 final String code; |
| 178 StringScript(this.code) : super(null, null); | 182 StringScript(this.code) : super(null, null); |
| 179 String get text() => code; | 183 String get text() => code; |
| 180 String get name() => "mock script"; | 184 String get name() => "mock script"; |
| 181 } | 185 } |
| OLD | NEW |