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

Unified Diff: sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart

Issue 694353007: Move dart2js from sdk/lib/_internal/compiler to pkg/compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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: sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart b/sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart
deleted file mode 100644
index 5a30e433cb4feed7fc3755da998ae1ddaa88a1be..0000000000000000000000000000000000000000
--- a/sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of scanner;
-
-/**
- * Scanner that reads from a String and creates tokens that points to
- * substrings.
- */
-class StringScanner extends ArrayBasedScanner {
- /** The file content. */
- String string;
-
- /** The current offset in [string]. */
- int scanOffset = -1;
-
- StringScanner(SourceFile file, {bool includeComments: false})
- : string = file.slowText(),
- super(file, includeComments) {
- ensureZeroTermination();
- }
-
- StringScanner.fromString(this.string, {bool includeComments: false})
- : super(null, includeComments) {
- ensureZeroTermination();
- }
-
- void ensureZeroTermination() {
- if (string.isEmpty || string.codeUnitAt(string.length - 1) != 0) {
- // TODO(lry): abort instead of copying the array, or warn?
- string = string + '\x00';
- }
- }
-
- int advance() => string.codeUnitAt(++scanOffset);
- int peek() => string.codeUnitAt(scanOffset + 1);
-
- int get stringOffset => scanOffset;
-
- int currentAsUnicode(int next) => next;
-
- void handleUnicode(int startScanOffset) { }
-
- Token firstToken() => tokens.next;
- Token previousToken() => tail;
-
- void appendSubstringToken(PrecedenceInfo info, int start,
- bool asciiOnly, [int extraOffset = 0]) {
- tail.next = new StringToken.fromSubstring(info, string, start,
- scanOffset + extraOffset, tokenStart, canonicalize: true);
- tail = tail.next;
- }
-
- bool atEndOfFile() => scanOffset >= string.length - 1;
-}

Powered by Google App Engine
This is Rietveld 408576698