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

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

Issue 11184046: Clean up leg.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on CL 11187067 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
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 "dart2jslib.dart";
10 #import("scanner/scannerlib.dart"); 10 import "tree/tree.dart";
11 #import("tree/tree.dart"); 11 import "elements/elements.dart";
12 #import("elements/elements.dart"); 12 import "util/characters.dart";
13 #import("util/characters.dart"); 13 import "scanner/scannerlib.dart" show Token;
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;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 } 179 }
180 // String literal successfully validated. 180 // String literal successfully validated.
181 if (quoting.raw || !containsEscape) { 181 if (quoting.raw || !containsEscape) {
182 // A string without escapes could just as well have been raw. 182 // A string without escapes could just as well have been raw.
183 return new DartString.rawString(string, length); 183 return new DartString.rawString(string, length);
184 } 184 }
185 return new DartString.escapedString(string, length); 185 return new DartString.escapedString(string, length);
186 } 186 }
187 } 187 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/ssa/tracer.dart ('k') | dart/lib/compiler/implementation/types/concrete_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698