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

Unified Diff: frog/leg/elements/elements.dart

Issue 9699033: Introduce FieldParameterElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: frog/leg/elements/elements.dart
diff --git a/frog/leg/elements/elements.dart b/frog/leg/elements/elements.dart
index c7d7d39ccda1ab5b580b83ecbab20afb20eff82c..874b5d53a070b2f1e895730e28f0aff7975e4b7a 100644
--- a/frog/leg/elements/elements.dart
+++ b/frog/leg/elements/elements.dart
@@ -46,6 +46,10 @@ class ElementKind {
const ElementKind('variable', ElementCategory.VARIABLE);
static final ElementKind PARAMETER =
const ElementKind('parameter', ElementCategory.VARIABLE);
+ // Parameters in constructors that directly initialize fields. For example:
+ // [:A(this.field):].
+ static final ElementKind FIELD_PARAMETER =
+ const ElementKind('field_parameter', ElementCategory.VARIABLE);
static final ElementKind FUNCTION =
const ElementKind('function', ElementCategory.FUNCTION);
static final ElementKind CLASS =
@@ -351,6 +355,21 @@ class VariableElement extends Element {
Token position() => findMyName(variables.position());
}
+/**
+ * Parameters in constructors that directly initialize fields. For example:
+ * [:A(this.field):].
+ */
+class FieldParameterElement extends VariableElement {
+ VariableElement fieldElement;
+
+ FieldParameterElement(SourceString name,
+ this.fieldElement,
+ VariableListElement variables,
+ Element enclosing,
+ [Node node])
ngeoffray 2012/03/15 10:06:01 I believe the node should not be optional here.
floitsch 2012/03/15 14:11:04 Done.
+ : super(name, variables, ElementKind.FIELD_PARAMETER, enclosing, node);
+}
+
// This element represents a list of variable or field declaration.
// It contains the node, and the type. A [VariableElement] always
// references its [VariableListElement]. It forwards its
« no previous file with comments | « frog/leg/compiler.dart ('k') | frog/leg/resolver.dart » ('j') | frog/leg/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698