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

Unified Diff: pkg/compiler/lib/src/scanner/string_scanner.dart

Issue 693183006: Revert "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
« no previous file with comments | « pkg/compiler/lib/src/scanner/scannerlib.dart ('k') | pkg/compiler/lib/src/scanner/token.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/scanner/string_scanner.dart
diff --git a/pkg/compiler/lib/src/scanner/string_scanner.dart b/pkg/compiler/lib/src/scanner/string_scanner.dart
deleted file mode 100644
index 5a30e433cb4feed7fc3755da998ae1ddaa88a1be..0000000000000000000000000000000000000000
--- a/pkg/compiler/lib/src/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;
-}
« no previous file with comments | « pkg/compiler/lib/src/scanner/scannerlib.dart ('k') | pkg/compiler/lib/src/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698