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

Side by Side Diff: pkg/compiler/lib/src/tokens/token.dart

Issue 1678043003: Add Dart code to diff_view (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update status. Created 4 years, 10 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 | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/js_ast/lib/src/nodes.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 library dart2js.tokens; 5 library dart2js.tokens;
6 6
7 import 'dart:convert' show 7 import 'dart:convert' show
8 UTF8; 8 UTF8;
9 import 'dart:collection' show 9 import 'dart:collection' show
10 HashSet; 10 HashSet;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 int get charCount { 105 int get charCount {
106 if (info == Precedence.BAD_INPUT_INFO) { 106 if (info == Precedence.BAD_INPUT_INFO) {
107 // This is a token that wraps around an error message. Return 1 107 // This is a token that wraps around an error message. Return 1
108 // instead of the size of the length of the error message. 108 // instead of the size of the length of the error message.
109 return 1; 109 return 1;
110 } else { 110 } else {
111 return value.length; 111 return value.length;
112 } 112 }
113 } 113 }
114 114
115 /// The character offset of the end of this token within the source text.
116 int get charEnd => charOffset + charCount;
117
115 int get hashCode => computeHashCode(charOffset, info, value); 118 int get hashCode => computeHashCode(charOffset, info, value);
116 } 119 }
117 120
118 /// A pair of tokens marking the beginning and the end of a span. Use for error 121 /// A pair of tokens marking the beginning and the end of a span. Use for error
119 /// reporting. 122 /// reporting.
120 class TokenPair implements Spannable { 123 class TokenPair implements Spannable {
121 final Token begin; 124 final Token begin;
122 final Token end; 125 final Token end;
123 126
124 TokenPair(this.begin, this.end); 127 TokenPair(this.begin, this.end);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 (identical(value, '<=')) || 434 (identical(value, '<=')) ||
432 (identical(value, '<')) || 435 (identical(value, '<')) ||
433 (identical(value, '&')) || 436 (identical(value, '&')) ||
434 (identical(value, '^')) || 437 (identical(value, '^')) ||
435 (identical(value, '|')); 438 (identical(value, '|'));
436 } 439 }
437 440
438 bool isTernaryOperator(String value) => identical(value, '[]='); 441 bool isTernaryOperator(String value) => identical(value, '[]=');
439 442
440 bool isMinusOperator(String value) => identical(value, '-'); 443 bool isMinusOperator(String value) => identical(value, '-');
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/nodes.dart ('k') | pkg/js_ast/lib/src/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698