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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/verifier.dart

Issue 2825053002: Add typedef AST node boilerplate. (Closed)
Patch Set: Update FastaVerifyingVisitor to work with the changes in VerifyingVisitor Created 3 years, 7 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 | « no previous file | pkg/kernel/lib/ast.dart » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.verifier; 5 library fasta.verifier;
6 6
7 import 'package:front_end/src/fasta/type_inference/type_schema.dart' 7 import 'package:front_end/src/fasta/type_inference/type_schema.dart'
8 show TypeSchemaVisitor, UnknownType; 8 show TypeSchemaVisitor, UnknownType;
9 9
10 import 'package:kernel/ast.dart' 10 import 'package:kernel/ast.dart'
(...skipping 26 matching lines...) Expand all
37 implements TypeSchemaVisitor { 37 implements TypeSchemaVisitor {
38 final List<VerificationError> errors = <VerificationError>[]; 38 final List<VerificationError> errors = <VerificationError>[];
39 39
40 String fileUri; 40 String fileUri;
41 41
42 FastaVerifyingVisitor(bool isOutline) { 42 FastaVerifyingVisitor(bool isOutline) {
43 this.isOutline = isOutline; 43 this.isOutline = isOutline;
44 } 44 }
45 45
46 @override 46 @override
47 problem(TreeNode node, String details) { 47 problem(TreeNode node, String details, {TreeNode context}) {
48 context ??= this.context;
48 VerificationError error = new VerificationError(context, node, details); 49 VerificationError error = new VerificationError(context, node, details);
49 printUnexpected(Uri.parse(fileUri), node?.fileOffset ?? -1, "$error"); 50 printUnexpected(Uri.parse(fileUri), node?.fileOffset ?? -1, "$error");
50 errors.add(error); 51 errors.add(error);
51 } 52 }
52 53
53 @override 54 @override
54 visitExpressionStatement(ExpressionStatement node) { 55 visitExpressionStatement(ExpressionStatement node) {
55 // Bypass verification of the [StaticGet] in [RedirectingFactoryBody] as 56 // Bypass verification of the [StaticGet] in [RedirectingFactoryBody] as
56 // this is a static get without a getter. 57 // this is a static get without a getter.
57 if (node is! RedirectingFactoryBody) { 58 if (node is! RedirectingFactoryBody) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 visitInvalidInitializer(InvalidInitializer node) { 98 visitInvalidInitializer(InvalidInitializer node) {
98 problem(node, "Invalid initializer."); 99 problem(node, "Invalid initializer.");
99 } 100 }
100 101
101 @override 102 @override
102 visitUnknownType(UnknownType node) { 103 visitUnknownType(UnknownType node) {
103 // Note: we can't pass [node] to [problem] because it's not a [TreeNode]. 104 // Note: we can't pass [node] to [problem] because it's not a [TreeNode].
104 problem(null, "Unexpected appearance of the unknown type."); 105 problem(null, "Unexpected appearance of the unknown type.");
105 } 106 }
106 } 107 }
OLDNEW
« no previous file with comments | « no previous file | pkg/kernel/lib/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698