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

Unified Diff: lib/src/tokenizer_base.dart

Issue 998843003: pkg/csslib: formatting (Closed) Base URL: https://github.com/dart-lang/csslib@master
Patch Set: Created 5 years, 9 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: lib/src/tokenizer_base.dart
diff --git a/lib/src/tokenizer_base.dart b/lib/src/tokenizer_base.dart
index 5501e6c94103d56cb10fe752d031b6f17195fead..7999a8f8603ce1d71e7aace88f9f28f260ea0a33 100644
--- a/lib/src/tokenizer_base.dart
+++ b/lib/src/tokenizer_base.dart
@@ -12,11 +12,11 @@ class TokenizerState {
final bool inSelectorExpression;
final bool inSelector;
- TokenizerState(TokenizerBase base) :
- index = base._index,
- startIndex = base._startIndex,
- inSelectorExpression = base.inSelectorExpression,
- inSelector = base.inSelector;
+ TokenizerState(TokenizerBase base)
+ : index = base._index,
+ startIndex = base._startIndex,
+ inSelectorExpression = base.inSelectorExpression,
+ inSelector = base.inSelector;
}
/**
@@ -141,7 +141,6 @@ abstract class TokenizerBase {
return _finishToken(TokenKind.WHITESPACE);
}
}
-
}
return _finishToken(TokenKind.END_OF_FILE);
}
@@ -181,11 +180,11 @@ abstract class TokenizerBase {
}
static int _hexDigit(int c) {
- if(c >= 48/*0*/ && c <= 57/*9*/) {
+ if (c >= 48 /*0*/ && c <= 57 /*9*/) {
return c - 48;
- } else if (c >= 97/*a*/ && c <= 102/*f*/) {
+ } else if (c >= 97 /*a*/ && c <= 102 /*f*/) {
return c - 87;
- } else if (c >= 65/*A*/ && c <= 70/*F*/) {
+ } else if (c >= 65 /*A*/ && c <= 70 /*F*/) {
return c - 55;
} else {
return -1;
@@ -241,7 +240,7 @@ abstract class TokenizerBase {
}
Token finishNumberExtra(int kind) {
- if (_maybeEatChar(101/*e*/) || _maybeEatChar(69/*E*/)) {
+ if (_maybeEatChar(101 /*e*/) || _maybeEatChar(69 /*E*/)) {
kind = TokenKind.DOUBLE;
_maybeEatChar(TokenKind.MINUS);
_maybeEatChar(TokenKind.PLUS);
@@ -276,8 +275,8 @@ abstract class TokenizerBase {
} else {
s = _text.substring(_startIndex + 2, _index - 1);
}
- return new LiteralToken(TokenKind.STRING,
- _file.span(_startIndex, _index), s);
+ return new LiteralToken(
+ TokenKind.STRING, _file.span(_startIndex, _index), s);
}
Token finishMultilineString(int quote) {
@@ -382,22 +381,22 @@ abstract class TokenizerBase {
final ch = _nextChar();
int hexValue;
switch (ch) {
- case 110/*n*/:
+ case 110 /*n*/ :
return TokenChar.NEWLINE;
- case 114/*r*/:
+ case 114 /*r*/ :
return TokenChar.RETURN;
- case 102/*f*/:
+ case 102 /*f*/ :
return TokenChar.FF;
- case 98/*b*/:
+ case 98 /*b*/ :
return TokenChar.BACKSPACE;
- case 116/*t*/:
+ case 116 /*t*/ :
return TokenChar.TAB;
- case 118/*v*/:
+ case 118 /*v*/ :
return TokenChar.FF;
- case 120/*x*/:
+ case 120 /*x*/ :
hexValue = readHex(2);
break;
- case 117/*u*/:
+ case 117 /*u*/ :
if (_maybeEatChar(TokenChar.LBRACE)) {
hexValue = readHex();
if (!_maybeEatChar(TokenChar.RBRACE)) {
@@ -407,7 +406,8 @@ abstract class TokenizerBase {
hexValue = readHex(4);
}
break;
- default: return ch;
+ default:
+ return ch;
}
if (hexValue == -1) return -1;
@@ -417,7 +417,7 @@ abstract class TokenizerBase {
// are not legal Unicode values.
if (hexValue < 0xD800 || hexValue > 0xDFFF && hexValue <= 0xFFFF) {
return hexValue;
- } else if (hexValue <= 0x10FFFF){
+ } else if (hexValue <= 0x10FFFF) {
messages.error('unicode values greater than 2 bytes not implemented yet',
_file.span(_startIndex, _startIndex + 1));
return -1;

Powered by Google App Engine
This is Rietveld 408576698