Chromium Code Reviews| 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 |