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

Side by Side Diff: pkg/front_end/lib/src/scanner/string_utilities.dart

Issue 2486873003: Move scanner into pkg/front_end/lib/src/scanner. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library front_end.src.scanner.string_utilities;
6
7 import 'package:front_end/src/scanner/interner.dart';
8
9 class StringUtilities {
10 static Interner INTERNER = new NullInterner();
11
12 static bool endsWith3(String str, int c1, int c2, int c3) {
Brian Wilkerson 2016/11/08 20:53:24 We might want to verify that these methods are sti
13 var length = str.length;
14 return length >= 3 &&
15 str.codeUnitAt(length - 3) == c1 &&
16 str.codeUnitAt(length - 2) == c2 &&
17 str.codeUnitAt(length - 1) == c3;
18 }
19
20 static String intern(String string) => INTERNER.intern(string);
21
22 static bool startsWith3(String str, int start, int c1, int c2, int c3) {
23 return str.length - start >= 3 &&
24 str.codeUnitAt(start) == c1 &&
25 str.codeUnitAt(start + 1) == c2 &&
26 str.codeUnitAt(start + 2) == c3;
27 }
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698