Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/error_token.dart

Issue 2866973005: align fasta.Token and analyzer.Token (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/token.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 type => 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;
77
78 bool get isIdentifier => false; 76 bool get isIdentifier => false;
79 77
80 String get assertionMessage; 78 String get assertionMessage;
81 79
82 FastaCode get errorCode; 80 FastaCode get errorCode;
83 81
84 int get character => null; 82 int get character => null;
85 83
86 String get start => null; 84 String get start => null;
87 85
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 UnmatchedToken(BeginGroupToken begin) 215 UnmatchedToken(BeginGroupToken begin)
218 : this.begin = begin, 216 : this.begin = begin,
219 super(begin.charOffset); 217 super(begin.charOffset);
220 218
221 String toString() => "UnmatchedToken(${begin.lexeme})"; 219 String toString() => "UnmatchedToken(${begin.lexeme})";
222 220
223 String get assertionMessage => "'$begin' isn't closed."; 221 String get assertionMessage => "'$begin' isn't closed.";
224 222
225 FastaCode get errorCode => codeUnmatchedToken; 223 FastaCode get errorCode => codeUnmatchedToken;
226 } 224 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698