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

Side by Side Diff: lib/compiler/implementation/string_validator.dart

Issue 10993059: Stop using the Hashable interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Another space removed. Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Check the validity of string literals. 5 // Check the validity of string literals.
6 6
7 #library("stringvalidator"); 7 #library("stringvalidator");
8 8
9 #import("leg.dart"); 9 #import("leg.dart");
10 #import("scanner/scannerlib.dart"); 10 #import("scanner/scannerlib.dart");
11 #import("tree/tree.dart"); 11 #import("tree/tree.dart");
12 #import("elements/elements.dart"); 12 #import("elements/elements.dart");
13 #import("util/characters.dart"); 13 #import("util/characters.dart");
14 14
15 class StringValidator { 15 class StringValidator {
16 final DiagnosticListener listener; 16 final DiagnosticListener listener;
17 17
18 StringValidator(this.listener); 18 StringValidator(this.listener);
19 19
20 DartString validateQuotedString(Token token) { 20 DartString validateQuotedString(Token token) {
21 SourceString source = token.value; 21 SourceString source = token.value;
22 StringQuoting quoting = quotingFromString(source); 22 StringQuoting quoting = quotingFromString(source);
23 int leftQuote = quoting.leftQuoteLength; 23 int leftQuote = quoting.leftQuoteLength;
24 int rightQuote = quoting.rightQuoteLength; 24 int rightQuote = quoting.rightQuoteLength;
25 SourceString content = source.copyWithoutQuotes(leftQuote, rightQuote); 25 SourceString content = source.copyWithoutQuotes(leftQuote, rightQuote);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 } 180 }
181 // String literal successfully validated. 181 // String literal successfully validated.
182 if (quoting.raw || !containsEscape) { 182 if (quoting.raw || !containsEscape) {
183 // A string without escapes could just as well have been raw. 183 // A string without escapes could just as well have been raw.
184 return new DartString.rawString(string, length); 184 return new DartString.rawString(string, length);
185 } 185 }
186 return new DartString.escapedString(string, length); 186 return new DartString.escapedString(string, length);
187 } 187 }
188 } 188 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698