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

Side by Side Diff: pkg/intl/lib/date_format.dart

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 1 month 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 | « pkg/dartdoc/lib/src/mirrors/util.dart ('k') | pkg/intl/lib/src/date_format_field.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) 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 /** 5 /**
6 * DateFormat is for formatting and parsing dates in a locale-sensitive 6 * DateFormat is for formatting and parsing dates in a locale-sensitive
7 * manner. 7 * manner.
8 * It allows the user to choose from a set of standard date time formats as well 8 * It allows the user to choose from a set of standard date time formats as well
9 * as specify a customized pattern under certain locales. Date elements that 9 * as specify a customized pattern under certain locales. Date elements that
10 * vary across locales include month name, week name, field order, etc. 10 * vary across locales include month name, week name, field order, etc.
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 (pattern, parent) => new _DateFormatLiteralField(pattern, parent)]; 526 (pattern, parent) => new _DateFormatLiteralField(pattern, parent)];
527 527
528 /** Parse the template pattern and return a list of field objects.*/ 528 /** Parse the template pattern and return a list of field objects.*/
529 List parsePattern(String pattern) { 529 List parsePattern(String pattern) {
530 if (pattern == null) return null; 530 if (pattern == null) return null;
531 return _reverse(_parsePatternHelper(pattern)); 531 return _reverse(_parsePatternHelper(pattern));
532 } 532 }
533 533
534 /** Recursive helper for parsing the template pattern. */ 534 /** Recursive helper for parsing the template pattern. */
535 List _parsePatternHelper(String pattern) { 535 List _parsePatternHelper(String pattern) {
536 if (pattern.isEmpty()) return []; 536 if (pattern.isEmpty) return [];
537 537
538 var matched = _match(pattern); 538 var matched = _match(pattern);
539 if (matched == null) return []; 539 if (matched == null) return [];
540 540
541 var parsed = _parsePatternHelper( 541 var parsed = _parsePatternHelper(
542 pattern.substring(matched.fullPattern().length)); 542 pattern.substring(matched.fullPattern().length));
543 parsed.add(matched); 543 parsed.add(matched);
544 return parsed; 544 return parsed;
545 } 545 }
546 546
(...skipping 12 matching lines...) Expand all
559 List _reverse(List list) { 559 List _reverse(List list) {
560 // TODO(alanknight): Use standardized list reverse when implemented. 560 // TODO(alanknight): Use standardized list reverse when implemented.
561 // See Issue 2804. 561 // See Issue 2804.
562 var result = new List(); 562 var result = new List();
563 for (var i = list.length-1; i >= 0; i--) { 563 for (var i = list.length-1; i >= 0; i--) {
564 result.addLast(list[i]); 564 result.addLast(list[i]);
565 } 565 }
566 return result; 566 return result;
567 } 567 }
568 } 568 }
OLDNEW
« no previous file with comments | « pkg/dartdoc/lib/src/mirrors/util.dart ('k') | pkg/intl/lib/src/date_format_field.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698