| OLD | NEW |
| 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 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
| 6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
| 7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
| 8 /// | 8 /// |
| 9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
| 10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 // ------------------------------------------------------------------------ | 491 // ------------------------------------------------------------------------ |
| 492 | 492 |
| 493 /// A indirect reference to a member, which can be updated to point at another | 493 /// A indirect reference to a member, which can be updated to point at another |
| 494 /// member at a later time. | 494 /// member at a later time. |
| 495 class _MemberAccessor { | 495 class _MemberAccessor { |
| 496 Member target; | 496 Member target; |
| 497 _MemberAccessor(this.target); | 497 _MemberAccessor(this.target); |
| 498 } | 498 } |
| 499 | 499 |
| 500 abstract class Member extends TreeNode { | 500 abstract class Member extends TreeNode { |
| 501 /// End offset in the source file it comes from. Valid values are from 0 and |
| 502 /// up, or -1 ([TreeNode.noOffset]) if the file end offset is not available |
| 503 /// (this is the default if none is specifically set). |
| 504 int fileEndOffset = TreeNode.noOffset; |
| 505 |
| 501 /// List of metadata annotations on the member. | 506 /// List of metadata annotations on the member. |
| 502 /// | 507 /// |
| 503 /// This defaults to an immutable empty list. Use [addAnnotation] to add | 508 /// This defaults to an immutable empty list. Use [addAnnotation] to add |
| 504 /// annotations if needed. | 509 /// annotations if needed. |
| 505 List<Expression> annotations = const <Expression>[]; | 510 List<Expression> annotations = const <Expression>[]; |
| 506 Name name; | 511 Name name; |
| 507 | 512 |
| 508 /// Flags summarizing the kinds of AST nodes contained in this member, for | 513 /// Flags summarizing the kinds of AST nodes contained in this member, for |
| 509 /// speeding up transformations that only affect certain types of nodes. | 514 /// speeding up transformations that only affect certain types of nodes. |
| 510 /// | 515 /// |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 | 1102 |
| 1098 // ------------------------------------------------------------------------ | 1103 // ------------------------------------------------------------------------ |
| 1099 // FUNCTIONS | 1104 // FUNCTIONS |
| 1100 // ------------------------------------------------------------------------ | 1105 // ------------------------------------------------------------------------ |
| 1101 | 1106 |
| 1102 /// A function declares parameters and has a body. | 1107 /// A function declares parameters and has a body. |
| 1103 /// | 1108 /// |
| 1104 /// This may occur in a procedure, constructor, function expression, or local | 1109 /// This may occur in a procedure, constructor, function expression, or local |
| 1105 /// function declaration. | 1110 /// function declaration. |
| 1106 class FunctionNode extends TreeNode { | 1111 class FunctionNode extends TreeNode { |
| 1112 /// End offset in the source file it comes from. Valid values are from 0 and |
| 1113 /// up, or -1 ([TreeNode.noOffset]) if the file end offset is not available |
| 1114 /// (this is the default if none is specifically set). |
| 1115 int fileEndOffset = TreeNode.noOffset; |
| 1116 |
| 1107 AsyncMarker asyncMarker; | 1117 AsyncMarker asyncMarker; |
| 1118 bool debuggable = true; |
| 1108 List<TypeParameter> typeParameters; | 1119 List<TypeParameter> typeParameters; |
| 1109 int requiredParameterCount; | 1120 int requiredParameterCount; |
| 1110 List<VariableDeclaration> positionalParameters; | 1121 List<VariableDeclaration> positionalParameters; |
| 1111 List<VariableDeclaration> namedParameters; | 1122 List<VariableDeclaration> namedParameters; |
| 1112 InferredValue inferredReturnValue; // May be null. | 1123 InferredValue inferredReturnValue; // May be null. |
| 1113 DartType returnType; // Not null. | 1124 DartType returnType; // Not null. |
| 1114 Statement body; | 1125 Statement body; |
| 1115 | 1126 |
| 1116 FunctionNode(this.body, | 1127 FunctionNode(this.body, |
| 1117 {List<TypeParameter> typeParameters, | 1128 {List<TypeParameter> typeParameters, |
| (...skipping 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3651 } | 3662 } |
| 3652 } | 3663 } |
| 3653 } | 3664 } |
| 3654 | 3665 |
| 3655 class Source { | 3666 class Source { |
| 3656 final List<int> lineStarts; | 3667 final List<int> lineStarts; |
| 3657 final String source; | 3668 final String source; |
| 3658 | 3669 |
| 3659 Source(this.lineStarts, this.source); | 3670 Source(this.lineStarts, this.source); |
| 3660 } | 3671 } |
| OLD | NEW |