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

Unified Diff: utils/css/tokenizer.dart

Issue 10170008: fixes css tests, now they can also run in browsers too. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils/css/tokenizer_base.dart » ('j') | utils/tests/css/src/DeclarationTest.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/css/tokenizer.dart
diff --git a/utils/css/tokenizer.dart b/utils/css/tokenizer.dart
index 40fd362b7298a95d7a8ef36b5ce666baacda4921..d6455190e589eda3c3b20a881f1c07f0cd21d70f 100644
--- a/utils/css/tokenizer.dart
+++ b/utils/css/tokenizer.dart
@@ -158,7 +158,7 @@ class Tokenizer extends CSSTokenizerBase {
default:
if (TokenizerHelpers.isIdentifierStart(ch)) {
return this.finishIdentifier(ch);
- } else if (isDigit(ch)) {
+ } else if (TokenizerHelpers.isDigit(ch)) {
return this.finishNumber();
} else {
return _errorToken();
@@ -177,7 +177,8 @@ class Tokenizer extends CSSTokenizerBase {
int tokId = TokenKind.matchUnits(_text, _startIndex, _index - _startIndex);
if (tokId == -1) {
// No, is it a directive?
- tokId = TokenKind.matchDirectives(_text, _startIndex, _index - _startIndex);
+ tokId = TokenKind.matchDirectives(
+ _text, _startIndex, _index - _startIndex);
}
if (tokId == -1) {
tokId = (_text.substring(_startIndex, _index) == '!important') ?
@@ -219,7 +220,7 @@ class Tokenizer extends CSSTokenizerBase {
if (_peekChar() == 46/*.*/) {
// Handle the case of 1.toString().
_nextChar();
- if (isDigit(_peekChar())) {
+ if (TokenizerHelpers.isDigit(_peekChar())) {
eatDigits();
return _finishToken(TokenKind.DOUBLE);
} else {
@@ -231,7 +232,8 @@ class Tokenizer extends CSSTokenizerBase {
}
bool maybeEatDigit() {
- if (_index < _text.length && isDigit(_text.charCodeAt(_index))) {
+ if (_index < _text.length
+ && TokenizerHelpers.isDigit(_text.charCodeAt(_index))) {
_index += 1;
return true;
}
@@ -240,7 +242,7 @@ class Tokenizer extends CSSTokenizerBase {
void eatHexDigits() {
while (_index < _text.length) {
- if (isHexDigit(_text.charCodeAt(_index))) {
+ if (TokenizerHelpers.isHexDigit(_text.charCodeAt(_index))) {
_index += 1;
} else {
return;
@@ -249,7 +251,8 @@ class Tokenizer extends CSSTokenizerBase {
}
bool maybeEatHexDigit() {
- if (_index < _text.length && isHexDigit(_text.charCodeAt(_index))) {
+ if (_index < _text.length
+ && TokenizerHelpers.isHexDigit(_text.charCodeAt(_index))) {
_index += 1;
return true;
}
@@ -301,19 +304,12 @@ class TokenizerHelpers {
}
static bool isHexDigit(int c) {
- return (isDigit(c) || (c >= 97/*a*/ && c <= 102/*f*/) || (c >= 65/*A*/ && c <= 70/*F*/));
- }
-
- static bool isWhitespace(int c) {
- return (c == 32/*' '*/ || c == 9/*'\t'*/ || c == 10/*'\n'*/ || c == 13/*'\r'*/);
+ return (isDigit(c) || (c >= 97/*a*/ && c <= 102/*f*/)
+ || (c >= 65/*A*/ && c <= 70/*F*/));
}
static bool isIdentifierPart(int c) {
return (isIdentifierStart(c) || isDigit(c) || c == 45 /*-*/);
}
-
- static bool isInterpIdentifierPart(int c) {
- return (isIdentifierStart(c) || isDigit(c));
- }
}
« no previous file with comments | « no previous file | utils/css/tokenizer_base.dart » ('j') | utils/tests/css/src/DeclarationTest.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698