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

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

Issue 2768523002: Fix IdentifierContext for primary expressions. Also pass IdentifierContext to handleThisExpression … (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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/token.dart' as analyzer; 6 import 'package:analyzer/dart/ast/token.dart' as analyzer;
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/error/error.dart'; 8 import 'package:analyzer/error/error.dart';
9 import 'package:analyzer/src/generated/parser.dart' as analyzer; 9 import 'package:analyzer/src/generated/parser.dart' as analyzer;
10 import 'package:analyzer/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
11 import 'package:analyzer/src/fasta/ast_builder.dart'; 11 import 'package:analyzer/src/fasta/ast_builder.dart';
12 import 'package:analyzer/src/fasta/element_store.dart'; 12 import 'package:analyzer/src/fasta/element_store.dart';
13 import 'package:front_end/src/fasta/builder/scope.dart'; 13 import 'package:front_end/src/fasta/builder/scope.dart';
14 import 'package:front_end/src/fasta/kernel/kernel_builder.dart'; 14 import 'package:front_end/src/fasta/kernel/kernel_builder.dart';
15 import 'package:front_end/src/fasta/kernel/kernel_library_builder.dart'; 15 import 'package:front_end/src/fasta/kernel/kernel_library_builder.dart';
16 import 'package:front_end/src/fasta/parser/parser.dart' as fasta; 16 import 'package:front_end/src/fasta/parser/parser.dart' as fasta;
17 import 'package:front_end/src/fasta/parser/identifier_context.dart'
18 show IdentifierContext;
17 import 'package:front_end/src/fasta/scanner/precedence.dart' as fasta; 19 import 'package:front_end/src/fasta/scanner/precedence.dart' as fasta;
18 import 'package:front_end/src/fasta/scanner/string_scanner.dart'; 20 import 'package:front_end/src/fasta/scanner/string_scanner.dart';
19 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; 21 import 'package:front_end/src/fasta/scanner/token.dart' as fasta;
20 import 'package:test/test.dart'; 22 import 'package:test/test.dart';
21 import 'package:test_reflective_loader/test_reflective_loader.dart'; 23 import 'package:test_reflective_loader/test_reflective_loader.dart';
22 24
23 import 'parser_test.dart'; 25 import 'parser_test.dart';
24 26
25 main() { 27 main() {
26 defineReflectiveSuite(() { 28 defineReflectiveSuite(() {
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 768 }
767 769
768 @override 770 @override
769 Identifier parsePrefixedIdentifier(String code) { 771 Identifier parsePrefixedIdentifier(String code) {
770 return _parseExpression(code); 772 return _parseExpression(code);
771 } 773 }
772 774
773 @override 775 @override
774 Expression parsePrimaryExpression(String code) { 776 Expression parsePrimaryExpression(String code) {
775 return _runParser( 777 return _runParser(
776 code, (parser) => parser.parsePrimary, const <ErrorCode>[]) 778 code,
777 as Expression; 779 (parser) =>
780 (token) => parser.parsePrimary(token, IdentifierContext.expression),
781 const <ErrorCode>[]) as Expression;
778 } 782 }
779 783
780 @override 784 @override
781 Expression parseRelationalExpression(String code) { 785 Expression parseRelationalExpression(String code) {
782 return _parseExpression(code); 786 return _parseExpression(code);
783 } 787 }
784 788
785 @override 789 @override
786 RethrowExpression parseRethrowExpression(String code) { 790 RethrowExpression parseRethrowExpression(String code) {
787 return _parseExpression(code); 791 return _parseExpression(code);
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 } 1302 }
1299 1303
1300 @override 1304 @override
1301 @failingTest 1305 @failingTest
1302 void test_parsePartOfDirective_uri() { 1306 void test_parsePartOfDirective_uri() {
1303 // TODO(paulberry,ahe): URIs in "part of" declarations are not supported by 1307 // TODO(paulberry,ahe): URIs in "part of" declarations are not supported by
1304 // Fasta. 1308 // Fasta.
1305 super.test_parsePartOfDirective_uri(); 1309 super.test_parsePartOfDirective_uri();
1306 } 1310 }
1307 } 1311 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/fasta/ast_builder.dart ('k') | pkg/compiler/lib/src/parser/node_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698