Chromium Code Reviews| Index: dart/lib/compiler/implementation/scanner/listener.dart |
| diff --git a/dart/lib/compiler/implementation/scanner/listener.dart b/dart/lib/compiler/implementation/scanner/listener.dart |
| index f606062ab159ea3b347085d68ca9d5ac7f70e681..11f7e010ab1ccf275cb158626d2e4cb4b01fd47c 100644 |
| --- a/dart/lib/compiler/implementation/scanner/listener.dart |
| +++ b/dart/lib/compiler/implementation/scanner/listener.dart |
| @@ -585,7 +585,8 @@ class ElementListener extends Listener { |
| void endMetadata(Token beginToken, Token endToken) { |
| popNode(); // Discard node (Send or Identifier). |
| - pushMetadata(new PartialMetadataAnnotation(beginToken)); |
| + pushMetadata(new PartialMetadataAnnotation(compilationUnitElement, |
| + beginToken)); |
|
Johnni Winther
2012/08/22 13:45:40
Does this always define the scope for the metadata
ahe
2012/08/22 14:01:54
This is what I assume:
@foo // Error: foo cannot
Johnni Winther
2012/08/22 14:08:36
But what about:
class Foo {
static const foo =
ahe
2012/08/22 17:23:02
I assume so.
|
| } |
| void endClassDeclaration(int interfacesCount, Token beginToken, |
| @@ -1644,9 +1645,17 @@ class PartialMetadataAnnotation extends MetadataAnnotation { |
| Expression cachedNode; |
| Constant value; |
| - PartialMetadataAnnotation(this.beginToken); |
| + PartialMetadataAnnotation(Element enclosingElement, this.beginToken) |
| + : super(enclosingElement); |
| - // TODO(ahe): Add more functionality as needed. |
| + |
| + Node parseNode(DiagnosticListener listener) { |
| + if (cachedNode !== null) return cachedNode; |
| + cachedNode = parse(listener, |
| + enclosingElement, |
| + (p) => p.parseSend(beginToken.next)); |
| + return cachedNode; |
| + } |
| } |
| Node parse(DiagnosticListener diagnosticListener, |