| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.ast_test; | 8 library engine.ast_test; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 [ | 2104 [ |
| 2105 AstFactory.fieldDeclaration2( | 2105 AstFactory.fieldDeclaration2( |
| 2106 false, | 2106 false, |
| 2107 Keyword.VAR, | 2107 Keyword.VAR, |
| 2108 [AstFactory.variableDeclaration("a")])])); | 2108 [AstFactory.variableDeclaration("a")])])); |
| 2109 } | 2109 } |
| 2110 | 2110 |
| 2111 void test_visitClassDeclaration_withMetadata() { | 2111 void test_visitClassDeclaration_withMetadata() { |
| 2112 ClassDeclaration declaration = | 2112 ClassDeclaration declaration = |
| 2113 AstFactory.classDeclaration(null, "C", null, null, null, null); | 2113 AstFactory.classDeclaration(null, "C", null, null, null, null); |
| 2114 declaration.metadata = | 2114 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 2115 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 2116 _assertSource("@deprecated class C {}", declaration); | 2115 _assertSource("@deprecated class C {}", declaration); |
| 2117 } | 2116 } |
| 2118 | 2117 |
| 2119 void test_visitClassTypeAlias_abstract() { | 2118 void test_visitClassTypeAlias_abstract() { |
| 2120 _assertSource( | 2119 _assertSource( |
| 2121 "abstract class C = S with M1;", | 2120 "abstract class C = S with M1;", |
| 2122 AstFactory.classTypeAlias( | 2121 AstFactory.classTypeAlias( |
| 2123 "C", | 2122 "C", |
| 2124 null, | 2123 null, |
| 2125 Keyword.ABSTRACT, | 2124 Keyword.ABSTRACT, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2214 } | 2213 } |
| 2215 | 2214 |
| 2216 void test_visitClassTypeAlias_withMetadata() { | 2215 void test_visitClassTypeAlias_withMetadata() { |
| 2217 ClassTypeAlias declaration = AstFactory.classTypeAlias( | 2216 ClassTypeAlias declaration = AstFactory.classTypeAlias( |
| 2218 "C", | 2217 "C", |
| 2219 null, | 2218 null, |
| 2220 null, | 2219 null, |
| 2221 AstFactory.typeName4("S"), | 2220 AstFactory.typeName4("S"), |
| 2222 AstFactory.withClause([AstFactory.typeName4("M1")]), | 2221 AstFactory.withClause([AstFactory.typeName4("M1")]), |
| 2223 null); | 2222 null); |
| 2224 declaration.metadata = | 2223 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 2225 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 2226 _assertSource("@deprecated class C = S with M1;", declaration); | 2224 _assertSource("@deprecated class C = S with M1;", declaration); |
| 2227 } | 2225 } |
| 2228 | 2226 |
| 2229 void test_visitComment() { | 2227 void test_visitComment() { |
| 2230 _assertSource( | 2228 _assertSource( |
| 2231 "", | 2229 "", |
| 2232 Comment.createBlockComment( | 2230 Comment.createBlockComment( |
| 2233 <Token>[TokenFactory.tokenFromString("/* comment */")])); | 2231 <Token>[TokenFactory.tokenFromString("/* comment */")])); |
| 2234 } | 2232 } |
| 2235 | 2233 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2416 | 2414 |
| 2417 void test_visitConstructorDeclaration_withMetadata() { | 2415 void test_visitConstructorDeclaration_withMetadata() { |
| 2418 ConstructorDeclaration declaration = AstFactory.constructorDeclaration2( | 2416 ConstructorDeclaration declaration = AstFactory.constructorDeclaration2( |
| 2419 null, | 2417 null, |
| 2420 null, | 2418 null, |
| 2421 AstFactory.identifier3("C"), | 2419 AstFactory.identifier3("C"), |
| 2422 null, | 2420 null, |
| 2423 AstFactory.formalParameterList(), | 2421 AstFactory.formalParameterList(), |
| 2424 null, | 2422 null, |
| 2425 AstFactory.blockFunctionBody2()); | 2423 AstFactory.blockFunctionBody2()); |
| 2426 declaration.metadata = | 2424 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 2427 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 2428 _assertSource("@deprecated C() {}", declaration); | 2425 _assertSource("@deprecated C() {}", declaration); |
| 2429 } | 2426 } |
| 2430 | 2427 |
| 2431 void test_visitConstructorFieldInitializer_withoutThis() { | 2428 void test_visitConstructorFieldInitializer_withoutThis() { |
| 2432 _assertSource( | 2429 _assertSource( |
| 2433 "a = b", | 2430 "a = b", |
| 2434 AstFactory.constructorFieldInitializer( | 2431 AstFactory.constructorFieldInitializer( |
| 2435 false, | 2432 false, |
| 2436 "a", | 2433 "a", |
| 2437 AstFactory.identifier3("b"))); | 2434 AstFactory.identifier3("b"))); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 AstFactory.showCombinator([AstFactory.identifier3("A")]), | 2543 AstFactory.showCombinator([AstFactory.identifier3("A")]), |
| 2547 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); | 2544 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); |
| 2548 } | 2545 } |
| 2549 | 2546 |
| 2550 void test_visitExportDirective_minimal() { | 2547 void test_visitExportDirective_minimal() { |
| 2551 _assertSource("export 'a.dart';", AstFactory.exportDirective2("a.dart")); | 2548 _assertSource("export 'a.dart';", AstFactory.exportDirective2("a.dart")); |
| 2552 } | 2549 } |
| 2553 | 2550 |
| 2554 void test_visitExportDirective_withMetadata() { | 2551 void test_visitExportDirective_withMetadata() { |
| 2555 ExportDirective directive = AstFactory.exportDirective2("a.dart"); | 2552 ExportDirective directive = AstFactory.exportDirective2("a.dart"); |
| 2556 directive.metadata = | 2553 directive.metadata.add(AstFactory.annotation(AstFactory.identifier3("depreca
ted"))); |
| 2557 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 2558 _assertSource("@deprecated export 'a.dart';", directive); | 2554 _assertSource("@deprecated export 'a.dart';", directive); |
| 2559 } | 2555 } |
| 2560 | 2556 |
| 2561 void test_visitExpressionFunctionBody_async() { | 2557 void test_visitExpressionFunctionBody_async() { |
| 2562 _assertSource( | 2558 _assertSource( |
| 2563 "async => a;", | 2559 "async => a;", |
| 2564 AstFactory.asyncExpressionFunctionBody(AstFactory.identifier3("a"))); | 2560 AstFactory.asyncExpressionFunctionBody(AstFactory.identifier3("a"))); |
| 2565 } | 2561 } |
| 2566 | 2562 |
| 2567 void test_visitExpressionFunctionBody_simple() { | 2563 void test_visitExpressionFunctionBody_simple() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 2598 true, | 2594 true, |
| 2599 Keyword.VAR, | 2595 Keyword.VAR, |
| 2600 [AstFactory.variableDeclaration("a")])); | 2596 [AstFactory.variableDeclaration("a")])); |
| 2601 } | 2597 } |
| 2602 | 2598 |
| 2603 void test_visitFieldDeclaration_withMetadata() { | 2599 void test_visitFieldDeclaration_withMetadata() { |
| 2604 FieldDeclaration declaration = AstFactory.fieldDeclaration2( | 2600 FieldDeclaration declaration = AstFactory.fieldDeclaration2( |
| 2605 false, | 2601 false, |
| 2606 Keyword.VAR, | 2602 Keyword.VAR, |
| 2607 [AstFactory.variableDeclaration("a")]); | 2603 [AstFactory.variableDeclaration("a")]); |
| 2608 declaration.metadata = | 2604 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 2609 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 2610 _assertSource("@deprecated var a;", declaration); | 2605 _assertSource("@deprecated var a;", declaration); |
| 2611 } | 2606 } |
| 2612 | 2607 |
| 2613 void test_visitFieldFormalParameter_functionTyped() { | 2608 void test_visitFieldFormalParameter_functionTyped() { |
| 2614 _assertSource( | 2609 _assertSource( |
| 2615 "A this.a(b)", | 2610 "A this.a(b)", |
| 2616 AstFactory.fieldFormalParameter( | 2611 AstFactory.fieldFormalParameter( |
| 2617 null, | 2612 null, |
| 2618 AstFactory.typeName4("A"), | 2613 AstFactory.typeName4("A"), |
| 2619 "a", | 2614 "a", |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3033 "f", | 3028 "f", |
| 3034 AstFactory.functionExpression())); | 3029 AstFactory.functionExpression())); |
| 3035 } | 3030 } |
| 3036 | 3031 |
| 3037 void test_visitFunctionDeclaration_withMetadata() { | 3032 void test_visitFunctionDeclaration_withMetadata() { |
| 3038 FunctionDeclaration declaration = AstFactory.functionDeclaration( | 3033 FunctionDeclaration declaration = AstFactory.functionDeclaration( |
| 3039 null, | 3034 null, |
| 3040 null, | 3035 null, |
| 3041 "f", | 3036 "f", |
| 3042 AstFactory.functionExpression()); | 3037 AstFactory.functionExpression()); |
| 3043 declaration.metadata = | 3038 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 3044 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3045 _assertSource("@deprecated f() {}", declaration); | 3039 _assertSource("@deprecated f() {}", declaration); |
| 3046 } | 3040 } |
| 3047 | 3041 |
| 3048 void test_visitFunctionDeclarationStatement() { | 3042 void test_visitFunctionDeclarationStatement() { |
| 3049 _assertSource( | 3043 _assertSource( |
| 3050 "f() {}", | 3044 "f() {}", |
| 3051 AstFactory.functionDeclarationStatement( | 3045 AstFactory.functionDeclarationStatement( |
| 3052 null, | 3046 null, |
| 3053 null, | 3047 null, |
| 3054 "f", | 3048 "f", |
| (...skipping 29 matching lines...) Expand all Loading... |
| 3084 null, | 3078 null, |
| 3085 AstFactory.formalParameterList())); | 3079 AstFactory.formalParameterList())); |
| 3086 } | 3080 } |
| 3087 | 3081 |
| 3088 void test_visitFunctionTypeAlias_withMetadata() { | 3082 void test_visitFunctionTypeAlias_withMetadata() { |
| 3089 FunctionTypeAlias declaration = AstFactory.typeAlias( | 3083 FunctionTypeAlias declaration = AstFactory.typeAlias( |
| 3090 AstFactory.typeName4("A"), | 3084 AstFactory.typeName4("A"), |
| 3091 "F", | 3085 "F", |
| 3092 null, | 3086 null, |
| 3093 AstFactory.formalParameterList()); | 3087 AstFactory.formalParameterList()); |
| 3094 declaration.metadata = | 3088 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 3095 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3096 _assertSource("@deprecated typedef A F();", declaration); | 3089 _assertSource("@deprecated typedef A F();", declaration); |
| 3097 } | 3090 } |
| 3098 | 3091 |
| 3099 void test_visitFunctionTypedFormalParameter_noType() { | 3092 void test_visitFunctionTypedFormalParameter_noType() { |
| 3100 _assertSource("f()", AstFactory.functionTypedFormalParameter(null, "f")); | 3093 _assertSource("f()", AstFactory.functionTypedFormalParameter(null, "f")); |
| 3101 } | 3094 } |
| 3102 | 3095 |
| 3103 void test_visitFunctionTypedFormalParameter_type() { | 3096 void test_visitFunctionTypedFormalParameter_type() { |
| 3104 _assertSource( | 3097 _assertSource( |
| 3105 "T f()", | 3098 "T f()", |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 AstFactory.importDirective3( | 3180 AstFactory.importDirective3( |
| 3188 "a.dart", | 3181 "a.dart", |
| 3189 "p", | 3182 "p", |
| 3190 [ | 3183 [ |
| 3191 AstFactory.showCombinator([AstFactory.identifier3("A")]), | 3184 AstFactory.showCombinator([AstFactory.identifier3("A")]), |
| 3192 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); | 3185 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); |
| 3193 } | 3186 } |
| 3194 | 3187 |
| 3195 void test_visitImportDirective_withMetadata() { | 3188 void test_visitImportDirective_withMetadata() { |
| 3196 ImportDirective directive = AstFactory.importDirective3("a.dart", null); | 3189 ImportDirective directive = AstFactory.importDirective3("a.dart", null); |
| 3197 directive.metadata = | 3190 directive.metadata.add(AstFactory.annotation(AstFactory.identifier3("depreca
ted"))); |
| 3198 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3199 _assertSource("@deprecated import 'a.dart';", directive); | 3191 _assertSource("@deprecated import 'a.dart';", directive); |
| 3200 } | 3192 } |
| 3201 | 3193 |
| 3202 void test_visitImportHideCombinator_multiple() { | 3194 void test_visitImportHideCombinator_multiple() { |
| 3203 _assertSource( | 3195 _assertSource( |
| 3204 "hide a, b", | 3196 "hide a, b", |
| 3205 AstFactory.hideCombinator( | 3197 AstFactory.hideCombinator( |
| 3206 [AstFactory.identifier3("a"), AstFactory.identifier3("b")])); | 3198 [AstFactory.identifier3("a"), AstFactory.identifier3("b")])); |
| 3207 } | 3199 } |
| 3208 | 3200 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3311 [AstFactory.label2("a")], | 3303 [AstFactory.label2("a")], |
| 3312 AstFactory.returnStatement())); | 3304 AstFactory.returnStatement())); |
| 3313 } | 3305 } |
| 3314 | 3306 |
| 3315 void test_visitLibraryDirective() { | 3307 void test_visitLibraryDirective() { |
| 3316 _assertSource("library l;", AstFactory.libraryDirective2("l")); | 3308 _assertSource("library l;", AstFactory.libraryDirective2("l")); |
| 3317 } | 3309 } |
| 3318 | 3310 |
| 3319 void test_visitLibraryDirective_withMetadata() { | 3311 void test_visitLibraryDirective_withMetadata() { |
| 3320 LibraryDirective directive = AstFactory.libraryDirective2("l"); | 3312 LibraryDirective directive = AstFactory.libraryDirective2("l"); |
| 3321 directive.metadata = | 3313 directive.metadata.add(AstFactory.annotation(AstFactory.identifier3("depreca
ted"))); |
| 3322 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3323 _assertSource("@deprecated library l;", directive); | 3314 _assertSource("@deprecated library l;", directive); |
| 3324 } | 3315 } |
| 3325 | 3316 |
| 3326 void test_visitLibraryIdentifier_multiple() { | 3317 void test_visitLibraryIdentifier_multiple() { |
| 3327 _assertSource( | 3318 _assertSource( |
| 3328 "a.b.c", | 3319 "a.b.c", |
| 3329 AstFactory.libraryIdentifier( | 3320 AstFactory.libraryIdentifier( |
| 3330 [ | 3321 [ |
| 3331 AstFactory.identifier3("a"), | 3322 AstFactory.identifier3("a"), |
| 3332 AstFactory.identifier3("b"), | 3323 AstFactory.identifier3("b"), |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3555 | 3546 |
| 3556 void test_visitMethodDeclaration_withMetadata() { | 3547 void test_visitMethodDeclaration_withMetadata() { |
| 3557 MethodDeclaration declaration = AstFactory.methodDeclaration2( | 3548 MethodDeclaration declaration = AstFactory.methodDeclaration2( |
| 3558 null, | 3549 null, |
| 3559 null, | 3550 null, |
| 3560 null, | 3551 null, |
| 3561 null, | 3552 null, |
| 3562 AstFactory.identifier3("m"), | 3553 AstFactory.identifier3("m"), |
| 3563 AstFactory.formalParameterList(), | 3554 AstFactory.formalParameterList(), |
| 3564 AstFactory.blockFunctionBody2()); | 3555 AstFactory.blockFunctionBody2()); |
| 3565 declaration.metadata = | 3556 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 3566 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3567 _assertSource("@deprecated m() {}", declaration); | 3557 _assertSource("@deprecated m() {}", declaration); |
| 3568 } | 3558 } |
| 3569 | 3559 |
| 3570 void test_visitMethodInvocation_noTarget() { | 3560 void test_visitMethodInvocation_noTarget() { |
| 3571 _assertSource("m()", AstFactory.methodInvocation2("m")); | 3561 _assertSource("m()", AstFactory.methodInvocation2("m")); |
| 3572 } | 3562 } |
| 3573 | 3563 |
| 3574 void test_visitMethodInvocation_target() { | 3564 void test_visitMethodInvocation_target() { |
| 3575 _assertSource( | 3565 _assertSource( |
| 3576 "t.m()", | 3566 "t.m()", |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3608 "(a)", | 3598 "(a)", |
| 3609 AstFactory.parenthesizedExpression(AstFactory.identifier3("a"))); | 3599 AstFactory.parenthesizedExpression(AstFactory.identifier3("a"))); |
| 3610 } | 3600 } |
| 3611 | 3601 |
| 3612 void test_visitPartDirective() { | 3602 void test_visitPartDirective() { |
| 3613 _assertSource("part 'a.dart';", AstFactory.partDirective2("a.dart")); | 3603 _assertSource("part 'a.dart';", AstFactory.partDirective2("a.dart")); |
| 3614 } | 3604 } |
| 3615 | 3605 |
| 3616 void test_visitPartDirective_withMetadata() { | 3606 void test_visitPartDirective_withMetadata() { |
| 3617 PartDirective directive = AstFactory.partDirective2("a.dart"); | 3607 PartDirective directive = AstFactory.partDirective2("a.dart"); |
| 3618 directive.metadata = | 3608 directive.metadata.add(AstFactory.annotation(AstFactory.identifier3("depreca
ted"))); |
| 3619 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3620 _assertSource("@deprecated part 'a.dart';", directive); | 3609 _assertSource("@deprecated part 'a.dart';", directive); |
| 3621 } | 3610 } |
| 3622 | 3611 |
| 3623 void test_visitPartOfDirective() { | 3612 void test_visitPartOfDirective() { |
| 3624 _assertSource( | 3613 _assertSource( |
| 3625 "part of l;", | 3614 "part of l;", |
| 3626 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]))); | 3615 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]))); |
| 3627 } | 3616 } |
| 3628 | 3617 |
| 3629 void test_visitPartOfDirective_withMetadata() { | 3618 void test_visitPartOfDirective_withMetadata() { |
| 3630 PartOfDirective directive = | 3619 PartOfDirective directive = |
| 3631 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])); | 3620 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])); |
| 3632 directive.metadata = | 3621 directive.metadata.add(AstFactory.annotation(AstFactory.identifier3("depreca
ted"))); |
| 3633 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3634 _assertSource("@deprecated part of l;", directive); | 3622 _assertSource("@deprecated part of l;", directive); |
| 3635 } | 3623 } |
| 3636 | 3624 |
| 3637 void test_visitPositionalFormalParameter() { | 3625 void test_visitPositionalFormalParameter() { |
| 3638 _assertSource( | 3626 _assertSource( |
| 3639 "var a = 0", | 3627 "var a = 0", |
| 3640 AstFactory.positionalFormalParameter( | 3628 AstFactory.positionalFormalParameter( |
| 3641 AstFactory.simpleFormalParameter(Keyword.VAR, "a"), | 3629 AstFactory.simpleFormalParameter(Keyword.VAR, "a"), |
| 3642 AstFactory.integer(0))); | 3630 AstFactory.integer(0))); |
| 3643 } | 3631 } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3917 } | 3905 } |
| 3918 | 3906 |
| 3919 void test_visitTypeParameter_withExtends() { | 3907 void test_visitTypeParameter_withExtends() { |
| 3920 _assertSource( | 3908 _assertSource( |
| 3921 "E extends C", | 3909 "E extends C", |
| 3922 AstFactory.typeParameter2("E", AstFactory.typeName4("C"))); | 3910 AstFactory.typeParameter2("E", AstFactory.typeName4("C"))); |
| 3923 } | 3911 } |
| 3924 | 3912 |
| 3925 void test_visitTypeParameter_withMetadata() { | 3913 void test_visitTypeParameter_withMetadata() { |
| 3926 TypeParameter parameter = AstFactory.typeParameter("E"); | 3914 TypeParameter parameter = AstFactory.typeParameter("E"); |
| 3927 parameter.metadata = | 3915 parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("depreca
ted"))); |
| 3928 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3929 _assertSource("@deprecated E", parameter); | 3916 _assertSource("@deprecated E", parameter); |
| 3930 } | 3917 } |
| 3931 | 3918 |
| 3932 void test_visitTypeParameter_withoutExtends() { | 3919 void test_visitTypeParameter_withoutExtends() { |
| 3933 _assertSource("E", AstFactory.typeParameter("E")); | 3920 _assertSource("E", AstFactory.typeParameter("E")); |
| 3934 } | 3921 } |
| 3935 | 3922 |
| 3936 void test_visitTypeParameterList_multiple() { | 3923 void test_visitTypeParameterList_multiple() { |
| 3937 _assertSource("<E, F>", AstFactory.typeParameterList(["E", "F"])); | 3924 _assertSource("<E, F>", AstFactory.typeParameterList(["E", "F"])); |
| 3938 } | 3925 } |
| 3939 | 3926 |
| 3940 void test_visitTypeParameterList_single() { | 3927 void test_visitTypeParameterList_single() { |
| 3941 _assertSource("<E>", AstFactory.typeParameterList(["E"])); | 3928 _assertSource("<E>", AstFactory.typeParameterList(["E"])); |
| 3942 } | 3929 } |
| 3943 | 3930 |
| 3944 void test_visitVariableDeclaration_initialized() { | 3931 void test_visitVariableDeclaration_initialized() { |
| 3945 _assertSource( | 3932 _assertSource( |
| 3946 "a = b", | 3933 "a = b", |
| 3947 AstFactory.variableDeclaration2("a", AstFactory.identifier3("b"))); | 3934 AstFactory.variableDeclaration2("a", AstFactory.identifier3("b"))); |
| 3948 } | 3935 } |
| 3949 | 3936 |
| 3950 void test_visitVariableDeclaration_uninitialized() { | 3937 void test_visitVariableDeclaration_uninitialized() { |
| 3951 _assertSource("a", AstFactory.variableDeclaration("a")); | 3938 _assertSource("a", AstFactory.variableDeclaration("a")); |
| 3952 } | 3939 } |
| 3953 | 3940 |
| 3954 void test_visitVariableDeclaration_withMetadata() { | 3941 void test_visitVariableDeclaration_withMetadata() { |
| 3955 VariableDeclaration declaration = AstFactory.variableDeclaration("a"); | 3942 VariableDeclaration declaration = AstFactory.variableDeclaration("a"); |
| 3956 declaration.metadata = | 3943 declaration.metadata.add(AstFactory.annotation(AstFactory.identifier3("depre
cated"))); |
| 3957 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3958 _assertSource("@deprecated a", declaration); | 3944 _assertSource("@deprecated a", declaration); |
| 3959 } | 3945 } |
| 3960 | 3946 |
| 3961 void test_visitVariableDeclarationList_const_type() { | 3947 void test_visitVariableDeclarationList_const_type() { |
| 3962 _assertSource( | 3948 _assertSource( |
| 3963 "const C a, b", | 3949 "const C a, b", |
| 3964 AstFactory.variableDeclarationList( | 3950 AstFactory.variableDeclarationList( |
| 3965 Keyword.CONST, | 3951 Keyword.CONST, |
| 3966 AstFactory.typeName4("C"), | 3952 AstFactory.typeName4("C"), |
| 3967 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")])); | 3953 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")])); |
| 3968 } | 3954 } |
| 3969 | 3955 |
| 3970 void test_visitVariableDeclarationList_final_noType() { | 3956 void test_visitVariableDeclarationList_final_noType() { |
| 3971 _assertSource( | 3957 _assertSource( |
| 3972 "final a, b", | 3958 "final a, b", |
| 3973 AstFactory.variableDeclarationList2( | 3959 AstFactory.variableDeclarationList2( |
| 3974 Keyword.FINAL, | 3960 Keyword.FINAL, |
| 3975 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")])); | 3961 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")])); |
| 3976 } | 3962 } |
| 3977 | 3963 |
| 3978 void test_visitVariableDeclarationList_final_withMetadata() { | 3964 void test_visitVariableDeclarationList_final_withMetadata() { |
| 3979 VariableDeclarationList declarationList = | 3965 VariableDeclarationList declarationList = |
| 3980 AstFactory.variableDeclarationList2( | 3966 AstFactory.variableDeclarationList2( |
| 3981 Keyword.FINAL, | 3967 Keyword.FINAL, |
| 3982 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")]); | 3968 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")]); |
| 3983 declarationList.metadata = | 3969 declarationList.metadata.add(AstFactory.annotation(AstFactory.identifier3("d
eprecated"))); |
| 3984 [AstFactory.annotation(AstFactory.identifier3("deprecated"))]; | |
| 3985 _assertSource("@deprecated final a, b", declarationList); | 3970 _assertSource("@deprecated final a, b", declarationList); |
| 3986 } | 3971 } |
| 3987 | 3972 |
| 3988 void test_visitVariableDeclarationList_type() { | 3973 void test_visitVariableDeclarationList_type() { |
| 3989 _assertSource( | 3974 _assertSource( |
| 3990 "C a, b", | 3975 "C a, b", |
| 3991 AstFactory.variableDeclarationList( | 3976 AstFactory.variableDeclarationList( |
| 3992 null, | 3977 null, |
| 3993 AstFactory.typeName4("C"), | 3978 AstFactory.typeName4("C"), |
| 3994 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")])); | 3979 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration
("b")])); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4096 | 4081 |
| 4097 static const List<WrapperKind> values = const [ | 4082 static const List<WrapperKind> values = const [ |
| 4098 PREFIXED_LEFT, | 4083 PREFIXED_LEFT, |
| 4099 PREFIXED_RIGHT, | 4084 PREFIXED_RIGHT, |
| 4100 PROPERTY_LEFT, | 4085 PROPERTY_LEFT, |
| 4101 PROPERTY_RIGHT, | 4086 PROPERTY_RIGHT, |
| 4102 NONE]; | 4087 NONE]; |
| 4103 | 4088 |
| 4104 const WrapperKind(String name, int ordinal) : super(name, ordinal); | 4089 const WrapperKind(String name, int ordinal) : super(name, ordinal); |
| 4105 } | 4090 } |
| OLD | NEW |