Chromium Code Reviews| 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 * Defines the tokens that are produced by the scanner, used by the parser, and | 6 * Defines the tokens that are produced by the scanner, used by the parser, and |
| 7 * referenced from the [AST structure](ast.dart). | 7 * referenced from the [AST structure](ast.dart). |
| 8 */ | 8 */ |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 | 10 |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 * Return the type of the token. | 685 * Return the type of the token. |
| 686 */ | 686 */ |
| 687 TokenType get type; | 687 TokenType get type; |
| 688 | 688 |
| 689 /** | 689 /** |
| 690 * Apply (add) the given [delta] to this token's offset. | 690 * Apply (add) the given [delta] to this token's offset. |
| 691 */ | 691 */ |
| 692 void applyDelta(int delta); | 692 void applyDelta(int delta); |
| 693 | 693 |
| 694 /** | 694 /** |
| 695 * Return a newly created token that is a copy of this token but that is not a | 695 * Return a newly created token that is a copy of this tokens |
|
ahe
2017/03/20 12:32:48
"this token" is kinda correct. Perhaps you want to
| |
| 696 * part of any token stream. | 696 * including any [preceedingComment] tokens, |
| 697 * but that is not a part of any token stream. | |
| 697 */ | 698 */ |
| 698 Token copy(); | 699 Token copy(); |
| 699 | 700 |
| 700 /** | 701 /** |
| 701 * Copy a linked list of comment tokens identical to the given comment tokens. | 702 * Copy a linked list of comment tokens identical to the given comment tokens. |
| 702 */ | 703 */ |
| 703 Token copyComments(Token token); | 704 Token copyComments(Token token); |
| 704 | 705 |
| 705 /** | 706 /** |
| 706 * Return `true` if this token has any one of the given [types]. | 707 * Return `true` if this token has any one of the given [types]. |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1157 | 1158 |
| 1158 void set precedingComments(CommentToken comment) { | 1159 void set precedingComments(CommentToken comment) { |
| 1159 _precedingComment = comment; | 1160 _precedingComment = comment; |
| 1160 _setCommentParent(_precedingComment); | 1161 _setCommentParent(_precedingComment); |
| 1161 } | 1162 } |
| 1162 | 1163 |
| 1163 @override | 1164 @override |
| 1164 Token copy() => | 1165 Token copy() => |
| 1165 new TokenWithComment(type, offset, copyComments(precedingComments)); | 1166 new TokenWithComment(type, offset, copyComments(precedingComments)); |
| 1166 } | 1167 } |
| OLD | NEW |