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

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

Issue 10001008: Many type fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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) 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 /** 5 /**
6 * A keyword in the Dart programming language. 6 * A keyword in the Dart programming language.
7 */ 7 */
8 class Keyword implements SourceString { 8 class Keyword implements SourceString {
9 static final Keyword BREAK = const Keyword("break"); 9 static final Keyword BREAK = const Keyword("break");
10 static final Keyword CASE = const Keyword("case"); 10 static final Keyword CASE = const Keyword("case");
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 Iterator<int> iterator() => new StringCodeIterator(syntax); 132 Iterator<int> iterator() => new StringCodeIterator(syntax);
133 133
134 void printOn(StringBuffer sb) { 134 void printOn(StringBuffer sb) {
135 sb.add(syntax); 135 sb.add(syntax);
136 } 136 }
137 137
138 String toString() => syntax; 138 String toString() => syntax;
139 String slowToString() => syntax; 139 String slowToString() => syntax;
140 String get stringValue() => syntax; 140 String get stringValue() => syntax;
141 141
142 SourceString copyWithoutQuotes(int initial, int terminal) {
143 // TODO(lrn): consider remodelling to avoid having this method in keywords.
144 throw new InternalError(
145 "copyWithouQuotes should never be called on keywords");
kasperl 2012/04/16 13:10:46 Withou -> Without. Would it be terrible to just re
floitsch 2012/04/16 13:57:57 Done.
146 }
147
142 bool isEmpty() => false; 148 bool isEmpty() => false;
143 bool isPrivate() => false; 149 bool isPrivate() => false;
144 } 150 }
145 151
146 /** 152 /**
147 * Abstract state in a state machine for scanning keywords. 153 * Abstract state in a state machine for scanning keywords.
148 */ 154 */
149 class KeywordState { 155 class KeywordState {
150 abstract bool isLeaf(); 156 abstract bool isLeaf();
151 abstract KeywordState next(int c); 157 abstract KeywordState next(int c);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 final Keyword keyword; 252 final Keyword keyword;
247 253
248 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 254 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
249 255
250 bool isLeaf() => true; 256 bool isLeaf() => true;
251 257
252 KeywordState next(int c) => null; 258 KeywordState next(int c) => null;
253 259
254 String toString() => keyword.syntax; 260 String toString() => keyword.syntax;
255 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698