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

Unified Diff: pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart

Issue 1261623002: Add AccessSemantics.INVALID for invalid expressions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
index c1dfa54dde9132f4e705441e8b10f1e857e8cdc7..517eafcae6781ed3c564513eff1fd87b9ae5ce0c 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
@@ -20,7 +20,9 @@ abstract class BulkHandle<R, A> {
abstract class ErrorBulkMixin<R, A>
implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
- R bulkHandleError(Node node, A arg) {
+ // TODO(johnniwinther): Ensure that all error methods have an
+ // [ErroneousElement].
+ R bulkHandleError(Node node, ErroneousElement error, A arg) {
return bulkHandleNode(node, "Error expression `#` unhandled.", arg);
}
@@ -29,7 +31,7 @@ abstract class ErrorBulkMixin<R, A>
Send node,
NodeList arguments,
A arg) {
- return bulkHandleError(node, arg);
+ return bulkHandleError(node, null, arg);
}
@override
@@ -40,7 +42,7 @@ abstract class ErrorBulkMixin<R, A>
NodeList arguments,
CallStructure callStructure,
A arg) {
- return bulkHandleError(node, arg);
+ return bulkHandleError(node, null, arg);
}
@override
@@ -49,7 +51,7 @@ abstract class ErrorBulkMixin<R, A>
Operator operator,
Node expression,
A arg) {
- return bulkHandleError(node, arg);
+ return bulkHandleError(node, null, arg);
}
@override
@@ -59,7 +61,62 @@ abstract class ErrorBulkMixin<R, A>
Operator operator,
Node right,
A arg) {
- return bulkHandleError(node, arg);
+ return bulkHandleError(node, null, arg);
+ }
+
+ @override
+ R errorInvalidCompound(
+ Send node,
+ ErroneousElement error,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, error, arg);
+ }
+
+ @override
+ R errorInvalidGet(
+ Send node,
+ ErroneousElement error,
+ A arg) {
+ return bulkHandleError(node, error, arg);
+ }
+
+ @override
+ R errorInvalidInvoke(
+ Send node,
+ ErroneousElement error,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ return bulkHandleError(node, error, arg);
+ }
+
+ @override
+ R errorInvalidPostfix(
+ Send node,
+ ErroneousElement error,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, error, arg);
+ }
+
+ @override
+ R errorInvalidPrefix(
+ Send node,
+ ErroneousElement error,
+ IncDecOperator operator,
+ A arg) {
+ return bulkHandleError(node, error, arg);
+ }
+
+ @override
+ R errorInvalidSet(
+ Send node,
+ ErroneousElement error,
+ Node rhs,
+ A arg) {
+ return bulkHandleError(node, error, arg);
}
}
@@ -3534,6 +3591,64 @@ class TraversalSendMixin<R, A> implements SemanticSendVisitor<R, A> {
}
@override
+ R errorInvalidCompound(
+ Send node,
+ ErroneousElement error,
+ AssignmentOperator operator,
+ Node rhs,
+ A arg) {
+ apply(rhs, arg);
+ return null;
+ }
+
+ @override
+ R errorInvalidGet(
+ Send node,
+ ErroneousElement error,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R errorInvalidInvoke(
+ Send node,
+ ErroneousElement error,
+ NodeList arguments,
+ Selector selector,
+ A arg) {
+ apply(arguments, arg);
+ return null;
+ }
+
+ @override
+ R errorInvalidPostfix(
+ Send node,
+ ErroneousElement error,
+ IncDecOperator operator,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R errorInvalidPrefix(
+ Send node,
+ ErroneousElement error,
+ IncDecOperator operator,
+ A arg) {
+ return null;
+ }
+
+ @override
+ R errorInvalidSet(
+ Send node,
+ ErroneousElement error,
+ Node rhs,
+ A arg) {
+ apply(rhs, arg);
+ return null;
+ }
+
+ @override
R visitClassTypeLiteralSet(
SendSet node,
ConstantExpression constant,
« no previous file with comments | « pkg/compiler/lib/src/resolution/semantic_visitor.dart ('k') | pkg/compiler/lib/src/resolution/send_structure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698