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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2802753002: Include ':' before constructor separators into AST with Fasta. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
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 library analyzer.test.generated.parser_test; 5 library analyzer.test.generated.parser_test;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
9 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 ConstructorFieldInitializer, initializer); 1191 ConstructorFieldInitializer, initializer);
1192 EngineTestCase.assertInstanceOf( 1192 EngineTestCase.assertInstanceOf(
1193 (obj) => obj is ParenthesizedExpression, 1193 (obj) => obj is ParenthesizedExpression,
1194 ParenthesizedExpression, 1194 ParenthesizedExpression,
1195 (initializer as ConstructorFieldInitializer).expression); 1195 (initializer as ConstructorFieldInitializer).expression);
1196 EngineTestCase.assertInstanceOf( 1196 EngineTestCase.assertInstanceOf(
1197 (obj) => obj is BlockFunctionBody, BlockFunctionBody, constructor.body); 1197 (obj) => obj is BlockFunctionBody, BlockFunctionBody, constructor.body);
1198 } 1198 }
1199 1199
1200 void test_parseConstructorFieldInitializer_qualified() { 1200 void test_parseConstructorFieldInitializer_qualified() {
1201 createParser('this.a = b'); 1201 var initializer = parseConstructorInitializer('this.a = b')
1202 ConstructorFieldInitializer initializer = 1202 as ConstructorFieldInitializer;
1203 parser.parseConstructorFieldInitializer(true);
1204 expect(initializer, isNotNull); 1203 expect(initializer, isNotNull);
1205 assertNoErrors(); 1204 assertNoErrors();
1206 expect(initializer.equals, isNotNull); 1205 expect(initializer.equals, isNotNull);
1207 expect(initializer.expression, isNotNull); 1206 expect(initializer.expression, isNotNull);
1208 expect(initializer.fieldName, isNotNull); 1207 expect(initializer.fieldName, isNotNull);
1209 expect(initializer.thisKeyword, isNotNull); 1208 expect(initializer.thisKeyword, isNotNull);
1210 expect(initializer.period, isNotNull); 1209 expect(initializer.period, isNotNull);
1211 } 1210 }
1212 1211
1213 void test_parseConstructorFieldInitializer_unqualified() { 1212 void test_parseConstructorFieldInitializer_unqualified() {
1214 createParser('a = b'); 1213 var initializer =
1215 ConstructorFieldInitializer initializer = 1214 parseConstructorInitializer('a = b') as ConstructorFieldInitializer;
1216 parser.parseConstructorFieldInitializer(false);
1217 expect(initializer, isNotNull); 1215 expect(initializer, isNotNull);
1218 assertNoErrors(); 1216 assertNoErrors();
1219 expect(initializer.equals, isNotNull); 1217 expect(initializer.equals, isNotNull);
1220 expect(initializer.expression, isNotNull); 1218 expect(initializer.expression, isNotNull);
1221 expect(initializer.fieldName, isNotNull); 1219 expect(initializer.fieldName, isNotNull);
1222 expect(initializer.thisKeyword, isNull); 1220 expect(initializer.thisKeyword, isNull);
1223 expect(initializer.period, isNull); 1221 expect(initializer.period, isNull);
1224 } 1222 }
1225 1223
1226 void test_parseGetter_nonStatic() { 1224 void test_parseGetter_nonStatic() {
(...skipping 13505 matching lines...) Expand 10 before | Expand all | Expand 10 after
14732 expectCommentText(typeVariable.documentationComment, '/// Doc'); 14730 expectCommentText(typeVariable.documentationComment, '/// Doc');
14733 } 14731 }
14734 14732
14735 /** 14733 /**
14736 * Assert that the given [name] is in declaration context. 14734 * Assert that the given [name] is in declaration context.
14737 */ 14735 */
14738 void _assertIsDeclarationName(SimpleIdentifier name) { 14736 void _assertIsDeclarationName(SimpleIdentifier name) {
14739 expect(name.inDeclarationContext(), isTrue); 14737 expect(name.inDeclarationContext(), isTrue);
14740 } 14738 }
14741 } 14739 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | pkg/front_end/lib/src/fasta/source/diet_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698