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 3414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3425 } | 3425 } |
3426 transformList(updates, v, this); | 3426 transformList(updates, v, this); |
3427 if (body != null) { | 3427 if (body != null) { |
3428 body = body.accept(v); | 3428 body = body.accept(v); |
3429 body?.parent = this; | 3429 body?.parent = this; |
3430 } | 3430 } |
3431 } | 3431 } |
3432 } | 3432 } |
3433 | 3433 |
3434 class ForInStatement extends Statement { | 3434 class ForInStatement extends Statement { |
3435 /// Offset in the source file it comes from. | |
3436 /// | |
3437 /// Valid values are from 0 and up, or -1 ([TreeNode.noOffset]) if the file | |
3438 /// offset is not available (this is the default if none is specifically set). | |
3439 int bodyOffset = TreeNode.noOffset; | |
ahe
2017/08/08 11:38:50
Why is the bodyOffset different from body.fileOffs
jensj
2017/08/08 11:54:53
As I recall I had to add that because we don't hav
ahe
2017/08/08 11:58:03
Can't we make sure that we have positions on all t
| |
3440 | |
3435 VariableDeclaration variable; // Has no initializer. | 3441 VariableDeclaration variable; // Has no initializer. |
3436 Expression iterable; | 3442 Expression iterable; |
3437 Statement body; | 3443 Statement body; |
3438 bool isAsync; // True if this is an 'await for' loop. | 3444 bool isAsync; // True if this is an 'await for' loop. |
3439 | 3445 |
3440 ForInStatement(this.variable, this.iterable, this.body, | 3446 ForInStatement(this.variable, this.iterable, this.body, |
3441 {this.isAsync: false}) { | 3447 {this.isAsync: false}) { |
3442 variable?.parent = this; | 3448 variable?.parent = this; |
3443 iterable?.parent = this; | 3449 iterable?.parent = this; |
3444 body?.parent = this; | 3450 body?.parent = this; |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4740 if (typedef_.canonicalName == null) { | 4746 if (typedef_.canonicalName == null) { |
4741 throw '$typedef_ has no canonical name'; | 4747 throw '$typedef_ has no canonical name'; |
4742 } | 4748 } |
4743 return typedef_.canonicalName; | 4749 return typedef_.canonicalName; |
4744 } | 4750 } |
4745 | 4751 |
4746 /// Annotation describing information which is not part of Dart semantics; in | 4752 /// Annotation describing information which is not part of Dart semantics; in |
4747 /// other words, if this information (or any information it refers to) changes, | 4753 /// other words, if this information (or any information it refers to) changes, |
4748 /// static analysis and runtime behavior of the library are unaffected. | 4754 /// static analysis and runtime behavior of the library are unaffected. |
4749 const informative = null; | 4755 const informative = null; |
OLD | NEW |