Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: dart/lib/compiler/implementation/elements/elements.dart

Issue 10870010: Evaluate compile-time constants of metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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('elements'); 5 #library('elements');
6 6
7 #import('dart:uri'); 7 #import('dart:uri');
8 8
9 #import('../tree/tree.dart'); 9 #import('../tree/tree.dart');
10 #import('../scanner/scannerlib.dart'); 10 #import('../scanner/scannerlib.dart');
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 * are the same compile-time constant, [: const Data() :]. 1592 * are the same compile-time constant, [: const Data() :].
1593 * 1593 *
1594 * The mirror system does not have a concept matching this class. 1594 * The mirror system does not have a concept matching this class.
1595 */ 1595 */
1596 class MetadataAnnotation { 1596 class MetadataAnnotation {
1597 /** 1597 /**
1598 * The compile-time constant which this annotation resolves to. 1598 * The compile-time constant which this annotation resolves to.
1599 * In the mirror system, this would be an object mirror. 1599 * In the mirror system, this would be an object mirror.
1600 */ 1600 */
1601 abstract Constant get value(); 1601 abstract Constant get value();
1602 final Element enclosingElement;
Johnni Winther 2012/08/22 13:45:40 enclosingElement is a bad name if it is always the
ahe 2012/08/22 14:01:54 It isn't supposed to always be a compilation unit.
ahe 2012/08/22 17:23:02 You convinced me offline that it should be annotat
1603 int resolutionState;
1602 1604
1603 // TODO(ahe): Add more functionality as needed. 1605 MetadataAnnotation(this.enclosingElement,
1606 [this.resolutionState = ClassElement.STATE_NOT_STARTED]);
Johnni Winther 2012/08/22 13:45:40 Why allow for another initial resolutionState?
ahe 2012/08/22 14:01:54 I need that for PatchMetadataAnnotation.
1607
1608 abstract Node parseNode(DiagnosticListener listener);
1609
1610 MetadataAnnotation ensureResolved(Compiler compiler) {
1611 if (resolutionState == ClassElement.STATE_NOT_STARTED) {
1612 compiler.resolver.resolveMetadataAnnotation(this);
1613 }
1614 return this;
1615 }
1616
1617 String toString() => 'MetadataAnnotation($value, $resolutionState)';
1604 } 1618 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/resolver.dart » ('j') | dart/lib/compiler/implementation/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698