OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 |
| 5 import 'package:kernel/ast.dart' as ir; |
| 6 |
| 7 import "../dart_types.dart" show DartType; |
| 8 import "../elements/elements.dart" show Element, ErroneousElement; |
| 9 import "../resolution/operators.dart" |
| 10 show AssignmentOperator, BinaryOperator, IncDecOperator, UnaryOperator; |
| 11 import "../tree/tree.dart" |
| 12 show Expression, NewExpression, Node, NodeList, Operator, Send, SendSet; |
| 13 import "../universe/call_structure.dart" show CallStructure; |
| 14 import "../universe/selector.dart" show Selector; |
| 15 |
| 16 abstract class KernelError { |
| 17 // TODO(ahe): Get rid of this method, each error should be handled according |
| 18 // to the semantics required by the Dart Language Specification. |
| 19 ir.Expression handleError(Expression node); |
| 20 |
| 21 ir.Expression errorInvalidBinary(Send node, ErroneousElement error, |
| 22 BinaryOperator operator, Node right, _) { |
| 23 return handleError(node); |
| 24 } |
| 25 |
| 26 ir.Expression errorInvalidCompound(Send node, ErroneousElement error, |
| 27 AssignmentOperator operator, Node rhs, _) { |
| 28 return handleError(node); |
| 29 } |
| 30 |
| 31 ir.Expression errorInvalidCompoundIndexSet(Send node, ErroneousElement error, |
| 32 Node index, AssignmentOperator operator, Node rhs, _) { |
| 33 return handleError(node); |
| 34 } |
| 35 |
| 36 ir.Expression errorInvalidEquals( |
| 37 Send node, ErroneousElement error, Node right, _) { |
| 38 return handleError(node); |
| 39 } |
| 40 |
| 41 ir.Expression errorInvalidGet(Send node, ErroneousElement error, _) { |
| 42 return handleError(node); |
| 43 } |
| 44 |
| 45 ir.Expression errorInvalidIndex( |
| 46 Send node, ErroneousElement error, Node index, _) { |
| 47 return handleError(node); |
| 48 } |
| 49 |
| 50 ir.Expression errorInvalidIndexPostfix(Send node, ErroneousElement error, |
| 51 Node index, IncDecOperator operator, _) { |
| 52 return handleError(node); |
| 53 } |
| 54 |
| 55 ir.Expression errorInvalidIndexPrefix(Send node, ErroneousElement error, |
| 56 Node index, IncDecOperator operator, _) { |
| 57 return handleError(node); |
| 58 } |
| 59 |
| 60 ir.Expression errorInvalidIndexSet( |
| 61 Send node, ErroneousElement error, Node index, Node rhs, _) { |
| 62 return handleError(node); |
| 63 } |
| 64 |
| 65 ir.Expression errorInvalidInvoke(Send node, ErroneousElement error, |
| 66 NodeList arguments, Selector selector, _) { |
| 67 return handleError(node); |
| 68 } |
| 69 |
| 70 ir.Expression errorInvalidNotEquals( |
| 71 Send node, ErroneousElement error, Node right, _) { |
| 72 return handleError(node); |
| 73 } |
| 74 |
| 75 ir.Expression errorInvalidPostfix( |
| 76 Send node, ErroneousElement error, IncDecOperator operator, _) { |
| 77 return handleError(node); |
| 78 } |
| 79 |
| 80 ir.Expression errorInvalidPrefix( |
| 81 Send node, ErroneousElement error, IncDecOperator operator, _) { |
| 82 return handleError(node); |
| 83 } |
| 84 |
| 85 ir.Expression errorInvalidSet( |
| 86 Send node, ErroneousElement error, Node rhs, _) { |
| 87 return handleError(node); |
| 88 } |
| 89 |
| 90 ir.Expression errorInvalidSetIfNull( |
| 91 Send node, ErroneousElement error, Node rhs, _) { |
| 92 return handleError(node); |
| 93 } |
| 94 |
| 95 ir.Expression errorInvalidUnary( |
| 96 Send node, UnaryOperator operator, ErroneousElement error, _) { |
| 97 return handleError(node); |
| 98 } |
| 99 |
| 100 ir.Expression errorNonConstantConstructorInvoke( |
| 101 NewExpression node, |
| 102 Element element, |
| 103 DartType type, |
| 104 NodeList arguments, |
| 105 CallStructure callStructure, |
| 106 _) { |
| 107 return handleError(node); |
| 108 } |
| 109 |
| 110 ir.Expression errorUndefinedBinaryExpression( |
| 111 Send node, Node left, Operator operator, Node right, _) { |
| 112 return handleError(node); |
| 113 } |
| 114 |
| 115 ir.Expression errorUndefinedUnaryExpression( |
| 116 Send node, Operator operator, Node expression, _) { |
| 117 return handleError(node); |
| 118 } |
| 119 |
| 120 ir.Expression errorUnresolvedFieldInitializer( |
| 121 SendSet node, Element element, Node initializer, _) { |
| 122 return handleError(node); |
| 123 } |
| 124 |
| 125 ir.Expression errorUnresolvedSuperConstructorInvoke( |
| 126 Send node, Element element, NodeList arguments, Selector selector, _) { |
| 127 return handleError(node); |
| 128 } |
| 129 |
| 130 ir.Expression errorUnresolvedThisConstructorInvoke( |
| 131 Send node, Element element, NodeList arguments, Selector selector, _) { |
| 132 return handleError(node); |
| 133 } |
| 134 |
| 135 ir.Expression errorInvalidIndexSetIfNull( |
| 136 SendSet node, ErroneousElement error, Node index, Node rhs, _) { |
| 137 return handleError(node); |
| 138 } |
| 139 } |
OLD | NEW |