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

Side by Side Diff: dart/lib/compiler/implementation/scanner/scanner.dart

Issue 10544173: Update partial parser and scanner to be able to skip expressions like "new Map<S, T>()". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 interface Scanner { 5 interface Scanner {
6 Token tokenize(); 6 Token tokenize();
7 } 7 }
8 8
9 /** 9 /**
10 * Common base class for a Dart scanner. 10 * Common base class for a Dart scanner.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 next = advance(); 334 next = advance();
335 if (next === $EQ) { 335 if (next === $EQ) {
336 return select($EQ, BANG_EQ_EQ_INFO, BANG_EQ_INFO); 336 return select($EQ, BANG_EQ_EQ_INFO, BANG_EQ_INFO);
337 } 337 }
338 appendPrecedenceToken(BANG_INFO); 338 appendPrecedenceToken(BANG_INFO);
339 return next; 339 return next;
340 } 340 }
341 341
342 int tokenizeEquals(int next) { 342 int tokenizeEquals(int next) {
343 // = == === 343 // = == ===
344 discardOpenLt();
344 next = advance(); 345 next = advance();
345 if (next === $EQ) { 346 if (next === $EQ) {
346 return select($EQ, EQ_EQ_EQ_INFO, EQ_EQ_INFO); 347 return select($EQ, EQ_EQ_EQ_INFO, EQ_EQ_INFO);
347 } else if (next === $GT) { 348 } else if (next === $GT) {
348 appendPrecedenceToken(FUNCTION_INFO); 349 appendPrecedenceToken(FUNCTION_INFO);
349 return advance(); 350 return advance();
350 } 351 }
351 appendPrecedenceToken(EQ_INFO); 352 appendPrecedenceToken(EQ_INFO);
352 return next; 353 return next;
353 } 354 }
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 charOffset); 762 charOffset);
762 } 763 }
763 } 764 }
764 765
765 class MalformedInputException { 766 class MalformedInputException {
766 final String message; 767 final String message;
767 final position; 768 final position;
768 MalformedInputException(this.message, this.position); 769 MalformedInputException(this.message, this.position);
769 toString() => message; 770 toString() => message;
770 } 771 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698