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

Side by Side Diff: pkg/front_end/lib/src/fasta/quote.dart

Issue 2915123002: Improve position information. (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 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 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 library fasta.quote; 5 library fasta.quote;
6 6
7 import 'errors.dart' show inputError, internalError; 7 import 'errors.dart' show inputError, internalError;
8 8
9 import 'scanner/characters.dart' 9 import 'scanner/characters.dart'
10 show 10 show
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 case Quote.RawSingle: 153 case Quote.RawSingle:
154 case Quote.RawDouble: 154 case Quote.RawDouble:
155 return string; 155 return string;
156 156
157 case Quote.RawMultiLineSingle: 157 case Quote.RawMultiLineSingle:
158 case Quote.RawMultiLineDouble: 158 case Quote.RawMultiLineDouble:
159 return !string.contains("\r") 159 return !string.contains("\r")
160 ? string 160 ? string
161 : unescapeCodeUnits(string.codeUnits, true); 161 : unescapeCodeUnits(string.codeUnits, true);
162 } 162 }
163 return internalError("Unhandled string quote: $quote"); 163 return internalError("Internal error: Unexpected quote: $quote.");
164 } 164 }
165 165
166 const String incompleteSequence = "Incomplete escape sequence."; 166 const String incompleteSequence = "Incomplete escape sequence.";
167 167
168 const String invalidCharacter = "Invalid character in escape sequence."; 168 const String invalidCharacter = "Invalid character in escape sequence.";
169 169
170 const String invalidCodePoint = "Invalid code point."; 170 const String invalidCodePoint = "Invalid code point.";
171 171
172 // Note: based on 172 // Note: based on
173 // [StringValidator.validateString](pkg/compiler/lib/src/string_validator.dart). 173 // [StringValidator.validateString](pkg/compiler/lib/src/string_validator.dart).
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 } else { 246 } else {
247 // Nothing, escaped character is passed through; 247 // Nothing, escaped character is passed through;
248 } 248 }
249 if (code > 0x10FFFF) return error(i, invalidCodePoint); 249 if (code > 0x10FFFF) return error(i, invalidCodePoint);
250 } 250 }
251 result[resultOffset++] = code; 251 result[resultOffset++] = code;
252 } 252 }
253 return new String.fromCharCodes(result, 0, resultOffset); 253 return new String.fromCharCodes(result, 0, resultOffset);
254 } 254 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698