| 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 import 'package:async_helper/async_helper.dart'; | 5 import 'package:async_helper/async_helper.dart'; |
| 6 import 'package:compiler/src/constants/values.dart' | 6 import 'package:compiler/src/constants/values.dart' |
| 7 show PrimitiveConstantValue; | 7 show PrimitiveConstantValue; |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 import 'compiler_helper.dart'; | 9 import 'compiler_helper.dart'; |
| 10 import 'package:compiler/src/parser/listener.dart' show | 10 import 'package:compiler/src/parser/partial_elements.dart' show |
| 11 PartialMetadataAnnotation; | 11 PartialMetadataAnnotation; |
| 12 | 12 |
| 13 void checkPosition(Spannable spannable, Node node, String source, compiler) { | 13 void checkPosition(Spannable spannable, Node node, String source, compiler) { |
| 14 SourceSpan span = compiler.spanFromSpannable(spannable); | 14 SourceSpan span = compiler.spanFromSpannable(spannable); |
| 15 Expect.isTrue(span.begin < span.end, | 15 Expect.isTrue(span.begin < span.end, |
| 16 'begin = ${span.begin}; end = ${span.end}'); | 16 'begin = ${span.begin}; end = ${span.end}'); |
| 17 Expect.isTrue(span.end < source.length, | 17 Expect.isTrue(span.end < source.length, |
| 18 'end = ${span.end}; length = ${source.length}'); | 18 'end = ${span.end}; length = ${source.length}'); |
| 19 String yield = source.substring(span.begin, span.end); | 19 String yield = source.substring(span.begin, span.end); |
| 20 | 20 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 compileAndCheckLibrary(source, | 216 compileAndCheckLibrary(source, |
| 217 (e) => e.compilationUnits.first.partTag.metadata); | 217 (e) => e.compilationUnits.first.partTag.metadata); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void main() { | 220 void main() { |
| 221 testClassMetadata(); | 221 testClassMetadata(); |
| 222 testTopLevelMethodMetadata(); | 222 testTopLevelMethodMetadata(); |
| 223 testTopLevelFieldMetadata(); | 223 testTopLevelFieldMetadata(); |
| 224 testLibraryTags(); | 224 testLibraryTags(); |
| 225 } | 225 } |
| OLD | NEW |