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

Unified Diff: frog/tokenizer.dart

Issue 9151015: addressing 3 previous review comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 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
« no previous file with comments | « frog/minfrog ('k') | frog/value.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tokenizer.dart
diff --git a/frog/tokenizer.dart b/frog/tokenizer.dart
index f19210a8f299ed1737a0e03d6526388f8330303d..98c8a8ab1b13b4200e58341adb3036c60c7263de 100644
--- a/frog/tokenizer.dart
+++ b/frog/tokenizer.dart
@@ -266,11 +266,9 @@ class TokenizerBase extends TokenizerHelpers implements TokenSource {
String s;
if (isMultiline) {
// Skip initial newline in multiline strings
- if (_source.text[_startIndex + 4] == '\n') {
- s = _source.text.substring(_startIndex + 5, _index - 3);
- } else {
- s = _source.text.substring(_startIndex + 4, _index - 3);
- }
+ int start = _startIndex + 4;
+ if (_source.text[start] == '\n') start++;
+ s = _source.text.substring(start, _index - 3);
} else {
s = _source.text.substring(_startIndex + 2, _index - 1);
}
@@ -278,7 +276,7 @@ class TokenizerBase extends TokenizerHelpers implements TokenSource {
}
Token finishMultilineString(int quote) {
- var buf = new List<int>();
+ var buf = <int>[];
while (true) {
int ch = _nextChar();
if (ch == 0) {
@@ -346,7 +344,7 @@ class TokenizerBase extends TokenizerHelpers implements TokenSource {
if (_maybeEatChar(quote)) {
return finishMultilineRawString(quote);
} else {
- return _makeStringToken(new List<int>(), false);
+ return _makeStringToken(<int>[], false);
}
}
while (true) {
« no previous file with comments | « frog/minfrog ('k') | frog/value.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698