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

Side by Side Diff: src/dateparser.h

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 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 | « src/date.cc ('k') | src/dateparser.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_DATEPARSER_H_ 5 #ifndef V8_DATEPARSER_H_
6 #define V8_DATEPARSER_H_ 6 #define V8_DATEPARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/char-predicates-inl.h" 9 #include "src/char-predicates-inl.h"
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 bool IsUnknown() { return tag_ == kUnknownTokenTag; } 144 bool IsUnknown() { return tag_ == kUnknownTokenTag; }
145 bool IsNumber() { return tag_ == kNumberTag; } 145 bool IsNumber() { return tag_ == kNumberTag; }
146 bool IsSymbol() { return tag_ == kSymbolTag; } 146 bool IsSymbol() { return tag_ == kSymbolTag; }
147 bool IsWhiteSpace() { return tag_ == kWhiteSpaceTag; } 147 bool IsWhiteSpace() { return tag_ == kWhiteSpaceTag; }
148 bool IsEndOfInput() { return tag_ == kEndOfInputTag; } 148 bool IsEndOfInput() { return tag_ == kEndOfInputTag; }
149 bool IsKeyword() { return tag_ >= kKeywordTagStart; } 149 bool IsKeyword() { return tag_ >= kKeywordTagStart; }
150 150
151 int length() { return length_; } 151 int length() { return length_; }
152 152
153 int number() { 153 int number() {
154 ASSERT(IsNumber()); 154 DCHECK(IsNumber());
155 return value_; 155 return value_;
156 } 156 }
157 KeywordType keyword_type() { 157 KeywordType keyword_type() {
158 ASSERT(IsKeyword()); 158 DCHECK(IsKeyword());
159 return static_cast<KeywordType>(tag_); 159 return static_cast<KeywordType>(tag_);
160 } 160 }
161 int keyword_value() { 161 int keyword_value() {
162 ASSERT(IsKeyword()); 162 DCHECK(IsKeyword());
163 return value_; 163 return value_;
164 } 164 }
165 char symbol() { 165 char symbol() {
166 ASSERT(IsSymbol()); 166 DCHECK(IsSymbol());
167 return static_cast<char>(value_); 167 return static_cast<char>(value_);
168 } 168 }
169 bool IsSymbol(char symbol) { 169 bool IsSymbol(char symbol) {
170 return IsSymbol() && this->symbol() == symbol; 170 return IsSymbol() && this->symbol() == symbol;
171 } 171 }
172 bool IsKeywordType(KeywordType tag) { 172 bool IsKeywordType(KeywordType tag) {
173 return tag_ == tag; 173 return tag_ == tag;
174 } 174 }
175 bool IsFixedLengthNumber(int length) { 175 bool IsFixedLengthNumber(int length) {
176 return IsNumber() && length_ == length; 176 return IsNumber() && length_ == length;
177 } 177 }
178 bool IsAsciiSign() { 178 bool IsAsciiSign() {
179 return tag_ == kSymbolTag && (value_ == '-' || value_ == '+'); 179 return tag_ == kSymbolTag && (value_ == '-' || value_ == '+');
180 } 180 }
181 int ascii_sign() { 181 int ascii_sign() {
182 ASSERT(IsAsciiSign()); 182 DCHECK(IsAsciiSign());
183 return 44 - value_; 183 return 44 - value_;
184 } 184 }
185 bool IsKeywordZ() { 185 bool IsKeywordZ() {
186 return IsKeywordType(TIME_ZONE_NAME) && length_ == 1 && value_ == 0; 186 return IsKeywordType(TIME_ZONE_NAME) && length_ == 1 && value_ == 0;
187 } 187 }
188 bool IsUnknown(int character) { 188 bool IsUnknown(int character) {
189 return IsUnknown() && value_ == character; 189 return IsUnknown() && value_ == character;
190 } 190 }
191 // Factory functions. 191 // Factory functions.
192 static DateToken Keyword(KeywordType tag, int value, int length) { 192 static DateToken Keyword(KeywordType tag, int value, int length) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 DateStringTokenizer<Char>* scanner, 377 DateStringTokenizer<Char>* scanner,
378 DayComposer* day, 378 DayComposer* day,
379 TimeComposer* time, 379 TimeComposer* time,
380 TimeZoneComposer* tz); 380 TimeZoneComposer* tz);
381 }; 381 };
382 382
383 383
384 } } // namespace v8::internal 384 } } // namespace v8::internal
385 385
386 #endif // V8_DATEPARSER_H_ 386 #endif // V8_DATEPARSER_H_
OLDNEW
« no previous file with comments | « src/date.cc ('k') | src/dateparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698