| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 licenset hat can be found in the LICENSE file. | 3 // BSD-style licenset hat can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart_scanner.error_token; | 5 library dart_scanner.error_token; |
| 6 | 6 |
| 7 import '../../scanner/token.dart' show TokenType; | 7 import '../../scanner/token.dart' show TokenType; |
| 8 | 8 |
| 9 import '../fasta_codes.dart' | 9 import '../fasta_codes.dart' |
| 10 show | 10 show |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 /// Common superclass for all error tokens. | 65 /// Common superclass for all error tokens. |
| 66 /// | 66 /// |
| 67 /// It's considered an implementation error to access [lexeme] of an | 67 /// It's considered an implementation error to access [lexeme] of an |
| 68 /// [ErrorToken]. | 68 /// [ErrorToken]. |
| 69 abstract class ErrorToken extends Token { | 69 abstract class ErrorToken extends Token { |
| 70 ErrorToken(int charOffset) : super(charOffset); | 70 ErrorToken(int charOffset) : super(charOffset); |
| 71 | 71 |
| 72 TokenType get info => TokenType.BAD_INPUT; | 72 TokenType get type => TokenType.BAD_INPUT; |
| 73 | 73 |
| 74 String get lexeme => throw assertionMessage; | 74 String get lexeme => throw assertionMessage; |
| 75 | 75 |
| 76 String get stringValue => null; | 76 String get stringValue => null; |
| 77 | 77 |
| 78 bool get isIdentifier => false; | 78 bool get isIdentifier => false; |
| 79 | 79 |
| 80 String get assertionMessage; | 80 String get assertionMessage; |
| 81 | 81 |
| 82 FastaCode get errorCode; | 82 FastaCode get errorCode; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 UnmatchedToken(BeginGroupToken begin) | 217 UnmatchedToken(BeginGroupToken begin) |
| 218 : this.begin = begin, | 218 : this.begin = begin, |
| 219 super(begin.charOffset); | 219 super(begin.charOffset); |
| 220 | 220 |
| 221 String toString() => "UnmatchedToken(${begin.lexeme})"; | 221 String toString() => "UnmatchedToken(${begin.lexeme})"; |
| 222 | 222 |
| 223 String get assertionMessage => "'$begin' isn't closed."; | 223 String get assertionMessage => "'$begin' isn't closed."; |
| 224 | 224 |
| 225 FastaCode get errorCode => codeUnmatchedToken; | 225 FastaCode get errorCode => codeUnmatchedToken; |
| 226 } | 226 } |
| OLD | NEW |