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

Unified Diff: tests/compiler/dart2js/semantic_visitor_test.dart

Issue 1047673002: Add SemanticDeclVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More renaming Created 5 years, 8 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
« no previous file with comments | « pkg/compiler/lib/src/use_unused_api.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/semantic_visitor_test.dart
diff --git a/tests/compiler/dart2js/semantic_visitor_test.dart b/tests/compiler/dart2js/semantic_visitor_test.dart
index 658f55130d914abe9b7bdc71550ce47b68641975..1ccc15c15f164d147e688c0f3ff52e54d15a9113 100644
--- a/tests/compiler/dart2js/semantic_visitor_test.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test.dart
@@ -2259,6 +2259,824 @@ const Map<String, List<Test>> SEND_TESTS = const {
],
};
+const Map<String, List<Test>> DECL_TESTS = const {
+ 'Function declarations': const [
+ const Test(
+ '''
+ m(a, b) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, [b]) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,[b])',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, [b = null]) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,[b=null])',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 'null',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, [b = 42]) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,[b=42])',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 42,
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m(a, {b}) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,{b})',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: 'parameter(m#b)'),
+ ]),
+ const Test(
+ '''
+ m(a, {b: null}) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,{b: null})',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 'null'),
+ ]),
+ const Test(
+ '''
+ m(a, {b:42}) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,{b: 42})',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ constant: 42),
+ ]),
+ const Test(
+ '''
+ get m => null;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL,
+ element: 'getter(m)',
+ body: '=>null;'),
+ ]),
+ const Test(
+ '''
+ set m(a) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL,
+ element: 'setter(m)',
+ parameters: '(a)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static m(a, b) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL,
+ element: 'function(C#m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static get m => null;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_GETTER_DECL,
+ element: 'getter(C#m)',
+ body: '=>null;'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static set m(a) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_SETTER_DECL,
+ element: 'setter(C#m)',
+ parameters: '(a)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ m(a, b) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL,
+ element: 'function(C#m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ get m => null;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL,
+ element: 'getter(C#m)',
+ body: '=>null;'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ set m(a) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL,
+ element: 'setter(C#m)',
+ parameters: '(a)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test.clazz(
+ '''
+ abstract class C {
+ m(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL,
+ element: 'function(C#m)',
+ parameters: '(a,b)'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test.clazz(
+ '''
+ abstract class C {
+ get m;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL,
+ element: 'getter(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ abstract class C {
+ set m(a);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL,
+ element: 'setter(C#m)',
+ parameters: '(a)'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ ]),
+ const Test(
+ '''
+ m(a, b) {}
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(m#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m() {
+ local(a, b) {}
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{local(a,b){}}'),
+ const Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL,
+ element: 'function(m#local)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(local#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(local#b)',
+ index: 1),
+ ]),
+ const Test(
+ '''
+ m() => (a, b) {};
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '=>(a,b){};'),
+ const Visit(VisitKind.VISIT_CLOSURE_DECL,
+ element: 'function(m#)',
+ parameters: '(a,b)',
+ body: '{}'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ]),
+ ],
+ 'Constructor declarations': const [
+ const Test.clazz(
+ '''
+ class C {
+ C(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var b;
+ C(a, this.b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,this.b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
+ element: 'initializing_formal(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var b;
+ C(a, [this.b = 42]);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,[this.b=42])',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
+ element: 'initializing_formal(#b)',
+ constant: 42,
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var b;
+ C(a, {this.b: 42});
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,{this.b: 42})',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL,
+ element: 'initializing_formal(#b)',
+ constant: 42),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ C(a, b) : super();
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ const Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE,
+ element: 'generative_constructor(Object#)',
+ type: 'Object',
+ arguments: '()',
+ selector: 'Selector(call, super, arity=0)'),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ var field;
+ C(a, b) : this.field = a;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ body: ';'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ const Visit(VisitKind.VISIT_FIELD_INITIALIZER,
+ element: 'field(C#field)',
+ rhs: 'a'),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ C(a, b) : this._(a, b);
+ C._(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
+ element: 'generative_constructor(C#)',
+ parameters: '(a,b)',
+ initializers: ':this._(a,b)'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ const Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE,
+ element: 'generative_constructor(C#_)',
+ arguments: '(a,b)',
+ selector: 'Selector(call, _, arity=2)'),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) => null;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ body: '=>null;'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = C._;
+ C._(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'generative_constructor(C#_)',
+ type: 'C'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = D;
+ }
+ class D<T> {
+ D(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'generative_constructor(D#)',
+ type: 'D'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = D<int>;
+ }
+ class D<T> {
+ D(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'generative_constructor(D#)',
+ type: 'D<int>'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ const Test.clazz(
+ '''
+ class C {
+ factory C(a, b) = D<int>;
+ }
+ class D<T> {
+ factory D(a, b) = E<D<T>>;
+ }
+ class E<S> {
+ E(a, b);
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: 'function(C#)',
+ parameters: '(a,b)',
+ target: 'function(D#)',
+ type: 'D<int>'),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#a)',
+ index: 0),
+ const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: 'parameter(#b)',
+ index: 1),
+ ],
+ method: ''),
+ ],
+ "Field declarations": const [
+ const Test.clazz(
+ '''
+ class C {
+ var m;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ var m, n;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ var m = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: 'field(C#m)',
+ rhs: 42),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local)'),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local=42;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local)',
+ rhs: 42),
+ ]),
+ const Test(
+ '''
+ m() {
+ const local = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{const local=42;}'),
+ const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: 'variable(m#local)',
+ constant: 42),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local1, local2;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local1,local2;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local1)'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local2)'),
+ ]),
+ const Test(
+ '''
+ m() {
+ var local1 = 42, local2 = true;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{var local1=42,local2=true;}'),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local1)',
+ rhs: 42),
+ const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: 'variable(m#local2)',
+ rhs: true),
+ ]),
+ const Test(
+ '''
+ m() {
+ const local1 = 42, local2 = true;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: 'function(m)',
+ parameters: '()',
+ body: '{const local1=42,local2=true;}'),
+ const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: 'variable(m#local1)',
+ constant: 42),
+ const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: 'variable(m#local2)',
+ constant: true),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m, n;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var k, l, m, n;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)'),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)',
+ rhs: 42),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static var m = 42, n = true;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: 'field(C#m)',
+ rhs: 42),
+ ]),
+ const Test.clazz(
+ '''
+ class C {
+ static const m = 42;
+ }
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL,
+ element: 'field(C#m)',
+ constant: 42),
+ ]),
+ const Test(
+ '''
+ var m;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: 'field(m)'),
+ ]),
+ const Test(
+ '''
+ var m, n;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: 'field(m)'),
+ ]),
+ const Test(
+ '''
+ var m = 42;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: 'field(m)',
+ rhs: 42),
+ ]),
+ const Test(
+ '''
+ const m = 42;
+ ''',
+ const [
+ const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
+ element: 'field(m)',
+ constant: 42),
+ ]),
+ ],
+};
+
main(List<String> arguments) {
asyncTest(() => Future.forEach([
() {
@@ -2267,2026 +3085,2667 @@ main(List<String> arguments) {
SEND_TESTS,
(elements) => new SemanticSendTestVisitor(elements));
},
+ () {
+ return test(
+ arguments,
+ DECL_TESTS,
+ (elements) => new SemanticDeclarationTestVisitor(elements));
+ },
], (f) => f()));
}
-Future test(List<String> arguments,
- Map<String, List<Test>> TESTS,
- SemanticTestVisitor createVisitor(TreeElements elements)) {
- Map<String, String> sourceFiles = {};
- Map<String, Test> testMap = {};
- StringBuffer mainSource = new StringBuffer();
- int index = 0;
- TESTS.forEach((String group, List<Test> tests) {
- if (arguments.isNotEmpty && !arguments.contains(group)) return;
+Future test(List<String> arguments,
+ Map<String, List<Test>> TESTS,
+ SemanticTestVisitor createVisitor(TreeElements elements)) {
+ Map<String, String> sourceFiles = {};
+ Map<String, Test> testMap = {};
+ StringBuffer mainSource = new StringBuffer();
+ int index = 0;
+ TESTS.forEach((String group, List<Test> tests) {
+ if (arguments.isNotEmpty && !arguments.contains(group)) return;
+
+ tests.forEach((Test test) {
+ StringBuffer testSource = new StringBuffer();
+ if (test.codeByPrefix != null) {
+ String prefixFilename = 'pre$index.dart';
+ sourceFiles[prefixFilename] = test.codeByPrefix;
+ testSource.writeln("import '$prefixFilename' as p;");
+ }
+
+ String filename = 'lib$index.dart';
+ testSource.writeln(test.code);
+ sourceFiles[filename] = testSource.toString();
+ mainSource.writeln("import '$filename';");
+ testMap[filename] = test;
+ index++;
+ });
+ });
+ mainSource.writeln("main() {}");
+ sourceFiles['main.dart'] = mainSource.toString();
+
+ Compiler compiler = compilerFor(sourceFiles,
+ options: ['--analyze-all', '--analyze-only']);
+ return compiler.run(Uri.parse('memory:main.dart')).then((_) {
+ testMap.forEach((String filename, Test test) {
+ LibraryElement library = compiler.libraryLoader.lookupLibrary(
+ Uri.parse('memory:$filename'));
+ var expectedVisits = test.expectedVisits;
+ if (expectedVisits is! List) {
+ expectedVisits = [expectedVisits];
+ }
+ Element element;
+ String cls = test.cls;
+ String method = test.method;
+ if (cls == null) {
+ element = library.find(method);
+ } else {
+ ClassElement classElement = library.find(cls);
+ Expect.isNotNull(classElement,
+ "Class '$cls' not found in:\n"
+ "${library.compilationUnit.script.text}");
+ element = classElement.localLookup(method);
+ }
+
+ void testAstElement(AstElement astElement) {
+ Expect.isNotNull(astElement, "Element '$method' not found in:\n"
+ "${library.compilationUnit.script.text}");
+ ResolvedAst resolvedAst = astElement.resolvedAst;
+ SemanticTestVisitor visitor = createVisitor(resolvedAst.elements);
+ try {
+ compiler.withCurrentElement(resolvedAst.element, () {
+ //print(resolvedAst.node.toDebugString());
+ resolvedAst.node.accept(visitor);
+ });
+ } catch (e, s) {
+ Expect.fail("$e:\n$s\nIn test:\n"
+ "${library.compilationUnit.script.text}");
+ }
+ Expect.listEquals(expectedVisits, visitor.visits,
+ "In test:\n"
+ "${library.compilationUnit.script.text}");
+ }
+ if (element.isAbstractField) {
+ AbstractFieldElement abstractFieldElement = element;
+ if (abstractFieldElement.getter != null) {
+ testAstElement(abstractFieldElement.getter);
+ } else if (abstractFieldElement.setter != null) {
+ testAstElement(abstractFieldElement.setter);
+ }
+ } else {
+ testAstElement(element);
+ }
+ });
+ });
+}
+
+abstract class SemanticTestVisitor extends TraversalVisitor {
+ List<Visit> visits = <Visit>[];
+
+ SemanticTestVisitor(TreeElements elements) : super(elements);
+
+ apply(Node node, arg) => node.accept(this);
+
+ internalError(Spannable spannable, String message) {
+ throw new SpannableAssertionFailure(spannable, message);
+ }
+}
+
+class SemanticSendTestVisitor extends SemanticTestVisitor {
+
+ SemanticSendTestVisitor(TreeElements elements) : super(elements);
+
+ @override
+ visitAs(
+ Send node,
+ Node expression,
+ DartType type,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_AS,
+ expression: expression, type: type));
+ apply(expression, arg);
+ }
+
+ @override
+ visitAssert(
+ Send node,
+ Node expression,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_ASSERT, expression: expression));
+ apply(expression, arg);
+ }
+
+ @override
+ errorInvalidAssert(
+ Send node,
+ NodeList arguments,
+ arg) {
+ // TODO: implement errorAssert
+ }
+
+ @override
+ visitBinary(
+ Send node,
+ Node left,
+ BinaryOperator operator,
+ Node right,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_BINARY,
+ left: left, operator: operator, right: right));
+ apply(left, arg);
+ apply(right, arg);
+ }
+
+ @override
+ visitIndex(
+ Send node,
+ Node receiver,
+ Node index,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_INDEX,
+ receiver: receiver, index: index));
+ apply(receiver, arg);
+ apply(index, arg);
+ }
+
+ @override
+ visitClassTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
+ constant: constant.getText()));
+ }
+
+ @override
+ visitClassTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
+ constant: constant.getText(), arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
+ errorClassTypeLiteralSet(
+ SendSet node,
+ ConstantExpression constant,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
+ constant: constant.getText(), rhs: rhs));
+ apply(rhs, arg);
+ }
+
+ @override
+ visitNotEquals(
+ Send node,
+ Node left,
+ Node right,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_NOT_EQUALS,
+ left: left, right: right));
+ apply(left, arg);
+ apply(right, arg);
+ }
+
+ @override
+ visitDynamicPropertyPrefix(
+ Send node,
+ Node receiver,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_PREFIX,
+ receiver: receiver, operator: operator,
+ getter: getterSelector, setter: setterSelector));
+ apply(receiver, arg);
+ }
+
+ @override
+ visitDynamicPropertyPostfix(
+ Send node,
+ Node receiver,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_POSTFIX,
+ receiver: receiver, operator: operator,
+ getter: getterSelector, setter: setterSelector));
+ apply(receiver, arg);
+ }
- tests.forEach((Test test) {
- StringBuffer testSource = new StringBuffer();
- if (test.codeByPrefix != null) {
- String prefixFilename = 'pre$index.dart';
- sourceFiles[prefixFilename] = test.codeByPrefix;
- testSource.writeln("import '$prefixFilename' as p;");
- }
+ @override
+ visitDynamicPropertyGet(
+ Send node,
+ Node receiver,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
+ receiver: receiver, name: selector.name));
+ apply(receiver, arg);
+ }
- String filename = 'lib$index.dart';
- testSource.writeln(test.code);
- sourceFiles[filename] = testSource.toString();
- mainSource.writeln("import '$filename';");
- testMap[filename] = test;
- index++;
- });
- });
- mainSource.writeln("main() {}");
- sourceFiles['main.dart'] = mainSource.toString();
+ @override
+ visitDynamicPropertyInvoke(
+ Send node,
+ Node receiver,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_INVOKE,
+ receiver: receiver, name: selector.name, arguments: arguments));
+ apply(receiver, arg);
+ apply(arguments, arg);
+ }
- Compiler compiler = compilerFor(sourceFiles,
- options: ['--analyze-all', '--analyze-only']);
- return compiler.run(Uri.parse('memory:main.dart')).then((_) {
- testMap.forEach((String filename, Test test) {
- LibraryElement library = compiler.libraryLoader.lookupLibrary(
- Uri.parse('memory:$filename'));
- var expectedVisits = test.expectedVisits;
- if (expectedVisits is! List) {
- expectedVisits = [expectedVisits];
- }
- AstElement element;
- String cls = test.cls;
- String method = test.method;
- if (cls == null) {
- element = library.find(method);
- } else {
- ClassElement classElement = library.find(cls);
- Expect.isNotNull(classElement,
- "Class '$cls' not found in:\n"
- "${library.compilationUnit.script.text}");
- element = classElement.localLookup(method);
- }
- Expect.isNotNull(element, "Element '$method' not found in:\n"
- "${library.compilationUnit.script.text}");
- ResolvedAst resolvedAst = element.resolvedAst;
- SemanticTestVisitor visitor = createVisitor(resolvedAst.elements);
- try {
- compiler.withCurrentElement(resolvedAst.element, () {
- //print(resolvedAst.node.toDebugString());
- resolvedAst.node.accept(visitor);
- });
- } catch (e, s) {
- Expect.fail("$e:\n$s\nIn test:\n"
- "${library.compilationUnit.script.text}");
- }
- Expect.listEquals(expectedVisits, visitor.visits,
- "In test:\n"
- "${library.compilationUnit.script.text}");
- });
- });
-}
+ @override
+ visitDynamicPropertySet(
+ SendSet node,
+ Node receiver,
+ Selector selector,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET,
+ receiver: receiver, name: selector.name, rhs: rhs));
+ apply(receiver, arg);
+ }
+ @override
+ visitDynamicTypeLiteralGet(
+ Send node,
+ ConstantExpression constant,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_GET,
+ constant: constant.getText()));
+ }
-abstract class SemanticTestVisitor extends TraversalVisitor {
- List<Visit> visits = <Visit>[];
+ @override
+ visitDynamicTypeLiteralInvoke(
+ Send node,
+ ConstantExpression constant,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
+ constant: constant.getText(), arguments: arguments));
+ }
+
+ @override
+ errorDynamicTypeLiteralSet(
+ Send node,
+ ConstantExpression constant,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
+ rhs: rhs));
+ apply(rhs, arg);
+ }
+
+ @override
+ visitExpressionInvoke(
+ Send node,
+ Node expression,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_EXPRESSION_INVOKE,
+ receiver: expression, arguments: arguments));
+ }
+
+ @override
+ visitIs(
+ Send node,
+ Node expression,
+ DartType type,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_IS,
+ expression: expression, type: type));
+ apply(expression, arg);
+ }
+
+ @override
+ visitIsNot(
+ Send node,
+ Node expression,
+ DartType type,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_IS_NOT,
+ expression: expression, type: type));
+ apply(expression, arg);
+ }
+
+ @override
+ visitLogicalAnd(
+ Send node,
+ Node left,
+ Node right,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOGICAL_AND,
+ left: left, right: right));
+ apply(left, arg);
+ apply(right, arg);
+ }
+
+ @override
+ visitLogicalOr(
+ Send node,
+ Node left,
+ Node right,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOGICAL_OR,
+ left: left, right: right));
+ apply(left, arg);
+ apply(right, arg);
+ }
+
+ @override
+ visitLocalFunctionGet(
+ Send node,
+ LocalFunctionElement function,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_GET,
+ element: function));
+ }
+
+ @override
+ visitLocalFunctionInvoke(
+ Send node,
+ LocalFunctionElement function,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE,
+ element: function, arguments: arguments, selector: selector));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitLocalVariableGet(
+ Send node,
+ LocalVariableElement variable,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_GET,
+ element: variable));
+ }
+
+ @override
+ visitLocalVariableInvoke(
+ Send node,
+ LocalVariableElement variable,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_INVOKE,
+ element: variable, arguments: arguments, selector: selector));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitLocalVariableSet(
+ SendSet node,
+ LocalVariableElement variable,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET,
+ element: variable, rhs: rhs));
+ apply(rhs, arg);
+ }
+
+ @override
+ visitParameterGet(
+ Send node,
+ ParameterElement parameter,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_PARAMETER_GET, element: parameter));
+ }
+
+ @override
+ visitParameterInvoke(
+ Send node,
+ ParameterElement parameter,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_PARAMETER_INVOKE,
+ element: parameter, arguments: arguments, selector: selector));
+ apply(arguments, arg);
+ }
- SemanticTestVisitor(TreeElements elements) : super(elements);
+ @override
+ visitParameterSet(
+ SendSet node,
+ ParameterElement parameter,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_PARAMETER_SET,
+ element: parameter, rhs: rhs));
+ apply(rhs, arg);
+ }
- apply(Node node, arg) => node.accept(this);
+ @override
+ visitStaticFieldGet(
+ Send node,
+ FieldElement field,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: field));
+ }
- internalError(Spannable spannable, String message) {
- throw new SpannableAssertionFailure(spannable, message);
+ @override
+ visitStaticFieldInvoke(
+ Send node,
+ FieldElement field,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
+ element: field, arguments: arguments));
+ apply(arguments, arg);
}
-}
-class SemanticSendTestVisitor extends SemanticTestVisitor {
+ @override
+ visitStaticFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_SET,
+ element: field, rhs: rhs));
+ apply(rhs, arg);
+ }
- SemanticSendTestVisitor(TreeElements elements) : super(elements);
+ @override
+ visitStaticFunctionGet(
+ Send node,
+ MethodElement function,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
+ element: function));
+ }
@override
- visitAs(
+ visitStaticFunctionInvoke(
Send node,
- Node expression,
- DartType type,
+ MethodElement function,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_AS,
- expression: expression, type: type));
- apply(expression, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
+ element: function, arguments: arguments));
+ apply(arguments, arg);
}
@override
- visitAssert(
+ visitStaticGetterGet(
Send node,
- Node expression,
+ FunctionElement getter,
arg) {
- visits.add(new Visit(VisitKind.VISIT_ASSERT, expression: expression));
- apply(expression, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_GET,
+ element: getter));
}
@override
- errorInvalidAssert(
+ visitStaticGetterInvoke(
Send node,
+ FunctionElement getter,
NodeList arguments,
+ Selector selector,
arg) {
- // TODO: implement errorAssert
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
+ element: getter, arguments: arguments));
+ apply(arguments, arg);
}
@override
- visitBinary(
+ visitStaticSetterSet(
+ SendSet node,
+ FunctionElement setter,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_SET,
+ element: setter, rhs: rhs));
+ apply(rhs, arg);
+ }
+
+ @override
+ visitSuperBinary(
Send node,
- Node left,
+ FunctionElement function,
BinaryOperator operator,
- Node right,
+ Node argument,
arg) {
- visits.add(new Visit(VisitKind.VISIT_BINARY,
- left: left, operator: operator, right: right));
- apply(left, arg);
- apply(right, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_BINARY,
+ element: function, operator: operator, right: argument));
+ apply(argument, arg);
}
@override
- visitIndex(
+ visitSuperIndex(
Send node,
- Node receiver,
+ FunctionElement function,
Node index,
arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX,
- receiver: receiver, index: index));
- apply(receiver, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX,
+ element: function, index: index));
apply(index, arg);
}
@override
- visitClassTypeLiteralGet(
+ visitSuperNotEquals(
Send node,
- ConstantExpression constant,
+ FunctionElement function,
+ Node argument,
arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
- constant: constant.getText()));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_NOT_EQUALS,
+ element: function, right: argument));
+ apply(argument, arg);
}
@override
- visitClassTypeLiteralInvoke(
+ visitThisGet(Identifier node, arg) {
+ visits.add(new Visit(VisitKind.VISIT_THIS_GET));
+ }
+
+ @override
+ visitThisInvoke(
Send node,
- ConstantExpression constant,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
- constant: constant.getText(), arguments: arguments));
+ visits.add(new Visit(VisitKind.VISIT_THIS_INVOKE, arguments: arguments));
apply(arguments, arg);
}
@override
- errorClassTypeLiteralSet(
+ visitThisPropertyGet(
+ Send node,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_GET,
+ name: selector.name));
+ }
+
+ @override
+ visitThisPropertyInvoke(
+ Send node,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
+ name: selector.name, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitThisPropertySet(
SendSet node,
- ConstantExpression constant,
+ Selector selector,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
- constant: constant.getText(), rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_SET,
+ name: selector.name, rhs: rhs));
apply(rhs, arg);
}
@override
- visitNotEquals(
+ visitTopLevelFieldGet(
Send node,
- Node left,
- Node right,
+ FieldElement field,
arg) {
- visits.add(new Visit(VisitKind.VISIT_NOT_EQUALS,
- left: left, right: right));
- apply(left, arg);
- apply(right, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, element: field));
}
@override
- visitDynamicPropertyPrefix(
+ visitTopLevelFieldInvoke(
Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ FieldElement field,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_PREFIX,
- receiver: receiver, operator: operator,
- getter: getterSelector, setter: setterSelector));
- apply(receiver, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
+ element: field, arguments: arguments));
+ apply(arguments, arg);
}
@override
- visitDynamicPropertyPostfix(
+ visitTopLevelFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
+ element: field, rhs: rhs));
+ apply(rhs, arg);
+ }
+
+ @override
+ visitTopLevelFunctionGet(
Send node,
- Node receiver,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ MethodElement function,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_POSTFIX,
- receiver: receiver, operator: operator,
- getter: getterSelector, setter: setterSelector));
- apply(receiver, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_GET,
+ element: function));
+ }
+
+ @override
+ visitTopLevelFunctionInvoke(
+ Send node,
+ MethodElement function,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
+ element: function, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitTopLevelGetterGet(
+ Send node,
+ FunctionElement getter,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET,
+ element: getter));
+ }
+
+ @override
+ visitTopLevelGetterInvoke(
+ Send node,
+ FunctionElement getter,
+ NodeList arguments,
+ Selector selector,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE,
+ element: getter, arguments: arguments));
+ apply(arguments, arg);
+ }
+
+ @override
+ visitTopLevelSetterSet(
+ SendSet node,
+ FunctionElement setter,
+ Node rhs,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_SET,
+ element: setter, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitDynamicPropertyGet(
+ visitTypeVariableTypeLiteralGet(
Send node,
- Node receiver,
- Selector selector,
+ TypeVariableElement element,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
- receiver: receiver, name: selector.name));
- apply(receiver, arg);
+ visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_GET,
+ element: element));
}
@override
- visitDynamicPropertyInvoke(
+ visitTypeVariableTypeLiteralInvoke(
Send node,
- Node receiver,
+ TypeVariableElement element,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_INVOKE,
- receiver: receiver, name: selector.name, arguments: arguments));
- apply(receiver, arg);
+ visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
+ element: element, arguments: arguments));
apply(arguments, arg);
}
@override
- visitDynamicPropertySet(
+ errorTypeVariableTypeLiteralSet(
SendSet node,
- Node receiver,
- Selector selector,
+ TypeVariableElement element,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET,
- receiver: receiver, name: selector.name, rhs: rhs));
- apply(receiver, arg);
+ visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
+ element: element, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitDynamicTypeLiteralGet(
+ visitTypedefTypeLiteralGet(
Send node,
ConstantExpression constant,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_GET,
+ visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_GET,
constant: constant.getText()));
}
@override
- visitDynamicTypeLiteralInvoke(
+ visitTypedefTypeLiteralInvoke(
Send node,
ConstantExpression constant,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
+ visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
constant: constant.getText(), arguments: arguments));
+ apply(arguments, arg);
}
@override
- errorDynamicTypeLiteralSet(
- Send node,
+ errorTypedefTypeLiteralSet(
+ SendSet node,
ConstantExpression constant,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
- rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
+ constant: constant.getText(), rhs: rhs));
apply(rhs, arg);
}
@override
- visitExpressionInvoke(
+ visitUnary(
Send node,
+ UnaryOperator operator,
Node expression,
- NodeList arguments,
- Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_EXPRESSION_INVOKE,
- receiver: expression, arguments: arguments));
+ visits.add(new Visit(VisitKind.VISIT_UNARY,
+ expression: expression, operator: operator));
+ apply(expression, arg);
}
@override
- visitIs(
+ visitNot(
Send node,
Node expression,
- DartType type,
arg) {
- visits.add(new Visit(VisitKind.VISIT_IS,
- expression: expression, type: type));
+ visits.add(new Visit(VisitKind.VISIT_NOT, expression: expression));
apply(expression, arg);
}
@override
- visitIsNot(
+ visitSuperFieldGet(
Send node,
- Node expression,
- DartType type,
+ FieldElement field,
arg) {
- visits.add(new Visit(VisitKind.VISIT_IS_NOT,
- expression: expression, type: type));
- apply(expression, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_GET, element: field));
}
@override
- visitLogicalAnd(
+ visitSuperFieldInvoke(
Send node,
- Node left,
- Node right,
+ FieldElement field,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOGICAL_AND,
- left: left, right: right));
- apply(left, arg);
- apply(right, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
+ element: field, arguments: arguments));
+ apply(arguments, arg);
}
@override
- visitLogicalOr(
- Send node,
- Node left,
- Node right,
+ visitSuperFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOGICAL_OR,
- left: left, right: right));
- apply(left, arg);
- apply(right, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SET,
+ element: field, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitLocalFunctionGet(
+ visitSuperMethodGet(
Send node,
- LocalFunctionElement function,
+ MethodElement method,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_GET,
- element: function));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_GET, element: method));
}
@override
- visitLocalFunctionInvoke(
+ visitSuperMethodInvoke(
Send node,
- LocalFunctionElement function,
+ MethodElement method,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE,
- element: function, arguments: arguments, selector: selector));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
+ element: method, arguments: arguments));
apply(arguments, arg);
}
@override
- visitLocalVariableGet(
+ visitSuperGetterGet(
Send node,
- LocalVariableElement variable,
+ FunctionElement getter,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_GET,
- element: variable));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_GET, element: getter));
}
@override
- visitLocalVariableInvoke(
+ visitSuperGetterInvoke(
Send node,
- LocalVariableElement variable,
+ FunctionElement getter,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_INVOKE,
- element: variable, arguments: arguments, selector: selector));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_INVOKE,
+ element: getter, arguments: arguments));
apply(arguments, arg);
}
@override
- visitLocalVariableSet(
+ visitSuperSetterSet(
SendSet node,
- LocalVariableElement variable,
+ FunctionElement setter,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET,
- element: variable, rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_SETTER_SET,
+ element: setter, rhs: rhs));
apply(rhs, arg);
}
@override
- visitParameterGet(
+ visitSuperUnary(
Send node,
- ParameterElement parameter,
+ UnaryOperator operator,
+ FunctionElement function,
arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_GET, element: parameter));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_UNARY,
+ element: function, operator: operator));
}
@override
- visitParameterInvoke(
+ visitEquals(
Send node,
- ParameterElement parameter,
- NodeList arguments,
- Selector selector,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_INVOKE,
- element: parameter, arguments: arguments, selector: selector));
- apply(arguments, arg);
- }
-
- @override
- visitParameterSet(
- SendSet node,
- ParameterElement parameter,
- Node rhs,
+ Node left,
+ Node right,
arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_SET,
- element: parameter, rhs: rhs));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_EQUALS, left: left, right: right));
+ apply(left, arg);
+ apply(right, arg);
}
@override
- visitStaticFieldGet(
+ visitSuperEquals(
Send node,
- FieldElement field,
+ FunctionElement function,
+ Node argument,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: field));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_EQUALS,
+ element: function, right: argument));
+ apply(argument, arg);
}
@override
- visitStaticFieldInvoke(
+ visitIndexSet(
Send node,
- FieldElement field,
- NodeList arguments,
- Selector selector,
+ Node receiver,
+ Node index,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
- element: field, arguments: arguments));
- apply(arguments, arg);
+ visits.add(new Visit(VisitKind.VISIT_INDEX_SET,
+ receiver: receiver, index: index, rhs: rhs));
+ apply(receiver, arg);
+ apply(index, arg);
+ apply(rhs, arg);
}
@override
- visitStaticFieldSet(
- SendSet node,
- FieldElement field,
+ visitSuperIndexSet(
+ Send node,
+ FunctionElement function,
+ Node index,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_SET,
- element: field, rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_SET,
+ element: function, index: index, rhs: rhs));
+ apply(index, arg);
apply(rhs, arg);
}
@override
- visitStaticFunctionGet(
- Send node,
- MethodElement function,
+ errorFinalLocalVariableSet(
+ SendSet node,
+ LocalVariableElement variable,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
- element: function));
+ // TODO: implement errorFinalLocalVariableSet
}
@override
- visitStaticFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- Selector selector,
+ errorFinalParameterSet(
+ SendSet node,
+ ParameterElement parameter,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
- element: function, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorFinalParameterSet
}
@override
- visitStaticGetterGet(
- Send node,
- FunctionElement getter,
+ errorFinalStaticFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_GET,
- element: getter));
+ // TODO: implement errorFinalStaticFieldSet
}
@override
- visitStaticGetterInvoke(
- Send node,
- FunctionElement getter,
- NodeList arguments,
- Selector selector,
+ errorFinalSuperFieldSet(
+ SendSet node,
+ FieldElement field,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
- element: getter, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorFinalSuperFieldSet
}
@override
- visitStaticSetterSet(
+ errorFinalTopLevelFieldSet(
SendSet node,
- FunctionElement setter,
+ FieldElement field,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_SET,
- element: setter, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorFinalTopLevelFieldSet
}
@override
- visitSuperBinary(
- Send node,
- FunctionElement function,
- BinaryOperator operator,
- Node argument,
+ errorLocalFunctionSet(
+ SendSet node,
+ LocalFunctionElement function,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_BINARY,
- element: function, operator: operator, right: argument));
- apply(argument, arg);
+ // TODO: implement errorLocalFunctionSet
}
@override
- visitSuperIndex(
+ errorStaticFunctionSet(
Send node,
- FunctionElement function,
- Node index,
+ MethodElement function,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX,
- element: function, index: index));
- apply(index, arg);
+ // TODO: implement errorStaticFunctionSet
}
@override
- visitSuperNotEquals(
- Send node,
- FunctionElement function,
- Node argument,
+ errorStaticGetterSet(
+ SendSet node,
+ FunctionElement getter,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_NOT_EQUALS,
- element: function, right: argument));
- apply(argument, arg);
+ // TODO: implement errorStaticGetterSet
}
@override
- visitThisGet(Identifier node, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_GET));
+ errorStaticSetterGet(
+ Send node,
+ FunctionElement setter,
+ arg) {
+ // TODO: implement errorStaticSetterGet
}
@override
- visitThisInvoke(
+ errorStaticSetterInvoke(
Send node,
+ FunctionElement setter,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_INVOKE, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorStaticSetterInvoke
}
@override
- visitThisPropertyGet(
- Send node,
- Selector selector,
+ errorSuperGetterSet(
+ SendSet node,
+ FunctionElement getter,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_GET,
- name: selector.name));
+ // TODO: implement errorSuperGetterSet
}
@override
- visitThisPropertyInvoke(
+ errorSuperMethodSet(
Send node,
- NodeList arguments,
- Selector selector,
+ MethodElement method,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
- name: selector.name, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorSuperMethodSet
}
@override
- visitThisPropertySet(
- SendSet node,
- Selector selector,
- Node rhs,
+ errorSuperSetterGet(
+ Send node,
+ FunctionElement setter,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_SET,
- name: selector.name, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorSuperSetterGet
}
@override
- visitTopLevelFieldGet(
+ errorSuperSetterInvoke(
Send node,
- FieldElement field,
+ FunctionElement setter,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, element: field));
+ // TODO: implement errorSuperSetterInvoke
}
@override
- visitTopLevelFieldInvoke(
+ errorTopLevelFunctionSet(
Send node,
- FieldElement field,
- NodeList arguments,
- Selector selector,
+ MethodElement function,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
- element: field, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorTopLevelFunctionSet
}
@override
- visitTopLevelFieldSet(
+ errorTopLevelGetterSet(
SendSet node,
- FieldElement field,
+ FunctionElement getter,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
- element: field, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorTopLevelGetterSet
}
@override
- visitTopLevelFunctionGet(
+ errorTopLevelSetterGet(
Send node,
- MethodElement function,
+ FunctionElement setter,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_GET,
- element: function));
+ // TODO: implement errorTopLevelSetterGet
}
@override
- visitTopLevelFunctionInvoke(
+ errorTopLevelSetterInvoke(
Send node,
- MethodElement function,
+ FunctionElement setter,
NodeList arguments,
Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- element: function, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorTopLevelSetterInvoke
}
@override
- visitTopLevelGetterGet(
+ visitDynamicPropertyCompound(
Send node,
- FunctionElement getter,
+ Node receiver,
+ AssignmentOperator operator,
+ Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET,
- element: getter));
+ visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_COMPOUND,
+ receiver: receiver, operator: operator, rhs: rhs,
+ getter: getterSelector, setter: setterSelector));
+ apply(receiver, arg);
+ apply(rhs, arg);
}
@override
- visitTopLevelGetterInvoke(
+ errorFinalLocalVariableCompound(
Send node,
- FunctionElement getter,
- NodeList arguments,
- Selector selector,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE,
- element: getter, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitTopLevelSetterSet(
- SendSet node,
- FunctionElement setter,
+ LocalVariableElement variable,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_SET,
- element: setter, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorFinalLocalVariableCompound
}
@override
- visitTypeVariableTypeLiteralGet(
+ errorFinalParameterCompound(
Send node,
- TypeVariableElement element,
+ ParameterElement parameter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_GET,
- element: element));
+ // TODO: implement errorFinalParameterCompound
}
@override
- visitTypeVariableTypeLiteralInvoke(
+ errorFinalStaticFieldCompound(
Send node,
- TypeVariableElement element,
- NodeList arguments,
- Selector selector,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
- element: element, arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorFinalStaticFieldCompound
}
@override
- errorTypeVariableTypeLiteralSet(
- SendSet node,
- TypeVariableElement element,
+ errorFinalSuperFieldCompound(
+ Send node,
+ FieldElement field,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
- element: element, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorFinalSuperFieldCompound
}
@override
- visitTypedefTypeLiteralGet(
+ errorFinalTopLevelFieldCompound(
Send node,
- ConstantExpression constant,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_GET,
- constant: constant.getText()));
+ // TODO: implement errorFinalTopLevelFieldCompound
}
@override
- visitTypedefTypeLiteralInvoke(
+ errorLocalFunctionCompound(
Send node,
- ConstantExpression constant,
- NodeList arguments,
- Selector selector,
+ LocalFunctionElement function,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
- constant: constant.getText(), arguments: arguments));
- apply(arguments, arg);
+ // TODO: implement errorLocalFunctionCompound
}
@override
- errorTypedefTypeLiteralSet(
- SendSet node,
- ConstantExpression constant,
+ visitLocalVariableCompound(
+ Send node,
+ LocalVariableElement variable,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
- constant: constant.getText(), rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_COMPOUND,
+ element: variable, operator: operator, rhs: rhs));
apply(rhs, arg);
}
@override
- visitUnary(
+ visitParameterCompound(
Send node,
- UnaryOperator operator,
- Node expression,
+ ParameterElement parameter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_UNARY,
- expression: expression, operator: operator));
- apply(expression, arg);
+ visits.add(new Visit(VisitKind.VISIT_PARAMETER_COMPOUND,
+ element: parameter, operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitNot(
+ visitStaticFieldCompound(
Send node,
- Node expression,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_NOT, expression: expression));
- apply(expression, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
+ element: field, operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitSuperFieldGet(
+ visitStaticGetterSetterCompound(
Send node,
- FieldElement field,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_GET, element: field));
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: getter, setter: setter));
+ apply(rhs, arg);
}
@override
- visitSuperFieldInvoke(
+ visitSuperFieldCompound(
Send node,
FieldElement field,
- NodeList arguments,
- Selector selector,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
- element: field, arguments: arguments));
- apply(arguments, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_COMPOUND,
+ element: field, operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitSuperFieldSet(
- SendSet node,
- FieldElement field,
+ visitSuperGetterSetterCompound(
+ Send node,
+ FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SET,
- element: field, rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: getter, setter: setter));
apply(rhs, arg);
}
@override
- visitSuperMethodGet(
+ visitThisPropertyCompound(
Send node,
- MethodElement method,
+ AssignmentOperator operator,
+ Node rhs,
+ Selector getterSelector,
+ Selector setterSelector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_GET, element: method));
+ visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: getterSelector, setter: setterSelector));
+ apply(rhs, arg);
}
@override
- visitSuperMethodInvoke(
+ visitTopLevelFieldCompound(
Send node,
- MethodElement method,
- NodeList arguments,
- Selector selector,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
- element: method, arguments: arguments));
- apply(arguments, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_COMPOUND,
+ element: field, operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- visitSuperGetterGet(
+ visitTopLevelGetterSetterCompound(
Send node,
FunctionElement getter,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_GET, element: getter));
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: getter, setter: setter));
+ apply(rhs, arg);
}
@override
- visitSuperGetterInvoke(
+ visitStaticMethodSetterCompound(
Send node,
- FunctionElement getter,
- NodeList arguments,
- Selector selector,
+ FunctionElement method,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_INVOKE,
- element: getter, arguments: arguments));
- apply(arguments, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: method, setter: setter));
+ apply(rhs, arg);
}
@override
- visitSuperSetterSet(
- SendSet node,
+ visitSuperFieldSetterCompound(
+ Send node,
+ FieldElement field,
FunctionElement setter,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_SETTER_SET,
- element: setter, rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: field, setter: setter));
apply(rhs, arg);
}
@override
- visitSuperUnary(
+ visitSuperGetterFieldCompound(
Send node,
- UnaryOperator operator,
- FunctionElement function,
+ FunctionElement getter,
+ FieldElement field,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_UNARY,
- element: function, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_COMPOUND,
+ operator: operator, rhs: rhs,
+ getter: getter, setter: field));
+ apply(rhs, arg);
}
@override
- visitEquals(
+ visitSuperMethodSetterCompound(
Send node,
- Node left,
- Node right,
+ FunctionElement method,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_EQUALS, left: left, right: right));
- apply(left, arg);
- apply(right, arg);
+ // TODO: implement visitSuperMethodSetterCompound
}
@override
- visitSuperEquals(
+ visitTopLevelMethodSetterCompound(
Send node,
- FunctionElement function,
- Node argument,
+ FunctionElement method,
+ FunctionElement setter,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_EQUALS,
- element: function, right: argument));
- apply(argument, arg);
+ // TODO: implement visitTopLevelMethodSetterCompound
}
@override
- visitIndexSet(
+ visitCompoundIndexSet(
Send node,
Node receiver,
Node index,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_SET,
- receiver: receiver, index: index, rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_COMPOUND_INDEX_SET,
+ receiver: receiver, index: index, rhs: rhs, operator: operator));
apply(receiver, arg);
apply(index, arg);
apply(rhs, arg);
}
@override
- visitSuperIndexSet(
+ visitSuperCompoundIndexSet(
Send node,
- FunctionElement function,
+ FunctionElement getter,
+ FunctionElement setter,
Node index,
+ AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_SET,
- element: function, index: index, rhs: rhs));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_COMPOUND_INDEX_SET,
+ getter: getter, setter: setter,
+ index: index, rhs: rhs, operator: operator));
apply(index, arg);
apply(rhs, arg);
}
@override
- errorFinalLocalVariableSet(
- SendSet node,
- LocalVariableElement variable,
+ errorClassTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
Node rhs,
arg) {
- // TODO: implement errorFinalLocalVariableSet
+ visits.add(new Visit(VisitKind.ERROR_CLASS_TYPE_LITERAL_COMPOUND,
+ constant: constant.getText(), operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- errorFinalParameterSet(
- SendSet node,
- ParameterElement parameter,
+ errorDynamicTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
Node rhs,
arg) {
- // TODO: implement errorFinalParameterSet
+ visits.add(new Visit(VisitKind.ERROR_DYNAMIC_TYPE_LITERAL_COMPOUND,
+ constant: constant.getText(), operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- errorFinalStaticFieldSet(
- SendSet node,
- FieldElement field,
+ errorTypeVariableTypeLiteralCompound(
+ Send node,
+ TypeVariableElement element,
+ AssignmentOperator operator,
Node rhs,
arg) {
- // TODO: implement errorFinalStaticFieldSet
+ visits.add(new Visit(VisitKind.ERROR_TYPE_VARIABLE_TYPE_LITERAL_COMPOUND,
+ element: element, operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- errorFinalSuperFieldSet(
- SendSet node,
- FieldElement field,
+ errorTypedefTypeLiteralCompound(
+ Send node,
+ ConstantExpression constant,
+ AssignmentOperator operator,
Node rhs,
arg) {
- // TODO: implement errorFinalSuperFieldSet
+ visits.add(new Visit(VisitKind.ERROR_TYPEDEF_TYPE_LITERAL_COMPOUND,
+ constant: constant.getText(), operator: operator, rhs: rhs));
+ apply(rhs, arg);
}
@override
- errorFinalTopLevelFieldSet(
- SendSet node,
- FieldElement field,
- Node rhs,
+ errorLocalFunctionPrefix(
+ Send node,
+ LocalFunctionElement function,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorFinalTopLevelFieldSet
+ // TODO: implement errorLocalFunctionPrefix
}
@override
- errorLocalFunctionSet(
- SendSet node,
- LocalFunctionElement function,
- Node rhs,
+ errorClassTypeLiteralPrefix(
+ Send node,
+ ConstantExpression constant,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorLocalFunctionSet
+ visits.add(new Visit(VisitKind.ERROR_CLASS_TYPE_LITERAL_PREFIX,
+ constant: constant.getText(), operator: operator));
}
@override
- errorStaticFunctionSet(
+ errorDynamicTypeLiteralPrefix(
Send node,
- MethodElement function,
- Node rhs,
+ ConstantExpression constant,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorStaticFunctionSet
+ visits.add(new Visit(VisitKind.ERROR_DYNAMIC_TYPE_LITERAL_PREFIX,
+ constant: constant.getText(), operator: operator));
}
@override
- errorStaticGetterSet(
- SendSet node,
- FunctionElement getter,
- Node rhs,
+ visitLocalVariablePrefix(
+ Send node,
+ LocalVariableElement variable,
+ IncDecOperator operator,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_PREFIX,
+ element: variable, operator: operator));
+ }
+
+ @override
+ visitParameterPrefix(
+ Send node,
+ ParameterElement parameter,
+ IncDecOperator operator,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_PARAMETER_PREFIX,
+ element: parameter, operator: operator));
+ }
+
+ @override
+ visitStaticFieldPrefix(
+ Send node,
+ FieldElement field,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorStaticGetterSet
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
+ element: field, operator: operator));
}
@override
- errorStaticSetterGet(
+ visitStaticGetterSetterPrefix(
Send node,
+ FunctionElement getter,
FunctionElement setter,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorStaticSetterGet
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
+ getter: getter, setter: setter, operator: operator));
}
@override
- errorStaticSetterInvoke(
+ visitStaticMethodSetterPrefix(
Send node,
+ FunctionElement getter,
FunctionElement setter,
- NodeList arguments,
- Selector selector,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorStaticSetterInvoke
+ // TODO: implement visitStaticMethodSetterPrefix
}
@override
- errorSuperGetterSet(
- SendSet node,
- FunctionElement getter,
- Node rhs,
+ visitSuperFieldFieldPrefix(
+ Send node,
+ FieldElement readField,
+ FieldElement writtenField,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorSuperGetterSet
+ // TODO: implement visitSuperFieldFieldPrefix
}
@override
- errorSuperMethodSet(
+ visitSuperFieldPrefix(
Send node,
- MethodElement method,
- Node rhs,
+ FieldElement field,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorSuperMethodSet
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_PREFIX,
+ element: field, operator: operator));
}
@override
- errorSuperSetterGet(
+ visitSuperFieldSetterPrefix(
Send node,
+ FieldElement field,
FunctionElement setter,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorSuperSetterGet
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_PREFIX,
+ getter: field, setter: setter, operator: operator));
}
@override
- errorSuperSetterInvoke(
+ visitSuperGetterFieldPrefix(
Send node,
- FunctionElement setter,
- NodeList arguments,
- Selector selector,
+ FunctionElement getter,
+ FieldElement field,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorSuperSetterInvoke
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_PREFIX,
+ getter: getter, setter: field, operator: operator));
}
@override
- errorTopLevelFunctionSet(
+ visitSuperGetterSetterPrefix(
Send node,
- MethodElement function,
- Node rhs,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorTopLevelFunctionSet
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_PREFIX,
+ getter: getter, setter: setter, operator: operator));
}
@override
- errorTopLevelGetterSet(
- SendSet node,
- FunctionElement getter,
- Node rhs,
+ visitSuperMethodSetterPrefix(
+ Send node,
+ FunctionElement method,
+ FunctionElement setter,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorTopLevelGetterSet
+ // TODO: implement visitSuperMethodSetterPrefix
}
@override
- errorTopLevelSetterGet(
+ visitThisPropertyPrefix(
Send node,
- FunctionElement setter,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
arg) {
- // TODO: implement errorTopLevelSetterGet
+ visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
+ operator: operator,
+ getter: getterSelector, setter: setterSelector));
}
@override
- errorTopLevelSetterInvoke(
+ visitTopLevelFieldPrefix(
Send node,
- FunctionElement setter,
- NodeList arguments,
- Selector selector,
+ FieldElement field,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorTopLevelSetterInvoke
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_PREFIX,
+ element: field, operator: operator));
}
@override
- visitDynamicPropertyCompound(
+ visitTopLevelGetterSetterPrefix(
Send node,
- Node receiver,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_COMPOUND,
- receiver: receiver, operator: operator, rhs: rhs,
- getter: getterSelector, setter: setterSelector));
- apply(receiver, arg);
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
+ getter: getter, setter: setter, operator: operator));
}
@override
- errorFinalLocalVariableCompound(
+ visitTopLevelMethodSetterPrefix(
Send node,
- LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
+ FunctionElement method,
+ FunctionElement setter,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorFinalLocalVariableCompound
+ // TODO: implement visitTopLevelMethodSetterPrefix
}
@override
- errorFinalParameterCompound(
+ errorTypeVariableTypeLiteralPrefix(
Send node,
- ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
+ TypeVariableElement element,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorFinalParameterCompound
+ visits.add(new Visit(VisitKind.ERROR_TYPE_VARIABLE_TYPE_LITERAL_PREFIX,
+ element: element, operator: operator));
}
@override
- errorFinalStaticFieldCompound(
+ errorTypedefTypeLiteralPrefix(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorFinalStaticFieldCompound
+ visits.add(new Visit(VisitKind.ERROR_TYPEDEF_TYPE_LITERAL_PREFIX,
+ constant: constant.getText(), operator: operator));
}
@override
- errorFinalSuperFieldCompound(
+ errorLocalFunctionPostfix(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ LocalFunctionElement function,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorFinalSuperFieldCompound
+ // TODO: implement errorLocalFunctionPostfix
}
@override
- errorFinalTopLevelFieldCompound(
+ errorClassTypeLiteralPostfix(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorFinalTopLevelFieldCompound
+ visits.add(new Visit(VisitKind.ERROR_CLASS_TYPE_LITERAL_POSTFIX,
+ constant: constant.getText(), operator: operator));
}
@override
- errorLocalFunctionCompound(
+ errorDynamicTypeLiteralPostfix(
Send node,
- LocalFunctionElement function,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
+ IncDecOperator operator,
arg) {
- // TODO: implement errorLocalFunctionCompound
+ visits.add(new Visit(VisitKind.ERROR_DYNAMIC_TYPE_LITERAL_POSTFIX,
+ constant: constant.getText(), operator: operator));
}
@override
- visitLocalVariableCompound(
+ visitLocalVariablePostfix(
Send node,
LocalVariableElement variable,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_COMPOUND,
- element: variable, operator: operator, rhs: rhs));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_POSTFIX,
+ element: variable, operator: operator));
}
@override
- visitParameterCompound(
+ visitParameterPostfix(
Send node,
ParameterElement parameter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_COMPOUND,
- element: parameter, operator: operator, rhs: rhs));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_PARAMETER_POSTFIX,
+ element: parameter, operator: operator));
}
@override
- visitStaticFieldCompound(
+ visitStaticFieldPostfix(
Send node,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
+ element: field, operator: operator));
}
@override
- visitStaticGetterSetterCompound(
+ visitStaticGetterSetterPostfix(
Send node,
FunctionElement getter,
FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
- operator: operator, rhs: rhs,
- getter: getter, setter: setter));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
+ getter: getter, setter: setter, operator: operator));
}
@override
- visitSuperFieldCompound(
+ visitStaticMethodSetterPostfix(
Send node,
- FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ FunctionElement getter,
+ FunctionElement setter,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement visitStaticMethodSetterPostfix
}
@override
- visitSuperGetterSetterCompound(
+ visitSuperFieldFieldPostfix(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ FieldElement readField,
+ FieldElement writtenField,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_COMPOUND,
- operator: operator, rhs: rhs,
- getter: getter, setter: setter));
- apply(rhs, arg);
+ // TODO: implement visitSuperFieldFieldPostfix
}
@override
- visitThisPropertyCompound(
+ visitSuperFieldPostfix(
Send node,
- AssignmentOperator operator,
- Node rhs,
- Selector getterSelector,
- Selector setterSelector,
+ FieldElement field,
+ IncDecOperator operator,
+ arg) {
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_POSTFIX,
+ element: field, operator: operator));
+ }
+
+ @override
+ visitSuperFieldSetterPostfix(
+ Send node,
+ FieldElement field,
+ FunctionElement setter,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
- operator: operator, rhs: rhs,
- getter: getterSelector, setter: setterSelector));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_POSTFIX,
+ getter: field, setter: setter, operator: operator));
}
@override
- visitTopLevelFieldCompound(
+ visitSuperGetterFieldPostfix(
Send node,
+ FunctionElement getter,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_POSTFIX,
+ getter: getter, setter: field, operator: operator));
}
@override
- visitTopLevelGetterSetterCompound(
+ visitSuperGetterSetterPostfix(
Send node,
FunctionElement getter,
FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
- operator: operator, rhs: rhs,
- getter: getter, setter: setter));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_POSTFIX,
+ getter: getter, setter: setter, operator: operator));
}
@override
- visitStaticMethodSetterCompound(
+ visitSuperMethodSetterPostfix(
Send node,
FunctionElement method,
FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- operator: operator, rhs: rhs,
- getter: method, setter: setter));
- apply(rhs, arg);
+ // TODO: implement visitSuperMethodSetterPostfix
}
@override
- visitSuperFieldSetterCompound(
+ visitThisPropertyPostfix(
Send node,
- FieldElement field,
- FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
+ Selector getterSelector,
+ Selector setterSelector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_COMPOUND,
- operator: operator, rhs: rhs,
- getter: field, setter: setter));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
+ operator: operator,
+ getter: getterSelector, setter: setterSelector));
}
@override
- visitSuperGetterFieldCompound(
+ visitTopLevelFieldPostfix(
Send node,
- FunctionElement getter,
FieldElement field,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_COMPOUND,
- operator: operator, rhs: rhs,
- getter: getter, setter: field));
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_POSTFIX,
+ element: field, operator: operator));
}
@override
- visitSuperMethodSetterCompound(
+ visitTopLevelGetterSetterPostfix(
Send node,
- FunctionElement method,
+ FunctionElement getter,
FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- // TODO: implement visitSuperMethodSetterCompound
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
+ getter: getter, setter: setter, operator: operator));
}
@override
- visitTopLevelMethodSetterCompound(
+ visitTopLevelMethodSetterPostfix(
Send node,
FunctionElement method,
FunctionElement setter,
- AssignmentOperator operator,
- Node rhs,
+ IncDecOperator operator,
arg) {
- // TODO: implement visitTopLevelMethodSetterCompound
+ // TODO: implement visitTopLevelMethodSetterPostfix
}
@override
- visitCompoundIndexSet(
+ errorTypeVariableTypeLiteralPostfix(
Send node,
- Node receiver,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ TypeVariableElement element,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_COMPOUND_INDEX_SET,
- receiver: receiver, index: index, rhs: rhs, operator: operator));
- apply(receiver, arg);
- apply(index, arg);
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.ERROR_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
+ element: element, operator: operator));
}
@override
- visitSuperCompoundIndexSet(
+ errorTypedefTypeLiteralPostfix(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ ConstantExpression constant,
+ IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_COMPOUND_INDEX_SET,
- getter: getter, setter: setter,
- index: index, rhs: rhs, operator: operator));
- apply(index, arg);
- apply(rhs, arg);
+ visits.add(new Visit(VisitKind.ERROR_TYPEDEF_TYPE_LITERAL_POSTFIX,
+ constant: constant.getText(), operator: operator));
}
@override
- errorClassTypeLiteralCompound(
+ visitConstantGet(
Send node,
ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
arg) {
- visits.add(new Visit(VisitKind.ERROR_CLASS_TYPE_LITERAL_COMPOUND,
- constant: constant.getText(), operator: operator, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement visitConstantGet
}
@override
- errorDynamicTypeLiteralCompound(
+ visitConstantInvoke(
Send node,
ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.ERROR_DYNAMIC_TYPE_LITERAL_COMPOUND,
- constant: constant.getText(), operator: operator, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement visitConstantInvoke
}
@override
- errorTypeVariableTypeLiteralCompound(
+ errorUnresolvedCompound(
Send node,
- TypeVariableElement element,
+ ErroneousElement element,
AssignmentOperator operator,
Node rhs,
arg) {
- visits.add(new Visit(VisitKind.ERROR_TYPE_VARIABLE_TYPE_LITERAL_COMPOUND,
- element: element, operator: operator, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorUnresolvedCompound
}
@override
- errorTypedefTypeLiteralCompound(
+ errorUnresolvedGet(
Send node,
- ConstantExpression constant,
- AssignmentOperator operator,
- Node rhs,
+ ErroneousElement element,
arg) {
- visits.add(new Visit(VisitKind.ERROR_TYPEDEF_TYPE_LITERAL_COMPOUND,
- constant: constant.getText(), operator: operator, rhs: rhs));
- apply(rhs, arg);
+ // TODO: implement errorUnresolvedGet
}
@override
- errorLocalFunctionPrefix(
+ errorUnresolvedInvoke(
Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
+ ErroneousElement element,
+ NodeList arguments,
+ Selector selector,
arg) {
- // TODO: implement errorLocalFunctionPrefix
+ // TODO: implement errorUnresolvedInvoke
}
@override
- errorClassTypeLiteralPrefix(
+ errorUnresolvedPostfix(
Send node,
- ConstantExpression constant,
+ ErroneousElement element,
IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.ERROR_CLASS_TYPE_LITERAL_PREFIX,
- constant: constant.getText(), operator: operator));
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_POSTFIX, operator: operator));
}
@override
- errorDynamicTypeLiteralPrefix(
+ errorUnresolvedPrefix(
Send node,
- ConstantExpression constant,
+ ErroneousElement element,
IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.ERROR_DYNAMIC_TYPE_LITERAL_PREFIX,
- constant: constant.getText(), operator: operator));
+ // TODO: implement errorUnresolvedPrefix
}
@override
- visitLocalVariablePrefix(
+ errorUnresolvedSet(
Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
+ ErroneousElement element,
+ Node rhs,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_PREFIX,
- element: variable, operator: operator));
+ // TODO: implement errorUnresolvedSet
}
@override
- visitParameterPrefix(
+ errorUndefinedBinaryExpression(
Send node,
- ParameterElement parameter,
- IncDecOperator operator,
+ Node left,
+ Operator operator,
+ Node right,
arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_PREFIX,
- element: parameter, operator: operator));
+ // TODO: implement errorUndefinedBinaryExpression
}
@override
- visitStaticFieldPrefix(
+ errorUndefinedUnaryExpression(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ Operator operator,
+ Node expression,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
- element: field, operator: operator));
+ // TODO: implement errorUndefinedUnaryExpression
}
@override
- visitStaticGetterSetterPrefix(
+ errorUnresolvedSuperBinary(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ ErroneousElement element,
+ BinaryOperator operator,
+ Node argument,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
+ // TODO: implement errorUnresolvedSuperBinary
}
@override
- visitStaticMethodSetterPrefix(
+ errorUnresolvedSuperCompoundIndexSet(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ ErroneousElement element,
+ Node index,
+ AssignmentOperator operator,
+ Node rhs,
arg) {
- // TODO: implement visitStaticMethodSetterPrefix
+ // TODO: implement errorUnresolvedSuperCompoundIndexSet
}
@override
- visitSuperFieldFieldPrefix(
+ errorUnresolvedSuperIndexSet(
Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
+ ErroneousElement element,
+ Node index,
+ Node rhs,
arg) {
- // TODO: implement visitSuperFieldFieldPrefix
+ // TODO: implement errorUnresolvedSuperIndexSet
}
@override
- visitSuperFieldPrefix(
+ errorUnresolvedSuperUnary(
+ Send node,
+ UnaryOperator operator,
+ ErroneousElement element,
+ arg) {
+ // TODO: implement errorUnresolvedSuperUnary
+ }
+
+ @override
+ errorUnresolvedSuperIndex(
+ Send node,
+ Element element,
+ Node index,
+ arg) {
+ // TODO: implement errorUnresolvedSuperIndex
+ }
+
+ @override
+ errorUnresolvedSuperIndexPostfix(
Send node,
- FieldElement field,
+ Element function,
+ Node index,
IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_PREFIX,
- element: field, operator: operator));
+ // TODO: implement errorUnresolvedSuperIndexPostfix
}
@override
- visitSuperFieldSetterPrefix(
+ errorUnresolvedSuperIndexPrefix(
Send node,
- FieldElement field,
- FunctionElement setter,
+ Element function,
+ Node index,
IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_PREFIX,
- getter: field, setter: setter, operator: operator));
+ // TODO: implement errorUnresolvedSuperIndexPrefix
}
@override
- visitSuperGetterFieldPrefix(
+ visitIndexPostfix(
Send node,
- FunctionElement getter,
- FieldElement field,
+ Node receiver,
+ Node index,
IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_PREFIX,
- getter: getter, setter: field, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_INDEX_POSTFIX,
+ receiver: receiver, index: index, operator: operator));
+ apply(receiver, arg);
+ apply(index, arg);
}
@override
- visitSuperGetterSetterPrefix(
+ visitIndexPrefix(
Send node,
- FunctionElement getter,
- FunctionElement setter,
+ Node receiver,
+ Node index,
IncDecOperator operator,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_INDEX_PREFIX,
+ receiver: receiver, index: index, operator: operator));
+ apply(receiver, arg);
+ apply(index, arg);
}
@override
- visitSuperMethodSetterPrefix(
+ visitSuperIndexPostfix(
Send node,
- FunctionElement method,
- FunctionElement setter,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
IncDecOperator operator,
arg) {
- // TODO: implement visitSuperMethodSetterPrefix
+ visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_POSTFIX,
+ getter: indexFunction, setter: indexSetFunction,
+ index: index, operator: operator));
+ apply(index, arg);
}
@override
- visitThisPropertyPrefix(
+ visitSuperIndexPrefix(
Send node,
+ FunctionElement indexFunction,
+ FunctionElement indexSetFunction,
+ Node index,
IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
- operator: operator,
- getter: getterSelector, setter: setterSelector));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_PREFIX,
+ getter: indexFunction, setter: indexSetFunction,
+ index: index, operator: operator));
+ apply(index, arg);
}
@override
- visitTopLevelFieldPrefix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
+ errorUnresolvedClassConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ MalformedType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_PREFIX,
- element: field, operator: operator));
+ // TODO(johnniwinther): Test [type] and [selector].
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
+ arguments: arguments));
+ apply(arguments, arg);
}
@override
- visitTopLevelGetterSetterPrefix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ errorUnresolvedConstructorInvoke(
+ NewExpression node,
+ Element constructor,
+ DartType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
+ // TODO(johnniwinther): Test [type] and [selector].
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_CONSTRUCTOR_INVOKE,
+ arguments: arguments));
+ apply(arguments, arg);
}
@override
- visitTopLevelMethodSetterPrefix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ visitConstConstructorInvoke(
+ NewExpression node,
+ ConstructedConstantExpression constant,
arg) {
- // TODO: implement visitTopLevelMethodSetterPrefix
+ visits.add(new Visit(VisitKind.VISIT_CONST_CONSTRUCTOR_INVOKE,
+ constant: constant.getText()));
}
@override
- errorTypeVariableTypeLiteralPrefix(
- Send node,
- TypeVariableElement element,
- IncDecOperator operator,
+ visitFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.ERROR_TYPE_VARIABLE_TYPE_LITERAL_PREFIX,
- element: element, operator: operator));
+ visits.add(new Visit(
+ VisitKind.VISIT_FACTORY_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: selector));
+ apply(arguments, arg);
}
@override
- errorTypedefTypeLiteralPrefix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ visitGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.ERROR_TYPEDEF_TYPE_LITERAL_PREFIX,
- constant: constant.getText(), operator: operator));
+ visits.add(new Visit(
+ VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: selector));
+ apply(arguments, arg);
}
@override
- errorLocalFunctionPostfix(
- Send node,
- LocalFunctionElement function,
- IncDecOperator operator,
+ visitRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ ConstructorElement effectiveTarget,
+ InterfaceType effectiveTargetType,
+ NodeList arguments,
+ Selector selector,
arg) {
- // TODO: implement errorLocalFunctionPostfix
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ target: effectiveTarget,
+ targetType: effectiveTargetType,
+ arguments: arguments,
+ selector: selector));
+ apply(arguments, arg);
}
@override
- errorClassTypeLiteralPostfix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ visitRedirectingGenerativeConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.ERROR_CLASS_TYPE_LITERAL_POSTFIX,
- constant: constant.getText(), operator: operator));
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: selector));
+ apply(arguments, arg);
}
@override
- errorDynamicTypeLiteralPostfix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ errorAbstractClassConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.ERROR_DYNAMIC_TYPE_LITERAL_POSTFIX,
- constant: constant.getText(), operator: operator));
+ visits.add(new Visit(
+ VisitKind.ERROR_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: selector));
+ apply(arguments, arg);
}
@override
- visitLocalVariablePostfix(
- Send node,
- LocalVariableElement variable,
- IncDecOperator operator,
+ errorUnresolvedRedirectingFactoryConstructorInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_POSTFIX,
- element: variable, operator: operator));
+ visits.add(new Visit(
+ VisitKind.ERROR_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ element: constructor,
+ type: type,
+ arguments: arguments,
+ selector: selector));
+ apply(arguments, arg);
}
+}
+
+class SemanticDeclarationTestVisitor extends SemanticTestVisitor {
+
+ SemanticDeclarationTestVisitor(TreeElements elements) : super(elements);
@override
- visitParameterPostfix(
+ errorUnresolvedSuperConstructorInvoke(
Send node,
- ParameterElement parameter,
- IncDecOperator operator,
+ Element element,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_POSTFIX,
- element: parameter, operator: operator));
+ // TODO: implement errorUnresolvedSuperConstructorInvoke
}
@override
- visitStaticFieldPostfix(
+ errorUnresolvedThisConstructorInvoke(
Send node,
- FieldElement field,
- IncDecOperator operator,
+ Element element,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
- element: field, operator: operator));
+ // TODO: implement errorUnresolvedThisConstructorInvoke
}
@override
- visitStaticGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ visitAbstractMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL,
+ element: method, parameters: parameters));
+ applyParameters(parameters, arg);
}
@override
- visitStaticMethodSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ visitClosureDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
arg) {
- // TODO: implement visitStaticMethodSetterPostfix
+ visits.add(new Visit(VisitKind.VISIT_CLOSURE_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
}
@override
- visitSuperFieldFieldPostfix(
- Send node,
- FieldElement readField,
- FieldElement writtenField,
- IncDecOperator operator,
+ visitFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ Node body,
arg) {
- // TODO: implement visitSuperFieldFieldPostfix
+ visits.add(new Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
+ element: constructor, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
}
@override
- visitSuperFieldPostfix(
- Send node,
+ visitFieldInitializer(
+ SendSet node,
FieldElement field,
- IncDecOperator operator,
+ Node initializer,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_POSTFIX,
- element: field, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_FIELD_INITIALIZER,
+ element: field, rhs: initializer));
+ apply(initializer, arg);
}
@override
- visitSuperFieldSetterPostfix(
- Send node,
- FieldElement field,
- FunctionElement setter,
- IncDecOperator operator,
+ visitGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_POSTFIX,
- getter: field, setter: setter, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ element: constructor, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
+ apply(body, arg);
}
@override
- visitSuperGetterFieldPostfix(
- Send node,
- FunctionElement getter,
- FieldElement field,
- IncDecOperator operator,
+ visitInstanceMethodDeclaration(
+ FunctionExpression node,
+ MethodElement method,
+ NodeList parameters,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_POSTFIX,
- getter: getter, setter: field, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL,
+ element: method, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
}
@override
- visitSuperGetterSetterPostfix(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ visitLocalFunctionDeclaration(
+ FunctionExpression node,
+ LocalFunctionElement function,
+ NodeList parameters,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
}
@override
- visitSuperMethodSetterPostfix(
- Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ visitRedirectingFactoryConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ InterfaceType redirectionType,
+ ConstructorElement redirectionTarget,
arg) {
- // TODO: implement visitSuperMethodSetterPostfix
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+ element: constructor,
+ parameters: parameters,
+ target: redirectionTarget,
+ type: redirectionType));
+ applyParameters(parameters, arg);
}
@override
- visitThisPropertyPostfix(
- Send node,
- IncDecOperator operator,
- Selector getterSelector,
- Selector setterSelector,
+ visitRedirectingGenerativeConstructorDeclaration(
+ FunctionExpression node,
+ ConstructorElement constructor,
+ NodeList parameters,
+ NodeList initializers,
arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
- operator: operator,
- getter: getterSelector, setter: setterSelector));
+ visits.add(new Visit(
+ VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
+ element: constructor,
+ parameters: parameters,
+ initializers: initializers));
+ applyParameters(parameters, arg);
+ applyInitializers(initializers, arg);
}
@override
- visitTopLevelFieldPostfix(
- Send node,
- FieldElement field,
- IncDecOperator operator,
+ visitStaticFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_POSTFIX,
- element: field, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
}
@override
- visitTopLevelGetterSetterPostfix(
+ visitSuperConstructorInvoke(
Send node,
- FunctionElement getter,
- FunctionElement setter,
- IncDecOperator operator,
+ ConstructorElement superConstructor,
+ InterfaceType type,
+ NodeList arguments,
+ Selector selector,
arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE,
+ element: superConstructor, type: type,
+ arguments: arguments, selector: selector));
+ apply(arguments, arg);
}
@override
- visitTopLevelMethodSetterPostfix(
+ visitThisConstructorInvoke(
Send node,
- FunctionElement method,
- FunctionElement setter,
- IncDecOperator operator,
+ ConstructorElement thisConstructor,
+ NodeList arguments,
+ Selector selector,
arg) {
- // TODO: implement visitTopLevelMethodSetterPostfix
+ visits.add(new Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE,
+ element: thisConstructor, arguments: arguments, selector: selector));
+ apply(arguments, arg);
}
@override
- errorTypeVariableTypeLiteralPostfix(
- Send node,
- TypeVariableElement element,
- IncDecOperator operator,
+ visitTopLevelFunctionDeclaration(
+ FunctionExpression node,
+ MethodElement function,
+ NodeList parameters,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.ERROR_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
- element: element, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
+ element: function, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
}
@override
- errorTypedefTypeLiteralPostfix(
- Send node,
- ConstantExpression constant,
- IncDecOperator operator,
+ errorUnresolvedFieldInitializer(
+ SendSet node,
+ Element element,
+ Node initializer,
arg) {
- visits.add(new Visit(VisitKind.ERROR_TYPEDEF_TYPE_LITERAL_POSTFIX,
- constant: constant.getText(), operator: operator));
+ // TODO: implement errorUnresolvedFieldInitializer
}
@override
- visitConstantGet(
- Send node,
- ConstantExpression constant,
+ visitOptionalParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
+ int index,
arg) {
- // TODO: implement visitConstantGet
+ visits.add(new Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
+ element: parameter,
+ constant: defaultValue != null ? defaultValue.getText() : null,
+ index: index));
}
@override
- visitConstantInvoke(
- Send node,
- ConstantExpression constant,
- NodeList arguments,
- Selector selector,
+ visitParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ int index,
arg) {
- // TODO: implement visitConstantInvoke
+ visits.add(new Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
+ element: parameter, index: index));
}
@override
- errorUnresolvedCompound(
- Send node,
- ErroneousElement element,
- AssignmentOperator operator,
- Node rhs,
+ visitInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ int index,
arg) {
- // TODO: implement errorUnresolvedCompound
+ visits.add(new Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
+ element: initializingFormal, index: index));
}
@override
- errorUnresolvedGet(
- Send node,
- ErroneousElement element,
+ visitLocalVariableDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ Node initializer,
arg) {
- // TODO: implement errorUnresolvedGet
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
+ element: variable, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- errorUnresolvedInvoke(
- Send node,
- ErroneousElement element,
- NodeList arguments,
- Selector selector,
+ visitLocalConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ LocalVariableElement variable,
+ ConstantExpression constant,
arg) {
- // TODO: implement errorUnresolvedInvoke
+ visits.add(new Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
+ element: variable, constant: constant.getText()));
+ return null;
}
@override
- errorUnresolvedPostfix(
- Send node,
- ErroneousElement element,
- IncDecOperator operator,
+ visitNamedInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
arg) {
- visits.add(new Visit(
- VisitKind.ERROR_UNRESOLVED_POSTFIX, operator: operator));
+ visits.add(new Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL,
+ element: initializingFormal,
+ constant: defaultValue != null ? defaultValue.getText() : null));
}
@override
- errorUnresolvedPrefix(
- Send node,
- ErroneousElement element,
- IncDecOperator operator,
+ visitNamedParameterDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ ParameterElement parameter,
+ ConstantExpression defaultValue,
arg) {
- // TODO: implement errorUnresolvedPrefix
+ visits.add(new Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
+ element: parameter,
+ constant: defaultValue != null ? defaultValue.getText() : null));
}
@override
- errorUnresolvedSet(
- Send node,
- ErroneousElement element,
- Node rhs,
+ visitOptionalInitializingFormalDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ InitializingFormalElement initializingFormal,
+ ConstantExpression defaultValue,
+ int index,
arg) {
- // TODO: implement errorUnresolvedSet
+ visits.add(new Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
+ element: initializingFormal,
+ constant: defaultValue != null ? defaultValue.getText() : null,
+ index: index));
}
@override
- errorUndefinedBinaryExpression(
- Send node,
- Node left,
- Operator operator,
- Node right,
+ visitInstanceFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
arg) {
- // TODO: implement errorUndefinedBinaryExpression
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
+ element: field, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- errorUndefinedUnaryExpression(
- Send node,
- Operator operator,
- Node expression,
+ visitStaticConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
arg) {
- // TODO: implement errorUndefinedUnaryExpression
+ visits.add(new Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL,
+ element: field, constant: constant.getText()));
+ return null;
}
@override
- errorUnresolvedSuperBinary(
- Send node,
- ErroneousElement element,
- BinaryOperator operator,
- Node argument,
+ visitStaticFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
arg) {
- // TODO: implement errorUnresolvedSuperBinary
+ visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
+ element: field, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- errorUnresolvedSuperCompoundIndexSet(
- Send node,
- ErroneousElement element,
- Node index,
- AssignmentOperator operator,
- Node rhs,
+ visitTopLevelConstantDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ ConstantExpression constant,
arg) {
- // TODO: implement errorUnresolvedSuperCompoundIndexSet
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
+ element: field, constant: constant.getText()));
+ return null;
}
@override
- errorUnresolvedSuperIndexSet(
- Send node,
- ErroneousElement element,
- Node index,
- Node rhs,
+ visitTopLevelFieldDeclaration(
+ VariableDefinitions node,
+ Node definition,
+ FieldElement field,
+ Node initializer,
arg) {
- // TODO: implement errorUnresolvedSuperIndexSet
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
+ element: field, rhs: initializer));
+ if (initializer != null) {
+ apply(initializer, arg);
+ }
+ return null;
}
@override
- errorUnresolvedSuperUnary(
- Send node,
- UnaryOperator operator,
- ErroneousElement element,
+ visitAbstractGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
arg) {
- // TODO: implement errorUnresolvedSuperUnary
+ visits.add(new Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL,
+ element: getter));
+ return null;
}
@override
- errorUnresolvedSuperIndex(
- Send node,
- Element element,
- Node index,
+ visitAbstractSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
arg) {
- // TODO: implement errorUnresolvedSuperIndex
+ visits.add(new Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL,
+ element: setter, parameters: parameters));
+ applyParameters(parameters, arg);
+ return null;
}
@override
- errorUnresolvedSuperIndexPostfix(
- Send node,
- Element function,
- Node index,
- IncDecOperator operator,
+ visitInstanceGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
arg) {
- // TODO: implement errorUnresolvedSuperIndexPostfix
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL,
+ element: getter, body: body));
+ apply(body, arg);
+ return null;
}
@override
- errorUnresolvedSuperIndexPrefix(
- Send node,
- Element function,
- Node index,
- IncDecOperator operator,
+ visitInstanceSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
arg) {
- // TODO: implement errorUnresolvedSuperIndexPrefix
+ visits.add(new Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL,
+ element: setter, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
}
@override
- visitIndexPostfix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
+ visitTopLevelGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_POSTFIX,
- receiver: receiver, index: index, operator: operator));
- apply(receiver, arg);
- apply(index, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL,
+ element: getter, body: body));
+ apply(body, arg);
+ return null;
}
@override
- visitIndexPrefix(
- Send node,
- Node receiver,
- Node index,
- IncDecOperator operator,
+ visitTopLevelSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_PREFIX,
- receiver: receiver, index: index, operator: operator));
- apply(receiver, arg);
- apply(index, arg);
+ visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL,
+ element: setter, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
}
@override
- visitSuperIndexPostfix(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
+ visitStaticGetterDeclaration(
+ FunctionExpression node,
+ MethodElement getter,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_POSTFIX,
- getter: indexFunction, setter: indexSetFunction,
- index: index, operator: operator));
- apply(index, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_DECL,
+ element: getter, body: body));
+ apply(body, arg);
+ return null;
}
@override
- visitSuperIndexPrefix(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
+ visitStaticSetterDeclaration(
+ FunctionExpression node,
+ MethodElement setter,
+ NodeList parameters,
+ Node body,
arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_PREFIX,
- getter: indexFunction, setter: indexSetFunction,
- index: index, operator: operator));
- apply(index, arg);
+ visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_DECL,
+ element: setter, parameters: parameters, body: body));
+ applyParameters(parameters, arg);
+ apply(body, arg);
+ return null;
}
@override
@@ -4449,9 +5908,13 @@ enum VisitKind {
VISIT_LOCAL_VARIABLE_COMPOUND,
VISIT_LOCAL_VARIABLE_PREFIX,
VISIT_LOCAL_VARIABLE_POSTFIX,
+ VISIT_LOCAL_VARIABLE_DECL,
+ VISIT_LOCAL_CONSTANT_DECL,
VISIT_LOCAL_FUNCTION_GET,
VISIT_LOCAL_FUNCTION_INVOKE,
+ VISIT_LOCAL_FUNCTION_DECL,
+ VISIT_CLOSURE_DECL,
VISIT_STATIC_FIELD_GET,
VISIT_STATIC_FIELD_SET,
@@ -4459,6 +5922,8 @@ enum VisitKind {
VISIT_STATIC_FIELD_COMPOUND,
VISIT_STATIC_FIELD_PREFIX,
VISIT_STATIC_FIELD_POSTFIX,
+ VISIT_STATIC_FIELD_DECL,
+ VISIT_STATIC_CONSTANT_DECL,
VISIT_STATIC_GETTER_GET,
VISIT_STATIC_SETTER_SET,
@@ -4467,9 +5932,12 @@ enum VisitKind {
VISIT_STATIC_METHOD_SETTER_COMPOUND,
VISIT_STATIC_GETTER_SETTER_PREFIX,
VISIT_STATIC_GETTER_SETTER_POSTFIX,
+ VISIT_STATIC_GETTER_DECL,
+ VISIT_STATIC_SETTER_DECL,
VISIT_STATIC_FUNCTION_GET,
VISIT_STATIC_FUNCTION_INVOKE,
+ VISIT_STATIC_FUNCTION_DECL,
VISIT_TOP_LEVEL_FIELD_GET,
VISIT_TOP_LEVEL_FIELD_SET,
@@ -4477,6 +5945,8 @@ enum VisitKind {
VISIT_TOP_LEVEL_FIELD_COMPOUND,
VISIT_TOP_LEVEL_FIELD_PREFIX,
VISIT_TOP_LEVEL_FIELD_POSTFIX,
+ VISIT_TOP_LEVEL_FIELD_DECL,
+ VISIT_TOP_LEVEL_CONSTANT_DECL,
VISIT_TOP_LEVEL_GETTER_GET,
VISIT_TOP_LEVEL_SETTER_SET,
@@ -4484,9 +5954,12 @@ enum VisitKind {
VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
+ VISIT_TOP_LEVEL_GETTER_DECL,
+ VISIT_TOP_LEVEL_SETTER_DECL,
VISIT_TOP_LEVEL_FUNCTION_GET,
VISIT_TOP_LEVEL_FUNCTION_INVOKE,
+ VISIT_TOP_LEVEL_FUNCTION_DECL,
VISIT_DYNAMIC_PROPERTY_GET,
VISIT_DYNAMIC_PROPERTY_SET,
@@ -4598,11 +6071,35 @@ enum VisitKind {
VISIT_FACTORY_CONSTRUCTOR_INVOKE,
VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ VISIT_SUPER_CONSTRUCTOR_INVOKE,
+ VISIT_THIS_CONSTRUCTOR_INVOKE,
+ VISIT_FIELD_INITIALIZER,
+
ERROR_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
ERROR_UNRESOLVED_CONSTRUCTOR_INVOKE,
ERROR_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
ERROR_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
+ VISIT_INSTANCE_GETTER_DECL,
+ VISIT_INSTANCE_SETTER_DECL,
+ VISIT_INSTANCE_METHOD_DECL,
+ VISIT_ABSTRACT_GETTER_DECL,
+ VISIT_ABSTRACT_SETTER_DECL,
+ VISIT_ABSTRACT_METHOD_DECL,
+ VISIT_INSTANCE_FIELD_DECL,
+
+ VISIT_GENERATIVE_CONSTRUCTOR_DECL,
+ VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
+ VISIT_FACTORY_CONSTRUCTOR_DECL,
+ VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
+
+ VISIT_REQUIRED_PARAMETER_DECL,
+ VISIT_OPTIONAL_PARAMETER_DECL,
+ VISIT_NAMED_PARAMETER_DECL,
+ VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
+ VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
+ VISIT_NAMED_INITIALIZING_FORMAL_DECL,
+
ERROR_UNRESOLVED_POSTFIX,
// TODO(johnniwinther): Add tests for more error cases.
« no previous file with comments | « pkg/compiler/lib/src/use_unused_api.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698