Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| diff --git a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| index 3310536f2688c8f64d8d722e8c7aa6f09951bb13..558e49fcbb586950c26ae186594cd59c6d439fa3 100644 |
| --- a/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| +++ b/pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart |
| @@ -457,18 +457,22 @@ class AstBuilder extends ScopeListener { |
| void endType(Token beginToken, Token endToken) { |
| debugEvent("Type"); |
| TypeArgumentList arguments = pop(); |
| - SimpleIdentifier name = pop(); |
| + Identifier name = pop(); |
| + // TODO(paulberry,ahe): what if the type doesn't resolve to a class |
| + // element? |
|
ahe
2017/02/22 11:42:08
We should try to share this method with BodyBuilde
Paul Berry
2017/02/22 16:34:53
Acknowledged.
|
| KernelClassElement cls = name.staticElement; |
| if (cls == null) { |
| + // TODO(paulberry): This is a kludge. Ideally we should already have |
| + // set the static element at the time that handleIdentifier was called. |
|
ahe
2017/02/22 11:42:08
For inspiration (or code sharing) take a look at B
Paul Berry
2017/02/22 16:34:53
Acknowledged.
|
| Builder builder = scope.lookup(name.name, beginToken.charOffset, uri); |
| if (builder == null) { |
| internalError("Undefined name: $name"); |
| } |
| - // TODO(paulberry,ahe): what if the type doesn't resolve to a class |
| - // element? |
| cls = elementStore[builder]; |
| assert(cls != null); |
| - name.staticElement = cls; |
| + if (name is SimpleIdentifier) { |
| + name.staticElement = cls; |
| + } |
| } |
| push(ast.typeName(name, arguments)..type = cls.rawType); |
| } |
| @@ -939,14 +943,20 @@ class AstBuilder extends ScopeListener { |
| @override |
| void handleQualified(Token period) { |
| + SimpleIdentifier identifier = pop(); |
| if (accumulateIdentifierComponents) { |
| - SimpleIdentifier identifier = pop(); |
| List<SimpleIdentifier> list = pop(); |
| list.add(identifier); |
| push(list); |
| } else { |
| - // TODO(paulberry): implement. |
| - logEvent('Qualified'); |
| + var prefix = pop(); |
| + if (prefix is SimpleIdentifier) { |
| + // TODO(paulberry): resolve [identifier]. |
|
ahe
2017/02/22 11:42:08
I'm using SendAccessor to handle this in BodyBuild
Paul Berry
2017/02/22 16:34:53
Acknowledged.
|
| + push(ast.prefixedIdentifier(prefix, toAnalyzerToken(period), identifier)); |
|
ahe
2017/02/22 11:42:08
Long line.
Paul Berry
2017/02/22 16:34:53
Thanks. Konstantin fixed this in https://coderevi
|
| + } else { |
| + // TODO(paulberry): implement. |
| + logEvent('Qualified with >1 dot'); |
| + } |
| } |
| } |