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

Unified Diff: sdk/lib/_internal/compiler/implementation/scanner/keyword.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart b/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
index 4a23d73cc6db11ca68dc1f754ea2bee6e3b9d70f..3a6db1151f137b8f0c5168231d1237ed72c30a7d 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/keyword.dart
@@ -7,7 +7,7 @@ part of scanner;
/**
* A keyword in the Dart programming language.
*/
-class Keyword implements SourceString {
+class Keyword extends Iterable<int> implements SourceString {
static const List<Keyword> values = const <Keyword> [
const Keyword("assert"),
const Keyword("break"),
@@ -102,7 +102,7 @@ class Keyword implements SourceString {
return other is SourceString && toString() == other.slowToString();
}
- Iterator<int> iterator() => new StringCodeIterator(syntax);
+ Iterator<int> get iterator => new StringCodeIterator(syntax);
void printOn(StringBuffer sb) {
sb.add(syntax);
@@ -132,7 +132,8 @@ abstract class KeywordState {
static KeywordState _KEYWORD_STATE;
static KeywordState get KEYWORD_STATE {
if (_KEYWORD_STATE == null) {
- List<String> strings = new List<String>(Keyword.values.length);
+ List<String> strings =
+ new List<String>.fixedLength(Keyword.values.length);
for (int i = 0; i < Keyword.values.length; i++) {
strings[i] = Keyword.values[i].syntax;
}
@@ -144,7 +145,7 @@ abstract class KeywordState {
static KeywordState computeKeywordStateTable(int start, List<String> strings,
int offset, int length) {
- List<KeywordState> result = new List<KeywordState>(26);
+ List<KeywordState> result = new List<KeywordState>.fixedLength(26);
assert(length != 0);
int chunk = 0;
int chunkStart = -1;

Powered by Google App Engine
This is Rietveld 408576698