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

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

Issue 2722153003: Always parse 'x.y' as a prefixed identifier. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4162 matching lines...) Expand 10 before | Expand all | Expand 10 after
4173 expect(argumentList, isNotNull); 4173 expect(argumentList, isNotNull);
4174 expect(argumentList.arguments, hasLength(1)); 4174 expect(argumentList.arguments, hasLength(1));
4175 expect(propertyAccess.operator, isNotNull); 4175 expect(propertyAccess.operator, isNotNull);
4176 expect(propertyAccess.propertyName, isNotNull); 4176 expect(propertyAccess.propertyName, isNotNull);
4177 } 4177 }
4178 4178
4179 void test_parseAssignableExpression_identifier_dot() { 4179 void test_parseAssignableExpression_identifier_dot() {
4180 Expression expression = parseAssignableExpression('x.y', false); 4180 Expression expression = parseAssignableExpression('x.y', false);
4181 expect(expression, isNotNull); 4181 expect(expression, isNotNull);
4182 assertNoErrors(); 4182 assertNoErrors();
4183 var propertyAccess = expression as PropertyAccess; 4183 var identifier = expression as PrefixedIdentifier;
4184 expect(propertyAccess.target, isNotNull); 4184 expect(identifier.prefix.name, 'x');
4185 expect(propertyAccess.operator, isNotNull); 4185 expect(identifier.period, isNotNull);
4186 expect(propertyAccess.operator.type, TokenType.PERIOD); 4186 expect(identifier.period.type, TokenType.PERIOD);
4187 expect(propertyAccess.propertyName, isNotNull); 4187 expect(identifier.identifier.name, 'y');
4188 } 4188 }
4189 4189
4190 void test_parseAssignableExpression_identifier_index() { 4190 void test_parseAssignableExpression_identifier_index() {
4191 Expression expression = parseAssignableExpression('x[y]', false); 4191 Expression expression = parseAssignableExpression('x[y]', false);
4192 expect(expression, isNotNull); 4192 expect(expression, isNotNull);
4193 assertNoErrors(); 4193 assertNoErrors();
4194 var indexExpression = expression as IndexExpression; 4194 var indexExpression = expression as IndexExpression;
4195 expect(indexExpression.target, isNotNull); 4195 expect(indexExpression.target, isNotNull);
4196 expect(indexExpression.leftBracket, isNotNull); 4196 expect(indexExpression.leftBracket, isNotNull);
4197 expect(indexExpression.index, isNotNull); 4197 expect(indexExpression.index, isNotNull);
(...skipping 10378 matching lines...) Expand 10 before | Expand all | Expand 10 after
14576 expect(typeAlias.name, isNotNull); 14576 expect(typeAlias.name, isNotNull);
14577 expect(typeAlias.typeParameters, isNull); 14577 expect(typeAlias.typeParameters, isNull);
14578 expect(typeAlias.semicolon, isNotNull); 14578 expect(typeAlias.semicolon, isNotNull);
14579 GenericFunctionType functionType = typeAlias.functionType; 14579 GenericFunctionType functionType = typeAlias.functionType;
14580 expect(functionType, isNotNull); 14580 expect(functionType, isNotNull);
14581 expect(functionType.parameters, isNotNull); 14581 expect(functionType.parameters, isNotNull);
14582 expect(functionType.returnType, isNotNull); 14582 expect(functionType.returnType, isNotNull);
14583 expect(functionType.typeParameters, isNull); 14583 expect(functionType.typeParameters, isNull);
14584 } 14584 }
14585 } 14585 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698