OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.body_builder; | 5 library fasta.body_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' | 7 import 'package:kernel/ast.dart' |
8 hide InvalidExpression, InvalidInitializer, InvalidStatement; | 8 hide InvalidExpression, InvalidInitializer, InvalidStatement; |
9 | 9 |
10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; | 10 import 'package:kernel/class_hierarchy.dart' show ClassHierarchy; |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 if (suffix is Identifier) { | 1678 if (suffix is Identifier) { |
1679 suffix = suffix.name; | 1679 suffix = suffix.name; |
1680 } | 1680 } |
1681 Builder builder; | 1681 Builder builder; |
1682 if (prefix is Builder) { | 1682 if (prefix is Builder) { |
1683 builder = prefix; | 1683 builder = prefix; |
1684 } else { | 1684 } else { |
1685 builder = scope.lookup(prefix, beginToken.charOffset, uri); | 1685 builder = scope.lookup(prefix, beginToken.charOffset, uri); |
1686 } | 1686 } |
1687 if (builder is PrefixBuilder) { | 1687 if (builder is PrefixBuilder) { |
1688 name = scopeLookup(builder.exports, suffix, beginToken, | 1688 name = scopeLookup(builder.exportScope, suffix, beginToken, |
1689 isQualified: true, prefix: builder); | 1689 isQualified: true, prefix: builder); |
1690 } else { | 1690 } else { |
1691 push(const InvalidType()); | 1691 push(const InvalidType()); |
1692 deprecated_addCompileTimeError(beginToken.charOffset, | 1692 deprecated_addCompileTimeError(beginToken.charOffset, |
1693 "Can't be used as a type: '${debugName(prefix, suffix)}'."); | 1693 "Can't be used as a type: '${debugName(prefix, suffix)}'."); |
1694 return; | 1694 return; |
1695 } | 1695 } |
1696 } | 1696 } |
1697 if (name is Identifier) { | 1697 if (name is Identifier) { |
1698 name = name.name; | 1698 name = name.name; |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 /// name. | 2130 /// name. |
2131 void pushQualifiedReference(Token start, Token periodBeforeName) { | 2131 void pushQualifiedReference(Token start, Token periodBeforeName) { |
2132 Identifier suffix = popIfNotNull(periodBeforeName); | 2132 Identifier suffix = popIfNotNull(periodBeforeName); |
2133 Identifier identifier; | 2133 Identifier identifier; |
2134 List<DartType> typeArguments = pop(); | 2134 List<DartType> typeArguments = pop(); |
2135 dynamic type = pop(); | 2135 dynamic type = pop(); |
2136 if (type is List) { | 2136 if (type is List) { |
2137 var prefix = type[0]; | 2137 var prefix = type[0]; |
2138 identifier = type[1]; | 2138 identifier = type[1]; |
2139 if (prefix is PrefixBuilder) { | 2139 if (prefix is PrefixBuilder) { |
2140 type = scopeLookup(prefix.exports, identifier.name, start, | 2140 type = scopeLookup(prefix.exportScope, identifier.name, start, |
2141 isQualified: true, prefix: prefix); | 2141 isQualified: true, prefix: prefix); |
2142 identifier = null; | 2142 identifier = null; |
2143 } else if (prefix is TypeDeclarationAccessor) { | 2143 } else if (prefix is TypeDeclarationAccessor) { |
2144 type = prefix; | 2144 type = prefix; |
2145 } else { | 2145 } else { |
2146 type = new Identifier(start); | 2146 type = new Identifier(start); |
2147 } | 2147 } |
2148 } | 2148 } |
2149 String name; | 2149 String name; |
2150 if (identifier != null && suffix != null) { | 2150 if (identifier != null && suffix != null) { |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3800 return AsyncMarker.Async; | 3800 return AsyncMarker.Async; |
3801 } else { | 3801 } else { |
3802 assert(identical(starToken.stringValue, "*")); | 3802 assert(identical(starToken.stringValue, "*")); |
3803 return AsyncMarker.AsyncStar; | 3803 return AsyncMarker.AsyncStar; |
3804 } | 3804 } |
3805 } else { | 3805 } else { |
3806 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", | 3806 return unhandled(asyncToken.lexeme, "asyncMarkerFromTokens", |
3807 asyncToken.charOffset, null); | 3807 asyncToken.charOffset, null); |
3808 } | 3808 } |
3809 } | 3809 } |
OLD | NEW |