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

Side by Side Diff: dart/frog/leg/scanner/token.dart

Issue 9634008: Introduce element categories and move resolver towards being more compositional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/leg/ssa/builder.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 final int EOF_TOKEN = 0; 5 final int EOF_TOKEN = 0;
6 6
7 final int KEYWORD_TOKEN = $k; 7 final int KEYWORD_TOKEN = $k;
8 final int IDENTIFIER_TOKEN = $a; 8 final int IDENTIFIER_TOKEN = $a;
9 final int DOUBLE_TOKEN = $d; 9 final int DOUBLE_TOKEN = $d;
10 final int INT_TOKEN = $i; 10 final int INT_TOKEN = $i;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bool hasNext() => index < end; 191 bool hasNext() => index < end;
192 int next() => string.charCodeAt(index++); 192 int next() => string.charCodeAt(index++);
193 } 193 }
194 194
195 class BeginGroupToken extends StringToken { 195 class BeginGroupToken extends StringToken {
196 Token endGroup; 196 Token endGroup;
197 BeginGroupToken(PrecedenceInfo info, String value, int charOffset) 197 BeginGroupToken(PrecedenceInfo info, String value, int charOffset)
198 : super(info, value, charOffset); 198 : super(info, value, charOffset);
199 } 199 }
200 200
201 bool isUserDefinableOperator(String value) {
202 return
203 (value === '==') ||
204 (value === '~') ||
205 (value === 'negate') ||
206 (value === '[]') ||
207 (value === '[]=') ||
208 (value === '*') ||
209 (value === '/') ||
210 (value === '%') ||
211 (value === '~/') ||
212 (value === '+') ||
213 (value === '-') ||
214 (value === '<<') ||
215 (value === '>>>') ||
216 (value === '>>') ||
217 (value === '>=') ||
218 (value === '>') ||
219 (value === '<=') ||
220 (value === '<') ||
221 (value === '&') ||
222 (value === '^') ||
223 (value === '|');
224 }
225
201 class PrecedenceInfo { 226 class PrecedenceInfo {
202 final SourceString value; 227 final SourceString value;
203 final int precedence; 228 final int precedence;
204 final int kind; 229 final int kind;
205 230
206 const PrecedenceInfo(this.value, this.precedence, this.kind); 231 const PrecedenceInfo(this.value, this.precedence, this.kind);
207 232
208 toString() => 'PrecedenceInfo($value, $precedence, $kind)'; 233 toString() => 'PrecedenceInfo($value, $precedence, $kind)';
209 } 234 }
210 235
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 final PrecedenceInfo STRING_INTERPOLATION_INFO = 424 final PrecedenceInfo STRING_INTERPOLATION_INFO =
400 const PrecedenceInfo(const SourceString('\${'), 0, 425 const PrecedenceInfo(const SourceString('\${'), 0,
401 STRING_INTERPOLATION_TOKEN); 426 STRING_INTERPOLATION_TOKEN);
402 427
403 final PrecedenceInfo HEXADECIMAL_INFO = 428 final PrecedenceInfo HEXADECIMAL_INFO =
404 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN); 429 const PrecedenceInfo(const SourceString('hexadecimal'), 0, HEXADECIMAL_TOKEN);
405 430
406 // For reporting lexical errors. 431 // For reporting lexical errors.
407 final PrecedenceInfo ERROR_INFO = 432 final PrecedenceInfo ERROR_INFO =
408 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN); 433 const PrecedenceInfo(const SourceString('?'), 0, UNKNOWN_TOKEN);
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698